1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CtcoxVkL.js","assets/versionProvider-BLaKWEOB.js","assets/index-ByIcGKUX.js","assets/versionProvider-6w9vuoFV.css","assets/useQuery-DGVh7Xho.js","assets/dialog-BZgb3TVt.js","assets/shared-DxjqqMQm.js","assets/index-rfwHk5oe.js","assets/rrweb-plugin-console-record-r1VHf89Q.js","assets/rrweb-record-DbaPEZ8K.js","assets/observers-Ce9A8Dyt.js","assets/core-D1v2liPP.js","assets/index.es-6IMa61ad.js","assets/lit-element-CdVIWKih.js","assets/index-UcNF_JDy.js","assets/p256-CyssckWy.js","assets/nonceManager-D_3EIYKz.js","assets/parseSignature-BJdqfZAH.js","assets/index-DgTijNFR.js","assets/startAuthentication-5_BAlMG9.js","assets/TurnstileWrapper-D0ULIRQd-CUZGiUSo.js","assets/HCaptchaWrapper-CUi9LJsp-BPg1ZzBq.js","assets/assertThisInitialized-DIFuz7Pv.js","assets/AccountNotFoundScreen-D_g_37og-BVYmDI-2.js","assets/ScreenLayout-rsaLrlHW-B6TQo_HZ.js","assets/ModalHeader-CPVs-20G-jZ010fFO.js","assets/Screen-CkHwbpUl-DHEtZi_h.js","assets/index-Dq_xe9dz-EO7rGlv3.js","assets/createLucideIcon-BN3dI5hj.js","assets/AddFundsSelectionScreen-CN9oRQgJ-B9w7cb_c.js","assets/styles-DVyDvTdj-CIniSxVF.js","assets/styles-B5IHPi7e-M4woZyn0.js","assets/credit-card-CAVvO5iY.js","assets/AffirmativeConsentScreen-wOWvmEm9-B5yhn2Uj.js","assets/shouldProceedtoEmbeddedWalletCreationFlow-DI14BPMB-44sPFbeq.js","assets/external-link-Ug_b9jqj.js","assets/AllowlistRejectionScreen-DLOb1IbL-mNg83ozg.js","assets/safe-url-D7SRPu33-A8zMgOTd.js","assets/lock-D80YGvnE.js","assets/AuthenticateWithWalletScreen-CxmVXCpq-BzuPboux.js","assets/ConnectWalletView-D9H4KAsY-3bhuiTk3.js","assets/CopyableText-CQapvaMr-Ow9PyuFr.js","assets/check-5OUyV91L.js","assets/copy-efPM2vki.js","assets/Link-DJ5gq9Di-B_MWUX34.js","assets/QrCode-pKF9uy8S-D1yMeNMi.js","assets/browser-CYAfahY6.js","assets/dijkstra-D_NXgYpA.js","assets/EmailInputForm-Dgoii4vf-BUA6PbwB.js","assets/ErrorMessage-D8VaAP5m-BfaR2ufy.js","assets/useI18n-CVYvkpfD-CvmF3t-6.js","assets/WalletCards-DH1rqayz-TUcV3Bqd.js","assets/AwaitingEvmToSolBridgingScreen-C0EGoPz7-BmxaQu6G.js","assets/CheckCircleIcon-B9ccdQxm.js","assets/Layouts-BlFm53ED-BK7vIBFw.js","assets/ScreenHeader-CHmc4-Lu-KUILlFMn.js","assets/FundWalletMethodHeader-m-pFuAXa-BdkvX21y.js","assets/useGetTokenPrice-Ct66jFo_-oB_lT4xm.js","assets/useGetSolPrice-x7gfUIHJ-Yt_4YlRc.js","assets/analytics-mkkvFRju-DOXuftJB.js","assets/reservoir-B7XIq5qj-DqjCgrbp.js","assets/getChainName-DjpPdUSc-c2urPd0g.js","assets/transaction-CnfuREWo-gT2-iQmg.js","assets/getFormattedUsdFromLamports-B6EqSEho-C-HCdwKa.js","assets/BridgeNetworkSelectionView-DBLCeP_R-BMjCrtGr.js","assets/getErc20Balance-DHgWH7_1-DYZrwFYY.js","assets/Value-tcJV9e0L-C2Y-91XC.js","assets/LoadingSkeleton-U6-3yFwI-BD41ivYp.js","assets/Subtitle-CV-2yKE4-Dpbbv0-G.js","assets/Title-BnzYV3Is-eegnQIRA.js","assets/WalletIcon-BxzEcomw.js","assets/Chip-D2-wZOHJ-DzqKOoYk.js","assets/TransferOrBridgeLoadingScreen-Van-cEJi-D2rbOmuZ.js","assets/InjectedWalletIcon-DLcYOGDj-MQj4nAwL.js","assets/Address-D7Y56HDo-Bhgbp-US.js","assets/GlobeAltIcon-CFp6_8Ls.js","assets/shared-FM0rljBt-BOS9ehw7.js","assets/ChevronDownIcon-CMJ-jinL.js","assets/formatErc20TokenAmount-BuPk9xcy-CkAr4Oc0.js","assets/ethers-D2sLCm5q-DXaklmTj.js","assets/styles-DSRYEpcK-BLhBiarI.js","assets/LinkPasskeyScreen-CHBFSg9m-CGbWzJc1.js","assets/TodoList-CgrU7uwu-0oiRHhsa.js","assets/x-CZjD_3ZC.js","assets/circle-check-big-BaNgQcN7.js","assets/fingerprint-pattern-DExhvNRr.js","assets/floating-ui.react-CrEzHlih.js","assets/AwaitingExternalEthereumTransferScreen-eMz3y86s-Dyr15jKQ.js","assets/transfer-6YztDh-t-
1DU6hH7CZ.js","assets/AwaitingPasswordlessCodeScreen-BVDX5cd4-DguVCUvE.js","assets/EnvelopeIcon-DvyN6M4z.js","assets/PhoneIcon-Cw2xvPna.js","assets/AwaitingSolToEvmBridgingScreen-Cy6IPwXH-CkTlMXGk.js","assets/CaptchaScreen-CF3tpDFb-DIwIUsVK.js","assets/circle-x-DtD9noYx.js","assets/CoinbaseOnrampStatusScreen-bKnFMDb2-zYozmDgm.js","assets/ArrowsRightLeftIcon-D_BO17_5.js","assets/CheckCircleIcon-D7SS8iZm.js","assets/ConnectLedgerScreen-BGC0DzYt-u_WQqQhf.js","assets/ConnectOnlyLandingScreen-WzTDnspN-C0isOXZM.js","assets/ConnectOnlyStatusScreen-BAuJPlKk-BILUMvyf.js","assets/ConnectionStatusScreen-BLO0eB_B-kn1rOHAE.js","assets/ConnectOrCreateScreen-32lhgmi8-DM-N2EU1.js","assets/CustomLandingScreenView-Ci1tXtvJ-qHjubjk9.js","assets/ConnectEmailForm-CxD45xi9-DCoJBRX3.js","assets/mail-CtRi364R.js","assets/farcaster-DPlSjvF5-BeChlTQ5.js","assets/FingerPrintIcon-Dox6H9YL.js","assets/ConnectPhoneForm-BX_3-4-1-SOB3aiS0.js","assets/twitch-5IOe4sIQ-Jct5P36p.js","assets/telegram-B-JqnkqZ-BjCECNxM.js","assets/WalletOverflowButton-Dwyk--Rf-CyfY9Ium.js","assets/wallet-DK3cLzL1.js","assets/smartphone-CEMkrXeA.js","assets/CrossAppAuthScreen-YjAcLBV2-D9PBN8cT.js","assets/DelegatedActionsConsentScreen-DPBY1dWo-CKid6tvW.js","assets/WalletInfoCard-Dp8VxL-P-BtaRdAiT.js","assets/LabelXs-oqZNqbm_-DDXYQZhN.js","assets/circle-alert-Kx8Pari9.js","assets/DelegatedActionsRevokeScreen-D1iywhe4-Db1QjDHU.js","assets/DepositAddressScreen-CI4eYwCb-DkVSTJgH.js","assets/triangle-alert-BmNH1LPW.js","assets/hourglass-Dt_kBITc.js","assets/chevron-down-BwIY1BSC.js","assets/EmbeddedWalletConnectingScreen-CluhExWV-BuAL-YDx.js","assets/EmbeddedWalletCreatedScreen-wlqUDU6d-EQ7OXFVU.js","assets/EmbeddedWalletKeyExportScreen-k5tP_eze-DrP8wII4.js","assets/WarningBanner-ZZqCEtZK-U_cgR3J8.js","assets/ExclamationTriangleIcon-Hv_TEuGx.js","assets/EmbeddedWalletOnAccountCreateScreen-BK8tw3Mj-CzMNQ6Is.js","assets/RecoveryPasswordCreateScreen-BPddw-Ex-D5eWmCKc.js","assets/SetWalletPasswordForm-BrpgY8QY-BRq6q-03.js","assets/shared-BsXn-8Cz-B2z7I5Ny.js","assets/Checkbox-BhNoOKjX-C4_7gbXo.js","assets/EmbeddedWalletPasswordUpdateScreen-D1jshO-6-D_Zux6WN.js","assets/EmbeddedWalletPasswordUpdateSplashScreen-BuriarnO-87vdts6i.js","assets/ErrorScreen-76JNrXJI-Op_velT8.js","assets/FarcasterConnectStatusScreen-BPIu1e7P-PFdv0BvL.js","assets/OpenLink-DZHy38vr-AtnJapKJ.js","assets/FarcasterSignerStatusScreen-D2iryUpj-BdH7I0Vk.js","assets/CopyToClipboard-DSTf_eKU-UsFi_SPD.js","assets/FiatOnrampScreen-B9Pz4dX6-viSrTgkm.js","assets/SelectSourceAsset-BwP1mgC4-yPdNF1KN.js","assets/InfoBanner-Jwk3Xf3U-CZnSnhcV.js","assets/GooglePay-DA-Ff7zK-B3-fHKuR.js","assets/with-selector-nhXHLSfA.js","assets/FundSolWalletWithExternalSolanaWallet-DZFgn3SS-DicDR89j.js","assets/useSolanaRpcClient-YRdCx1J_-DCJhQj7K.js","assets/getUsdcMintAddress-DFI1hv05-Dhc3f3lk.js","assets/FundWithBankDepositScreen-EpAb2AKB-gjqhc6Ms.js","assets/FundingEditAmountScreen-wjiqcj9O-NpMgdoHd.js","assets/FundingMethodSelectionScreen-F_73hpQK-DgFrNKwD.js","assets/ErrorBanner-BcpGRt0h-CbLM6rgB.js","assets/ExclamationCircleIcon-BgDxFNt6.js","assets/getErc20TokenInfo-DdZupEXp-Cekch4lC.js","assets/index-CdOhMHEP-DFBP0ScU.js","assets/InAppBrowserLoginNotPossible-B0hwYzXz-CEpC27QG.js","assets/InstallWalletScreen-DYqE-pP8-cddslAeL.js","assets/LandingScreen-rp9tgEMx-C2dSIerm.js","assets/LinkConflictScreen-Cs5NA-I0-B5cEpde4.js","assets/StackedContainer-B2vaEl56-iGSdd5x5.js","assets/capitalizeFirstLetter-DmLYqXsO-tV1Idewc.js","assets/LinkEmailScreen-CtlhwdAH-XHH1tqoU.js","assets/LinkPhoneScreen-dj3rzgJQ-5cI2Omen.js","assets/LoginFailedScreen-87LgCVCV-CqqtixLa.js","assets/ManualTransferScreen-BRXiBgiZ-DoeRaifV.js","assets/useWalletBalance-D47dI-xh-BQGLS8YA.js","assets/MfaAuthEnrollmentFlowScreen-qXwJGe2E-8qISCKit.js","assets/ShieldCheckIcon-qgYsbTWR.js","assets/EnrollTotp-Dc4RbIOA-BGIyXBxo.js","assets/PinInput-YqT0dSuH-CntwwXiD.js","assets/MfaAuthVerifyFlowScreen-DXEKzBAu-DJUjdInG.js","assets/to-ui-error-ijH7Jvog-ClNi8Qck.js","assets/TransactionDetails-B-EpB9v5-BKE-iVni.js","assets/WalletLink-BiKPJbmo-DS8-iVkY.js","assets/MfaEnrollmentFlowScreen-HeKSb33a-CR3adrtC.js","assets/MoonpayStatusScreen-l-qyxBqo-atQFbC9a.js","assets/OAuthStatusScreen-DEaj1Cx0-CWU06oli.js","assets/PasskeySelectSignupOrLogin-BkByGRw--QXu_mFGa.js","assets/PasskeyStatusScreen-D-V-K3Z9-Q4c7iXUK.js","assets/PasswordRecoveryScreen-CCu4ttfr-DEI86kgW.js","assets/RecoveryOAuthStatusScreen-CFujlL9L-BDIglmC3.js","assets/styles-BsotlekN-nkQsyBSn.js","assets/RecoverySelectionScreen-F_wQ_CWq-nQ4j4B54.js","assets/LockClosedIcon-VQnba-Dz.js","assets/index-BWsACtDt-BrJYR5yH.js","assets/JsonTree-aPaJmPx7-BTNIsKQi.js","assets/TransactionErrorView-C7TN0KiG-BnRnOb4m.js","assets/SetAutomaticRecoveryScreen-C7A71DnN-CVOxMFUd.js","assets/SignRequestScreen-CZ5BTKSq-DR7r2HNx.js","assets/StandardSignAndSendTransactionScreen-C26odE6I-BrgPhxbx.js","assets/TelegramAuthScreen-BNOwzXOU-CwsQDc1B.js","assets/TransferFromWalletScreen-a7BSg9U2-DGILfPNG.js","assets/UpdateEmailScreen-n_K4amJc-BCuz2ljH.js","assets/UpdatePhoneScreen-Cw26b--T-DwMk5ges.js","assets/UserLimitReachedScreen-B3Dl2q5_-CdcGa5q3.js","assets/WalletInterstitialScreen-Cy2YhOXL-CxEFCtty.js","assets/MfaVerifyFlowScreen-tffdYhQu-BmtdhhT2.js","assets/index-B6aUbwA1.js","assets/CoinflowPurchase-CT_n0wZa.js","assets/CoinflowCardFormV2-wUCfml6Q.js","assets/CoinflowPurchaseProtection-D4oCngYH.js"])))=>i.map(i=>d[i]); 2import{Q as yJ,a as mJ,u as Bt}from"./useQuery-DGVh7Xho.js";import{da as WM,db as iu,dc as d6,dd as Uc,de as vJ,df as wJ,dg as WA,dh as bJ,di as _J,m as CJ,dj as EJ,dk as SJ,dl as AJ,dm as E7,dn as f6,cW as ts,dp as xJ,b as it,u as ns,dq as Se,aQ as re,bz as Qe,dr as $e,a2 as te,a3 as ee,bu as au,ds as rs,t as De,dt as hg,du as pg,dv as IJ,dw as nc,e as zo,c as Y_,ce as TJ,dx as qM,c9 as S7,c7 as LJ,dy as kJ,v as ur,cg as Sa,ch as J_,aB as $J,b5 as PJ,r as ta,a as dm,I as RJ,dz as OJ,b8 as zM,B as wh,Y as MJ,a6 as NJ,a7 as DJ,g as FJ,d3 as e2,dA as UJ,dB as jJ,dC as BJ,F as Ir}from"./versionProvider-BLaKWEOB.js";import{dR as Zs,eS as ZM,eZ as VJ,dc as L,eT as KM,e_ as HJ,e$ as qA,f0 as zA,f1 as ZA,f2 as WJ,f3 as qJ,a as zJ,a5 as Kt,cp as Xi,bG as Qi,bZ as Gh,bd as GM,aQ as ZJ,f4 as zp,ce as gg,f5 as Zp,ey as Dt,cg as A7,f6 as KJ,c8 as GJ,c7 as KA,cY as YJ,f7 as JJ,eB as XJ,eC as QJ,cO as X_,dz as Zt,an as eX,cj as Q_,f8 as tX,aq as nX,ao as rX,co as GA,ap as iX,f9 as aX,fa as fm,fb as YM,fc as Yh,fd as Wr,dZ as O2,fe as eC,ff as sX,fg as yg,fh as oX,fi as cX,fj as $o,b$ as JM,bC as M2,fk as lX,fl as uX,dF as ol,fm as XM,dG as QM,fn as mg,dB as eN,bJ as N2,r as Jh,fo as hm,fp as tN,dy as dX,ew as tC,cZ as nC,fq as fX,ez as $u,bV as pm,cF as nN,fr as hX,fs as pX,ft as YA,fu as rN,fv as gX,fw as Xh,fx as m3,fy as iN,d9 as rC,bD as yX,bL as mX,fz as Qh,bO as aN,bM as _t,fA as vX,fB as gm,fC as wX,fD as iC,fE as e1,k as ym,bW as ui,fF as aC,fG as sC,dT as sN,dU as bX,dV as _X,fH as CX,fI as JA,fJ as Kp,fK as EX,fL as SX,fM as AX,fN as un,fO as mm,fP as D2,fQ as Gi,fR as Xe,fS as xX,fT as Tn,fU as bi,fV as ep,fW as vg,fX as IX,fY as oN,fZ as cN,f_ as lN,f$ as TX,g0 as uN,g1 as LX,g2 as kX,g3 as $X,g4 as vm,g5 as PX,g6 as RX,g7 as OX,g8 as dN,g9 as MX,ga as fN,gb as NX,gc as DX,gd as hN,ge as FX,gf as rc,gg as UX,d3 as x7,d1 as jX,gh as BX,dA as Us,cA as VX,cD as HX,bX as WX,cz as qX,cC as zX,cE as ZX,D as XA,cH as F2,eu as oC,gi as KX,gj as pN,c0 as xo,cW as GX,bN as t2,a4 as wg,cr as An,eo as su,gk as YX,gl as bg,eq as cC,ep as Lc,gm as JX,gn as XX,en as gN,go as QX,gp as eQ,cQ as yN,cT as mN,gq as tQ,bf as ar,b5 as Dd,cP as vN,b7 as tp,dd as Ne,dS as _s,dj as Zo,gr as _g,gs as np,cm as lC,cd as bh,bI as nQ,cM as jc,bA as I7,bx as wN,z as Ls,cv as wm,l as ti,q as Ii,eF as rQ,eH as iQ,gt as aQ,aO as sQ,aA as oQ,gu as cQ,e as lQ,gv as uQ,bq as dQ,bc as fQ,cc as hQ,b3 as h6,dl as tt,d7 as pQ,db as m,es as gQ,er as yQ,et as mQ,e2 as QA,e1 as vQ,m as T7,gw as wQ,dx as bQ,dw as _Q,dq as CQ,dn as ex,gx as EQ,ec as SQ,e4 as bm,ds as rp,o as AQ,gy as xQ,eP as IQ,gz as bN,e7 as TQ,dh as _N,eg as _m,gA as CN,gB as LQ,gC as tx,ei as nx,gD as rx,e5 as ix,gE as ax,dk as kQ,dH as $Q,gF as n2}from"./index-ByIcGKUX.js";
vendor: 4,277 bytes, line 2
2import{c as sx,D as PQ,a as RQ}from"./dialog-BZgb3TVt.js";import{d as xn,a as In,f as qn,B as uC,j as EN,i as SN,c as bt,A as OQ,C as cl,D as dC,E as MQ,s as Cm,l as Em}from"./shared-DxjqqMQm.js";import{u as U2}from"./index-rfwHk5oe.js";function NQ(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var DQ={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const FQ=Zs(DQ);var UQ=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function ox(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(FQ[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var i=new RegExp(UQ),a=null;(a=i.exec(t))!==null;)if(a[0].trim())if(a[1]){var s=a[1].trim(),o=[s,""];s.indexOf("=")>-1&&(o=s.split("=")),e.attrs[o[0]]=o[1],i.lastIndex--}else a[2]&&(e.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return e}var jQ=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,BQ=/^\s*$/,VQ=Object.create(null);function AN(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(AN,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var HQ={parse:function(t,e){e||(e={}),e.components||(e.components=VQ);var n,r=[],i=[],a=-1,s=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");r.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(jQ,function(c,l){if(s){if(c!=="</"+n.name+">")return;s=!1}var u,d=c.charAt(1)!=="/",f=c.startsWith("<!--"),h=l+c.length,p=t.charAt(h);if(f){var g=ox(c);return a<0?(r.push(g),r):((u=i[a]).children.push(g),r)}if(d&&(a++,(n=ox(c)).type==="tag"&&e.components[n.name]&&(n.type="component",s=!0),n.voidElement||s||!p||p==="<"||n.children.push({type:"text",content:t.slice(h,t.indexOf("<",h))}),a===0&&r.push(n),(u=i[a-1])&&u.children.push(n),i[a]=n),(!d||n.voidElement)&&(a>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(a--,n=a===-1?r:i[a]),!s&&p!=="<"&&p)){u=a===-1?r:i[a].children;var y=t.indexOf("<",h),v=t.slice(h,y===-1?void 0:y);BQ.test(v)&&(v=" "),(y>-1&&a+u.length>=0||v!==" ")&&u.push({type:"text",content:v})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+AN("",n)},"")}};const v3=(t,e)=>{if(!t)return!1;const n=t.props?.children??t.children;return e?n.length>0:!!n},w3=t=>{if(!t)return[];const e=t.props?.children??t.children;return t.props?.i18nIsDynamicList?ql(e):e},WQ=t=>Array.isArray(t)&&t.every(L.isValidElement),ql=t=>Array.isArray(t)?t:[t],qQ=(t,e)=>{const n={...e};return n.props={...e.props,...t.props},n},zQ=t=>{const e={};if(!t)return e;const n=r=>{ql(r).forEach(a=>{iu(a)||(v3(a)?n(w3(a)):Uc(a)&&!L.isValidElement(a)&&Object.assign(e,a))})};return n(t),e},L7=(t,e,n,r)=>{if(!t)return"";let i="";const a=ql(t),s=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((o,c)=>{if(iu(o)){i+=`${o}`;return}if(L.isValidElement(o)){const{props:l,type:u}=o,d=Object.keys(l).length,f=s.indexOf(u)>-1,h=l.children;if(!h&&f&&!d){i+=`<${u}/>`;return}if(!h&&(!f||d)||l.i18nIsDynamicList){i+=`<${c}></${c}>`;return}if(f&&d<=1){const g=iu(h)?h:L7(h,e,n,r);i+=`<${u}>${g}</${u}>`;return}const p=L7(h,e,n,r);i+=`<${c}>${p}</${c}>`;return}if(o===null){d6(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(Uc(o)){const{format:l,...u}=o,d=Object.keys(u);if(d.length===1){const f=l?`${d[0]}, ${l}`:d[0];i+=`{{${f}}}`;return}d6(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:o});return}d6(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:o})}),i},ZQ=(t,e=[],n={})=>
2{if(!t)return t;const r=Object.keys(n),i=[...e,...r];let a="",s=0;for(;s<t.length;)if(t[s]==="<"){let o=!1;const c=t.slice(s).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(c){const l=c[1];(/^\d+$/.test(l)||i.includes(l))&&(o=!0,a+=c[0],s+=c[0].length)}if(!o){const l=t.slice(s).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(l){const u=l[1];(/^\d+$/.test(u)||i.includes(u))&&(o=!0,a+=l[0],s+=l[0].length)}}o||(a+="<",s+=1)}else a+=t[s],s+=1;return a},KQ=(t,e,n,r,i,a,s)=>{if(n==="")return[];const o=i.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(o.map(b=>`<${b}`).join("|")).test(n);if(!t&&!e&&!c&&!s)return[n];const l=e??{},u=b=>{ql(b).forEach(_=>{iu(_)||(v3(_)?u(w3(_)):Uc(_)&&!L.isValidElement(_)&&Object.assign(l,_))})};u(t);const d=ZQ(n,o,l),f=HQ.parse(`<0>${d}</0>`),h={...l,...a},p=(b,w,_)=>{const E=w3(b),C=y(E,w.children,_);return WQ(E)&&C.length===0||b.props?.i18nIsDynamicList?E:C},g=(b,w,_,E,C)=>{b.dummy?(b.children=w,_.push(L.cloneElement(b,{key:E},C?void 0:w))):_.push(...L.Children.map([b],x=>{if(x.type===L.Fragment||x.props?.i18nIsDynamicList!==void 0){const T={key:E};return x&&x.props&&Object.keys(x.props).forEach(U=>{U==="children"||U==="i18nIsDynamicList"||(T[U]=x.props[U])}),L.createElement(x.type,T,C?null:w)}const $={key:E};return x&&x.props&&Object.keys(x.props).forEach(T=>{T==="ref"||T==="children"||($[T]=x.props[T])}),L.cloneElement(x,$,C?null:w)}))},y=(b,w,_)=>{const E=ql(b);return ql(w).reduce((x,$,T)=>{const U=$.children?.[0]?.content&&r.services.interpolator.interpolate($.children[0].content,h,r.language);if($.type==="tag"){let O=E[parseInt($.name,10)];!O&&e&&(O=e[$.name]),_.length===1&&!O&&(O=_[0][$.name]),O||(O={});const F={...$.attrs};s&&Object.keys(F).forEach(N=>{const P=F[N];iu(P)&&(F[N]=HJ(P))});const k=Object.keys(F).length!==0?qQ({props:F},O):O,S=L.isValidElement(k),I=S&&v3($,!0)&&!$.voidElement,A=c&&Uc(k)&&k.dummy&&!S,R=Uc(e)&&Object.hasOwnProperty.call(e,$.name);if(iu(k)){const N=r.services.interpolator.interpolate(k,h,r.language);x.push(N)}else if(v3(k)||I){const N=p(k,$,_);g(k,N,x,T)}else if(A){const N=y(E,$.children,_);g(k,N,x,T)}else if(Number.isNaN(parseFloat($.name)))if(R){const N=p(k,$,_);g(k,N,x,T,$.voidElement)}else if(i.transSupportBasicHtmlNodes&&o.indexOf($.name)>-1)if($.voidElement)x.push(L.createElement($.name,{key:`${$.name}-${T}`}));else{const N=y(E,$.children,_);x.push(L.createElement($.name,{key:`${$.name}-${T}`},N))}else if($.voidElement)x.push(`<${$.name} />`);else{const N=y(E,$.children,_);x.push(`<${$.name}>${N}</${$.name}>`)}else if(Uc(k)&&!S){const N=$.children[0]?U:null;N&&x.push(N)}else g(k,U,x,T,$.children.length!==1||!U)}else if($.type==="text"){const O=i.transWrapTextNodes,F=typeof i.unescape=="function"?i.unescape:ZM().unescape,k=s?F(r.services.interpolator.interpolate($.content,h,r.language)):r.services.interpolator.interpolate($.content,h,r.language);O?x.push(L.createElement(O,{key:`${$.name}-${T}`},k)):x.push(k)}return x},[])},v=y([{dummy:!0,children:t||[]}],f,ql(t||[]));return w3(v[0])},xN=(t,e,n)=>{const r=t.key||e,i=L.cloneElement(t,{key:r});if(!i.props||!i.props.children||n.indexOf(`${e}/>`)<0&&n.indexOf(`${e} />`)<0)return i;function a(){return L.createElement(L.Fragment,null,i)}return L.createElement(a,{key:r})},GQ=(t,e)=>t.map((n,r)=>xN(n,r,e)),YQ=(t,e)=>{const n={};return Object.keys(t).forEach(r=>{Object.assign(n,{[r]:xN(t[r],r,e)})}),n},JQ=(t,e,n,r)=>t?Array.isArray(t)?GQ(t,e):Uc(t)?YQ(t,e):(WM(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,XQ=t=>!Uc(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,n)=>e&&Number.isNaN(Number.parseFloat(n)),!0);function QQ({children:t,count:e,parent:n,i18nKey:r,context:i,tOptions:a={},values:s,defaults:o,components:c,ns:l,i18n:u,t:d,shouldUnescape:f,...h}){const p=u||KM();if(!p)return WM(p,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),t;const g=d||p.t.bind(p)||(j=>j),y={...ZM(),...p.options?.react};let v=l||g.ns||p.options?.defaultNS;v=iu(v)?[v]:v||["translation"];const{transDefaultProps:b}=y,w=b?.tOptions?{...b.tOptions,...a}
2:a,_=f??b?.shouldUnescape,E=b?.values?{...b.values,...s}:s,C=b?.components?{...b.components,...c}:c,x=L7(t,y,p,r),$=o||w?.defaultValue||x||y.transEmptyNodeValue||(typeof r=="function"?VJ(r):r),{hashTransKey:T}=y,U=r||(T?T(x||$):x||$);p.options?.interpolation?.defaultVariables?s=E&&Object.keys(E).length>0?{...E,...p.options.interpolation.defaultVariables}:{...p.options.interpolation.defaultVariables}:s=E;const O=zQ(t);O&&typeof O.count=="number"&&e===void 0&&(e=O.count);const F=s||e!==void 0&&!p.options?.interpolation?.alwaysFormat||!t?w.interpolation:{interpolation:{...w.interpolation,prefix:"#$?",suffix:"?$#"}},k={...w,context:i||w.context,count:e,...s,...F,defaultValue:$,ns:v};let S=U?g(U,k):$;S===U&&$&&(S=$);const I=JQ(C,S,p,r);let A=I||t,R=null;XQ(I)&&(R=I,A=t);const N=KQ(A,R,S,p,y,k,_),P=n??y.defaultTransParent;return P?L.createElement(P,h,N):N}function eee({children:t,count:e,parent:n,i18nKey:r,context:i,tOptions:a={},values:s,defaults:o,components:c,ns:l,i18n:u,t:d,shouldUnescape:f,...h}){const{i18n:p,defaultNS:g}=L.useContext(vJ)||{},y=u||p||KM(),v=d||y?.t.bind(y);return QQ({children:t,count:e,parent:n,i18nKey:r,context:i,tOptions:a,values:s,defaults:o,components:c,ns:l||v?.ns||g||y?.options?.defaultNS,i18n:y,t:d,shouldUnescape:f,...h})}const ip=async t=>{const e=t.toLowerCase().trim(),r=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(i)).map(s=>s.toString(16).padStart(2,"0")).join("")},tee=["AO","AG","AW","BS","BZ","BJ","BW","BF","BI","CM","CF","TD","KM","CG","CK","DJ","DM","GQ","ER","FJ","GM","GD","GY","HK","KI","MO","MR","NR","NU","QA","RW","KN","LC","VC","SC","SL","SB","SR","TL","TK","TO","TV","UG","VU","YE","ZW","AE"],nrt=["US","CA"],rrt=[{code:"us",name:"United States"},{code:"al",name:"Albania"},{code:"dz",name:"Algeria"},{code:"ar",name:"Argentina"},{code:"am",name:"Armenia"},{code:"au",name:"Australia"},{code:"at",name:"Austria"},{code:"az",name:"Azerbaijan"},{code:"bh",name:"Bahrain"},{code:"bd",name:"Bangladesh"},{code:"bo",name:"Bolivia"},{code:"ba",name:"Bosnia and Herzegovina"},{code:"be",name:"Belgium"},{code:"br",name:"Brazil"},{code:"bn",name:"Brunei"},{code:"bg",name:"Bulgaria"},{code:"kh",name:"Cambodia"},{code:"ca",name:"Canada"},{code:"cl",name:"Chile"},{code:"co",name:"Colombia"},{code:"cr",name:"Costa Rica"},{code:"hr",name:"Croatia"},{code:"cy",name:"Cyprus"},{code:"cz",name:"Czech Republic"},{code:"dk",name:"Denmark"},{code:"do",name:"Dominican Republic"},{code:"ec",name:"Ecuador"},{code:"eg",name:"Egypt"},{code:"sv",name:"El Salvador"},{code:"ee",name:"Estonia"},{code:"fi",name:"Finland"},{code:"fr",name:"France"},{code:"ge",name:"Georgia"},{code:"de",name:"Germany"},{code:"gh",name:"Ghana"},{code:"gr",name:"Greece"},{code:"gt",name:"Guatemala"},{code:"hk",name:"Hong Kong"},{code:"hu",name:"Hungary"},{code:"is",name:"Iceland"},{code:"in",name:"India"},{code:"id",name:"Indonesia"},{code:"ie",name:"Ireland"},{code:"il",name:"Israel"},{code:"it",name:"Italy"},{code:"jm",name:"Jamaica"},{code:"jp",name:"Japan"},{code:"jo",name:"Jordan"},{code:"kz",name:"Kazakhstan"},{code:"ke",name:"Kenya"},{code:"kw",name:"Kuwait"},{code:"lv",name:"Latvia"},{code:"lb",name:"Lebanon"},{code:"lt",name:"Lithuania"},{code:"lu",name:"Luxembourg"},{code:"mo",name:"Macau"},{code:"my",name:"Malaysia"},{code:"mt",name:"Malta"},{code:"mx",name:"Mexico"},{code:"md",name:"Moldova"},{code:"mc",name:"Monaco"},{code:"mn",name:"Mongolia"},{code:"me",name:"Montenegro"},{code:"ma",name:"Morocco"},{code:"mm",name:"Myanmar"},{code:"np",name:"Nepal"},{code:"nl",name:"Netherlands"},{code:"nz",name:"New Zealand"},{code:"ng",name:"Nigeria"},{code:"mk",name:"North Macedonia"},{code:"no",name:"Norway"},{code:"om",name:"Oman"},{code:"pk",name:"Pakistan"},{code:"pa",name:"Panama"},{code:"py",name:"Paraguay"},{code:"pe",name:"Peru"},{code:"ph",name:"Philippines"},{code:"pl",name:"Poland"},{code:"pt",name:"Portugal"},{code:"pr",name:"Puerto Rico"},{code:"qa",name:"Qatar"},{code:"ro",name:"Romania"},{code:"sa",name:"Saudi Arabia"},{code:"rs",name:"Serbia"},{code:"sg",name:"Singapore"},{code:"sk",name:"Slovakia"}
2,{code:"si",name:"Slovenia"},{code:"za",name:"South Africa"},{code:"kr",name:"South Korea"},{code:"es",name:"Spain"},{code:"lk",name:"Sri Lanka"},{code:"se",name:"Sweden"},{code:"ch",name:"Switzerland"},{code:"tw",name:"Taiwan"},{code:"th",name:"Thailand"},{code:"tr",name:"Turkey"},{code:"ae",name:"United Arab Emirates"},{code:"gb",name:"United Kingdom"},{code:"uy",name:"Uruguay"},{code:"uz",name:"Uzbekistan"},{code:"ve",name:"Venezuela"},{code:"vn",name:"Vietnam"}],nee="validation.address.englishOnly",ree=/[^�-� -Éá¸-ỿâ-â¯â -â]/;function iee(t){return t?ree.test(t):!1}const aee=["firstName","lastName","addressLine1","addressLine2","city","state"],Cg=t=>t.type==="ethereum"&&t.walletClientType==="privy"&&t.connectorType==="embedded",IN=t=>t?.find(e=>e.type==="wallet"&&e.chainType==="ethereum"&&e.connectorType==="embedded"&&e.walletClientType==="privy"&&!e.imported)?.address,see=(t,e)=>{const n=IN(t)?.toLowerCase();return n?e.find(r=>Cg(r)&&r.address.toLowerCase()===n):e.find(Cg)};function TN(t){const e=[];if(typeof t=="string"){const n=qA(t),r=n.length;for(let i=0;i<r;i++)e.push(zA(n[i],{modifiers:ZA}))}else{const n=WJ(t),r=t.length;for(let i=0;i<r;i++){const a=t[i];if(qJ(a))continue;const s=qA(a),o=s.length;for(let c=0;c<o;c++)e.push(zA(s[c],{modifiers:ZA,structs:n}))}}if(e.length===0)throw new zJ({params:t});return e}class oee extends Kt{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}const LN="0x5792579257925792579257925792579257925792579257925792579257925792",kN=Xi(0,{size:32});async function $N(t,e){const{account:n=t.account,chain:r=t.chain,experimental_fallback:i,experimental_fallbackDelay:a=32,forceAtomic:s=!1,id:o,version:c="2.0.0"}=e,l=n?Dt(n):null;let u=e.capabilities;t.dataSuffix&&!e.capabilities?.dataSuffix&&(typeof t.dataSuffix=="string"?u={...e.capabilities,dataSuffix:{value:t.dataSuffix,optional:!0}}:u={...e.capabilities,dataSuffix:{value:t.dataSuffix.value,...t.dataSuffix.required?{}:{optional:!0}}});const d=e.calls.map(f=>{const h=f,p=h.abi?Qi({abi:h.abi,functionName:h.functionName,args:h.args}):h.data;return{data:h.dataSuffix&&p?Gh([p,h.dataSuffix]):p,to:h.to,value:h.value?Xi(h.value):void 0}});try{const f=await t.request({method:"wallet_sendCalls",params:[{atomicRequired:s,calls:d,capabilities:u,chainId:Xi(r.id),from:l?.address,id:o,version:c}]},{retryCount:0});return typeof f=="string"?{id:f}:f}catch(f){const h=f;if(i&&(h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"||h.name==="UnknownRpcError"||h.details.toLowerCase().includes("does not exist / is not available")||h.details.toLowerCase().includes("missing or invalid. request()")||h.details.toLowerCase().includes("did not match any variant of untagged enum")||h.details.toLowerCase().includes("account upgraded to unsupported contract")||h.details.toLowerCase().includes("eip-7702 not supported")||h.details.toLowerCase().includes("unsupported wc_ method")||h.details.toLowerCase().includes("feature toggled misconfigured")||h.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(u&&Object.values(u).some(v=>!v.optional)){const v="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new GM(new Kt(v,{details:v}))}if(s&&d.length>1){const y="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new ZJ(new Kt(y,{details:y}))}const p=[];for(const y of d){try{const v=await zp(t,{account:l,chain:r,data:y.data,to:y.to,value:y.value?gg(y.value):void 0});p.push({status:"fulfilled",value:v})}catch(v){p.push({reason:v,status:"rejected"})}a>0&&await new Promise(v=>setTimeout(v,a))}if(p.every(y=>y.status==="rejected"))throw p[0].reason;const g=p.map(y=>y.status==="fulfilled"?y.value:kN);return{id:Gh([...g,Xi(r.id,{size:32}),LN])}}throw Zp(f,{...e,account:l,chain:e.chain})}}async function PN(t,e){async function n(u){if(u.endsWith(LN.slice(2))){const f=GJ(KA(u,-64,-32)),h=KA(u,0,-64).slice(2).match(/.{1,64}/g),p=await Promise.all(h.map(y=>kN.slice(2)!==y?t.request({method:"eth_getTransactionReceipt",params:[`0x${y}`]},{dedupe:!0}):void 0)),g=p.some(y=>y===null)?100:p.every(y=>y?.status==="0x1")?200:p.every(y=>y?.status==="0x0")?500:600;
2return{atomic:!1,chainId:A7(f),receipts:p.filter(Boolean),status:g,version:"2.0.0"}}return t.request({method:"wallet_getCallsStatus",params:[u]})}const{atomic:r=!1,chainId:i,receipts:a,version:s="2.0.0",...o}=await n(e.id),[c,l]=(()=>{const u=o.status;return u>=100&&u<200?["pending",u]:u>=200&&u<300?["success",u]:u>=300&&u<700?["failure",u]:u==="CONFIRMED"?["success",200]:u==="PENDING"?["pending",100]:[void 0,u]})();return{...o,atomic:r,chainId:i?A7(i):void 0,receipts:a?.map(u=>({...u,blockNumber:gg(u.blockNumber),gasUsed:gg(u.gasUsed),status:KJ[u.status]}))??[],statusCode:l,status:c,version:s}}async function RN(t,e){const{id:n,pollingInterval:r=t.pollingInterval,status:i=({statusCode:g})=>g===200||g>=300,retryCount:a=4,retryDelay:s=({count:g})=>~~(1<<g)*200,timeout:o=6e4,throwOnFailure:c=!1}=e,l=YJ(["waitForCallsStatus",t.uid,n]),{promise:u,resolve:d,reject:f}=JJ();let h;const p=XJ(l,{resolve:d,reject:f},g=>{const y=QJ(async()=>{const v=b=>{clearTimeout(h),y(),b(),p()};try{const b=await X_(async()=>{const w=await Zt(t,PN,"getCallsStatus")({id:n});if(c&&w.status==="failure")throw new oee(w);return w},{retryCount:a,delay:s});if(!i(b))return;v(()=>g.resolve(b))}catch(b){v(()=>g.reject(b))}},{interval:r,emitOnBegin:!0});return y});return h=o?setTimeout(()=>{p(),clearTimeout(h),f(new cee({id:n}))},o):void 0,await u}class cee extends Kt{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const cx=1024;function lee(t,e="hex"){const n=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new eX(t);return Q_(t)}return t})(),r=tX(n,{recursiveReadLimit:Number.POSITIVE_INFINITY}),i=ON(r,e);if(r.position<r.bytes.length)throw new nX({count:r.bytes.length-r.position});return i}function ON(t,e="hex",n=0){if(n>=cx)throw new rX({limit:cx});if(t.bytes.length===0)return e==="hex"?GA(t.bytes):t.bytes;const r=t.readByte();if(r<128&&t.decrementPosition(1),r<192){const a=lx(t,r,128),s=t.readBytes(a);return e==="hex"?GA(s):s}const i=lx(t,r,192);return uee(t,i,e,n+1)}function lx(t,e,n){if(n===128&&e<128)return 1;if(e<=n+55)return e-n;if(e===n+55+1)return t.readUint8();if(e===n+55+2)return t.readUint16();if(e===n+55+3)return t.readUint24();if(e===n+55+4)return t.readUint32();throw new Kt("Invalid RLP prefix")}function uee(t,e,n,r){const i=t.position,a=[];for(;t.position-i<e;)a.push(ON(t,n,r));if(t.position-i!==e)throw new iX({consumed:t.position-i,declared:e});return a}function MN(t){return dee(t,"Hex")}function dee(t,e){const n=e,r=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new aX(t);return fm(t)}return t})(),i=YM(r,{recursiveReadLimit:Number.POSITIVE_INFINITY});return NN(i,n)}function NN(t,e="Hex"){if(t.bytes.length===0)return e==="Hex"?Yh(t.bytes):t.bytes;const n=t.readByte();if(n<128&&t.decrementPosition(1),n<192){const i=ux(t,n,128),a=t.readBytes(i);return e==="Hex"?Yh(a):a}const r=ux(t,n,192);return fee(t,r,e)}function ux(t,e,n){if(n===128&&e<128)return 1;if(e<=n+55)return e-n;if(e===n+55+1)return t.readUint8();if(e===n+55+2)return t.readUint16();if(e===n+55+3)return t.readUint24();if(e===n+55+4)return t.readUint32();throw new Wr("Invalid RLP prefix")}function fee(t,e,n){const r=t.position,i=[];for(;t.position-r<e;)i.push(NN(t,n));return i}function hee(t,e){const{as:n}=e,r=DN(t),i=YM(new Uint8Array(r.length));return r.encode(i),n==="Hex"?Yh(i.bytes):i.bytes}function fC(t,e={}){const{as:n="Hex"}=e;return hee(t,{as:n})}function DN(t){return Array.isArray(t)?pee(t.map(e=>DN(e))):gee(t)}function pee(t){const e=t.reduce((i,a)=>i+a.length,0),n=FN(e);return{length:e<=55?1+e:1+n+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+n),n===1?i.pushUint8(e):n===2?i.pushUint16(e):n===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:a}of t)a(i)}}}function gee(t){const e=typeof t=="string"?fm(t):t,n=FN(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+n+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+n),n===1?i.pushUint8(e.length):n===2?i.pushUint16(e.length):n===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function FN(t){if(t<=255)return 1;if(t<=65535)return 2;if(t<=16777215)return 3;
2if(t<=4294967295)return 4;throw new Wr("Length is too large.")}function UN(t){return $o(hC(t))}function hC(t){const{payload:e,signature:n}=t,{r,s:i,yParity:a}=n,o=new O2.Signature(BigInt(r),BigInt(i)).addRecoveryBit(a).recoverPublicKey(eC(e).substring(2));return sX(o)}function yee(t){const{hash:e,payload:n}=t;return t.address?yg(t.address,UN({payload:n,signature:t.signature})):O2.verify(t.signature,oX(n),cX(t.publicKey),...e?[{prehash:!0,lowS:!0}]:[])}function mee(t){const{address:e,data:n,signature:r,to:i="hex"}=t,a=JM([M2([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,n,r]),lX]);return i==="hex"?a:Q_(a)}function $l(t,e="wei"){return uX(t,e)}async function r2(t,e){return r2.inner(ol,t,e)}(function(t){async function e(s,o,c){return await s(o,{...c,...t.call(o,c)})}t.inner=e;function n(s,o){return XM(vee(s,o))}t.call=n;async function r(s,o){return QM(s,{...mg(o),...t.call(s,o)})}t.estimateGas=r;async function i(s,o){return eN(s,{...mg(o),...t.call(s,o)})}t.simulate=i;function a(s){const[o]=N2({abi:Jh,logs:s,eventName:"Approval",strict:!0});if(!o)throw new Error("`Approval` event not found.");return o}t.extractEvent=a})(r2||(r2={}));function vee(t,e){const{amount:n,spender:r,token:i}=e,{address:a,decimals:s}=hm(t,{token:i});return{abi:Jh,address:a,args:[r,tN(n,s)],functionName:"approve"}}const p6=new dX(128);async function jN(t,e){const{account:n=t.account,assertChainId:r=!0,chain:i=t.chain,accessList:a,authorizationList:s,blobs:o,data:c,dataSuffix:l=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:g,pollingInterval:y,throwOnReceiptRevert:v,type:b,value:w,..._}=e,E=e.timeout??Math.max((i?.blockTime??0)*3,5e3);if(typeof n>"u")throw new tC({docsPath:"/docs/actions/wallet/sendTransactionSync"});const C=n?Dt(n):null;let x;try{nC(e);const $=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await fX({authorization:s[0]}).catch(()=>{throw new Kt("`to` is required. Could not infer from `authorizationList`.")})})();if(C?.type==="json-rpc"||C===null){let T;i!==null&&(T=await Zt(t,$u,"getChainId")({}),r&&pm({currentChainId:T,chain:i}));const U=t.chain?.formatters?.transactionRequest?.format,F=(U||nN)({...hX(_,{format:U}),accessList:a,account:C,authorizationList:s,blobs:o,chainId:T,data:l?Gh([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:g,to:$,type:b,value:w},"sendTransaction"),k=p6.get(t.uid),S=k?"wallet_sendTransaction":"eth_sendTransaction",I=await(async()=>{try{return await t.request({method:S,params:[F]},{retryCount:0})}catch(R){if(k===!1)throw R;const N=R;if(N.name==="InvalidInputRpcError"||N.name==="InvalidParamsRpcError"||N.name==="MethodNotFoundRpcError"||N.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(P=>(p6.set(t.uid,!0),P)).catch(P=>{const j=P;throw j.name==="MethodNotFoundRpcError"||j.name==="MethodNotSupportedRpcError"?(p6.set(t.uid,!1),N):j});throw N}})(),A=await Zt(t,pX,"waitForTransactionReceipt")({checkReplacement:!1,hash:I,pollingInterval:y,timeout:E});if(v&&A.status==="reverted")throw new YA({receipt:A});return A}if(C?.type==="local"){const T=(()=>{if(!C.nonceManager||typeof g<"u")return C.nonceManager;const k=C.nonceManager;return{consume(S){return x={address:S.address,chainId:S.chainId},k.consume(S)},get(S){return k.get(S)},increment(S){return k.increment(S)},reset(S){return k.reset(S)}}})(),U=await Zt(t,rN,"prepareTransactionRequest")({account:C,accessList:a,authorizationList:s,blobs:o,chain:i,data:l?Gh([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:g,nonceManager:T,parameters:[...gX,"sidecars"],type:b,value:w,..._,to:$}),O=i?.serializers?.transaction,F=await C.signTransaction(U,{serializer:O});return await Zt(t,Xh,"sendRawTransactionSync")({serializedTransaction:F,throwOnReceiptRevert:v,timeout:e.timeout})}throw C?.type==="smart"?new m3({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new m3({docsPath:"/docs/actions/wallet/sendTransactionSync",type:C?.type})}catch($){throw $ instanceof m3?$:(x&&!($ instanceof YA)&&C?.nonceManager?.reset(x),Zp($,{...e,account:C,chain:e.chain||void 0}))}}async function pC(t,e){return ol.internal(t,jN,"sendTransactionSync",e)}async function wee(t,e){const{amount:n,token:r,throwOnReceiptRevert:i=!0}
2=e,{decimals:a}=hm(t,{token:r}),s=iN(n,a),o=await r2.inner(pC,t,{...e,throwOnReceiptRevert:i}),{args:c}=r2.extractEvent(o.logs);return{...c,...s===void 0?{}:{decimals:s,formatted:rC(c.value,s)},receipt:o}}async function i2(t,e){return i2.inner(ol,t,e)}(function(t){async function e(s,o,c){return await s(o,{...c,...t.call(o,c)})}t.inner=e;function n(s,o){return XM(bee(s,o))}t.call=n;async function r(s,o){return QM(s,{...mg(o),...t.call(s,o)})}t.estimateGas=r;async function i(s,o){return eN(s,{...mg(o),...t.call(s,o)})}t.simulate=i;function a(s){const[o]=N2({abi:Jh,logs:s,eventName:"Transfer",strict:!0});if(!o)throw new Error("`Transfer` event not found.");return o}t.extractEvent=a})(i2||(i2={}));function bee(t,e){const{amount:n,from:r,to:i,token:a}=e,{address:s,decimals:o}=hm(t,{token:a}),c=tN(n,o);return r?{abi:Jh,address:s,args:[r,i,c],functionName:"transferFrom"}:{abi:Jh,address:s,args:[i,c],functionName:"transfer"}}async function _ee(t,e){const{amount:n,token:r,throwOnReceiptRevert:i=!0}=e,{decimals:a}=hm(t,{token:r}),s=iN(n,a),o=await i2.inner(pC,t,{...e,throwOnReceiptRevert:i}),{args:c}=i2.extractEvent(o.logs);return{...c,...s===void 0?{}:{decimals:s,formatted:rC(c.value,s)},receipt:o}}async function Cee(t,{chain:e}){const{id:n,name:r,nativeCurrency:i,rpcUrls:a,blockExplorers:s}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:Xi(n),chainName:r,nativeCurrency:i,rpcUrls:a.default.http,blockExplorerUrls:s?Object.values(s).map(({url:o})=>o):void 0}]},{dedupe:!0,retryCount:0})}function Eee(t,e){const{abi:n,args:r,bytecode:i,...a}=e,s=yX({abi:n,args:r,bytecode:i}
2);return zp(t,{...a,...a.authorizationList?{to:null}:{},data:s})}async function See(t){return t.account?.type==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>mX(n))}async function Aee(t,e={}){const{account:n=t.account,chainId:r}=e,i=n?Dt(n):void 0,a=r?[i?.address,[Xi(r)]]:[i?.address],s=await t.request({method:"wallet_getCapabilities",params:a}),o={};for(const[c,l]of Object.entries(s)){o[Number(c)]={};for(let[u,d]of Object.entries(l))u==="addSubAccount"&&(u="unstable_addSubAccount"),o[Number(c)][u]=d}return typeof r=="number"?o[r]:o}async function xee(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function BN(t,e){const{account:n=t.account,chainId:r,nonce:i}=e;if(!n)throw new tC({docsPath:"/docs/eip7702/prepareAuthorization"});const a=Dt(n),s=(()=>{if(e.executor)return e.executor==="self"?e.executor:Dt(e.executor)})(),o={address:e.contractAddress??e.address,chainId:r,nonce:i};return typeof o.chainId>"u"&&(o.chainId=t.chain?.id??await Zt(t,$u,"getChainId")({})),typeof o.nonce>"u"&&(o.nonce=await Zt(t,Qh,"getTransactionCount")({address:a.address,blockTag:"pending"}),(s==="self"||s?.address&&aN(s.address,a.address))&&(o.nonce+=1)),o}async function Iee(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(n=>_t(n))}async function Tee(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function Lee(t,e){const{chain:n=t.chain}=e,r=e.timeout??Math.max((n?.blockTime??0)*3,5e3),i=await Zt(t,$N,"sendCalls")(e);return await Zt(t,RN,"waitForCallsStatus")({...e,id:i.id,timeout:r})}async function kee(t,e){const{id:n}=e;await t.request({method:"wallet_showCallsStatus",params:[n]})}async function $ee(t,e){const{account:n=t.account}=e;if(!n)throw new tC({docsPath:"/docs/eip7702/signAuthorization"});const r=Dt(n);if(!r.signAuthorization)throw new m3({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:r.type});const i=await BN(t,e);return r.signAuthorization(i)}async function Pee(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:Xi(e)}]},{retryCount:0})}async function Ree(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function VN(t){return{addChain:e=>Cee(t,e),deployContract:e=>Eee(t,e),fillTransaction:e=>vX(t,e),getAddresses:()=>See(t),getCallsStatus:e=>PN(t,e),getCapabilities:e=>Aee(t,e),getChainId:()=>$u(t),getPermissions:()=>xee(t),prepareAuthorization:e=>BN(t,e),prepareTransactionRequest:e=>rN(t,e),requestAddresses:()=>Iee(t),requestPermissions:e=>Tee(t,e),sendCalls:e=>$N(t,e),sendCallsSync:e=>Lee(t,e),sendRawTransaction:e=>gm(t,e),sendRawTransactionSync:e=>Xh(t,e),sendTransaction:e=>zp(t,e),sendTransactionSync:e=>jN(t,e),showCallsStatus:e=>kee(t,e),signAuthorization:e=>$ee(t,e),signMessage:e=>wJ(t,e),signTransaction:e=>wX(t,e),signTypedData:e=>iC(t,e),switchChain:e=>Pee(t,e),waitForCallsStatus:e=>RN(t,e),watchAsset:e=>Ree(t,e),writeContract:e=>ol(t,e),writeContractSync:e=>pC(t,e),token:{approve:e1(t,r2),approveSync:e1(t,wee),transfer:e1(t,i2),transferSync:e1(t,_ee)}}}function Sm(t){const{key:e="wallet",name:n="Wallet Client",transport:r}=t;return ym({...t,key:e,name:n,transport:r,type:"walletClient"}).extend(VN)}const Oee=ui({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),Mee=ui({id:43113,name:"Avalanche Fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://testnet.snowtrace.io",apiUrl:"https://api-testnet.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),Nee=ui({id:41923,name:"EDU Chain",nativeCurrency:{decimals:18,name:"EDU",symbol:"EDU"},rpcUrls:{default:{http:["https://rpc.educhain.xyz"],webSocket:["wss://rpc.educhain.xyz"]}},blockExplorers:{default:{name:"EDU Chain Explorer",url:"https://explorer.educhain.xyz/"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:16410660}},testnet:!1}),Dee=ui({id:4689,name:"IoTeX",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.mainnet.iotex.io"],webS
2ocket:["wss://babel-api.mainnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://iotexscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:22163670}}}),Fee=ui({id:4690,name:"IoTeX Testnet",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://testnet.iotexscan.io"}},contracts:{multicall3:{address:"0xb5cecD6894c6f473Ec726A176f1512399A2e355d",blockCreated:24347592}},testnet:!0}),Uee=ui({id:3338,name:"Peaq",nativeCurrency:{decimals:18,name:"peaq",symbol:"PEAQ"},rpcUrls:{default:{http:["https://quicknode1.peaq.xyz","https://quicknode2.peaq.xyz","https://quicknode3.peaq.xyz"],webSocket:["wss://quicknode1.peaq.xyz","wss://quicknode2.peaq.xyz","wss://quicknode3.peaq.xyz"]}},blockExplorers:{default:{name:"Subscan",url:"https://peaq.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3566354}}}),jee=ui({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon.drpc.org"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Bee=ui({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-amoy.drpc.org"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),Vee=ui({id:1329,name:"Sei Network",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc.sei-apis.com/"],webSocket:["wss://evm-ws.sei-apis.com/"]}},blockExplorers:{default:{name:"Seiscan",url:"https://seiscan.io",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}}}),Hee=ui({id:1328,name:"Sei Testnet",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc-testnet.sei-apis.com"],webSocket:["wss://evm-ws-testnet.sei-apis.com"]}},blockExplorers:{default:{name:"Seiscan",url:"https://testnet.seiscan.io",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:98697651}},testnet:!0}),Wee=ui({id:1514,name:"Data Network",nativeCurrency:{decimals:18,name:"DATA",symbol:"DATA"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:340998},ensRegistry:{address:"0x5dc881dda4e4a8d312be3544ad13118d1a04cb17",blockCreated:648924},ensUniversalResolver:{address:"0xddfb18888a9466688235887dec2a10c4f5effee9",blockCreated:649114}},rpcUrls:{default:{http:["https://mainnet.datarpc.io"]}},blockExplorers:{default:{name:"Data Network explorer",url:"https://datanetscan.io",apiUrl:"https://datanetscan.io/api/v2"}},ensTlds:[".ip"],testnet:!1});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const HN=aC(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),qee=HN.create(BigInt("-3")),zee=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Zee=sC({a:qee,b:zee,Fp:HN,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},sN),WN=aC(BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff")),Kee=WN.create(BigInt("-3")),Gee=BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef");sC({a:Kee,b:Gee,Fp:WN,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},bX);const qN=aC(BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")),Yee=qN.create(BigInt("-3")),Jee=BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00");sC({a:Yee,b:Jee,Fp:qN,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1),lowS:!1,allowedPrivateKeyLengths:[130,131,132]},_X);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xee=Zee;function zN(t){const{hash:e,payload:n,publicKey:r,signature:i}=t;return Xee.verify(i,n instanceof Uint8Array?n:fm(n),CX(r).substring(2),{lowS:!0,...e?{prehash:!0}:{}})}const Qee=new TextEncoder;Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2+/").map((t,e)=>[e,t.charCodeAt(0)]);const t1={...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((t,e)=>[t.charCodeAt(0),e])),61:0,45:62,95:63};function ete(t){const e=t.replace(/=+$/,""),n=e.length,r=new Uint8Array(n+3);Qee.encodeInto(e+"===",r);for(let a=0,s=0;a<e.length;a+=4,s+=3){const o=(t1[r[a]]<<18)+(t1[r[a+1]]<<12)+(t1[r[a+2]]<<6)+t1[r[a+3]];r[s]=o>>16,r[s+1]=o>>8&255,r[s+2]=o&255}const i=(n>>2)*3+(n%4&&n%4-1);return new Uint8Array(r.buffer,0,i)}function tte(t){const{challenge:e,metadata:n,origin:r,publicKey:i,rpId:a,signature:s}=t,{authenticatorData:o,clientDataJSON:c,userVerificationRequired:l}=n,u=fm(o);if(u.length<37)return!1;if(a!==void 0){const g=u.slice(0,32),y=JA(Kp(a),{as:"Bytes"});if(!EX(g,y))return!1}const d=u[32];if((d&1)!==1||l&&(d&4)!==4||(d&8)!==8&&(d&16)===16)return!1;const f=JSON.parse(c);if(f.type!=="webauthn.get"||!f.challenge||Yh(ete(f.challenge))!==e||r!==void 0&&!(Array.isArray(r)?r:[r]).includes(f.origin))return!1;const h=JA(SX(c),{as:"Bytes"}),p=AX(u,h);return zN({hash:!0,payload:p,publicKey:i,signature:s})}function nte(t){return tte(t)}const rte=255,ZN=8,Eg=ZN,Sg=2,Ag=2049,j2=`0x${"00".repeat(32)}`,ite="tempo:multisig:account",ate="tempo:multisig:signature";function Am(t){const{salt:e,threshold:n,owners:r}=t;if(typeof e<"u"&&bi(e)!==32)throw new ji({reason:"salt must be 32 bytes"});if(r.length===0)throw new ji({reason:"owners cannot be empty"});if(r.length>rte)throw new ji({reason:"too many owners"});if(!Number.isInteger(Number(n)))throw new ji({reason:"threshold must be an integer"});if(Number(n)<1)throw new ji({reason:"threshold cannot be zero"});if(Number(n)>ZN)throw new ji({reason:"threshold exceeds max threshold"});let i=0,a;for(const s of r){if(!ep(s.owner)||un(s.owner)===0n)throw new ji({reason:"owner cannot be zero"});if(!Number.isInteger(Number(s.weight)))throw new ji({reason:"owner weight must be an integer"});if(Number(s.weight)<1)throw new ji({reason:"owner weight cannot be zero"});const o=un(s.owner);if(typeof a<"u"&&a>=o)throw new ji({reason:"owners must be strictly ascending"});a=o,i+=Number(s.weight)}if(i>255)throw new ji({reason:"total owner weight exceeds u8 max"});if(Number(n)>i)throw new ji({reason:"threshold exceeds total owner weight"})}function gC(t){const e=[...t.owners].sort((r,i)=>un(r.owner)<un(i.owner)?-1:1),n={salt:t.salt?mm(t.salt,32):j2,threshold:t.threshold,owners:e};return Am(n),n}function ste(t){const[e,n,r]=t;return{salt:e&&e!=="0x"?mm(e,32):j2,threshold:n==="0x"?0:vg(n),owners:r.map(i=>{const[a,s]=i;return{owner:a,weight:!s||s==="0x"?0:vg(s)}})}}function B2(t){Am(t);const e=D2(Gi(Kp(ite),mm(t.salt??j2,32),Xe(t.threshold,{size:1}),Xe(t.owners.length,{size:1}),...t.owners.flatMap(r=>[r.owner,Xe(r.weight,{size:1})]))),n=xX(Tn(e,12,32));if(un(n)===0n)throw new ji({reason:"derived account cannot be zero"});return n}function ote(t){const{payload:e}=t,n="account"in t&&t.account?t.account:B2(t.genesisConfig);return D2(Gi(Kp(ate),eC(e),n))}function cte(t){Am(t);const e=t.owners.map(r=>[r.owner,Xe(r.weight)]);return[t.salt?mm(t.salt,32):j2,Xe(t.threshold),e]}class ji extends Wr{constructor({reason:e}){super(`Invalid native multisig config: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MultisigConfig.InvalidConfigError"})}}const k7="0x01",$7="0x02",P7="0x03",b3="0x04",R7="0x05",Fl="0x7777777777777777777777777777777777777777777777777777777777777777";function Gp(t){const e=Xp(t);if(e==="secp256k1"){oN(t.signature);return}if(e==="p256"){const n=t,r=[];if(typeof n.signature?.r!="bigint"&&r.push("signature.r"),typeof n.signature?.s!="bigint"&&r.push("signature.s"),typeof n.prehash!="boolean"&&r.push("prehash"),n.publicKey?(typeof n.publicKey.x!="bigint"&&r.push("publicKey.x"),typeof n.publicKey.y!="bigint"&&r.push("publicKey.y")):r.push("publicKey"),r.length>0)throw new M7({envelope:t,missing:r,type:"p256"});return}if(e==="webAuthn"){const n=t,r=[];if(typeof n.signature?.r!="bigint"&&r.push("signature.r"),typeof n.signature?.s!="bigint"&&r.push("signature.s"),n.metadata?(n.metadata.authenticatorData||r.push("metadata.authenticatorData"),n.metadata.clientDataJSON||r.push("metadata.clientDataJSON")):r.push("metadata"),n.publicKey?(typeof n.publicKey.x!="bigint"&&r.push("publicKey.x"),typeof n.publicKey.y!="bigint"&&r.push("publicKey.y")):r.push("publicKey"),r.length>0)throw new M7({envelope:t,missing:r,type:"webAuthn"});return}
2if(e==="keychain"){Gp(t.inner);return}if(e==="multisig"){yC(t,1);return}}function yC(t,e){const n=[];if(t.account||n.push("account"),Array.isArray(t.signatures)||n.push("signatures"),n.length>0)throw new M7({envelope:t,missing:n,type:"multisig"});if(e>Sg)throw new hs({reason:`multisig nesting depth exceeds ${Sg}`});if(!ep(t.account))throw new hs({reason:"multisig account is invalid"});if(un(t.account)===0n)throw new hs({reason:"multisig account cannot be zero"});if(t.signatures.length===0)throw new hs({reason:"multisig signatures cannot be empty"});if(t.signatures.length>Eg)throw new hs({reason:`multisig signatures exceed ${Eg}`});if(t.init&&(Am(t.init),!yg(B2(t.init),t.account)))throw new hs({reason:"multisig init does not derive account"});for(const r of t.signatures){const i=Xp(r);if(i==="keychain")throw new hs({reason:"keychain owner approvals are not allowed"});if(i==="multisig"){const a=r;if(a.init)throw new hs({reason:"nested multisig owner approvals cannot carry `init`"});yC(a,e+1)}else Gp(r);if(bi(a2(r))>Ag)throw new hs({reason:`multisig owner signature exceeds ${Ag} bytes`})}}function Yp(t){const{signature:e,root:n}=t;return e.type==="keychain"?n?e.userAddress:Yp({...t,signature:e.inner}):e.type==="multisig"?e.account:$o(KN(t))}function KN(t){const{payload:e,signature:n}=t;switch(n.type){case"secp256k1":return hC({payload:e,signature:n.signature});case"p256":case"webAuthn":return n.publicKey;case"keychain":return KN({payload:e,signature:n.inner});case"multisig":throw new s2({envelope:n})}}function Jp(t){return O7(t,0)}function O7(t,e){const n=t.endsWith(Fl.slice(2))?Tn(t,0,-bi(Fl)):t;if(bi(n)===65){const o=IX(n);return oN(o),{signature:o,type:"secp256k1"}}const i=Tn(n,0,1),a=Tn(n,1),s=bi(a);if(i===k7){if(s!==129)throw new Bi({reason:`Invalid P256 signature envelope size: expected 129 bytes, got ${s} bytes`,serialized:n});return{publicKey:{prefix:4,x:un(Tn(a,64,96)),y:un(Tn(a,96,128))},prehash:vg(Tn(a,128,129))!==0,signature:{r:un(Tn(a,0,32)),s:un(Tn(a,32,64))},type:"p256"}}if(i===$7){if(s<128)throw new Bi({reason:`Invalid WebAuthn signature envelope size: expected at least 128 bytes, got ${s} bytes`,serialized:n});const o=s-128,c=Tn(a,0,o);let l,u;for(let d=37;d<o;d++){const f=cN(Tn(c,d));if(f.startsWith("{")&&f.endsWith("}"))try{JSON.parse(f),l=Tn(c,0,d),u=f;break}catch{}}if(!l||!u)throw new Bi({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:n});return{publicKey:{prefix:4,x:un(Tn(a,o+64,o+96)),y:un(Tn(a,o+96,o+128))},metadata:{authenticatorData:l,clientDataJSON:u},signature:{r:un(Tn(a,o,o+32)),s:un(Tn(a,o+32,o+64))},type:"webAuthn"}}if(i===P7||i===b3){const o=Tn(a,0,20),c=O7(Tn(a,20),e);return{userAddress:o,inner:c,type:"keychain",version:i===b3?"v2":"v1"}}if(i===R7){const o=e+1;if(o>Sg)throw new Bi({reason:`multisig nesting depth exceeds ${Sg}`,serialized:n});const c=MN(a);if(!Array.isArray(c)||c.length!==2)throw new Bi({reason:"invalid multisig wire shape: expected exactly two fields",serialized:n});const[l,u]=c;if(!Array.isArray(u)||u.some(Array.isArray))throw new Bi({reason:"invalid multisig signatures list",serialized:n});if(u.length===0)throw new Bi({reason:"multisig signatures cannot be empty",serialized:n});if(u.length>Eg)throw new Bi({reason:`multisig signatures exceed ${Eg}`,serialized:n});for(const p of u)if(bi(p)>Ag)throw new Bi({reason:`multisig owner signature exceeds ${Ag} bytes`,serialized:n});if(!Array.isArray(l)&&!ep(l))throw new Bi({reason:"invalid multisig account",serialized:n});if(Array.isArray(l)){const[p,g,y]=l;if(l.length!==3||Array.isArray(p)||bi(p)!==32||Array.isArray(g)||bi(g)>1||!Array.isArray(y)||y.some(v=>!Array.isArray(v)||v.length!==2||v.some(Array.isArray)||bi(v[1])>1))throw new Bi({reason:"invalid multisig init config",serialized:n})}const d=Array.isArray(l)?ste(l):void 0,h={type:"multisig",account:d?B2(d):l,signatures:u.map(p=>O7(p,o)),...d?{init:d}:{}};return yC(h,o),h}throw new Bi({reason:`Unknown signature type identifier: ${i}. Expected ${k7} (P256), ${$7} (WebAuthn), ${P7} (Keychain V1), ${b3} (Keychain V2), or ${R7} (Multisig)`,serialized:n})}function Ps(t,e){if(typeof t=="string")return Jp(t);if(typeof t=="object"&&t!==null&&"r"in t&&"s"in t&&"yParity"in t)return{signature:t,type:"secp256k1"};const n=Xp(t);if(n==="multisig"){const r=t,{genesisConfig:i,init:a,...s}=r,o=s.account?s.account:i?B2(i):s.account,c=a===!0?i:a||void 0;
2return{...s,account:o,signatures:s.signatures.map(l=>Ps(l)),...c?{init:gC(c)}:{},type:n}}return{...t,...n==="p256"?{prehash:t.prehash}:{},...n==="keychain"?{...typeof t=="object"&&t!==null&&"version"in t&&t.version?{}:{version:"v2"},...typeof t=="object"&&"keyId"in t&&t.keyId?{}:(()=>{const r=t.inner;return r.type==="p256"||r.type==="webAuthn"?{keyId:$o(r.publicKey)}:r.type==="secp256k1"&&e?.payload?{keyId:$o(hC({payload:e.payload,signature:r.signature}))}:{}})()}:{},type:n}}function ap(t){if(t.type==="secp256k1")return{signature:uN(t),type:"secp256k1"};if(t.type==="p256")return{prehash:t.preHash,publicKey:{prefix:4,x:un(t.pubKeyX),y:un(t.pubKeyY)},signature:{r:un(t.r),s:un(t.s)},type:"p256"};if(t.type==="webAuthn"){const e=t.webauthnData,n=bi(e);let r,i;for(let a=37;a<n;a++){const s=cN(Tn(e,a));if(s.startsWith("{")&&s.endsWith("}"))try{JSON.parse(s),r=Tn(e,0,a),i=s;break}catch{}}if(!r||!i)throw new Bi({reason:"Unable to parse WebAuthn metadata: could not extract valid authenticatorData and clientDataJSON",serialized:e});return{metadata:{authenticatorData:r,clientDataJSON:i},publicKey:{prefix:4,x:un(t.pubKeyX),y:un(t.pubKeyY)},signature:{r:un(t.r),s:un(t.s)},type:"webAuthn"}}if(t.type==="keychain"||"userAddress"in t&&"signature"in t){const e=t;return{type:"keychain",userAddress:e.userAddress,inner:ap(e.signature),...e.keyId?{keyId:e.keyId}:{},...e.version?{version:e.version}:{}}}if(t.type==="multisig"||"signatures"in t&&("account"in t||"init"in t)){const e=t,n=typeof e.account<"u",r=typeof e.init<"u";if(n===r)throw new hs({reason:"RPC multisig must contain exactly one of `account` or `init`"});const i=r?gC(e.init):void 0,s={type:"multisig",account:i?B2(i):e.account,signatures:e.signatures.map(o=>ap(o)),...i?{init:i}:{}};return Gp(s),s}throw new s2({envelope:t})}function Xp(t){if(typeof t!="object"||t===null)throw new s2({envelope:t});if("type"in t&&t.type)return t.type;if("signature"in t&&!("publicKey"in t)&&typeof t.signature=="object"&&t.signature!==null&&"r"in t.signature&&"s"in t.signature&&"yParity"in t.signature||"r"in t&&"s"in t&&"yParity"in t)return"secp256k1";if("signature"in t&&"prehash"in t&&"publicKey"in t&&typeof t.prehash=="boolean")return"p256";if("signature"in t&&"metadata"in t&&"publicKey"in t)return"webAuthn";if("userAddress"in t&&"inner"in t)return"keychain";if(("account"in t||"genesisConfig"in t||"init"in t)&&"signatures"in t)return"multisig";throw new s2({envelope:t})}function a2(t,e={}){const n=Xp(t);if(n==="secp256k1")return Gi(TX(t.signature),e.magic?Fl:"0x");if(n==="p256"){const r=t;return Gi(k7,Xe(r.signature.r,{size:32}),Xe(r.signature.s,{size:32}),Xe(r.publicKey.x,{size:32}),Xe(r.publicKey.y,{size:32}),Xe(r.prehash?1:0,{size:1}),e.magic?Fl:"0x")}if(n==="webAuthn"){const r=t,i=Gi(r.metadata.authenticatorData,Kp(r.metadata.clientDataJSON));return Gi($7,i,Xe(r.signature.r,{size:32}),Xe(r.signature.s,{size:32}),Xe(r.publicKey.x,{size:32}),Xe(r.publicKey.y,{size:32}),e.magic?Fl:"0x")}if(n==="keychain"){const r=t,i=r.version==="v1"?P7:b3;return Gi(i,r.userAddress,a2(r.inner),e.magic?Fl:"0x")}if(n==="multisig"){const r=t;return Gp(r),Gi(R7,fC([r.init?cte(r.init):r.account,r.signatures.map(i=>a2(i))]),e.magic?Fl:"0x")}throw new s2({envelope:t})}function lte(t){const{payload:e,signatures:n}=t,r=ote("genesisConfig"in t&&t.genesisConfig?{payload:e,genesisConfig:t.genesisConfig}:{payload:e,account:t.account});return n.map(i=>({key:un(Yp({payload:r,signature:i})),signature:i})).sort((i,a)=>i.key<a.key?-1:i.key>a.key?1:0).map(i=>i.signature)}function xg(t){const e=Xp(t);if(e==="secp256k1")return{...LX(t.signature),type:"secp256k1"};if(e==="p256"){const n=t;return{preHash:n.prehash,pubKeyX:Xe(n.publicKey.x,{size:32}),pubKeyY:Xe(n.publicKey.y,{size:32}),r:Xe(n.signature.r,{size:32}),s:Xe(n.signature.s,{size:32}),type:"p256"}}if(e==="webAuthn"){const n=t,r=Gi(n.metadata.authenticatorData,Kp(n.metadata.clientDataJSON));return{pubKeyX:Xe(n.publicKey.x,{size:32}),pubKeyY:Xe(n.publicKey.y,{size:32}),r:Xe(n.signature.r,{size:32}),s:Xe(n.signature.s,{size:32}),type:"webAuthn",webauthnData:r}}if(e==="keychain"){const n=t;return{type:"keychain",userAddress:n.userAddress,signature:xg(n.inner),...n.keyId?{keyId:n.keyId}:{},...n.version?{version:n.version}:{}}}if(e==="multisig"){const n=t;Gp(n);const r=n.signatures.map(i=>xg(i));return n.init?{init:{...n.init,salt:n.init.salt??j2,threshold:Number(n.init.threshold),owners:n.init.owners.map(a=>({...a,weight:Number(a.weight)}))},signatures:r}:{account:n.account,signatures:r}}throw new s2({envelope:t})}function dx(t,e){const{payload:n}=e,r=(()=>
2{if(e.address)return e.address;if(e.publicKey)return $o(e.publicKey)})();if(!r)return!1;const i=Ps(t);if(i.type==="secp256k1")return r?yee({address:r,payload:n,signature:i.signature}):!1;if(i.type==="p256"){const a=$o(i.publicKey);return yg(a,r)?zN({hash:i.prehash,publicKey:i.publicKey,payload:n,signature:i.signature}):!1}if(i.type==="webAuthn"){const a=$o(i.publicKey);return yg(a,r)?nte({challenge:eC(n),metadata:i.metadata,publicKey:i.publicKey,signature:i.signature}):!1}throw new ute(`Unable to verify signature envelope of type "${i.type}".`)}class s2 extends Wr{constructor({envelope:e}){super(`Unable to coerce value (\`${lN(e)}\`) to a valid signature envelope.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.CoercionError"})}}class M7 extends Wr{constructor({envelope:e,missing:n,type:r}){super(`Signature envelope of type "${r}" is missing required properties: ${n.map(i=>`\`${i}\``).join(", ")}. 3 4Provided: ${lN(e)}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.MissingPropertiesError"})}}let Bi=class extends Wr{constructor({reason:e,serialized:n}){super(`Unable to deserialize signature envelope: ${e}`,{metaMessages:[`Serialized: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidSerializedError"})}};class hs extends Wr{constructor({reason:e}){super(`Invalid native multisig owner approval: ${e}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.InvalidMultisigApprovalError"})}}class ute extends Wr{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureEnvelope.VerificationError"})}}function Ei(t){return t.startsWith("tempo")?dte(t).address:t}function dte(t){if(!t.startsWith("tempox"))throw new fte({address:t});const e=t.slice(6);return kX(e,{strict:!0}),{address:$X(e)}}let fte=class extends Wr{constructor({address:e}){super(`Tempo address "${e}" has an invalid prefix. Expected "tempox".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TempoAddress.InvalidPrefixError"})}};function hte(t,e={}){if(typeof t.chainId=="string")return GN(t);const n={...t,address:Ei(t.address)};return e.signature?{...n,signature:e.signature}:n}function GN(t){const{address:e,chainId:n,nonce:r}=t,i=ap(t.signature);return{address:e,chainId:Number(n),nonce:BigInt(r),signature:i}}function pte(t){return t.map(e=>GN(e))}function gte(t){const[e,n,r,i]=t,a={address:n,chainId:e==="0x"?0:Number(e),nonce:r==="0x"?0n:BigInt(r)};return i&&(a.signature=Jp(i)),hte(a)}function yte(t){const e=[];for(const n of t)e.push(gte(n));return e}function mte(t){const{address:e,chainId:n,nonce:r,signature:i}=t;return{address:e,chainId:Xe(n),nonce:Xe(r),signature:xg(i)}}function vte(t){return t.map(e=>mte(e))}function wte(t){const{address:e,chainId:n,nonce:r}=t,i=t.signature?a2(t.signature):void 0;return[n?Xe(n):"0x",e,r?Xe(r):"0x",...i?[i]:[]]}function bte(t){if(!t||t.length===0)return[];const e=[];for(const n of t)e.push(wte(n));return e}const _te="0x20c0";function YN(t){if(typeof t=="string"){const n=Ei(t);return vm(n),n}const e=Xe(t,{size:18});return Gi(_te,e)}function JN(t,e={}){if("keyId"in t)return XN(t);const n=t;n.witness!==void 0&&Qp(n.witness),n.signature&&o2(n.signature);const r={...n,address:Ei(n.address),...n.limits?{limits:n.limits.map(i=>({...i,token:Ei(i.token)}))}:{},...n.scopes?{scopes:n.scopes.map(i=>({...i,address:Ei(i.address),selector:mC(i.selector),...i.recipients?{recipients:i.recipients.map(a=>Ei(a))}:{}}))}:{}};if(e.signature){const i=Ps(e.signature);return o2(i),{...r,signature:i}}return r}function XN(t){const{allowedCalls:e,chainId:n,keyId:r,expiry:i,limits:a,keyType:s}=t,o=t.witness??void 0,c=t.isAdmin??void 0,l=t.account??void 0,u=ap(t.signature);o2(u),o!==void 0&&Qp(o);const d=e?e.flatMap(h=>!h.selectorRules||h.selectorRules.length===0?[{address:h.target}]:h.selectorRules.map(p=>({address:h.target,selector:Ite(p.selector),...p.recipients&&p.recipients.length>0?{recipients:p.recipients}:{}}
4))):void 0,f=l!==void 0&&c?{account:l,isAdmin:!0}:{};return{address:r,chainId:n==="0x"?0n:un(n),...i!=null?{expiry:Number(i)}:{},limits:a?.map(h=>({token:h.token,limit:BigInt(h.limit),...h.period&&Ig(h.period)>0?{period:Ig(h.period)}:{}})),...d?{scopes:d}:{},signature:u,type:s,...o!==void 0?{witness:o}:{},...f}}function Cte(t){const[e,n]=t,[r,i,a,...s]=e,o=(()=>{switch(i){case"0x":case"0x00":return"secp256k1";case"0x01":return"p256";case"0x02":return"webAuthn";default:throw new Error(`Invalid key type: ${i}`)}})(),[c,l,u,d,f,h]=s,p=n1(c)?void 0:Ig(c)||void 0,g=Array.isArray(l)&&l.length>0?l.map(C=>{const[x,$,T]=C;return{token:x,limit:xte($),...T!==void 0?{period:Ig(T)}:{}}}):void 0,y=Array.isArray(u)?u.flatMap(C=>{const[x,$]=C;return!Array.isArray($)||$.length===0?[{address:x}]:$.map(T=>{const[U,O]=T;return{address:x,selector:U,...Array.isArray(O)&&O.length>0?{recipients:O}:{}}})}):void 0,v=n1(d)?void 0:d;v!==void 0&&Qp(v);const b=(()=>{if(!n1(f)){if(f!=="0x01")throw new Lte(f);return!0}})(),w=n1(h)?void 0:h,_=w!==void 0&&b?{account:w,isAdmin:!0}:{},E={address:a,chainId:r==="0x"?0n:un(r),type:o,...p!==void 0?{expiry:p}:{},...g!==void 0?{limits:g}:{},...y!==void 0?{scopes:y}:{},...v!==void 0?{witness:v}:{},..._};if(n){const C=Jp(n);o2(C),E.signature=C}return JN(E)}function Ete(t){return Ste(t)}function Ste(t){const[e]=QN(t),n=fC(e);return D2(n)}function Ate(t){const{address:e,scopes:n,chainId:r,expiry:i,limits:a,type:s,signature:o,witness:c,isAdmin:l,account:u}=t;o2(o),c!==void 0&&Qp(c);const d=(()=>{if(!n)return;const f=new Map;for(const h of n){const p=h.address;f.has(p)||f.set(p,[]),h.selector&&f.get(p).push({selector:mC(h.selector),...h.recipients&&h.recipients.length>0?{recipients:h.recipients}:{}}
4)}return[...f.entries()].map(([h,p])=>({target:h,...p.length>0?{selectorRules:p}:{}}))})();return{chainId:r===0n?"0x":Xe(r),expiry:typeof i=="number"?Xe(i):null,keyId:Ei(e),keyType:s,limits:a?.map(({token:f,limit:h,period:p})=>({token:f,limit:Xe(h),...p?{period:N7(p)}:{}})),signature:xg(o),...d?{allowedCalls:d}:{},...c!==void 0?{witness:c}:{},...l?{isAdmin:!0}:{},...u!==void 0?{account:u}:{}}}function QN(t){const{address:e,chainId:n,scopes:r,expiry:i,limits:a,witness:s,isAdmin:o,account:c}=t;s!==void 0&&Qp(s);const l=(()=>{if(t.signature)return o2(t.signature),a2(t.signature)})(),u=(()=>{switch(t.type){case"secp256k1":return"0x";case"p256":return"0x01";case"webAuthn":return"0x02";default:throw new Error(`Invalid key type: ${t.type}`)}})(),d=a?.map(b=>{const w=[b.token,fx(b.limit)];return b.period&&b.period>0&&w.push(N7(b.period)),w}),f=(()=>{if(!r)return;const b=new Map;for(const w of r){const _=w.address;b.has(_)||b.set(_,[]),w.selector&&b.get(_).push([mC(w.selector),w.recipients??[]])}return[...b.entries()].map(([w,_])=>[w,_.map(([E,C])=>[E,C])])})(),h=s!==void 0||o||c!==void 0,p=[{value:i!=null&&i!==0?N7(i):void 0,placeholder:"0x"},{value:d,placeholder:h?"0x":[]},{value:f,placeholder:"0x"},{value:s,placeholder:"0x"},{value:o?"0x01":void 0,placeholder:"0x"},{value:c,placeholder:"0x"}];let g=-1;for(let b=p.length-1;b>=0;b--)if(p[b].value!==void 0){g=b;break}const y=p.slice(0,g+1).map(({value:b,placeholder:w})=>b??w);return[[fx(n),u,e,...y],...l?[l]:[]]}function fx(t){return t===0n?"0x":Xe(t)}function N7(t){return t===0?"0x":Xe(t)}function xte(t){return t==="0x"?0n:BigInt(t)}function Ig(t){return t==="0x"?0:vg(t)}function Ite(t){return typeof t=="string"?t:Array.isArray(t)?Yh(new Uint8Array(t)):t}function mC(t){if(t)return t.startsWith("0x")?t:PX(t)}function Qp(t){if(bi(t)!==32)throw new Tte(t)}function o2(t){if(t.type==="keychain"||t.type==="multisig")throw new kte(t.type)}function n1(t){return t===void 0||t==="0x"}class Tte extends Error{constructor(e){super(`Witness \`${e}\` must be exactly 32 bytes (got ${bi(e)} bytes).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidWitnessSizeError"})}}class Lte extends Error{constructor(e){super(`Admin marker \`${e}\` is invalid; expected \`0x01\` (TIP-1049).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidAdminMarkerError"})}}class kte extends Error{constructor(e){super(`Signature type \`${e}\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"KeyAuthorization.InvalidSignatureTypeError"})}}const eD={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"},tD={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function $te(t,e={}){if(!t)return null;const n=RX(t),r={...t,...n};return r.blockNumber=t.blockNumber?BigInt(t.blockNumber):null,"blockTimestamp"in t&&(r.blockTimestamp=t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0),r.data=t.input,r.gas=BigInt(t.gas??0n),r.nonce=BigInt(t.nonce??0n),r.transactionIndex=t.transactionIndex?Number(t.transactionIndex):null,r.value=BigInt(t.value??0n),t.authorizationList&&(r.authorizationList=OX(t.authorizationList)),t.chainId&&(r.chainId=Number(t.chainId)),t.gasPrice&&(r.gasPrice=BigInt(t.gasPrice)),t.maxFeePerBlobGas&&(r.maxFeePerBlobGas=BigInt(t.maxFeePerBlobGas)),t.maxFeePerGas&&(r.maxFeePerGas=BigInt(t.maxFeePerGas)),t.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=BigInt(t.maxPriorityFeePerGas)),t.type&&(r.type=tD[t.type]??t.type),n&&(r.v=dN(n.yParity)),r}const nD={...eD,tempo:"0x76"},Pte={...tD,"0x76":"tempo"};function Rte(t,e={}){if(!t)return null;const n=$te(t);return n.type=Pte[t.type],t.aaAuthorizationList&&(n.authorizationList=pte(t.aaAuthorizationList),delete n.aaAuthorizationList),t.calls&&(n.calls=t.calls.map(r=>({to:r.to,value:r.value&&r.value!=="0x"?BigInt(r.value):void 0,data:r.input||r.data||"0x"}
4))),t.feeToken&&(n.feeToken=t.feeToken),t.nonceKey&&(n.nonceKey=BigInt(t.nonceKey)),t.signature&&(n.signature=ap(t.signature)),t.validAfter&&(n.validAfter=Number(t.validAfter)),t.validBefore&&(n.validBefore=Number(t.validBefore)),t.keyAuthorization&&(n.keyAuthorization=XN(t.keyAuthorization)),t.feePayerSignature&&(n.feePayerSignature=uN(t.feePayerSignature),n.feePayerSignature.v=dN(n.feePayerSignature.yParity)),n}function Ote(t){const e={};return typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.authorizationList<"u"&&(e.authorizationList=MX(t.authorizationList)),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(e.blobs=t.blobs),typeof t.chainId<"u"&&(e.chainId=Xe(t.chainId)),typeof t.data<"u"?(e.data=t.data,e.input=t.data):typeof t.input<"u"&&(e.data=t.input,e.input=t.input),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=Xe(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=Xe(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=Xe(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=Xe(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=Xe(t.maxPriorityFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=Xe(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=Xe(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=eD[t.type]||t.type),typeof t.value<"u"&&(e.value=Xe(t.value)),e}function Mte(t){const e=Ote({...t,authorizationList:void 0});t.authorizationList&&(e.authorizationList=vte(t.authorizationList)),t.calls?e.calls=t.calls.map(r=>({to:r.to?Ei(r.to):r.to,value:r.value?Xe(r.value):"0x",data:r.data??"0x"})):(t.to||t.data||t.value)&&(e.calls=[{to:t.to?Ei(t.to):void 0,value:t.value?Xe(t.value):"0x",data:t.data??"0x"}]),typeof t.feeToken<"u"&&(e.feeToken=YN(t.feeToken)),t.keyAuthorization&&(e.keyAuthorization=Ate(t.keyAuthorization)),typeof t.validBefore<"u"&&(e.validBefore=Xe(t.validBefore)),typeof t.validAfter<"u"&&(e.validAfter=Xe(t.validAfter));const n=(()=>{if(t.nonceKey==="random")return fN(6);if(typeof t.nonceKey=="bigint")return Xe(t.nonceKey)})();return n&&(e.nonceKey=n),(typeof t.calls<"u"||typeof t.feePayer<"u"||typeof t.feeToken<"u"||typeof t.keyAuthorization<"u"||typeof t.nonceKey<"u"||typeof t.validBefore<"u"||typeof t.validAfter<"u"||t.type==="tempo")&&(e.type=nD.tempo,delete e.data,delete e.input,delete e.to,delete e.value),e}function Nte(t){const e=[];for(let n=0;n<t.length;n++){const[r,i]=t[n];r&&vm(r,{strict:!1}),e.push({address:r,storageKeys:i.map(a=>NX(a)?a:DX(a))})}return e}function Dte(t){if(!t||t.length===0)return[];const e=[];for(const{address:n,storageKeys:r}of t){for(let i=0;i<r.length;i++)if(bi(r[i])!==32)throw new Fte({storageKey:r[i]});n&&vm(n,{strict:!1}),e.push([n,r])}return e}class Fte extends Wr{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${bi(e)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}const hx={wei:0,gwei:9,szabo:12,finney:15,ether:18};function Ute(t,e=0){let n=t.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(e,"0");let[i,a]=[n.slice(0,n.length-e),n.slice(n.length-e)];return a=a.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${a?`.${a}`:""}`}function D7(t,e="wei"){return Ute(t,hx.gwei-hx[e])}class jte extends Wr{constructor({feeCap:e}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${e?` = ${D7(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}class Bte extends Wr{constructor({chainId:e}){super(typeof e<"u"?`Chain ID "${e}
4" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class Vte extends Wr{constructor({attributes:e,serialized:n,type:r}){const i=Object.entries(e).map(([a,s])=>typeof s>"u"?a:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${r}" was provided.`,{metaMessages:[`Serialized Transaction: "${n}"`,i.length>0?`Missing Attributes: ${i.join(", ")}`:""].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidSerializedError"})}}class Hte extends Wr{constructor({maxPriorityFeePerGas:e,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${D7(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${D7(n)} gwei`:""}).`].join(` 5`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}const Wte="0x78",qte="0x76",px="tempo";function vC(t){const{calls:e,chainId:n,maxFeePerGas:r,maxPriorityFeePerGas:i,validBefore:a,validAfter:s}=t;if(!e||e.length===0)throw new Yte;if(typeof a=="number"&&typeof s=="number"&&a<=s)throw new Jte({validBefore:a,validAfter:s});if(e)for(const o of e)o.to&&vm(o.to,{strict:!1});if(n<=0)throw new Bte({chainId:n});if(r&&BigInt(r)>2n**256n-1n)throw new jte({feeCap:r});if(i&&r&&i>r)throw new Hte({maxFeePerGas:r,maxPriorityFeePerGas:i})}function zte(t){const e=MN(Tn(t,1)),[n,r,i,a,s,o,c,l,u,d,f,h,p,g,y]=e,v=Array.isArray(g)?g:void 0,b=v?y:g;if(!(e.length===13||e.length===14||e.length===15))throw new Vte({attributes:{authorizationList:p,chainId:n,maxPriorityFeePerGas:r,maxFeePerGas:i,gas:a,calls:s,accessList:o,keyAuthorization:v,nonceKey:c,nonce:l,validBefore:u,validAfter:d,feeToken:f,feePayerSignatureOrSender:h,...e.length>12?{signature:b}:{}},serialized:t,type:px});let w={chainId:Number(n),type:px};if(rc(a)&&a!=="0x"&&(w.gas=BigInt(a)),rc(l)&&(w.nonce=l==="0x"?0n:BigInt(l)),rc(i)&&i!=="0x"&&(w.maxFeePerGas=BigInt(i)),rc(r)&&r!=="0x"&&(w.maxPriorityFeePerGas=BigInt(r)),rc(c)&&(w.nonceKey=c==="0x"?0n:BigInt(c)),rc(u)&&u!=="0x"&&(w.validBefore=Number(u)),rc(d)&&d!=="0x"&&(w.validAfter=Number(d)),rc(f)&&f!=="0x"&&(w.feeToken=f),s&&s!=="0x"){const E=s;w.calls=E.map(C=>{const[x,$,T]=C,U={};return x&&x!=="0x"&&(U.to=x),$&&$!=="0x"&&(U.value=BigInt($)),T&&T!=="0x"&&(U.data=T),U})}o?.length!==0&&o!=="0x"&&(w.accessList=Nte(o)),p?.length!==0&&p!=="0x"&&(w.authorizationList=yte(p)),h!=="0x"&&h!==void 0&&(h==="0x00"||ep(h)?(w.feePayerSignature=null,ep(h)&&(w.from=h)):w.feePayerSignature=UX(h)),v&&(w.keyAuthorization=Cte(v));const _=b?Jp(b):void 0;if(_&&(w={...w,signature:_}),!w.from&&_)try{w.from=Yp({payload:Lg(Tg(w)),signature:_,root:!0})}catch{}return vC(w),w}function Tg(t,e={}){const{feePayerSignature:n,signature:r}=e,i=typeof t=="string"?zte(t):t;return i.from&&(i.from=Ei(i.from)),i.calls&&(i.calls=i.calls.map(a=>({...a,...a.to?{to:Ei(a.to)}:{}}))),vC(i),{...i,...r?{signature:Ps(r)}:{},...n?{feePayerSignature:hN(n)}:{},type:"tempo"}}function kc(t,e={}){const{accessList:n,authorizationList:r,calls:i,chainId:a,feeToken:s,gas:o,keyAuthorization:c,nonce:l,nonceKey:u,maxFeePerGas:d,maxPriorityFeePerGas:f,validBefore:h,validAfter:p}=t;vC(t);const g=Dte(n),y=e.signature||t.signature,v=bte(r),b=i.map(C=>[C.to?Ei(C.to):"0x",C.value?Xe(C.value):"0x",C.data??"0x"]);let w=!1;const _=(()=>{if(e.sender)return e.sender;if(e.format==="feePayer"&&y){const x=Ps(y);if(x.type==="keychain")return x.userAddress;if(x.type==="p256"||x.type==="webAuthn")return $o(x.publicKey);if(x.type==="secp256k1")return UN({payload:Lg(Tg(t)),signature:x.signature})}const C=typeof e.feePayerSignature<"u"?e.feePayerSignature:t.feePayerSignature;return C===null?(w=!0,"0x00"):C?FX(C):"0x"})(),E=[Xe(a),f?Xe(f):"0x",d?Xe(d):"0x",o?Xe(o):"0x",b,g,u?Xe(u):"0x",l?Xe(l):"0x",typeof h=="number"?Xe(h):"0x",typeof p=="number"?Xe(p):"0x",!w&&(typeof s=="bigint"||typeof s=="string")?YN(s):"0x",_,v,...c?[QN(c)]:[],...y?[a2(Ps(y))]:[]];return Gi(e.format==="feePayer"?Wte:qte,fC(E))}function Zte(t){return kc({...t,signature:void 0,...t.feePayerSignature!==void 0?{feePayerSignature:null}:{}})}function Lg(t,e={}){const n=Kte(t,{presign:!0});return e.from?D2(Gi("0x04",n,Ei(e.from))):n}function Kte(t,e={}){const n=e.presign?Zte(t):kc(t);return D2(n)}function Gte(t,e){const n=Ei(e.sender),r=kc({...t,signature:void 0},{sender:n,format:"feePayer"});return D2(r)}class Yte extends Wr{constructor(){super("Calls list cannot be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.CallsEmptyError"})}}class Jte extends Wr{constructor({validBefore:e,validAfter:n}){super(`validBefore (${e}) must be greater than validAfter (${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TxEnvelopeTempo.InvalidValidityWindowError"})}}const ea=[{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]}],outputs:[]},{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"tuple",name:"config",components:[{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"uint64",name:"period"}]},{type:"bool",name:"allowAnyCalls"},{type:"tuple[]",name:"allowedCalls",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]}],outputs:[]},{name:"authorizeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"tuple",name:"config",components:[{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"tuple[]",name:"limits",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"uint64",name:"period"}]},{type:"bool",name:"allowAnyCalls"},{type:"tuple[]",name:"allowedCalls",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]},{type:"bytes32",name:"witness"}],outputs:[]},{name:"authorizeAdminKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"uint8",name:"signatureType"},{type:"bytes32",name:"witness"}],outputs:[]},{name:"burnKeyAuthorizationWitness",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"witness"}],outputs:[]},{name:"revokeKey",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"}],outputs:[]},{name:"updateSpendingLimit",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"address",name:"token"},{type:"uint256",name:"newLimit"}],outputs:[]},{name:"setAllowedCalls",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"tuple[]",name:"scopes",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}],outputs:[]},{name:"removeAllowedCalls",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"keyId"},{type:"address",name:"target"}],outputs:[]},{name:"getKey",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"tuple",components:[{type:"uint8",name:"signatureType"},{type:"address",name:"keyId"},{type:"uint64",name:"expiry"},{type:"bool",name:"enforceLimits"},{type:"bool",name:"isRevoked"}]}]},{name:"getRemainingLimit",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"remaining"}]},{name:"getRemainingLimitWithPeriod",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"remaining"},{type:"uint64",name:"periodEnd"}]},{name:"getAllowedCalls",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"bool",name:"isScoped"},{type:"tuple[]",name:"scopes",components:[{type:"address",name:"target"},{type:"tuple[]",name:"selectorRules",components:[{type:"bytes4",name:"selector"},{type:"address[]",name:"recipients"}]}]}]},{name:"isKeyAuthorizationWitnessBurned",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"witness"}],outputs:[{type:"bool"}]},{name:"isAdminKey",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"address",name:"keyId"}],outputs:[{type:"bool"}]},{name:"getTransactionKey",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"KeyAuthorized",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0},{type:"uint8",name:"signatureType"},{type:"uint64",name:"expiry"}]},{name:"AdminKeyAuthorized",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}]},{name:"KeyRevoked",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}]},{name:"SpendingLimitUpdated",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0}
5,{type:"address",name:"token",indexed:!0},{type:"uint256",name:"newLimit"}]},{name:"AccessKeySpend",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"address",name:"publicKey",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint256",name:"amount"},{type:"uint256",name:"remainingLimit"}]},{name:"KeyAuthorizationWitness",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"bytes32",name:"witness",indexed:!0}]},{name:"KeyAuthorizationWitnessBurned",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"bytes32",name:"witness",indexed:!0}]},{name:"UnauthorizedCaller",type:"error",inputs:[]},{name:"KeyAlreadyExists",type:"error",inputs:[]},{name:"KeyNotFound",type:"error",inputs:[]},{name:"KeyExpired",type:"error",inputs:[]},{name:"SpendingLimitExceeded",type:"error",inputs:[]},{name:"InvalidSpendingLimit",type:"error",inputs:[]},{name:"InvalidSignatureType",type:"error",inputs:[]},{name:"ZeroPublicKey",type:"error",inputs:[]},{name:"ExpiryInPast",type:"error",inputs:[]},{name:"KeyAlreadyRevoked",type:"error",inputs:[]},{name:"SignatureTypeMismatch",type:"error",inputs:[{type:"uint8",name:"expected"},{type:"uint8",name:"actual"}]},{name:"CallNotAllowed",type:"error",inputs:[]},{name:"InvalidCallScope",type:"error",inputs:[]},{name:"InvalidKeyId",type:"error",inputs:[]},{name:"InvalidKeyAuthorizationWitness",type:"error",inputs:[]},{name:"KeyAuthorizationWitnessAlreadyBurned",type:"error",inputs:[]},{name:"LegacyAuthorizeKeySelectorChanged",type:"error",inputs:[{type:"bytes4",name:"newSelector"}]}],Xte=[{name:"registerVirtualMaster",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"salt"}],outputs:[{type:"bytes4",name:"masterId"}]},{name:"getMaster",type:"function",stateMutability:"view",inputs:[{type:"bytes4",name:"masterId"}],outputs:[{type:"address"}]},{name:"resolveRecipient",type:"function",stateMutability:"view",inputs:[{type:"address",name:"to"}],outputs:[{type:"address",name:"effectiveRecipient"}]},{name:"resolveVirtualAddress",type:"function",stateMutability:"view",inputs:[{type:"address",name:"virtualAddr"}],outputs:[{type:"address",name:"master"}]},{name:"isVirtualAddress",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"addr"}],outputs:[{type:"bool"}]},{name:"decodeVirtualAddress",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"addr"}],outputs:[{type:"bool",name:"isVirtual"},{type:"bytes4",name:"masterId"},{type:"bytes6",name:"userTag"}]},{name:"isImplicitlyApproved",type:"function",stateMutability:"view",inputs:[{type:"address",name:"addr"}],outputs:[{type:"bool"}]},{name:"MasterRegistered",type:"event",inputs:[{type:"bytes4",name:"masterId",indexed:!0},{type:"address",name:"masterAddress",indexed:!0}]},{name:"MasterIdCollision",type:"error",inputs:[{type:"address",name:"master"}]},{name:"InvalidMasterAddress",type:"error",inputs:[]},{name:"ProofOfWorkFailed",type:"error",inputs:[]},{name:"VirtualAddressUnregistered",type:"error",inputs:[]}],Qte=[{name:"getNonce",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"uint256",name:"nonceKey"}],outputs:[{type:"uint64",name:"nonce"}]},{name:"NonceIncremented",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"uint256",name:"nonceKey",indexed:!0},{type:"uint64",name:"newNonce"}]},{name:"ProtocolNonceNotSupported",type:"error",inputs:[]},{name:"InvalidNonceKey",type:"error",inputs:[]},{name:"NonceOverflow",type:"error",inputs:[]},{name:"ExpiringNonceReplay",type:"error",inputs:[]},{name:"ExpiringNonceSetFull",type:"error",inputs:[]},{name:"InvalidExpiringNonceExpiry",type:"error",inputs:[]}],ene=[{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"receipt"}],outputs:[{type:"uint256",name:"amount"}]},{name:"claim",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"bytes",name:"receipt"}],outputs:[]},{name:"burnBlockedReceipt",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes",name:"receipt"}],outputs:[]},{name:"TransferBlocked",type:"event",inputs:[{type:"address",name:"token",
5indexed:!0},{type:"address",name:"receiver",indexed:!0},{type:"uint64",name:"blockedNonce",indexed:!0},{type:"uint256",name:"amount"},{type:"uint8",name:"receiptVersion"},{type:"bytes",name:"receipt"}]},{name:"ReceiptClaimed",type:"event",inputs:[{type:"address",name:"token",indexed:!0},{type:"address",name:"receiver",indexed:!0},{type:"uint64",name:"blockedNonce",indexed:!0},{type:"uint64",name:"blockedAt"},{type:"uint8",name:"receiptVersion"},{type:"address",name:"originator"},{type:"address",name:"recipient"},{type:"address",name:"recoveryAuthority"},{type:"address",name:"caller"},{type:"address",name:"to"},{type:"uint256",name:"amount"}]},{name:"ReceiptBurned",type:"event",inputs:[{type:"address",name:"token",indexed:!0},{type:"address",name:"receiver",indexed:!0},{type:"uint64",name:"blockedNonce",indexed:!0},{type:"uint64",name:"blockedAt"},{type:"uint8",name:"receiptVersion"},{type:"address",name:"originator"},{type:"address",name:"recipient"},{type:"address",name:"recoveryAuthority"},{type:"address",name:"caller"},{type:"uint256",name:"amount"}]},{name:"InvalidReceipt",type:"error",inputs:[]},{name:"InvalidClaimAddress",type:"error",inputs:[]},{name:"UnauthorizedClaimer",type:"error",inputs:[]},{name:"AddressReserved",type:"error",inputs:[]}],rD=[{name:"recover",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"address",name:"signer"}]},{name:"verify",type:"function",stateMutability:"view",inputs:[{type:"address",name:"signer"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"verifyKeychain",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"verifyKeychainAdmin",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"hash"},{type:"bytes",name:"signature"}],outputs:[{type:"bool"}]},{name:"InvalidFormat",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]}],tne=[{name:"createPair",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"base"}],outputs:[{type:"bytes32",name:"key"}]},{name:"place",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"}],outputs:[{type:"uint128",name:"orderId"}]},{name:"placeFlip",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"int16",name:"flipTick"}],outputs:[{type:"uint128",name:"orderId"}]},{name:"cancel",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint128",name:"orderId"}],outputs:[]},{name:"cancelStaleOrder",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint128",name:"orderId"}],outputs:[]},{name:"swapExactAmountIn",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountIn"},{type:"uint128",name:"minAmountOut"}],outputs:[{type:"uint128",name:"amountOut"}]},{name:"swapExactAmountOut",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountOut"},{type:"uint128",name:"maxAmountIn"}],outputs:[{type:"uint128",name:"amountIn"}]},{name:"quoteSwapExactAmountIn",type:"function",stateMutability:"view",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountIn"}],outputs:[{type:"uint128",name:"amountOut"}]},{name:"quoteSwapExactAmountOut",type:"function",stateMutability:"view",inputs:[{type:"address",name:"tokenIn"},{type:"address",name:"tokenOut"},{type:"uint128",name:"amountOut"}],outputs:[{type:"uint128",name:"amountIn"}]},{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"user"},{type:"address",name:"token"}],outputs:[{type:"uint128"}]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"},{type:"uint128",name:"amount"}],outputs:[]},{name:"getOrder",type:"function",stateMutability:"view",inputs:[{type:"uint128",name:"orderId"}],outputs:[{type:"tuple",components:[{type:"uint128",name:"orderId"},{type:"address",name:"maker"},{type:"bytes32",name:"bookKey"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"uint128",name:"amount"},{type:"uint128",name:"remaining"},{type:"uint128",name:"prev"},{type:"uint128",name:"next"},{type:"bool",name:"isFlip"},{type:"int16",name:"flipTick"}]}]},{name:"getTickLevel",type:"function",stateMutability:"view",inputs:[{type:"address",name:"base"},{type:"int16",name:"tick"},{type:"bool",name:"isBid"}],outputs:[{type:"uint128",name:"head"},{type:"uint128",name:"tail"},{type:"uint128",name:"totalLiquidity"}]},{name:"pairKey",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"tokenA"},{type:"address",name:"tokenB"}],outputs:[{type:"bytes32"}]},{name:"nextOrderId",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"books",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"pairKey"}],outputs:[{type:"tuple",components:[{type:"address",name:"base"},{type:"address",name:"quote"},{type:"int16",name:"bestBidTick"},{type:"int16",name:"bestAskTick"}]}]},{name:"MIN_TICK",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"int16"}]},{name:"MAX_TICK",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"int16"}]},{name:"TICK_SPACING",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"int16"}]},{name:"PRICE_SCALE",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint32"}]},{name:"MIN_ORDER_AMOUNT",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint128"}]},{name:"MIN_PRICE",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint32"}]},{name:"MAX_PRICE",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint32"}]},{name:"tickToPrice",type:"function",stateMutability:"pure",inputs:[{type:"int16",name:"tick"}],outputs:[{type:"uint32",name:"price"}]},{name:"priceToTick",type:"function",stateMutability:"pure",inputs:[{type:"uint32",name:"price"}],outputs:[{type:"int16",name:"tick"}]},{name:"PairCreated",type:"event",inputs:[{type:"bytes32",name:"key",indexed:!0},{type:"address",name:"base",indexed:!0},{type:"address",name:"quote",indexed:!0}]},{name:"OrderPlaced",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0}
5,{type:"address",name:"token",indexed:!0},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"bool",name:"isFlipOrder"},{type:"int16",name:"flipTick"}]},{name:"OrderFilled",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0},{type:"address",name:"taker",indexed:!0},{type:"uint128",name:"amountFilled"},{type:"bool",name:"partialFill"}]},{name:"OrderFlipped",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint128",name:"amount"},{type:"bool",name:"isBid"},{type:"int16",name:"tick"},{type:"int16",name:"flipTick"}]},{name:"FlipFailed",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0},{type:"address",name:"maker",indexed:!0},{type:"bytes4",name:"reason"}]},{name:"OrderCancelled",type:"event",inputs:[{type:"uint128",name:"orderId",indexed:!0}]},{name:"Unauthorized",type:"error",inputs:[]},{name:"PairDoesNotExist",type:"error",inputs:[]},{name:"PairAlreadyExists",type:"error",inputs:[]},{name:"OrderDoesNotExist",type:"error",inputs:[]},{name:"IdenticalTokens",type:"error",inputs:[]},{name:"InvalidToken",type:"error",inputs:[]},{name:"TickOutOfBounds",type:"error",inputs:[{type:"int16",name:"tick"}]},{name:"InvalidTick",type:"error",inputs:[]},{name:"InvalidFlipTick",type:"error",inputs:[]},{name:"InsufficientBalance",type:"error",inputs:[]},{name:"InsufficientLiquidity",type:"error",inputs:[]},{name:"InsufficientOutput",type:"error",inputs:[]},{name:"MaxInputExceeded",type:"error",inputs:[]},{name:"BelowMinimumOrderSize",type:"error",inputs:[{type:"uint128",name:"amount"}]},{name:"InvalidBaseToken",type:"error",inputs:[]},{name:"OrderNotStale",type:"error",inputs:[]}],nne=[{name:"name",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"symbol",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"decimals",type:"function",stateMutability:"pure",inputs:[],outputs:[{type:"uint8"}]},{name:"totalSupply",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"quoteToken",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"nextQuoteToken",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"balanceOf",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"uint256"}]},{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]},{name:"approve",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"spender"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"},{type:"address",name:"spender"}],outputs:[{type:"uint256"}]},{name:"transferFrom",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[{type:"bool"}]},{name:"mint",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]},{name:"burn",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"}],outputs:[]},{name:"currency",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"supplyCap",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"paused",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"transferPolicyId",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"logoURI",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{name:"setLogoURI",type:"function",stateMutability:"nonpayable",inputs:[{type:"string",name:"newLogoURI"}],outputs:[]},{name:"burnBlocked",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"from"},{type:"uint256",name:"amount"}],outputs:[]},{name:"mintWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[]},{name:"burnWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[]},{name:"transferWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[]},{name:"transferFromWithMemo",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo"}],outputs:[{type:"bool"}]},{name:"changeTransferPolicyId",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"newPolicyId"}],outputs:[]},{name:"setSupplyCap",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"newSupplyCap"}],outputs:[]},{name:"pause",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"unpause",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"setNextQuoteToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newQuoteToken"}],outputs:[]},{name:"completeQuoteTokenUpdate",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"PAUSE_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"UNPAUSE_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"ISSUER_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"BURN_BLOCKED_ROLE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"permit",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"owner"},{type:"address",name:"spender"},{type:"uint256",name:"value"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}],outputs:[]},{name:"nonces",type:"function",stateMutability:"view",inputs:[{type:"address",name:"owner"}],outputs:[{type:"uint256"}]},{name:"DOMAIN_SEPARATOR",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"distributeReward",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount"}],outputs:[]},{name:"setRewardRecipient",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"recipient"}],outputs:[]},{name:"claimRewards",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[{type:"uint256"}]},{name:"optedInSupply",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint128"}]},{name:"globalRewardPerToken",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"userRewardInfo",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"tuple",components:[{type:"address",name:"rewardRecipient"},{type:"uint256",name:"rewardPerToken"},{type:"uint256",name:"rewardBalance"}]}]},{name:"getPendingRewards",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"uint128"}]},{name:"Transfer",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"address",name:"to",indexed:!0},{type:"uint256",name:"amount"}]},{name:"Approval",type:"event",inputs:[{type:"address",name:"owner",indexed:!0},{type:"address",name:"spender",indexed:!0},{type:"uint256",name:"amount"}]},{name:"Mint",type:"event",inputs:[{type:"address",name:"to",indexed:!0},{type:"uint256",name:"amount"}]},{name:"Burn",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"uint256",name:"amount"}]},{name:"BurnBlocked",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"uint256",name:"amount"}]},{name:"TransferWithMemo",type:"event",inputs:[{type:"address",name:"from",indexed:!0},{type:"address",name:"to",indexed:!0},{type:"uint256",name:"amount"},{type:"bytes32",name:"memo",indexed:!0}]},{name:"TransferPolicyUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"uint64",name:"newPolicyId",indexed:!0}]},{name:"SupplyCapUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"uint256",name:"newSupplyCap",indexed:!0}]},{name:"PauseStateUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"bool",name:"isPaused"}]},{name:"NextQuoteTokenSet",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"address",name:"nextQuoteToken",indexed:!0}]},{name:"QuoteTokenUpdate",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"address",name:"newQuoteToken",indexed:!0}]},{name:"RewardDistributed",type:"event",inputs:[{type:"address",name:"funder",indexed:!0},{type:"uint256",name:"amount"}]},{name:"RewardRecipientSet",type:"event",inputs:[{type:"address",name:"holder",indexed:!0},{type:"address",name:"recipient",indexed:!0}]},{name:"LogoURIUpdated",type:"event",inputs:[{type:"address",name:"updater",indexed:!0},{type:"string",name:"newLogoURI"}]},{name:"InsufficientBalance",type:"error",inputs:[{type:"uint256",name:"available"},{type:"uint256",name:"required"},{type:"address",name:"token"}]},{name:"InsufficientAllowance",type:"error",inputs:[]},{name:"SupplyCapExceeded",type:"error",inputs:[]},{name:"InvalidSupplyCap",type:"error",inputs:[]},{name:"InvalidPayload",type:"error",inputs:[]},{name:"PolicyForbids",type:"error",inputs:[]},{name:"InvalidRecipient",type:"error",inputs:[]},{name:"ContractPaused",type:"error",inputs:[]},{name:"InvalidCurrency",type:"error",inputs:[]},{name:"InvalidQuoteToken",type:"error",inputs:[]},{name:"InvalidAmount",type:"error",inputs:[]},{name:"NoOptedInSupply",type:"error",inputs:[]},{name:"Unauthorized",type:"error",inputs:[]},{name:"ProtectedAddress",type:"error",inputs:[]},{name:"InvalidToken",type:"error",inputs:[]},{name:"Uninitialized",type:"error",inputs:[]},{name:"InvalidTransferPolicyId",type:"error",inputs:[]},{name:"PermitExpired",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]},{name:"LogoURITooLong",type:"error",inputs:[]},{name:"InvalidLogoURI",type:"error",inputs:[]},{name:"hasRole",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"},{type:"bytes32",name:"role"}],outputs:[{type:"bool"}]},{name:"getRoleAdmin",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"role"}],outputs:[{type:"bytes32"}]},{name:"grantRole",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"},{type:"address",name:"account"}],outputs:[]},{name:"revokeRole",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"},{type:"address",name:"account"}],outputs:[]},{name:"renounceRole",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"}],outputs:[]},{name:"setRoleAdmin",type:"function",stateMutability:"nonpayable",inputs:[{type:"bytes32",name:"role"},{type:"bytes32",name:"adminRole"}],outputs:[]},{name:"RoleMembershipUpdated",type:"event",inputs:[{type:"bytes32",name:"role",indexed:!0},{type:"address",name:"account",indexed:!0},{type:"address",name:"sender",indexed:!0},{type:"bool",name:"hasRole"}]},{name:"RoleAdminUpdated",type:"event",inputs:[{type:"bytes32",name:"role",indexed:!0},{type:"bytes32",name:"newAdminRole",indexed:!0},{type:"address",name:"sender",indexed:!0}]},{name:"Unauthorized",type:"error",inputs:[]}],rne=[{name:"CLOSE_GRACE_PERIOD",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"VOUCHER_TYPEHASH",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"open",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"uint96",name:"deposit"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"}],outputs:[{type:"bytes32",name:"channelId"}]},{name:"settle",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"uint96",name:"cumulativeAmount"},{type:"bytes",name:"signature"}],outputs:[]},{name:"topUp",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"uint96",name:"additionalDeposit"}],outputs:[]},{name:"close",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"uint96",name:"cumulativeAmount"},{type:"uint96",name:"captureAmount"},{type:"bytes",name:"signature"}],outputs:[]},{name:"requestClose",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]}],outputs:[]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]}],outputs:[]},{name:"getChannel",type:"function",stateMutability:"view",inputs:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]}],outputs:[{type:"tuple",components:[{type:"tuple",name:"descriptor",components:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}]},{type:"tuple",name:"state",components:[{type:"uint96",name:"settled"},{type:"uint96",name:"deposit"},{type:"uint32",name:"closeRequestedAt"}]}]}]},{name:"getChannelState",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"channelId"}],outputs:[{type:"tuple",components:[{type:"uint96",name:"settled"},{type:"uint96",name:"deposit"},{type:"uint32",name:"closeRequestedAt"}]}]},{name:"getChannelStatesBatch",type:"function",stateMutability:"view",inputs:[{type:"bytes32[]",name:"channelIds"}],outputs:[{type:"tuple[]",components:[{type:"uint96",name:"settled"},{type:"uint96",name:"deposit"},{type:"uint32",name:"closeRequestedAt"}]}]},{name:"computeChannelId",type:"function",stateMutability:"view",inputs:[{type:"address",name:"payer"},{type:"address",name:"payee"},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"bytes32",name:"salt"},{type:"address",name:"authorizedSigner"},{type:"bytes32",name:"expiringNonceHash"}],outputs:[{type:"bytes32"}]},{name:"getVoucherDigest",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"channelId"},{type:"uint96",name:"cumulativeAmount"}],outputs:[{type:"bytes32"}]},{name:"domainSeparator",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{name:"ChannelOpened",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"address",name:"operator"},{type:"address",name:"token"},{type:"address",name:"authorizedSigner"},{type
5:"bytes32",name:"salt"},{type:"bytes32",name:"expiringNonceHash"},{type:"uint96",name:"deposit"}]},{name:"Settled",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint96",name:"cumulativeAmount"},{type:"uint96",name:"deltaPaid"},{type:"uint96",name:"newSettled"}]},{name:"TopUp",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint96",name:"additionalDeposit"},{type:"uint96",name:"newDeposit"}]},{name:"CloseRequested",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint256",name:"closeGraceEnd"}]},{name:"ChannelClosed",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0},{type:"uint96",name:"settledToPayee"},{type:"uint96",name:"refundedToPayer"}]},{name:"CloseRequestCancelled",type:"event",inputs:[{type:"bytes32",name:"channelId",indexed:!0},{type:"address",name:"payer",indexed:!0},{type:"address",name:"payee",indexed:!0}]},{name:"ChannelAlreadyExists",type:"error",inputs:[]},{name:"ChannelNotFound",type:"error",inputs:[]},{name:"NotPayer",type:"error",inputs:[]},{name:"NotPayeeOrOperator",type:"error",inputs:[]},{name:"InvalidPayee",type:"error",inputs:[]},{name:"ZeroDeposit",type:"error",inputs:[]},{name:"ExpiringNonceHashNotSet",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]},{name:"AmountExceedsDeposit",type:"error",inputs:[]},{name:"AmountNotIncreasing",type:"error",inputs:[]},{name:"CaptureAmountInvalid",type:"error",inputs:[]},{name:"CloseNotReady",type:"error",inputs:[]},{name:"DepositOverflow",type:"error",inputs:[]}],ine=[{name:"createToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"string",name:"name"},{type:"string",name:"symbol"},{type:"string",name:"currency"},{type:"address",name:"quoteToken"},{type:"address",name:"admin"},{type:"bytes32",name:"salt"}],outputs:[{type:"address"}]},{name:"createToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"string",name:"name"},{type:"string",name:"symbol"},{type:"string",name:"currency"},{type:"address",name:"quoteToken"},{type:"address",name:"admin"},{type:"bytes32",name:"salt"},{type:"string",name:"logoURI"}],outputs:[{type:"address"}]},{name:"isTIP20",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"}],outputs:[{type:"bool"}]},{name:"getTokenAddress",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"sender"},{type:"bytes32",name:"salt"}],outputs:[{type:"address"}]},{name:"TokenCreated",type:"event",inputs:[{type:"address",name:"token",indexed:!0},{type:"string",name:"name"},{type:"string",name:"symbol"},{type:"string",name:"currency"},{type:"address",name:"quoteToken"},{type:"address",name:"admin"},{type:"bytes32",name:"salt"}]},{name:"AddressReserved",type:"error",inputs:[]},{name:"AddressNotReserved",type:"error",inputs:[]},{name:"InvalidQuoteToken",type:"error",inputs:[]},{name:"TokenAlreadyExists",type:"error",inputs:[{type:"address",name:"token"}]}],ane=[{name:"policyIdCounter",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"policyExists",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"}],outputs:[{type:"bool"}]},{name:"policyData",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"}],outputs:[{type:"uint8",name:"policyType"},{type:"address",name:"admin"}]},{name:"isAuthorized",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"isAuthorizedSender",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"isAuthorizedRecipient",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"isAuthorizedMintRecipient",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"user"}],outputs:[{type:"bool"}]},{name:"compoundPolicyData",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"policyId"}],outputs:[{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"recipientPolicyId"},{type:"uint64",name:"mintRecipientPolicyId"}]},{name:"receivePolicy",type:"function",stateMutability:"view",inputs:[{type:"address",name:"account"}],outputs:[{type:"bool",name:"hasReceivePolicy"},{type:"uint64",name:"senderPolicyId"},{type:"uint8",name:"senderPolicyType"},{type:"uint64",name:"tokenFilterId"},{type:"uint8",name:"tokenFilterType"},{type:"address",name:"recoveryAuthority"}]},{name:"validateReceivePolicy",type:"function",stateMutability:"view",inputs:[{type:"address",name:"token"},{type:"address",name:"sender"},{type:"address",name:"receiver"}],outputs:[{type:"bool",name:"authorized"},{type:"uint8",name:"blockedReason"}]},{name:"createPolicy",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"admin"},{type:"uint8",name:"policyType"}],outputs:[{type:"uint64"}]},{name:"createPolicyWithAccounts",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"admin"},{type:"uint8",name:"policyType"},{type:"address[]",name:"accounts"}],outputs:[{type:"uint64"}]},{name:"setPolicyAdmin",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"admin"}],outputs:[]},{name:"modifyPolicyWhitelist",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"account"},{type:"bool",name:"allowed"}
5],outputs:[]},{name:"modifyPolicyBlacklist",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"policyId"},{type:"address",name:"account"},{type:"bool",name:"restricted"}],outputs:[]},{name:"createCompoundPolicy",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"recipientPolicyId"},{type:"uint64",name:"mintRecipientPolicyId"}],outputs:[{type:"uint64"}]},{name:"setReceivePolicy",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"tokenFilterId"},{type:"address",name:"recoveryAuthority"}],outputs:[]},{name:"PolicyAdminUpdated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"address",name:"admin",indexed:!0}]},{name:"PolicyCreated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"uint8",name:"policyType"}]},{name:"WhitelistUpdated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"address",name:"account",indexed:!0},{type:"bool",name:"allowed"}]},{name:"BlacklistUpdated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"updater",indexed:!0},{type:"address",name:"account",indexed:!0},{type:"bool",name:"restricted"}]},{name:"CompoundPolicyCreated",type:"event",inputs:[{type:"uint64",name:"policyId",indexed:!0},{type:"address",name:"creator",indexed:!0},{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"recipientPolicyId"},{type:"uint64",name:"mintRecipientPolicyId"}]},{name:"ReceivePolicyUpdated",type:"event",inputs:[{type:"address",name:"account",indexed:!0},{type:"uint64",name:"senderPolicyId"},{type:"uint64",name:"tokenFilterId"},{type:"address",name:"recoveryAuthority"}]},{name:"Unauthorized",type:"error",inputs:[]},{name:"PolicyNotFound",type:"error",inputs:[]},{name:"PolicyNotSimple",type:"error",inputs:[]},{name:"InvalidPolicyType",type:"error",inputs:[]},{name:"IncompatiblePolicyType",type:"error",inputs:[]},{name:"VirtualAddressNotAllowed",type:"error",inputs:[]},{name:"InvalidReceivePolicyType",type:"error",inputs:[]},{name:"InvalidRecoveryAuthority",type:"error",inputs:[]}],sne=[{name:"userTokens",type:"function",stateMutability:"view",inputs:[{type:"address",name:"user"}],outputs:[{type:"address"}]},{name:"validatorTokens",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validator"}],outputs:[{type:"address"}]},{name:"setUserToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[]},{name:"setValidatorToken",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"token"}],outputs:[]},{name:"distributeFees",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"validator"},{type:"address",name:"token"}],outputs:[]},{name:"collectedFees",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validator"},{type:"address",name:"token"}],outputs:[{type:"uint256"}]},{name:"UserTokenSet",type:"event",inputs:[{type:"address",name:"user",indexed:!0},{type:"address",name:"token",indexed:!0}]},{name:"ValidatorTokenSet",type:"event",inputs:[{type:"address",name:"validator",indexed:!0},{type:"address",name:"token",indexed:!0}]},{name:"FeesDistributed",type:"event",inputs:[{type:"address",name:"validator",indexed:!0},{type:"address",name:"token",indexed:!0},{type:"uint256",name:"amount"}]},{name:"InvalidToken",type:"error",inputs:[]},{name:"InsufficientFeeTokenBalance",type:"error",inputs:[]},{name:"CannotChangeWithinBlock",type:"error",inputs:[]}],one=[{name:"M",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"N",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"SCALE",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"MIN_LIQUIDITY",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{name:"getPoolId",type:"function",stateMutability:"pure",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"}],outputs:[{type:"bytes32"}]},{name:"getPool",type:"function",stateMutability:"view",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"}],outputs:[{type:"tuple",components:[{type:"uint128",name:"reserveUserToken"},{type:"uint128",name:"reserveValidatorToken"}]}]},{name:"pools",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"uint128",name:"reserveUserToken"},{type:"uint128",name:"reserveValidatorToken"}]}]},{name:"mint",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"},{type:"uint256",name:"amountValidatorToken"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"liquidity"}]},{name:"burn",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"},{type:"uint256",name:"liquidity"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amountUserToken"},{type:"uint256",name:"amountValidatorToken"}]},{name:"totalSupply",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{name:"liquidityBalances",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"uint256"}]},{name:"rebalanceSwap",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"userToken"},{type:"address",name:"validatorToken"},{type:"uint256",name:"amountOut"},{type:"address",name:"to"}],outputs:[{type:"uint256",name:"amountIn"}]},{name:"Mint",type:"event",inputs:[{type:"address",name:"sender"},{type:"address",name:"to",indexed:!0},{type:"address",name:"userToken",indexed:!0},{type:"address",name:"validatorToken",indexed:!0},{type:"uint256",name:"amountValidatorToken"},{type:"uint256",name:"liquidity"}]},{name:"Burn",type:"event",inputs:[{type:"address",name:"sender",indexed:!0},{type:"address",name:"userToken",indexed:!0},{type:"address",name:"validatorToken",indexed:!0},{type:"uint256",name:"amountUserToken"},{type:"uint256",name:"amountValidatorToken"},{type:"uint256",name:"liquidity"},{type:"address",name:"to"}]},{name:"RebalanceSwap",type:"event",inputs:[{type:"address",name:"userToken",indexed:!0},{type:"address",name:"validatorToken",indexed:!0},{type:"address",name:"swapper",indexed:!0},{type:"uint256",name:"amountIn"},{type:"uint256",name:"amountOut"}]},{name:"IdenticalAddresses",type:"error",inputs:[]},{name:"InvalidToken",type:"error",inputs:[]},{name:"InsufficientLiquidity",type:"error",inputs:[]},{name:"InsufficientReserves",type:"error",inputs:[]},{name:"InvalidAmount",type:"error",inputs:[]},{name:"DivisionByZero",type:"error",inputs:[]},{name:"InvalidSwapCalculation",type:"error",inputs:[]}],cne=[{name:"getValidators",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"tuple[]",name:"validators",components:[{type:"bytes32",name:"publicKey"},{type:"bool",name:"active"},{type:"uint64",name:"index"},{type:"address",name:"validatorAddress"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}]}]},{name:"addValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newValidatorAddress"},{type:"bytes32",name:"publicKey"},{type:"bool",name:"active"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}],outputs:[]}
5,{name:"updateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newValidatorAddress"},{type:"bytes32",name:"publicKey"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}],outputs:[]},{name:"changeValidatorStatus",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"validator"},{type:"bool",name:"active"}],outputs:[]},{name:"changeValidatorStatusByIndex",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"index"},{type:"bool",name:"active"}],outputs:[]},{name:"owner",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"changeOwner",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newOwner"}],outputs:[]},{name:"getNextFullDkgCeremony",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"setNextFullDkgCeremony",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"epoch"}],outputs:[]},{name:"validatorsArray",type:"function",stateMutability:"view",inputs:[{type:"uint256",name:"index"}],outputs:[{type:"address"}]},{name:"validators",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validator"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"bool",name:"active"},{type:"uint64",name:"index"},{type:"address",name:"validatorAddress"},{type:"string",name:"inboundAddress"},{type:"string",name:"outboundAddress"}]}]},{name:"validatorCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"Unauthorized",type:"error",inputs:[]},{name:"ValidatorAlreadyExists",type:"error",inputs:[]},{name:"ValidatorNotFound",type:"error",inputs:[]},{name:"InvalidPublicKey",type:"error",inputs:[]},{name:"NotHostPort",type:"error",inputs:[{type:"string",name:"field"},{type:"string",name:"input"},{type:"string",name:"backtrace"}]},{name:"NotIpPort",type:"error",inputs:[{type:"string",name:"field"},{type:"string",name:"input"},{type:"string",name:"backtrace"}]}],lne=[{type:"error",name:"DelegateCallNotAllowed",inputs:[]},{type:"error",name:"InvalidMode",inputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint64"}]},{type:"function",name:"modeOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint8"}]},{type:"function",name:"budgetOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint64"}]},{type:"function",name:"setMode",stateMutability:"nonpayable",inputs:[{name:"newMode",type:"uint8"}],outputs:[]},{type:"function",name:"setBudget",stateMutability:"nonpayable",inputs:[{name:"creditBudget",type:"uint64"}],outputs:[]}],une=[{name:"getActiveValidators",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"tuple[]",name:"validators",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]},{name:"getInitializedAtHeight",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"owner",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"address"}]},{name:"validatorCount",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"validatorByIndex",type:"function",stateMutability:"view",inputs:[{type:"uint64",name:"index"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]},{name:"validatorByAddress",type:"function",stateMutability:"view",inputs:[{type:"address",name:"validatorAddress"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]},{name:"validatorByPublicKey",type:"function",stateMutability:"view",inputs:[{type:"bytes32",name:"publicKey"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"publicKey"},{type:"address",name:"validatorAddress"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"uint64",name:"index"},{type:"uint64",name:"addedAtHeight"},{type:"uint64",name:"deactivatedAtHeight"}]}]}
5,{name:"getNextNetworkIdentityRotationEpoch",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"uint64"}]},{name:"isInitialized",type:"function",stateMutability:"view",inputs:[],outputs:[{type:"bool"}]},{name:"addValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"validatorAddress"},{type:"bytes32",name:"publicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"},{type:"bytes",name:"signature"}],outputs:[{type:"uint64",name:"index"}]},{name:"deactivateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"}],outputs:[]},{name:"rotateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"bytes32",name:"publicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"bytes",name:"signature"}],outputs:[]},{name:"setFeeRecipient",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"address",name:"feeRecipient"}],outputs:[]},{name:"setIpAddresses",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"string",name:"ingress"},{type:"string",name:"egress"}],outputs:[]},{name:"transferValidatorOwnership",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"},{type:"address",name:"newAddress"}],outputs:[]},{name:"transferOwnership",type:"function",stateMutability:"nonpayable",inputs:[{type:"address",name:"newOwner"}],outputs:[]},{name:"setNetworkIdentityRotationEpoch",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"epoch"}],outputs:[]},{name:"migrateValidator",type:"function",stateMutability:"nonpayable",inputs:[{type:"uint64",name:"idx"}],outputs:[]},{name:"initializeIfMigrated",type:"function",stateMutability:"nonpayable",inputs:[],outputs:[]},{name:"ValidatorAdded",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"publicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"feeRecipient"}]},{name:"ValidatorDeactivated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0}]},{name:"ValidatorRotated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"uint64",name:"deactivatedIndex",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"oldPublicKey"},{type:"bytes32",name:"newPublicKey"},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"caller"}]},{name:"FeeRecipientUpdated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"feeRecipient"},{type:"address",name:"caller"}]},{name:"IpAddressesUpdated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"string",name:"ingress"},{type:"string",name:"egress"},{type:"address",name:"caller"}]},{name:"ValidatorOwnershipTransferred",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"oldAddress",indexed:!0},{type:"address",name:"newAddress",indexed:!0},{type:"address",name:"caller"}]},{name:"OwnershipTransferred",type:"event",inputs:[{type:"address",name:"oldOwner",indexed:!0},{type:"address",name:"newOwner",indexed:!0}]},{name:"ValidatorMigrated",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"publicKey"}]},{name:"NetworkIdentityRotationEpochSet",type:"event",inputs:[{type:"uint64",name:"previousEpoch",indexed:!0},{type:"uint64",name:"nextEpoch",indexed:!0}]},{name:"Initialized",type:"event",inputs:[{type:"uint64",name:"height"}]},{name:"SkippedValidatorMigration",type:"event",inputs:[{type:"uint64",name:"index",indexed:!0},{type:"address",name:"validatorAddress",indexed:!0},{type:"bytes32",name:"publicKey"}]},{name:"AlreadyInitialized",type:"error",inputs:[]},{name:"IngressAlreadyExists",type:"error",inputs:[{type:"string",name:"ingress"}]},{name:"EmptyV1ValidatorSet",type:"error",inputs:[]},{name:"InvalidMigrationIndex",type:"error",inputs:[]},{name:"InvalidOwner",type:"error",inputs:[]},{name:"InvalidPublicKey",type:"error",inputs:[]},{name:"InvalidSignature",type:"error",inputs:[]},{name:"InvalidSignatureFormat",type:"error",inputs:[]},{name:"InvalidValidatorAddress",type:"error",inputs:[]},{name:"MigrationNotComplete",type:"error",inputs:[]},{name:"NotInitialized",type:"error",inputs:[]},{name:"NotIp",type:"error",inputs:[{type:"string",name:"input"},{type:"string",name:"backtrace"}]},{name:"NotIpPort",type:"error",inputs:[{type:"string",name:"input"},{type:"string",name:"backtrace"}]},{name:"PublicKeyAlreadyExists",type:"error",inputs:[]},{name:"Unauthorized",type:"error",inputs:[]},{name:"AddressAlreadyHasValidator",type:"error",inputs:[]},{name:"ValidatorAlreadyDeactivated",type:"error",inputs:[]},{name:"ValidatorNotFound",type:"error",inputs:[]}];[...ea,...Xte,...Qte,...ene,...rD,...tne,...lne,...nne,...rne,...ine,...ane,...sne,...one,...cne,...une];function iD(t){const e=t.account;return e?.keyType&&e.keyType!=="secp256k1"||e?.source==="accessKey"||e?.source==="multisig"||typeof t.calls<"u"||typeof t.feePayer<"u"||typeof t.feePayerSignature<"u"||typeof t.feeToken<"u"||typeof t.keyAuthorization<"u"||typeof t.multisig<"u"||typeof t.nonceKey<"u"||typeof t.signature<"u"||typeof t.signatures<"u"||typeof t.validBefore<"u"||typeof t.validAfter<"u"?"tempo":t.type?t.type:jX(t)}function wC(t){try{return iD(t)==="tempo"}catch{return!1}}async function dne(t,e){if(!wC(t)){if(e&&"type"in e&&e.type!=="secp256k1")throw new Error("Unsupported signature type. Expected `secp256k1` but got `"+e.type+"`.");if(e&&"type"in e){const{r,s:i,yParity:a}=e?.signature;return x7(t,{r:Xe(r,{size:32}),s:Xe(i,{size:32}),yParity:a})}return x7(t,e)}if(iD(t)==="tempo")return fne(t,e);throw new Error("Unsupported transaction type")}async function fne(t,e){const n=(()=>
5{if(t.signature)return t.signature;if(e&&"type"in e)return e;if(e)return Ps({r:BigInt(e.r),s:BigInt(e.s),yParity:Number(e.yParity)})})(),{chainId:r,feePayer:i,nonce:a,...s}=t,o=(()=>{const h=t.feePayerSignature;if(h)return{r:BigInt(h.r),s:BigInt(h.s),yParity:Number(h.yParity)};if(h===null||i)return null})(),c=typeof t.feePayerSignature<"u"&&t.feePayerSignature!==null,l=i===!0&&(!n||!o)||typeof i=="object"&&!n||!n&&c,u={...s,calls:s.calls?.length?s.calls:[{to:s.to||(!s.data||s.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:s.value,data:s.data}],chainId:Number(r),feePayerSignature:o,type:"tempo",...a?{nonce:BigInt(a)}:{}},d={...u};l&&delete d.feeToken;const f=(()=>{if(n)return n;if(!t.multisig||!t.signatures)return;const h=Lg(Tg(d)),p=t.signatures.map(y=>Ps(y)),g=lte({payload:h,signatures:p,genesisConfig:t.multisig});return Ps({genesisConfig:t.multisig,signatures:g,...a||t.nonceKey?{}:{init:!0}})})();if(f&&typeof t.feePayer=="object"){const h=Tg(u,{signature:f}),p=t.from??Yp({payload:Lg(h),root:!0,signature:f}),g=Gte(h,{sender:p}),y=await t.feePayer.sign({hash:g});return kc(h,{feePayerSignature:hN(y)})}return i===!0||!f&&c?f&&o?kc(d,{signature:f}):f?kc(d,{format:"feePayer",sender:t.from,signature:f}):kc(d,{feePayerSignature:null}):kc(d,{feePayerSignature:void 0,signature:f})}function hne(t){return t.source==="accessKey"&&"accessKeyAddress"in t}async function pne(t,e){const{chainId:n,key:r,expiry:i,limits:a,scopes:s,witness:o,admin:c}=e,{accessKeyAddress:l,keyType:u}=gne(r),d=hne(t),f=d?{account:t.address}:{},h=c?{}:{expiry:i,limits:a,scopes:s},p=Ete({address:l,chainId:n,type:u,witness:o,...c?{isAdmin:!0}:{},...f,...h}),g=d?await t.sign({hash:p,raw:!0}):await t.sign({hash:p});return JN({address:l,chainId:n,signature:Ps(g),type:u,...o?{witness:o}:{},...c?{isAdmin:!0}:{},...f,...h})}function gne(t){return"accessKeyAddress"in t?{accessKeyAddress:t.accessKeyAddress,keyType:t.keyType}:"publicKey"in t&&t.publicKey?{accessKeyAddress:$o(BX(t.publicKey)),keyType:t.type}:{accessKeyAddress:t.address,keyType:t.type}}const el="0xaAAAaaAA00000000000000000000000000000000",yne="0x5165300000000000000000000000000000000000",gx=["genesis","t0","t1","t1a","t1b","t1c","t2","t3","t4","t5","t6"];function mne(t,e){return gx.indexOf(t)<gx.indexOf(e)}function Mo(t){return{...t,data:Qi(t),to:t.address}}const vne={0:"secp256k1",1:"p256",2:"webAuthn"}
5,wne={true:"limited",false:"unlimited"};async function F7(t,e){return F7.inner(zp,t,e)}(function(t){async function e(r,i,a){const{accessKey:s,admin:o,chainId:c=i.chain?.id,expiry:l,limits:u,scopes:d,witness:f,...h}=a,p=h.account??i.account;if(!p)throw new Error("account is required.");if(!c)throw new Error("chainId is required.");const g=Dt(p),y=await pne(g,{chainId:BigInt(c),key:s,admin:o,expiry:l,limits:u,scopes:d,witness:f});return await r(i,{...h,keyAuthorization:y})}t.inner=e;function n(r){const[i]=N2({abi:ea,logs:r,eventName:"KeyAuthorized",strict:!0});if(!i)throw new Error("`KeyAuthorized` event not found.");return i}t.extractEvent=n})(F7||(F7={}));async function U7(t,e){return U7.inner(ol,t,e)}(function(t){async function e(i,a,s){const{witness:o,...c}=s,l=t.call({witness:o});return await i(a,{...c,...l})}t.inner=e;function n(i){const{witness:a}=i;return Mo({address:el,abi:ea,functionName:"burnKeyAuthorizationWitness",args:[a]})}t.call=n;function r(i){const[a]=N2({abi:ea,logs:i,eventName:"KeyAuthorizationWitnessBurned",strict:!0});if(!a)throw new Error("`KeyAuthorizationWitnessBurned` event not found.");return a}t.extractEvent=r})(U7||(U7={}));async function sp(t,e){const{account:n=t.account,accessKey:r,...i}=e;if(!n)throw new Error("account is required.");const a=Dt(n),s=await Us(t,{...i,account:null,...sp.call({account:a.address,accessKey:r})});return{address:s.keyId,keyType:vne[s.signatureType]??"secp256k1",expiry:s.expiry,spendPolicy:wne[`${s.enforceLimits}`],isRevoked:s.isRevoked}}(function(t){function e(n){const{account:r,accessKey:i}=n;return Mo({address:el,abi:ea,functionName:"getKey",args:[r,c2(i)]})}t.call=e})(sp||(sp={}));async function kg(t,e){const{account:n=t.account,accessKey:r,token:i,...a}=e;if(!n)throw new Error("account is required.");const s=Dt(n),o=t.chain?.hardfork;if(o&&mne(o,"t3"))return{remaining:await Us(t,{...a,...kg.call({account:s.address,accessKey:r,token:i})}),periodEnd:void 0};const[c,l]=await Us(t,{...a,...kg.callWithPeriod({account:s.address,accessKey:r,token:i})});return{remaining:c,periodEnd:l}}(function(t){function e(r){const{account:i,accessKey:a,token:s}=r;return Mo({address:el,abi:ea,functionName:"getRemainingLimit",args:[i,c2(a),s]})}t.call=e;function n(r){const{account:i,accessKey:a,token:s}=r;return Mo({address:el,abi:ea,functionName:"getRemainingLimitWithPeriod",args:[i,c2(a),s]})}t.callWithPeriod=n})(kg||(kg={}));async function j7(t,e){const{account:n=t.account,accessKey:r,...i}=e;if(!n)throw new Error("account is required.");const a=Dt(n);return Us(t,{...i,account:null,...j7.call({account:a.address,accessKey:r})})}(function(t){function e(n){const{account:r,accessKey:i}=n;return Mo({address:el,abi:ea,functionName:"isAdminKey",args:[r,c2(i)]})}t.call=e})(j7||(j7={}));async function B7(t,e){const{account:n=t.account,witness:r,...i}=e;if(!n)throw new Error("account is required.");const a=Dt(n);return Us(t,{...i,account:null,...B7.call({account:a.address,witness:r})})}(function(t){function e(n){const{account:r,witness:i}=n;return Mo({address:el,abi:ea,functionName:"isKeyAuthorizationWitnessBurned",args:[r,i]})}t.call=e})(B7||(B7={}));async function V7(t,e){return V7.inner(ol,t,e)}(function(t){async function e(i,a,s){const{accessKey:o,...c}=s,l=t.call({accessKey:o});return await i(a,{...c,...l})}t.inner=e;function n(i){const{accessKey:a}=i;return Mo({address:el,abi:ea,functionName:"revokeKey",args:[c2(a)]})}t.call=n;function r(i){const[a]=N2({abi:ea,logs:i,eventName:"KeyRevoked",strict:!0});if(!a)throw new Error("`KeyRevoked` event not found.");return a}t.extractEvent=r})(V7||(V7={}));async function H7(t,e){return H7.inner(ol,t,e)}(function(t){async function e(i,a,s){const{accessKey:o,token:c,limit:l,...u}=s,d=t.call({accessKey:o,token:c,limit:l});return await i(a,{...u,...d})}t.inner=e;function n(i){const{accessKey:a,token:s,limit:o}=i;return Mo({address:el,abi:ea,functionName:"updateSpendingLimit",args:[c2(a),s,o]})}t.call=n;function r(i){const[a]=N2({abi:ea,logs:i,eventName:"SpendingLimitUpdated",strict:!0});if(!a)throw new Error("`SpendingLimitUpdated` event not found.");return a}t.extractEvent=r})(H7||(H7={}));async function W7(t,e){const{account:n,admin:r,hash:i,signature:a,...s}=e;return Us(t,{...s,...W7.call({account:n,admin:r,hash:i,signature:a})})}(function(t){function e(n){const{account:r,admin:i=!0,hash:a,signature:s}=n;return Mo({address:yne,abi:rD,functionName:i?"verifyKeychainAdmin":"verifyKeychain",args:[r,a,s]})}t.call=e})(W7||(W7={}));function c2(t){return typeof t=="string"?t:t.accessKeyAddress}function bne(t){if(!wC(t))return VX(t);const e=t.blockTimestamp==null?void 0:BigInt(t.blockTimestamp),{feePayerSignature:n,gasPrice:r,nonce:i,...a}=Rte(t);return{...a,accessList:a.accessList,...typeof e<"u"&&{blockTimestamp:e},feePayerSignature:n?{r:Xe(n.r,{size:32}),s:Xe(n.s,{size:32}),v:BigInt(n.v??27),yParity:n.yParity}:void 0,nonce:Number(i),typeHex:nD[a.type],type:a.type}}function _ne(t){return HX(t)}function Cne(t,e){const n=t,r=n.account?Dt(n.account):void 0;if(!wC(n))return nN(t);e&&(n.calls=n.calls??[{to:t.to||(!t.data||t.data==="0x"?"0x0000000000000000000000000000000000000000":void 0),value:t.value,data:t.data}]),n.feePayer===!0&&!n.feePayerSignature&&delete n.feeToken;const{multisig:i,multisigInit:a,multisigSignatureCount:s,signatures:o,...c}=n,l=Mte({...c,type:"tempo"});e==="estimateGas"&&(l.maxFeePerGas=void 0,l.maxPriorityFeePerGas=void 0),l.to=void 0,l.data=void 0,l.value=void 0;const[u,d]=(()=>{const h=r&&"keyType"in r?r.keyType:r?.source;return h?h==="webAuthn"?["webAuthn","0x0578"]:["p256","secp256k1"].includes(h)?[h,void 0]:[n.keyType,yx(n.keyData)]:[n.keyType,yx(n.keyData)]})(),f=r&&"accessKeyAddress"in r?r.accessKeyAddress:n.keyId;return r&&(l.from=r.address),{...l,...a?{multisigInit:a}:{},...typeof s<"u"?{multisigSignatureCount:s}:{},...n.capabilities?{capabilities:n.capabilities}:{},...d?{keyData:d}:{},...f?{keyId:f}:{},...u?{keyType:u}:{},...typeof n.feePayer<"u"?{feePayer:typeof n.feePayer=="object"?Dt(n.feePayer):n.feePayer}:{},..."feePayerSignature"in n&&n.feePayerSignature!==void 0?{feePayerSignature:n.feePayerSignature}:{}}}function yx(t){if(!t)return t;const e=(t.length-2)/2;return e<=4?t:Xe(e,{size:2})}const Ju=new Map;async function Ene(t){Ju.set(t,(Ju.get(t)??0)+1),await Promise.resolve();const e=(Ju.get(t)??0)>1;return queueMicrotask(()=>{const n=Ju.get(t)??0;n<=1?Ju.delete(t):Ju.set(t,n-1)}),e}const Sne=25;function Ane(){const e=BigInt(Math.floor(Date.now()/1e3))-60n;return e<=0n?0:Number(BigInt(fN(8))%e)}const aD={blockTime:1e3,extendSchema:WX(),formatters:{transaction:qX({exclude:["aaAuthorizationList"],format:bne}),transactionReceipt:zX({format:_ne}),transactionRequest:ZX({format:Cne})},prepareTransactionRequest:[async(t,{client:e,phase:n})=>{const r=t;if(n==="afterFillParameters")return typeof r.gas<"u"&&r.feePayer&&!r.feePayerSignature&&(r.keyAuthorization?.signature.type==="webAuthn"?r.gas=(r.gas??0n)+20000n:r.account?.source==="accessKey"&&(r.gas=(r.gas??0n)+10000n)),r;const i=r.multisig??(r.account?.source==="multisig"?r.account.config:void 0);if(i){const s=gC(i);r.multisig=s,r.from=B2(s),r.multisigInit={salt:s.salt??j2,threshold:Number(s.threshold),owners:s.owners.map(o=>({owner:o.owner,weight:Number(o.weight)}))},r.multisigSignatureCount??=xne(s),r.account?.source!=="multisig"&&delete r.account}if(await(async()=>
5{if(r.nonceKey==="expiring"||r.nonceKey===XA)return!0;if(i)return!1;if(r.feePayer&&typeof r.nonceKey>"u")return!0;const s=r.account,o=typeof s=="string"?s:s?.address;return o&&typeof r.nonceKey>"u"?await Ene(o.toLowerCase()):!1})()?(r.nonceKey=XA,r.nonce=0,typeof r.validAfter>"u"&&(r.validAfter=Ane()),typeof r.validBefore>"u"&&(r.validBefore=Math.floor(Date.now()/1e3)+Sne)):typeof r.nonceKey<"u"&&(r.nonce=typeof r.nonce=="number"?r.nonce:0),!r.keyAuthorization&&r.account?.source==="accessKey"){const s=r.account.keyAuthorizationManager;if(s){const o=r.chainId??r.chain?.id;if(typeof o<"u"){const c=r.account.address,l=r.account.accessKeyAddress,u={address:c,accessKey:l,chainId:o},d=await s.get(u);if(d){const f=BigInt(Math.floor(Date.now()/1e3));if(d.expiry!=null&&BigInt(d.expiry)<=f)await s.remove(u);else{const h=await Zt(e,sp,"getMetadata")({account:c,accessKey:l});aN(h.address,l)&&!h.isRevoked&&h.expiry>f?await s.remove(u):r.keyAuthorization=d}}}}}return!r.feeToken&&r.chain?.feeToken&&(r.feeToken=r.chain.feeToken),r},{runAt:["beforeFillTransaction","afterFillParameters"]}],serializers:{transaction:(t,e)=>dne(t,e)},async verifyHash(t,e){const{address:n,hash:r,signature:i,mode:a}=e,s=(()=>{if(typeof i=="string")try{return Jp(i)}catch{return}})();if(s){if(s?.type==="keychain"&&a==="allowAccessKey"){const o=s.version==="v2"?F2(Gi("0x04",r,n)):r,c=(()=>{try{return Yp({payload:o,signature:s.inner})}catch{return}})();if(!c)return!1;const l=await sp(t,{account:n,accessKey:c,blockHash:e.blockHash,blockNumber:e.blockNumber,blockTag:e.blockTag,requireCanonical:e.requireCanonical});return l.isRevoked||l.expiry<=BigInt(Math.floor(Date.now()/1e3))?!1:dx(s.inner,{address:c,payload:o})}if(s.type==="p256"||s.type==="webAuthn"){const o=await oC(t,{address:n,blockHash:e.blockHash,blockNumber:e.blockNumber,blockTag:e.blockTag,requireCanonical:e.requireCanonical});if(!o||o==="0xef01007702c00000000000000000000000000000000000")return dx(s,{address:n,payload:r})}}return await Zt(t,KX,"verifyHash")({...e,chain:null})}};function xne(t){const e=Number(t.threshold),n=t.owners.map(i=>Number(i.weight)).sort((i,a)=>a-i);let r=0;for(const[i,a]of n.entries())if(r+=a,r>=e)return i+1;return n.length}const ou=ui({...aD,id:4217,blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.tempo.xyz"}},name:"Tempo Mainnet",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.tempo.xyz"],webSocket:["wss://rpc.tempo.xyz"]}}}),op=ui({...aD,id:42431,hardfork:"t5",blockExplorers:{default:{name:"Tempo Explorer",url:"https://explore.testnet.tempo.xyz"}},name:"Tempo Testnet (Moderato)",nativeCurrency:{name:"USD",symbol:"USD",decimals:6},rpcUrls:{default:{http:["https://rpc.moderato.tempo.xyz"],webSocket:["wss://rpc.moderato.tempo.xyz"]}},testnet:!0}),mx=ui({...pN,blockTime:200,id:324,name:"ZKsync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"ZKsync Explorer",url:"https://explorer.zksync.io/",apiUrl:"https://block-explorer-api.mainnet.zksync.io/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963",blockCreated:3908235},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:45659388}}}),vx=ui({...pN,blockTime:200,id:300,name:"ZKsync Sepolia Testnet",network:"zksync-sepolia-testnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.era.zksync.dev"],webSocket:["wss://sepolia.era.zksync.dev/ws"]}},blockExplorers:{default:{name:"ZKsync Explorer",url:"https://sepolia.explorer.zksync.io/",blockExplorerApi:"https://block-explorer-api.sepolia.zksync.dev/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:3855712}},testnet:!0});let g6=!1;async function e0({hash:t,privateKey:e,to:n="object"}){const{r,s:i,recovery:a}=O2.sign(t.slice(2),e.slice(2),{lowS:!0,extraEntropy:xo(g6,{strict:!1})?Q_(g6):g6}),s={r:Xi(r,{size:32}),s:Xi(i,{size:32}),v:a?28n:27n,yParity:a};return n==="bytes"||n==="hex"?GX({...s,to:n}):s}function xm(t){if(typeof t=="string"){if(!t2(t,{strict:!1}))throw new wg({address:t});return{address:t,type:"json-rpc"}}if(!t2(t.address,{strict:!1}))throw new wg({address:t.address});return{address:t.address,nonceManager:t.nonceManager,sign:t.sign,signAuthorization:t.signAuthorization,signMessage:t.signMessage,signTransaction:t.signTransaction,signTypedData:t.signTypedData,source:"custom",type:"local"}}function Ine(){return An(O2.utils.randomPrivateKey())}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bC=BigInt(0),q7=BigInt(1);function $g(t,e=""){if(typeof t!="boolean"){const n=e&&`"${e}"`;throw new Error(n+"expected boolean, got type="+typeof t)}return t}function zl(t,e,n=""){const r=cC(t),i=t?.length,a=e!==void 0;if(!r||a&&i!==e){const s=n&&`"${n}" `,o=a?` of length ${e}`:"",c=r?`length=${i}`:`type=${typeof t}`;throw new Error(s+"expected Uint8Array"+o+", got "+c)}return t}function r1(t){const e=t.toString(16);return e.length&1?"0"+e:e}function sD(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?bC:BigInt("0x"+t)}function Im(t){return sD(su(t))}function oD(t){return YX(t),sD(su(Uint8Array.from(t).reverse()))}function _C(t,e){return bg(t.toString(16).padStart(e*2,"0"))}function cD(t,e){return _C(t,e).reverse()}function wi(t,e,n){let r;if(typeof e=="string")try{r=bg(e)}catch(a){throw new Error(t+" must be hex string or Uint8Array, cause: "+a)}else if(cC(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function srt(t){return Uint8Array.from(t)}const y6=t=>typeof t=="bigint"&&bC<=t;function Tne(t,e,n){return y6(t)&&y6(e)&&y6(n)&&e<=t&&t<n}function Lne(t,e,n,r){if(!Tne(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function lD(t){let e;for(e=0;t>bC;t>>=q7,e+=1);return e}const t0=t=>(q7<<BigInt(t))-q7;function kne(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=h=>new Uint8Array(h),i=h=>Uint8Array.of(h);let a=r(t),s=r(t),o=0;const c=()=>{a.fill(1),s.fill(0),o=0},l=(...h)=>n(s,a,...h),u=(h=r(0))=>{s=l(i(0),h),a=l(),h.length!==0&&(s=l(i(1),h),a=l())},d=()=>
vendor: 28,511 bytes, line 5
5{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const p=[];for(;h<e;){a=l();const g=a.slice();p.push(g),h+=a.length}return Lc(...p)};return(h,p)=>{c(),u(h);let g;for(;!(g=p(d()));)u();return c(),g}}function CC(t,e,n={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function r(i,a,s){const o=t[i];if(s&&o===void 0)return;const c=typeof o;if(c!==a||o===null)throw new Error(`param "${i}" is invalid: expected ${a}, got ${c}`)}Object.entries(e).forEach(([i,a])=>r(i,a,!1)),Object.entries(n).forEach(([i,a])=>r(i,a,!0))}function wx(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const a=t(n,...r);return e.set(n,a),a}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Si=BigInt(0),_r=BigInt(1),Zl=BigInt(2),uD=BigInt(3),dD=BigInt(4),fD=BigInt(5),$ne=BigInt(7),hD=BigInt(8),Pne=BigInt(9),pD=BigInt(16);function ha(t,e){const n=t%e;return n>=Si?n:e+n}function ia(t,e,n){let r=t;for(;e-- >Si;)r*=r,r%=n;return r}function bx(t,e){if(t===Si)throw new Error("invert: expected non-zero number");if(e<=Si)throw new Error("invert: expected positive modulus, got "+e);let n=ha(t,e),r=e,i=Si,a=_r;for(;n!==Si;){const o=r/n,c=r%n,l=i-a*o;r=n,n=c,i=a,a=l}if(r!==_r)throw new Error("invert: does not exist");return ha(i,e)}function EC(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function gD(t,e){const n=(t.ORDER+_r)/dD,r=t.pow(e,n);return EC(t,r,e),r}function Rne(t,e){const n=(t.ORDER-fD)/hD,r=t.mul(e,Zl),i=t.pow(r,n),a=t.mul(e,i),s=t.mul(t.mul(a,Zl),i),o=t.mul(a,t.sub(s,t.ONE));return EC(t,o,e),o}function One(t){const e=n0(t),n=yD(t),r=n(e,e.neg(e.ONE)),i=n(e,r),a=n(e,e.neg(r)),s=(t+$ne)/pD;return(o,c)=>{let l=o.pow(c,s),u=o.mul(l,r);const d=o.mul(l,i),f=o.mul(l,a),h=o.eql(o.sqr(u),c),p=o.eql(o.sqr(d),c);l=o.cmov(l,u,h),u=o.cmov(f,d,p);const g=o.eql(o.sqr(u),c),y=o.cmov(l,u,g);return EC(o,y,c),y}}function yD(t){if(t<uD)throw new Error("sqrt is not defined for small field");let e=t-_r,n=0;for(;e%Zl===Si;)e/=Zl,n++;let r=Zl;const i=n0(t);for(;_x(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return gD;let a=i.pow(r,e);const s=(e+_r)/Zl;return function(c,l){if(c.is0(l))return l;if(_x(c,l)!==1)throw new Error("Cannot find square root");let u=n,d=c.mul(c.ONE,a),f=c.pow(l,e),h=c.pow(l,s);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let p=1,g=c.sqr(f);for(;!c.eql(g,c.ONE);)if(p++,g=c.sqr(g),p===u)throw new Error("Cannot find square root");const y=_r<<BigInt(u-p-1),v=c.pow(d,y);u=p,d=c.sqr(v),f=c.mul(f,d),h=c.mul(h,v)}return h}}function Mne(t){return t%dD===uD?gD:t%hD===fD?Rne:t%pD===Pne?One(t):yD(t)}const ort=(t,e)=>(ha(t,e)&_r)===_r,Nne=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Dne(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=Nne.reduce((r,i)=>(r[i]="function",r),e);return CC(t,n),t}function Fne(t,e,n){if(n<Si)throw new Error("invalid exponent, negatives unsupported");if(n===Si)return t.ONE;if(n===_r)return e;let r=t.ONE,i=e;for(;n>Si;)n&_r&&(r=t.mul(r,i)),i=t.sqr(i),n>>=_r;return r}function mD(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((s,o,c)=>t.is0(o)?s:(r[c]=s,t.mul(s,o)),t.ONE),a=t.inv(i);return e.reduceRight((s,o,c)=>t.is0(o)?s:(r[c]=t.mul(s,r[c]),t.mul(s,o)),a),r}function _x(t,e){const n=(t.ORDER-_r)/Zl,r=t.pow(e,n),i=t.eql(r,t.ONE),a=t.eql(r,t.ZERO),s=t.eql(r,t.neg(t.ONE));if(!i&&!a&&!s)throw new Error("invalid Legendre symbol result");return i?1:a?0:-1}function vD(t,e){e!==void 0&&JX(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function n0(t,e,n=!1,r={}){if(t<=Si)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,a,s=!1,o;if(typeof e=="object"&&e!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const f=e;f.BITS&&(i=f.BITS),f.sqrt&&(a=f.sqrt),typeof f.isLE=="boolean"&&(n=f.isLE),typeof f.modFromBytes=="boolean"&&(s=f.modFromBytes),o=f.allowedLengths}else typeof e=="number"&&(i=e),r.sqrt&&(a=r.sqrt);const{nBitLength:c,nByteLength:l}=vD(t,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:t,isLE:n,BITS:c,BYTES:l,MASK:t0(c),ZERO:Si,ONE:_r,allowedLengths:o,create:f=>ha(f,t),isValid:f=>{if(typeof f!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof f);return Si<=f&&f<t},is0:f=>f===Si,isValidNot0:f=>!d.is0(f)&&d.isValid(f),isOdd:f=>(f&_r)===_r,neg:f=>ha(-f,t),eql:(f,h)=>f===h,sqr:f=>ha(f*f,t),add:(f,h)=>ha(f+h,t),sub:(f,h)=>ha(f-h,t),mul:(f,h)=>ha(f*h,t),pow:(f,h)=>Fne(d,f,h),div:(f,h)=>ha(f*bx(h,t),t),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>bx(f,t),sqrt:a||(f=>(u||(u=Mne(t)),u(d,f))),toBytes:f=>n?cD(f,l):_C(f,l),fromBytes:(f,h=!0)=>{if(o){if(!o.includes(f.length)||f.length>l)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+f.length);const g=new Uint8Array(l);g.set(f,n?0:g.length-f.length),f=g}if(f.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+f.length);let p=n?oD(f):Im(f);if(s&&(p=ha(p,t)),!h&&!d.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p},invertBatch:f=>mD(d,f),cmov:(f,h,p)=>p?h:f});return Object.freeze(d)}function wD(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function bD(t){const e=wD(t);return e+Math.ceil(e/2)}function Une(t,e,n=!1){const r=t.length,i=wD(e),a=bD(e);if(r<16||r<a||r>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+r);const s=n?oD(t):Im(t),o=ha(s,e-_r)+_r;return n?cD(o,i):_C(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const l2=BigInt(0),Kl=BigInt(1);function Pg(t,e){const n=e.negate();return t?n:e}function m6(t,e){const n=mD(t.Fp,e.map(r=>r.Z));return e.map((r,i)=>t.fromAffine(r.toAffine(n[i])))}function _D(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function v6(t,e){_D(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,a=t0(t),s=BigInt(t);return{windows:n,windowSize:r,mask:a,maxNumber:i,shiftBy:s}}function Cx(t,e,n){const{windowSize:r,mask:i,maxNumber:a,shiftBy:s}=n;let o=Number(t&i),c=t>>s;o>r&&(o-=a,c+=Kl);const l=e*r,u=l+Math.abs(o)-1,d=o===0,f=o<0,h=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function jne(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function Bne(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const w6=new WeakMap,CD=new WeakMap;function b6(t){return CD.get(t)||1}function Ex(t){if(t!==l2)throw new Error("invalid wNAF")}class Vne{constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,r=this.ZERO){let i=e;for(;n>l2;)n&Kl&&(r=r.add(i)),i=i.double(),n>>=Kl;return r}precomputeWindow(e,n){const{windows:r,windowSize:i}=v6(n,this.bits),a=[];let s=e,o=s;for(let c=0;c<r;c++){o=s,a.push(o);for(let l=1;l<i;l++)o=o.add(s),a.push(o);s=o.double()}return a}wNAF(e,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let i=this.ZERO,a=this.BASE;const s=v6(e,this.bits);for(let o=0;o<s.windows;o++){const{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:f,offsetF:h}=Cx(r,o,s);r=c,u?a=a.add(Pg(f,n[h])):i=i.add(Pg(d,n[l]))}return Ex(r),{p:i,f:a}}wNAFUnsafe(e,n,r,i=this.ZERO){const a=v6(e,this.bits);for(let s=0;s<a.windows&&r!==l2;s++){const{nextN:o,offset:c,isZero:l,isNeg:u}=Cx(r,s,a);if(r=o,!l){const d=n[c];i=i.add(u?d.negate():d)}}return Ex(r),i}getPrecomputes(e,n,r){let i=w6.get(n);return i||(i=this.precomputeWindow(n,e),e!==1&&(typeof r=="function"&&(i=r(i)),w6.set(n,i))),i}cached(e,n,r){const i=b6(e);return this.wNAF(i,this.getPrecomputes(i,e,r),n)}unsafe(e,n,r,i){const a=b6(e);return a===1?this._unsafeLadder(e,n,i):this.wNAFUnsafe(a,this.getPrecomputes(a,e,r),n,i)}createCache(e,n){_D(n,this.bits),CD.set(e,n),w6.delete(e)}hasCache(e){return b6(e)!==1}}function Hne(t,e,n,r){let i=e,a=t.ZERO,s=t.ZERO;for(;n>l2||r>l2;)n&Kl&&(a=a.add(i)),r&Kl&&(s=s.add(i)),i=i.double(),n>>=Kl,r>>=Kl;return{p1:a,p2:s}}function Wne(t,e,n,r){jne(n,t),Bne(r,e);const i=n.length,a=r.length;if(i!==a)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,o=lD(BigInt(i));let c=1;o>12?c=o-3:o>4?c=o-2:o>0&&(c=2);const l=t0(c),u=new Array(Number(l)+1).fill(s),d=Math.floor((e.BITS-1)/c)*c;let f=s;for(let h=d;h>=0;h-=c){u.fill(s);for(let g=0;g<a;g++){const y=r[g],v=Number(y>>BigInt(h)&l);u[v]=u[v].add(n[g])}let p=s;for(let g=u.length-1,y=s;g>0;g--)y=y.add(u[g]),p=p.add(y);if(f=f.add(p),h!==0)for(let g=0;g<c;g++)f=f.double()}return f}function Sx(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Dne(e),e}else return n0(t,{isLE:n})}function qne(t,e,n={},r){if(r===void 0&&(r=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const c of["p","n","h"]){const l=e[c];if(!(typeof l=="bigint"&&l>l2))throw new Error(`CURVE.${c} must be positive bigint`)}const i=Sx(e.p,n.Fp,r),a=Sx(e.n,n.Fn,r),o=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(const c of o)if(!i.isValid(e[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:a}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ax=(t,e)=>(t+(t>=0?e:-e)/ED)/e;function zne(t,e,n){const[[r,i],[a,s]]=e,o=Ax(s*t,n),c=Ax(-i*t,n);let l=t-o*r-c*a,u=-o*i-c*s;const d=l<Io,f=u<Io;d&&(l=-l),f&&(u=-u);const h=t0(Math.ceil(lD(n)/2))+Fd;if(l<Io||l>=h||u<Io||u>=h)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:d,k1:l,k2neg:f,k2:u}}function z7(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function _6(t,e){const n={};for(let r of Object.keys(e))n[r]=t[r]===void 0?e[r]:t[r];return $g(n.lowS,"lowS"),$g(n.prehash,"prehash"),n.format!==void 0&&z7(n.format),n}class Zne extends Error{constructor(e=""){super(e)}}const wo={Err:Zne,_tlv:{encode:(t,e)=>{const{Err:n}=wo;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=r1(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const a=r>127?r1(i.length/2|128):"";return r1(t)+a+i+e},decode(t,e){const{Err:n}=wo;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],a=!!(i&128);let s=0;if(!a)s=i;else{const c=i&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=e.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)s=s<<8|u;if(r+=c,s<128)throw new n("tlv.decode(long): not minimal encoding")}const o=e.subarray(r,r+s);if(o.length!==s)throw new n("tlv.decode: wrong value length");return{v:o,l:e.subarray(r+s)}}},_int:{encode(t){const{Err:e}=wo;if(t<Io)throw new e("integer: negative integers are not allowed");let n=r1(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=wo;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Im(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=wo,i=wi("signature",t),{v:a,l:s}=r.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:o,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(o),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=wo,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),a=r+i;return e.encode(48,a)}},Io=BigInt(0),Fd=BigInt(1),ED=BigInt(2),i1=BigInt(3),Kne=BigInt(4);function Ad(t,e){const{BYTES:n}=t;let r;if(typeof e=="bigint")r=e;else{let i=wi("private key",e);try{r=t.fromBytes(i)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function Gne(t,e={}){const n=qne("weierstrass",t,e),{Fp:r,Fn:i}=n;let a=n.CURVE;const{h:s,n:o}=a;CC(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=e;if(c&&(!r.is0(a.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=AD(r,i);function u(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(F,k,S){const{x:I,y:A}=k.toAffine(),R=r.toBytes(I);if($g(S,"isCompressed"),S){u();const N=!r.isOdd(A);return Lc(SD(N),R)}else return Lc(Uint8Array.of(4),R,r.toBytes(A))}function f(F){zl(F,void 0,"Point");const{publicKey:k,publicKeyUncompressed:S}=l,I=F.length,A=F[0],R=F.subarray(1);if(I===k&&(A===2||A===3)){const N=r.fromBytes(R);if(!r.isValid(N))throw new Error("bad point: is not on curve, wrong x");const P=g(N);let j;try{j=r.sqrt(P)}catch(B){const G=B instanceof Error?": "+B.message:"";throw new Error("bad point: is not on curve, sqrt error"+G)}u();const M=r.isOdd(j);return(A&1)===1!==M&&(j=r.neg(j)),{x:N,y:j}}else if(I===S&&A===4){const N=r.BYTES,P=r.fromBytes(R.subarray(0,N)),j=r.fromBytes(R.subarray(N,N*2));if(!y(P,j))throw new Error("bad point: is not on curve");return{x:P,y:j}}else throw new Error(`bad point: got length ${I}, expected compressed=${k} or uncompressed=${S}`)}const h=e.toBytes||d,p=e.fromBytes||f;function g(F){const k=r.sqr(F),S=r.mul(k,F);return r.add(r.add(S,r.mul(F,a.a)),a.b)}function y(F,k){const S=r.sqr(k),I=g(F);return r.eql(S,I)}if(!y(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const v=r.mul(r.pow(a.a,i1),Kne),b=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(v,b)))throw new Error("bad curve params: a or b");function w(F,k,S=!1){if(!r.isValid(k)||S&&r.is0(k))throw new Error(`bad point coordinate ${F}`);return k}function _(F){if(!(F instanceof T))throw new Error("ProjectivePoint expected")}function E(F){if(!c||!c.basises)throw new Error("no endo");return zne(F,c.basises,i.ORDER)}const C=wx((F,k)=>{const{X:S,Y:I,Z:A}=F;if(r.eql(A,r.ONE))return{x:S,y:I};const R=F.is0();k==null&&(k=R?r.ONE:r.inv(A));const N=r.mul(S,k),P=r.mul(I,k),j=r.mul(A,k);if(R)return{x:r.ZERO,y:r.ZERO};if(!r.eql(j,r.ONE))throw new Error("invZ was invalid");return{x:N,y:P}}),x=wx(F=>{if(F.is0()){if(e.allowInfinityPoint&&!r.is0(F.Y))return;throw new Error("bad point: ZERO")}const{x:k,y:S}=F.toAffine();if(!r.isValid(k)||!r.isValid(S))throw new Error("bad point: x or y not field elements");if(!y(k,S))throw new Error("bad point: equation left != right");if(!F.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function $(F,k,S,I,A){return S=new T(r.mul(S.X,F),S.Y,S.Z),k=Pg(I,k),S=Pg(A,S),k.add(S)}class T{constructor(k,S,I){this.X=w("x",k),this.Y=w("y",S,!0),this.Z=w("z",I),Object.freeze(this)}static CURVE(){return a}static fromAffine(k){const{x:S,y:I}=k||{};if(!k||!r.isValid(S)||!r.isValid(I))throw new Error("invalid affine point");if(k instanceof T)throw new Error("projective point not allowed");return r.is0(S)&&r.is0(I)?T.ZERO:new T(S,I,r.ONE)}static fromBytes(k){const S=T.fromAffine(p(zl(k,void 0,"point")));return S.assertValidity(),S}static fromHex(k){return T.fromBytes(wi("pointHex",k))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(k=8,S=!0){return O.createCache(this,k),S||this.multiply(i1),this}assertValidity(){x(this)}hasEvenY(){const{y:k}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(k)}equals(k){_(k);const{X:S,Y:I,Z:A}=this,{X:R,Y:N,Z:P}=k,j=r.eql(r.mul(S,P),r.mul(R,A)),M=r.eql(r.mul(I,P),r.mul(N,A));return j&&M}negate(){return new T(this.X,r.neg(this.Y),this.Z)}double(){const{a:k,b:S}=a,I=r.mul(S,i1),{X:A,Y:R,Z:N}=this;let P=r.ZERO,j=r.ZERO,M=r.ZERO,V=r.mul(A,A),B=r.mul(R,R),G=r.mul(N,N),Z=r.mul(A,R);return Z=r.add(Z,Z),M=r.mul(A,N),M=r.add(M,M),P=r.mul(k,M),j=r.mul(I,G),j=r.add(P,j),P=r.sub(B,j),j=r.add(B,j),j=r.mul(P,j),P=r.mul(Z,P),M=r.mul(I,M),G=r.mul(k,G),Z=r.sub(V,G),Z=r.mul(k,Z),Z=r.add(Z,M),M=r.add(V,V),V=r.add(M,V),V=r.add(V,G),V=r.mul(V,Z),j=r.add(j,V),G=r.mul(R,N),G=r.add(G,G),V=r.mul(G,Z),P=r.sub(P,V),M=r.mul(G,B),M=r.add(M,M),M=r.add(M,M),new T(P,j,M)}add(k){_(k);const{X:S,Y:I,Z:A}=this,{X:R,Y:N,Z:P}=k;let j=r.ZERO,M=r.ZERO,V=r.ZERO;const B=a.a,G=r.mul(a.b,i1);let Z=r.mul(S,R),ie=r.mul(I,N),oe=r.mul(A,P),z=r.add(S,I),J=r.add(R,N);z=r.mul(z,J),J=r.add(Z,ie),z=r.sub(z,J),J=r.add(S,A);let K=r.add(R,P);return J=r.mul(J,K),K=r.add(Z,oe),J=r.sub(J,K),K=r.add(I,A),j=r.add(N,P),K=r.mul(K,j),j=r.add(ie,oe),K=r.sub(K,j),V=r.mul(B,J),j=r.mul(G,oe),V=r.add(j,V),j=r.sub(ie,V),V=r.add(ie,V),M=r.mul(j,V),ie=r.add(Z,Z),ie=r.add(ie,Z),oe=r.mul(B,oe),J=r.mul(G,J),ie=r.add(ie,oe),oe=r.sub(Z,oe),oe=r.mul(B,oe),J=r.add(J,oe),Z=r.mul(ie,J),M=r.add(M,Z),Z=r.mul(K,J),j=r.mul(z,j),j=r.sub(j,Z),Z=r.mul(z,ie),V=r.mul(K,V),V=r.add(V,Z),new T(j,M,V)}subtract(k){return this.add(k.negate())}is0(){return this.equals(T.ZERO)}multiply(k){const{endo:S}=e;if(!i.isValidNot0(k))throw new Error("invalid scalar: out of range");let I,A;const R=N=>O.cached(this,N,P=>m6(T,P));if(S){const{k1neg:N,k1:P,k2neg:j,k2:M}=E(k),{p:V,f:B}=R(P),{p:G,f:Z}=R(M);A=B.add(Z),I=$(S.beta,V,G,N,j)}else{const{p:N,f:P}=R(k);I=N,A=P}return m6(T,[I,A])[0]}multiplyUnsafe(k){const{endo:S}=e,I=this;if(!i.isValid(k))throw new Error("invalid scalar: out of range");if(k===Io||I.is0())return T.ZERO;if(k===Fd)return I;if(O.hasCache(this))return this.multiply(k);if(S){const{k1neg:A,k1:R,k2neg:N,k2:P}=E(k),{p1:j,p2:M}=Hne(T,I,R,P);return $(S.beta,j,M,A,N)}else return O.unsafe(I,k)}multiplyAndAddUnsafe(k,S,I){const A=this.multiplyUnsafe(S).add(k.multiplyUnsafe(I));return A.is0()?void 0:A}toAffine(k){return C(this,k)}isTorsionFree(){const{isTorsionFree:k}=e;return s===Fd?!0:k?k(T,this):O.unsafe(this,o).is0()}clearCofactor(){const{clearCofactor:k}=e;return s===Fd?this:k?k(T,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(k=!0){return $g(k,"isCompressed"),this.assertValidity(),h(T,this,k)}toHex(k=!0){return su(this.toBytes(k))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(k=!0){return this.toBytes(k)}_setWindowSize(k){this.precompute(k)}static normalizeZ(k){return m6(T,k)}static msm(k,S){return Wne(T,i,k,S)}static fromPrivateKey(k){return T.BASE.multiply(Ad(i,k))}}T.BASE=new T(a.Gx,a.Gy,r.ONE),T.ZERO=new T(r.ZERO,r.ONE,r.ZERO),T.Fp=r,T.Fn=i;const U=i.BITS,O=new Vne(T,e.endo?Math.ceil(U/2):U);return T.BASE.precompute(8),T}function SD(t){return Uint8Array.of(t?2:3)}function AD(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function Yne(t,e={}){const{Fn:n}=t,r=e.randomBytes||gN,i=Object.assign(AD(t.Fp,n),{seed:bD(n.ORDER)});function a(h){try{return!!Ad(n,h)}catch{return!1}}function s(h,p){const{publicKey:g,publicKeyUncompressed:y}=i;try{const v=h.length;return p===!0&&v!==g||p===!1&&v!==y?!1:!!t.fromBytes(h)}catch{return!1}}function o(h=r(i.seed)){return Une(zl(h,i.seed,"seed"),n.ORDER)}function c(h,p=!0){return t.BASE.multiply(Ad(n,h)).toBytes(p)}function l(h){const p=o(h);return{secretKey:p,publicKey:c(p)}}function u(h){if(typeof h=="bigint")return!1;if(h instanceof t)return!0;const{secretKey:p,publicKey:g,publicKeyUncompressed:y}=i;if(n.allowedLengths||p===g)return;const v=wi("key",h).length;return v===g||v===y}function d(h,p,g=!0){if(u(h)===!0)throw new Error("first arg must be private key");if(u(p)===!1)throw new Error("second arg must be public key");const y=Ad(n,h);return t.fromHex(p).multiply(y).toBytes(g)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:t,utils:{isValidSecretKey:a,isValidPublicKey:s,randomSecretKey:o,isValidPrivateKey:a,randomPrivateKey:o,normPrivateKeyToScalar:h=>Ad(n,h),precompute(h=8,p=t.BASE){return p.precompute(h,!1)}},lengths:i})}function Jne(t,e,n={}){XX(e),CC(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||gN,i=n.hmac||((S,...I)=>QX(e,S,Lc(...I))),{Fp:a,Fn:s}=t,{ORDER:o,BITS:c}=s,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h}=Yne(t,n),p={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},g="compact";function y(S){const I=o>>Fd;return S>I}function v(S,I){if(!s.isValidNot0(I))throw new Error(`invalid signature ${S}: out of range 1..Point.Fn.ORDER`);return I}function b(S,I){z7(I);const A=h.signature,R=I==="compact"?A:I==="recovered"?A+1:void 0;return zl(S,R,`${I} signature`)}class w{constructor(I,A,R){this.r=v("r",I),this.s=v("s",A),R!=null&&(this.recovery=R),Object.freeze(this)}static fromBytes(I,A=g){b(I,A);let R;if(A==="der"){const{r:M,s:V}=wo.toSig(zl(I));return new w(M,V)}A==="recovered"&&(R=I[0],A="compact",I=I.subarray(1));const N=s.BYTES,P=I.subarray(0,N),j=I.subarray(N,N*2);return new w(s.fromBytes(P),s.fromBytes(j),R)}static fromHex(I,A){return this.fromBytes(bg(I),A)}addRecoveryBit(I){return new w(this.r,this.s,I)}recoverPublicKey(I){const A=a.ORDER,{r:R,s:N,recovery:P}=this;if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");if(o*ED<A&&P>1)throw new Error("recovery id is ambiguous for h>1 curve");const M=P===2||P===3?R+o:R;if(!a.isValid(M))throw new Error("recovery id 2 or 3 invalid");const V=a.toBytes(M),B=t.fromBytes(Lc(SD((P&1)===0),V)),G=s.inv(M),Z=E(wi("msgHash",I)),ie=s.create(-Z*G),oe=s.create(N*G),z=t.BASE.multiplyUnsafe(ie).add(B.multiplyUnsafe(oe));if(z.is0())throw new Error("point at infinify");return z.assertValidity(),z}hasHighS(){return y(this.s)}toBytes(I=g){if(z7(I),I==="der")return bg(wo.hexFromSig(this));const A=s.toBytes(this.r),R=s.toBytes(this.s);if(I==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return Lc(Uint8Array.of(this.recovery),A,R)}return Lc(A,R)}toHex(I){return su(this.toBytes(I))}assertValidity(){}static fromCompact(I){return w.fromBytes(wi("sig",I),"compact")}static fromDER(I){return w.fromBytes(wi("sig",I),"der")}normalizeS(){return this.hasHighS()?new w(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return su(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return su(this.toBytes("compact"))}}const _=n.bits2int||function(I){if(I.length>8192)throw new Error("input is too large");const A=Im(I),R=I.length*8-c;return R>0?A>>BigInt(R):A},E=n.bits2int_modN||function(I){return s.create(_(I))},C=t0(c);function x(S){return Lne("num < 2^"+c,S,Io,C),s.toBytes(S)}function $(S,I){return zl(S,void 0,"message"),I?zl(e(S),void 0,"prehashed message"):S}function T(S,I,A){if(["recovered","canonical"].some(ie=>ie in A))throw new Error("sign() legacy options not supported");const{lowS:R,prehash:N,extraEntropy:P}=_6(A,p);S=$(S,N);const j=E(S),M=Ad(s,I),V=[x(M),x(j)];if(P!=null&&P!==!1){const ie=P===!0?r(h.secretKey):P;V.push(wi("extraEntropy",ie))}const B=Lc(...V),G=j;function Z(ie){const oe=_(ie);if(!s.isValidNot0(oe))return;const z=s.inv(oe),J=t.BASE.multiply(oe).toAffine(),K=s.create(J.x);if(K===Io)return;const ne=s.create(z*s.create(G+K*M));if(ne===Io)return;let ce=(J.x===K?0:2)|Number(J.y&Fd),xe=ne;return R&&y(ne)&&(xe=s.neg(ne),ce^=1),new w(K,xe,ce)}return{seed:B,k2sig:Z}}function U(S,I,A={}){S=wi("message",S);const{seed:R,k2sig:N}=T(S,I,A);return kne(e.outputLen,s.BYTES,i)(R,N)}function O(S){let I;const A=typeof S=="string"||cC(S),R=!A&&S!==null&&typeof S=="object"&&typeof S.r=="bigint"&&typeof S.s=="bigint";if(!A&&!R)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(R)I=new w(S.r,S.s);else if(A){try{I=w.fromBytes(wi("sig",S),"der")}catch(N){if(!(N instanceof wo.Err))throw N}if(!I)try{I=w.fromBytes(wi("sig",S),"compact")}catch{return!1}}return I||!1}function F(S,I,A,R={}){const{lowS:N,prehash:P,format:j}=_6(R,p);if(A=wi("publicKey",A),I=$(wi("message",I),P),"strict"in R)throw new Error("options.strict was renamed to lowS");const M=j===void 0?O(S):w.fromBytes(wi("sig",S),j);if(M===!1)return!1;try{const V=t.fromBytes(A);if(N&&M.hasHighS())return!1;const{r:B,s:G}=M,Z=E(I),ie=s.inv(G),oe=s.create(Z*ie),z=s.create(B*ie),J=t.BASE.multiplyUnsafe(oe).add(V.multiplyUnsafe(z));return J.is0()?!1:s.create(J.x)===B}catch{return!1}}function k(S,I,A={}){const{prehash:R}=_6(A,p);return I=$(I,R),w.fromBytes(S,"recovered").recoverPublicKey(I).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h,Point:t,sign:U,verify:F,recoverPublicKey:k,Signature:w,hash:e})}function Xne(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(s=>Math.ceil(s/2)))):void 0;const i=n0(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),a={Fp:n,Fn:i,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:a}}function Qne(t){const{CURVE:e,curveOpts:n}=Xne(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function ere(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,vD(n.Fn.ORDER,n.Fn.BITS))})}function tre(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:i}=Qne(t),a=Gne(e,n),s=Jne(a,r,i);return ere(t,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function nre(t,e){const n=r=>tre({...t,hash:r});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const SC={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},rre={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},xx=BigInt(2);function ire(t){const e=SC.p,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),s=BigInt(23),o=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,d=ia(u,n,e)*u%e,f=ia(d,n,e)*u%e,h=ia(f,xx,e)*l%e,p=ia(h,i,e)*h%e,g=ia(p,a,e)*p%e,y=ia(g,o,e)*g%e,v=ia(y,c,e)*y%e,b=ia(v,o,e)*g%e,w=ia(b,n,e)*u%e,_=ia(w,s,e)*p%e,E=ia(_,r,e)*l%e,C=ia(E,xx,e);if(!Z7.eql(Z7.sqr(C),t))throw new Error("Cannot find square root");return C}const Z7=n0(SC.p,{sqrt:ire}),K7=nre({...SC,Fp:Z7,lowS:!0,endo:rre},sN);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function AC(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function xC(t,...e){if(!AC(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function xD(t,e){return Array.isArray(e)?e.length===0?!0:t?e.every(n=>typeof n=="string"):e.every(n=>Number.isSafeInteger(n)):!1}function are(t){if(typeof t!="function")throw new Error("function expected");return!0}function u2(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function r0(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function Rg(t){if(!Array.isArray(t))throw new Error("array expected")}function Og(t,e){if(!xD(!0,e))throw new Error(`${t}
5: array of strings expected`)}function ID(t,e){if(!xD(!1,e))throw new Error(`${t}: array of numbers expected`)}function V2(...t){const e=a=>a,n=(a,s)=>o=>a(s(o)),r=t.map(a=>a.encode).reduceRight(n,e),i=t.map(a=>a.decode).reduce(n,e);return{encode:r,decode:i}}function H2(t){const e=typeof t=="string"?t.split(""):t,n=e.length;Og("alphabet",e);const r=new Map(e.map((i,a)=>[i,a]));return{encode:i=>(Rg(i),i.map(a=>{if(!Number.isSafeInteger(a)||a<0||a>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${a}". Allowed: ${t}`);return e[a]})),decode:i=>(Rg(i),i.map(a=>{u2("alphabet.decode",a);const s=r.get(a);if(s===void 0)throw new Error(`Unknown letter: "${a}". Allowed: ${t}`);return s}))}}function W2(t=""){return u2("join",t),{encode:e=>(Og("join.decode",e),e.join(t)),decode:e=>(u2("join.decode",e),e.split(t))}}function IC(t,e="="){return r0(t),u2("padding",e),{encode(n){for(Og("padding.encode",n);n.length*t%8;)n.push(e);return n},decode(n){Og("padding.decode",n);let r=n.length;if(r*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if((r-1)*t%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,r)}}}function sre(t){return are(t),{encode:e=>e,decode:e=>t(e)}}function Ix(t,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(Rg(t),!t.length)return[];let r=0;const i=[],a=Array.from(t,o=>{if(r0(o),o<0||o>=e)throw new Error(`invalid integer: ${o}`);return o}),s=a.length;for(;;){let o=0,c=!0;for(let l=r;l<s;l++){const u=a[l],d=e*o,f=d+u;if(!Number.isSafeInteger(f)||d/e!==o||f-u!==d)throw new Error("convertRadix: carry overflow");const h=f/n;o=f%n;const p=Math.floor(h);if(a[l]=p,!Number.isSafeInteger(p)||p*n+o!==f)throw new Error("convertRadix: carry overflow");if(c)p?c=!1:r=l;else continue}if(i.push(o),c)break}for(let o=0;o<t.length-1&&t[o]===0;o++)i.push(0);return i.reverse()}const TD=(t,e)=>e===0?t:TD(e,t%e),Mg=(t,e)=>t+(e-TD(t,e)),C6=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function Tx(t,e,n,r){if(Rg(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Mg(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${Mg(e,n)}`);let i=0,a=0;const s=C6[e],o=C6[n]-1,c=[];for(const l of t){if(r0(l),l>=s)throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);if(i=i<<e|l,a+e>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${e}`);for(a+=e;a>=n;a-=n)c.push((i>>a-n&o)>>>0);const u=C6[a];if(u===void 0)throw new Error("invalid carry");i&=u-1}if(i=i<<n-a&o,!r&&a>=e)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&a>0&&c.push(i>>>0),c}function ore(t){r0(t);const e=2**8;return{encode:n=>{if(!AC(n))throw new Error("radix.encode input should be Uint8Array");return Ix(Array.from(n),e,t)},decode:n=>(ID("radix.decode",n),Uint8Array.from(Ix(n,t,e)))}}function i0(t,e=!1){if(r0(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Mg(8,t)>32||Mg(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!AC(n))throw new Error("radix2.encode input should be Uint8Array");return Tx(Array.from(n),8,t,!e)},decode:n=>(ID("radix2.decode",n),Uint8Array.from(Tx(n,t,8,e)))}}const cre=V2(i0(5),H2("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),IC(5),W2("")),LD=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",kD=(t,e)=>{u2("base64",t);const n=e?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=e?"base64url":"base64";if(t.length>0&&!n.test(t))throw new Error("invalid base64");return Uint8Array.fromBase64(t,{alphabet:r,lastChunkHandling:"strict"})},Bc=LD?{encode(t){return xC(t),t.toBase64()},decode(t){return kD(t,!1)}}:V2(i0(6),H2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),IC(6),W2("")),$D=V2(i0(6),H2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),W2("")),Tm=LD?{encode(t){return xC(t),t.toBase64({alphabet:"base64url"})},decode(t){return kD(t,!0)}}:V2(i0(6),H2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),IC(6),W2("")),lre=t=>V2(ore(58),H2(t),W2("")),PD=lre("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),ure=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",dre={encode(t){return xC(t),t.toHex()},decode(t){return u2("hex",t),Uint8Array.fromHex(t)}},Lm=ure?dre:V2(i0(4),H2("0123456789abcdef"),W2(""),sre(t=>{if(typeof t!="string"||t.length%2!==0)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()}));async function fre(t){const{chainId:e,nonce:n,privateKey:r,to:i="object"}=t,a=t.contractAddress??t.address,s=await e0({hash:eQ({address:a,chainId:e,nonce:n}),privateKey:r,to:i});return i==="object"?{address:a,chainId:e,nonce:n,...s}:s}async function hre({message:t,privateKey:e}){return await e0({hash:yN(t),privateKey:e,to:"hex"})}async function pre(t){const{privateKey:e,transaction:n,serializer:r=x7}=t,i=n.type==="eip4844"?{...n,sidecars:!1}:n,a=await e0({hash:F2(await r(i)),privateKey:e});return await r(n,a)}async function gre(t){const{privateKey:e,...n}=t;return await e0({hash:mN(n),privateKey:e,to:"hex"})}function G7(t,e={}){const{nonceManager:n}=e,r=An(O2.getPublicKey(t.slice(2),!1)),i=tQ(r);return{...xm({address:i,nonceManager:n,async sign({hash:s}){return e0({hash:s,privateKey:t,to:"hex"})},async signAuthorization(s){return fre({...s,privateKey:t})},async signMessage({message:s}){return hre({message:s,privateKey:t})}
5,async signTransaction(s,{serializer:o}={}){return pre({privateKey:t,transaction:s,serializer:o})},async signTypedData(s){return gre({...s,privateKey:t})}}),publicKey:r,source:"privateKey"}}const RD=t=>{const{EIP712Domain:e,...n}=t;return n},OD=t=>{const e={};return typeof t.name=="string"&&(e.name=t.name),typeof t.version=="string"&&(e.version=t.version),typeof t.chainId=="number"?e.chainId=t.chainId:typeof t.chainId=="bigint"?e.chainId=Number(t.chainId):typeof t.chainId=="string"&&/^(0x[0-9a-fA-F]+|\d+)$/.test(t.chainId)&&(e.chainId=Number(BigInt(t.chainId))),typeof t.verifyingContract=="string"&&(e.verifyingContract=t.verifyingContract),typeof t.salt=="string"&&(e.salt=t.salt),e},rt=globalThis||void 0||self;var yre=class extends yJ{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:WA()},e)}getOptimisticResult(t){return t.behavior=WA(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:n}=t,r=super.createResult(t,e),{isFetching:i,isRefetching:a,isError:s,isRefetchError:o}=r,c=n.fetchMeta?.fetchMore?.direction,l=s&&c==="forward",u=i&&c==="forward",d=s&&c==="backward",f=i&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:bJ(e,n.data),hasPreviousPage:_J(e,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:o&&!l&&!d,isRefetching:a&&!u&&!f}}};function MD(t,e){return mJ(t,yre)}/** 6 * @license lucide-react v0.473.0 - ISC 7 * 8 * This source code is licensed under the ISC license. 9 * See the LICENSE file in the root directory of this source tree. 10 */const mre=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vre=CJ("ChevronLeft",mre);async function wre(t,e){let n;if(typeof e.connector=="function"?n=t._internal.connectors.setup(e.connector):n=e.connector,n.uid===t.state.current)throw new EJ;try{t.setState(s=>({...s,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const{connector:r,...i}=e,a=await n.connect(i);return n.emitter.off("connect",t._internal.events.connect),n.emitter.on("change",t._internal.events.change),n.emitter.on("disconnect",t._internal.events.disconnect),await t.storage?.setItem("recentConnectorId",n.id),t.setState(s=>({...s,connections:new Map(s.connections).set(n.uid,{accounts:i.withCapabilities?a.accounts.map(o=>typeof o=="object"?o.address:o):a.accounts,chainId:a.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:i.withCapabilities?a.accounts.map(s=>typeof s=="object"?s:{address:s,capabilities:{}}):a.accounts,chainId:a.chainId}}catch(r){throw t.setState(i=>({...i,status:i.current?"connected":"disconnected"})),r}}async function bre(t,e={}){let n;if(e.connector)n=e.connector;else{const{connections:i,current:a}=t.state;n=i.get(a)?.connector}const r=t.state.connections;n&&(await n.disconnect(),n.emitter.off("change",t._internal.events.change),n.emitter.off("disconnect",t._internal.events.disconnect),n.emitter.on("connect",t._internal.events.connect),r.delete(n.uid)),t.setState(i=>{if(r.size===0)return{...i,connections:new Map,current:null,status:"disconnected"};const a=r.values().next().value;return{...i,connections:new Map(r),current:a.connector.uid}});{const i=t.state.current;if(!i)return;const a=t.state.connections.get(i)?.connector;if(!a)return;await t.storage?.setItem("recentConnectorId",a.id)}}function ND(t){const e=t.state.current,n=t.state.connections.get(e),r=n?.accounts,i=r?.[0],a=t.chains.find(o=>o.id===n?.chainId),s=t.state.status;switch(s){case"connected":return{address:i,addresses:r,chain:a,chainId:n?.chainId,connector:n?.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:s};case"reconnecting":return{address:i,addresses:r,chain:a,chainId:n?.chainId,connector:n?.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:s};case"connecting":return{address:i,addresses:r,chain:a,chainId:n?.chainId,connector:n?.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:s};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:s}}}function Lx(t){return t.state.chainId}function pu(t,e){if(t===e)return!0;
10if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let n,r;if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!pu(t[r],e[r]))return!1;return!0}if(typeof t.valueOf=="function"&&t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.hasOwn(e,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(a&&!pu(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}let E6=[];function kx(t){const e=t.chains;return pu(E6,e)?E6:(E6=e,e)}let a1=[];function Y7(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||pu(a1,e)?a1:(a1=e,e)}let s1=[];function $x(t){const e=t.connectors;return s1.length===e.length&&s1.every((n,r)=>n===e[r])?s1:(s1=e,e)}async function _re(t,e={}){return(await SJ(t,e)).extend(VN)}let Xu=class extends AJ{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}};function Cre(t,e){const{onChange:n}=e;return t.subscribe(()=>ND(t),n,{equalityFn(r,i){const{connector:a,...s}=r,{connector:o,...c}=i;return pu(s,c)&&a?.id===o?.id&&a?.uid===o?.uid}})}function Ere(t,e){const{onChange:n}=e;return t.subscribe(r=>r.chainId,n)}function Sre(t,e){const{onChange:n}=e;return t.subscribe(()=>Y7(t),n,{equalityFn:pu})}function Are(t,e){const{onChange:n}=e;return t._internal.connectors.subscribe((r,i)=>{n(Object.values(r),i)})}TC.type="injected";function TC(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...xre[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l?.ethereum}}}let i,a,s,o;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:TC.type,async setup(){const l=await this.getProvider();l?.on&&t.target&&(s||(s=this.onConnect.bind(this),l.on("connect",s)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:u,withCapabilities:d}={}){const f=await this.getProvider();if(!f)throw new Xu;let h=[];if(u)h=await this.getAccounts().catch(()=>[]);else if(e)try{h=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0]?.caveats?.[0]?.value?.map(g=>_t(g)),h.length>0&&(h=await this.getAccounts())}catch(p){const g=p;if(g.code===ar.code)throw new ar(g);if(g.code===Dd.code)throw g}try{!h?.length&&!u&&(h=(await f.request({method:"eth_requestAccounts"})).map(y=>_t(y))),s&&(f.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),f.on("disconnect",o));let p=await this.getChainId();return l&&p!==l&&(p=(await this.switchChain({chainId:l}).catch(y=>{if(y.code===ar.code)throw y;return{id:p}}))?.id??p),e&&await c.storage?.removeItem(`${this.id}.disconnected`),t.target||await c.storage?.setItem("injected.connected",!0),{accounts:d?h.map(g=>({address:g,capabilities:{}})):h,chainId:p}}catch(p){const g=p;throw g.code===ar.code?new ar(g):g.code===Dd.code?new Dd(g):g}},async disconnect(){const l=await this.getProvider();if(!l)throw new Xu;a&&(l.removeListener("chainChanged",a),a=void 0),o&&(l.removeListener("disconnect",o),o=void 0),s||(s=this.onConnect.bind(this),l.on("connect",s));try{await vN(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await c.storage?.setItem(`${this.id}.disconnected`,!0),t.target||await c.storage?.removeItem("injected.connected")},async getAccounts(){const l=await this.getProvider();if(!l)throw new Xu;return(await l.request({method:"eth_accounts"})).map(d=>_t(d))},async getChainId(){const l=await this.getProvider();if(!l)throw new Xu;const u=await l.request({method:"eth_chainId"});return Number(u)}
10,async getProvider(){if(typeof window>"u")return;let l;const u=r();return typeof u.provider=="function"?l=u.provider(window):typeof u.provider=="string"?l=_3(window,u.provider):l=u.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){try{if(e&&await c.storage?.getItem(`${this.id}.disconnected`)||!t.target&&!await c.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const f=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",f),!!await this.getProvider()),h=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(g=>window.addEventListener("ethereum#initialized",()=>g(f()),{once:!0}))]:[],new Promise(g=>setTimeout(()=>g(f()),h))]))return!0}throw new Xu}return!!(await X_(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){const d=await this.getProvider();if(!d)throw new Xu;const f=c.chains.find(p=>p.id===u);if(!f)throw new tp(new E7);const h=new Promise(p=>{const g=y=>{"chainId"in y&&y.chainId===u&&(c.emitter.off("change",g),p())};c.emitter.on("change",g)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:Xi(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),h]),f}catch(p){const g=p;if(g.code===4902||g?.data?.originalError?.code===4902)try{const{default:y,...v}=f.blockExplorers??{};let b;l?.blockExplorerUrls?b=l.blockExplorerUrls:y&&(b=[y.url,...Object.values(v).map(E=>E.url)]);let w;l?.rpcUrls?.length?w=l.rpcUrls:w=[f.rpcUrls.default?.http[0]??""];const _={blockExplorerUrls:b,chainId:Xi(u),chainName:l?.chainName??f.name,iconUrls:l?.iconUrls,nativeCurrency:l?.nativeCurrency??f.nativeCurrency,rpcUrls:w};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[_]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new ar(new Error("User rejected switch after adding network."))}),h]),f}catch(y){throw new ar(y)}throw g.code===ar.code?new ar(g):new tp(g)}},async onAccountsChanged(l){if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const u=(await this.getChainId()).toString();this.onConnect({chainId:u}),e&&await c.storage?.removeItem(`${this.id}.disconnected`)}else c.emitter.emit("change",{accounts:l.map(u=>_t(u))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onConnect(l){const u=await this.getAccounts();if(u.length===0)return;const d=Number(l.chainId);c.emitter.emit("connect",{accounts:u,chainId:d});const f=await this.getProvider();f&&(s&&(f.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),f.on("disconnect",o)))},async onDisconnect(l){const u=await this.getProvider();l&&l.code===1013&&u&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),u&&(a&&(u.removeListener("chainChanged",a),a=void 0),o&&(u.removeListener("disconnect",o),o=void 0),s||(s=this.onConnect.bind(this),u.on("connect",s))))}})}const xre={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t?.coinbaseWalletExtension?t.coinbaseWalletExtension:_3(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return _3(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(e[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){return t?.phantom?.ethereum?t.phantom?.ethereum:_3(t,"isPhantom")}}};function _3(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r?.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}function Ire(t){if(typeof window>"u")return;const e=n=>t(n.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function DD(){const t=new Set;let e=[];const n=()=>Ire(i=>{e.some(({info:a})=>
10a.uuid===i.info.uuid)||(e=[...e,i],t.forEach(a=>a(e,{added:[i]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r?.()},findProvider({rdns:i}){return e.find(a=>a.info.rdns===i)},getProviders(){return e},reset(){this.clear(),r?.(),r=n()},subscribe(i,{emitImmediately:a}={}){return t.add(i),a&&i(e,{added:e}),()=>t.delete(i)}}}const Tre=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(s,o,c)=>{let l=s;if(o){const u=c?.equalityFn||Object.is;let d=s(r.getState());l=f=>{const h=s(f);if(!u(d,h)){const p=d;o(d=h,p)}},c?.fireImmediately&&o(d,d)}return i(l)},t(e,n,r)},Lre=Tre;function kre(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var a;const s=c=>c===null?null:JSON.parse(c,void 0),o=(a=n.getItem(i))!=null?a:null;return o instanceof Promise?o.then(s):s(o)},setItem:(i,a)=>n.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>n.removeItem(i)}}const J7=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return J7(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return J7(r)(n)}}}},$re=(t,e)=>(n,r,i)=>{let a={storage:kre(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},s=!1;const o=new Set,c=new Set;let l=a.storage;if(!l)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...g)},r,i);const u=()=>{const g=a.partialize({...r()});return l.setItem(a.name,{state:g,version:a.version})},d=i.setState;i.setState=(g,y)=>{d(g,y),u()};const f=t((...g)=>{n(...g),u()},r,i);i.getInitialState=()=>f;let h;const p=()=>{var g,y;if(!l)return;s=!1,o.forEach(b=>{var w;return b((w=r())!=null?w:f)});const v=((y=a.onRehydrateStorage)==null?void 0:y.call(a,(g=r())!=null?g:f))||void 0;return J7(l.getItem.bind(l))(a.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==a.version){if(a.migrate){const w=a.migrate(b.state,b.version);return w instanceof Promise?w.then(_=>[!0,_]):[!0,w]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var w;const[_,E]=b;if(h=a.merge(E,(w=r())!=null?w:f),n(h,!0),_)return u()}).then(()=>{v?.(h,void 0),h=r(),s=!0,c.forEach(b=>b(h))}).catch(b=>{v?.(void 0,b)})};return i.persist={setOptions:g=>{a={...a,...g},g.storage&&(l=g.storage)},clearStorage:()=>{l?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(o.add(g),()=>{o.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},a.skipHydration||p(),h||f},Pre=$re,Px=t=>{let e;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(e):l;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({}
10,e,d),n.forEach(h=>h(e,f))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=e=t(r,i,o);return o},C3=t=>t?Px(t):Px;var FD={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function a(c,l,u,d,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,d||c,f),p=n?n+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function s(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],u,d;if(this._eventsCount===0)return l;for(d in u=this._events)e.call(u,d)&&l.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},o.prototype.listeners=function(l){var u=n?n+l:l,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,h=d.length,p=new Array(h);f<h;f++)p[f]=d[f].fn;return p},o.prototype.listenerCount=function(l){var u=n?n+l:l,d=this._events[u];return d?d.fn?1:d.length:0},o.prototype.emit=function(l,u,d,f,h,p){var g=n?n+l:l;if(!this._events[g])return!1;var y=this._events[g],v=arguments.length,b,w;if(y.fn){switch(y.once&&this.removeListener(l,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,u),!0;case 3:return y.fn.call(y.context,u,d),!0;case 4:return y.fn.call(y.context,u,d,f),!0;case 5:return y.fn.call(y.context,u,d,f,h),!0;case 6:return y.fn.call(y.context,u,d,f,h,p),!0}for(w=1,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];y.fn.apply(y.context,b)}else{var _=y.length,E;for(w=0;w<_;w++)switch(y[w].once&&this.removeListener(l,y[w].fn,void 0,!0),v){case 1:y[w].fn.call(y[w].context);break;case 2:y[w].fn.call(y[w].context,u);break;case 3:y[w].fn.call(y[w].context,u,d);break;case 4:y[w].fn.call(y[w].context,u,d,f);break;default:if(!b)for(E=1,b=new Array(v-1);E<v;E++)b[E-1]=arguments[E];y[w].fn.apply(y[w].context,b)}}return!0},o.prototype.on=function(l,u,d){return a(this,l,u,d,!1)},o.prototype.once=function(l,u,d){return a(this,l,u,d,!0)},o.prototype.removeListener=function(l,u,d,f){var h=n?n+l:l;if(!this._events[h])return this;if(!u)return s(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!f||p.once)&&(!d||p.context===d)&&s(this,h);else{for(var g=0,y=[],v=p.length;g<v;g++)(p[g].fn!==u||f&&!p[g].once||d&&p[g].context!==d)&&y.push(p[g]);y.length?this._events[h]=y.length===1?y[0]:y:s(this,h)}return this},o.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(FD);var Rre=FD.exports;const ll=Zs(Rre);class Ore{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new ll})}on(e,n){this._emitter.on(e,n)}once(e,n){this._emitter.once(e,n)}off(e,n){this._emitter.off(e,n)}emit(e,...n){const r=n[0];this._emitter.emit(e,{uid:this.uid,...r})}listenerCount(e){return this._emitter.listenerCount(e)}}function Mre(t){return new Ore(t)}function Nre(t,e){return JSON.parse(t,(n,r)=>{let i=r;return i?.__type==="bigint"&&(i=BigInt(i.value)),i?.__type==="Map"&&(i=new Map(i.value)),e?.(n,i)??i})}function Rx(t,e){return t.slice(0,e).join(".")||"."}function Ox(t,e){const{length:n}=t;for(let r=0;r<n;++r)if(t[r]===e)return r+1;return 0}function Dre(t,e){const n=typeof t=="function",r=typeof e=="function",i=[],a=[];return function(o,c){if(typeof c=="object")if(i.length){const l=Ox(i,this);l===0?i[i.length]=this:(i.splice(l),a.splice(l)),a[a.length]=o;const u=Ox(i,c);if(u!==0)return r?e.call(this,o,c,Rx(a,u)):`[ref=${Rx(a,u)}]`}else i[0]=c,a[0]=o;return n?t.call(this,o,c):c}}function Fre(t,e,n,r){return JSON.stringify(t,Dre((i,a)=>{let s=a;return typeof s=="bigint"&&(s={__type:"bigint",value:a.toString()}),s instanceof Map&&(s={__type:"Map",value:Array.from(a.entries())}),e?.(i,s)??s},r),n??void 0)}function Ure(t){const{deserialize:e=Nre,key:n="wagmi",serialize:r=Fre,storage:i=UD}=t;function a(s){return s instanceof Promise?s.then(o=>o).catch(()=>null):s}return{...i,key:n,async getItem(s,o){const c=i.getItem(`${n}.${s}`),l=await a(c);return l?e(l)??null:o??null},async setItem(s,o){const c=`${n}.${s}`;o===null?await a(i.removeItem(c)):await a(i.setItem(c,r(o)))},async removeItem(s){await a(i.removeItem(`${n}.${s}`))}}}const UD={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function jre(){const t=typeof window<"u"&&window.localStorage?window.localStorage:UD;return{getItem(e){return t.getItem(e)},removeItem(e){t.removeItem(e)},setItem(e,n){try{t.setItem(e,n)}catch{}}}}const X7=256;let o1=X7,c1;function Bre(t=11){if(!c1||o1+t>X7*2){c1="",o1=0;for(let e=0;e<X7;e++)c1+=(256+Math.random()*256|0).toString(16).substring(1)}return c1.substring(o1,o1+++t)}function jD(t){const{multiInjectedProviderDiscovery:e=!0,storage:n=Ure({storage:jre()}),syncConnectedChain:r=!0,ssr:i=!1,...a}=t,s=typeof window<"u"&&e?DD():void 0,o=C3(()=>a.chains),c=C3(()=>{const E=[],C=new Set;for(const x of a.connectors??[]){const $=l(x);if(E.push($),!i&&$.rdns){const T=typeof $.rdns=="string"?[$.rdns]:$.rdns;for(const U of T)C.add(U)}}if(!i&&s){const x=s.getProviders();for(const $ of x)C.has($.info.rdns)||E.push(l(u($)))}return E});function l(E){const C=Mre(Bre()),x={...E({emitter:C,chains:o.getState(),storage:n,transports:a.transports}),emitter:C,uid:C.uid};return C.on("connect",w),x.setup?.(),x}function u(E){const{info:C}=E,x=E.provider;return TC({target:{...C,id:C.rdns,provider:x}})}const d=new Map;function f(E={}){const C=E.chainId??y.getState().chainId,x=o.getState().find(T=>T.id===C);if(E.chainId&&!x)throw new E7;{const T=d.get(y.getState().chainId);if(T&&!x)return T;if(!x)throw new E7}{const T=d.get(C);if(T)return T}let $;if(a.client)$=a.client({chain:x});else{const T=x.id,U=o.getState().map(k=>k.id),O={},F=Object.entries(a);for(const[k,S]of F)if(!(k==="chains"||k==="client"||k==="connectors"||k==="transports"))if(typeof S=="object")if(T in S)O[k]=S[T];else{if(U.some(A=>A in S))continue;O[k]=S}else O[k]=S;$=ym({...O,chain:x,batch:O.batch??{multicall:!0},transport:k=>a.transports[T]({...k,connectors:c})})}return d.set(C,$),$}function h(){return{chainId:o.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const g="0.0.0-canary-";f6.startsWith(g)?p=Number.parseInt(f6.replace(g,""),10):p=Number.parseInt(f6.split(".")[0]??"0",10);
10const y=C3(Lre(n?Pre(h,{migrate(E,C){if(C===p)return E;const x=h(),$=v(E,x.chainId);return{...x,chainId:$}},name:"store",partialize(E){return{connections:{__type:"Map",value:Array.from(E.connections.entries()).map(([C,x])=>{const{id:$,name:T,type:U,uid:O}=x.connector;return[C,{...x,connector:{id:$,name:T,type:U,uid:O}}]})},chainId:E.chainId,current:E.current}},merge(E,C){typeof E=="object"&&E&&"status"in E&&delete E.status;const x=v(E,C.chainId);return{...C,...E,chainId:x}},skipHydration:i,storage:n,version:p}):h));y.setState(h());function v(E,C){return E&&typeof E=="object"&&"chainId"in E&&typeof E.chainId=="number"&&o.getState().some(x=>x.id===E.chainId)?E.chainId:C}r&&y.subscribe(({connections:E,current:C})=>C?E.get(C)?.chainId:void 0,E=>{if(o.getState().some(x=>x.id===E))return y.setState(x=>({...x,chainId:E??x.chainId}))}),s?.subscribe(E=>{const C=new Set,x=new Set;for(const T of c.getState())if(C.add(T.id),T.rdns){const U=typeof T.rdns=="string"?[T.rdns]:T.rdns;for(const O of U)x.add(O)}const $=[];for(const T of E){if(x.has(T.info.rdns))continue;const U=l(u(T));C.has(U.id)||$.push(U)}n&&!y.persist.hasHydrated()||c.setState(T=>[...T,...$],!0)});function b(E){y.setState(C=>{const x=C.connections.get(E.uid);return x?{...C,connections:new Map(C.connections).set(E.uid,{accounts:E.accounts??x.accounts,chainId:E.chainId??x.chainId,connector:x.connector})}:C})}function w(E){y.getState().status==="connecting"||y.getState().status==="reconnecting"||y.setState(C=>{const x=c.getState().find($=>$.uid===E.uid);return x?(x.emitter.listenerCount("connect")&&x.emitter.off("connect",b),x.emitter.listenerCount("change")||x.emitter.on("change",b),x.emitter.listenerCount("disconnect")||x.emitter.on("disconnect",_),{...C,connections:new Map(C.connections).set(E.uid,{accounts:E.accounts,chainId:E.chainId,connector:x}),current:E.uid,status:"connected"}):C})}function _(E){y.setState(C=>{const x=C.connections.get(E.uid);if(x){const T=x.connector;T.emitter.listenerCount("change")&&x.connector.emitter.off("change",b),T.emitter.listenerCount("disconnect")&&x.connector.emitter.off("disconnect",_),T.emitter.listenerCount("connect")||x.connector.emitter.on("connect",w)}if(C.connections.delete(E.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const $=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:$.connector.uid}})}return{get chains(){return o.getState()},get connectors(){return c.getState()},storage:n,getClient:f,get state(){return y.getState()},setState(E){let C;typeof E=="function"?C=E(y.getState()):C=E;const x=h();typeof C!="object"&&(C=x),Object.keys(x).some(T=>!(T in C))&&(C=x),y.setState(C,!0)},subscribe(E,C,x){return y.subscribe(E,C,x?{...x,fireImmediately:x.emitImmediately}:void 0)},_internal:{mipd:s,async revalidate(){const E=y.getState(),C=E.connections;let x=E.current;for(const[,$]of C){const T=$.connector;T.isAuthorized&&await T.isAuthorized()||(C.delete(T.uid),x===T.uid&&(x=null))}y.setState($=>({...$,connections:C,current:x}))},store:y,ssr:!!i,syncConnectedChain:r,transports:a.transports,chains:{setState(E){const C=typeof E=="function"?E(o.getState()):E;
10if(C.length!==0)return o.setState(C,!0)},subscribe(E){return o.subscribe(E)}},connectors:{providerDetailToConnector:u,setup:l,setState(E){return c.setState(typeof E=="function"?E(c.getState()):E,!0)},subscribe(E){return c.subscribe(E)}},events:{change:b,connect:w,disconnect:_}}}}function Vre(t,e){const{onChange:n}=e;return t._internal.chains.subscribe((r,i)=>{n(r,i)})}var BD={exports:{}},VD={},HD={exports:{}},WD={};/** 11 * @license React 12 * use-sync-external-store-shim.production.js 13 * 14 * Copyright (c) Meta Platforms, Inc. and affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var d2=L;function Hre(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Wre=typeof Object.is=="function"?Object.is:Hre,qre=d2.useState,zre=d2.useEffect,Zre=d2.useLayoutEffect,Kre=d2.useDebugValue;function Gre(t,e){var n=e(),r=qre({inst:{value:n,getSnapshot:e}}),i=r[0].inst,a=r[1];return Zre(function(){i.value=n,i.getSnapshot=e,S6(i)&&a({inst:i})},[t,n,e]),zre(function(){return S6(i)&&a({inst:i}),t(function(){S6(i)&&a({inst:i})})},[t]),Kre(n),n}function S6(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Wre(t,n)}catch{return!0}}function Yre(t,e){return e()}var Jre=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Yre:Gre;WD.useSyncExternalStore=d2.useSyncExternalStore!==void 0?d2.useSyncExternalStore:Jre;HD.exports=WD;var Xre=HD.exports;/** 19 * @license React 20 * use-sync-external-store-shim/with-selector.production.js 21 * 22 * Copyright (c) Meta Platforms, Inc. and affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */var km=L,Qre=Xre;function eie(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var tie=typeof Object.is=="function"?Object.is:eie,nie=Qre.useSyncExternalStore,rie=km.useRef,iie=km.useEffect,aie=km.useMemo,sie=km.useDebugValue;VD.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var a=rie(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=aie(function(){function c(h){if(!l){if(l=!0,u=h,h=r(h),i!==void 0&&s.hasValue){var p=s.value;if(i(p,h))return d=p}return d=h}if(p=d,tie(u,h))return p;var g=r(h);return i!==void 0&&i(p,g)?(u=h,p):(u=h,d=g)}var l=!1,u,d,f=n===void 0?null:n;return[function(){return c(e())},f===null?void 0:function(){return c(f())}]},[e,n,r,i]);var o=nie(t,a[0],a[1]);return iie(function(){s.hasValue=!0,s.value=o},[o]),sie(o),o};BD.exports=VD;var oie=BD.exports;const A6=t=>typeof t=="object"&&!Array.isArray(t);function cie(t,e,n=e,r=pu){const i=L.useRef([]),a=oie.useSyncExternalStoreWithSelector(t,e,n,s=>s,(s,o)=>{if(A6(s)&&A6(o)&&i.current.length){for(const c of i.current)if(!r(s[c],o[c]))return!1;return!0}return r(s,o)});return L.useMemo(()=>{if(A6(a)){const s={...a};let o={};for(const[c,l]of Object.entries(s))o={...o,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}};return Object.defineProperties(s,o),s}return a},[a])}function LC(t={}){const e=ts(t);return cie(n=>Cre(e,{onChange:n}),()=>ND(e))}function lie(t){return JSON.stringify(t,(e,n)=>uie(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):typeof n=="bigint"?n.toString():n)}function uie(t){if(!Mx(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!Mx(n)||!n.hasOwnProperty("isPrototypeOf"))}function Mx(t){return Object.prototype.toString.call(t)==="[object Object]"}function die(t){const{_defaulted:e,behavior:n,gcTime:r,initialData:i,initialDataUpdatedAt:a,maxPages:s,meta:o,networkMode:c,queryFn:l,queryHash:u,queryKey:d,queryKeyHashFn:f,retry:h,retryDelay:p,structuralSharing:g,getPreviousPageParam:y,getNextPageParam:v,initialPageParam:b,_optimisticResults:w,enabled:_,notifyOnChangeProps:E,placeholderData:C,refetchInterval:x,refetchIntervalInBackground:$,refetchOnMount:T,refetchOnReconnect:U,refetchOnWindowFocus:O,retryOnMount:F,select:k,staleTime:S,suspense:I,throwOnError:A,config:R,connector:N,query:P,...j}=t;return j}function fie(t){return{mutationFn(e){return wre(t,e)},mutationKey:["connect"]}}function hie(t){return{mutationFn(e){return bre(t,e)},mutationKey:["disconnect"]}}function pie(t,e={}){return{gcTime:0,async queryFn({queryKey:n}){const{connector:r}=e,{connectorUid:i,scopeKey:a,...s}=n[1];
26return _re(t,{...s,connector:r})},queryKey:gie(e)}}function gie(t={}){const{connector:e,...n}=t;return["walletClient",{...die(n),connectorUid:e?.uid}]}function yie(t){return{mutationFn(e){return xJ(t,e)},mutationKey:["reconnect"]}}function mie(t){const e=Bt({...t,queryKeyHashFn:lie});return e.queryKey=t.queryKey,e}function vie(t={}){const e=ts(t);return L.useSyncExternalStore(n=>Ere(e,{onChange:n}),()=>Lx(e),()=>Lx(e))}function wie(t={}){const e=ts(t);return L.useSyncExternalStore(n=>Vre(e,{onChange:n}),()=>kx(e),()=>kx(e))}function bie(t={}){const e=ts(t);return L.useSyncExternalStore(n=>Are(e,{onChange:n}),()=>$x(e),()=>$x(e))}function _ie(t={}){const{mutation:e}=t,n=ts(t),r=fie(n),{mutate:i,mutateAsync:a,...s}=it({...e,...r});return L.useEffect(()=>n.subscribe(({status:o})=>o,(o,c)=>{c==="connected"&&o==="disconnected"&&s.reset()}),[n,s.reset]),{...s,connect:i,connectAsync:a,connectors:bie({config:n})}}function Cie(t={}){const e=ts(t);return L.useSyncExternalStore(n=>Sre(e,{onChange:n}),()=>Y7(e),()=>Y7(e))}function Eie(t={}){const{mutation:e}=t,n=ts(t),r=hie(n),{mutate:i,mutateAsync:a,...s}=it({...e,...r});return{...s,connectors:Cie({config:n}).map(o=>o.connector),disconnect:i,disconnectAsync:a}}function Sie(t={}){const{mutation:e}=t,n=ts(t),r=yie(n),{mutate:i,mutateAsync:a,...s}=it({...e,...r});return{...s,connectors:n.connectors,reconnect:i,reconnectAsync:a}}function Aie(t={}){const{query:e={},...n}=t,r=ts(n),i=ns(),{address:a,connector:s,status:o}=LC({config:r}),c=vie({config:r}),l=t.connector??s,{queryKey:u,...d}=pie(r,{...t,chainId:t.chainId??c,connector:t.connector??s}),f=!!((o==="connected"||o==="reconnecting"&&l?.getProvider)&&(e.enabled??!0)),h=L.useRef(a);return L.useEffect(()=>{const p=h.current;!a&&p?(i.removeQueries({queryKey:u}),h.current=void 0):a!==p&&(i.invalidateQueries({queryKey:u}),h.current=a)},[a,i]),mie({...e,...d,queryKey:u,enabled:f,staleTime:Number.POSITIVE_INFINITY})}var Vc;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(Vc||(Vc={}));var ni;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(ni||(ni={}));var Nx="-",$m="AMP",xie="".concat($m,"_unsent"),qD="$default_instance",kC="https://api2.amplitude.com/2/httpapi",zD="https://api.eu.amplitude.com/2/httpapi",ZD="https://api2.amplitude.com/batch",KD="https://api.eu.amplitude.com/batch",Iie="utm_campaign",Tie="utm_content",Lie="utm_id",kie="utm_medium",$ie="utm_source",Pie="utm_term",Dx="dclid",Fx="fbclid",Ux="gbraid",jx="gclid",Bx="ko_click_id",Vx="li_fat_id",Hx="msclkid",Wx="rdt_cid",qx="ttclid",zx="twclid",Zx="wbraid",Pm={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ng=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],Rie=["authorization","cookie","set-cookie"],Oie=1e3,Q7=function(t){if(Object.keys(t).length>Oie)return!1;for(var e in t){var n=t[e];if(!GD(e,n))return!1}return!0},GD=function(t,e){var n,r;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var a=Se(e),s=a.next();!s.done;s=a.next()){var o=s.value;if(Array.isArray(o))return!1;if(typeof o=="object")i=i&&Q7(o);else if(!["number","string"].includes(typeof o))return!1;if(!i)return!1}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}else{if(e==null)return!1;if(typeof e=="object")return Q7(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0},_h=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return re({},this._properties)},t.prototype.set=function(e,n){return this._safeSet(en.SET,e,n),this},t.prototype.setOnce=function(e,n){return this._safeSet(en.SET_ONCE,e,n),this},t.prototype.append=function(e,n){return this._safeSet(en.APPEND,e,n),this},t.prototype.prepend=function(e,n){return this._safeSet(en.PREPEND,e,n),this},t.prototype.postInsert=function(e,n){return this._safeSet(en.POSTINSERT,e,n),this},t.prototype.preInsert=function(e,n){return this._safeSet(en.PREINSERT,e,n),this},t.prototype.remove=function(e,n){return this._safeSet(en.REMOVE,e,n),this},t.prototype.add=function(e,n){return this._safeSet(en.ADD,e,n),this},t.prototype.unset=function(e){return this._safeSet(en.UNSET,e,Nx),this},t.prototype.clearAll=function(){return this._properties={},this._properties[en.CLEAR_ALL]=Nx,this}
26,t.prototype._safeSet=function(e,n,r){if(this._validate(e,n,r)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[n]=r,this._propertySet.add(n),!0}return!1},t.prototype._validate=function(e,n,r){return this._properties[en.CLEAR_ALL]!==void 0||this._propertySet.has(n)?!1:e===en.ADD?typeof r=="number":e!==en.UNSET&&e!==en.REMOVE?GD(n,r):!0},t}(),en;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(en||(en={}));var Mie=[en.CLEAR_ALL,en.UNSET,en.SET,en.SET_ONCE,en.ADD,en.APPEND,en.PREPEND,en.PREINSERT,en.POSTINSERT,en.REMOVE],Nie="Event tracked successfully",Die="Unexpected error occurred",Fie="Event rejected due to exceeded retry count",Uie="Event skipped due to optOut config",Kx="Event skipped due to empty event type",jie="Event rejected due to missing API key",Bie="Invalid API key",Vie="Client not initialized",cn;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(cn||(cn={}));var Gl=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=cn.Unknown),{event:t,code:e,message:n}},He=function(){var t="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[t]<"u")return globalThis[t];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof rt<"u")return rt},Hie=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,js)},Gx=Qe([],$e(Array(256).keys()),!1).map(function(t){return t.toString(16).padStart(2,"0")}),js=function(t){var e,n=He();if(!(!((e=n?.crypto)===null||e===void 0)&&e.getRandomValues))return Hie(t);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Qe([],$e(r.entries()),!1).map(function(i){var a=$e(i,2),s=a[0],o=a[1];return[4,6,8,10].includes(s)?"-".concat(Gx[o]):Gx[o]}).join("")},Wie=function(){function t(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return t.prototype.register=function(e,n){var r,i;return te(this,void 0,void 0,function(){var a;return ee(this,function(s){switch(s.label){case 0:return e.name===void 0&&(e.name=js(),this.loggerProvider.warn(`Plugin name is undefined. 27 Generating a random UUID for plugin name: `.concat(e.name,`. 28 Set a name for the plugin to prevent it from being added multiple times.`))),a=e.name,this.pluginStatus.has(a)?(this.loggerProvider.warn("Plugin with name ".concat(a," already exists, skipping registration")),[2]):(e.type=(r=e.type)!==null&&r!==void 0?r:"enrichment",this.pluginStatus.set(a,"locked"),[4,(i=e.setup)===null||i===void 0?void 0:i.call(e,n,this.client)]);case 1:return s.sent(),this.pluginStatus.get(a)!=="locked"?[2]:(this.plugins.push(e),this.pluginStatus.set(a,"installed"),[2])}})})},t.prototype.deregister=function(e,n){var r;return te(this,void 0,void 0,function(){var i,a;return ee(this,function(s){switch(s.label){case 0:return this.pluginStatus.delete(e),i=this.plugins.findIndex(function(o){return o.name===e}),i===-1?(n.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(a=this.plugins[i],this.plugins.splice(i,1),[4,(r=a.teardown)===null||r===void 0?void 0:r.call(a)]);case 1:return s.sent(),[2]}})})},t.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1;var n=this.plugins;n.map(function(r){var i;return(i=r.teardown)===null||i===void 0?void 0:i.call(r)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},t.prototype.push=function(e){var n=this;return new Promise(function(r){n.queue.push([e,r]),n.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var n=this;this.applying||(this.applying=!0,setTimeout(function(){n.apply(n.queue.shift()).then(function(){n.applying=!1,n.queue.length>0&&n.scheduleApply(0)})},e))},t.prototype.apply=function(e){return te(this,void 0,void 0,function(){var n,r,i,a,s,o,c,h,p,l,u,d,f,h,p,g,y,v,b,w,_,E;return ee(this,function(C){switch(C.label){case 0:if(!e)return[2];n=$e(e,1),r=n[0],i=$e(e,2),a=i[1],this.loggerProvider.log("Timeline.apply: Initial event",r),s=this.plugins.filter(function(x){return x.type==="before"}),C.label=1;case 1:C.trys.push([1,6,7,8]),o=Se(s),c=o.next(),C.label=2;case 2:return c.done?[3,5]:(h=c.value,h.execute?[4,h.execute(re({},r))]:[3,4]);case 3:if(p=C.sent(),p===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(r))),a({event:r,code:0,message:""}),[2];r=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(r))),C.label=4;case 4:return c=o.next(),[3,2];case 5:return[3,8];case 6:return l=C.sent(),b={error:l},[3,8];case 7:try{c&&!c.done&&(w=o.return)&&w.call(o)}finally{if(b)throw b.error}
28return[7];case 8:u=this.plugins.filter(function(x){return x.type==="enrichment"||x.type===void 0}),C.label=9;case 9:C.trys.push([9,14,15,16]),d=Se(u),f=d.next(),C.label=10;case 10:return f.done?[3,13]:(h=f.value,h.execute?[4,h.execute(re({},r))]:[3,12]);case 11:if(p=C.sent(),p===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(r))),a({event:r,code:0,message:""}),[2];r=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(h.name),"', event: ").concat(JSON.stringify(r))),C.label=12;case 12:return f=d.next(),[3,10];case 13:return[3,16];case 14:return g=C.sent(),_={error:g},[3,16];case 15:try{f&&!f.done&&(E=d.return)&&E.call(d)}finally{if(_)throw _.error}return[7];case 16:return y=this.plugins.filter(function(x){return x.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),v=y.map(function(x){var $=re({},r);return x.execute($).catch(function(T){return Gl($,0,String(T))})}),Promise.all(v).then(function(x){var $=$e(x,1),T=$[0],U=T||Gl(r,100,"Event not tracked, no destination plugins on the instance");a(U)}),[2]}})})},t.prototype.flush=function(){return te(this,void 0,void 0,function(){var e,n,r,i=this;return ee(this,function(a){switch(a.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(s){return i.apply(s)}))];case 1:return a.sent(),n=this.plugins.filter(function(s){return s.type==="destination"}),r=n.map(function(s){return s.flush&&s.flush()}),[4,Promise.all(r)];case 2:return a.sent(),[2]}})})},t.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},t.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},t.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(n){var r;(r=n.onIdentityChanged)===null||r===void 0||r.call(n,e)})},t.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(n){var r;(r=n.onSessionIdChanged)===null||r===void 0||r.call(n,e)})},t.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(n){var r;(r=n.onOptOutChanged)===null||r===void 0||r.call(n,e)}),this._callOptOutListeners(e)},t.prototype._callOptOutListeners=function(e){return te(this,void 0,void 0,function(){var n,r,i,a,s,o,c;return ee(this,function(l){switch(l.label){case 0:l.trys.push([0,7,8,9]),n=Se(this._optOutListeners),r=n.next(),l.label=1;case 1:if(r.done)return[3,6];i=r.value,l.label=2;case 2:return l.trys.push([2,4,,5]),[4,i(e)];case 3:return l.sent(),[3,5];case 4:return a=l.sent(),this.loggerProvider.error("Error calling optOut listener",a),[3,5];case 5:return r=n.next(),[3,1];case 6:return[3,9];case 7:return s=l.sent(),o={error:s},[3,9];case 8:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(o)throw o.error}return[7];case 9:return[2]}})})},t.prototype.onReset=function(){this.plugins.forEach(function(e){var n;(n=e.onReset)===null||n===void 0||n.call(e)})},t}(),qie=function(t,e,n){var r=typeof t=="string"?{event_type:t}:t;return re(re(re({},r),n),e&&{event_properties:e})},$C=function(t,e){var n=re(re({},e),{event_type:ni.IDENTIFY,user_properties:t.getUserProperties()});return n},zie=function(t,e,n,r){var i,a=re(re({},r),{event_type:ni.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[t]=e,i)});return a},Zie=function(t,e,n){var r,i=new _h;i.set(t,e);var a=re(re({},n),{event_type:ni.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[t]=e,r)});return a},Kie=function(t,e){return re(re({},e),{event_type:ni.REVENUE,event_properties:t.getEventProperties()})},ir=function(t){return{promise:t||Promise.resolve()}},Gie=function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Wie(this),this.name=e}return t.prototype._init=function(e){return te(this,void 0,void 0,function(){var n=this;return ee(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q",function(){return n.isReady=!0})];case 1:return r.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e,n){return te(this,void 0,void 0,function(){var r,i,a,s,o,c,l,u;return ee(this,function(d){switch(d.label){case 0:r=this[e],this[e]=[],d.label=1;case 1:d.trys.push([1,8,9,10]),i=Se(r),a=i.next(),d.label=2;case 2:return a.done?[3,7]:(s=a.value,o=s(),o&&"promise"in o?[4,o.promise]:[3,4]);case 3:return d.sent(),[3,6];case 4:return[4,o];case 5:d.sent(),d.label=6;case 6:return a=i.next(),[3,2];case 7:return[3,10];case 8:return c=d.sent(),l={error:c},[3,10];case 9:try{a&&!a.done&&(u=i.return)&&u.call(i)}finally{if(l)throw l.error}
28return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e,n)]:[3,12];case 11:return d.sent(),[3,13];case 12:n?.(),d.label=13;case 13:return[2]}})})},t.prototype.track=function(e,n,r){var i=qie(e,n,r);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),ir(this.dispatch(i))},t.prototype.identify=function(e,n){var r=$C(e,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),ir(this.dispatch(r))},t.prototype.groupIdentify=function(e,n,r,i){var a=zie(e,n,r,i);return ir(this.dispatch(a))},t.prototype.setGroup=function(e,n,r){var i=Zie(e,n,r);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),ir(this.dispatch(i))},t.prototype.revenue=function(e,n){var r=Kie(e,n);return ir(this.dispatch(r))},t.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),ir())},t.prototype._addPlugin=function(e){return ir(this.timeline.register(e,this.config))},t.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),ir())},t.prototype._removePlugin=function(e){return ir(this.timeline.deregister(e,this.config))},t.prototype.dispatchWithCallback=function(e,n){if(!this.isReady)return n(Gl(e,0,Vie));this.process(e).then(n)},t.prototype.dispatch=function(e){return te(this,void 0,void 0,function(){var n=this;return ee(this,function(r){return this.isReady?[2,this.process(e)]:[2,new Promise(function(i){n.dispatchQ.push(n.dispatchWithCallback.bind(n,e,i))})]})})},t.prototype.getOperationAppliedUserProperties=function(e){var n,r=(n=this.userProperties)!==null&&n!==void 0?n:{},i=re({},r);if(e===void 0)return i;var a={};return Object.keys(e).forEach(function(s){Object.values(Vc).includes(s)||(a[s]=e[s])}),Mie.forEach(function(s){if(Object.keys(e).includes(s)){var o=e[s];
28switch(s){case Vc.CLEAR_ALL:Object.keys(i).forEach(function(c){delete i[c]});break;case Vc.UNSET:Object.keys(o).forEach(function(c){delete i[c]});break;case Vc.SET:Object.assign(i,o);break}}}),Object.assign(i,a),i},t.prototype.process=function(e){return te(this,void 0,void 0,function(){var n,a,r,i,a;return ee(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,Gl(e,0,Uie)]:(n=e.event_type,typeof n!="string"||n.trim().length===0?(this.config.loggerProvider.error(Kx),[2,Gl(e,0,Kx)]):(e.event_type===ni.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]));case 1:return a=s.sent(),a.code===200?this.config.loggerProvider.log(a.message):a.code===100?this.config.loggerProvider.warn(a.message):this.config.loggerProvider.error(a.message),[2,a];case 2:return r=s.sent(),i=String(r),this.config.loggerProvider.error(i),a=Gl(e,0,i),[2,a];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!e));return}this._setOptOut(e)},t.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},t.prototype.flush=function(){return ir(this.timeline.flush())},t.prototype.plugin=function(e){var n=this.timeline.plugins.find(function(r){return r.name===e});if(n===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e));return}return n},t.prototype.plugins=function(e){return this.timeline.plugins.filter(function(n){return n instanceof e})},t}(),Yie=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setCurrency=function(e){return this.currency=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setReceipt=function(e){return this.receipt=e,this},t.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},t.prototype.setEventProperties=function(e){try{var n=JSON.parse(JSON.stringify(e));Q7(n)&&(this.properties=n)}catch{}return this},t.prototype.getEventProperties=function(){var e=this.properties?re({},this.properties):{};return e[ys.REVENUE_PRODUCT_ID]=this.productId,e[ys.REVENUE_QUANTITY]=this.quantity,e[ys.REVENUE_PRICE]=this.price,e[ys.REVENUE_TYPE]=this.revenueType,e[ys.REVENUE_CURRENCY]=this.currency,e[ys.REVENUE]=this.revenue,e[ys.RECEIPT]=this.receipt,e[ys.RECEIPT_SIG]=this.receiptSig,e},t}(),ys;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue",t.RECEIPT="$receipt",t.RECEIPT_SIG="$receiptSig"})(ys||(ys={}));var Jie=function(t,e){var n=Math.max(e,1);return t.reduce(function(r,i,a){var s=Math.floor(a/n);return r[s]||(r[s]=[]),r[s].push(i),r},[])},Qr;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(Qr||(Qr={}));var l1="Amplitude Logger ",f2=function(){function t(){this.logLevel=Qr.None}return t.prototype.disable=function(){this.logLevel=Qr.None},t.prototype.enable=function(e){e===void 0&&(e=Qr.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<Qr.Verbose||console.log("".concat(l1,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<Qr.Warn||console.warn("".concat(l1,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<Qr.Error||console.error("".concat(l1,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.logLevel<Qr.Debug||console.log("".concat(l1,"[Debug]: ").concat(e.join(" ")))},t}(),E3=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:qD,logLevel:Qr.Warn,loggerProvider:new f2,offline:!1,optOut:!1,serverUrl:kC,serverZone:"US",useBatch:!1}},YD=function(){function t(e){var n,r,i,a;this._optOut=!1;var s=E3();this.apiKey=e.apiKey,this.flushIntervalMillis=(n=e.flushIntervalMillis)!==null&&n!==void 0?n:s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.instanceName=e.instanceName||s.instanceName,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(r=e.logLevel)!==null&&r!==void 0?r:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=e.offline!==void 0?e.offline:s.offline,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(a=e.useBatch)!==null&&a!==void 0?a:s.useBatch,this.loggerProvider.enable(this.logLevel);var o=JD(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
28,enumerable:!1,configurable:!0}),t}(),Xie=function(t,e){return t==="EU"?e?KD:zD:e?ZD:kC},JD=function(t,e,n){if(t===void 0&&(t=""),e===void 0&&(e=E3().serverZone),n===void 0&&(n=E3().useBatch),t)return{serverUrl:t,serverZone:void 0};var r=["US","EU"].includes(e)?e:E3().serverZone;return{serverZone:r,serverUrl:Xie(r,n)}},Qie=function(){function t(){this.sdk={metrics:{histogram:{}}}}return t.prototype.recordHistogram=function(e,n){this.sdk.metrics.histogram[e]=n},t}();function ew(t){return t>=200&&t<300}var S3=function(t){t===void 0&&(t=0);var e=new Error().stack||"";return e.split(` 29`).slice(2+t).map(function(n){return n.trim()})},Wt=function(t){return function(){var e=re({},t.config),n=e.loggerProvider,r=e.logLevel;return{logger:n,logLevel:r}}},eae=function(t,e){var n,r;e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,"");try{for(var i=Se(e.split(".")),a=i.next();!a.done;a=i.next()){var s=a.value;if(s in t)t=t[s];else return}}catch(o){n={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},qt=function(t,e){return function(){var n,r,i={};try{for(var a=Se(e),s=a.next();!s.done;s=a.next()){var o=s.value;i[o]=eae(t,o)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}},Ct=function(t,e,n,r,i){return i===void 0&&(i=null),function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var o=n(),c=o.logger,l=o.logLevel;if(l&&l<Qr.Debug||!l||!c)return t.apply(i,a);var u={type:"invoke public method",name:e,args:a,stacktrace:S3(1),time:{start:new Date().toISOString()},states:{}};r&&u.states&&(u.states.before=r());var d=t.apply(i,a);return d&&d.promise?d.promise.then(function(){r&&u.states&&(u.states.after=r()),u.time&&(u.time.end=new Date().toISOString()),c.debug(JSON.stringify(u,null,2))}):(r&&u.states&&(u.states.after=r()),u.time&&(u.time.end=new Date().toISOString()),c.debug(JSON.stringify(u,null,2))),d}},tae=new Set([kC,zD,ZD,KD]),nae=function(t,e){return e===void 0&&(e=!1),tae.has(t)?!0:e};function rae(t){return t instanceof Error?t.message:String(t)}function vf(t){var e="";try{"body"in t&&(e=JSON.stringify(t.body,null,2))}catch{}return e}var iae=function(){function t(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=e?.diagnosticsClient}return t.prototype.setup=function(e){var n;return te(this,void 0,void 0,function(){var r,i=this;return ee(this,function(a){switch(a.label){case 0:return this.config=e,this.storageKey="".concat(xie,"_").concat(this.config.apiKey.substring(0,10)),[4,(n=this.config.storageProvider)===null||n===void 0?void 0:n.get(this.storageKey)];case 1:return r=a.sent(),r&&r.length>0&&Promise.all(r.map(function(s){return i.execute(s)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var n=this;return e.insert_id||(e.insert_id=js()),new Promise(function(r){var i={event:e,attempts:0,callback:function(a){return r(a)},timeout:0};n.queue.push(i),n.schedule(n.config.flushIntervalMillis),n.saveEvents()})},t.prototype.removeEventsExceedFlushMaxRetries=function(e){var n=this;return e.filter(function(r){return r.attempts+=1,r.attempts<n.config.flushMaxRetries?!0:(n.fulfillRequest([r],500,Fie),!1)})},t.prototype.scheduleEvents=function(e){var n=this;e.forEach(function(r){n.schedule(r.timeout===0?n.config.flushIntervalMillis:r.timeout)})},t.prototype.schedule=function(e){var n=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){n.queue=n.queue.map(function(r){return r.timeout=0,r}),n.flush(!0)},e);return}},t.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},t.prototype.flush=function(e){return e===void 0&&(e=!1),te(this,void 0,void 0,function(){var n,r,i,a=this;return ee(this,function(s){switch(s.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),n=[],r=[],this.queue.forEach(function(o){return o.timeout===0?n.push(o):r.push(o)}),i=Jie(n,this.config.flushQueueSize),[4,i.reduce(function(o,c){return te(a,void 0,void 0,function(){return ee(this,function(l){switch(l.label){case 0:return[4,o];case 1:return l.sent(),[4,this.send(c,e)];case 2:return[2,l.sent()]}})})},Promise.resolve())]);case 1:return s.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},t.prototype.send=function(e,n){var r;return n===void 0&&(n=!0),te(this,void 0,void 0,function(){var i,a,s,o,c,l;return ee(this,function(u){switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,jie)];i={api_key:this.config.apiKey,events:e.map(function(d){var f=d.event;f.extra;var h=au(f,["extra"]);return h}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Qie,u.label=1;case 1:return u.trys.push([1,3,,4]),a=JD(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,s=nae(a,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(a,i,s)];case 2:return o=u.sent(),o===null?(this.fulfillRequest(e,0,Die),[2]):n?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(vf(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return c=u.sent(),l=rae(c),this.config.loggerProvider.error(l),(r=this.diagnosticsClient)===null||r===void 0||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(d){return d.event.event_type}),message:l,stack_trace:S3()}),this.handleResponse({status:cn.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(e,n){var r;ew(e.statusCode)||(r=this.diagnosticsClient)===null||r===void 0||r.recordEvent("analytics.events.unsuccessful",{events:n.map(function(a){return a.event.event_type}),code:e.statusCode,status:e.status,body:vf(e),stack_trace:S3()});var i=e.status;switch(i){case cn.Success:{this.handleSuccessResponse(e,n);break}case cn.Invalid:{this.handleInvalidResponse(e,n);break}case cn.PayloadTooLarge:{this.handlePayloadTooLargeResponse(e,n);break}case cn.RateLimit:{this.handleRateLimitResponse(e,n);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(i,"' provided for ").concat(n.length,' events"}')),this.handleOtherResponse(n);break}}},t.prototype.handleSuccessResponse=function(e,n){this.fulfillRequest(n,e.statusCode,Nie)},t.prototype.handleInvalidResponse=function(e,n){var r=this;if(e.body.missingField||e.body.error.startsWith(Bie)){this.fulfillRequest(n,e.statusCode,e.body.error);return}var i=Qe(Qe(Qe(Qe([],$e(Object.values(e.body.eventsWithInvalidFields)),!1),$e(Object.values(e.body.eventsWithMissingFields)),!1),$e(Object.values(e.body.eventsWithInvalidIdLengths)),!1),$e(e.body.silencedEvents),!1).flat(),a=new Set(i),s=n.filter(function(c,l){if(a.has(l)){r.fulfillRequest([c],e.statusCode,e.body.error);return}return!0});s.length>0&&this.config.loggerProvider.warn(vf(e));
29var o=this.removeEventsExceedFlushMaxRetries(s);this.scheduleEvents(o)},t.prototype.handlePayloadTooLargeResponse=function(e,n){if(n.length===1){this.fulfillRequest(n,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(vf(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},t.prototype.handleRateLimitResponse=function(e,n){var r=this,i=Object.keys(e.body.exceededDailyQuotaUsers),a=Object.keys(e.body.exceededDailyQuotaDevices),s=e.body.throttledEvents,o=new Set(i),c=new Set(a),l=new Set(s),u=n.filter(function(f,h){if(f.event.user_id&&o.has(f.event.user_id)||f.event.device_id&&c.has(f.event.device_id)){r.fulfillRequest([f],e.statusCode,e.body.error);return}return l.has(h)&&(f.timeout=r.throttleTimeout),!0});u.length>0&&this.config.loggerProvider.warn(vf(e));var d=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(d)},t.prototype.handleOtherResponse=function(e){var n=this,r=e.map(function(a){return a.timeout=a.attempts*n.retryTimeout,a}),i=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(i)},t.prototype.fulfillRequest=function(e,n,r){var i,a,s;ew(n)?(s=this.diagnosticsClient)===null||s===void 0||s.increment("analytics.events.sent",e.length):((i=this.diagnosticsClient)===null||i===void 0||i.increment("analytics.events.dropped",e.length),(a=this.diagnosticsClient)===null||a===void 0||a.recordEvent("analytics.events.dropped",{events:e.map(function(o){return o.event.event_type}),code:n,message:r,stack_trace:S3()})),this.removeEvents(e),e.forEach(function(o){return o.callback(Gl(o.event,n,r))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(n){return n.event});this.config.storageProvider.set(this.storageKey,e)}},t.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(n){return!e.some(function(r){return r.event.insert_id===n.event.insert_id})}),this.saveEvents()},t}();class aae{getApplicationContext(){return{versionName:this.versionName,language:sae(),platform:"Web",os:void 0,deviceModel:void 0}}}const sae=()=>typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||"";class oae{constructor(){this.queue=[]}logEvent(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)}setEventReceiver(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(n=>{e(n)}),this.queue=[])}}const A3=(t,e)=>{const n=["string","number","boolean","undefined"],r=typeof t;if(r!==typeof e)return!1;for(const o of n)if(o===r)return t===e;if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;const a=Array.isArray(t),s=Array.isArray(e);if(a!==s)return!1;if(a&&s){for(let o=0;o<t.length;o++)if(!A3(t[o],e[o]))return!1}else{const o=Object.keys(t).sort(),c=Object.keys(e).sort();if(!A3(o,c))return!1;let l=!0;return Object.keys(t).forEach(u=>{A3(t[u],e[u])||(l=!1)}),l}return!0},cae="$set",lae="$unset",uae="$clearAll";Object.entries||(Object.entries=function(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r});class dae{constructor(){this.identity={userProperties:{}},this.listeners=new Set}editIdentity(){const e=this,n=Object.assign({},this.identity.userProperties),r=Object.assign(Object.assign({},this.identity),{userProperties:n});return{setUserId:function(i){return r.userId=i,this},setDeviceId:function(i){return r.deviceId=i,this},setUserProperties:function(i){return r.userProperties=i,this},setOptOut(i){return r.optOut=i,this},updateUserProperties:function(i){let a=r.userProperties||{};for(const[s,o]of Object.entries(i))switch(s){case cae:for(const[c,l]of Object.entries(o))a[c]=l;break;case lae:for(const c of Object.keys(o))delete a[c];break;case uae:a={};break}return r.userProperties=a,this},commit:function(){return e.setIdentity(r),this}}}getIdentity(){return Object.assign({},this.identity)}setIdentity(e){const n=Object.assign({},this.identity);this.identity=Object.assign({},e),A3(n,this.identity)||this.listeners.forEach(r=>{r(e)})}addIdentityListener(e){this.listeners.add(e)}removeIdentityListener(e){this.listeners.delete(e)}}const wf=typeof globalThis<"u"?globalThis:typeof rt<"u"?rt:self;
29class Rm{constructor(){this.identityStore=new dae,this.eventBridge=new oae,this.applicationContextProvider=new aae}static getInstance(e){return wf.analyticsConnectorInstances||(wf.analyticsConnectorInstances={}),wf.analyticsConnectorInstances[e]||(wf.analyticsConnectorInstances[e]=new Rm),wf.analyticsConnectorInstances[e]}}var gu=function(t){return t===void 0&&(t=qD),Rm.getInstance(t)},fae=function(t,e){gu(e).identityStore.editIdentity().setUserId(t).commit()},hae=function(t,e){gu(e).identityStore.editIdentity().setDeviceId(t).commit()},pae=function(){function t(){this.name="identity",this.type="before",this.identityStore=gu().identityStore}return t.prototype.execute=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){return n=e.user_properties,n&&this.identityStore.editIdentity().updateUserProperties(n).commit(),[2,e]})})},t.prototype.setup=function(e){return te(this,void 0,void 0,function(){return ee(this,function(n){return e.instanceName&&(this.identityStore=gu(e.instanceName).identityStore),[2]})})},t}(),XD=function(t,e){e===void 0&&(e=Date.now());var n=Date.now(),r=n-e;return r>t},QD=function(t,e,n){return e===void 0&&(e=""),n===void 0&&(n=10),[$m,e,t.substring(0,n)].filter(Boolean).join("_")},gae=function(t){return"".concat($m.toLowerCase(),"_").concat(t.substring(0,6))},yae=function(){var t,e,n,r;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(r=(n=(e=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:navigator.language)!==null&&n!==void 0?n:i)!==null&&r!==void 0?r:""},Dg=function(){var t,e=He();if(!(!((t=e?.location)===null||t===void 0)&&t.search))return{};var n=e.location.search.substring(1).split("&").filter(Boolean),r=n.reduce(function(i,a){var s=a.split("=",2),o=Yx(s[0]),c=Yx(s[1]);return c&&(i[o]=c),i},{});return r},Yx=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}},tw=function(t,e){return!e||!e.length?!0:e.some(function(n){return typeof n=="string"?t===n:t.match(n)})},qa=function(t,e){var n=t;try{n=decodeURI(t)}catch(r){e?.error("Malformed URI sequence: ",r)}return n},nw=function(t){var e=0;if(t.length===0)return e;for(var n=0;n<t.length;n++){var r=t.charCodeAt(n);e=(e<<5)-e+r,e|=0}return e},Jx=function(t,e){var n=nw(t.toString()),r=Math.abs(n),i=r*31,a=i%1e5;return a/1e5<e},eF=function(t){var e={};for(var n in t){var r=t[n];r&&(e[n]=r)}return e},PC=function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return te(this,void 0,void 0,function(){return ee(this,function(e){return[2,!0]})})},t.prototype.get=function(e){return te(this,void 0,void 0,function(){return ee(this,function(n){return[2,this.memoryStorage.get(e)]})})},t.prototype.getRaw=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return n=r.sent(),[2,n?JSON.stringify(n):void 0]}})})},t.prototype.set=function(e,n){return te(this,void 0,void 0,function(){return ee(this,function(r){return this.memoryStorage.set(e,n),[2]})})},t.prototype.remove=function(e){return te(this,void 0,void 0,function(){return ee(this,function(n){return this.memoryStorage.delete(e),[2]})})},t.prototype.reset=function(){return te(this,void 0,void 0,function(){return ee(this,function(e){return this.memoryStorage.clear(),[2]})})},t}(),mae=function(){var t,e=He();return(t=e?.navigator)===null||t===void 0?void 0:t.locks},Fg=function(){function t(e,n){n===void 0&&(n={}),this.options=re({},e),this.config=n}return t.prototype.isEnabled=function(){return te(this,void 0,void 0,function(){var e,n,r,i,a=this;return ee(this,function(s){switch(s.label){case 0:return e="AMP_TEST",n=re({},this.options),r=new t(n),i=String(Date.now()),[4,r.transaction(e,function(o){var c,l;try{o.set(i);var u=o.get(),d=u===i;return!d&&a.config.diagnosticsClient&&((c=a.config.diagnosticsClient)===null||c===void 0||c.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:e,testValue:i,sync:!0})),d}catch(h){if(a.config.diagnosticsClient){var f=h instanceof Error?h.message:String(h);(l=a.config.diagnosticsClient)===null||l===void 0||l.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:e,testValue:i,error:f,sync:!0})}return!1}finally{o.set(null)}})];case 1:return[2,s.sent()]}})})},t.prototype.get=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:return n=r.sent(),[2,this.decodeCookieValue(e,n)]}})})},t.prototype.decodeCookieValue=function(e,n){if(n)try{var r=tF(n);if(r===void 0){console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(n));return}return JSON.parse(r)}catch{console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n));return}},t.prototype.getSync=function(e){var n=this.getRawSync(e);return this.decodeCookieValue(e,n)},t.prototype.getRaw=function(e){var n,r;return te(this,void 0,void 0,function(){var i,a,s,o,c,l,u,d,f;return ee(this,function(h){switch(h.label){case 0:i=He(),a=i,h.label=1;case 1:return h.trys.push([1,4,,5]),s=a?.cookieStore,s?[4,s.getAll(e)]:[3,3];case 2:if(o=h.sent(),o){o.length>1&&((n=this.config.diagnosticsClient)===null||n===void 0||n.recordEvent("cookies.duplicate",{cookies:o.map(function(p){return p.domain})}),(r=this.config.diagnosticsClient)===null||r===void 0||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=Se(o),l=c.next();!l.done;l=c.next())if(u=l.value,nF(u.domain,this.options.domain))return[2,u.value]}catch(p){d={error:p}}finally{try{l&&!l.done&&(f=c.return)&&f.call(c)}finally{if(d)throw d.error}}}h.label=3;case 3:return[3,5];case 4:return h.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},t.prototype.getRawSync=function(e){var n=this,r,i,a=He(),s=((i=(r=a?.document)===null||r===void 0?void 0:r.cookie.split("; "))!==null&&i!==void 0?i:[]).filter(function(l){return l.indexOf(e+"=")===0}),o=void 0,c=this.config.duplicateResolverFn;
29if(typeof c=="function"&&s.length>1&&(o=s.find(function(l){var u;try{var d=c(l.substring(e.length+1));return d||(u=n.config.diagnosticsClient)===null||u===void 0||u.increment("cookies.duplicate.occurrence.document.cookie"),d}catch{return!1}})),o||(o=s[0]),!!o)return o.substring(e.length+1)},t.prototype.set=function(e,n){return te(this,void 0,void 0,function(){return ee(this,function(r){return this.setSync(e,n),[2]})})},t.prototype.setSync=function(e,n){var r;try{var i=He();if(!i||!i.document||typeof i.btoa!="function"||typeof i.encodeURIComponent!="function")return;var a=(r=this.options.expirationDays)!==null&&r!==void 0?r:0,s=n!==null?a:-1,o=void 0;if(s){var c=new Date;c.setTime(c.getTime()+s*24*60*60*1e3),o=c}var l="".concat(e,"=").concat(i.btoa(i.encodeURIComponent(JSON.stringify(n))));o&&(l+="; expires=".concat(o.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite)),i.document.cookie=l}catch(d){var u=d instanceof Error?d.message:String(d);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}},t.prototype.remove=function(e){return te(this,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return[4,this.set(e,null)];case 1:return n.sent(),[2]}})})},t.prototype.reset=function(){return te(this,void 0,void 0,function(){return ee(this,function(e){return[2]})})},t.isDomainWritable=function(e){return te(this,void 0,void 0,function(){var n,r,i,a;return ee(this,function(s){switch(s.label){case 0:if(t.cachedTlds[e])return[2,!0];n={domain:"."+e},r="AMP_TLDTEST",i=new t(n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i.transaction(r,function(o){if(t.cachedTlds[e])return!0;try{o.set(1);var c=!!o.get();return c&&(t.cachedTlds[e]=!0),c}finally{o.set(null)}})];case 2:return a=s.sent(),[2,!!a];case 3:return s.sent(),[2,!1];case 4:return[2]}})})},t.prototype.transaction=function(e,n){return te(this,void 0,void 0,function(){var r,i,a=this;return ee(this,function(s){switch(s.label){case 0:if(r=mae(),i=function(){var o={get:function(){return a.getSync(e)},set:function(c){return a.setSync(e,c)}};return n(o)},!r)return[2,i()];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r.request("com.amplitude:cookie-lock:".concat(e),i)];case 2:return[2,s.sent()];case 3:return s.sent(),[2,i()];case 4:return[2]}})})},t.cachedTlds={},t}(),vae=function(t){try{return decodeURIComponent(atob(t))}catch{return}},wae=function(t){try{return decodeURIComponent(atob(decodeURIComponent(t)))}catch{return}},tF=function(t){var e;return(e=vae(t))!==null&&e!==void 0?e:wae(t)},nF=function(t,e){if(t===""&&e==="")return!0;if(!t||!e)return!1;var n=t.startsWith(".")?t.substring(1):t,r=e.startsWith(".")?e.substring(1):e;return n.toLowerCase()===r.toLowerCase()},Xx=function(t,e,n){return e===void 0&&(e=""),n===void 0&&(n=10),[$m,e,t.substring(0,n)].filter(Boolean).join("_")},Om=function(){function t(e){this.storage=e}return t.prototype.isEnabled=function(){return te(this,void 0,void 0,function(){var e,n,r,i;return ee(this,function(a){switch(a.label){case 0:if(!this.storage)return[2,!1];e=String(Date.now()),n=new t(this.storage),r="AMP_TEST",a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,n.set(r,e)];case 2:return a.sent(),[4,n.get(r)];case 3:return i=a.sent(),[2,i===e];case 4:return a.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return a.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return n=r.sent(),n?[2,JSON.parse(n)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},t.prototype.getRaw=function(e){var n;return te(this,void 0,void 0,function(){return ee(this,function(r){return[2,((n=this.storage)===null||n===void 0?void 0:n.getItem(e))||void 0]})})},t.prototype.set=function(e,n){var r;return te(this,void 0,void 0,function(){return ee(this,function(i){try{(r=this.storage)===null||r===void 0||r.setItem(e,JSON.stringify(n))}catch{}return[2]})})},t.prototype.remove=function(e){var n;return te(this,void 0,void 0,function(){return ee(this,function(r){try{(n=this.storage)===null||n===void 0||n.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return te(this,void 0,void 0,function(){return ee(this,function(n){try{(e=this.storage)===null||e===void 0||e.clear()}catch{}return[2]})})},t}(),bae=10,_ae=1,Tt={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},Qx={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},eI=function(){function t(e,n){this.dbPromise=null,this.logger=n,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return t.isSupported=function(){var e;return((e=He())===null||e===void 0?void 0:e.indexedDB)!==void 0},t.prototype.getDB=function(){return te(this,void 0,void 0,function(){return ee(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},t.prototype.openDB=function(){var e=this;return new Promise(function(n,r){var i=indexedDB.open(e.dbName,_ae);
29i.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},i.onsuccess=function(){var a=i.result;a.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},a.onerror=function(s){e.logger.debug("DiagnosticsStorage: A global database error occurred.",s),a.close()},n(a)},i.onupgradeneeded=function(){var a=i.result;if(!a){e.logger.debug("DiagnosticsStorage: Missing DB during upgrade.");return}e.createTables(a)}})},t.prototype.createTables=function(e){if(e.objectStoreNames.contains(Tt.TAGS)||e.createObjectStore(Tt.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(Tt.COUNTERS)||e.createObjectStore(Tt.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(Tt.HISTOGRAMS)||e.createObjectStore(Tt.HISTOGRAMS,{keyPath:"key"}),!e.objectStoreNames.contains(Tt.EVENTS)){var n=e.createObjectStore(Tt.EVENTS,{keyPath:"id",autoIncrement:!0});n.createIndex("time_idx","time",{unique:!1})}e.objectStoreNames.contains(Tt.INTERNAL)||e.createObjectStore(Tt.INTERNAL,{keyPath:"key"})},t.prototype.setTags=function(e){return te(this,void 0,void 0,function(){var n,r,i,a,s=this;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),Object.entries(e).length===0?[2]:[4,this.getDB()];case 1:return n=o.sent(),r=n.transaction([Tt.TAGS],"readwrite"),i=r.objectStore(Tt.TAGS),[2,new Promise(function(c){var l=Object.entries(e);r.oncomplete=function(){c()},r.onabort=function(u){s.logger.debug("DiagnosticsStorage: Failed to set tags",u),c()},l.forEach(function(u){var d=$e(u,2),f=d[0],h=d[1],p=i.put({key:f,value:h});p.onerror=function(g){s.logger.debug("DiagnosticsStorage: Failed to set tag",f,h,g)}})})];case 2:return a=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",a),[3,3];case 3:return[2]}})})},t.prototype.incrementCounters=function(e){return te(this,void 0,void 0,function(){var n,r,i,a,s=this;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),Object.entries(e).length===0?[2]:[4,this.getDB()];case 1:return n=o.sent(),r=n.transaction([Tt.COUNTERS],"readwrite"),i=r.objectStore(Tt.COUNTERS),[2,new Promise(function(c){var l=Object.entries(e);r.oncomplete=function(){c()},r.onabort=function(u){s.logger.debug("DiagnosticsStorage: Failed to increment counters",u),c()},l.forEach(function(u){var d=$e(u,2),f=d[0],h=d[1],p=i.get(f);p.onsuccess=function(){var g=p.result,y=g?g.value:0,v=i.put({key:f,value:y+h});v.onerror=function(b){s.logger.debug("DiagnosticsStorage: Failed to update counter",f,b)}},p.onerror=function(g){s.logger.debug("DiagnosticsStorage: Failed to read existing counter",f,g)}})})];case 2:return a=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",a),[3,3];case 3:return[2]}})})},t.prototype.setHistogramStats=function(e){return te(this,void 0,void 0,function(){var n,r,i,a,s=this;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),Object.entries(e).length===0?[2]:[4,this.getDB()];case 1:return n=o.sent(),r=n.transaction([Tt.HISTOGRAMS],"readwrite"),i=r.objectStore(Tt.HISTOGRAMS),[2,new Promise(function(c){var l=Object.entries(e);r.oncomplete=function(){c()},r.onabort=function(u){s.logger.debug("DiagnosticsStorage: Failed to set histogram stats",u),c()},l.forEach(function(u){var d=$e(u,2),f=d[0],h=d[1],p=i.get(f);p.onsuccess=function(){var g=p.result,y;g?y={key:f,count:g.count+h.count,min:Math.min(g.min,h.min),max:Math.max(g.max,h.max),sum:g.sum+h.sum}:y={key:f,count:h.count,min:h.min,max:h.max,sum:h.sum};var v=i.put(y);v.onerror=function(b){s.logger.debug("DiagnosticsStorage: Failed to set histogram stats",f,b)}},p.onerror=function(g){s.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",f,g)}})})];case 2:return a=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",a),[3,3];case 3:return[2]}})})},t.prototype.addEventRecords=function(e){return te(this,void 0,void 0,function(){var n,r,i,a,s=this;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e.length===0?[2]:[4,this.getDB()];case 1:return n=o.sent(),r=n.transaction([Tt.EVENTS],"readwrite"),i=r.objectStore(Tt.EVENTS),[2,new Promise(function(c){r.oncomplete=function(){c()},r.onabort=function(u){s.logger.debug("DiagnosticsStorage: Failed to add event records",u),c()};var l=i.count();l.onsuccess=function(){var u=l.result,d=Math.max(0,bae-u);d<e.length&&s.logger.debug("DiagnosticsStorage: Only added ".concat(d," of ").concat(e.length," events due to storage limit")),e.slice(0,d).forEac
29h(function(f){var h=i.add(f);h.onerror=function(p){s.logger.debug("DiagnosticsStorage: Failed to add event record",p)}})},l.onerror=function(u){s.logger.debug("DiagnosticsStorage: Failed to count existing events",u)}})];case 2:return a=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",a),[3,3];case 3:return[2]}})})},t.prototype.setInternal=function(e,n){return te(this,void 0,void 0,function(){var r,i,a,s;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=o.sent(),i=r.transaction([Tt.INTERNAL],"readwrite"),a=i.objectStore(Tt.INTERNAL),[2,new Promise(function(c,l){i.onabort=function(){return l(new Error("Failed to set internal value"))};var u=a.put({key:e,value:n});u.onsuccess=function(){return c()},u.onerror=function(){return l(new Error("Failed to set internal value"))}})];case 2:return s=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",s),[3,3];case 3:return[2]}})})},t.prototype.getInternal=function(e){return te(this,void 0,void 0,function(){var n,r,i,a;return ee(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=s.sent(),r=n.transaction([Tt.INTERNAL],"readonly"),i=r.objectStore(Tt.INTERNAL),[2,new Promise(function(o,c){r.onabort=function(){return c(new Error("Failed to get internal value"))};var l=i.get(e);l.onsuccess=function(){return o(l.result)},l.onerror=function(){return c(new Error("Failed to get internal value"))}})];case 2:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",a),[2,void 0];case 3:return[2]}})})},t.prototype.getLastFlushTimestamp=function(){return te(this,void 0,void 0,function(){var e,n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(Qx.LAST_FLUSH_TIMESTAMP)];case 1:return e=r.sent(),[2,e?parseInt(e.value,10):void 0];case 2:return n=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",n),[2,void 0];case 3:return[2]}})})},t.prototype.setLastFlushTimestamp=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(Qx.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return r.sent(),[3,3];case 2:return n=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",n),[3,3];case 3:return[2]}})})},t.prototype.clearTable=function(e,n){return new Promise(function(r,i){var a=e.objectStore(n),s=a.clear();s.onsuccess=function(){return r()},s.onerror=function(){return i(new Error("Failed to clear table ".concat(n)))}})},t.prototype.getAllAndClear=function(){return te(this,void 0,void 0,function(){var e,n,r,i,a,s,o,c;return ee(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),n=e.transaction([Tt.TAGS,Tt.COUNTERS,Tt.HISTOGRAMS,Tt.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(n,Tt.TAGS),this.getAllFromStore(n,Tt.COUNTERS),this.getAllFromStore(n,Tt.HISTOGRAMS),this.getAllFromStore(n,Tt.EVENTS)])];case 2:return r=$e.apply(void 0,[l.sent(),4]),i=r[0],a=r[1],s=r[2],o=r[3],[4,Promise.all([this.clearTable(n,Tt.COUNTERS),this.clearTable(n,Tt.HISTOGRAMS),this.clearTable(n,Tt.EVENTS)])];case 3:return l.sent(),[2,{tags:i,counters:a,histogramStats:s,events:o}];case 4:return c=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",c),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},t.prototype.getAllFromStore=function(e,n){return new Promise(function(r,i){var a=e.objectStore(n),s=a.getAll();s.onsuccess=function(){return r(s.result)},s.onerror=function(){return i(new Error("Failed to get all from ".concat(n)))}})},t}(),Cae="__AMPLITUDE_SCRIPT_URL__",Eae="sdk.error.uncaught",Sae=function(){var t=He();if(!t)return[];var e=t[Cae];return Array.isArray(e)?e:typeof e=="string"?[e]:[]},Aae=function(t){var e=He();if(!(!e||typeof e.addEventListener!="function")){var n=function(a){var s=a.error instanceof Error?a.error:void 0,o=s?.stack,c=tI({filename:a.filename,stack:o});c&&i({type:"error",message:a.message,stack:o,filename:a.filename,errorName:s?.name,metadata:{colno:a.colno,lineno:a.lineno,isTrusted:a.isTrusted,matchReason:c}})},r=function(a){var s,o=a.reason instanceof Error?a.reason:void 0,c=o?.stack,l=xae(c),u=tI({filename:l,stack:c});u&&i({type:"unhandledrejection",message:(s=o?.message)!==null&&s!==void 0?s:Iae(a.reason),stack:c,filename:l,errorName:o?.name,metadata:{isTrusted:a.isTrusted,matchReason:u}})},i=function(a){t.recordEvent(Eae,re({type:a.type,message:a.message,filename:a.filename,error_name:a.errorName,stack:a.stack},a.metadata))};e.addEventListener("error",n,!0),e.addEventListener("unhandledrejection",r,!0)}},tI=function(t){var e,n,r=Sae();if(r.length!==0)try{for(var i=Se(r),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.filename&&t.filename.includes(s))return"filename";if(t.stack&&t.stack.includes(s))return"stack"}}catch(o){e={error:o}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},xae=function(t){if(t){var e=t.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return e?e[1]:void 0}},Iae=function(t){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return"[object Object]"}},Tae=1e3,u1=5*60*1e3,Lae="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",kae="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",x6=1e4,$ae=10,Pae=function(){function t(e,n,r,i,a){r===void 0&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=n,this.serverUrl=r==="US"?Lae:kae,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(i,null,2)),this.config=re({enabled:!0,sampleRate:0},i),this.startTimestamp=Date.now(),this.shouldTrack=Jx(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,a?this.storage=a:eI.isSupported()?this.storage=new eI(e,n):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),Aae(this))}return t.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},t.prototype.setTag=function(e,n){if(this.isStorageAndTrackEnabled()){if
29(Object.keys(this.inMemoryTags).length>=x6){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[e]=n,this.startTimersIfNeeded()}},t.prototype.increment=function(e,n){if(n===void 0&&(n=1),!!this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=x6){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+n,this.startTimersIfNeeded()}},t.prototype.recordHistogram=function(e,n){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=x6){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,n),r.max=Math.max(r.max,n),r.sum+=n):this.inMemoryHistograms[e]={count:1,min:n,max:n,sum:n},this.startTimersIfNeeded()}},t.prototype.recordEvent=function(e,n){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=$ae){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:n}),this.startTimersIfNeeded()}},t.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(n){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",n)}).finally(function(){e.saveTimer=null})},Tae)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(n){e.logger.debug("DiagnosticsClient: Failed to flush",n)}).finally(function(){e.flushTimer=null})},u1))},t.prototype.saveAllDataToStorage=function(){return te(this,void 0,void 0,function(){var e,n,r,i;return ee(this,function(a){switch(a.label){case 0:return this.storage?(e=re({},this.inMemoryTags),n=re({},this.inMemoryCounters),r=re({},this.inMemoryHistograms),i=Qe([],$e(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(n),this.storage.setHistogramStats(r),this.storage.addEventRecords(i)])]):[2];case 1:return a.sent(),[2]}})})},t.prototype._flush=function(){return te(this,void 0,void 0,function(){var e,n,r,i,a,s,o,c,l,u;return ee(this,function(d){switch(d.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return d.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=d.sent(),n=e.tags,r=e.counters,i=e.histogramStats,a=e.events,this.storage.setLastFlushTimestamp(Date.now()),s={},n.forEach(function(f){s[f.key]=f.value}),o={},r.forEach(function(f){o[f.key]=f.value}),c={},i.forEach(function(f){c[f.key]={count:f.count,min:f.min,max:f.max,avg:Math.round(f.sum/f.count*100)/100}}),l=a.map(function(f){return{event_name:f.event_name,time:f.time,event_properties:f.event_properties}}),Object.keys(o).length===0&&Object.keys(c).length===0&&l.length===0?[2]:(u={tags:s,histogram:c,counters:o,events:l},this.fetch(u),[2])}})})},t.prototype.fetch=function(e){return te(this,void 0,void 0,function(){var n,r;return ee(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),!He())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return n=i.sent(),n.ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return r=i.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",r),[3,3];case 3:return[2]}})})},t.prototype.initializeFlushInterval=function(){return te(this,void 0,void 0,function(){var e,n,r;return ee(this,function(i){switch(i.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return n=i.sent()||-1,n===-1?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(u1),[2]):(r=e-n,r>=u1?(this._flush(),[2]):(this._setFlushTimer(u1-r),[2]))}})})},t.prototype._setFlushTimer=function(e){var n=this;this.flushTimer=setTimeout(function(){n._flush().catch(function(r){n.logger.debug("DiagnosticsClient: Failed to flush",r)}).finally(function(){n.flushTimer=null})},e)},t.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Jx(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},t}(),a0=function(){function t(){}return t.prototype.send=function(e,n,r){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var n,r,i,a,s,o,c,l,u,d,f,h,p,g,y,v,b,w,_,E,
29C,x;if(typeof e!="object")return null;var $=e.code||0,T=this.buildStatus($);switch(T){case cn.Success:return{status:T,statusCode:$,body:{eventsIngested:(n=e.events_ingested)!==null&&n!==void 0?n:0,payloadSizeBytes:(r=e.payload_size_bytes)!==null&&r!==void 0?r:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case cn.Invalid:return{status:T,statusCode:$,body:{error:(a=e.error)!==null&&a!==void 0?a:"",missingField:(s=e.missing_field)!==null&&s!==void 0?s:"",eventsWithInvalidFields:(o=e.events_with_invalid_fields)!==null&&o!==void 0?o:{},eventsWithMissingFields:(c=e.events_with_missing_fields)!==null&&c!==void 0?c:{},eventsWithInvalidIdLengths:(l=e.events_with_invalid_id_lengths)!==null&&l!==void 0?l:{},epsThreshold:(u=e.eps_threshold)!==null&&u!==void 0?u:0,exceededDailyQuotaDevices:(d=e.exceeded_daily_quota_devices)!==null&&d!==void 0?d:{},silencedDevices:(f=e.silenced_devices)!==null&&f!==void 0?f:[],silencedEvents:(h=e.silenced_events)!==null&&h!==void 0?h:[],throttledDevices:(p=e.throttled_devices)!==null&&p!==void 0?p:{},throttledEvents:(g=e.throttled_events)!==null&&g!==void 0?g:[]}};case cn.PayloadTooLarge:return{status:T,statusCode:$,body:{error:(y=e.error)!==null&&y!==void 0?y:""}};case cn.RateLimit:return{status:T,statusCode:$,body:{error:(v=e.error)!==null&&v!==void 0?v:"",epsThreshold:(b=e.eps_threshold)!==null&&b!==void 0?b:0,throttledDevices:(w=e.throttled_devices)!==null&&w!==void 0?w:{},throttledUsers:(_=e.throttled_users)!==null&&_!==void 0?_:{},exceededDailyQuotaDevices:(E=e.exceeded_daily_quota_devices)!==null&&E!==void 0?E:{},exceededDailyQuotaUsers:(C=e.exceeded_daily_quota_users)!==null&&C!==void 0?C:{},throttledEvents:(x=e.throttled_events)!==null&&x!==void 0?x:[]}};case cn.Timeout:default:return{status:T,statusCode:$}}},t.prototype.buildStatus=function(e){return ew(e)?cn.Success:e===429?cn.RateLimit:e===413?cn.PayloadTooLarge:e===408?cn.Timeout:e>=400&&e<500?cn.Invalid:e>=500?cn.Failed:cn.Unknown},t}(),Rae=function(t){rs(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.customHeaders=n,r}return e.prototype.send=function(n,r){return te(this,void 0,void 0,function(){var i,a,s;return ee(this,function(o){switch(o.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:re({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(r),method:"POST"},[4,fetch(n,i)];case 1:return a=o.sent(),[4,a.text()];case 2:s=o.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch{return[2,this.buildResponse({code:a.status})]}return[2]}})})},e}(a0),rF=2*1024;function iF(){return typeof CompressionStream<"u"}function aF(t){return te(this,void 0,void 0,function(){var e,n;return ee(this,function(r){switch(r.label){case 0:if(e=CompressionStream,typeof e>"u")return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),n=new Blob([t]).stream().pipeThrough(new e("gzip")),[4,new Response(n).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var Oae=function(){function t(e,n){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=n}return t.prototype.fetchConfig=function(){var e=null,n={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(i){return this.logger.debug("Remote config localstorage failed to access: ",i),Promise.resolve(n)}if(e===null)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(n);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(i){return this.logger.debug("Remote config localstorage failed to parse: ",i),localStorage.removeItem(this.key),Promise.resolve(n)}},t.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(n){this.logger.debug("Remote config localstorage failed to set: ",n)}return Promise.resolve(!1)},t}();function Mae(t,e){return new Promise(function(n,r){var i=function(){var a=new Error("Remote config custom fetch aborted by timeout");a.name="AbortError",r(a)};e.addEventListener("abort",i,{once:!0}),t.then(function(a){e.removeEventListener("abort",i),n(a)},function(a){e.removeEventListener("abort",i),r(a)})})}var Nae="https://sr-client-cfg.amplitude.com/config",Dae="https://sr-client-cfg.eu.amplitude.com/config",Fae=3,I6={INVALID_API_KEY:401,FORB
vendor: 2,596 bytes, line 29
29IDDEN:403,RATE_LIMIT:429},Uae=1e3,jae=5*60*1e3,sF=function(){function t(e,n,r,i,a){r===void 0&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=i||(r==="US"?Nae:Dae),this.logger=n,this.storage=new Oae(e,n),this.customFetch=a}return t.prototype.subscribe=function(e,n,r){var i=js(),a={id:i,key:e,deliveryMode:n,callback:r};return this.callbackInfos.push(a),n==="all"?this.subscribeAll(a):this.subscribeWaitForRemote(a,n.timeout),i},t.prototype.unsubscribe=function(e){var n=this.callbackInfos.findIndex(function(r){return r.id===e});return n===-1?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(n,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},t.prototype.updateConfigs=function(){return te(this,void 0,void 0,function(){var e,n,r=this;return ee(this,function(i){switch(i.label){case 0:return this.lastSuccessfulFetch&&(e=Date.now()-this.lastSuccessfulFetch,e<jae)?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return n=i.sent(),this.storage.setConfig(n),this.callbackInfos.forEach(function(a){r.sendCallback(a,n,"remote")}),[2]}})})},t.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(n){return n.remoteConfig!==null&&(e.lastSuccessfulFetch=Date.now()),n}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},t.prototype.subscribeAll=function(e){return te(this,void 0,void 0,function(){var n,r,i,a=this;return ee(this,function(s){switch(s.label){case 0:return n=this.getOrCreateFetchPromise().then(function(o){a.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(o))),a.sendCallback(e,o,"remote"),a.storage.setConfig(o)}),r=this.storage.fetchConfig().then(function(o){return o}),[4,Promise.race([n,r])];case 1:return i=s.sent(),i!==void 0&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(i))),i.remoteConfig!==null?this.sendCallback(e,i,"cache"):this.logger.debug("Remote config client skips sending c
29allback because cache is empty (first time user).")),[4,n];case 2:return s.sent(),[2]}})})},t.prototype.subscribeWaitForRemote=function(e,n){return te(this,void 0,void 0,function(){var r,i,i;return ee(this,function(a){switch(a.label){case 0:r=new Promise(function(s,o){setTimeout(function(){o("Timeout exceeded")},n)}),a.label=1;case 1:return a.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return i=a.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,i,"remote"),this.storage.setConfig(i),[3,5];case 3:return a.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return i=a.sent(),i.remoteConfig!==null?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,i,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,i,"remote")),[3,5];case 5:return[2]}})})},t.prototype.sendCallback=function(e,n,r){e.lastCallback=new Date;var i;e.key?i=e.key.split(".").reduce(function(a,s){return a===null?a:s in a?a[s]:null},n.remoteConfig):i=n.remoteConfig,e.callback(i,r,n.lastFetch)},t.prototype.fetch=function(e,n){return e===void 0&&(e=Fae),n===void 0&&(n=Uae),te(this,void 0,void 0,function(){var r,i,a,s,o,c,l=this;return ee(this,function(u){switch(u.label){case 0:r=n/e,i={remoteConfig:null,lastFetch:new Date},a=function(d){var f,h,p,g,y,v,b,w,_,E,C;return ee(this,function(x){switch(x.label){case 0:f=!0,h=new AbortController,p=setTimeout(function(){return h.abort()},n),x.label=1;case 1:return x.trys.push([1,10,11,12]),g=s.getUrlParams(),y={Accept:"*/*"},s.customFetch?[4,Mae(s.customFetch({url:g,method:"GET",headers:y,signal:h.signal}),h.signal)]:[3,3];case 2:return b=x.sent(),[3,5];case 3:return[4,fetch(g,{method:"GET",headers:y,signal:h.signal})];case 4:b=x.sent(),x.label=5;case 5:return v=b,w=v.ok||v.status>=200&&v.status<300,w?[3,7]:[4,v.text()];case 6:return _=x.sent(),s.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(v.status,": ").concat(_)),v.status===I6.INVALID_API_KEY||v.status===I6.FORBIDDEN?(s.logger.error("Remote config client fetch failed with ".concat(v.status,". Invalid API key; future fetches will be skipped.")),s.isLastFetchInvalidApiKey=!0,f=!1):v.status>=400&&v.status<500&&v.status!==I6.RATE_LIMIT&&(f=!1),[3,9];case 7:return[4,v.json()];case 8:return E=x.sent(),[2,{value:{remoteConfig:E,lastFetch:new Date}}];case 9:return[3,12];case 10:return C=x.sent(),C instanceof Error&&C.name==="AbortError"?s.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(n,"ms")):s.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),C),[3,12];case 11:return clearTimeout(p),[7];case 12:return f?d<e-1?[4,new Promise(function($){return setTimeout($,l.getJitterDelay(r))})]:[3,14]:[2,"break"];case 13:x.sent(),x.label=14;case 14:return[2]}})},s=this,o=0,u.label=1;case 1:return o<e?[5,a(o)]:[3,4];case 2:if(c=u.sent(),typeof c=="object")return[2,c.value];if(c==="break")return[3,4];u.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})},t.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},t.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",t.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(e,"?").concat(n.toString())},t.CONFIG_GROUP="browser",t}(),T6=He(),vd=T6?.console,cu={},Ch={},L6=!1;function Bae(t){if(!vd||typeof vd[t]!="function")return!1;if(Ch[t])return!0;var e=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{if(cu[t]&&!L6){L6=!0;var i=cu[t];i&&i.forEach(function(a){try{a(t,n)}catch{}})}}catch{}return L6=!1,Ch[t].apply(vd,n)};return Ch[t]=vd[t],vd[t]=e,!0}function Vae(t,e){var n=Bae(t);if(!n)return new Error("Console override failed");cu[t]?cu[t].push(e):cu[t]=[e]}function Hae(t){var e,n;try{for(var r=Se(Object.values(cu)),i=r.next();!i.done;i=r.next())for(var a=i.value,s=a.length-1;s>=0;s--)if(a[s]===t){a.splice(s,1);break}}catch(o){e={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}function Wae(){var t,e;try{for(var n=Se(Object.entries(Ch)),r=n.next();!r.done;r=n.next()){var i=$e(r.value,2),a=i[0],s=i[1];s&&(vd[a]=s)}}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}Ch={},cu={}}var nI={addListener:Vae,removeListener:Hae,_restoreConsole:Wae},rw;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(rw||(rw={}));var qae=null,zae=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],oF="data-amp-track-",Zae=["div","span","h1","h2","h3","h4","h5","h6"],cF=150,Kae=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],lF=Qe(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],$e(Kae),!1),Gae=lF,Yae=lF,Jae=["*"],Xae=1e3,Qae=4,ese=50;function tse(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null||t===void 0}function uF(t,e,n){if(t){var r=e.map(rI),i=n.map(rI);dF({json:t,allowlist:r,excludelist:i,ancestors:[]})}}function dF(t){var e,n,r=t.json,i=t.targetObject,a=t.allowlist,s=t.excludelist,o=t.ancestors,c=t.parentObject,l=t.targetKey;
29i||(i=r);var u=Object.keys(i);try{for(var d=Se(u),f=d.next();!f.done;f=d.next()){var h=f.value,p=Qe(Qe([],$e(o),!1),[h],!1);tse(i[h])?(!iI(p,a)||iI(p,s))&&delete i[h]:dF({json:r,targetObject:i[h],allowlist:a,excludelist:s,ancestors:p,parentObject:i,targetKey:h})}}catch(g){e={error:g}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}Object.keys(i).length===0&&c&&l&&delete c[l]}function rI(t){return t.startsWith("/")&&(t=t.slice(1)),t.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function iw(t,e,n,r){if(n===void 0&&(n=0),r===void 0&&(r=0),r===e.length)return n===t.length;if(n===t.length){for(;r<e.length&&e[r]==="**";)r++;return r===e.length}var i=e[r];if(i==="**"){if(r+1===e.length)return!0;for(var a=n;a<=t.length;a++)if(iw(t,e,a,r+1))return!0;return!1}else return i==="*"||i===t[n]?iw(t,e,n+1,r+1):!1}function iI(t,e){return e.some(function(n){return iw(t,n)})}var nse=500,fF=100,rse=function(){function t(e){this.request=e}return t.prototype.headers=function(e){var n,r;e===void 0&&(e=[]);var i=this.request.headers,a={};if(Array.isArray(i))i.forEach(function(d){var f=$e(d,2),h=f[0],p=f[1];a[h]=p});else if(i instanceof Headers)i.forEach(function(d,f){a[f]=d});else if(typeof i=="object"&&i!==null)try{for(var s=Se(Object.entries(i)),o=s.next();!o.done;o=s.next()){var c=$e(o.value,2),l=c[0],u=c[1];a[l]=u}}catch(d){n={error:d}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return Mm(a,{allow:e})},Object.defineProperty(t.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var e=He();if(e?.TextEncoder){var n=this.request.body;return this._bodySize=hF(n,fF),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"body",{get:function(){return typeof this.request.body=="string"?this.request.body:null},enumerable:!1,configurable:!0}),t.prototype.json=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(i){return e.length===0?[2,null]:(r=this.body,[2,RC(r,e,n)])})})},t}(),ise=function(){function t(e,n){this.bodyRaw=e,this.requestHeaders=n}return t.prototype.headers=function(e){return e===void 0&&(e=[]),Mm(this.requestHeaders,{allow:e})},Object.defineProperty(t.prototype,"bodySize",{get:function(){return hF(this.bodyRaw,fF)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"body",{get:function(){return typeof this.bodyRaw=="string"?this.bodyRaw:null},enumerable:!1,configurable:!0}),t.prototype.json=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(i){return e.length===0?[2,null]:(r=this.body,[2,RC(r,e,n)])})})},t}();function hF(t,e){var n,r,i,a=He(),s=a?.TextEncoder;if(s&&t!=null){var o;if(typeof t=="string")o=t,i=new s().encode(o).length;else if(typeof Blob<"u"&&t instanceof Blob)o=t,i=o.size;else if(typeof URLSearchParams<"u"&&t instanceof URLSearchParams)o=t,i=new s().encode(o.toString()).length;else if(ArrayBuffer.isView(t))o=t,i=o.byteLength;else if(t instanceof ArrayBuffer)o=t,i=o.byteLength;else if(typeof FormData<"u"&&t instanceof FormData){var c=t,l=0,u=0;try{for(var d=Se(c.entries()),f=d.next();!f.done;f=d.next()){var h=$e(f.value,2),p=h[0],g=h[1];if(l+=p.length,typeof g=="string")l+=new s().encode(g).length;else if(typeof Blob<"u"&&g instanceof Blob)l+=g.size;else return;if(++u>=e)return}}catch(y){n={error:y}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}i=l}else if(typeof ReadableStream<"u"&&t instanceof ReadableStream){o=t;return}return i}}var ase=function(){function t(e){this.response=e}return t.prototype.headers=function(e){var n;if(e===void 0&&(e=[]),this.response.headers instanceof Headers){var r=this.response.headers,i={};return(n=r?.forEach)===null||n===void 0||n.call(r,function(a,s){i[s]=a}),Mm(i,{allow:e})}},Object.defineProperty(t.prototype,"bodySize",{get:function(){var e,n;if(this._bodySize!==void 0)return this._bodySize;var r=(n=(e=this.response.headers)===null||e===void 0?void 0:e.get)===null||n===void 0?void 0:n.call(e,"content-length"),i=r?parseInt(r,10):void 0;return this._bodySize=i,i}
29,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),t.prototype.text=function(){return te(this,void 0,void 0,function(){var e,n,r;return ee(this,function(i){switch(i.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),i.label=1;case 1:return i.trys.push([1,3,,4]),e=this.clonedResponse.text(),n=new Promise(function(a){return setTimeout(function(){return a(null)},nse)}),[4,Promise.race([e,n])];case 2:return r=i.sent(),[2,r];case 3:return i.sent(),[2,null];case 4:return[2]}})})},t.prototype.json=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(i){switch(i.label){case 0:return e.length===0?[2,null]:[4,this.text()];case 1:return r=i.sent(),[2,RC(r,e,n)]}})})},t}(),sse=function(){function t(e,n,r,i){this.statusCode=e,this.headersString=n,this.size=r,this.getJson=i}return Object.defineProperty(t.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),t.prototype.headers=function(e){var n,r;if(e===void 0&&(e=[]),!this.headersString)return{};var i={},a=this.headersString.split(`\r 30`);try{for(var s=Se(a),o=s.next();!o.done;o=s.next()){var c=o.value,l=$e(c.split(": "),2),u=l[0],d=l[1];u&&d&&(i[u]=d)}}catch(f){n={error:f}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return Mm(i,{allow:e})},t.prototype.json=function(e,n){return e===void 0&&(e=[]),n===void 0&&(n=[]),te(this,void 0,void 0,function(){var r;return ee(this,function(i){return e.length===0?[2,null]:(r=this.getJson(),r?(uF(r,e,n),[2,r]):[2,null])})})},t}();function RC(t,e,n){if(!t)return null;try{var r=JSON.parse(t);return uF(r,e,n),r}catch{return null}}var Eh;(function(t){t.REDACT="redact",t.REMOVE="remove"})(Eh||(Eh={}));var aI="[REDACTED]",Mm=function(t,e){var n,r,i=e.allow,a=i===void 0?[]:i,s=e.strategy,o=s===void 0?Eh.REMOVE:s,c=Qe([],$e(Rie),!1),l={},u=function(p){var g=p.toLowerCase();c.find(function(y){return y.toLowerCase()===g})?o===Eh.REDACT&&(l[p]=aI):a.find(function(y){return y.toLowerCase()===g})?l[p]=t[p]:o===Eh.REDACT&&(l[p]=aI)};try{for(var d=Se(Object.keys(t)),f=d.next();!f.done;f=d.next()){var h=f.value;u(h)}}catch(p){n={error:p}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return l},ose=function(){function t(e,n,r,i,a,s,o,c,l,u,d){o===void 0&&(o=0),this.type=e,this.method=n,this.timestamp=r,this.startTime=i,this.url=a,this.requestWrapper=s,this.status=o,this.duration=c,this.responseWrapper=l,this.error=u,this.endTime=d}return t.prototype.toSerializable=function(){var e,n,r,i,a={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:(e=this.requestWrapper)===null||e===void 0?void 0:e.headers(Qe([],$e(Ng),!1)),requestBodySize:(n=this.requestWrapper)===null||n===void 0?void 0:n.bodySize,responseHeaders:(r=this.responseWrapper)===null||r===void 0?void 0:r.headers(Qe([],$e(Ng),!1)),responseBodySize:(i=this.responseWrapper)===null||i===void 0?void 0:i.bodySize};return Object.fromEntries(Object.entries(a).filter(function(s){var o=$e(s,2);o[0];var c=o[1];return c!==void 0}))},t}();function cse(t){return typeof t=="object"&&t!==null&&"url"in t&&"method"in t}var lse=function(){function t(e,n){n===void 0&&(n=js()),this.callback=e,this.id=n}return t}();function wl(t){try{t()}catch{}}var use=function(){function t(e){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=e;var n=He();t.isSupported()&&(this.globalScope=n)}return t.isSupported=function(){var e=He();return!!e&&!!e.fetch},t.prototype.subscribe=function(e,n){var r,i,a,s,o,c,l,u,d,f;if(this.logger||(this.logger=n),this.eventCallbacks.set(e.id,e),!this.isObserving){var h=(a=(i=(r=this.globalScope)===null||r===void 0?void 0:r.XMLHttpRequest)===null||i===void 0?void 0:i.prototype)===null||a===void 0?void 0:a.open,p=(c=(o=(s=this.globalScope)===null||s===void 0?void 0:s.XMLHttpRequest)===null||o===void 0?void 0:o.prototype)===null||c===void 0?void 0:c.send,g=(d=(u=(l=this.globalScope)===null||l===void 0?void 0:l.XMLHttpRequest)===null||u===void 0?void 0:u.prototype)===null||d===void 0?void 0:d.setRequestHeader;h&&p&&g&&this.observeXhr(h,p,g);var y=(f=this.globalScope)===null||f===void 0?void 0:f.fetch;y&&this.observeFetch(y),this.isObserving=!0}},t.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},t.prototype.triggerEventCallbacks=function(e){var n=this;this.eventCallbacks.forEach(function(r){try{r.callback(e)}catch(i){wl(function(){var a;(a=n.logger)===null||a===void 0||a.debug("an unexpected error occurred while triggering event callbacks",i)})}})},t.prototype.handleNetworkRequestEvent=function(e,n,r,i,a,s,o){var c;if(!(s===void 0||o===void 0)){var l,u="GET";if(cse(n)?(l=n.url,u=n.method):l=(c=n?.toString)===null||c===void 0?void 0:c.call(n),l)try{var d=new URL(l);l="".concat(d.protocol,"//").concat(d.host).concat(d.pathname).concat(d.search).concat(d.hash)}catch{}u=r?.method||u;var f,h;
30i&&(f=i.status),a&&(h={name:a.name||"UnknownError",message:a.message||"An unknown error occurred"},f=0);var p=Math.floor(performance.now()-o),g=Math.floor(s+p),y=new ose(e,u,s,s,l,r,f,p,i,h,g);this.triggerEventCallbacks(y)}},t.prototype.getTimestamps=function(){var e,n;return{startTime:(e=Date.now)===null||e===void 0?void 0:e.call(Date),durationStart:(n=performance?.now)===null||n===void 0?void 0:n.call(performance)}},t.prototype.observeFetch=function(e){var n=this;!this.globalScope||!e||(this.globalScope.fetch=function(r,i){return te(n,void 0,void 0,function(){var a,s,o,c,l=this;return ee(this,function(u){switch(u.label){case 0:try{a=this.getTimestamps()}catch(d){wl(function(){var f;return(f=l.logger)===null||f===void 0?void 0:f.debug("an unexpected error occurred while retrieving timestamps",d)})}u.label=1;case 1:return u.trys.push([1,3,,4]),[4,e(r,i)];case 2:return s=u.sent(),[3,4];case 3:return c=u.sent(),o=c,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,i?new rse(i):void 0,s?new ase(s):void 0,o,a?.startTime,a?.durationStart)}catch(d){wl(function(){var f;return(f=l.logger)===null||f===void 0?void 0:f.debug("an unexpected error occurred while handling fetch",d)})}if(s)return[2,s];throw o}})})})},t.createXhrJsonParser=function(e,n){return function(){var r;try{if(e.responseType==="json"){if(!((r=n.globalScope)===null||r===void 0)&&r.structuredClone)return n.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(i){return i instanceof Error&&i.name==="InvalidStateError"&&wl(function(){var a;return(a=n.logger)===null||a===void 0?void 0:a.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))}),null}return null}},t.prototype.observeXhr=function(e,n,r){if(!(!this.globalScope||!e||!n)){var i=this.globalScope.XMLHttpRequest.prototype,a=this;i.open=function(){for(var s,o=[],c=0;c<arguments.length;c++)o[c]=arguments[c];var l=this,u=$e(o,2),d=u[0],f=u[1];try{l.$$AmplitudeAnalyticsEvent=re({method:d,url:(s=f?.toString)===null||s===void 0?void 0:s.call(f),headers:{}},a.getTimestamps())}catch(h){wl(function(){var p;return(p=a.logger)===null||p===void 0?void 0:p.debug("an unexpected error occurred while calling xhr open",h)})}return e.apply(l,o)},i.send=function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var c=this,l=c,u=t.createXhrJsonParser(c,a),d=s[0],f=l.$$AmplitudeAnalyticsEvent;return l.$$AmplitudeAnalyticsEvent&&l.addEventListener("loadend",function(){try{var h=l.getAllResponseHeaders(),p=l.getResponseHeader("content-length"),g=new sse(l.status,h,p?parseInt(p,10):void 0,u),y=l.$$AmplitudeAnalyticsEvent.headers,v=new ise(d,y);f.status=l.status,a.handleNetworkRequestEvent("xhr",{url:f.url,method:f.method},v,g,void 0,f.startTime,f.durationStart)}catch(b){wl(function(){var w;return(w=a.logger)===null||w===void 0?void 0:w.debug("an unexpected error occurred while handling xhr send",b)})}}),n.apply(l,s)},i.setRequestHeader=function(s,o){var c=this;try{var l=c.$$AmplitudeAnalyticsEvent;l&&(l.headers[s]=o)}catch(u){wl(function(){var d;return(d=a.logger)===null||d===void 0?void 0:d.debug("an unexpected error occurred while calling xhr setRequestHeader",u)})}r.apply(c,[s,o])}}},t}(),sI=new use,dse=function(t,e){return t?.map(function(n){var r,i;if(!((r=n.urls)===null||r===void 0)&&r.length&&(!((i=n.hosts)===null||i===void 0)&&i.length)){var a=JSON.stringify(n.hosts),s=JSON.stringify(n.urls);return e?.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(a,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),re(re({},n),{hosts:void 0})}return n})},OC=function(){function t(){}return t.prototype.parse=function(){return te(this,void 0,void 0,function(){return ee(this,function(e){return[2,re(re(re(re({},Pm),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=Dg(),n=e[Iie],r=e[Tie],i=e[Lie],a=e[kie],s=e[$ie],o=e[Pie];return{utm_campaign:n,utm_content:r,utm_id:i,utm_medium:a,utm_source:s,utm_term:o}},t.prototype.getReferrer=function(){var e,n,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=(n=(e=r.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&n!==void 0?n:void 0}catch{}return r},t.prototype.getClickIds=function(){var e,n=Dg();return e={},e[Dx]=n[Dx],e[Fx]=n[Fx],e[Ux]=n[Ux],e[jx]=n[jx],e[Bx]=n[Bx],e[Vx]=n[Vx],e[Hx]=n[Hx],e[Wx]=n[Wx],e[qx]=n[qx],e[zx]=n[zx],e[Zx]=n[Zx],e},t}(),Gc="data-amp-mask",Hc="*****",fse=/\b(?:\d[ -]*?){13,16}\b/,hse=/(\d{3}-?\d{2}-?\d{4})/g,pse=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,MC=function(t,e){var n,r;if(e===void 0&&(e=[]),typeof t!="string")return"";var i=t;i=i.replace(fse,Hc),i=i.replace(hse,Hc),i=i.replace(pse,Hc);try{for(var a=Se(e),s=a.next();!s.done;s=a.next()){var o=s.value;try{i=i.replace(o,Hc)}catch{}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},NC=function(t){if(typeof document>"u"||!document.title)return"";var e=document.querySelector("title");
30return e&&e.hasAttribute(Gc)?Hc:t?t(document.title):document.title},Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});Nm.Observable=void 0;const pF=t=>!!Symbol[t],DC=t=>pF(t)?Symbol[t]:"@@"+t,gse=DC("iterator"),aw=DC("observable"),gF=DC("species");function Ug(t,e){let n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function bf(t){let e=t.constructor;return e!==void 0&&(e=e[gF],e===null&&(e=void 0)),e!==void 0?e:Dm}function yse(t){return t instanceof Dm}function h2(t){h2.log?h2.log(t):setTimeout(()=>{throw t})}function x3(t){Promise.resolve().then(()=>{try{t()}catch(e){h2(e)}})}function yF(t){let e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{let n=Ug(e,"unsubscribe");n&&n.call(e)}}catch(n){h2(n)}}function sw(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function mse(t){let e=t._queue;if(e){t._queue=void 0,t._state="ready";for(let n=0;n<e.length&&(mF(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function mF(t,e,n){t._state="running";let r=t._observer;try{let i=Ug(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(sw(t),i)i.call(r,n);else throw n;break;case"complete":sw(t),i&&i.call(r);break}}catch(i){h2(i)}t._state==="closed"?yF(t):t._state==="running"&&(t._state="ready")}function k6(t,e,n){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:n}],x3(()=>mse(t));return}mF(t,e,n)}}class vse{constructor(e,n){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let r=this,i={get closed(){return r._state==="closed"},next(a){k6(r,"next",a)},error(a){k6(r,"error",a)},complete(){k6(r,"complete")}};try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(sw(this),yF(this))}}let Dm=class I3{constructor(e){if(!(this instanceof I3))throw new TypeError("Observable cannot be called as a function");if(typeof e!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return(typeof e!="object"||e===null)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new vse(e,this._subscriber)}forEach(e){return new Promise((n,r)=>{if(typeof e!="function"){r(new TypeError(e+" is not a function"));return}function i(){a.unsubscribe(),n()}let a=this.subscribe({next(s){try{e(s,i)}catch(o){r(o),a.unsubscribe()}},error:r,complete:n})})}map(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let n=bf(this);return new n(r=>this.subscribe({next(i){try{i=e(i)}catch(a){return r.error(a)}r.next(i)},error(i){r.error(i)},complete(){r.complete()}}))}filter(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let n=bf(this);return new n(r=>this.subscribe({next(i){try{if(!e(i))return}catch(a){return r.error(a)}r.next(i)},error(i){r.error(i)},complete(){r.complete()}}))}reduce(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let n=bf(this),r=arguments.length>1,i=!1,s=arguments[1];return new n(o=>this.subscribe({next(c){let l=!i;if(i=!0,!l||r)try{s=e(s,c)}catch(u){return o.error(u)}else s=c},error(c){o.error(c)},complete(){if(!i&&!r)return o.error(new TypeError("Cannot reduce an empty sequence"));o.next(s),o.complete()}}))}async all(){let e=[];return await this.forEach(n=>e.push(n)),e}concat(...e){let n=bf(this);return new n(r=>{let i,a=0;function s(o){i=o.subscribe({next(c){r.next(c)},error(c){r.error(c)},complete(){a===e.length?(i=void 0,r.complete()):s(n.from(e[a++]))}})}return s(this),()=>{i&&(i.unsubscribe(),i=void 0)}})}flatMap(e){if(typeof e!="function")throw new TypeError(e+" is not a function");let n=bf(this);return new n(r=>{let i=[],a=this.subscribe({next(o){if(e)try{o=e(o)}catch(l){return r.error(l)}let c=n.from(o).subscribe({next(l){r.next(l)},error(l){r.error(l)},complete(){let l=i.indexOf(c);l>=0&&i.splice(l,1),s()}});i.push(c)},error(o){r.error(o)},complete(){s()}});function s(){a.closed&&i.length===0&&r.complete()}return()=>
30{i.forEach(o=>o.unsubscribe()),a.unsubscribe()}})}[aw](){return this}static from(e){let n=typeof this=="function"?this:I3;if(e==null)throw new TypeError(e+" is not an object");let r=Ug(e,aw);if(r){let i=r.call(e);if(Object(i)!==i)throw new TypeError(i+" is not an object");return yse(i)&&i.constructor===n?i:new n(a=>i.subscribe(a))}if(pF("iterator")&&(r=Ug(e,gse),r))return new n(i=>{x3(()=>{if(!i.closed){for(let a of r.call(e))if(i.next(a),i.closed)return;i.complete()}})});if(Array.isArray(e))return new n(i=>{x3(()=>{if(!i.closed){for(let a=0;a<e.length;++a)if(i.next(e[a]),i.closed)return;i.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){let n=typeof this=="function"?this:I3;return new n(r=>{x3(()=>{if(!r.closed){for(let i=0;i<e.length;++i)if(r.next(e[i]),r.closed)return;r.complete()}})})}static get[gF](){return this}};Nm.Observable=Dm;Object.defineProperty(Dm,Symbol("extensions"),{value:{symbol:aw,hostReportError:h2},configurable:!0});var wse=Nm.Observable;const Jn=Zs(wse);function FC(t,e){return new Jn(function(n){t.subscribe({next:function(r){e(r).then(function(i){return n.next(i)}).catch(function(i){return n.error(i)})},error:function(r){n.error(r)},complete:function(){n.complete()}})})}function yu(t,e){return new Jn(function(n){var r=!1,i=new Set,a=function(){var o,c;r=!0;try{for(var l=Se(i),u=l.next();!u.done;u=l.next()){var d=u.value;try{d.unsubscribe()}catch{}}}catch(f){o={error:f}}finally{try{u&&!u.done&&(c=l.return)&&c.call(l)}finally{if(o)throw o.error}}i.clear()},s=function(o){var c=o.subscribe({next:function(l){r||n.next(l)},error:function(l){r||(r=!0,n.error(l),a())},complete:function(){i.delete(c),!r&&i.size===0&&(n.complete(),a(),r=!0)}});i.add(c)};return s(t),s(e),a})}function Cs(t){var e=new Set,n=null;function r(){n?.unsubscribe(),n=null,e.clear()}return new Jn(function(i){return e.add(i),n===null&&(n=t.subscribe({next:function(a){var s,o,c;try{for(var l=Se(e),u=l.next();!u.done;u=l.next()){var d=u.value;(c=d.next)===null||c===void 0||c.call(d,a)}}catch(f){s={error:f}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(s)throw s.error}}},error:function(a){var s,o,c;try{for(var l=Se(e),u=l.next();!u.done;u=l.next()){var d=u.value;(c=d.error)===null||c===void 0||c.call(d,a)}}catch(f){s={error:f}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(s)throw s.error}}r()},complete:function(){var a,s,o;try{for(var c=Se(e),l=c.next();!l.done;l=c.next()){var u=l.value;(o=u.complete)===null||o===void 0||o.call(u)}}catch(d){a={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}r()}})),function(){e.delete(i),e.size===0&&n&&(n.unsubscribe(),n=null)}})}var UC={exports:{}},bse=Object.prototype.hasOwnProperty;function vF(t){return"[Throws: "+(t?t.message:"?")+"]"}function _se(t,e){if(bse.call(t,e))try{return t[e]}catch(n){return vF(n)}return t[e]}function wF(t){var e=[];function n(r){if(r===null||typeof r!="object")return r;if(e.indexOf(r)!==-1)return"[Circular]";if(e.push(r),typeof r.toJSON=="function")try{var i=n(r.toJSON());return e.pop(),i}catch(o){return vF(o)}if(Array.isArray(r)){var a=r.map(n);return e.pop(),a}var s=Object.keys(r).reduce(function(o,c){return o[c]=n(_se(r,c)),o},{});return e.pop(),s}return n(t)}UC.exports=function(t,e,n){return JSON.stringify(wF(t),e,n)};var Cse=UC.exports.ensureProperties=wF,bF=UC.exports;const _F=Zs(bF),Ese=NQ({__proto__:null,default:_F,ensureProperties:Cse},[bF]);var ow=_F||Ese,cw="https://app.amplitude.com",Sse="https://app.eu.amplitude.com",Ase="https://apps.stag2.amplitude.com",CF={US:cw,EU:Sse,STAGING:Ase},xse="https://cdn.amplitude.com/libs/background-capture-1.0.3.js.gz",Ise=function(t){var e=document.querySelector('script[src="'.concat(CSS.escape(t),'"]'));return e?Promise.resolve({status:!0}):new Promise(function(n,r){var i;try{var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=t,a.addEventListener("load",function(){n({status:!0})},{once:!0}),a.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(t)})}),(i=document.head)===null||i===void 0||i.appendChild(a)}catch(s){r(s)}})};function Tse(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var EF,lw="__AMPLITUDE_MESSENGER_INSTANCE__",jg="__AMPLITUDE_MESSENGER__",Lse=function(){function t(e){var n=e===void 0?{}:e,r=n.origin,i=r===void 0?cw:r;this[EF]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=i}return t.prototype.notify=function(e){var n,r,i,a;(r=(n=this.logger)===null||n===void 0?void 0:n.debug)===null||r===void 0||r.call(n,"Message sent: ",JSON.stringify(e)),(a=(i=window.opener)===null||i===void 0?void 0:i.postMessage)===null||a===void 0||a.call(i,e,this.endpoint)},t.prototype.sendRequest=function(e,n,r){var i=this;r===void 0&&(r={timeout:15e3});var a=Tse(),s={id:a,action:e,args:n},o=new Promise(function(c,l){i.requestCallbacks[a]={resolve:c,reject:l},i.notify(s),r.timeout>0&&setTimeout(function(){l(new Error("".concat(e," timed out (id: ").concat(a,")"))),delete i.requestCallbacks[a]},r.timeout)});return o},t.prototype.handleResponse=function(e){var n;if(!this.requestCallbacks[e.id]){(n=this.logger)===null||n===void 0||n.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},t.prototype.registerActionHandler=function(e,n){var r,i,a,s;this.actionHandlers.has(e)&&((s=(a=this.logger)===null||a===void 0?void 0:a.warn)===null||s===void 0||s.call(a,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,n);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var c=Se(o),l=c.next();!l.done;l=c.next()){var u=l.value;n(u)}}catch(d){r={error:d}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}},t.prototype.loadScriptOnce=function(e){return te(this,void 0,void 0,function(){var n,r,i;return ee(this,function(a){switch(a.label){case 0:if(n=this.scriptLoadPromises.get(e),n)return[2,n];r=Ise(e).then(function(){}),this.scriptLoadPromises.set(e,r),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r];case 2:return a.sent(),[3,4];case 3:throw i=a.sent(),this.scriptLoadPromises.delete(e),i;case 4:return[2]}})})},t.prototype.setup=function(e){var n=this,r,i,a=e===void 0?{}:e,s=a.logger,o=a.endpoint;
30s&&(this.logger=s),o&&this.endpoint===cw&&(this.endpoint=o),!this.isSetup&&(this.isSetup=!0,(i=(r=this.logger)===null||r===void 0?void 0:r.debug)===null||i===void 0||i.call(r,"Setting up messenger"),this.messageHandler=function(c){var l,u,d,f,h;if((u=(l=n.logger)===null||l===void 0?void 0:l.debug)===null||u===void 0||u.call(l,"Message received: ",JSON.stringify(c)),n.endpoint===c.origin){var p=c.data,g=p?.action;if(g)if("id"in p&&p.id)(f=(d=n.logger)===null||d===void 0?void 0:d.debug)===null||f===void 0||f.call(d,"Received Response to previous request: ",JSON.stringify(c)),n.handleResponse(p);else{if(g==="ping"){n.notify({action:"pong"});return}var y=n.actionHandlers.get(g);if(y)y(p.data);else{var v=(h=n.pendingMessages.get(g))!==null&&h!==void 0?h:[];v.push(p.data),n.pendingMessages.set(g,v)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},t.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=He();e?.[jg]===this&&delete e[jg]},t}();EF=lw;function kse(t){return typeof t=="object"&&t!==null&&lw in t&&t[lw]===!0}function SF(t){var e=He(),n=e?.[jg];if(kse(n))return n;var r=new Lse(t);return e&&(e[jg]=r),r}var oI="__AMPLITUDE_BACKGROUND_CAPTURE__";function AF(t,e){var n,r=t;if(r[oI]!==!0){r[oI]=!0;var i=(n=void 0)!==null&&n!==void 0?n:xse,a=null,s=function(o,c){var l,u;o==="background-capture-complete"&&((u=(l=t.logger)===null||l===void 0?void 0:l.debug)===null||u===void 0||u.call(l,"Background capture complete"),t.notify({action:"background-capture-complete",data:c}))};t.registerActionHandler("initialize-background-capture",function(){var o,c;(c=(o=t.logger)===null||o===void 0?void 0:o.debug)===null||c===void 0||c.call(o,"Initializing background capture (external script)");var l=new URL(i,t.endpoint).toString();t.loadScriptOnce(l).then(function(){var u,d,f;(d=(u=t.logger)===null||u===void 0?void 0:u.debug)===null||d===void 0||d.call(u,"Background capture script loaded (external)"),a=(f=window?.amplitudeBackgroundCapture)===null||f===void 0?void 0:f.call(window,{messenger:t,onBackgroundCapture:s}),t.notify({action:"background-capture-loaded"})}).catch(function(){var u;(u=t.logger)===null||u===void 0||u.warn("Failed to initialize background capture")})}),t.registerActionHandler("close-background-capture",function(){var o;(o=a?.close)===null||o===void 0||o.call(a),a=null})}}var $6={always:"always",ifEmptyCampaign:"ifEmptyCampaign"};function $se(){var t,e,n=He();return typeof((e=(t=n?.chrome)===null||t===void 0?void 0:t.runtime)===null||e===void 0?void 0:e.id)=="string"}function Pse(){var t,e=He();return((t=e?.navigator)===null||t===void 0?void 0:t.product)==="ReactNative"}function xF(t,e,n){var r,i,a=[];try{for(var s=Se(e??[]),o=s.next();!o.done;o=s.next()){var c=o.value;try{a.push(new RegExp(c))}catch(l){n.warn("Invalid regex pattern: ".concat(c),l)}}}catch(l){r={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return t.concat(a)}function Rse(t,e){var n,r,i,a,s;if(!(typeof t!="object"||t===null||!(!((i=t.captureRules)===null||i===void 0)&&i.length))){var o=re({},t),c=(a=o.captureRules)!==null&&a!==void 0?a:[];try{for(var l=Se(c),u=l.next();!u.done;u=l.next()){var d=u.value;d.urls=xF((s=d.urls)!==null&&s!==void 0?s:[],d.urlsRegex,e),delete d.urlsRegex}}catch(f){n={error:f}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return o}}function IF(t){var e,n,r,i,a,s,o,c,l,u,d,f;if(!(typeof t!="object"||t===null)&&!Array.isArray(t)){var h=Object.keys(t);try{for(var p=Se(h),g=p.next();!g.done;g=p.next()){var y=g.value;try{var v=t[y];typeof v?.enabled=="boolean"&&(v.enabled?(delete v.enabled,Object.keys(v).length===0&&(t[y]=!0)):t[y]=!1),IF(v)}catch{}}}catch(S){e={error:S}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}try{if(!((l=(c=(o=t.autocapture)===null||o===void 0?void 0:o.networkTracking)===null||c===void 0?void 0:c.captureRules)===null||l===void 0)&&l.length)try{for(var b=Se(t.autocapture.
30networkTracking.captureRules),w=b.next();!w.done;w=b.next()){var _=w.value;try{for(var E=(a=void 0,Se(["responseHeaders","requestHeaders"])),C=E.next();!C.done;C=E.next()){var x=C.value,$=(u=_[x])!==null&&u!==void 0?u:{},T=$.captureSafeHeaders,U=$.allowlist;if(!(!T&&!U)){if(U!==void 0&&!Array.isArray(U)){delete _[x];continue}_[x]=Qe(Qe([],$e(T?Ng:[]),!1),$e(U??[]),!1)}}}catch(S){a={error:S}}finally{try{C&&!C.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}}}catch(S){r={error:S}}finally{try{w&&!w.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}}catch{}var O=(d=t.autocapture)===null||d===void 0?void 0:d.frustrationInteractions;O&&(O.rageClick&&(O.rageClicks=O.rageClick,delete O.rageClick),O.deadClick&&(O.deadClicks=O.deadClick,delete O.deadClick));try{var F=(f=t.autocapture)===null||f===void 0?void 0:f.elementInteractions;if(F&&typeof F=="object"&&(F.viewportContentUpdated===!0&&(F.viewportContentUpdated={}),F.viewportContentUpdated===!1&&(F.viewportContentUpdated={enabled:!1}),F.exposureDuration!==void 0)){var k=F.viewportContentUpdated;k===void 0?F.viewportContentUpdated={exposureDuration:F.exposureDuration}:typeof k=="object"&&k.exposureDuration===void 0&&k.enabled!==!1&&(k.exposureDuration=F.exposureDuration),delete F.exposureDuration}}catch{}}}var q2=function(t,e){return typeof t=="boolean"?t:t?.[e]===!1?!1:$se()?!!t?.[e]:!0},uw=function(t){return q2(t,"attribution")},Ose=function(t){return q2(t,"fileDownloads")},TF=function(t){return q2(t,"formInteractions")},LF=function(t){return q2(t,"pageViews")},cI=function(t){return q2(t,"sessions")},Mse=function(t){return q2(t,"pageUrlEnrichment")},kF=function(t){return typeof t=="boolean"?t:typeof t=="object"&&(t.networkTracking===!0||typeof t.networkTracking=="object")},$F=function(t){return typeof t=="boolean"?t:typeof t=="object"&&(t.elementInteractions===!0||typeof t.elementInteractions=="object")},Nse=function(t){return typeof t=="boolean"?t:typeof t=="object"&&t.webVitals===!0},PF=function(t){return typeof t=="boolean"?t:typeof t=="object"&&(t.frustrationInteractions===!0||typeof t.frustrationInteractions=="object")},Dse=function(t){return typeof t=="object"&&(t.performanceTracking===!0||typeof t.performanceTracking=="object")},Fse=function(t){if(typeof t.autocapture=="object"){var e=t.autocapture.performanceTracking;if(e===!0)return{mainThreadBlock:!0};if(typeof e=="object"&&e!==null)return e}},Use=function(t){return typeof t=="boolean"?t:typeof t=="object"&&t!==null&&t.enabled!==!1},jse=function(t){if($F(t.autocapture)&&typeof t.autocapture=="object"&&typeof t.autocapture.elementInteractions=="object")return t.autocapture.elementInteractions},Bse=function(t){if(PF(t.autocapture)&&typeof t.autocapture=="object"&&typeof t.autocapture.frustrationInteractions=="object")return t.autocapture.frustrationInteractions},Vse=function(t){if(kF(t.autocapture)){var e=void 0;return typeof t.autocapture=="object"&&typeof t.autocapture.networkTracking=="object"?e=t.autocapture.networkTracking:t.networkTrackingOptions&&(e=t.networkTrackingOptions),re(re({},e),{captureRules:dse(e?.captureRules,t.loggerProvider)})}},lI=function(t){var e=function(){return!1},n=void 0,r,i=t.pageCounter,a=LF(t.defaultTracking);return a&&(e=void 0,r=void 0,t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.pageViews&&typeof t.defaultTracking.pageViews=="object"&&("trackOn"in t.defaultTracking.pageViews&&(e=t.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in t.defaultTracking.pageViews&&(n=t.defaultTracking.pageViews.trackHistoryChanges),"eventType"in t.defaultTracking.pageViews&&t.defaultTracking.pageViews.eventType&&(r=t.defaultTracking.pageViews.eventType))),{trackOn:e,trackHistoryChanges:n,eventType:r,pageCounter:i}},Hse=function(t){return uw(t.defaultTracking)&&t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.attribution&&typeof t.defaultTracking.attribution=="object"?re({},t.defaultTracking.attribution):{}},Wse=function(t){if(TF(t.defaultTracking)&&t.defaultTracking&&typeof t.defaultTracking=="object"&&typeof t.defaultTracking.formInteractions=="object")return t.defaultTracking.formInteractions},P6=function(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.name,a=r.args,s=r.resolve,o=t&&t[i];if(typeof o=="function"){var c=o.apply(t,a);typeof s=="function"&&s(c?.promise)}}return t},R6=function(t){var e=t;return e&&e._q!==void 0},qse=function(t){var e,n;return typeof((n=(e=t.chrome)===null||e===void 0?void 0:e.runtime)===null||n===void 0?void 0:n.id)=="string"},zse=function(t){var e=t.ServiceWorkerGlobalScope;return typeof e=="function"&&t instanceof e},Zse=function(t){var e=t.WorkerGlobalScope;return typeof e=="function"&&t instanceof e},Kse=function(t){return typeof t.document<"u"},Gse=function(t){var e,n;return typeof((n=(e=t.process)===null||e===void 0?void 0:e.versions)===null||n===void 0?void 0:n.node)=="string"};function Yse(){var t=He();if(!t)return"unknown";var e=qse(t);return zse(t)?e?"chrome_extension_service_worker":"service_worker":Zse(t)?"web_worker":Kse(t)?e?"chrome_extension":"browser":Gse(t)?"node":"unknown"}var jC="2.45.8",RF="amplitude-ts",OF="Web",Jse="$remote",Xse=function(){function t(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(RF,"/").concat(jC),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return t.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},t.prototype.execute=function(e){var n,r;return te(this,void 0,void 0,function(){var i,a,s,o;return ee(this,function(c){return i=new Date().getTime(),a=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1,s=(r=e.event_id)!==null&&r!==void 0?r:a+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=i),o=re(re(re(re(re(re(re(re({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:OF}),this.config.trackingOptions.language&&{language:yae()}),this.config.trackingOptions.ipAddress&&{ip:Jse}),{insert_id:js(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:s,library:this.library,user_agent:this.userAgent}),[2,o]})})},t}(),d1=1e3,MF=function(t){rs(e,t);function e(n){var r=this,i,a,s;try{s=(i=He())===null||i===void 0?void 0:i.localStorage}catch(o){(a=n?.loggerProvider)===null||a===void 0||a.debug("Failed to access localStorage. error=".concat(JSON.stringify(o))),s=void 0}return r=t.call(this,s)||this,r.loggerProvider=n?.loggerProvider,r}return e.prototype.set=function(n,r){var i;return te(this,void 0,void 0,function(){var a;return ee(this,function(s){switch(s.label){case 0:return Array.isArray(r)&&r.length>d1?(a=r.length-d1,[4,t.prototype.set.call(this,n,r.slice(0,d1))]):[3,2];case 1:return s.sent(),(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(a," events because the queue length exceeded ").concat(d1,".")),[3,4];case 2:return[4,t.prototype.set.call(this,n,r)];case 3:s.sent(),s.label=4;case 4:return[2]}})})},e}(Om),Qse=function(t){rs(e,t);function e(){var n;return t.call(this,(n=He())===null||n===void 0?void 0:n.sessionStorage)||this}return e}(Om),eoe=function(t){rs(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.state={done:4},r.customHeaders=n,r}return e.prototype.send=function(n,r,i){return i===void 0&&(i=!1),te(this,void 0,void 0,function(){var a=this;return ee(this,function(s){return[2,new Promise(function(o,c){typeof XMLHttpRequest>"u"&&c(new Error("XHRTransport is not supported."));var l=new XMLHttpRequest;l.open("POST",n,!0),l.onreadystatechange=function(){if(l.readyState===a.state.done){var g=l.responseText;try{o(a.buildResponse(JSON.parse(g)))}catch{o(a.buildResponse({code:l.status}))}}};var u={"Content-Type":"application/json",Accept:"*/*"},d=JSON.stringify(r),f=i&&d.length>=rF&&iF(),h=function(g){var y,v;u=re(re({},a.customHeaders),u);try{for(var b=Se(Object.entries(u)),w=b.next();!w.done;w=b.next()){var _=$e(w.value,2),E=_[0],C=_[1];l.setRequestHeader(E,C)}}catch(x){y={error:x}}finally{try{w&&!w.done&&(v=b.return)&&v.call(b)}finally{if(y)throw y.error}}l.send(g)},p=function(){return te(a,void 0,void 0,function(){var g;return ee(this,function(y){switch(y.label){case 0:return f?[4,aF(d)]:[3,2];case 1:return g=y.sent(),g?(u["Content-Encoding"]="gzip",h(g)):h(d),[3,3];case 2:h(d),y.label=3;case 3:return[2]}})})};p().catch(c)})]})})},e}(a0),toe=16*1024,noe=function(t){rs(e,t);function e(n,r,i){n===void 0&&(n={});var a=t.call(this)||this;return a.customHeaders=n,a.enableKeepalive=r!==!1,a.referrerPolicy=i,a}return e.prototype.send=function(n,r,i){return i===void 0&&(i=!1),te(this,void 0,void 0,function(){var a,s,o,c,l,u,d,f,h;return ee(this,function(p){switch(p.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return a=JSON.stringify(r),s=i&&a.length>=rF&&iF(),o=a,c={"Content-Type":"application/json",Accept:"*/*"},s?[4,aF(a)]:[3,2];case 1:l=p.sent(),l&&(c["Content-Encoding"]="gzip",o=l),p.label=2;case 2:return c=re(re({}
30,this.customHeaders),c),u=typeof o=="string"?o.length:o.byteLength,d={headers:c,body:o,method:"POST",keepalive:this.enableKeepalive&&u<=toe},this.referrerPolicy&&(d.referrerPolicy=this.referrerPolicy),[4,fetch(n,d)];case 3:return f=p.sent(),[4,f.text()];case 4:h=p.sent();try{return[2,this.buildResponse(JSON.parse(h))]}catch{return[2,this.buildResponse({code:f.status})]}return[2]}})})},e}(a0),roe=function(t){rs(e,t);function e(){return t.call(this)||this}return e.prototype.send=function(n,r,i){return te(this,void 0,void 0,function(){var a=this;return ee(this,function(s){return[2,new Promise(function(o,c){var l=He();if(!l?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var u=JSON.stringify(r),d=l.navigator.sendBeacon(n,u);return o(d?a.buildResponse({code:200,events_ingested:r.events.length,payload_size_bytes:u.length,server_upload_time:Date.now()}):a.buildResponse({code:500}))}catch(f){c(f)}})]})})},e}(a0),ioe=function(t,e,n){return n===void 0&&(n=!0),te(void 0,void 0,void 0,function(){var r,i,a,s,o,c,l,u,d;return ee(this,function(f){switch(f.label){case 0:return r=gae(t),[4,e.getRaw(r)];case 1:return i=f.sent(),i?n?[4,e.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;case 3:return a=$e(i.split("."),6),s=a[0],o=a[1],c=a[2],l=a[3],u=a[4],d=a[5],[2,{deviceId:s,userId:aoe(o),sessionId:O6(l),lastEventId:O6(d),lastEventTime:O6(u),optOut:!!c}]}})})},O6=function(t){var e=parseInt(t,32);if(!isNaN(e))return e},aoe=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}},is="[Amplitude]",uI="".concat(is," Form Started"),soe="".concat(is," Form Submitted"),ooe="".concat(is," File Downloaded"),dI="session_start",fI="session_end",coe="".concat(is," File Extension"),loe="".concat(is," File Name"),uoe="".concat(is," Link ID"),doe="".concat(is," Link Text"),foe="".concat(is," Link URL"),M6="".concat(is," Form ID"),N6="".concat(is," Form Name"),D6="".concat(is," Form Destination"),Bg="cookie",NF="US",hI=function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")},hoe=function(t){return Object.values(t).every(function(e){return!e})},poe=function(t){var e=re(re({},t),{referring_domain:void 0,referrer:void 0});return Object.values(e).every(function(n){return!n})},goe=function(t,e,n,r,i,a){i===void 0&&(i=!0),t.referrer;var s=t.referring_domain,o=au(t,["referrer","referring_domain"]),c=e||{};c.referrer;var l=c.referring_domain,u=au(c,["referrer","referring_domain"]),d=n.excludeInternalReferrers;if(d){var f=boe(d,r);if(!(f instanceof TypeError)&&t.referring_domain&&_oe(t.referring_domain,a)){if(f==="always")return pI(f,t.referring_domain,r),!1;if(f==="ifEmptyCampaign"&&poe(t))return pI(f,t.referring_domain,r),!1}}if(yoe(n.excludeReferrers,t.referring_domain))return r.debug("This is not a new campaign because ".concat(t.referring_domain," is in the exclude referrer list.")),!1;if(!i&&hoe(t)&&e)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var h=JSON.stringify(o)!==JSON.stringify(u),p=hI(s||"")!==hI(l||""),g=!e||h||p;return g?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),g},yoe=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=""),t.some(function(n){return n instanceof RegExp?n.test(e):n===e})},moe=function(t,e){var n=e.startsWith(".")?e:".".concat(e),r=t.startsWith(".")?t:".".concat(t);return!!r.endsWith(n)},voe=function(t,e){var n=re(re({},Pm),t),r=Object.entries(n).reduce(function(i,a){var s,o=$e(a,2),c=o[0],l=o[1];return i.setOnce("initial_".concat(c),(s=l??e.initialEmptyValue)!==null&&s!==void 0?s:"EMPTY"),l?i.set(c,l):i.unset(c)},new _h);return $C(r)},woe=function(t){var e=t;return e?(e.startsWith(".")&&(e=e.substring(1)),[new RegExp("".concat(e.replace(".","\\."),"$"))]):[]},boe=function(t,e){if(t===!0)return $6.always;if(typeof t=="object"){var n=t.condition;if(typeof n=="string"&&Object.keys($6).includes(n))return n;if(typeof n>"u")return $6.always}var r="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(t));return e.error(r),new TypeError(r)};function pI(t,e,n){var r="This is not a new campaign because referring_domain=".concat(e," is on the same domain as the current page and it is configured to exclude internal referrers");t==="always"?n.debug(r):t==="ifEmptyCampaign"&&n.debug("".concat(r," with empty campaign parameters"))}var DF=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],FF=function(t){var e,n,r=t||((n=(e=He())===null||e===void 0?void 0:e.location)===null||n===void 0?void 0:n.hostname);if(!r)return"";var i=r.split("."),a=i[i.length-1],s=i[i.length-2];return DF.find(function(o){return r.endsWith(".".concat(o))})&&(a=i[i.length-2]+"."+i[i.length-1],s=i[i.length-3]),s?"".concat(s,".").concat(a):a},_oe=function(t,e){var n=He();if(!n)return!1;var r=(e||"").trim()||FF(n.location.hostname);return moe(t,r)},Coe=function(t){rs(e,t);
30function e(n,r,i,a,s,o,c,l,u,d,f,h,p,g,y,v,b,w,_,E,C,x,$,T,U,O,F,k,S,I,A,R,N,P,j,M,V,B,G,Z,ie,oe,z,J){i===void 0&&(i=new PC),a===void 0&&(a={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),l===void 0&&(l=1e3),u===void 0&&(u=5),d===void 0&&(d=30),f===void 0&&(f=Bg),v===void 0&&(v=new f2),b===void 0&&(b=Qr.Warn),_===void 0&&(_=!1),E===void 0&&(E=!1),$===void 0&&($=""),T===void 0&&(T=NF),F===void 0&&(F=30*60*1e3),k===void 0&&(k=new MF({loggerProvider:v})),S===void 0&&(S={ipAddress:!0,language:!0,platform:!0}),I===void 0&&(I="fetch"),A===void 0&&(A=!1),R===void 0&&(R=!0),B===void 0&&(B=!0),G===void 0&&(G=0),z===void 0&&(z=!1);var K=this,ne;K=t.call(this,{apiKey:n,storageProvider:k,transportProvider:UF(I)})||this,K.apiKey=n,K.appVersion=r,K.cookieOptions=a,K.defaultTracking=s,K.autocapture=o,K.flushIntervalMillis=l,K.flushMaxRetries=u,K.flushQueueSize=d,K.identityStorage=f,K.ingestionMetadata=h,K.instanceName=p,K.loggerProvider=v,K.logLevel=b,K.minIdLength=w,K.offline=_,K.partnerId=C,K.plan=x,K.serverUrl=$,K.serverZone=T,K.sessionTimeout=F,K.storageProvider=k,K.trackingOptions=S,K.transport=I,K.useBatch=A,
30K.fetchRemoteConfig=R,K.networkTrackingOptions=M,K.identify=V,K.enableDiagnostics=B,K.diagnosticsSampleRate=G,K.diagnosticsClient=Z,K.remoteConfig=ie,K.topLevelDomain=oe,K.enableRequestBodyCompression=z,K.customEnrichment=J,K.version=jC,K._optOut=!1,K._cookieStorage=i,K.deviceId=c,K.lastEventId=g,K.lastEventTime=y,K.optOut=E,K.deferredSessionId=O,K.sessionId=U,K.pageCounter=P,K.userId=N,K.debugLogsEnabled=j,K.loggerProvider.enable(j?Qr.Debug:K.logLevel),K.networkTrackingOptions=M,K.identify=V,K.enableDiagnostics=B,K.diagnosticsSampleRate=G,K.diagnosticsClient=Z;var ce=(ne=ie?.fetchRemoteConfig)!==null&&ne!==void 0?ne:R;return K.remoteConfig=K.remoteConfig||{},K.remoteConfig.fetchRemoteConfig=ce,K.fetchRemoteConfig=ce,K.topLevelDomain=oe||FF(),K}return Object.defineProperty(e.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(n){this._cookieStorage!==n&&(this._cookieStorage=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._deviceId},set:function(n){this._deviceId!==n&&(this._deviceId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},set:function(n){this._userId!==n&&(this._userId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._sessionId},set:function(n){this._sessionId!==n&&(this._sessionId=n,n!==void 0&&this._deferredSessionId!==void 0&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(n){this._deferredSessionId!==n&&n!==this.sessionId&&(this._deferredSessionId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(n){this._optOut!==n&&(this._optOut=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(n){this._lastEventTime!==n&&(this._lastEventTime=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(n){this._lastEventId!==n&&(this._lastEventId=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(n){this._pageCounter!==n&&(this._pageCounter=n,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"debugLogsEnabled",{set:function(n){this._debugLogsEnabled!==n&&(this._debugLogsEnabled=n,this.updateStorage())},enumerable:!1,configurable:!0}),e.prototype.updateStorage=function(){var n={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof Fg&&(n.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(QD(this.apiKey),n)},e}(YD),Eoe=function(t,e,n,r,i){return e===void 0&&(e={}),te(void 0,void 0,void 0,function(){var a,s,o,c,l,u,d,f,h,p,g,y,v,b,w,_,E,C,x,$,T,U,O,F,k,S,I,A,R,N,P,j,M,V,B,G,Z,ie,oe,z,J,K,ne,ce,xe,ke,Me,$t,H,q,se;return ee(this,function(de){switch(de.label){case 0:return a=e.identityStorage||Bg,s="",a===Bg&&!(!((U=e.cookieOptions)===null||U===void 0)&&U.domain)&&((O=e.cookieOptions)===null||O===void 0?void 0:O.domain)!==""?[4,xoe(void 0,r)]:[3,2];case 1:s=de.sent(),de.label=2;case 2:return o=re({domain:(k=(F=e.cookieOptions)===null||F===void 0?void 0:F.domain)!==null&&k!==void 0?k:s,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},e.cookieOptions),c={duplicateResolverFn:function(he){var pe=tF(he);if(!pe)return!1;var ye=JSON.parse(pe);return nF(ye.cookieDomain,o.domain)},diagnosticsClient:r},l=Soe(e.identityStorage,o,c),[4,ioe(t,l,(I=(S=e.cookieOptions)===null||S===void 0?void 0:S.upgrade)!==null&&I!==void 0?I:!0)];case 3:return u=de.sent(),[4,l.get(QD(t))];case 4:return d=de.sent(),f=Dg(),h=f.ampTimestamp?Number(f.ampTimestamp):void 0,p=h?Date.now()<h:!0,g=(j=(P=(N=(A=e.deviceId)!==null&&A!==void 0?A:p?(R=f.ampDeviceId)!==null&&R!==void 0?R:f.deviceId:void 0)!==null&&N!==void 0?N:d?.deviceId)!==null&&P!==void 0?P:u.deviceId)!==null&&j!==void 0?j:js(),y=(M=d?.lastEventId)!==null&&M!==void 0?M:u.lastEventId,v=(V=d?.lastEventTime)!==null&&V!==void 0?V:u.lastEventTime,b=(G=(B=e.optOut)!==null&&B!==void 0?B:d?.optOut)!==null&&G!==void 0?G:u.optOut,w=(Z=d?.sessionId)!==null&&Z!==void 0?Z:u.sessionId,_=d?.deferredSessionId,E=(oe=(ie=e.userId)!==null&&ie!==void 0?ie:d?.userId)!==null&&oe!==void 0?oe:u.userId,n.previousSessionDeviceId=(z=d?.deviceId)!==null&&z!==void 0?z:u.deviceId,n.previousSessionUserId=(J
30=d?.userId)!==null&&J!==void 0?J:u.userId,C={ipAddress:(ne=(K=e.trackingOptions)===null||K===void 0?void 0:K.ipAddress)!==null&&ne!==void 0?ne:!0,language:(xe=(ce=e.trackingOptions)===null||ce===void 0?void 0:ce.language)!==null&&xe!==void 0?xe:!0,platform:(Me=(ke=e.trackingOptions)===null||ke===void 0?void 0:ke.platform)!==null&&Me!==void 0?Me:!0},x=d?.pageCounter,$=d?.debugLogsEnabled,e.autocapture!==void 0&&(e.defaultTracking=e.autocapture),T=new Coe(t,e.appVersion,l,o,e.defaultTracking,e.autocapture,g,e.flushIntervalMillis,e.flushMaxRetries,e.flushQueueSize,a,e.ingestionMetadata,e.instanceName,y,v,($t=i?.loggerProvider)!==null&&$t!==void 0?$t:e.loggerProvider,e.logLevel,e.minIdLength,e.offline,b,e.partnerId,e.plan,e.serverUrl,(H=i?.serverZone)!==null&&H!==void 0?H:e.serverZone,w,_,e.sessionTimeout,e.storageProvider,C,e.transport,e.useBatch,e.fetchRemoteConfig,E,x,$,e.networkTrackingOptions,e.identify,(q=i?.enableDiagnostics)!==null&&q!==void 0?q:e.enableDiagnostics,(se=i?.diagnosticsSampleRate)!==null&&se!==void 0?se:n._diagnosticsSampleRate,r,e.remoteConfig,s,e.enableRequestBodyCompression,e.customEnrichment),[4,T.storageProvider.isEnabled()];case 5:return de.sent()||(T.loggerProvider.warn("Storage provider ".concat(T.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),T.storageProvider=new PC),[2,T]}})})},Soe=function(t,e,n){switch(t===void 0&&(t=Bg),e===void 0&&(e={}),t){case"localStorage":return new MF;case"sessionStorage":return new Qse;case"none":return new PC;case"cookie":default:return new Fg(re(re({},e),{expirationDays:e.expiration}),n)}},Aoe=function(t){var e,n;return t===void 0&&(t={}),((e=t.remoteConfig)===null||e===void 0?void 0:e.fetchRemoteConfig)===!0?!0:!(((n=t.remoteConfig)===null||n===void 0?void 0:n.fetchRemoteConfig)===!1||t.fetchRemoteConfig===!1)},UF=function(t){var e=typeof t=="object"?t.type:t,n=typeof t=="object"?t.headers:void 0,r=typeof t=="object"?t.enableKeepalive:void 0,i=typeof t=="object"?t.referrerPolicy:void 0;return e==="xhr"?new eoe(n):e==="beacon"?new roe:new noe(n,r,i)},xoe=function(t,e){return te(void 0,void 0,void 0,function(){var n,r,i,a,s,s,o,c,l;return ee(this,function(u){switch(u.label){case 0:return[4,new Fg(void 0,{diagnosticsClient:e}).isEnabled()];case 1:if(!u.sent()||typeof location>"u"||!location.hostname)return[2,""];if(n=location.hostname,r=n.split("."),r.length===1)return[2,""];for(i=[],a=1,DF.find(function(d){return n.endsWith(".".concat(d))})&&(a=2),s=r.length-a-1;s>=0;--s)i.push(r.slice(s).join("."));s=0,u.label=2;case 2:if(!(s<i.length))return[3,7];o=i[s],u.label=3;case 3:return u.trys.push([3,5,,6]),[4,Fg.isDomainWritable(o)];case 4:return c=u.sent(),c?[2,"."+o]:[3,6];case 5:return l=u.sent(),e&&e.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(o),error:l instanceof Error?l.message:String(l)}),[3,6];case 6:return s++,[3,2];case 7:return e&&e.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(n)}),[2,""]}})})},Ioe="[Amplitude] Page Viewed",F6="AMP_PAGE_VIEW",gI=function(t){t===void 0&&(t={});var e,n=He(),r=void 0,i=!1,a,s,o=t.trackOn,c=t.trackHistoryChanges,l=t.eventType,u=l===void 0?Ioe:l,d=function(b){var w=b;try{w=decodeURI(b)}catch(_){r?.error("Malformed URI sequence: ",_)}return w},f=function(b){return te(void 0,void 0,void 0,function(){var w,_,E;return ee(this,function(C){switch(C.label){case 0:return w=d(typeof location<"u"&&location.href||""),E={event_type:u},_=[{}],[4,Toe()];case 1:return[2,(E.event_properties=re.apply(void 0,[re.apply(void 0,_.concat([C.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":w,"[Amplitude] Page Path":typeof location<"u"&&d(location.pathname)||"","[Amplitude] Page Title":NC(MC),"[Amplitude] Page URL":w.split("?")[0],"[Amplitude] Page View ID":b}]),E)]}})})},h=function(){return typeof o>"u"||typeof o=="function"&&o()},p=typeof location<"u"?location.href:null,g=function(){return te(void 0,void 0,void 0,function(){var b,w,_,E,C;return ee(this,function(x){switch(x.label){case 0:return b=location.href,w=koe(c,b,p||"")&&h(),p=b,w?(_=void 0,s&&(_=js(),s.set(F6,{pageViewId:_})),r?.log("Tracking page view event"),e!=null?[3,1]:[3,3]):[3,4];case 1:return C=(E=e).track,[4,f(_)];case 2:C.apply(E,[x.sent()]),x.label=3;case 3:x.label=4;case 4:return[2]}})})},y=function(){g()},v={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(b,w){return te(void 0,void 0,void 0,function(){var _,E,C;return ee(this,function(x){switch(x.label){case 0:if(e=w,a=b,r=b.loggerProvider,r.log("Installing @amplitude/plugin-page-view-tracking-browser"),i=!0,n){try{s=new Om(n.sessionStorage)}catch{r?.debug("sessionStorage is not available in this environment.")}n.addEventListener("popstate",y),n.history.pushState=new Proxy(n.history.pushState,{apply:function($,T,U){var O=$e(U,3),F=O[0],k=O[1],S=O[2];$.apply(T,[F,k,S]),i&&y()}})}return h()?(r.log("Tracking page view event"),_=void 0,s&&(_=js(),s.set(F6,{pageViewId:_})),C=(E=e).track,[4,f(_)]):[3,2];case 1:C.apply(E,[x.sent()]),x.label=2;case 2:return[2]}})})},execute:function(b){return te(void 0,void 0,void 0,function(){var w,_,E;return ee(this,function(C){switch(C.label){case 0:return o==="attribution"&&Loe(b)?(r?.log("Enriching c
30ampaign event to page view event with campaign parameters"),w=void 0,s?[4,s.get(F6)]:[3,2]):[3,4];case 1:_=C.sent(),w=_?.pageViewId,C.label=2;case 2:return[4,f(w)];case 3:E=C.sent(),b.event_type=E.event_type,b.event_properties=re(re({},b.event_properties),E.event_properties),C.label=4;case 4:return a&&b.event_type===u&&(a.pageCounter=a.pageCounter?a.pageCounter+1:1,b.event_properties=re(re({},b.event_properties),{"[Amplitude] Page Counter":a.pageCounter})),[2,b]}})})},teardown:function(){return te(void 0,void 0,void 0,function(){return ee(this,function(b){return n&&(n.removeEventListener("popstate",y),i=!1),[2]})})}};return v},Toe=function(){return te(void 0,void 0,void 0,function(){var t;return ee(this,function(e){switch(e.label){case 0:return t=eF,[4,new OC().parse()];case 1:return[2,t.apply(void 0,[e.sent()])]}})})},Loe=function(t){if(t.event_type==="$identify"&&t.user_properties){var e=t.user_properties,n=e[Vc.SET]||{},r=e[Vc.UNSET]||{},i=Qe(Qe([],$e(Object.keys(n)),!1),$e(Object.keys(r)),!1);return Object.keys(Pm).every(function(a){return i.includes(a)})}return!1},koe=function(t,e,n){switch(t){case"pathOnly":{if(n=="")return!0;var r=new URL(e),i=new URL(n),a=r.origin+r.pathname,s=i.origin+i.pathname;return a!==s}default:return e!==n}},$oe=function(){var t,e=[],n=function(u,d,f){u.addEventListener(d,f),e.push({element:u,type:d,handler:f})},r=function(){e.forEach(function(u){var d=u.element,f=u.type,h=u.handler;d?.removeEventListener(f,h)}),e=[]},i,a="@amplitude/plugin-form-interaction-tracking-browser",s="enrichment",o=function(u,d){return te(void 0,void 0,void 0,function(){var f,h;return ee(this,function(p){return i=Wse(u),f=function(){if(!d){u.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(!(typeof document>"u")){var g=new WeakSet,y=function(b){if(!g.has(b)){g.add(b);var w=!1;n(b,"change",function(){var _,E=yI(b);w||d.track(uI,(_={},_[M6]=Qu(b.id),_[N6]=Qu(b.name),_[D6]=E,_)),w=!0}),n(b,"submit",function(_){var E,C,x=yI(b);if(w||d.track(uI,(E={},E[M6]=Qu(b.id),E[N6]=Qu(b.name),E[D6]=x,E)),w=!0,i?.shouldTrackSubmit!==void 0)if(typeof i.shouldTrackSubmit=="function"&&typeof SubmitEvent<"u"&&_ instanceof SubmitEvent)try{var $=i.shouldTrackSubmit(_);if(!$)return}catch{u.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else u.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");d.track(soe,(C={},C[M6]=Qu(b.id),C[N6]=Qu(b.name),C[D6]=x,C)),w=!1})}},v=Array.from(document.getElementsByTagName("form"));v.forEach(y),typeof MutationObserver<"u"&&(t=new MutationObserver(function(b){b.forEach(function(w){w.addedNodes.forEach(function(_){try{if(_.nodeName==="FORM"&&y(_),"querySelectorAll"in _&&typeof _.querySelectorAll=="function"){var E=_,C=E.querySelectorAll("form");C?.forEach(y)}}catch(x){u.loggerProvider.warn("Failed to track form interactions for an added node: ".concat(String(x)))}})})}),t.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(h=He(),h?h.addEventListener("load",f):u.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},c=function(u){return te(void 0,void 0,void 0,function(){return ee(this,function(d){return[2,u]})})},l=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(u){return t?.disconnect(),r(),[2]})})};return{name:a,type:s,setup:o,execute:c,teardown:l}},Qu=function(t){if(typeof t=="string")return t},yI=function(t){var e=t.getAttribute("action");try{e=new URL(encodeURI(e??""),window.location.href).href}catch{}return e},Poe=function(){var t,e=[],n=function(l,u,d){l.addEventListener(u,d),e.push({element:l,type:u,handler:d})},r=function(){e.forEach(function(l){var u=l.element,d=l.type,f=l.handler;u?.removeEventListener(d,f)}),e=[]},i="@amplitude/plugin-file-download-tracking-browser",a="enrichment",s=function(l,u){return te(void 0,void 0,void 0,function(){var d,f;return ee(this,function(h){return d=function(){if(!u){l.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(!(typeof document>"u")){var p=function(v){var b;
30try{b=new URL(v.href,window.location.href)}catch{return}var w=g.exec(b.href),_=w?.[1];_&&n(v,"click",function(){var E;_&&u.track(ooe,(E={},E[coe]=_,E[loe]=b.pathname,E[uoe]=v.id,E[doe]=v.text,E[foe]=v.href,E))})},g=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/,y=Array.from(document.getElementsByTagName("a"));y.forEach(p),typeof MutationObserver<"u"&&(t=new MutationObserver(function(v){v.forEach(function(b){b.addedNodes.forEach(function(w){try{if(w.nodeName==="A"&&p(w),"querySelectorAll"in w&&typeof w.querySelectorAll=="function"){var _=w,E=_.querySelectorAll("a");E?.forEach(p)}}catch(C){l.loggerProvider.warn("Failed to track file downloads for an added node: ".concat(String(C)))}})})}),t.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?d():(f=He(),f?f.addEventListener("load",d):l.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},o=function(l){return te(void 0,void 0,void 0,function(){return ee(this,function(u){return[2,l]})})},c=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(l){return t?.disconnect(),r(),[2]})})};return{name:i,type:a,setup:s,execute:o,teardown:c}},mI=!1,Roe=function(t){if(!(mI||t.defaultTracking!==void 0)){var e=`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example: 31 32amplitude.init(<YOUR_API_KEY>, { 33 defaultTracking: true, 34}); 35 36Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`;t.loggerProvider.warn(e),mI=!0}},Ooe=function(){var t="@amplitude/plugin-network-checker-browser",e="before",n=He(),r=[],i=function(c,l){n?.addEventListener&&(n?.addEventListener(c,l),r.push({type:c,handler:l}))},a=function(){r.forEach(function(c){var l=c.type,u=c.handler;n?.removeEventListener(l,u)}),r=[]},s=function(c,l){return te(void 0,void 0,void 0,function(){return ee(this,function(u){return typeof navigator>"u"?(c.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),c.offline=!1,[2]):(c.offline=!navigator.onLine,i("online",function(){c.offline!==!1&&(c.loggerProvider.debug("Network connectivity changed to online."),c.offline=!1,setTimeout(function(){l.flush()},c.flushIntervalMillis))}),i("offline",function(){c.loggerProvider.debug("Network connectivity changed to offline."),c.offline=!0}),[2])})})},o=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(c){return a(),[2]})})};return{name:t,type:e,setup:s,teardown:o}};function Moe(t,e){var n,r;if(t){IF(t);try{e.loggerProvider.debug("Update browser config with remote configuration:",ow(t));var i=t;if(i&&"autocapture"in i){if(typeof i.autocapture=="boolean"&&(e.autocapture=i.autocapture),typeof i.autocapture=="object"&&i.autocapture!==null){var a=re({},i.autocapture);if(e.autocapture===void 0&&(e.autocapture=i.autocapture),typeof i.autocapture.elementInteractions=="object"&&i.autocapture.elementInteractions!==null&&(!((n=i.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||n===void 0)&&n.length)){a.elementInteractions=re({},i.autocapture.elementInteractions);var s=a.elementInteractions,o=(r=s.pageUrlAllowlist)!==null&&r!==void 0?r:[],c=i.autocapture.elementInteractions.pageUrlAllowlistRegex;s.pageUrlAllowlist=xF(o,c,e.loggerProvider),delete s.pageUrlAllowlistRegex}var l=Rse(i.autocapture.networkTracking,e.loggerProvider);l&&(a.networkTracking=l),typeof e.autocapture=="boolean"&&(e.autocapture=re({attribution:e.autocapture,fileDownloads:e.autocapture,formInteractions:e.autocapture,pageViews:e.autocapture,sessions:e.autocapture,elementInteractions:e.autocapture,webVitals:e.autocapture,frustrationInteractions:e.autocapture},a)),typeof e.autocapture=="object"&&(e.autocapture=re(re({},e.autocapture),a))}e.defaultTracking=e.autocapture}"customEnrichment"in i&&i.customEnrichment!==null&&e.customEnrichment!==!1&&(e.customEnrichment=i.customEnrichment),e.loggerProvider.debug("Browser config after remote config update:",ow(e))}catch(u){e.loggerProvider.error("Failed to apply remote configuration because of error: ",u)}}}var jF="1.29.0",Noe="@amplitude/plugin-autocapture-browser",Doe="@amplitude/plugin-frustration-browser",Foe="@amplitude/plugin-performance-browser",BF="[Amplitude] Element Clicked",Uoe="[Amplitude] Dead Click",joe="[Amplitude] Rage Click",Boe="[Amplitude] Error Click",Voe="[Amplitude] Element Changed",Hoe="[Amplitude] Thrashed Cursor",Woe="[Amplitude] Main Thread Block",qoe="[Amplitude] Element ID",zoe="[Amplitude] Element Class",vI="[Amplitude] Element Tag",wI="[Amplitude] Element Text",Zoe="[Amplitude] Element Hierarchy",Koe="[Amplitude] Element Href",Goe="[Amplitude] Element Position Left",Yoe="[Amplitude] Element Position Top",Joe="[Amplitude] Element Aria Label",Xoe="[Amplitude] Element Attributes",Qoe="[Amplitude] Element Path",ece="[Amplitude] Element Parent Label",dw="[Amplitude] Page URL",tce="[Amplitude] Page Title",VF="[Amplitude] Viewport Height",HF="[Amplitude] Viewport Width",nce="[Amplitude] Max Page X",rce="[Amplitude] Max Page Y",WF="[Amplitude] Page View ID",ice="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",ace="amp-visual-tagging-selector-highlight",qF="data-amp-mask-attributes",zF="data-amp-internal-shadow",sce=25,ZF=128,oce="AMP_PAGE_VIEW",cce=18e3,lce=150,uce=4e3,dce=50,fce=[/^:r[0-9a-z]+:$/,/^radix-/,/^headlessui-/,/^mui-/,/^[a-f0-9]{16,}$/i,/-\d{8,}$/,/\d{4,}/];function hce(t,e){var n,r,i=[];try{for(var a=Se(t),s=a.next();!s.done;s=a.next()){var o=s.value;
36try{i.push(new RegExp(o))}catch(l){var c=l instanceof Error?l.message:String(l);e?.warn('@amplitude/element-selector: ignoring invalid autogenerated-id pattern "'.concat(o,'" (').concat(c,")"))}}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}function pce(t,e){var n,r;if(t==null||t==="")return!1;try{for(var i=Se(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.test(t))return!1}}catch(o){n={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0}var gce=[/^(p|m|px|py|mx|my|pt|pb|pl|pr|mt|mb|ml|mr)-\d+$/,/^(w|h|min-w|max-w|min-h|max-h)-/,/^(text|bg|border|ring|fill|stroke)-/,/^(hover|focus|active|disabled|group-hover):/,/^(sm|md|lg|xl|2xl):/,/^z-\d+$/,/^data-\[/,/^\[/,/^css-[a-z0-9]{6,}$/,/^[a-zA-Z]+_[a-zA-Z0-9]{3,}__[a-zA-Z0-9]{5,}$/,/^sc-[a-zA-Z0-9]{6,}$/,/^jsx-\d+$/,/^swiper-slide-(visible|fully-visible|active|prev|next|duplicate)$/,/^is-(active|open|selected|hovered|focused|expanded)$/,/^Mui[A-Z][a-zA-Z]+-(focused|selected|disabled|expanded|focusVisible|active|checked)$/,/^Mui-(selected|focused|disabled|expanded|focusVisible|active|checked)$/,/^data-state-/];function yce(t,e){var n,r,i=[];try{for(var a=Se(t),s=a.next();!s.done;s=a.next()){var o=s.value;try{i.push(new RegExp(o))}catch(l){var c=l instanceof Error?l.message:String(l);e?.warn('@amplitude/element-selector: ignoring invalid unstable-class pattern "'.concat(o,'" (').concat(c,")"))}}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}function KF(t,e){var n=t.getAttribute(e.explicitTrackingAttribute);if(n!==null&&n==="")return null;var r=t.getAttribute("id");return r===null||r===""||!pce(r,e.autogeneratedIdPatterns)?null:r}function mce(t,e){return e.map(vce).join(" > ")}function vce(t){var e=t.tagName.toLowerCase(),n=t.parentElement;if(n===null)return e;var r=wce(t,n);return"".concat(e,":nth-of-type(").concat(r,")")}function wce(t,e){for(var n=0,r=0;r<e.children.length;r++){var i=e.children[r];if(i.tagName===t.tagName&&(n+=1,i===t))return n}return 1}var bce=" >>> ",GF=":scope > ";function No(t){return typeof ShadowRoot<"u"&&t instanceof ShadowRoot}function _ce(t,e,n){return t&&n&&No(e)?"".concat(GF).concat(t):t}function Cce(t){for(var e=t;e!==null;e=e.parentElement)if(e.getAttribute("id"))return!1;return!0}function Ece(t){var e,n=t.getRootNode();return No(n)?n:(e=t.ownerDocument)!==null&&e!==void 0?e:document}function Sce(t){if(t.parentElement)return t.parentElement;var e=t.getRootNode();return No(e)?e.host:null}var YF=1024,Ace=5e4;function JF(t,e){var n,r,i,a;return ee(this,function(s){switch(s.label){case 0:n=t,r=0,i=0,s.label=1;case 1:return n!==null&&i<YF?(i+=1,[4,n]):[3,3];case 2:return s.sent(),n.parentElement?(n=n.parentElement,[3,1]):r<e&&typeof n.getRootNode=="function"&&(a=Sce(n),a&&a!==n)?(r+=1,n=a,[3,1]):[3,3];case 3:return[2]}})}function XF(t,e){var n=[];if(e<=0)return n;for(var r=[[t,0]],i=0;r.length&&i<Ace;){i+=1;var a=$e(r.pop(),2),s=a[0],o=a[1],c=s.shadowRoot;if(c&&o+1<=e){n.push({root:c,depth:o+1});for(var l=c.children,u=0;u<l.length;u++)r.push([l[u],o+1])}for(var d=s.children,u=0;u<d.length;u++)r.push([d[u],o])}return n}function QF(t,e){for(var n=[],r=t,i=0;r!==null&&i<YF;){i+=1;var a=Ece(r);n.push({root:a,target:r});var s=r.getRootNode();if(!No(s))break;r=s.host}var o=n.length-1,c=!1,l=n;return o>e&&(l=n.slice(o-e),c=!0),{segments:l.reverse(),truncated:c}}function xce(t,e){var n=t.tagName.toLowerCase(),r=t.parentElement;if(r===null){var i=t.getRootNode();return e&&No(i)?"".concat(n,":nth-of-type(").concat(bI(t,i.children),")"):n}return"".concat(n,":nth-of-type(").concat(bI(t,r.children),")")}function bI(t,e){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(i.tagName===t.tagName&&(n+=1,i===t))return n}return 1}var Ice={name:"explicitTrackingAttribute",try:function(t,e){var n=e.config.explicitTrackingAttribute,r=t.getAttribute(n);return r===null||r===""?null:"[".concat(n,"=").concat(JSON.stringify(r),"]")}};function Vg(t){var e=globalThis.CSS;if(e&&typeof e.escape=="function")return e.escape(t);for(var n=String(t),r=n.length,i="",a=0;a<r;a++){var s=n.charCodeAt(a);if(s===0){i+="�";continue}if(s>=1&&s<=31||s===127||a===0&&s>=48&&s<=57||a===1&&s>
36=48&&s<=57&&n.charCodeAt(0)===45){i+="\\".concat(s.toString(16)," ");continue}if(a===0&&r===1&&s===45){i+="\\-";continue}if(s>=128||s===45||s===95||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122){i+=n.charAt(a);continue}i+="\\".concat(n.charAt(a))}return i}function eU(t){return Vg(t)}var Tce={name:"stableId",try:function(t,e){var n=KF(t,e.config);return n===null?null:"".concat(t.tagName.toLowerCase(),"#").concat(eU(n))}},tU=!1,nU=1,Lce=10,bl=Object.freeze({enabled:!1,explicitTrackingAttribute:"data-amp-track-id",autogeneratedIdPatterns:Qe([],$e(fce),!1),unstableClassPatterns:Qe([],$e(gce),!1),maxAncestorWalkDepth:void 0,shadowDomEnabled:tU,maxShadowDomDepth:nU});function cp(t){var e;return re(re({},t),{shadowDomEnabled:(e=t.shadowDomEnabled)!==null&&e!==void 0?e:tU,maxShadowDomDepth:iU(t.maxShadowDomDepth)})}function rU(t,e){if(!t)return _I();var n=_I();return typeof t.enabled=="boolean"&&(n.enabled=t.enabled),typeof t.explicitTrackingAttribute=="string"&&t.explicitTrackingAttribute!==""&&(n.explicitTrackingAttribute=t.explicitTrackingAttribute),Array.isArray(t.autogeneratedIdPatterns)&&(n.autogeneratedIdPatterns=hce(t.autogeneratedIdPatterns,e)),Array.isArray(t.unstableClassPatterns)&&(n.unstableClassPatterns=yce(t.unstableClassPatterns,e)),n.maxAncestorWalkDepth=kce(t.maxAncestorWalkDepth),typeof t.shadowDomEnabled=="boolean"&&(n.shadowDomEnabled=t.shadowDomEnabled),n.maxShadowDomDepth=iU(t.maxShadowDomDepth),cp(n)}function kce(t){if(typeof t=="number"&&Number.isFinite(t)&&!(t<=0))return Math.floor(t)}function iU(t){return typeof t!="number"||!Number.isFinite(t)?nU:Math.min(Math.max(Math.floor(t),1),Lce)}function _I(){return{enabled:bl.enabled,explicitTrackingAttribute:bl.explicitTrackingAttribute,autogeneratedIdPatterns:Qe([],$e(bl.autogeneratedIdPatterns),!1),unstableClassPatterns:Qe([],$e(bl.unstableClassPatterns),!1),maxAncestorWalkDepth:bl.maxAncestorWalkDepth,shadowDomEnabled:bl.shadowDomEnabled,maxShadowDomDepth:bl.maxShadowDomDepth}}var $ce=[Ice,Tce];function Pce(t,e,n){var r,i,a,s,o;n===void 0&&(n={});var c=cp(e),l=(a=n.strategies)!==null&&a!==void 0?a:$ce,u=(o=(s=n.scope)!==null&&s!==void 0?s:t.ownerDocument)!==null&&o!==void 0?o:document,d={scope:u,config:c},f=Rce(t,c.maxAncestorWalkDepth);try{for(var h=Se(l),p=h.next();!p.done;p=h.next())for(var g=p.value,y=0;y<f.length;y++){var v=f[y],b=g.try(v,d);if(b!==null){if(y===0){if(CI(u,b,t,g.name,n.logger))return b;continue}var w=f.slice(0,y).reverse(),_=mce(v,w),E="".concat(b," > ").concat(_);if(CI(u,E,t,g.name,n.logger))return E}}}catch(C){r={error:C}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return null}function Rce(t,e){for(var n=[],r=t;r!==null&&(n.push(r),!(e!==void 0&&n.length>e));)r=r.parentElement;return n}function CI(t,e,n,r,i){var a;try{a=t.querySelectorAll(e)}catch(o){var s=o instanceof Error?o.message:String(o);return i?.debug('@amplitude/element-selector: strategy "'.concat(r,'" emitted a malformed selector "').concat(e,'" (').concat(s,")")),!1}return a.length===1&&a[0]===n}function Oce(t,e,n){var r,i;n===void 0&&(n={});for(var a=cp(e),s=(i=(r=n.scope)!==null&&r!==void 0?r:t.ownerDocument)!==null&&i!==void 0?i:document,o=No(s),c=[],l=t,u=0,d=!(a.shadowDomEnabled&&o);l!==null&&!(d&&a.maxAncestorWalkDepth!==void 0&&u>a.maxAncestorWalkDepth);){var f=KF(l,a);if(f!==null){var h="".concat(l.tagName.toLowerCase(),"#").concat(eU(f)),p=Qe([h],$e(c),!1).join(" > ");if(Mce(s,p,t))return p}c.unshift(xce(l,a.shadowDomEnabled)),l=l.parentElement,u+=1}var g=c.join(" > ");return a.shadowDomEnabled&&o&&l===null?"".concat(GF).concat(g):g}function Mce(t,e,n){var r;try{r=t.querySelectorAll(e)}catch{return!1}return r.length===1&&r[0]===n}var _f=function(){function t(e,n){this.value=e,this.optimized=n}return t.prototype.toString=function(){return this.value},t}(),Nce=function(t,e){if(t.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=t;r;){var i=Dce(r,!!e,r===t);if(!i||(n.push(i),i.optimized))break;r=r.parentElement}return n.reverse(),n.join(" > ")},Dce=function(t,e,n){var r,i;if(t.nodeType!==Node.ELEMENT_NODE)return null;var a=t.getAttribute("id");if(e){if(a)return new _f(SI(a),!0);var s=t.tagName.toLowerCase();if(s==="body"||s==="head"||s==="html")return new _f(s,!0)}var o=t.tagName.toLowerCase();if(a)return new _f(o+SI(a),!0);var c=t.parentNode;if(!c||c.nodeType===Node.DOCUMENT_NODE)return new _f(o,!0);for(var l=EI(t),u=!1,d=!1,f=-1,h=-1,p=c.children,g=0;p&&(f===-1||!d)&&g<p.length;++g){var y=p[g];if(y.nodeType===Node.ELEMENT_NODE){if(h+=1,y===t){f=h;continue}if(!d&&y.tagName.toLowerCase()===o){u=!0;var v=new Set(l);if(!v.size){d=!0;continue}for(var b=EI(y),w=0;w<b.length;++w){var _=b[w];if(v.has(_)&&(v.delete(_),!v.size)){d=!0;break}}}}}var E=o;if(n&&o.toLowerCase()==="input"&&t.getAttribute("type")&&!t.getAttribute("id")&&!t.getAttribute("class")&&(E+="[type="+Vg(t.getAttribute("type")||"")+"]"),d)E+=":nth-child("+String(f+1)+")";else if(u)try{for(var C=Se(l),x=C.next();!x.done;x=C.next()){var $=x.value;E+="."+Vg($.slice(1))}}catch(T){r={error:T}}finally{try{x&&!x.done&&(i=C.return)&&i.call(C)}finally{if(r)throw r.error}}return new _f(E,!1)},EI=function(t){var e=t.getAttribute("class");
36return e?e.split(/\s+/g).filter(Boolean).map(function(n){return"$"+n}):[]},SI=function(t){return"#"+Vg(t)};function AI(t,e){try{return Nce(t)}catch(r){var n=r instanceof Error?r.message:String(r);return e?.warn("@amplitude/element-selector: legacyCssPath threw â emitting empty selector: ".concat(n)),""}}function Fce(t,e){e===void 0&&(e={});var n=cp(t),r=new Set,i=e.logger,a=function(l){return AI(l,i)},s=function(l,u){var d;return(d=Pce(l,n,{strategies:e.strategies,scope:u,logger:i}))!==null&&d!==void 0?d:Oce(l,n,{scope:u})},o=function(l,u){return _ce(a(l),u,Cce(l))};function c(l,u){var d=QF(l,n.maxShadowDomDepth),f=d.segments,h=d.truncated;return h&&i?.debug("@amplitude/element-selector: target is nested deeper than maxShadowDomDepth (".concat(n.maxShadowDomDepth,") â emitting a best-effort selector for the outermost in-budget shadow host")),f.map(function(p){var g=p.target,y=p.root;return u(g,y)}).join(bce)}return{generate:function(l){var u,d;try{if(!n.shadowDomEnabled){var f=n.enabled?s:a;return f(l,(d=(u=e.scope)!==null&&u!==void 0?u:l.ownerDocument)!==null&&d!==void 0?d:document)}return c(l,n.enabled?s:o)}catch(p){var h=p instanceof Error?p.message:String(p);return i?.warn("@amplitude/element-selector: selector generation threw â falling back to legacy cssPath: ".concat(h)),AI(l,i)}},getConfig:function(){return n},updateConfig:function(l){var u,d;n=cp(l);try{for(var f=Se(r),h=f.next();!h.done;h=f.next()){var p=h.value;try{p(n)}catch(y){var g=y instanceof Error?y.message:String(y);i?.warn("@amplitude/element-selector: onConfigChange subscriber threw â ".concat(g))}}}catch(y){u={error:y}}finally{try{h&&!h.done&&(d=f.return)&&d.call(f)}finally{if(u)throw u.error}}},onConfigChange:function(l){return r.add(l),function(){r.delete(l)}}}}var Uce=1,Pu=Object.freeze({enabled:!1,maxDepth:0}),jce=function(t){var e,n=(e=t.maxShadowDomDepth)!==null&&e!==void 0?e:Uce;return!t.shadowDomEnabled||n<=0?Pu:Object.freeze({enabled:!0,maxDepth:n})},Bce=function(){var t=Pu,e=new Set,n=function(r){var i,a;try{for(var s=Se(Qe([],$e(e),!1)),o=s.next();!o.done;o=s.next()){var c=o.value;try{c(r)}catch{}}}catch(l){i={error:l}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}e.clear()};return{get:function(){return t},arm:function(r){return t.enabled||!r.enabled||(t=r,n(r)),t},onArm:function(r){if(t.enabled){var i=t;try{r(i)}catch{}return function(){}}return e.add(r),function(){e.delete(r)}}}},U6,Vce=function(){return U6||(U6=Bce()),U6},Hce=["input","select","textarea"],Wce=function(t,e){var n,r=(n=window?.getComputedStyle)===null||n===void 0?void 0:n.call(window,t);return r?.getPropertyValue("cursor")==="pointer"&&e==="click"},BC=function(t){var e=t.pageUrlAllowlist,n=t.pageUrlExcludelist;return!(n&&n.length>0&&tw(window.location.href,n)||!tw(window.location.href,e))},Ud=function(t,e){return function(n,r){var i,a,s=t.shouldTrackEventResolver,o=(a=(i=r?.tagName)===null||i===void 0?void 0:i.toLowerCase)===null||a===void 0?void 0:a.call(i);if(!o)return!1;if(s)return s(n,r);if(!BC(t))return!1;var c=String(r?.getAttribute("type"))||"";if(typeof c=="string")switch(c.toLowerCase()){case"hidden":return!1;case"password":return!1}if(e){var l=e.some(function(u){var d;return!!(!((d=r?.matches)===null||d===void 0)&&d.call(r,u))});if(!l)return!1}switch(o){case"input":case"select":case"textarea":return n==="change"||n==="click";default:return n==="click"}}},qce=function(t){var e,n,r,i=(n=(e=t?.tagName)===null||e===void 0?void 0:e.toLowerCase)===null||n===void 0?void 0:n.call(e),a=t instanceof HTMLElement?((r=t.getAttribute("contenteditable"))===null||r===void 0?void 0:r.toLowerCase())==="true":!1;return!Hce.includes(i)&&!a},zce=function(t){return t?t.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&e!=="id"&&e!=="class"}):[]},Zce=function(t,e){return Object.entries(t).reduce(function(n,r){var i=$e(r,2),a=i[0],s=i[1];if(a.startsWith(e)){var o=a.replace(e,"");o&&(n[o]=s||"")}return n},{})},Kce=function(t){return t==null||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0},xI=function(t){return Object.keys(t).reduce(function(e,n){var r=t[n];return Kce(r)||(e[n]=r),e},{})},aU=function(){var t;try{var e=He(),n=(t=e?.sessionStorage)===null||t===void 0?void 0:t.getItem(oce);if(!n)return;var r=JSON.parse(n);if(typeof r.pageViewId=="string")return r.pageViewId}catch{}},sU=function(t,e,n){return n===void 0&&(n=Pu),n.enabled?Gce(t,e,n.maxDepth):oU(t,e)},oU=function(t,e){return t?e.some(function(n){var r;return(r=t?.matches)===null||r===void 0?void 0:r.call(t,n)})?t:oU(t?.parentElement,e):null},Gce=function(t,e,n){var r,i;if(!t)return null;var a=function(u){if(e.some(function(d){var f;return(f=u?.matches)===null||f===void 0?void 0:f.call(u,d)}))return{value:u}};try{for(var s=Se(JF(t,n)),o=s.next();!o.done;o=s.next()){var c=o.value,l=a(c);if(typeof l=="object")return l.value}}catch(u){r={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return null},II=function(t,e,n){return n===void 0&&(n=Pu),n.enabled?Yce(t,e,n.maxDepth):cU(t,e)},cU=function(t,e){var n=[];return e&&t.querySelectorAll(e).forEach(function(r){return n.push(r)}),n},Yce=function(t,e,n){var r=cU(t,e),i=t instanceof Document?t.documentElement:t;
36return i&&XF(i,n).forEach(function(a){var s=a.root;s.querySelectorAll(e).forEach(function(o){return r.push(o)})}),r},Jce=function(t,e){var n,r;if(e===void 0&&(e=Pu),!e.enabled)return t.target;var i=(n=t.composedPath)===null||n===void 0?void 0:n.call(t),a=(r=t.target)!==null&&r!==void 0?r:null;if(!i||i.length===0)return a;var s=i[0];if(!(s instanceof Element))return s??a;var o=QF(s,e.maxDepth),c=o.segments,l=o.truncated;return l&&c.length>0?c[c.length-1].target:s},s0=function(t){return!(t.event.target===null||!t.closestTrackedAncestor)};function Xce(t){return t.type==="click"||t.type==="change"}function VC(t){if(!t)return"";try{var e=new URL(t);return e.search="",qa(e.href)}catch{return qa(t)}}function jd(t){var e,n;return t===void 0&&(t=He()),VC((n=(e=t?.location)===null||e===void 0?void 0:e.href)!==null&&n!==void 0?n:"")}function Qce(t,e){var n;if(e===void 0&&(e=He()),t==null||t==="")return jd(e);var r=((n=e?.location)===null||n===void 0?void 0:n.href)||"http://localhost/";try{return VC(new URL(t,r).href)}catch{return jd(e)}}var Hg;(function(t){t[t.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",t[t.MIDDLE=1]="MIDDLE",t[t.RIGHT=2]="RIGHT"})(Hg||(Hg={}));var TI="__AMPLITUDE_VISUAL_TAGGING__";function ele(t,e){var n=t;if(n[TI]!==!0){n[TI]=!0;var r=e.dataExtractor,i=e.isElementSelectable,a=e.cssSelectorAllowlist,s=e.actionClickAllowlist,o=null,c=function(u){t.notify({action:"element-selected",data:u})},l=function(u,d){u==="selector-mode-changed"?t.notify({action:"track-selector-mode-changed",data:d}):u==="selector-moved"&&t.notify({action:"track-selector-moved",data:d})};t.registerActionHandler("initialize-visual-tagging-selector",function(u){t.loadScriptOnce(ice).then(function(){var d;o=(d=window?.amplitudeVisualTaggingSelector)===null||d===void 0?void 0:d.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(f){return i?i(u?.actionType||"click",f):!0},onTrack:l,onSelect:c,visualHighlightClass:ace,messenger:t,cssSelectorAllowlist:a,actionClickAllowlist:s,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:jF}}}),t.notify({action:"selector-loaded"})}).catch(function(){var d;(d=t.logger)===null||d===void 0||d.warn("Failed to initialize visual tagging selector")})}),t.registerActionHandler("close-visual-tagging-selector",function(){var u;(u=o?.close)===null||u===void 0||u.call(o)})}}function tle(t){var e=t.amplitude,n=t.allObservables,r=t.shouldTrackEvent,i=t.evaluateTriggers,a=n.clickObservable,s=a.filter(s0).filter(function(c){return r("click",c.closestTrackedAncestor)}).map(function(c){return i(c)}),o=s;return o.subscribe(function(c){e?.track(BF,c.targetElementProperties)})}function nle(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent,a=t.evaluateTriggers,s=n.changeObservable,o=s.filter(s0).filter(function(c){return i("change",c.closestTrackedAncestor)}).map(function(c){return a(c)});return o.subscribe(function(c){e?.track(Voe,r("change",c.closestTrackedAncestor))})}function rle(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,a=t.shouldTrackEvent,s=t.shouldTrackActionClick,o=n.clickObservable,c=n.mutationObservable,l=n.navigateObservable,u=o.filter(function(y){return!a("click",y.closestTrackedAncestor)}).map(function(y){var v=sU(y.event.target,r.actionClickAllowlist);return y.closestTrackedAncestor=v,y.closestTrackedAncestor!==null&&(y.targetElementProperties=i(y.type,y.closestTrackedAncestor)),y}).filter(s0).filter(function(y){return s("click",y.closestTrackedAncestor)}),d=l?yu(c,l):c,f=yu(u,d),h=null,p=null,g=FC(f,function(y){if(h&&(clearTimeout(h),h=null),y.type==="click")return p=y,h=setTimeout(function(){h=null,p=null},500),Promise.resolve(null);if(p){var v=p;return p=null,Promise.resolve(v)}return Promise.resolve(null)});return g.subscribe(function(y){y&&e?.track(BF,i("click",y.closestTrackedAncestor))})}function ile(t){var e=t.allObservables,n=e.scrollObservable,r={maxX:0,maxY:0},i=n.subscribe(function(){var a,s,o,c,l=He(),u=Math.floor((s=(a=l?.scrollX)!==null&&a!==void 0?a:l?.pageXOffset)!==null&&s!==void 0?s:0),d=Math.floor((c=(o=l?.
36scrollY)!==null&&o!==void 0?o:l?.pageYOffset)!==null&&c!==void 0?c:0);r.maxX=Math.max(r.maxX,u),r.maxY=Math.max(r.maxY,d)});return{unsubscribe:function(){i.unsubscribe()},getState:function(){return r},reset:function(){r.maxX=0,r.maxY=0}}}var p2=He(),rh=function(t){return t.get()},ale={childList:!0,attributes:!0,characterData:!0,subtree:!0},lU=function(t){return t?new Jn(function(e){var n=new WeakSet,r=new WeakMap,i=function(u,d){n.has(u)||(n.add(u),No(u)&&r.set(u,d),o.observe(u,ale))},a=function(u,d,f){var h=f-d;h<=0||XF(u,h).forEach(function(p){var g=p.root,y=p.depth;return i(g,d+y)})},s=function(u){var d=u.getRootNode();if(!No(d))return 0;var f=r.get(d);return f??0},o=new MutationObserver(function(u){var d,f;e.next(u);try{var h=rh(t);if(!h.enabled)return;var p=function(b){var w=s(b.target);b.addedNodes.forEach(function(_){_ instanceof Element&&a(_,w,h.maxDepth)})};try{for(var g=Se(u),y=g.next();!y.done;y=g.next()){var v=y.value;p(v)}}catch(b){d={error:b}}finally{try{y&&!y.done&&(f=g.return)&&f.call(g)}finally{if(d)throw d.error}}}catch{}}),c;if(document.body){var l=document.body;i(l,0),c=t.onArm(function(u){a(l,0,u.maxDepth)})}return function(){c?.(),o.disconnect()}}):new Jn(function(e){var n=new MutationObserver(function(r){e.next(r)});return document.body&&n.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return n.disconnect()}})},uU=function(t){return t===void 0&&(t="click"),new Jn(function(e){var n,r=function(i){e.next(i)};return(n=He())===null||n===void 0||n.document.addEventListener(t,r,{capture:!0}),function(){var i;(i=He())===null||i===void 0||i.document.removeEventListener(t,r,{capture:!0})}})},sle=function(){return new Jn(function(t){var e,n=function(r){t.next(r)};return(e=He())===null||e===void 0||e.addEventListener("scroll",n),function(){var r;(r=He())===null||r===void 0||r.removeEventListener("scroll",n)}})},ole=function(){return new Jn(function(t){var e=function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=void 0;Array.isArray(r[0])&&typeof r[0][0]=="string"&&(a=r[0][0]),t.next({kind:"console",message:a})};return nI.addListener("error",e),function(){nI.removeListener(e)}})},cle=function(t,e,n,r){var i=typeof n=="function"?n:void 0,a=typeof n=="function"?r:n;return new Jn(function(s){var o=He();if(!o?.IntersectionObserver)return function(){};var c=new IntersectionObserver(function(g){g.forEach(function(y){s.next(y)})},{root:null,rootMargin:"0px",threshold:1}),l=e.join(","),u=function(g){g instanceof Element&&g.matches(l)&&c.observe(g),g.querySelectorAll(l).forEach(function(y){c.observe(y)})},d=function(g){if(a)try{II(g,l,rh(a)).forEach(function(y){c.observe(y)})}catch{}},f=function(){var g=o?.document;if(g){var y=[];try{a&&rh(a).enabled?y=II(g,l,rh(a)):y=g.querySelectorAll(l)}catch{return}Array.from(y).forEach(function(v){c.unobserve(v),c.observe(v)})}};i?.(f),f();var h=a?.onArm(function(){o?.document&&d(o.document)}),p=t.subscribe(function(g){var y=g.event;return y.forEach(function(v){var b=v.addedNodes;return b.forEach(function(w){if(w instanceof DocumentFragment){u(w);return}if(w instanceof Element){if(!a||!rh(a).enabled){u(w);return}try{w.matches(l)&&c.observe(w)}catch{}d(w)}})})});return function(){i?.(void 0),h?.(),p.unsubscribe(),c.disconnect()}})},lle=function(){return new Jn(function(t){var e=function(n){if(n instanceof ErrorEvent){var r={kind:"error"};n.error instanceof Error||n.error instanceof DOMException?r=re(re({},r),{message:n.error.message,stack:n.error.stack,filename:n.filename,lineNumber:n.lineno,columnNumber:n.colno}):typeof n.error=="string"&&(r.message=n.error),t.next(r)}};return p2.addEventListener("error",e),function(){p2.removeEventListener("error",e)}})},ule=function(){return new Jn(function(t){var e=function(n){var r={kind:"unhandledrejection"};n.reason instanceof Error||n.reason instanceof DOMException?(r.message=n.reason.message,r.stack=n.reason.stack):typeof n.reason=="string"&&(r.message=n.reason),t.next(r)};return p2.addEventListener("unhandledrejection",e),function(){p2.removeEventListener("unhandledrejection",e)}})},dle=function(){var t=yu(lle(),ule());
36return yu(t,ole())},fle=function(){return new Jn(function(t){var e=function(r){t.next(r)},n={capture:!0};return p2.document.addEventListener("mousemove",e,n),function(){p2.document.removeEventListener("mousemove",e,n)}})},hle=function(t,e){try{if(e.subprop_key==="[Amplitude] Element Text")return e.subprop_op==="is"&&e.subprop_value.includes(t.targetElementProperties["[Amplitude] Element Text"]);if(e.subprop_key==="[Amplitude] Element Hierarchy")return e.subprop_op==="autotrack css match"&&!!t.closestTrackedAncestor.closest(e.subprop_value.toString())}catch(n){return console.error("Error matching event to filter",n),!1}return!1},ple=function(t,e){try{if(t.sourceType==="DOM_ELEMENT"){var n=document.documentElement;return t.scope&&e&&(n=e.closest(t.scope)),n&&t.selector?n.querySelector(t.selector):n}}catch{return}},gle=function(t,e,n){t.forEach(function(r){if(typeof r!="string"&&r.actionType==="ATTACH_EVENT_PROPERTY"){var i=n.extractDataFromDataSource(r.dataSource,e.closestTrackedAncestor);e.targetElementProperties[r.destinationKey]=i}})},fw={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},LI=function(t){var e,n,r,i,a=Object.values(fw).reduce(function(h,p){return h[p]=new Set,h},{});if(!t)return a;try{for(var s=Se(t),o=s.next();!o.done;o=s.next()){var c=o.value;try{try{for(var l=(r=void 0,Se(c.definition)),u=l.next();!u.done;u=l.next()){var d=u.value,f=fw[d.event_type];f&&a[f].add(c.id)}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}catch(h){console.warn("Skipping Labeled Event due to malformed definition",c?.id,h)}}}catch(h){e={error:h}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},kI=function(t){var e,n,r,i,a=new Map;try{for(var s=Se(t),o=s.next();!o.done;o=s.next()){var c=o.value;try{for(var l=(r=void 0,Se(c.conditions)),u=l.next();!u.done;u=l.next()){var d=u.value;if(d.type==="LABELED_EVENT"){var f=d.match.eventId,h=a.get(f);h||(h=[],a.set(f,h)),h.push(c)}}}catch(p){r={error:p}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}}catch(p){e={error:p}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},yle=function(t,e){return e.filter(function(n){return n.definition.some(function(r){return fw[r.event_type]===t.type&&r.filters.every(function(i){return hle(t,i)})})})},mle=function(t,e){var n,r,i,a,s=new Set;try{for(var o=Se(t),c=o.next();!c.done;c=o.next()){var l=c.value,u=e.get(l.id);if(u)try{for(var d=(i=void 0,Se(u)),f=d.next();!f.done;f=d.next()){var h=f.value;s.add(h)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return Array.from(s)},vle=function(){function t(e,n,r,i){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=n,this.dataExtractor=r,this.options=i}return t.prototype.evaluate=function(e){var n,r,i=this.options.pageActions;if(!i)return e;var a=yle(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(u){return i.labeledEvents[u]})),s=mle(a,this.labeledEventToTriggerMap);try{for(var o=Se(s),c=o.next();!c.done;c=o.next()){var l=c.value;gle(l.actions,e,this.dataExtractor)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e},t.prototype.update=function(e,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=n,this.options=r},t}(),wle=function(t,e,n,r){return new vle(t,e,n,r)},ble=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",qF,Gc,zF]),_le=["type"],Cle=["svg","path","g"],Ele=["password","hidden"];function Sle(t,e){if(t.parentElement)return t.parentElement.children;var n=t.getRootNode();return e&&No(n)?n.children:[]}function Ale(t,e,n){var r,i,a,s,o;if(n===void 0&&(n=Pu),t===null)return null;var c=String(t.tagName).toLowerCase(),l={tag:c},u=Array.from(Sle(t,n.enabled));u.length&&(l.index=u.indexOf(t),l.indexOfType=u.filter(function(E){return E.tagName===t.tagName}).indexOf(t));var d=(o=(s=t.previousElementSibling)===null||s===void 0?void 0:s.tagName)===null||o===void 0?void 0:o.toLowerCase();d&&(l.prevSib=String(d));var f=t.getAttribute("id");f&&(l.id=String(f));var h=Array.from(t.classList);h.length&&(l.classes=h);var p={},g=Array.from(t.attributes),y=g.filter(function(E){return!ble.has(E.name)}),v=!qce(t);if(!Ele.includes(String(t.getAttribute("type")))&&!Cle.includes(c))try{for(var b=Se(y),w=b.next();!w.done;w=b.next()){var _=w.value;
36if(!(v&&!_le.includes(_.name))){if(e.has(_.name)){p[_.name]=Hc;continue}p[_.name]=String(_.value).substring(0,ZF)}}}catch(E){r={error:E}}finally{try{w&&!w.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}return Object.keys(p).length&&(l.attrs=p),t.shadowRoot&&(l.attrs=re(re({},l.attrs||{}),(a={},a[zF]="true",a)),l.shadow=!0),l}function dU(t,e){return e===void 0&&(e=Pu),t?e.enabled?Ile(t,e.maxDepth):xle(t):[]}function xle(t){var e=[];e.push(t);for(var n=t.parentElement;n&&n.tagName!=="HTML";)e.push(n),n=n.parentElement;return e}function Ile(t,e){var n,r,i=[];try{for(var a=Se(JF(t,e)),s=a.next();!s.done;s=a.next()){var o=s.value;if(o.tagName==="HTML")break;i.push(o)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}var Tle=function(t){return t.closest("[".concat(Gc,"]"))!==null},Lle=function(t,e){var n,r;return dU(t,e).some(function(i){return i.hasAttribute(Gc)})?!0:(r=(n=document.documentElement)===null||n===void 0?void 0:n.hasAttribute(Gc))!==null&&r!==void 0?r:!1},j6;function kle(){return j6||(j6=Fce(rU())),j6}var fU=function(){function t(e,n){var r,i,a=this,s;this.replaceSensitiveString=function(f){return MC(f,a.additionalMaskTextPatterns)},this.getHierarchy=function(f){var h,p,g,y,v=performance.now(),b=[];if(!f)return[];for(var w=a.getShadowMode(),_=dU(f,w),E=new Map,C=_.length-1;C>=0;C--){var x=_[C];if(x){var $=zce(x.getAttribute(qF)),T=C===_.length-1?[]:(g=E.get(_[C+1]))!==null&&g!==void 0?g:new Set,U=new Set(Qe(Qe([],$e(T),!1),$e($),!1));E.set(x,U)}}b=_.map(function(A){var R;return Ale(A,(R=E.get(A))!==null&&R!==void 0?R:new Set,w)});var O=function(A){A?.attrs&&Object.entries(A.attrs).forEach(function(R){var N=$e(R,2),P=N[0],j=N[1];A.attrs&&(A.attrs[P]=a.replaceSensitiveString(j))})};try{for(var F=Se(b),k=F.next();!k.done;k=F.next()){var S=k.value;O(S)}}catch(A){h={error:A}}finally{try{k&&!k.done&&(p=F.return)&&p.call(F)}finally{if(h)throw h.error}}var I=performance.now();return(y=a.diagnosticsClient)===null||y===void 0||y.recordHistogram("autocapturePlugin.getHierarchy",I-v),b},this.getNearestLabel=function(f){var h=f.parentElement;if(!h)return"";var p;try{p=h.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{p=null}return p?a.getText(p):a.getNearestLabel(h)},this.getElementPath=function(f){var h;if(!f)return"";var p=performance.now(),g=a.selectorEngine.generate(f),y=performance.now();return(h=a.diagnosticsClient)===null||h===void 0||h.recordHistogram("autocapturePlugin.getElementPath",y-p),g},this.updateSelectorConfig=function(f,h){var p;if(f!=null){var g=typeof f.enabled=="boolean",y=typeof f.shadowDomEnabled=="boolean";if(!g&&!y){h?.debug("@amplitude/element-selector: ignoring remote-config delivery without an explicit `enabled` or `shadowDomEnabled` flag â keeping current engine state.");return}var v=rU(f,h),b=a.selectorEngine.getConfig().enabled,w=a.shadowGate.get().enabled,_=a.shadowGate.arm(jce(v));a.selectorEngine.updateConfig(re(re(re({},g?v:a.selectorEngine.getConfig()),{shadowDomEnabled:_.enabled}),_.enabled&&{maxShadowDomDepth:_.maxDepth})),g&&b!==v.enabled&&h?.debug(v.enabled?"@amplitude/element-selector: engine enabled â now emitting new element-selector element paths for autocapture events.":"@amplitude/element-selector: engine disabled â reverting to legacy cssPath for element paths."),!w&&_.enabled&&((p=a.diagnosticsClient)===null||p===void 0||p.setTag("plugin.autocapture.shadowDom","enabled:".concat(_.maxDepth)))}}
36,this.getShadowMode=function(){return a.shadowGate.get()},this.getEventProperties=function(f,h,p){var g,y,v,b,w=(v=(y=h?.tagName)===null||y===void 0?void 0:y.toLowerCase)===null||v===void 0?void 0:v.call(y),_=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():{left:null,top:null},E=a.getHierarchy(h),C=(b=E[0])===null||b===void 0?void 0:b.attrs,x=a.getNearestLabel(h),$=Zce(C??{},p),T=(g={},g[Zoe]=E,g[vI]=w,g[wI]=a.getText(h),g[Goe]=_.left==null?null:Math.round(_.left),g[Yoe]=_.top==null?null:Math.round(_.top),g[Xoe]=$,g[Qoe]=a.getElementPath(h),g[ece]=x,g[dw]=qa(window.location.href.split("?")[0]),g[tce]=NC(a.replaceSensitiveString),g[VF]=window.innerHeight,g[HF]=window.innerWidth,g),U=aU();if(U&&(T[WF]=U),T[qoe]=h.getAttribute("id")||"",T[zoe]=h.getAttribute("class"),T[Joe]=C?.["aria-label"],w==="a"&&f==="click"&&h instanceof HTMLAnchorElement){var O=h.href.substring(0,ZF);T[Koe]=a.replaceSensitiveString(O)}return xI(T)},this.addTypeAndTimestamp=function(f,h){return{event:f,timestamp:Date.now(),type:h}},this.addAdditionalEventProperties=function(f,h,p,g,y){y===void 0&&(y=!1);var v=a.addTypeAndTimestamp(f,h);try{if(Xce(v)&&v.event.target!==null){var b=a.getShadowMode(),w=Jce(v.event,b);if(y){var _=Wce(w,v.type);if(_)return v.closestTrackedAncestor=w,v.targetElementProperties=a.getEventProperties(v.type,v.closestTrackedAncestor,g),v}var E=sU(w,p,b);E&&(v.closestTrackedAncestor=E,v.targetElementProperties=a.getEventProperties(v.type,E,g))}}catch{}return v},this.extractDataFromDataSource=function(f,h){if(f.sourceType==="DOM_ELEMENT"){var p=ple(f,h);return p?f.elementExtractType==="TEXT"?a.getText(p):f.elementExtractType==="ATTRIBUTE"&&f.attribute?p.getAttribute(f.attribute):void 0:void 0}},this.getTextWithMaskedDescendants=function(f){var h,p,g="[".concat(Gc,"], [contenteditable]");if(!f.querySelector(g))return f.innerText;var y="",v=Array.from(f.childNodes);try{for(var b=Se(v),w=b.next();!w.done;w=b.next()){var _=w.value;if(_.nodeType===Node.TEXT_NODE){y+=_.textContent||"";continue}if(_ instanceof Element){if(_.hasAttribute(Gc)||_.hasAttribute("contenteditable")){y+=Hc;continue}y+=a.getTextWithMaskedDescendants(_)}}}catch(E){h={error:E}}finally{try{w&&!w.done&&(p=b.return)&&p.call(b)}finally{if(h)throw h.error}}return y},this.hasMaskedAncestor=function(f){var h=a.getShadowMode();return h.enabled?Lle(f,h):Tle(f)},this.getText=function(f){var h=a.hasMaskedAncestor(f);if(h)return Hc;var p="";return f.querySelector("[".concat(Gc,"], [contenteditable]"))?p=a.getTextWithMaskedDescendants(f):p=f.innerText||"",a.replaceSensitiveString(p.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(f){var h,p,g;if(!f)return{};var y=(g=(p=f?.tagName)===null||p===void 0?void 0:p.toLowerCase)===null||g===void 0?void 0:g.call(p),v=(h={},h[vI]=y,h[wI]=a.getText(f),h[dw]=window.location.href.split("?")[0],h);return xI(v)},this.diagnosticsClient=n?.diagnosticsClient,this.selectorEngine=kle(),this.shadowGate=Vce();var o=(s=e.maskTextRegex)!==null&&s!==void 0?s:[],c=[];try{for(var l=Se(o),u=l.next();!u.done;u=l.next()){var d=u.value;if(c.length>=sce)break;if(d instanceof RegExp)c.push(d);else if("pattern"in d&&typeof d.pattern=="string")try{c.push(new RegExp(d.pattern,"i"))}catch{}}}catch(f){r={error:f}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=c}return t}(),$le="configs.analyticsSDK.browserSDK.autocapture.elementSelector";function hU(t,e){var n=t.remoteConfigClient;if(!(!t.fetchRemoteConfig||!n)){var r=n.subscribe($le,"all",function(i,a){t.loggerProvider.debug("@amplitude/element-selector: remote-config delivery (source=".concat(String(a),") ").concat(JSON.stringify(i))),e.updateSelectorConfig(i,t.loggerProvider)});return function(){n.unsubscribe(r)}}}function Ple(t){var e=t.allObservables,n=t.onExposure,r=t.dataExtractor,i=t.exposureDuration,a=i===void 0?cF:i,s=new Map,o=new Map,c=e.exposureObservable,l=c.subscribe(function(u){var d=u,f=d.target;if(d.isIntersecting){if(!s.get(f)){var h=o.get(f);h&&clearTimeout(h);var p=setTimeout(function(){s.set(f,!0);var g=r.getElementPath(f);n(g),o.set(f,null)},a);o.set(f,p)}}else if(!d.isIntersecting&&d.intersectionRatio<1){var p=o.get(f);p&&(clearTimeout(p),o.set(f,null))}});return{unsubscribe:function(){l.unsubscribe()},reset:function(){o.forEach(function(u){u&&clearTimeout(u)}),o.clear(),s.clear()}}}function Rle(t){var e,n,r,i=t.amplitude,a=t.scrollTracker,s=t.currentElementExposed,o=t.elementExposedForPage,c=t.elementExposedInSentEvents,l=t.exposureTracker,u=t.isPageEnd,d=t.lastScroll,f=a.getState(),h=He(),p=(n=h?.innerWidth)!==null&&n!==void 0?n:0,g=(r=h?.innerHe
36ight)!==null&&r!==void 0?r:0,y=Array.from(s).filter(function(_){return!c.has(_)}),v=(e={},e[dw]=jd(h),e[nce]=f.maxX+p,e[rce]=f.maxY+g,e[VF]=g,e[HF]=p,e["[Amplitude] Element Exposed"]=y,e),b=aU();b&&(v[WF]=b);var w=function(){a.reset();var _=a.getState();d.maxX=_.maxX,d.maxY=_.maxY,o.clear(),c.clear(),l?.reset()};if(y.length===0&&f.maxX===d.maxX&&f.maxY===d.maxY){u&&w();return}i?.track("[Amplitude] Viewport Content Updated",v),d.maxX=f.maxX,d.maxY=f.maxY,y.forEach(function(_){c.add(_)}),s.clear(),u&&w()}function Ole(t,e,n,r,i){if(!(e.has(t)||n.has(t))){e.add(t),r.add(t);var a=Array.from(r),s=JSON.stringify(a);s.length>=cce&&i(!1)}}function Mle(t){var e=t.mutationObservable,n=t.onRescan,r=t.onFlush,i=t.exposureDuration,a=t.quietMs,s=a===void 0?lce:a,o=t.maxWaitMs,c=o===void 0?uce:o,l=!1,u,d,f,h,p,g=function(){u&&(clearTimeout(u),u=void 0),d&&(clearTimeout(d),d=void 0),f&&(clearTimeout(f),f=void 0)},y=function(){p&&(document.removeEventListener("DOMContentLoaded",p),p=void 0)},v=function(){return typeof document<"u"&&document.readyState!=="loading"},b=function(){if(!l){if(!v()){p||(p=function(){p=void 0,w()},document.addEventListener("DOMContentLoaded",p));return}l=!0,g(),y(),n(),f=setTimeout(function(){f=void 0,r()},i+dce)}},w=function(){l||(u&&clearTimeout(u),u=setTimeout(b,s))},_=function(){g(),y(),l=!1,w(),d=setTimeout(b,c)};return{start:function(){h||(h=e.subscribe(function(){w()}),_())},reset:function(){_()},stop:function(){h?.unsubscribe(),h=void 0,g(),y()}}}var br;(function(t){t.ClickObservable="clickObservable",t.PointerDownObservable="pointerDownObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable",t.ScrollObservable="scrollObservable",t.ExposureObservable="exposureObservable",t.BrowserErrorObservable="browserErrorObservable",t.SelectionObservable="selectionObservable",t.MouseMoveObservable="mouseMoveObservable"})(br||(br={}));var Nle=function(t,e){var n,r,i,a,s,o,c,l,u,d,f,h;t===void 0&&(t={}),e?.diagnosticsClient.setTag("plugin.autocapture.version",jF);var p=t.dataAttributePrefix,g=p===void 0?oF:p,y=t.visualTaggingOptions,v=y===void 0?{enabled:!0}:y;t.cssSelectorAllowlist=(n=t.cssSelectorAllowlist)!==null&&n!==void 0?n:zae,t.actionClickAllowlist=(r=t.actionClickAllowlist)!==null&&r!==void 0?r:Zae,t.debounceTime=(i=t.debounceTime)!==null&&i!==void 0?i:0;var b=((a=t.viewportContentUpdated)===null||a===void 0?void 0:a.enabled)!==!1,w=(c=(o=(s=t.viewportContentUpdated)===null||s===void 0?void 0:s.exposureDuration)!==null&&o!==void 0?o:t.exposureDuration)!==null&&c!==void 0?c:cF;t.viewportContentUpdated=re(re({},t.viewportContentUpdated),{exposureDuration:w}),t.pageUrlExcludelist=(l=t.pageUrlExcludelist)===null||l===void 0?void 0:l.reduce(function(M,V){if(typeof V=="string"&&M.push(V),V instanceof RegExp&&M.push(V),typeof V=="object"&&V!==null&&"pattern"in V)try{M.push(new RegExp(V.pattern))}catch(B){return console.warn("Invalid regex pattern: ".concat(V.pattern),B),M}return M},[]);var _=Noe,E="enrichment",C=[],x=new fU(t,e),$=new Set,T=new Set,U=new Set,O,F,k=function(){var M,V=Cs(uU().map(function(J){return x.addAdditionalEventProperties(J,"click",t.cssSelectorAllowlist,g)})),B=Cs(new Jn(function(J){var K,ne=function(ce){var xe=x.addAdditionalEventProperties(ce,"change",t.cssSelectorAllowlist,g);J.next(xe)};return(K=He())===null||K===void 0||K.document.addEventListener("change",ne,{capture:!0}),function(){var ce;return(ce=He())===null||ce===void 0?void 0:ce.document.removeEventListener("change",ne)}})),G;window.navigation&&(G=Cs(new Jn(function(J){var K=function(ne){var ce=x.addAdditionalEventProperties(ne,"navigate",t.cssSelectorAllowlist,g);J.next(ce)};return window.navigation.addEventListener("navigate",K),function(){window.navigation.removeEventListener("navigate",K)}})));var Z=x.shadowGate,ie=Cs(lU(Z).map(function(J){return x.addAdditionalEventProperties(J,"mutation",t.cssSelectorAllowlist,g)})),oe=sle(),z=cle(ie,t.cssSelectorAllowlist,function(J){F=J},Z);return M={},M[br.ChangeObservable]=B,M[br.ClickObservable]=V,M[br.MutationObservable]=ie,M[br.NavigateObservable]=G,M[br.ScrollObservable]=oe,M[br.ExposureObservable]=z,M},S=LI(Object.values((d=(u=t.pageActions)===null||u===void 0?void 0:u.labeledEvents)!==null&&d!==void 0?d:{})),I=kI((h=(f=t.pageActions)===null||f===void 0?void 0:f.triggers)!==null&&h!==void 0?h:[]),A=wle(S,I,x,t),R=function(M){var V,B;M&&(t.pageActions=re(re({},t.pageActions),M),S=LI(Object.values((V=t.pageActions.labeledEvents)!==null&&V!==void 0?V:{})),I=kI((B=t.pageActions.triggers)!==null&&B!==void 0?B:[]),A.update(S,I,t))},N=function(M,V){return te(void 0,void 0,void 0,function(){var B,G,Z,ie,oe,z,J,K,ne,ce,xe,ke,Me,$t,H,q,se,de,he,pe,ye,ge,Pe,_e,Ie,qe,Fe;return ee(this,function(pt){return typeof document>"u"?[2]:(B=!1,M.fetchRemoteConfig&&(M.remoteConfigClient?M.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(ze){R(ze)}):M.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),G=hU(M,x),G&&C.push({unsubscribe:G}),Z=Ud(t,t.cssSelectorAllowlist),ie=Ud(t,t.actionClickAllowlist),oe=k(),z=tle({allObservables:oe,amplitude:V,shouldTrackEvent:Z,evaluateTriggers:A.evaluate.bind(A)}),C.push(z),J=nle({allObservables:oe,getEventProperties:function(){for(var ze=[],Ue=0;Ue<arguments.length;Ue++)ze[Ue]=arguments[Ue];return x.getEventProperties.apply(x,Qe(Qe([],$e(ze),!1),[g],!1))},amplitude:V,shouldTrackEvent:Z,evaluateTriggers:A.evaluate.bind(A)}),C.push(J),K=rle({allObservables:oe,options:t,getEventProperties:function(){for(var ze=[],Ue=0;Ue<arguments.length;Ue++)ze[Ue]=arguments[Ue];return x.getEventProperties.apply(x,Qe(Qe([],$e(ze),!1),[g],!1))},amplitude:V,shouldTrackEvent:Z,shouldTrackActionClick:ie}),K&&C.push(K),ne=ile({allObservables:oe,amplitude:V}),C.push(ne),ce=re({},ne.getState()),xe={},ke=He(),$t=function(ze){ze&&Me?.reset(),!(ze&&B)&&(ze&&(B=!0,setTimeout(function(){B=!1},100)),Rle({amplitude:V,scrollTracker:ne,currentElementExposed:U,elementExposedForPage:$,elementExposedInSentEvents:T,exposureTracker:xe.exposure,isPageEnd:ze,lastScroll:ce}))},H=jd(ke),q=function(){var ze=jd(ke);ze!==H&&(H=ze,$t(!0))},se=function(ze,Ue){var Ve=jd(ke),st=Qce(Ue,ke);if(Ve===st){ze();return}H=st,$t(!0),ze()},de=function(ze){Ole(ze,$,T,U,$t)},b&&(xe.exposure=Ple({allObservables:oe,onExposure:de,dataExtractor:x,exposureDuration:w}),xe.exposure&&C.push(xe.exposure),Me=Mle({mutationObservable:oe[br.MutationObservable],onRescan:function(){var ze,Ue;(Ue=(ze=M.loggerProvider)===null||ze===void 0?void 0:ze.debug)===null||Ue===void 0||Ue.call(ze,"@amplitude/plugin-autocapture-browser: initial exposure snapshot â rescanning DOM"),F?.()},onFlush:function(){var ze,Ue;(Ue=(ze=M.loggerProvider)===null||ze===void 0?void 0:ze.debug)===null||Ue===void 0||Ue.call(ze,"@amplitude/plugin-autocapture-browser: initial exposure snapshot â flushing viewport content updated"),$t(!1)},exposureDuration:w}),Me.start(),C.push({unsubscribe:function(){Me?.stop()}}),he=function(){$t(!0)},ke?.addEventListener("beforeunload",he),O=function(){ke?.removeEventListener("beforeunload",he)},C.push({unsubscribe:function(){return O()}}),pe=oe[br.NavigateObservable],pe?C.push(pe.subscribe(function(ze){var Ue,Ve,st=(Ve=(Ue=ze.event)===null||Ue===void 0?void 0:Ue.destination)===null||Ve===void 0?void 0:Ve.url;if(st){var as=VC(st);if(as===H)return;H=as,$t(!0);return}q()})):ke&&(ye=function(){q()},ke.addEventListener("popstate",ye),ge=ke.history.pushState,Pe=ke.history.replaceState,ke.history&&ge&&(ke.history.pushState=new Proxy(ge,{apply:function(ze,Ue,Ve){se(function(){ze.apply(Ue,Ve)},Ve[2])}})),ke.history&&Pe&&(ke.history.replaceState=new Proxy(Pe,{apply:function(ze,Ue,Ve){se(function(){ze.apply(Ue,Ve)},Ve[2])}})),C.push({unsubscribe:function(){ke.removeEventListener("popstate",ye),ke.history&&ge&&(ke.history.pushState=ge),ke.history&&Pe&&(ke.history.replaceState=Pe)}}))),(Fe=M?.loggerProvider)===null||Fe===void 0||Fe.log("".concat(_," has been successfully added.")),window.opener&&v.enabled&&(_e=t.cssSelectorAllowlist,Ie=t.actionClickAllowlist,qe=SF(),ele(qe,{dataExtractor:x,isElementSelectable:Ud(t,Qe(Qe([],$e(_e),!1),$e(Ie),!1)),cssSelectorAllowlist:_e,actionClickAllowlist:Ie}),AF(qe),qe.setup(re({logger:M?.loggerProvider},M?.serverZone&&{endpoint:CF[M.serverZone]}))),[2])})})},P=function(M){return te(void 0,void 0,void 0,function(){return ee(this,function(V){return[2,M]})})},j=function(){return te(void 0,void 0,void 0,function(){var M,V,B,G,Z;return ee(this,function(ie){try{for(M=Se(C),V=M.next();!V.done;V=M.next())B=V.value,B.unsubscribe()}catch(oe){G={error:oe}}finally{try{V&&!V.done&&(Z=M.return)&&Z.call(M)}finally{if(G)throw G.error}}return[2]})})};return{name:_,type:E,setup:N,execute:P,teardown:j}},Dle=3e3,Fle=["mutation","navigate"];function Ule(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackDeadClick,a=n.clickObservable,s=n.mutationObservable,o=n.navigateObservable,c=a.filter(function(h){return s0(h)&&i("click",h.closestTrackedAncestor)&&h.event.target instanceof Element&&h.event.target.closest('a[target="_blank"]')===null&&h.event.button===Hg.LEFT_OR_TOUCH_CONTACT}),l=o?yu(s,o):s,u=yu(c,l),d=null,f=FC(u,function(h){return d&&Fle.includes(h.type)?(clearTimeout(d),d=null,Promise.resolve(null)):h.type==="click"?d?Promise.resolve(null):new Promise(function(p){d=setTimeout(function(){p(h),d=null},Dle)}):Promise.resolve(null)});return f.subscribe(function(h){if(h){var p={"[Amplitude] X":h.event.clientX,"[Amplitude] Y":h.event.clientY};e.track(Uoe,re(re({},r("click",h.closestTrackedAncestor)),p),{time:h.timestamp})}})}var pU=Qae,gU=Xae,$I=ese;function PI(t,e){var n,r,i,a,s=e.event,o=s.pageX,c=s.pageY;t.yMin=Math.min((n=t.yMin)!==null&&n!==void 0?n:c,c),t.yMax=Math.max((r=t.yMax)!==null&&r!==void 0?r:c,c),t.xMin=Math.min((i=t.xMin)!==null&&i!==void 0?i:o,o),t.xMax=Math.max((a=t.xMax)!==null&&a!==void 0?a:o,o),t.isOutOfBounds=t.yMax-t.yMin>$I||t.xMax-t.xMin>$I}function RI(t){if(t.length===0)return null;var e=t[0],n=t[t.length-1],r=re({"[Amplitude] Begin Time":new Date(e.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-e.timestamp,"[Amplitude] Clicks":t.map(function(i){return{X:i.event.pageX,Y:i.event.pageY,Time:i.timestamp}}),"[Amplitude] Click Count":t.length},e.targetElementProperties);return{rageClickEvent:r,time:e.timestamp}}function jle(t,e){var n=Math.max(0,t.length-pU+1),r=t[n];return e.timestamp-r.timestamp>=gU}function Ble(t,e){return t.length>0&&t[t.length-1].closestTrackedAncestor!==e.closestTrackedAncestor}function Vle(t){var e=this,n=t.amplitude,r=t.allObservables,i=t.shouldTrackRageClick,a=r.pointerDownObservable,s=r.selectionObservable,o=[],c={},l=null;function u(p){o=[],c={},p&&(PI(c,p),o.push(p))}var d=FC(a.filter(function(p){return i("click",p.closestTrackedAncestor)}),function(p){return te(e,void 0,void 0,function(){var g;return ee(this,function(y){return PI(c,p),g=null,o.length===0||Ble(o,p)||jle(o,p)||c.isOutOfBounds?(l&&(g=RI(o)),u(p)):o.push(p),l&&(clearTimeout(l.timerId),l.resolve(g),l=null),o.length>=pU?[2,new Promise(function(v){l={resolve:v,timerId:setTimeout(function(){v(RI(o))},gU)}})]:[2,null]})})}),f=s?.subscribe(function(){u()}),h=d.subscribe(function(p){p!==null&&n.track(joe,p.rageClickEvent,{time:p.time})});return{unsubscribe:function(){h.unsubscribe(),f?.unsubscribe()}}}var Hle=2e3;function Wle(t){var e=t.amplitude,n=t.allObservables,r=t.shouldTrackErrorClick,i=n.pointerDownObservable,a=n.browserErrorObservable,s=i.filter(function(u){return s0(u)&&r("click",u.closestTrackedAncestor)&&u.event.target instanceof Element&&u.event.target.closest('a[target="_blank"]')===null&&u.event.button===Hg.LEFT_OR_TOUCH_CONTACT}),o=null,c=null,l=function(){o!==null&&(clearTimeout(o),o=null),c=null};return yu(s,a).subscribe(function(u){var d;if(u.type==="click"){l(),c=u,o=setTimeout(l,Hle);return}u.type==="error"&&c&&(e.track(Boe,re((d={},d["[Amplitude] Kind"]=u.event.kind,d["[Amplitude] Message"]=u.event.message,d["[Amplitude] Stack"]=u.event.stack,d["[Amplitude] Filename"]=u.event.filename,d["[Amplitude] Line Number"]=u.event.lineNumber,d["[Amplitude] Column Number"]=u.event.columnNumber,d),c.targetElementProperties)),l())})}var ms;(function(t){t.INCREASING="increasing",t.DECREASING="decreasing"})(ms||(ms={}));var Yl;(function(t){t.X="x",t.Y="y"})(Yl||(Yl={}));var qle=function(t){var e=t.allWindowObservables,n=e.mouseMoveObservable;return new Jn(function(r){var i=null,a=null,s=null;return n.subscribe(function(o){var c={x:o.clientX,y:o.clientY};if(i===null){i=c;return}c.x>i.x?(a===ms.DECREASING&&r.next(Yl.X),a=ms.INCREASING):c.x<i.x&&(a===ms.INCREASING&&r.next(Yl.X),a=ms.DECREASING),c.y>i.y?(s===ms.DECREASING&&r.next(Yl.Y),s=ms.INCREASING):c.y<i.y&&(s===ms.INCREASING&&r.next(Yl.Y),s=ms.DECREASING),i=c})})};function zle(t){var e=+Date.now();t.startTime=t.startTime||e;var n=t.changes,r=t.changesThreshold;n.push(e),n.length>r&&n.shift()}function OI(t){var e=t.changes,n=t.changesThreshold,r=t.thresholdMs;if(e.length<n)return!1;var i=e[e.length-1]-e[0];return i<r}function MI(t){t.changes=[],t.startTime=void 0}function NI(t){for(var e=t.changes,n=t.thresholdMs,r=0,i=e[e.length-1];r<e.length;r++){var a=i-e[r];if(a<n)break}r!==0&&(t.startTime=e[r],t.changes.splice(0,r))}function Zle(t,e){var n=void 0;if(OI(t)&&(n=t.startTime),OI(e)){var r=e.startTime;r&&(!n||r<n)&&(n=r)}return n}var yU=20,mU=2e3,Kle=function(t){var e=t.mouseDirectionChangeObservable,n=t.directionChanges,r=n===void 0?yU:n,i=t.thresholdMs,a=i===void 0?mU:i;return new Jn(function(s){var o={changes:[],changesThreshold:r,thresholdMs:a},c={changes:[],changesThreshold:r,thresholdMs:a},l=void 0,u=null;function d(){l!==void 0&&(s.next(l),l=void 0,u!==null&&clearTimeout(u),MI(o),MI(c))}return e.subscribe(function(f){u!==null&&clearTimeout(u),zle(f===Yl.X?o:c);var h=Zle(o,c);return h?(l=l||h,u=setTimeout(function(){d(),u=null},a)):d(),NI(o),NI(c),function(){u!==null&&(clearTimeout(u),u=null)}})})},Gle=function(t){var e=t.amplitude,n=t.options,r=t.allObservables,i=t.directionChanges,a=i===void 0?yU:i,s=t.thresholdMs,o=s===void 0?mU:s,c=qle({allWindowObservables:r}),l=Kle({mouseDirectionChangeObservable:c,directionChanges:a,thresholdMs:o});return l.subscribe(function(u){BC(n)&&e.track(Hoe,void 0,{time:u})})};function B6(t,e,n,r){if(!r)return[];var i=t[e];return typeof i=="object"&&i!==null&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var f1=5,h1=4e3,Yle=function(t){var e;t===void 0&&(t={});var n=Doe,r="enrichment",i=[],a=t.errorClicks!==!1;t.errorClicks||(a=!1);var s=t.deadClicks!==!1&&t.deadClicks!==null,o=t.rageClicks!==!1&&t.rageClicks!==null,c=t.thrashedCursor!==!1&&t.thrashedCursor!==null;t.thrashedCursor||(c=!1);var l=B6(t,"rageClicks",Jae,o),u=B6(t,"deadClicks",Gae,s),d=B6(t,"errorClicks",Yae,a),f=(e=t.dataAttributePrefix)!==null&&e!==void 0?e:oF,h=new fU(t),p=Qe([],$e(new Set(Qe(Qe(Qe([],$e(l),!1),$e(u),!1),$e(d),!1))),!1),g=function(){var w,_=function(k){return Cs(uU(k).map(function(S){return h.addAdditionalEventProperties(S,"click",p,f,!0)}))},E=_("click"),C=_("pointerdown"),x=Cs(dle().map(function(k){return h.addTypeAndTimestamp(k,"error")})),$=Cs(lU(h.shadowGate).map(function(k){return h.addAdditionalEventProperties(k,"mutation",p,f)})),T;if(window.navigation){var U=new Jn(function(k){var S=function(I){k.next(re(re({},I),{type:"navigate"}))};return window.navigation.addEventListener("navigate",S),function(){window.navigation.removeEventListener("navigate",S)}});T=Cs(U.map(function(k){return h.addAdditionalEventProperties(k,"n
36avigate",p,f)}))}var O=Cs(new Jn(function(k){var S=function(){var I=document.activeElement;if(I&&(I.tagName==="TEXTAREA"||I.tagName==="INPUT")){var A=void 0,R=void 0;try{if(A=I.selectionStart,R=I.selectionEnd,A===R)return}catch{return}return k.next()}var N=window.getSelection();if(!(!N||N.isCollapsed))return k.next()};return window.document.addEventListener("selectionchange",S),function(){window.document.removeEventListener("selectionchange",S)}})),F=Cs(fle());return w={},w[br.ClickObservable]=E,w[br.PointerDownObservable]=C,w[br.MutationObservable]=$,w[br.NavigateObservable]=T,w[br.BrowserErrorObservable]=x,w[br.SelectionObservable]=O,w[br.MouseMoveObservable]=F,w},y=function(w,_){return te(void 0,void 0,void 0,function(){var E,C,x,$,T,U,O,F,k,S,I,A;return ee(this,function(R){return typeof document>"u"?[2]:(E=g(),C=hU(w,h),C&&i.push({unsubscribe:C}),o&&(x=Ud(t,l),$=Vle({allObservables:E,amplitude:_,shouldTrackRageClick:x}),i.push($)),s&&(T=Ud(t,u),U=Ule({amplitude:_,allObservables:E,getEventProperties:function(N,P){return h.getEventProperties(N,P,f)},shouldTrackDeadClick:T}),i.push(U)),a&&(O=Ud(t,d),F=Wle({amplitude:_,allObservables:E,shouldTrackErrorClick:O}),i.push(F)),c&&(k=void 0,S=void 0,typeof t.thrashedCursor=="object"&&(k=t.thrashedCursor.directionChanges,S=t.thrashedCursor.threshold,k&&k<f1&&(w.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(f1,", setting to ").concat(f1)),k=f1),S&&S>h1&&(w.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(S," is above the maximum of ").concat(h1,", setting to ").concat(h1)),S=h1)),I=Gle({amplitude:_,options:t,allObservables:E,directionChanges:k,thresholdMs:S}),i.push(I)),(A=w?.loggerProvider)===null||A===void 0||A.log("".concat(n," has been successfully added.")),[2])})})},v=function(w){return te(void 0,void 0,void 0,function(){return ee(this,function(_){return[2,w]})})},b=function(){return te(void 0,void 0,void 0,function(){var w,_,E,C,x;return ee(this,function($){try{for(w=Se(i),_=w.next();!_.done;_=w.next())E=_.value,E.unsubscribe()}catch(T){C={error:T}}finally{try{_&&!_.done&&(x=w.return)&&x.call(w)}finally{if(C)throw C.error}}return[2]})})};return{name:n,type:r,setup:y,execute:v,teardown:b}},Jle=100,Xle=1e4;function vU(t,e){var n=t.startTime+t.duration;return e.filter(function(r){return r.startTime<n&&r.startTime+r.duration>t.startTime}).map(function(r){return r.name})}function Qle(t,e){var n,r=vU(t,e),i=(n=t.scripts)!==null&&n!==void 0?n:[],a=i.map(function(u){return u.sourceURL}).filter(Boolean),s=i.map(function(u){return u.sourceFunctionName}).filter(Boolean),o=i.map(function(u){return u.sourceCharPosition}).filter(function(u){return typeof u=="number"&&u>=0}),c=i.map(function(u){return u.invokerType}).filter(Boolean),l=i.map(function(u){return u.invoker}).filter(Boolean);return re(re(re(re(re(re(re({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":t.duration,"[Amplitude] Main Thread Block Blocking Duration":t.blockingDuration,"[Amplitude] Main Thread Block Start Time":t.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),{"[Amplitude] Main Thread Block Render Start":t.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":t.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":i.length}),a.length>0&&{"[Amplitude] Main Thread Block Script URLs":a}),s.length>0&&{"[Amplitude] Main Thread Block Script Functions":s}),o.length>0&&{"[Amplitude] Main Thread Block Script Positions":o}),c.length>0&&{"[Amplitude] Main Thread Block Invoker Types":c}),l.length>0&&{"[Amplitude] Main Thread Block Invokers":l})}function eue(t,e){var n,r=vU(t,e),i=(n=t.attribution)!==null&&n!==void 0?n:[];return re(re({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":t.duration,"[Amplitude] Main Thread Block Blocking Duration":t.duration,"[Amplitude] Main Thread Block Start Time":t.startTime},r.length>0&&{"[Amplitude] Main Thread Block Measures":r}),i.length>0&&{"[Amplitude] Main Thread Block Attribution":i.map(function(a){return a.name})})}function tue(){if(typeof PerformanceObserver>"u")return null;try{var t=PerformanceObserver.supportedEntryTypes;if(t.includes("long-animation-frame"))return"long-animation-frame";if(t.includes("longtask"))return"longtask"}catch{}return null}function nue(t){var e=t.amplitude,n=t.options,r=t.durationThreshold,i=r===void 0?Jle:r,a=tue();if(!a)return{unsubscribe:function(){}};var s=[],o=new PerformanceObserver(function(l){var u,d,f=performance.now();try{for(var h=Se(l.getEntries()),p=h.next();!p.done;p=h.next()){var g=p.value;s.push(g)}}catch(v){u={error:v}}finally{try{p&&!p.done&&(d=h.return)&&d.call(h)}finally{if(u)throw u.error}}for(var y=f-Xle;s.length>0&&s[0].startTime<y;)s.shift()});try{o.observe({entryTypes:["measure"]})}catch{}var c=new PerformanceObserver(function(l){var u,d;try{for(var f=Se(l.getEntries()),h=f.next();!h.done;h=f.next()){var p=h.value;if(!BC(n))return;if(!(p.duration<i)){var g=a==="long-animation-frame"?Qle(p,s):eue(p,s);e.track(Woe,g)}}}catch(y){u={error:y}}finally{try{h&&!h.done&&(d=f.return)&&d.call(f)}finally{if(u)throw u.error}}});try{c.observe({entryTypes:[a]})}catch{return o.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){c.disconnect(),o.disconnect()}}}var rue=100,iue=function(t){t===void 0&&(t={});var e=Foe,n="enrichment",r=[],i=t.mainThreadBlock===!0||typeof t.mainThreadBlock=="object"&&t.mainThreadBlock!==null,a=function(c,l){return te(void 0,void 0,void 0,function(){var u,d,f;return ee(this,function(h){return typeof document>"u"?[2]:(i&&(u=rue,typeof t.mainThreadBlock=="object"&&t.mainThreadBlock.durationThreshold!==void 0&&(u=t.mainThreadBlock.durationThreshold),d=nue({amplitude:l,options:t,durationThreshold:u}),r.push(d)),(f=c?.loggerProvider)===null||f===void 0||f.log("".concat(e," performance tracking has been successfully added.")),[2])})})},s=function(c){return te(void 0,void 0,void 0,function(){return ee(this,function(l){return[2,c]})})},o=function(){return te(void 0,void 0,void 0,function(){var c,l,u,d,f;return ee(this,function(h){try{for(c=Se(r),l=c.next();!l.done;l=c.next())u=l.value,u.unsubscribe()}catch(p){d={error:p}}finally{try{l&&!l.done&&(f=c.return)&&f.call(c)}finally{if(d)throw d.error}}return[2]})})};return{name:e,type:n,setup:a,execute:s,teardown:o}},aue="@amplitude/plugin-network-capture-browser",wU="[Amplitude] Network Request",bU="500-599";function T3(t,e){var n=e.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&"),r="^"+n.replace(/\*/g,".*")+"$",i=new RegExp(r);return i.test(t)}function _U(t,e){var n,r,i=e.split(",");try{for(var a=Se(i),s=a.next();!s.done;s=a.next()){var o=s.value,c=$e(o.split("-").map(Number),2),l=c[0],u=c[1];if(t===l&&u===void 0||t>=l&&t<=u)return!0}}catch(d){n={error:d}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1}function sue(t,e,n,r,i){if(!(t.hosts&&!t.hosts.find(function(s){return T3(e,s)}))&&!(r&&t.urls&&!tw(r,t.urls))&&!(i&&t.methods&&!t.methods.find(function(s){return i.toLowerCase()===s.toLowerCase()||s==="*"}))){if(n||n===0){var a=t.statusCodeRange||bU;if(!_U(n,a))return!1}return!0}}
36function oue(t){var e,n=t.indexOf("#"),r=n>=0?t.slice(n+1):"",i=n>=0?t.slice(0,n):t,a=i.indexOf("?"),s=a>=0?i.slice(a+1):"",o=a>=0?i.slice(0,a):i,c=o.match(/^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i),l=(e=c?.[1])!==null&&e!==void 0?e:"";return{query:s,fragment:r,href:t,hrefWithoutQueryOrHash:o,host:l}}function CU(t){var e;if(t)try{var n=(e=He())===null||e===void 0?void 0:e.location.href,r=new URL(t,n),i=r.searchParams.toString(),a=r.hash.replace("#",""),s=r.href,o=r.host;r.hash="",r.search="";var c=r.href;return{query:i,fragment:a,href:s,hrefWithoutQueryOrHash:c,host:o}}catch{try{return oue(t)}catch{return}}}function cue(t,e){if(t.includes("amplitude.com"))try{var n=e.body;if(typeof n!="string")return!1;var r=JSON.parse(n),i=r.events;if(i.find(function(a){return a.event_type===wU}))return!0}catch{}return!1}function DI(t){if(typeof t!="object"||t===null){if(t)return Qe([],$e(Ng),!1);if(t===void 0){var e=void 0;return e}return}if(t.length!==0)return t}function FI(t){var e,n,r;return!(!((e=t?.allowlist)===null||e===void 0)&&e.length)&&!(!((n=t?.blocklist)===null||n===void 0)&&n.length)&&!(!((r=t?.excludelist)===null||r===void 0)&&r.length)}function lue(t,e){var n;e===void 0&&(e={});var r=CU(t.url);if(!r)return!1;var i=r.host;if(e.ignoreAmplitudeRequests!==!1&&(T3(i,"*.amplitude.com")||T3(i,"amplitude.com"))||!((n=e.ignoreHosts)===null||n===void 0)&&n.find(function(s){return T3(i,s)})||!e.captureRules&&t.status!==void 0&&!_U(t.status,bU))return!1;if(e.captureRules){var a;if(Qe([],$e(e.captureRules),!1).reverse().find(function(s){if(a=sue(s,i,t.status,t.url,t.method),a){var o=DI(s.responseHeaders);if(t.responseWrapper&&o){var c=t.responseWrapper.headers(o);c&&(t.responseHeaders=c)}var l=DI(s.requestHeaders);if(t.requestWrapper&&l){var u=t.requestWrapper.headers(l);u&&(t.requestHeaders=u)}if(t.responseWrapper&&s.responseBody&&!FI(s.responseBody)){var d=s.responseBody.excludelist||s.responseBody.blocklist;t.responseBodyJson=t.responseWrapper.json(s.responseBody.allowlist,d)}if(t.requestWrapper&&s.requestBody&&!FI(s.requestBody)){var d=s.requestBody.excludelist||s.requestBody.blocklist;t.requestBodyJson=t.requestWrapper.json(s.requestBody.allowlist,d)}}return a!==void 0}),!a)return!1}return!(t.requestWrapper&&cue(i,t.requestWrapper))}function uue(t,e,n,r){return te(this,void 0,void 0,function(){var i,a,s;return ee(this,function(o){switch(o.label){case 0:return e.requestBodyJson||e.responseBodyJson?[4,Promise.all([e.requestBodyJson,e.responseBodyJson])]:[3,2];case 1:if(i=$e.apply(void 0,[o.sent(),2]),a=i[0],s=i[1],a)try{t["[Amplitude] Request Body"]=JSON.stringify(a)}catch(c){r?.debug("Failed to stringify request body",c)}if(s)try{t["[Amplitude] Response Body"]=JSON.stringify(s)}catch{r?.debug("Failed to stringify response body")}o.label=2;case 2:return n?.track(wU,t),[2]}})})}function due(t){var e=t.allObservables,n=t.networkTrackingOptions,r=t.amplitude,i=t.loggerProvider,a=e.networkObservable,s=a.filter(function(o){return lue(o.event,n)});return s.subscribe(function(o){var c,l,u,d=o.event,f=CU(d.url);if(f){var h=(l=d.responseWrapper)===null||l===void 0?void 0:l.bodySize,p=(u=d.requestWrapper)===null||u===void 0?void 0:u.bodySize,g=(c={},c["[Amplitude] URL"]=f.hrefWithoutQueryOrHash,c["[Amplitude] URL Query"]=f.query,c["[Amplitude] URL Fragment"]=f.fragment,c["[Amplitude] Request Method"]=d.method,c["[Amplitude] Status Code"]=d.status,c["[Amplitude] Start Time"]=d.startTime,c["[Amplitude] Completion Time"]=d.endTime,c["[Amplitude] Duration"]=d.duration,c["[Amplitude] Request Body Size"]=p,c["[Amplitude] Response Body Size"]=h,c["[Amplitude] Request Type"]=d.type,c["[Amplitude] Request Headers"]=d.requestHeaders,c["[Amplitude] Response Headers"]=d.responseHeaders,c);uue(g,d,r,i)}})}var hw;(function(t){t.NetworkObservable="networkObservable"})(hw||(hw={}));var UI,fue=function(t){t===void 0&&(t={});var e=aue,n="enrichment",r,i=function(l,u){var d={event:l,timestamp:Date.now(),type:u};return d},a=function(){var l,u=new Jn(function(d){var f=new lse(function(h){var p=i(h,"network");d.next(p)});return sI.subscribe(f,r),function(){sI.unsubscribe(f)}});return l={},l[hw.NetworkObservable]=u,l},s=function(l,u){return te(void 0,void 0,void 0,function(){var d;return ee(this,function(f){return typeof document>"u"&&!Pse()?[2]:(d=a(),r=l?.loggerProvider,UI=due({allObservables:d,networkTrackingOptions:t,amplitude:u,loggerProvider:r}),r?.log("".concat(e," has been successfully added.")),[2])})})},o=function(l){return te(void 0,void 0,void 0,function(){return ee(this,function(u){return[2,l]})})},c=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(l){return UI.unsubscribe(),[2]})})};return{name:e,type:n,setup:s,execute:o,teardown:c}},hue="web-vitals-browser",pue="[Amplitude] Web Vitals";let EU=-1;const z2=t=>{addEventListener("pageshow",e=>{e.persisted&&(EU=e.timeStamp,t(e))},!0)},Bs=(t,e,n,r)=>{let i,a;return s=>{e.value>=0&&(s||r)&&(a=e.value-(i??0),(a||i===void 0)&&(i=e.value,e.delta=a,e.rating=((o,c)=>o>c[1]?"poor":o>c[0]?"needs-improvement":"good")(e.value,n),t(e)))}},HC=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},WC=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},o0=()=>WC()?.activationStart??0,Vs=(t,e=-1)=>{const n=WC();let r="navigate";return EU>=0?r="back-forward-cache":n&&(document.prerendering||o0()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},V6=new WeakMap;function qC(t,e){return V6.get(t)||V6.set(t,new e),V6.get(t)}let gue=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const n=this.o[0],r=this.o.at(-1);this.i&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}};const c0=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{Promise.resolve().then(()=>{e(i.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}},zC=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let xd=-1;const SU=new Set,jI=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,pw=t=>{if(document.visibilityState==="hidden"){if(t.type==="visibilitychange")for(const e of SU)e();isFinite(xd)||(xd=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("prerenderingchange",pw,!0))}},Fm=()=>{if(xd<0){const t=o0();xd=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0]?.startTime)??jI(),addEventListener("visibilitychange",pw,!0),addEventListener("prerenderingchange",pw,!0),z2(()=>{setTimeout(()=>{xd=jI()})})}return{get firstHiddenTime(){return xd},onHidden(t){SU.add(t)}}},Um=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},BI=[1800,3e3],AU=(t,e={})=>{Um(()=>{const n=Fm();let r,i=Vs("FCP");const a=c0("paint",s=>{for(const o of s)o.name==="first-contentful-paint"&&(a.disconnect(),o.startTime<n.firstHiddenTime&&(i.value=Math.max(o.startTime-o0(),0),i.entries.push(o),r(!0)))});a&&(r=Bs(t,i,BI,e.reportAllChanges),z2(s=>{i=Vs("FCP"),r=Bs(t,i,BI,e.reportAllChanges),HC(()=>{i.value=performance.now()-s.timeStamp,r(!0)})}))})},VI=[.1,.25],yue=(t,e={})=>{const n=Fm();AU(zC(()=>{let r,i=Vs("CLS",0);const a=qC(e,gue),s=c=>{for(const l of c)a.h(l);a.i>i.value&&(i.value=a.i,i.entries=a.o,r())},o=c0("layout-shift",s);o&&(r=Bs(t,i,VI,e.reportAllChanges),n.onHidden(()=>{s(o.takeRecords()),r(!0)}),z2(()=>
36{a.i=0,i=Vs("CLS",0),r=Bs(t,i,VI,e.reportAllChanges),HC(()=>r())}),setTimeout(r))}))};let xU=0,H6=1/0,p1=0;const mue=t=>{for(const e of t)e.interactionId&&(H6=Math.min(H6,e.interactionId),p1=Math.max(p1,e.interactionId),xU=p1?(p1-H6)/7+1:0)};let gw;const HI=()=>gw?xU:performance.interactionCount??0,vue=()=>{"interactionCount"in performance||gw||(gw=c0("event",mue,{type:"event",buffered:!0,durationThreshold:0}))};let WI=0,wue=class{u=[];l=new Map;m;p;v(){WI=HI(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((HI()-WI)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&e.entryType!=="first-input")return;const n=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>n.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((i,a)=>a.P-i.P),this.u.length>10){const i=this.u.splice(10);for(const a of i)this.l.delete(a.id)}this.p?.(r)}}};const IU=t=>{const e=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?t():(t=zC(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e(()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})}))},qI=[200,500],bue=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Fm();Um(()=>{vue();let r,i=Vs("INP");const a=qC(e,wue),s=c=>{IU(()=>{for(const u of c)a.h(u);const l=a.L();l&&l.P!==i.value&&(i.value=l.P,i.entries=l.entries,r())})},o=c0("event",s,{durationThreshold:e.durationThreshold??40});r=Bs(t,i,qI,e.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(o.takeRecords()),r(!0)}),z2(()=>{a.v(),i=Vs("INP"),r=Bs(t,i,qI,e.reportAllChanges)}))})};let _ue=class{m;h(e){this.m?.(e)}};const zI=[2500,4e3],Cue=(t,e={})=>{Um(()=>{const n=Fm();let r,i=Vs("LCP");const a=qC(e,_ue),s=c=>{e.reportAllChanges||(c=c.slice(-1));for(const l of c)a.h(l),l.startTime<n.firstHiddenTime&&(i.value=Math.max(l.startTime-o0(),0),i.entries=[l],r())},o=c0("largest-contentful-paint",s);if(o){r=Bs(t,i,zI,e.reportAllChanges);const c=zC(()=>{s(o.takeRecords()),o.disconnect(),r(!0)}),l=u=>{u.isTrusted&&(IU(c),removeEventListener(u.type,l,{capture:!0}))};for(const u of["keydown","click","visibilitychange"])addEventListener(u,l,{capture:!0});z2(u=>{i=Vs("LCP"),r=Bs(t,i,zI,e.reportAllChanges),HC(()=>{i.value=performance.now()-u.timeStamp,r(!0)})})}})},ZI=[800,1800],yw=t=>{document.prerendering?Um(()=>yw(t)):document.readyState!=="complete"?addEventListener("load",()=>yw(t),!0):setTimeout(t)},Eue=(t,e={})=>{let n=Vs("TTFB"),r=Bs(t,n,ZI,e.reportAllChanges);yw(()=>{const i=WC();i&&(n.value=Math.max(i.responseStart-o0(),0),n.entries=[i],r(!0),z2(()=>{n=Vs("TTFB",0),r=Bs(t,n,ZI,e.reportAllChanges),r(!0)}))})};function Sue(t){var e,n=((e=t.entries[0])===null||e===void 0?void 0:e.startTime)||0;return performance.timeOrigin+n}function Cf(t){return{value:t.value,rating:t.rating,delta:t.delta,navigationType:t.navigationType,id:t.id,timestamp:Math.floor(Sue(t)),navigationStart:Math.floor(performance.timeOrigin)}}var Aue=function(){var t=null,e=He(),n=e?.document,r=e?.location,i=function(o,c){return te(void 0,void 0,void 0,function(){var l,u;return ee(this,function(d){return n===void 0?[2]:(l=qa(r?.href||"",o.loggerProvider),u={"[Amplitude] Page Domain":r?.hostname||"","[Amplitude] Page Location":l,"[Amplitude] Page Path":qa(r?.pathname||"",o.loggerProvider),"[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":qa(l.split("?")[0],o.loggerProvider)},Cue(function(f){u["[Amplitude] LCP"]=Cf(f)}),AU(function(f){u["[Amplitude] FCP"]=Cf(f)}),bue(function(f){u["[Amplitude] INP"]=Cf(f)}),yue(function(f){u["[Amplitude] CLS"]=Cf(f)}),Eue(function(f){u["[Amplitude] TTFB"]=Cf(f)}),t=function(){n.visibilityState==="hidden"&&t&&(c.track(pue,u),n.removeEventListener("visibilitychange",t),t=null)},n.addEventListener("visibilitychange",t),[2])})})},a=function(o){return te(void 0,void 0,void 0,function(){return ee(this,function(c){return[2,o]})})},s=function(){return te(void 0,void 0,void 0,function(){return ee(this,function(o){return t&&n?.removeEventListener("visibilitychange",t),[2]})})};return{name:hue,type:"enrichment",setup:i,execute:a,teardown:s}},KI=function(){function t(e,n){var r;this.shouldTrackNewCampaign=!1,this.options=re({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:woe(((r=n.cookieOptions)===null||r===void 0?void 0:r.domain)||n.topLevelDomain),optOut:n.optOut},e),this.storage=n.cookieStorage,this.storageKey=Xx(n.apiKey,"MKTG"),this.webExpStorageKey=Xx(n.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=Pm,this.sessionTimeout=n.sessionTimeout,this.lastEventTime=n.lastEventTime,this.logger=n.loggerProvider,this.topLevelDomain=n.topLevelDomain,n.loggerProvider.log("Installing web attribution tracking.")}return t.prototype.init=function(){return te(this,void 0,void 0,function(){var e,n;return ee(this,function(r){switch(r.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return n=$e.apply(void 0,[r.sent(),2]),this.currentCampaign=n[0],this.previousCampaign=n[1],e=this.lastEventTime?XD(this.sessionTimeout,this.lastEventTime):!0,goe(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},t.prototype.fetchCampaign=function(){return te(this,void 0,void 0,function(){var e;return ee(this,function(n){switch(n.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return e=n.sent(),e?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[4,Promise.all([e||new OC().parse(),this.storage.get(this.storageKey)])];case 4:return[2,n.sent()]}})})},t.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var n=voe(this.currentCampaign,this.options);return e&&(n.event_id=e),n},t.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},t}
36(),xue="[Amplitude] Attribution",Iue=new Set([ni.IDENTIFY,ni.GROUP_IDENTIFY]),Tue=function(t){return eF(t)},Lue=function(t){var e;t===void 0&&(t={});var n=(e=t.fallbackAttributionEvent)!==null&&e!==void 0?e:!1,r=He(),i,a,s={},o=!1,c=!1,l,u,d,f,h=function(){return te(void 0,void 0,void 0,function(){var y;return ee(this,function(v){switch(v.label){case 0:return[4,new OC().parse()];case 1:return y=v.sent(),s=Tue(y),n&&(a?.log("Tracking attribution fallback event."),i?.track(xue,s)),[2]}})})},p=function(){h()},g=function(y){return new Proxy(y,{apply:function(v,b,w){Reflect.apply(v,b,w),o&&p()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(y,v){return te(void 0,void 0,void 0,function(){return ee(this,function(b){switch(b.label){case 0:return i=v,a=y.loggerProvider,o=!0,a.log("Installing event property attribution tracking."),[4,h()];case 1:if(b.sent(),!r)return[2];if(r.addEventListener("popstate",p),!c){if(l=Reflect.get(r.history,"pushState"),u=Reflect.get(r.history,"replaceState"),!l||!u)return[2];d=g(l),r.history.pushState=d,f=g(u),r.history.replaceState=f,c=!0}return[2]}})})},execute:function(y){return te(void 0,void 0,void 0,function(){return ee(this,function(v){return Iue.has(y.event_type)?[2,y]:(y.event_properties=re(re({},s),y.event_properties),[2,y])})})},teardown:function(){return te(void 0,void 0,void 0,function(){var y,v;return ee(this,function(b){return r&&(r.removeEventListener("popstate",p),y=Reflect.get(r.history,"pushState"),v=Reflect.get(r.history,"replaceState"),c&&y===d&&l&&(r.history.pushState=l),c&&v===f&&u&&(r.history.replaceState=u)),o=!1,c=!1,l=void 0,u=void 0,d=void 0,f=void 0,s={},[2]})})}}},g1="AMP_CURRENT_PAGE",y1="AMP_PREVIOUS_PAGE",ed="AMP_URL_INFO",Sh;(function(t){t.Direct="direct",t.Internal="internal",t.External="external"})(Sh||(Sh={}));var kue=new Set([ni.IDENTIFY,ni.GROUP_IDENTIFY,ni.REVENUE]),$ue=function(t){var e={},n=e.internalDomains,r=n===void 0?[]:n,i=He(),a=void 0,s=!1,o=void 0,c=!1,l=!1,u=function(g){var y;try{var v=qa(g,o);y=new URL(v).hostname}catch(b){o?.error("Could not parse URL: ",b)}return y},d=function(g){var y=typeof location<"u"&&location.hostname||"",v=g?u(g):void 0;if(!v)return Sh.Direct;var b=r.some(function(_){return y.indexOf(_)!==-1}),w=r.some(function(_){return v.indexOf(_)!==-1});return y===v||w&&b?Sh.Internal:Sh.External},f=function(){return te(void 0,void 0,void 0,function(){var g,y,v,b,w;return ee(this,function(_){switch(_.label){case 0:return a&&s?[4,a.get(ed)]:[3,3];case 1:return g=_.sent(),y=qa(typeof location<"u"&&location.href||""),v=g?.[g1]||"",b=void 0,y===v?b=g?.[y1]||"":v?b=v:b=document.referrer||"",[4,a.set(ed,(w={},w[g1]=y,w[y1]=b,w))];case 2:_.sent(),_.label=3;case 3:return[2]}})})},h=function(){f()},p={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(g,y){return te(void 0,void 0,void 0,function(){var v,b,w,_,E,C,x,$,T;return ee(this,function(U){switch(U.label){case 0:if(o=g.loggerProvider,o.log("Installing @amplitude/plugin-page-url-enrichment-browser"),l=!0,!i)return[3,7];try{a=new Om(i.sessionStorage)}catch{o?.debug("sessionStorage is not available in this environment.")}return[4,a?.isEnabled()];case 1:return s=(T=U.sent())!==null&&T!==void 0?T:!1,a&&s?(v=typeof document<"u"&&document.referrer||"",b=v?u(v):void 0,w=typeof location<"u"&&location.hostname||"",_=qa(typeof location<"u"&&location.href||""),[4,a.get(ed)]):[3,6];case 2:return E=U.sent(),C=E?.[g1]||"",x=!!b&&b!==w&&C!==_,x?[4,a.set(ed,($={},$[g1]=_,$[y1]=v,$))]:[3,4];case 3:return U.sent(),[3,6];case 4:return[4,f()];case 5:U.sent(),U.label=6;case 6:i.addEventListener("popstate",h),c||(i.history.pushState=new Proxy(i.history.pushState,{apply:function(O,F,k){var S=$e(k,3),I=S[0],A=S[1],R=S[2];O.apply(F,[I,A,R]),l&&h()}}),i.history.replaceState=new Proxy(i.history.replaceState,{apply:function(O,F,k){var S=$e(k,3),I=S[0],A=S[1],R=S[2];O.apply(F,[I,A,R]),l&&h()}}),c=!0),U.label=7;case 7:return[2]}})})},execute:function(g){return te(void 0,void 0,void 0,function(){var y,v,b;return ee(this,function(w){switch(w.label){case 0:return y=qa(typeof location<"u"&&location.href||""),a&&s?[4,a.get(ed)]:[3,2];case 1:if(v=w.sent(),b=v?.[y1]||"",kue.has(g.event_type))return[2,g];g.event_properties=re(re({},g.event_properties||{}),{"[Amplitude] Page Domain":Ef(g,"[Amplitude] Page Domain",typeof location<"u"&&location.hostname||""),"[Amplitude] Page Location":Ef(g,"[Amplitude] Page Location",y),"[Amplitude] Page Path":Ef(g,"[Amplitude] Page Path",typeof location<"u"&&qa(location.pathname)||""),"[Amplitude] Page Title":Ef(g,"[Amplitude] Page Title",NC(MC)),"[Amplitude] Page URL":Ef(g,"[Amplitude] Page URL",y.split("?")[0]),"[Amplitude] Previous Page Location":b,"[Amplitude] Previous Page Type":d(b)}),w.label=2;case 2:return[2,g]}})})},teardown:function(){return te(void 0,void 0,void 0,function(){return ee(this,function(g){switch(g.label){case 0:return i&&(i.removeEventListener("popstate",h),l=!1),a&&s?[4,a.set(ed,{})]:[3,2];case 1:g.sent(),g.label=2;case 2:return[2]}})})}};return p};function Ef(t,e,n){return t.event_properties||(t.event_properties={}),t.event_properties[e]===void 0?n:t.event_properties[e]}var Pue=function(){var t,e,n;function r(s){return typeof s!="object"||s===null?!1:"body"in s&&typeof s.body=="str
36ing"}function i(s){if(s)try{var o=new Function("return "+s)();if(typeof o=="function")return o;t?.error("Custom enrichment body did not evaluate to a function")}catch(c){t?.error("Could not create custom enrichment function",c)}return function(c){return c}}var a={name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(s,o){return te(void 0,void 0,void 0,function(){var c,l;return ee(this,function(u){return t=s.loggerProvider,t?.log("Installing @amplitude/plugin-custom-enrichment-browser"),!((l=s.remoteConfig)===null||l===void 0)&&l.fetchRemoteConfig&&(s.remoteConfigClient?(c=s.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(d){d&&r(d)?n=i(d.body||""):n=i("")}),e=function(){var d;return(d=s.remoteConfigClient)===null||d===void 0?void 0:d.unsubscribe(c)}):t?.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(s){return te(void 0,void 0,void 0,function(){var o;return ee(this,function(c){if(n)try{return[2,(o=n(s))!==null&&o!==void 0?o:null]}catch(l){return t?.error("Could not execute custom enrichment function",l),[2,s]}return[2,s]})})},teardown:function(){return te(void 0,void 0,void 0,function(){return ee(this,function(s){return e&&e(),[2]})})}};return a},ZC="userProperty",KC="eventProperty",Rue=function(t){return t===ZC||t===KC},Oue=[ZC,KC],Mue=function(t){var e=Qe([],$e(new Set((Array.isArray(t)?t:[t]).filter(Rue))),!1);return e.length>0?e:Qe([],$e(Oue),!1)},TU=function(t,e){return Mue(t.trackingMethod).includes(e)},GI=function(t){return TU(t,ZC)},Nue=function(t){return TU(t,KC)},W6=-1,Due=function(t){rs(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n._diagnosticsSampleRate=0,n}return e.prototype.init=function(n,r,i){n===void 0&&(n="");var a,s;return arguments.length>2?(a=r,s=i):typeof r=="string"?(a=r,s=void 0):(a=r?.userId,s=r),ir(this._init(re(re({},s),{userId:a,apiKey:n})))},e.prototype._init=function(n){var r,i,a,s,o,c,l,u;return te(this,void 0,void 0,function(){var d,f,h,p,g,y,v,b,w,_,E,C,x,$,T,U=this;return ee(this,function(O){switch(O.label){case 0:return this.initializing?[2]:(this.initializing=!0,d=Aoe(n),f=(r=n.loggerProvider)!==null&&r!==void 0?r:new f2,n.loggerProvider||f.enable((i=n.logLevel)!==null&&i!==void 0?i:Qr.Warn),h=(a=n.serverZone)!==null&&a!==void 0?a:NF,g=this._diagnosticsSampleRate,y=(s=n.enableDiagnostics)!==null&&s!==void 0?s:!0,d?(p=new sF(n.apiKey,f,h,(o=n.remoteConfig)===null||o===void 0?void 0:o.serverUrl),[4,new Promise(function(F){p?.subscribe("configs.diagnostics.browserSDK","all",function(k,S,I){if(f.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:k,source:S,lastFetch:I},null,2)),k){var A=k.sampleRate;typeof A=="number"&&!isNaN(A)&&(g=A);var R=k.enabled;typeof R=="boolean"&&(y=R)}F()})})]):[3,2]);case 1:O.sent(),O.label=2;case 2:return v=new Pae(n.apiKey,f,h,{enabled:y,sampleRate:g}),v.setTag("library","".concat(RF,"/").concat(jC)),v.setTag("platform",OF),v.setTag("web_environment",Yse()),typeof navigator<"u"&&v.setTag("user_agent",navigator.userAgent),[4,Eoe(n.apiKey,n,this,v,{loggerProvider:f,serverZone:h,enableDiagnostics:y,diagnosticsSampleRate:g})];case 3:return b=O.sent(),d&&p?[4,new Promise(function(F){p?.subscribe("configs.analyticsSDK.browserSDK","all",function(k,S,I){b.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:k,source:S,lastFetch:I},null,2)),k&&Moe(k,b),F()})})]:[3,5];case 4:O.sent(),O.label=5;case 5:return[4,t.prototype._init.call(this,b)];case 6:return O.sent(),this.logBrowserOptions(b),this.config.remoteConfigClient=p,w=Hse(this.config),uw(this.config.defaultTracking)&&GI(w)?(this.config.optOut&&this.timeline.addOptOutListener(function(F){return te(U,void 0,void 0,function(){return ee(this,function(k){switch(k.label){case 0:return F?[3,2]:(this.webAttribution=new KI(w,this.config),[4,this.webAttribution.init()]);case 1:k.sent(),k.label=2;case 2:return[2]}})})}),this.webAttribution=new KI(w,this.config),[4,this.webAttribution.init()]):[3,8];case 7:O.sent(),O.label=8;case 8:return _=Dg(),E=_.ampTimestamp?Number(_.ampTimestamp):void 0,C=E?Date.now()<E:!0,x=C&&!Number.isNaN(Number(_.ampSessionId))?Number(_.ampSessionId):void 0,$=this.config.deferredSessionId,$===W6&&!this.config.optOut&&($=Date.now()),this.setSessionId((u=(l=(c=n.sessionId)!==null&&c!==void 0?c:x)!==null&&l!==void 0?l:$)!==null&&u!==void 0?u:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(F){return te(U,void 0,void 0,function(){return ee(this,function(k){return!F&&this.config.deferredSessionId&&(this.config.deferredSessionId===W6?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),T=gu(n.instanceName),T.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===qae?[3,10]:[4,this.add(Ooe()).promise];case 9:O.sent(),O.label=10;case 10:return[4,this.add(new iae({diagnosticsClient:v})).promise];case 11:return O.sent(),[4,this.add(new Xse).promise];case 12:return O.sent(),[4,this.add(new pae).promise];case 13:return O.sent(),Roe(this.config),Ose(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Poe()).promise]):[3,15];case 14:O.sent(),O.label=15;case 15:return TF(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add($oe()).promise]):[3,17];case 16:O.sent(),O.label=17;case 17:return LF(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(gI(lI(this.config))).promise]):[3,20];case 18:return O.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(F){return te(U,void 0,void 0,function(){return ee(this,function(k){switch(k.label){case 0:return F?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(gI(lI(this.config))).promise]);case 1:return k.sent(),[2]}})})}),O.label=20;case 20:return uw(this.config.defaultTracking)&&Nue(w)?(this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(Lue(w)).promise]):[3,22];case 21:O.sent(),O.label=22;case 22:return $F(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Nle(jse(this.config),{diagnosticsClient:v})).promise]):[3,24];case 23:O.sent(),O.label=24;case 24:return PF(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Yle(Bse(this.config))).promise]):[3,26];case 25:O.sent(),O.label=26;case 26:return kF(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(fue(Vse(this.config))).promise]):[3,28];
36case 27:O.sent(),O.label=28;case 28:return Nse(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(Aue()).promise]):[3,30];case 29:O.sent(),O.label=30;case 30:return Dse(this.config.autocapture)?(this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(iue(Fse(this.config))).promise]):[3,32];case 31:O.sent(),O.label=32;case 32:return Mse(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add($ue()).promise]):[3,34];case 33:O.sent(),O.label=34;case 34:return Use(this.config.customEnrichment)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(Pue()).promise]):[3,36];case 35:O.sent(),O.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return O.sent(),T.eventBridge.setEventReceiver(function(F){var k=F.eventProperties||{},S=k.time,I=au(k,["time"]),A=typeof S=="number"?{time:S}:void 0;U.track(F.eventType,I,A)}),[2]}})})},e.prototype.getUserId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.userId},e.prototype.setUserId=function(n){if(!this.config){this.q.push(this.setUserId.bind(this,n));return}
36this.config.loggerProvider.debug("function setUserId: ",n),(n!==this.config.userId||n===void 0)&&(this.config.userId=n,this.timeline.onIdentityChanged({userId:n}),fae(n,this.config.instanceName))},e.prototype.getDeviceId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.deviceId},e.prototype.setDeviceId=function(n){if(!this.config){this.q.push(this.setDeviceId.bind(this,n));return}this.config.loggerProvider.debug("function setDeviceId: ",n),n!==this.config.deviceId&&(this.config.deviceId=n,this.timeline.onIdentityChanged({deviceId:n}),hae(n,this.config.instanceName))},e.prototype.reset=function(){this.setDeviceId(js()),this.setUserId(void 0),this.timeline.onReset()},e.prototype.getIdentity=function(){var n,r;return{deviceId:(n=this.config)===null||n===void 0?void 0:n.deviceId,userId:(r=this.config)===null||r===void 0?void 0:r.userId,userProperties:this.userProperties}},e.prototype.setIdentity=function(n){var r,i,a;if("userId"in n&&this.setUserId(n.userId),"deviceId"in n&&n.deviceId&&this.setDeviceId(n.deviceId),"userProperties"in n){this.userProperties=n.userProperties;var s=new _h,o=(a=n.userProperties)!==null&&a!==void 0?a:{};try{for(var c=Se(Object.entries(o)),l=c.next();!l.done;l=c.next()){var u=$e(l.value,2),d=u[0],f=u[1];s.set(d,f)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}this.identify(s)}},e.prototype.getOptOut=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.optOut},e.prototype.getSessionId=function(){var n;return(n=this.config)===null||n===void 0?void 0:n.sessionId},e.prototype.setSessionId=function(n){var r,i=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,n)),ir(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=n??W6,ir(Promise.resolve());if(n===void 0&&(n=Date.now()),n===this.config.sessionId)return ir(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",n);var a=this.getSessionId();a!==n&&this.timeline.onSessionIdChanged(n);var s=this.config.lastEventTime,o=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1;this.config.sessionId=n,this.config.lastEventTime=void 0,this.config.pageCounter=0,cI(this.config.defaultTracking)&&(a&&s&&i.push(this.track(fI,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:a,time:s+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var c=this.trackCampaignEventIfNeeded(++o,i);return this.config.identify&&i.push(this.track($C(this.config.identify)).promise),cI(this.config.defaultTracking)&&i.push(this.track(dI,void 0,{event_id:c?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,ir(Promise.all(i))},e.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},e.prototype.setTransport=function(n){if(!this.config){this.q.push(this.setTransport.bind(this,n));return}this.config.transportProvider=UF(n)},e.prototype.identify=function(n,r){if(R6(n)){var i=n._q;n._q=[],n=P6(new _h,i)}return r?.user_id&&this.setUserId(r.user_id),r?.device_id&&this.setDeviceId(r.device_id),t.prototype.identify.call(this,n,r)},e.prototype.groupIdentify=function(n,r,i,a){if(R6(i)){var s=i._q;i._q=[],i=P6(new _h,s)}return t.prototype.groupIdentify.call(this,n,r,i,a)},e.prototype.revenue=function(n,r){if(R6(n)){var i=n._q;n._q=[],n=P6(new Yie,i)}return t.prototype.revenue.call(this,n,r)},e.prototype.trackCampaignEventIfNeeded=function(n,r){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!GI(this.webAttribution.options))return!1;var i=this.webAttribution.generateCampaignEvent(n);return r?r.push(this.track(i).promise):this.track(i),this.config.loggerProvider.log("Tracking attribution."),!0},e.prototype.process=function(n){return te(this,void 0,void 0,function(){var r,i,a;return ee(this,function(s){return r=Date.now(),i=XD(this.config.sessionTimeout,this.config.lastEventTime),a=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),n.event_type!==dI&&n.event_type!==fI&&(!n.session_id||n.session_id===this.getSessionId())&&(i||a?(this.setSessionId(r),a&&this.config.loggerProvider.log("Created a new session for new campaign.")):i||this.trackCampaignEventIfNeeded()),[2,t.prototype.process.call(this,n)]})})},e.prototype.logBrowserOptions=function(n){try{var r=re(re({},n),{apiKey:n.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",ow(r))}catch(i){this.config.loggerProvider.error("Error logging browser config",i)}},e.prototype._setDiagnosticsSampleRate=function(n){if(!(n>1||n<0)&&!this.config){this._diagnosticsSampleRate=n;return}},e}(Gie),LU="[Amplitude]",Fue="".concat(LU," Session Replay ID"),Uue=0,jue=rw.US,Bue={enabled:!0},GC=1e3,Vue="".concat(LU," Session Replay Debug"),Hue="amp-block",kU="amp-mask",$U="amp-unmask",PU="https://api-sr.amplitude.com/sessions/v2/track",RU="https://api-sr.eu.amplitude.com/sessions/v2/track",OU="https://api-sr.stag2.amplitude.com/sessions/v2/track",Wue=2e6,que=6e6,MU=9*1e6,zue=/payload.*exceed/i,Zue=3e4,Kue=6e4,mw=500,vw=10*1e3,Gue=1e3,Yue=10*1e3,ww=1024,Jue=1e3,Xue=64*1024,Que=1e4,YI="X-Session-Replay-Event-Skipped",ede="429",tde="4004",nde="4005",JI=6e4,rde=2*Wue,L3="amplitude-sr-iframe",go;(function(t){t.GET_SR_PROPS="get-sr-props",t.DEBUG_INFO="debug-info",t.FETCH_REQUEST="fetch-request",t.METADATA="metadata",t.TARGETING_DECISION="targeting-decision",t.REPLAY_GATE_DECISION="replay-gate-decision"})(go||(go={}));var bw=function(){function t(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return t.prototype.getSafeMethod=function(e){var n;if(!this.logger)return function(){};var r=this.logger[e];
36if(typeof r=="function"){var i=(n=r.__rrweb_original__)!==null&&n!==void 0?n:r;return i.bind(this.logger)}return function(){}},t.prototype.enable=function(e){this.logger.enable(e)},t.prototype.disable=function(){this.logger.disable()},t}(),YC="medium";function ide(t){return t.toLowerCase()}function ade(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ide(e):null}function Ah(t,e){return e||(t==="STAGING"?OU:t==="EU"?RU:PU)}var NU=function(t,e,n){switch(e){case"light":{if(t!=="input")return!1;var r=n?ade(n):"";return r?!!(["password","hidden","email","tel"].includes(r)||n.autocomplete.startsWith("cc-")):!1}case"medium":return t==="input";case"conservative":return!0;default:return NU(t,YC,n)}},DU=function(t,e){var n,r,i;if(t&&e.urlMaskLevels)try{for(var a=Se(e.urlMaskLevels),s=a.next();!s.done;s=a.next()){var o=s.value;if(UU(o.match).test(t))return o.maskLevel}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return(i=e.defaultMaskLevel)!==null&&i!==void 0?i:YC},FU=function(t,e,n,r){var i,a;if(e===void 0&&(e={defaultMaskLevel:YC}),n){if(n.closest("."+kU))return!0;var s=((i=e.maskSelector)!==null&&i!==void 0?i:[]).some(function(c){return n.closest(c)});if(s)return!0;if(n.closest("."+$U))return!1;var o=((a=e.unmaskSelector)!==null&&a!==void 0?a:[]).some(function(c){return n.closest(c)});if(o)return!1}return NU(t,DU(r,e),n)},XI=function(t,e,n){return function(r,i){return FU(t,e,i,n?.())?r.replace(/[^\s]/g,"*"):r}},sde=function(t,e){return function(n,r,i){var a;if(n==="style"||!((a=t?.maskAttributes)!==null&&a!==void 0?a:[]).includes(n))return r;var s=["INPUT","SELECT","TEXTAREA"].includes(i.tagName)?"input":"text";return FU(s,t,i,e?.())?r.replace(/[^\s]/g,"*"):r}},_w=function(){var t=He();return t?.location?t.location.href:""},ode=function(t,e){return"".concat(e,"/").concat(t)},cde=function(t){if(typeof t!="string"||t.trim()==="")return!1;var e=/^\/|^https?:\/\/[^\s]+$/;return!!e.test(t)},QI=new Map,UU=function(t){var e=QI.get(t);if(e)return e;var n="\0TRAIL\0",r="\0MID\0",i="\0DS\0",a="\0ST\0",s="\0QU\0",o=t;o=o.replace(/\/\*\*$/,n),o=o.replace(/\/\*\*\//g,r),o=o.replace(/\*\*/g,i),o=o.replace(/\*/g,a),o=o.replace(/\?/g,s),o=o.replace(/[.+^${}()|[\]\\]/g,"\\$&"),o=o.split(n).join("(/.*)?"),o=o.split(r).join("/(.*\\/)?"),o=o.split(i).join(".*"),o=o.split(a).join(".*"),o=o.split(s).join(".");var c=new RegExp("^".concat(o,"$"));return QI.set(t,c),c},lde=function(t){if(!t.every(function(e){return typeof e.selector=="string"&&typeof e.replacement=="string"}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!t.every(function(e){return cde(e.selector)}))throw new Error("ugcFilterRules must be an array of objects with valid globs")},jm=function(t,e){var n,r;try{for(var i=Se(e),a=i.next();!a.done;a=i.next()){var s=a.value,o=UU(s.selector);if(o.test(t))return t.replace(o,s.replacement)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},jU=function(){return te(void 0,void 0,void 0,function(){var t,e,n,r,i,a,s;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),t=He(),t?[4,t.navigator.storage.estimate()]:[3,2];case 1:return e=o.sent(),n=e.usage,r=e.quota,i=e.usageDetails,a=n?Math.round(n/ww):0,s=n&&r?Math.round((n/r+Number.EPSILON)*1e3)/1e3:0,[2,{totalStorageSize:a,percentOfQuota:s,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return o.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},BU=function(t){var e=re({},t),n=e.apiKey;return e.apiKey="****".concat(n.substring(n.length-4)),e},VU=function(){return{flushMaxRetries:2,logLevel:Qr.Warn,loggerProvider:new f2,transportProvider:new Rae}},ude=function(t){rs(e,t);function e(n,r){var i=this,a,s,o,c,l,u,d,f,h,p,g,y,v,b,w=VU();i=t.call(this,re(re({transportProvider:w.transportProvider,loggerProvider:new bw(r.loggerProvider||w.loggerProvider)},r),{apiKey:n}))||this,i.flushMaxRetries=r.flushMaxRetries!==void 0&&r.flushMaxRetries<=w.flushMaxRetries?r.flushMaxRetries:w.flushMaxRetries,i.apiKey=n,i.sampleRate=r.sampleRate||Uue,i.serverZone=r.serverZone||jue,i.configServerUrl=r.configServerUrl,i.trackServerUrl=r.trackServerUrl,i.shouldInlineStylesheet=r.shouldInlineStylesheet,i.version=r.version,i.performanceConfig=r.performanceConfig||Bue,
36i.storeType=(a=r.storeType)!==null&&a!==void 0?a:"memory",i.applyBackgroundColorToBlockedElements=(s=r.applyBackgroundColorToBlockedElements)!==null&&s!==void 0?s:!1,i.enableUrlChangePolling=(o=r.enableUrlChangePolling)!==null&&o!==void 0?o:!1,i.urlChangePollingInterval=(c=r.urlChangePollingInterval)!==null&&c!==void 0?c:GC,i.captureDocumentTitle=(l=r.captureDocumentTitle)!==null&&l!==void 0?l:!1,r.fullSnapshotIntervalMs!==void 0&&(i.fullSnapshotIntervalMs=r.fullSnapshotIntervalMs),r.eagerFullSnapshotSend!==void 0&&(i.eagerFullSnapshotSend=r.eagerFullSnapshotSend),i.captureFullSnapshotOnFocus=(u=r.captureFullSnapshotOnFocus)!==null&&u!==void 0?u:!1,r.maxPersistedEventsSizeBytes!==void 0&&(i.maxPersistedEventsSizeBytes=tT(r.maxPersistedEventsSizeBytes,eT,dde,"maxPersistedEventsSizeBytes",i.loggerProvider)),r.maxSingleEventSizeBytes!==void 0&&(i.maxSingleEventSizeBytes=tT(r.maxSingleEventSizeBytes,eT,fde,"maxSingleEventSizeBytes",i.loggerProvider)),i.privacyConfig=re(re({},(d=r.privacyConfig)!==null&&d!==void 0?d:{}),{unmaskSelector:Array.from(new Set(Qe([".".concat($U)],$e((h=(f=r.privacyConfig)===null||f===void 0?void 0:f.unmaskSelector)!==null&&h!==void 0?h:[]),!1)))}),r.interactionConfig&&(i.interactionConfig=r.interactionConfig,i.interactionConfig.ugcFilterRules&&lde(i.interactionConfig.ugcFilterRules)),r.debugMode&&(i.debugMode=r.debugMode);var _=r;return i.useWebWorker=(y=(p=r.useWebWorker)!==null&&p!==void 0?p:(g=_.experimental)===null||g===void 0?void 0:g.useWebWorker)!==null&&y!==void 0?y:!0,i.enableTransportCompression=(v=r.enableTransportCompression)!==null&&v!==void 0?v:!0,i.sendTimeoutMs=r.sendTimeoutMs,i.captureAdoptedStyleSheets=(b=r.captureAdoptedStyleSheets)!==null&&b!==void 0?b:!0,r.crossOriginIframes&&(i.crossOriginIframes=r.crossOriginIframes),r.flushIntervalConfig?i.flushIntervalConfig=hde(r.flushIntervalConfig,i.loggerProvider):i.flushIntervalConfig={minIntervalMs:Gue,maxIntervalMs:Yue},i.handleSendEvents=r.handleSendEvents,i.handleFetchConfig=r.handleFetchConfig,i}return e}(YD),td=100,eT=1e3,dde=8e6,fde=1e7;function tT(t,e,n,r,i){if(!Number.isFinite(t)){i.warn("".concat(r," value is not a finite number (got ").concat(String(t),"); ignoring."));return}return t<e?(i.warn("".concat(r," ").concat(t," is below floor ").concat(e,"; clamping.")),e):t>n?(i.warn("".concat(r," ").concat(t," exceeds ceiling ").concat(n,"; clamping.")),n):t}function hde(t,e){var n,r,i={};if(t.minIntervalMs!==void 0&&(!Number.isFinite(t.minIntervalMs)||t.minIntervalMs<td?(e.warn("flushIntervalConfig.minIntervalMs ".concat(t.minIntervalMs," is below floor ").concat(td,"ms; clamping.")),i.minIntervalMs=td):i.minIntervalMs=t.minIntervalMs),t.maxIntervalMs!==void 0&&(Number.isNaN(t.maxIntervalMs)||t.maxIntervalMs<td?(e.warn("flushIntervalConfig.maxIntervalMs ".concat(t.maxIntervalMs," is below floor ").concat(td,"ms; clamping.")),i.maxIntervalMs=td):i.maxIntervalMs=t.maxIntervalMs),i.minIntervalMs!==void 0||i.maxIntervalMs!==void 0){var a=(n=i.minIntervalMs)!==null&&n!==void 0?n:mw,s=(r=i.maxIntervalMs)!==null&&r!==void 0?r:vw;s<a&&(i.maxIntervalMs===void 0?(e.warn("flushIntervalConfig.minIntervalMs (".concat(a,") exceeds the default maxIntervalMs (").concat(vw,"); raising max to match min.")),i.maxIntervalMs=a):i.minIntervalMs===void 0?(e.warn("flushIntervalConfig.maxIntervalMs (".concat(s,") is below the default minIntervalMs (").concat(mw,"); lowering min to match max.")),i.minIntervalMs=s):(e.warn("flushIntervalConfig.maxIntervalMs (".concat(i.maxIntervalMs,") is less than minIntervalMs (").concat(i.minIntervalMs,"); raising max to match min.")),i.maxIntervalMs=i.minIntervalMs))}return i}var Bm=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Bm||{}),JC=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(JC||{}),HU=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(HU||{}),pde=1500,gde=function(t,e){var n=document.createDocumentFragment(),r=function(i){if(i===void 0&&(i=[]),typeof i=="string"&&(i=[i]),i=i.filter(function(a){try{n.querySelector(a)}catch{return e.warn('[session-replay-browser] omitting selector "'.concat(a,'" because it is invali
36d')),!1}return!0}),i.length!==0)return i};return t.blockSelector=r(t.blockSelector),t.maskSelector=r(t.maskSelector),t.unmaskSelector=r(t.unmaskSelector),t},yde=function(){function t(e,n){this.localConfig=n,this.remoteConfigClient=e}return t.prototype.generateJoinedConfig=function(){var e,n,r,i,a,s,o;return te(this,void 0,void 0,function(){var c,l,u,d,f,h,p,g,y,v,b,w,_,E,C,x,$,T=this;return ee(this,function(U){switch(U.label){case 0:c=re({},this.localConfig),c.optOut=this.localConfig.optOut,c.captureEnabled=!0,U.label=1;case 1:return U.trys.push([1,3,,4]),[4,new Promise(function(O,F){T.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:pde},function(k,S){var I;if(T.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(S,":"),JSON.stringify(k,null,2)),!k){F(new Error("No remote config received"));return}var A=k,R=A.sr_sampling_config,N=A.sr_privacy_config,P=A.sr_targeting_config,j=(I=c.interactionConfig)===null||I===void 0?void 0:I.ugcFilterRules;c.interactionConfig=A.sr_interaction_config,c.interactionConfig&&j&&(c.interactionConfig.ugcFilterRules=j),c.loggingConfig=A.sr_logging_config,(R||N||P)&&(l={},R&&(l.sr_sampling_config=R),N&&(l.sr_privacy_config=N),P&&(l.sr_targeting_config=P)),O()})})];case 2:return U.sent(),[3,4];case 3:return u=U.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",u),c.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:c,remoteConfig:void 0}];case 4:if(!l)return[2,{localConfig:this.localConfig,joinedConfig:c,remoteConfig:l}];if(d=l.sr_sampling_config,f=l.sr_privacy_config,h=l.sr_targeting_config,d&&Object.keys(d).length>0?(Object.prototype.hasOwnProperty.call(d,"capture_enabled")?c.captureEnabled=d.capture_enabled:c.captureEnabled=!1,Object.prototype.hasOwnProperty.call(d,"sample_rate")&&(c.sampleRate=d.sample_rate),Object.prototype.hasOwnProperty.call(d,"min_session_duration_ms")&&(c.minSessionDurationMs=this.sanitizeMinSessionDurationMs(d.min_session_duration_ms))):(c.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),f){p=(e=c.privacyConfig)!==null&&e!==void 0?e:{},g={defaultMaskLevel:(r=(n=f.defaultMaskLevel)!==null&&n!==void 0?n:p.defaultMaskLevel)!==null&&r!==void 0?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:Qe([],$e(new Set(Qe(Qe([],$e((i=p.maskAttributes)!==null&&i!==void 0?i:[]),!1),$e((a=f.maskAttributes)!==null&&a!==void 0?a:[]),!1))),!1),urlMaskLevels:Qe(Qe([],$e((s=f.urlMaskLevels)!==null&&s!==void 0?s:[]),!1),$e((o=p.urlMaskLevels)!==null&&o!==void 0?o:[]),!1)},y=function(O){var F,k,S,I,A,R,N,P,j,M={};typeof O.blockSelector=="string"&&(O.blockSelector=[O.blockSelector]);try{for(var V=Se((N=O.blockSelector)!==null&&N!==void 0?N:[]),B=V.next();!B.done;B=V.next()){var G=B.value;M[G]="block"}}catch(J){F={error:J}}finally{try{B&&!B.done&&(k=V.return)&&k.call(V)}finally{if(F)throw F.error}}try{for(var Z=Se((P=O.maskSelector)!==null&&P!==void 0?P:[]),ie=Z.next();!ie.done;ie=Z.next()){var G=ie.value;M[G]="mask"}}catch(J){S={error:J}}finally{try{ie&&!ie.done&&(I=Z.return)&&I.call(Z)}finally{if(S)throw S.error}}try{for(var oe=Se((j=O.unmaskSelector)!==null&&j!==void 0?j:[]),z=oe.next();!z.done;z=oe.next()){var G=z.value;M[G]="unmask"}}catch(J){A={error:J}}finally{try{z&&!z.done&&(R=oe.return)&&R.call(oe)}finally{if(A)throw A.error}}return M},v=re(re({},y(p)),y(f));try{for(b=Se(Object.entries(v)),w=b.next();!w.done;w=b.next())_=$e(w.value,2),E=_[0],C=_[1],C==="mask"?g.maskSelector.push(E):C==="block"?g.blockSelector.push(E):C==="unmask"&&g.unmaskSelector.push(E)}catch(O){x={error:O}}finally{try{w&&!w.done&&($=b.return)&&$.call(b)}finally{if(x)throw x.error}}c.privacyConfig=gde(g,this.localConfig.loggerProvider)}return h&&Object.keys(h).length>0&&(c.targetingConfig=h),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:BU(c)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:c,remoteConfig:l}]}})})},t.prototype.sanitizeMinSessionDurationMs=function(e){if(typeof e!="number"||!Number.isFinite(e)){this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is not a finite number (got ".concat(String(e),"); ignoring."));return}if(e<0){this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is negative (".concat(e,"); ignoring."));return}return e>q6?(this.localConfig.loggerProvider.warn("min_session_duration_ms remote value ".concat(e," exceeds ").concat(q6,"ms ceiling; clamping.")),q6):e},t}(),q6=6e4,mde=function(t,e){return te(void 0,void 0,void 0,function(){var n,r;return ee(this,function(i){return n=new ude(t,e),r=new sF(t,n.loggerProvider,n.serverZone,e.configServerUrl,e.handleFetchConfig),[2,new yde(r,n)]})})};function nT(t){if(t.type!==Bm.IncrementalSnapshot)return!1;var e=t.data;return e.source===JC.Mutation&&!e.isAttachIframe}function vde(t){return typeof t=="object"&&t!==null}function wde(t){var e,n,r,i,a={};try{for(var s=Se(t),o=s.next();!o.done;o=s.next()){var c=o.value;try{for(var l=(r=void 0,Se(Object.keys(c))),u=l.next();!u.done;u=l.next()){var d=u.value;a[d]=c[d]}}catch(f){r={error:f}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a}function bde(t){var e,n,r=new Map;if(t.forEach(function(f,h){if(f.attributes&&"style"in f.attributes){var p=r.get(f.id);p?p.push(h):r.set(f.id,[h])}}),r.size===0)return t;var i=function(f){return t[f].attributes.style},a=new Set,s=new Map,o=function(f){if(f.length===1)return"continue";var h=-1;f.forEach(function(v,b){vde(i(v))||(h=b)});var p=[];
36if(f.forEach(function(v,b){b!==h&&(a.add(v),b>h&&p.push(v))}),p.length>0){var g=p[p.length-1],y=wde(p.map(function(v){return i(v)}));a.delete(g),s.set(g,y)}};try{for(var c=Se(r.values()),l=c.next();!l.done;l=c.next()){var u=l.value;o(u)}}catch(f){e={error:f}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(a.size===0&&s.size===0)return t;var d=[];return t.forEach(function(f,h){var p=s.get(h);if(p!==void 0){d.push(re(re({},f),{attributes:re(re({},f.attributes),{style:p})}));return}if(!a.has(h)){d.push(f);return}var g=re({},f.attributes);delete g.style,Object.keys(g).length>0&&d.push(re(re({},f),{attributes:g}))}),d}function _de(t){var e,n,r,i,a=t[0],s=new Map,o=new Map,c=new Map,l=new Map,u=new Map;t.forEach(function(M,V){var B,G,Z,ie,oe=M.data;try{for(var z=Se(oe.adds),J=z.next();!J.done;J=z.next()){var K=J.value;s.has(K.node.id)||s.set(K.node.id,V),o.set(K.node.id,V),u.set(K.node.id,K.parentId)}}catch(ke){B={error:ke}}finally{try{J&&!J.done&&(G=z.return)&&G.call(z)}finally{if(B)throw B.error}}try{for(var ne=Se(oe.removes),ce=ne.next();!ce.done;ce=ne.next()){var xe=ce.value;c.has(xe.id)||c.set(xe.id,V),l.set(xe.id,V)}}catch(ke){Z={error:ke}}finally{try{ce&&!ce.done&&(ie=ne.return)&&ie.call(ne)}finally{if(Z)throw Z.error}}});var d=new Set,f=new Set;try{for(var h=Se(s),p=h.next();!p.done;p=h.next()){var g=$e(p.value,2),y=g[0],v=g[1],b=c.get(y);if(b!==void 0){var w=o.get(y),_=l.get(y);w>=_||(v<b?d.add(y):b<v&&f.add(y))}}}catch(M){e={error:M}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}var E=new Set;if(d.size>0||f.size>0)for(var C=!0;C;){C=!1;try{for(var x=(r=void 0,Se(u)),$=x.next();!$.done;$=x.next()){var T=$e($.value,2),U=T[0],O=T[1];if(!d.has(U)&&!f.has(U)&&!E.has(U)&&(d.has(O)||f.has(O)||E.has(O))){var F=c.get(U),k=s.get(U);F!==void 0&&k!==void 0&&F<k?f.add(U):F!==void 0&&k!==void 0&&F===k?E.add(U):d.add(U),C=!0}}}catch(M){r={error:M}}finally{try{$&&!$.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}}var S=d.size>0||f.size>0||E.size>0,I=[];t.forEach(function(M,V){var B,G;try{for(var Z=Se(M.data.removes),ie=Z.next();!ie.done;ie=Z.next()){var oe=ie.value;d.has(oe.id)||f.has(oe.id)&&V>=s.get(oe.id)||E.has(oe.id)&&(d.has(oe.parentId)||f.has(oe.parentId)||E.has(oe.parentId))||I.push(oe)}}catch(z){B={error:z}}finally{try{ie&&!ie.done&&(G=Z.return)&&G.call(Z)}finally{if(B)throw B.error}}});var A=t.flatMap(function(M){return M.data.adds}),R=t.flatMap(function(M){return M.data.texts}),N=t.flatMap(function(M){return M.data.attributes}),P=S?N.filter(function(M){return!d.has(M.id)&&!f.has(M.id)&&!E.has(M.id)}):N,j={source:JC.Mutation,removes:I,adds:S?A.filter(function(M){return!d.has(M.node.id)&&!f.has(M.node.id)&&!E.has(M.node.id)}):A,texts:S?R.filter(function(M){return!d.has(M.id)&&!f.has(M.id)&&!E.has(M.id)}):R,attributes:bde(P)};return re(re({},a),{data:j})}function Cde(t){if(t.length<=1)return t;for(var e=[],n=0;n<t.length;){if(!nT(t[n])){e.push(t[n]),n++;continue}for(var r=n+1;r<t.length&&nT(t[r]);)r++;e.push(r>n+1?_de(t.slice(n,r)):t[n]),n=r}return e}var Ede=2e3,Sde=function(){function t(e,n,r,i,a){var s=this,o;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(f){var h=f,p=h.type,g=h.timestamp,y=h.delay,v=h.data;return y!=null?JSON.stringify({type:p,timestamp:g,delay:y,data:v}):JSON.stringify({type:p,timestamp:g,data:v})},this.addCompressedEventToManager=function(f,h){var p,g=new Blob([f]).size;if(g>((p=s.config.maxSingleEventSizeBytes)!==null&&p!==void 0?p:MU)){s.config.loggerProvider.warn("Session replay event dropped: serialized size ".concat(Math.round(g/1024)," KB exceeds maximum allowed event size. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support."));return}s.eventsManager&&s.deviceId&&s.eventsManager.addEvent({event:{type:"replay",data:f},sessionId:h,deviceId:s.deviceId})},this.addCompressedEvent=function(f,h){if(s.worker)try{s.worker.postMessage({event:f,sessionId:h})}catch(g){g.name==="DataCloneError"?s.worker.postMessage(JSON.stringify({event:f,sessionId:h}
36)):s.config.loggerProvider.warn("Unexpected error while posting message to worker:",g)}else{var p=s.compressEvent(f);s.addCompressedEventToManager(p,h)}},this.flushQueue=function(){var f;for(s.pendingQueue.length>0&&(f=s.taskQueue).push.apply(f,Qe([],$e(s.mergeMutationTasks(s.pendingQueue.splice(0))),!1));s.taskQueue.length>0;){var h=s.taskQueue.shift();if(h){var p=h.event,g=h.sessionId,y=s.compressEvent(p);s.addCompressedEventToManager(y,g)}}s.isProcessing=!1},this.terminate=function(){var f;(f=s.worker)===null||f===void 0||f.terminate()};var c=He();if(this.canUseIdleCallback=c&&"requestIdleCallback"in c,this.eventsManager=e,this.config=n,this.deviceId=r,this.timeout=((o=n.performanceConfig)===null||o===void 0?void 0:o.timeout)||Ede,this.onFullSnapshotProcessed=a,i){n.loggerProvider.log("Enabling web worker for compression");try{var l=new Blob([i],{type:"application/javascript"}),u=URL.createObjectURL(l),d=new Worker(u);d.onerror=function(f){f.preventDefault(),n.loggerProvider.error("Worker failed, falling back to non-worker compression: ".concat(f.message," (").concat(f.filename,":").concat(f.lineno,")")),d.terminate(),s.worker=void 0},d.onmessage=function(f){var h=f.data,p=h.compressedEvent,g=h.sessionId;s.addCompressedEventToManager(p,g)},this.worker=d}catch(f){n.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",f)}}}return t.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(n){e.processQueue(n)},{timeout:this.timeout}))},t.prototype.enqueueEvent=function(e,n){var r,i,a,s;if(e.type===Bm.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var o=Qe(Qe([],$e(this.taskQueue.splice(0)),!1),$e(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var c=Se(o),l=c.next();!l.done;l=c.next()){var u=l.value,d=this.compressEvent(u.event);this.addCompressedEventToManager(d,u.sessionId)}}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}this.isProcessing=!1}var f=this.compressEvent(e);this.addCompressedEventToManager(f,n),(a=this.onFullSnapshotProcessed)===null||a===void 0||a.call(this);return}this.canUseIdleCallback&&(!((s=this.config.performanceConfig)===null||s===void 0)&&s.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.pendingQueue.push({event:e,sessionId:n}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,n))},t.prototype.processQueue=function(e){var n,r=this;for(this.pendingQueue.length>0&&(n=this.taskQueue).push.apply(n,Qe([],$e(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var i=this.taskQueue.shift();if(i){var a=i.event,s=i.sessionId;this.addCompressedEvent(a,s)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(function(o){r.processQueue(o)},{timeout:this.timeout}):this.isProcessing=!1},t.prototype.mergeMutationTasks=function(e){var n,r,i;if(((i=this.config.performanceConfig)===null||i===void 0?void 0:i.mergeMutations)===!1||e.length<=1)return e;for(var a=[],s=0;s<e.length;){for(var o=e[s].sessionId,c=s+1;c<e.length&&e[c].sessionId===o;)c++;var l=Cde(e.slice(s,c).map(function(h){return h.event}));try{for(var u=(n=void 0,Se(l)),d=u.next();!d.done;d=u.next()){var f=d.value;a.push({event:f,sessionId:o})}}catch(h){n={error:h}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}s=c}return a},t}(),Ade="Unexpected error occurred",xde="Network error occurred, event batch rejected",rT="Session replay event batch rejected due to exceeded retry count",aa="Failed to store session replay events in IndexedDB",Ide="Session replay event batch not sent due to missing device ID",Tde="Session replay event batch not sent due to missing api key",z6="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",Wg="1.49.0";function Lde(t,e){return te(this,void 0,void 0,function(){var n,r,i,a,s,o,c,l,u,d,f,h,p,g,y=this;return ee(this,function(v){switch(v.label){case 0:return v.trys.push([0,4,,5]),n=e.CompressionStream,r=new n("gzip"),i=r.writable.getWriter(),a=r.readable.getReader(),s=[],o=function(){return te(y,void 0,void 0,function(){var b,w,_;return ee(this,function(E){switch(E.label){case 0:return[4,a.read()];case 1:if(b=E.sent(),w=b.done,_=b.value,w)return[3,3];s.push(_),E.label=2;case 2:return[3,0];case 3:return[2]}})})}(),[4,i.write(new TextEncoder().encode(t))];case 1:return v.sent(),[4,i.close()];case 2:return v.sent(),[4,o];case 3:v.sent(),c=s.reduce(function(b,w){return b+w.length},0),l=new Uint8Array(c),u=0;try{for(d=Se(s),f=d.next();!f.done;f=d.next())h=f.value,l.set(h,u),u+=h.length}catch(b){p={error:b}}finally{try{f&&!f.done&&(g=d.return)&&g.call(d)}finally{if(p)throw p.error}}return[2,l];case 4:return v.sent(),[2,null];case 5:return[2]}})})}var kde=256,$de=256;function Pde(t,e){return new Promise(function(n,r){var i=function(){var a=new Error("Custom session replay transport aborted by send timeout");a.name="AbortError",r(a)};e.addEventListener("abort",i,{once:!0}),t.then(function(a){e.removeEventListener("abort",i),n(a)},function(a){e.removeEventListener("abort",i),r(a)})})}var Rde=function(){function t(e){var n=e.trackServerUrl,r=e.loggerProvider,i=e.payloadBatcher,a=e.workerScript,s=e.enableTransportCompression,o=e.sendTimeoutMs,c=e.handleSendEvents,l=this;if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.timedOutWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=r,this.payloadBatcher=i||function(h){return h},this.trackServerUrl=n,this.enableTransportCompression=s??!0,this.sendTimeoutMs=o??Que,this.handleSendEvents=c,a)try{var u=new Blob([a],{type:"application/javascript"}),d=URL.createObjectURL(u),f=new Worker(d);f.onerror=function(h){var p,g;h.preventDefault(),r.error("Track destination worker failed, falling back to main-thread sending: ".concat(h.message," (").concat(h.filename,":").concat(h.lineno,")")),f.terminate(),l.worker=void 0;try{for(var y=Se(l.pendingWorkerRequests),v=y.next();!v.done;v=y.next()){var b=$e(v.value,2),w=b[1];w.timeout&&clearTimeout(w.timeout),r.warn("Session replay event send failed due to worker crash: ".concat(h.message)),w.resolve()}}catch(_){p={error:_}}finally{try{v&&!v.done&&(g=y.return)&&g.call(y)}finally{if(p)throw p.error}}l.pendingWorkerRequests.clear(),l.timedOutWorkerRequests.clear()},f.onmessage=function(h){var p=h.data;if(p.type==="log")r.log(p.message);else if(p.type==="warn")r.warn(p.message);else if(p.type==="payload_too_large"){var g=l.pendingWorkerRequests.get(p.id);if(g)g.timeout&&clearTimeout(g.timeout),l.handlePayloadTooLargeResponse(g.context,p.isWaf),g.resolve(),l.pendingWorkerRequests.delete(p.id);else{var y=l.timedOutWorkerRequests.get(p.id);y&&(l.timedOutWorkerRequests.delete(p.id),l.handlePayloadTooLargeResponse(y,p.isWaf))}}else if(p.type==="complete"){var v=l.pendingWorkerRequests.get(p.id);if(v)v.timeout&&clearTimeout(v.timeout),p.skipCode!==void 0&&l.applyServerDirective(v.context.sessionId,p.skipCode),l.completeRequest({context:v.context}),v.resolve(),l.pendingWorkerRequests.delete(p.id);else{var y=l.timedOutWorkerRequests.get(p.id);y&&(l.timedOutWorkerRequests.delete(p.id),p.skipCode!==void 0&&l.applyServerDirective(y.sessionId,p.skipCode),l.completeRequest({context:y}))}}else p.type==="fetch-request"&&l.handleDelegatedFetch(f,p).catch(function(b){r.warn("Failed to handle delegated session replay fetch:",b)})},this.worker=f}catch(h){r.error("Failed to create track destination worker, falling back to main-thread sending:",h)}}return t.prototype.sendEventsList=function(e){this.addToQueue(re(re({},e),{attempts:0,timeout:0}))},t.prototype.markCoalesceNextFlush=function(){this.coalesceNextFlush=!0,this.schedule(0)},t.prototype.sendBeacon=function(e){var n=this,r,i,a=e.events,s=e.sessionId,o=e.deviceId,c=e.apiKey,l=e.serverZone,u=64*1024,d=function(T){return new Blob([T]).size},f=a,h=JSON.stringify({version:2,events:f});if(d(h)>u){for(var p=0,g=f.length;p<g;){var y=Math.floor((p+g+1)/2);d(JSON.stringify({version:2,events:f.slice(0,y)}))<=u?p=y:g=y-1}f=f.slice(0,p),h=JSON.stringify({version:2,events:f}),this.loggerProvider.warn("sendBeacon payload exceeded 64 KB limit, trimmed from ".concat(a.length," to ").concat(f.length," events"))}if(f.length!==0){if(this.handleSendEvents){var v=new URLSearchParams({device_id:o,session_id:String(s),type:"replay"}),b="".concat(Ah(l,this.trackServerUrl),"?").concat(v.toString()),w={"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(c)};this.loggerProvider.debug("Routing session replay exit batch (".concat(f.length," events) through custom transport for session id ").concat(s,"."));try{this.handleSendEvents({url:b,method:"POST",headers:w,body:h,keepalive:!0}
36).catch(function(T){n.loggerProvider.warn("Custom transport failed to send session replay exit batch:",T)})}catch(T){this.loggerProvider.warn("Custom transport threw while sending session replay exit batch:",T)}return}var _=new URLSearchParams({device_id:o,session_id:String(s),type:"replay",api_key:c}),E="".concat(Ah(l,this.trackServerUrl),"?").concat(_.toString()),C=He();try{var x=new Blob([h],{type:"application/json"}),$=(i=(r=C?.navigator)===null||r===void 0?void 0:r.sendBeacon)===null||i===void 0?void 0:i.call(r,E,x);$===!1&&this.loggerProvider.warn("sendBeacon failed to queue session replay payload")}catch{}}},t.prototype.addToQueue=function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.filter(function(a){return e.killedSessions.has(a.sessionId)?(e.completeRequest({context:a,err:z6}),!1):a.attempts<(a.flushMaxRetries||0)?(a.attempts+=1,!0):(e.completeRequest({context:a,err:rT}),!1)});i.forEach(function(a){e.queue=e.queue.concat(a),e.schedule(0)})},t.prototype.schedule=function(e){var n=this;if(!this.scheduled){var r=this.flushPauseUntilMs-Date.now(),i=r>0,a=r>e?r:e;i&&(this.mergeOnNextFlush=!0),this.scheduled=setTimeout(function(){n.flush(!0).then(function(){n.queue.length>0&&n.schedule(e)})},a)}},t.prototype.flush=function(e){return e===void 0&&(e=!1),te(this,void 0,void 0,function(){var n,r,i,a,s,o,c;return ee(this,function(l){switch(l.label){case 0:n=this.queue,this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),this.mergeOnNextFlush?(this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,n=this.mergeQueueAfterThrottle(n)):this.coalesceNextFlush&&(this.coalesceNextFlush=!1,n=this.mergeDrainBacklog(n)),l.label=1;case 1:l.trys.push([1,6,7,8]),r=Se(n),i=r.next(),l.label=2;case 2:return i.done?[3,5]:(a=i.value,[4,this.send(a,e)]);case 3:l.sent(),l.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return s=l.sent(),o={error:s},[3,8];case 7:try{i&&!i.done&&(c=r.return)&&c.call(r)}finally{if(o)throw o.error}return[7];case 8:return[2]}})})},t.prototype.mergeQueueAfterThrottle=function(e){var n=this.coalesceByIdentity(e);return n.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log("Session replay throttle pause ended; merged ".concat(e.length," queued batches into ").concat(n.length," request(s)"))),n},t.prototype.mergeDrainBacklog=function(e){var n=this.coalesceByIdentity(e);return n.length<e.length&&this.loggerProvider.log("Session replay coalesced ".concat(e.length," persisted page-load backlog batches into ").concat(n.length," request(s)")),n},t.prototype.coalesceByIdentity=function(e){var n,r,i,a,s=this,o,c,l,u,d,f,h;if(e.length<=1)return e;var p=new Map;try{for(var g=Se(e),y=g.next();!y.done;y=g.next()){var v=y.value,b=[v.sessionId,(o=v.deviceId)!==null&&o!==void 0?o:"",(c=v.apiKey)!==null&&c!==void 0?c:"",v.type,(l=v.serverZone)!==null&&l!==void 0?l:"",v.sampleRate,(d=(u=v.version)===null||u===void 0?void 0:u.type)!==null&&d!==void 0?d:"",(h=(f=v.version)===null||f===void 0?void 0:f.version)!==null&&h!==void 0?h:""].join("|"),w=p.get(b);w?w.push(v):p.set(b,[v])}}catch(T){n={error:T}}finally{try{y&&!y.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}var _=[],E=function(T){var U,O;if(T.length===1)return _.push(T[0]),"continue";var F=null,k=0,S=function(){F&&_.push(F),F=null,k=0},I=function(P){var j=P.events.reduce(function(B,G){return B+new Blob([G]).size},0);if(F===null)return F=re(re({},P),{events:Qe([],$e(P.events),!1),attempts:0}),k=j,"continue";if(k+j>rde)return S(),F=re(re({},P),{events:Qe([],$e(P.events),!1),attempts:0}),k=j,"continue";var M=F.onComplete,V=P.onComplete;F.events=F.events.concat(P.events),k+=j,F.onComplete=function(){return te(s,void 0,void 0,function(){return ee(this,function(B){switch(B.label){case 0:return[4,Promise.allSettled([M(),V()])];case 1:return B.sent(),[2]}})})}};try{for(var A=(U=void 0,Se(T)),R=A.next();!R.done;R=A.next()){var N=R.value;I(N)}}catch(P){U={error:P}}finally{try{R&&!R.done&&(O=A.return)&&O.call(A)}finally{if(U)throw U.error}}S()};try{for(var C=Se(p.values()),x=C.next();!x.done;x=C.next()){var $=x.value;E($)}}catch(T){i={error:T}}finally{try{x&&!x.done&&(a=C.return)&&a.call(C)}finally{if(i)throw i.error}}return _},t.prototype.send=function(e,n){return n===void 0&&(n=!0),te(this,void 0,void 0,function(){var r,i,a,s;return ee(this,function(o){return this.killedSessions.has(e.sessionId)?[2,this.completeRequest({context:e,err:z6})]:(r=e.apiKey,r?(i=e.deviceId,i?(a=this.payloadBatcher({version:1,events:e.events}),a.events.length===0?(this.completeRequest({context:e}),[2]):(s=this.worker,s?[2,this.sendViaWorker(s,e,a,n)]:[2,this.sendOnMainThread(r,i,e,a,n)])):[2,this.completeRequest({context:e,err:Ide})]):[2,this.completeRequest({context:e,err:Tde})])})})},t.prototype.sendViaWorker=function(e,n,r,i){return te(this,void 0,void 0,function(){var a,s=this;return ee(this,function(o){return a="".concat(++this.sendIdCounter),[2,new Promise(function(c){var l,u=s.sendTimeoutMs>0?setTimeout(function(){var d=s.pendingWorkerRequests.get(a);
36d&&(s.pendingWorkerRequests.delete(a),s.rememberTimedOutRequest(a,d.context),s.loggerProvider.warn("Session replay worker send timed out after ".concat(s.sendTimeoutMs,"ms; leaving events for retry")),d.resolve())},s.sendTimeoutMs):void 0;s.pendingWorkerRequests.set(a,{context:n,resolve:c,timeout:u}),e.postMessage({type:"send",id:a,payload:r,useRetry:i,useCustomTransport:!!s.handleSendEvents,context:{apiKey:n.apiKey,deviceId:n.deviceId,sessionId:n.sessionId,events:n.events,eventType:n.type,flushMaxRetries:(l=n.flushMaxRetries)!==null&&l!==void 0?l:0,sampleRate:n.sampleRate,serverZone:n.serverZone,trackServerUrl:s.trackServerUrl,version:n.version,currentUrl:_w(),sdkVersion:Wg,enableTransportCompression:s.enableTransportCompression,sendTimeoutMs:s.sendTimeoutMs}})})]})})},t.prototype.rememberTimedOutRequest=function(e,n){var r,i;if(this.timedOutWorkerRequests.set(e,n),this.timedOutWorkerRequests.size>$de)try{for(var a=Se(this.timedOutWorkerRequests.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;this.timedOutWorkerRequests.delete(o);break}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},t.prototype.handleDelegatedFetch=function(e,n){var r,i,a;return te(this,void 0,void 0,function(){var s,o,c,l,u,d,f,h,p,g,y;return ee(this,function(v){switch(v.label){case 0:s=n.requestId,o=n.url,c=n.method,l=n.headers,u=n.body,d=n.keepalive,v.label=1;case 1:return v.trys.push([1,10,,11]),f=void 0,this.handleSendEvents?[4,this.handleSendEvents({url:o,method:c,headers:l,body:u,keepalive:d})]:[3,3];case 2:return f=v.sent(),[3,5];case 3:return this.loggerProvider.warn("Delegated session replay fetch received without a custom transport configured; falling back to built-in fetch."),[4,fetch(o,{method:c,headers:l,body:u,keepalive:d})];case 4:f=v.sent(),v.label=5;case 5:if(h=f.status,p=null,g="",h>=200&&h<300&&(p=(a=(i=(r=f.headers)===null||r===void 0?void 0:r.get)===null||i===void 0?void 0:i.call(r,YI))!==null&&a!==void 0?a:null),h!==413)return[3,9];v.label=6;case 6:return v.trys.push([6,8,,9]),[4,f.text()];case 7:return g=v.sent(),[3,9];case 8:return v.sent(),[3,9];case 9:return this.loggerProvider.debug("Delegated session replay fetch (request ".concat(s,") returned status ").concat(h,".")),e.postMessage({type:"fetch-response",requestId:s,status:h,skipHeader:p,body:g}),[3,11];case 10:return y=v.sent(),this.loggerProvider.debug("Delegated session replay fetch (request ".concat(s,") failed:"),y),e.postMessage({type:"fetch-response",requestId:s,status:0,skipHeader:null,body:String(y),error:!0}),[3,11];case 11:return[2]}})})},t.prototype.sendOnMainThread=function(e,n,r,i,a){var s,o,c,l,u,d,f;return te(this,void 0,void 0,function(){var h,p,g,y,v,b,w,_,E,C,x,$,T,U,O,F,k,S,I,A,R,R,N,P;return ee(this,function(j){switch(j.label){case 0:h=_w(),p=Wg,g=r.sampleRate,y=new URLSearchParams({device_id:n,session_id:"".concat(r.sessionId),type:"".concat(r.type)}),v="".concat((o=(s=r.version)===null||s===void 0?void 0:s.type)!==null&&o!==void 0?o:"standalone","/").concat((l=(c=r.version)===null||c===void 0?void 0:c.version)!==null&&l!==void 0?l:p),j.label=1;case 1:return j.trys.push([1,19,,23]),b=JSON.stringify(i),w=He(),this.enableTransportCompression&&w&&"CompressionStream"in w?[4,Lde(b,w)]:[3,3];case 2:return E=j.sent(),[3,4];case 3:E=null,j.label=4;case 4:if(_=E,C=_?_.byteLength:new Blob([b]).size,x=new AbortController,$=re({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":p,"X-Client-Library":v,"X-Client-Url":h.substring(0,Jue),"X-Client-Sample-Rate":"".concat(g),"X-Sampling-Hash-Alg":"xxhash32"},_?{"Content-Encoding":"gzip"}:{}),T=_??b,U=C<=Xue,O={headers:$,body:T,method:"POST",keepalive:U,signal:x.signal},F="".concat(Ah(r.serverZone,this.trackServerUrl),"?").concat(y.toString()),i.events.length===0)return this.completeRequest({context:r}),[2];k=this.sendTimeoutMs>0?setTimeout(function(){x.abort()},this.sendTimeoutMs):void 0,S=void 0,j.label=5;case 5:return j.trys.push([5,,10,11]),this.handleSendEvents?[4,Pde(this.handleSendEvents({url:F,method:"POST",headers:$,body:T,keepalive:U}),x.signal)]:[3,7];case 6:return I=j.sent(),[3,9];case 7:return[4,fetch(F,O)];case 8:I=j.sent(),j.label=9;case 9:return S=I,[3,11];case 10:return k&&clearTimeout(k),[7];case 11:if(S===null)return this.completeRequest({context:r,err:Ade}),[2];if(S.status>=200&&S.status<300&&(A=(f=(d=(u=S.headers)===null||u===void 0?void 0:u.get)===null||d===void 0?void 0:d.call(u,YI))!==null&&f!==void 0?f:null,this.applyServerDirective(r.sessionId,A)),a)return[3,12];R="";try{R=JSON.stringify(S.body,null,2)}catch{}return this.completeRequest({context:r,success:"".concat(S.status,": ").concat(R)}),[3,18];
36case 12:if(R="",S.status!==413)return[3,16];j.label=13;case 13:return j.trys.push([13,15,,16]),[4,S.text()];case 14:return R=j.sent(),[3,16];case 15:return j.sent(),[3,16];case 16:return[4,this.handleReponse(S.status,r,R)];case 17:j.sent(),j.label=18;case 18:return[3,23];case 19:return N=j.sent(),P=!!N&&typeof N=="object"&&N.name==="AbortError",P&&a?[4,this.handleOtherResponse(r)]:[3,21];case 20:return j.sent(),[3,22];case 21:this.completeRequest({context:r,err:N}),j.label=22;case 22:return[3,23];case 23:return[2]}})})},t.prototype.handleReponse=function(e,n,r){return r===void 0&&(r=""),te(this,void 0,void 0,function(){var i,a;return ee(this,function(s){switch(s.label){case 0:switch(i=new a0().buildStatus(e),a=i,a){case cn.Success:return[3,1];case cn.Failed:return[3,2];case cn.Timeout:return[3,2];case cn.RateLimit:return[3,2];case cn.PayloadTooLarge:return[3,4]}return[3,5];case 1:return this.handleSuccessResponse(n),[3,8];case 2:return[4,this.handleOtherResponse(n)];case 3:return s.sent(),[3,8];case 4:return this.handlePayloadTooLargeResponse(n,zue.test(r)),[3,8];case 5:return e!==499?[3,7]:[4,this.handleOtherResponse(n)];case 6:return s.sent(),[3,8];case 7:this.completeRequest({context:n,err:xde}),s.label=8;case 8:return[2]}})})},t.prototype.handlePayloadTooLargeResponse=function(e,n){var r=n?"WAF (compressed payload too large)":"server (event too large)",i=Math.round(e.events.reduce(function(o,c){return o+c.length},0)/ww);if(!n){this.completeRequest({context:e,err:"Session replay event batch dropped: ".concat(r," rejected payload (").concat(e.events.length," events, ").concat(i," KB) â not retrying non-WAF 413")});return}if(e.events.length===1){this.completeRequest({context:e,err:"Session replay event dropped: single event (".concat(i," KB, 1 event) rejected by ").concat(r," â cannot split further")});return}this.loggerProvider.warn("Session replay event batch rejected by ".concat(r," (").concat(e.events.length," events, ").concat(i," KB total) â splitting and retrying")),e.onComplete();var a=function(){return Promise.resolve()},s=Math.floor(e.events.length/2);this.sendEventsList(re(re({},e),{events:e.events.slice(0,s),onComplete:a})),this.sendEventsList(re(re({},e),{events:e.events.slice(s),onComplete:a}))},t.prototype.handleSuccessResponse=function(e){var n=Math.round(new Blob(e.events).size/ww);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(n," KB")})},t.prototype.handleOtherResponse=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return n=Math.random()*e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:rT}),[2]):[4,new Promise(function(i){return setTimeout(i,n)})];case 1:return r.sent(),[4,this.send(e,!0)];case 2:return r.sent(),[2]}})})},t.prototype.completeRequest=function(e){var n=e.context,r=e.err,i=e.success;n.onComplete(),r?this.loggerProvider.warn(r):i&&this.loggerProvider.log(i)},t.prototype.applyServerDirective=function(e,n){if(n===null){this.flushPauseUntilMs=0,this.mergeLogFiredThisPause=!1;return}if(n===ede){var r=this.flushPauseUntilMs>Date.now();this.flushPauseUntilMs=Date.now()+JI,r||this.loggerProvider.log("Session replay throttled by server; pausing flush schedule for ".concat(JI/1e3,"s"));return}(n===nde||n===tde)&&this.killSession(e,n)},t.prototype.killSession=function(e,n){var r,i,a,s;if(!this.killedSessions.has(e)){if(this.killedSessions.add(e),this.killedSessions.size>kde)try{for(var o=Se(this.killedSessions),c=o.next();!c.done;c=o.next()){var l=c.value;this.killedSessions.delete(l);break}}catch(p){r={error:p}}finally{try{c&&!c.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}this.loggerProvider.log("Session replay capture stopped for session ".concat(e," by server directive ").concat(n,"; remaining events will be dropped"));var u=[];try{for(var d=Se(this.queue),f=d.next();!f.done;f=d.next()){var h=f.value;h.sessionId===e?this.completeRequest({context:h,err:z6}):u.push(h)}}catch(p){a={error:p}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}this.queue=u}},t}();const Cw=(t,e)=>e.some(n=>t instanceof n);let iT,aT;function Ode(){return iT||(iT=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Mde(){return aT||(aT=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ew=new WeakMap,Z6=new WeakMap,Vm=new WeakMap;function Nde(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",a),t.removeEventListener("error",s)},a=()=>{n(lu(t.result)),i()},s=()=>{r(t.error),i()};t.addEventListener("success",a),t.addEventListener("error",s)});return Vm.set(e,t),e}function Dde(t){if(Ew.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",a),t.removeEventListener("error",s),t.removeEventListener("abort",s)},a=()=>{n(),i()},s=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",a),t.addEventListener("error",s),t.addEventListener("abort",s)});Ew.set(t,e)}let Sw={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Ew.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return lu(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function WU(t){Sw=t(Sw)}function Fde(t){return Mde().includes(t)?function(...e){return t.apply(Aw(this),e),lu(this.request)}:function(...e){return lu(t.apply(Aw(this),e))}}function Ude(t){return typeof t=="function"?Fde(t):(t instanceof IDBTransaction&&Dde(t),Cw(t,Ode())?new Proxy(t,Sw):t)}function lu(t){if(t instanceof IDBRequest)return Nde(t);if(Z6.has(t))return Z6.get(t);const e=Ude(t);return e!==t&&(Z6.set(t,e),Vm.set(e,t)),e}const Aw=t=>Vm.get(t);function qU(t,e,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const s=indexedDB.open(t,e),o=lu(s);return r&&s.addEventListener("upgradeneeded",c=>{r(lu(s.result),c.oldVersion,c.newVersion,lu(s.transaction),c)}),n&&s.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),o.then(c=>{a&&c.addEventListener("close",()=>a()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),o}const jde=["get","getKey","getAll","getAllKeys","count"],Bde=["put","add","delete","clear"],K6=new Map;function sT(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(K6.get(e))return K6.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=Bde.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||jde.includes(n)))return;const a=async function(s,...o){const c=this.transaction(s,i?"readwrite":"readonly");let l=c.store;
36return r&&(l=l.index(o.shift())),(await Promise.all([l[n](...o),i&&c.done]))[0]};return K6.set(e,a),a}WU(t=>({...t,get:(e,n,r)=>sT(e,n)||t.get(e,n,r),has:(e,n)=>!!sT(e,n)||t.has(e,n)}));const Vde=["continue","continuePrimaryKey","advance"],oT={},xw=new WeakMap,zU=new WeakMap,Hde={get(t,e){if(!Vde.includes(e))return t[e];let n=oT[e];return n||(n=oT[e]=function(...r){xw.set(this,zU.get(this)[e](...r))}),n}};async function*Wde(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const n=new Proxy(e,Hde);for(zU.set(n,e),Vm.set(n,Aw(e));e;)yield n,e=await(xw.get(n)||e.continue()),xw.delete(n)}function cT(t,e){return e===Symbol.asyncIterator&&Cw(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&Cw(t,[IDBIndex,IDBObjectStore])}WU(t=>({...t,get(e,n,r){return cT(e,n)?Wde:t.get(e,n,r)},has(e,n){return cT(e,n)||t.has(e,n)}}));var ZU=function(){function t(e){var n=this,r,i,a;this.minInterval=mw,this.maxInterval=vw,this.maxPersistedEventsSize=que,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(s,o){var c=n.getStringSize(o),l=n.getEventsArraySize(s);return l+c>=n.maxPersistedEventsSize?!0:Date.now()-n.timeAtLastSplit>n.interval&&s.length?(n.interval=Math.min(n.maxInterval,n.interval+n.minInterval),n._timeAtLastSplit=Date.now(),!0):!1},this.loggerProvider=e.loggerProvider,this.minInterval=(r=e.minInterval)!==null&&r!==void 0?r:this.minInterval,this.maxInterval=(i=e.maxInterval)!==null&&i!==void 0?i:this.maxInterval,this.maxPersistedEventsSize=(a=e.maxPersistedEventsSize)!==null&&a!==void 0?a:this.maxPersistedEventsSize,this.interval=this.minInterval}return Object.defineProperty(t.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),t.prototype.getStringSize=function(e){for(var n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);if(i<=127)n++;else if(i<=2047)n+=2;else if(i>=55296&&i<=56319){var a=r+1<e.length?e.charCodeAt(r+1):NaN;a>=56320&&a<=57343?(n+=4,r++):n+=3}else i>=56320&&i<=57343,n+=3}return n},t.prototype.getEventsArraySize=function(e){var n,r,i=0;try{for(var a=Se(e),s=a.next();!s.done;s=a.next()){var o=s.value;i+=this.getStringSize(o)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var c=2+Math.max(0,e.length-1)+e.length*2;return i+c},t}(),qde=function(t){return typeof t=="object"&&t!==null&&t.name==="AbortError"},Jr=function(t,e,n){qde(n)?t.debug(e):t.warn(e)};function zde(){try{return crypto.randomUUID()}catch{return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}}var ua="sessionCurrentSequence",yo="sequencesToSend",Zde=2e3,G6=5e3;function Kde(t,e,n){return new Promise(function(r,i){var a=setTimeout(function(){return i(new Error("".concat(n," after ").concat(e,"ms")))},e);t.then(function(s){clearTimeout(a),r(s)},function(s){clearTimeout(a),i(s)})})}function Y6(t,e,n){var r=setTimeout(n,e);return t.then(function(){return clearTimeout(r)},function(){return clearTimeout(r)}),function(){return clearTimeout(r)}}var Gde=function(t){var e,n;return t.objectStoreNames.contains(ua)||(n=t.createObjectStore(ua,{keyPath:"sessionId"})),t.objectStoreNames.contains(yo)||(e=t.createObjectStore(yo,{keyPath:"sequenceId",autoIncrement:!0}),e.createIndex("sessionId","sessionId")),{sequencesStore:e,currentSequenceStore:n}},Yde=function(t){return te(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,Kde(qU(t,1,{upgrade:Gde}),Zde,"IDB openDB timed out")];case 1:return[2,e.sent()]}})})},Jde=function(t){rs(e,t);function e(n){var r=this,i;return r=t.call(this,n)||this,r.consecutiveFailures=0,r.hasTriggeredFallback=!1,r.emptyFilteredCount=0,r.getSequencesToSend=function(){return te(r,void 0,void 0,function(){var a,s,o,c,l,u,d,f,h,p,g=this;return ee(this,function(y){switch(y.label){case 0:a=!1,s=!1,y.label=1;case 1:return y.trys.push([1,9,,10]),o=[],c=this.db.transaction("sequencesToSend","readwrite"),c.done.catch(function(v){!a&&!s&&(Jr(g.loggerProvider,"".concat(aa,": ").concat(v),v),g.recordFailure())}),l=Y6(c.done,G6,function(){!a&&!s&&(s=!0,Jr(g.loggerProvider,"".concat(aa,": transaction timed out")),g.recordFailure())}),[4,c.store.openCursor()];case 2:u=y.sent(),y.label=3;case 3:return u?(d=u.value,f=d.sessionId,h=d.events,h.length!==0?[3,5]:(this.maybeLogEmptyFiltered("getSequencesToSend"),[4,u.delete()])):[3,8];case 4:return y.sent(),[3,6];case 5:o.push({events:h,sequenceId:u.key,sessionId:f}),y.label=6;case 6:return[4,u.continue()];case 7:return u=y.sent(),[3,3];case 8:return this.recordSuccess(),l(),[2,o];case 9:return p=y.sent(),s||(a=!0,Jr(this.loggerProvider,"".concat(aa,": ").concat(p),p),this.recordFailure()),[3,10];case 10:return[2,void 0]}})})},r.storeCurrentSequence=function(a){return te(r,void 0,void 0,function(){var s,o,c,l,u,d,f,h,p=this;return ee(this,function(g){switch(g.label){case 0:s=!1,o=!1,g.label=1;case 1:return g.trys.push([1,5,,6]),c=this.db.transaction([ua,yo],"readwrite"),c.done.catch(function(y){!s&&!o&&(Jr(p.loggerProvider,"".concat(aa,": ").concat(y),y),p.recordFailure())}),l=Y6(c.done,G6,function(){!s&&!o&&(o=!0,Jr(p.loggerProvider,"".concat(aa,": transaction timed out")),p.recordFailure())}),[4,c.objectStore(ua).get(a)];case 2:return u=g.sent(),!u||u.tabId&&u.tabId!==this.tabId?(l(),[2,void 0]):u.events.length===0?(this.maybeLogEmptyFiltered("storeCurrentSequence"),l(),[2,void 0]):[4,c.objectStore(yo).put({sessionId:a,events:u.events,tabId:this.tabId})];case 3:return d=g.sent(),[4,c.objectStore(ua).put({sessionId:a,events:[],tabId:this.tabId})];case 4:return g.sent(),this.recordSuccess(),l(),u.tabId,f=au(u,["tabId"]),[2,re(re({},f),{sessionId:a,sequenceId:d})];case 5:return h=g.sent(),o||(s=!0,Jr(this.loggerProvider,"".concat(aa,": ").concat(h),h),this.recordFailure()),[3,6];case 6:return[2,void 0]}})})},r.addEventToCurrentSequence=function(a,s){return te(r,void 0,void 0,function(){var o,c,l,u,d,f,h,p,g,y=this;return ee(this,function(v){switch(v.label){case 0:o=!1,c=!1,v.label=1;case 1:return v.trys.push([1,15,,16]),l=this.db.transaction([ua,yo],"readwrite"),l.done.catch(function(b){!o&&!c&&(Jr(y.loggerProvider,"".concat(aa,": ").concat(b),b),y.recordFailure())}),u=Y6(l.done,G6,function(){!o&&!c&&(c=!0,Jr(y.loggerProvider,"".concat(aa,": transaction timed out")),y.recordFailure())}),[4,l.objectStore(ua).get(a)];case 2:return d=v.sent(),d?.tabId&&d.tabId!==this.tabId?d.events.length>0?[4,l.objectStore(yo).put({sessionId:a,events:d.events,tabId:d.tabId})]:[3,4]:[3,6];case 3:v.sent(),v.label=4;case 4:return[4,l.objectStore(ua).put({sessionId:a,events:[s],tabId:this.tabId})];case 5:return v.sent(),this.recordSuccess(),u(),[2,void 0];case 6:return f=d,f?[3,8]:[4,l.objectStore(ua).put({sessionId:a,events:[s],tabId:this.tabId})];case 7:return v.sent(),this.recordSuccess(),u(),[2,void 0];case 8:return this.shouldSplitEventsList(f.events,s)?[3,10]:[4,l.objectStore(ua).put({sessionId:a,events:f.events.concat(s),tabId:this.tabId})];case 9:return v.sent(),this.recordSuccess(),u(),[2,void 0];case 10:return h=f.events,h.length!==0?[3,12]:(this.maybeLogEmptyFiltered("addEventToCurrentSequence"),[4,l.objectStore(ua).put({sessionId:a,events:[s],tabId:this.tabId})]);case 11:return v.sent(),this.recordSuccess(),u(),[2,void 0];case 12:return[4,l.objectStore(ua).put({sessionId:a,events:[s],tabId:this.tabId})];case 13:return v.sent(),[4,l.objectStore(yo).put({sessionId:a,events:h,tabId:this.tabId})];case 14:return p=v.sent(),this.recordSuccess(),u(),[2,{events:h,sessionId:a,sequenceId:p}];case 15:return g=v.sent(),c||(o=!0,Jr(this.loggerProvider,"".concat(aa,": ").concat(g),g),this.recordFailure()),[3,16];case 16:return[2,void 0]}})})},r.storeSendingEvents=function(a,s){return te(r,void 0,void 0,function(){var o,c;return ee(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,this.db.put(yo,{sessionId:a,events:s,tabId:this.tabId})];case 1:return o=l.sent(),this.recordSuccess(),[2,o];case 2:return c=l.sent(),Jr(this.loggerProvider,"".concat(aa,": ").concat(c),c),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(a,s){return te(r,void 0,void 0,function(){var o;return ee(this,function(c){switch(c.label){case 0:if(!s)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.db.delete(yo,s)];case 2:return c.sent(),this.recordSuccess(),[3,4];case 3:return o=c.sent(),Jr(this.loggerProvider,"".concat(aa,": ").concat(o),o),this.recordFailure(),[3,4];case 4:return[2]}})})},r.db=n.db,r.tabId=n.tabId,r.onPersistentFailure=n.onPersistentFailure,r.consecutiveFailureThreshold=(i=n.consecutiveFailureThreshold)!==null&&i!==void 0?i:1,r}return e.prototype.maybeLogEmptyFiltered=function(n){this.emptyFilteredCount++%100===0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(n," (idb store)"))},e.prototype.recordFailure=function(){var n;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,(n=this.onPersistentFailure)===null||n===void 0||n.call(this))},e.prototype.recordSuccess=function(){this.consecutiveFailures=0},e.new=function(n,r){var i;return te(this,void 0,void 0,function(){var a,s,o,c,l;return ee(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),a=n==="replay"?"":"_".concat(n),s="".concat(r.a
36piKey.substring(0,10),"_amp_session_replay_events").concat(a),[4,Yde(s)];case 1:return o=u.sent(),c=(i=r.tabId)!==null&&i!==void 0?i:zde(),[2,new e(re(re({},r),{db:o,tabId:c}))];case 2:return l=u.sent(),Jr(r.loggerProvider,"".concat(aa,": ").concat(l),l),[3,3];case 3:return[2]}})})},e.prototype.getCurrentSequenceEvents=function(n){return te(this,void 0,void 0,function(){var s,o,r,i,a,s,o,c,l,u;return ee(this,function(d){switch(d.label){case 0:return n?[4,this.db.get("sessionCurrentSequence",n)]:[3,2];case 1:return s=d.sent(),s?s.tabId&&s.tabId!==this.tabId?[2,void 0]:(s.tabId,o=au(s,["tabId"]),[2,[o]]):[2,void 0];case 2:r=[],d.label=3;case 3:return d.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:i=Se.apply(void 0,[d.sent()]),a=i.next(),d.label=5;case 5:if(a.done)return[3,7];if(s=a.value,s.tabId&&s.tabId!==this.tabId)return[3,6];s.tabId,o=au(s,["tabId"]),r.push(o),d.label=6;case 6:return a=i.next(),[3,5];case 7:return[3,10];case 8:return c=d.sent(),l={error:c},[3,10];case 9:try{a&&!a.done&&(u=i.return)&&u.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})})},e}(ZU),Xde=function(t){rs(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.finalizedSequences={},n.sequences={},n.sequenceId=0,n.emptyFilteredCount=0,n}return e.prototype.resetCurrentSequence=function(n){this.sequences[n]=[]},e.prototype.addSequence=function(n){var r=this.sequenceId++,i=Qe([],$e(this.sequences[n]),!1);return this.finalizedSequences[r]={sessionId:n,events:i},this.resetCurrentSequence(n),{sequenceId:r,events:i,sessionId:n}},e.prototype.maybeLogEmptyFiltered=function(n){this.emptyFilteredCount++%100===0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(n," (in-memory store)"))},e.prototype.getSequencesToSend=function(){return te(this,void 0,void 0,function(){var n,r,i,a,s,o,c,l,u,d;return ee(this,function(f){n=[];try{for(r=Se(Object.entries(this.finalizedSequences)),i=r.next();!i.done;i=r.next()){if(a=$e(i.value,2),s=a[0],o=a[1],c=o.sessionId,l=o.events,l.length===0){this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(s)];continue}n.push({sequenceId:Number(s),sessionId:c,events:l})}}catch(h){u={error:h}}finally{try{i&&!i.done&&(d=r.return)&&d.call(r)}finally{if(u)throw u.error}}return[2,n]})})},e.prototype.storeCurrentSequence=function(n){return te(this,void 0,void 0,function(){var r;return ee(this,function(i){return r=this.sequences[n],r?r.length===0?(this.maybeLogEmptyFiltered("storeCurrentSequence"),[2,void 0]):[2,this.addSequence(n)]:[2,void 0]})})},e.prototype.addEventToCurrentSequence=function(n,r){return te(this,void 0,void 0,function(){var i;return ee(this,function(a){return this.sequences[n]||this.resetCurrentSequence(n),this.shouldSplitEventsList(this.sequences[n],r)&&(this.sequences[n].length===0?this.maybeLogEmptyFiltered("addEventToCurrentSequence"):i=this.addSequence(n)),this.sequences[n].push(r),[2,i]})})},e.prototype.storeSendingEvents=function(n,r){return te(this,void 0,void 0,function(){return ee(this,function(i){return this.finalizedSequences[this.sequenceId]={sessionId:n,events:r},[2,this.sequenceId++]})})},e.prototype.cleanUpSessionEventsStore=function(n,r){return te(this,void 0,void 0,function(){return ee(this,function(i){return r!==void 0&&delete this.finalizedSequences[r],[2]})})},e}(ZU),lT=function(t){var e=t.config,n=t.minInterval,r=t.maxInterval,i=t.maxPersistedEventsSize,a=t.type,s=t.payloadBatcher,o=t.storeType,c=t.trackDestinationWorkerScript,l=t.shouldSend;return te(void 0,void 0,void 0,function(){function u(S){return S===void 0&&(S=!1),te(this,void 0,void 0,function(){return ee(this,function(I){return[2,f.flush(S)]})})}var d,f,h,p,g,y,v,b,w,_,E,C,x,$,T,U,O,F,k;return ee(this,function(S){switch(S.label){case 0:return d=(k=e.maxSingleEventSizeBytes)!==null&&k!==void 0?k:MU,f=new Rde(re(re({},e),{loggerProvider:e.loggerProvider,payloadBatcher:s,workerScript:c})),h=function(){return new Xde({loggerProvider:e.loggerProvider,maxInterval:r,minInterval:n,maxPersistedEventsSize:i})},g=!1,v=function(){return te(void 0,void 0,void 0,function(){var I,A,R;return ee(this,function(N){switch(N.label){case 0:return g?(g=!1,e.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),p?[4,y.getSequencesToSend()]:[3,2]):[2];case 1:return A=N.sent(),[3,3];case 2:A=void 0,N.label=3;case 3:return I=A,y=h(),I&&p&&(R=p,I.forEach(function(P){x({sequenceId:P.sequenceId,events:P.events,sessionId:P.sessionId,deviceId:R})})),[2]}})})},b=function(){return te(void 0,void 0,void 0,function(){var I;return ee(this,function(A){switch(A.label){case 0:return[4,Jde.new(a,{loggerProvider:e.loggerProvider,minInterval:n,maxInterval:r,maxPersistedEventsSize:i,apiKey:e.apiKey,onPersistentFailure:function(){v()}})];case 1:return I=A.sent(),I?(g=!0,[2,I]):(e.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,h()])}})})},o!=="idb"?[3,2]:[4,b()];case 1:return w=S.sent(),[3,3];case 2:w=h(),S.label=3;case 3:return y=w,_=[],E=0,C=function(I){if(!(I<=E)){var A=Math.min(I-E,_.length);A>0&&(_.splice(0,A),E=I)}},x=function(I){var A=I.events,R=I.sessionId,N=I.deviceId,P=I.sequenceId,j=A.map(function(B){return{event:B,bytes:new Blob([B]).size}}
36),M=j.filter(function(B){return B.bytes>d});M.length>0&&e.loggerProvider.warn("Dropping ".concat(M.length," oversized event(s) from session replay sequence before send. Sizes: ").concat(M.map(function(B){return"".concat(Math.round(B.bytes/1024)," KB")}).join(", "),". If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support."));var V=M.length>0?j.filter(function(B){return B.bytes<=d}).map(function(B){return B.event}):A;if(V.length===0){y.cleanUpSessionEventsStore(R,P).catch(function(B){e.loggerProvider.warn("Failed to clean up session replay events store:",B)});return}e.debugMode&&jU().then(function(B){var G=B.totalStorageSize,Z=B.percentOfQuota,ie=B.usageDetails;e.loggerProvider.debug("Total storage size: ".concat(G," KB, percentage of quota: ").concat(Z,"%, usage details: ").concat(ie))}).catch(function(){}),f.sendEventsList({events:V,sessionId:R,flushMaxRetries:e.flushMaxRetries,apiKey:e.apiKey,deviceId:N,sampleRate:e.sampleRate,serverZone:e.serverZone,version:e.version,type:a,onComplete:function(){return te(void 0,void 0,void 0,function(){return ee(this,function(B){switch(B.label){case 0:return[4,y.cleanUpSessionEventsStore(R,P)];case 1:return B.sent(),[2]}})})}})},$=function(I){var A=I.sessionId,R=I.deviceId;if(p=R,!(l&&!l())){var N=E+_.length;y.storeCurrentSequence(A).then(function(P){P&&(C(N),x({sequenceId:P.sequenceId,events:P.events,sessionId:P.sessionId,deviceId:R}))}).catch(function(P){e.loggerProvider.warn("Failed to get current sequence of session replay events for session:",P)})}},T=function(I){var A=I.deviceId;return te(void 0,void 0,void 0,function(){var R;return ee(this,function(N){switch(N.label){case 0:return p=A,[4,y.getSequencesToSend()];case 1:return R=N.sent(),R?.length?(e.loggerProvider.log("Draining ".concat(R.length," stored sequence(s) from previous session.")),R.length>1&&f.markCoalesceNextFlush(),R.forEach(function(P){x({sequenceId:P.sequenceId,events:P.events,sessionId:P.sessionId,deviceId:A})}),[2]):[2]}})})},U=function(I){var A=I.event,R=I.sessionId,N=I.deviceId;p=N;var P=!l||l(),j=E+_.length;_.push(A.data),y.addEventToCurrentSequence(R,A.data).then(function(M){if(M){if(!P){y.cleanUpSessionEventsStore(M.sessionId,M.sequenceId).catch(function(V){e.loggerProvider.warn("Failed to clean up dropped session replay sequence:",V)}),C(j);return}C(j),x({sequenceId:M.sequenceId,events:M.events,sessionId:M.sessionId,deviceId:N})}}).catch(function(M){e.loggerProvider.warn("Failed to add event to session replay capture:",M)})},O=function(){return Qe([],$e(_),!1)},F=function(){C(E+_.length)},[2,{sendCurrentSequenceEvents:$,addEvent:U,sendStoredEvents:T,flush:u,getBeaconEvents:O,dropPendingBeaconEvents:F,trackDestination:f}]}})})},uT=function(){function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=new Map;e.forEach(function(i){r.set(i.name,i.manager)}),this.managers=r}return t.prototype.sendStoredEvents=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(i){n.push(i.sendStoredEvents(e))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},t.prototype.addEvent=function(e){var n,r=e.sessionId,i=e.event,a=e.deviceId;(n=this.managers.get(i.type))===null||n===void 0||n.addEvent({sessionId:r,event:i,deviceId:a})},t.prototype.sendCurrentSequenceEvents=function(e){var n=e.sessionId,r=e.deviceId;this.managers.forEach(function(i){i.sendCurrentSequenceEvents({sessionId:n,deviceId:r})})},t.prototype.flush=function(e){return te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return n=[],this.managers.forEach(function(i){n.push(i.flush(e))}),[4,Promise.all(n)];case 1:return r.sent(),[2]}})})},t}(),wa,XC,KU;function Qde(t,e){if(KU=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";var n={root:document.body,idName:function(a){return!0},className:function(a){return!0},tagName:function(a){return!0},attr:function(a,s){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};wa=re(re({},n),e),XC=e2e(wa.root,n);var r=m1(t,"all",function(){return m1(t,"two",function(){return m1(t,"one",function(){return m1(t,"none")})})});if(r){var i=JU(XU(r,t));return i.length>0&&(r=i[0]),Hm(r)}else throw new Error("Selector was not found.")}function e2e(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function m1(t,e,n){for(var r=null,i=[],a=t,s=0,o=function(){var l,u,d=new Date().getTime()-KU.getTime();if(wa.timeoutMs!==void 0&&d>wa.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(d,"ms"));var f=w1(t2e(a))||w1.apply(void 0,Qe([],$e(n2e(a)),!1))||w1.apply(void 0,Qe([],$e(r2e(a)),!1))||w1(i2e(a))||[hT()],h=a2e(a);
vendor: 4,417 bytes, line 36
36if(e=="all")h&&(f=f.concat(f.filter(J6).map(function(b){return v1(b,h)})));else if(e=="two")f=f.slice(0,1),h&&(f=f.concat(f.filter(J6).map(function(b){return v1(b,h)})));else if(e=="one"){var p=$e(f=f.slice(0,1),1),g=p[0];h&&J6(g)&&(f=[v1(g,h)])}else e=="none"&&(f=[hT()],h&&(f=[v1(f[0],h)]));try{for(var y=(l=void 0,Se(f)),v=y.next();!v.done;v=y.next()){var g=v.value;g.level=s}}catch(b){l={error:b}}finally{try{v&&!v.done&&(u=y.return)&&u.call(y)}finally{if(l)throw l.error}}if(i.push(f),i.length>=wa.seedMinLength&&(r=dT(i,n),r))return"break";a=a.parentElement,s++};a;){var c=o();if(c==="break")break}return r||(r=dT(i,n)),!r&&n?n():r}function dT(t,e){var n,r,i=JU(YU(t));if(i.length>wa.threshold)return e?e():null;try{for(var a=Se(i),s=a.next();!s.done;s=a.next()){var o=s.value;if(GU(o))return o}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return null}function Hm(t){for(var e=t[0],n=e.name,r=1;r<t.length;r++){var i=t[r].level||0;e.level===i-1?n="".concat(t[r].name," > ").concat(n):n="".concat(t[r].name," ").concat(n),e=t[r]}return n}function fT(t){return t.map(function(e){return e.penalty}).reduce(function(e,n){return e+n},0)}function GU(t){var e=Hm(t);switch(XC.querySelectorAll(e).length){case 0:throw new Error("Can't select any node with this selector: ".concat(e));case 1:return!0;default:return!1}}function t2e(t){var e=t.getAttribute("id");return e&&wa.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function n2e(t){var e=Array.from(t.attributes).filter(function(n){return wa.attr(n.name,n.value)});return e.map(function(n){return{name:"[".concat(CSS.escape(n.name),'="').concat(CSS.escape(n.value),'"]'),penalty:.5}})}function r2e(t){var e=Array.from(t.classList).filter(wa.className);return e.map(function(n){return{name:"."+CSS.escape(n),penalty:1}})}function i2e(t){var e=t.tagName.toLowerCase();return wa.tagName(e)?{name:e,penalty:2}:null}function hT(){return{name:"*",penalty:3}}function a2e(t){var e=t.parentNode;if(!e)return null;var n=e.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==t);)n=n.nextSibling;return r}function v1(t,e){return{name:t.name+":nth-child(".concat(e,")"),penalty:t.penalty+1}}function J6(t){return t.name!=="html"&&!t.name.startsWith("#")}function w1(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(s2e);return n.length>0?n:null}function s2e(t){return t!=null}function YU(t,e){var n,r,i,a,s,o;return e===void 0&&(e=[]),ee(this,function(c){switch(c.label){case 0:if(!(t.length>0))return[3,9];c.label=1;case 1:c.trys.push([1,6,7,8]),n=Se(t[0]),r=n.next(),c.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,Se(YU(t.slice(1,t.length),e.concat(i)))]);case 3:c.sent(),c.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return a=c.sent(),s={error:a},[3,8];case 7:try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,e];case 10:c.sent(),c.label=11;case 11:return[2]}})}function JU(t){return Qe([],$e(t),!1).sort(function(e,n){return fT(e)-fT(n)})}function XU(t,e,n){var r,i,a;return n===void 0&&(n={counter:0,visited:new Map}),ee(this,function(s){switch(s.label){case 0:if(!(t.length>2&&t.length>wa.optimizedMinLength))return[3,5];r=1,s.label=1;case 1:return r<t.length-1?n.counter>wa.maxNumberOfTries?[2]:(n.counter+=1,i=Qe([],$e(t),!1),i.splice(r,1),a=Hm(i),n.visited.has(a)?[2]:GU(i)&&o2e(i,e)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),n.visited.set(a,!0),[5,Se(XU(i,e,n))];case 3:s.sent(),s.label=4;case 4:return r++,[3,1];case 5:return[2]}})}function o2e(t,e){return XC.querySelector(Hm(t))===e}var c2e=36e5,l2e=function(t){var e=t.version,n=t.events,r=[];return n.forEach(function(i){var a=JSON.parse(i);a.count=1,a.type==="click"&&r.push(a)}),{version:e,events:r}},u2e=function(t){var e=t.version,n=t.events,r=[];n.forEach(function(a){var s=JSON.parse(a);s.type==="click"&&r.push(s)});var i=r.reduce(function(a,s){var o=s.x,c=s.y,l=s.selector,u=s.timestamp,d=u-u%c2e,f="".concat(o,":").concat(c,":").concat(l??"",":").concat(d);return a[f]?a[f].count+=1:a[f]=re(re({},s),{timestamp:d,count:1}),a},{});return{version:e,events:Object.values(i)}},d2e=function(){function t(e,n){var r=this;this.createHook=function(i){var a=i.eventsManager,s=i.sessionId,o=i.deviceIdFn,c=i.mirror,l=i.ugcFilterRules,u=i.performanceOptions;return function(d){if(d.type===HU.Click){var f=He();
36if(f){var h=f.location,p=f.innerHeight,g=f.innerWidth;if(h){var y=d.x,v=d.y;if(!(y===void 0||v===void 0)){var b=c.getNode(d.id),w;if(b)try{w=Qde(b,u)}catch{r.logger.debug("error resolving selector from finder")}var _=jm(h.href,l),E={x:y+r.scrollWatcher.currentScrollX,y:v+r.scrollWatcher.currentScrollY,selector:w,viewportHeight:p,viewportWidth:g,pageUrl:_,timestamp:Date.now(),type:"click"},C=o();C&&a.addEvent({sessionId:s,event:{type:"interaction",data:JSON.stringify(E)},deviceId:C})}}}}}},this.logger=e,this.scrollWatcher=n}return t}();function X6(){var t=He();return t?.innerHeight||document.documentElement&&document.documentElement.clientHeight||0}function Q6(){var t=He();return t?.innerWidth||document.documentElement&&document.documentElement.clientWidth||0}var f2e=function(){function t(e,n){var r=He();r&&r.navigator&&typeof r.navigator.sendBeacon=="function"?this.sendBeacon=function(i,a){try{if(r.navigator.sendBeacon(i,JSON.stringify(a)))return!0}catch{}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(i,a){var s=new XMLHttpRequest;return s.open("POST",i,!0),s.setRequestHeader("Accept","*/*"),s.send(JSON.stringify(a)),!0},this.basePageUrl=Ah(n.serverZone,n.trackServerUrl),this.apiKey=n.apiKey,this.context=e,this.handleSendEvents=n.handleSendEvents,this.loggerProvider=n.loggerProvider}return t.prototype.send=function(e,n){var r=this,i,a=this.context,s=a.sessionId,o=a.type;if(this.handleSendEvents){var c=new URLSearchParams({device_id:e,session_id:String(s),type:String(o)}),l="".concat(this.basePageUrl,"?").concat(c.toString()),u={"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(this.apiKey)};try{this.handleSendEvents({url:l,method:"POST",headers:u,body:JSON.stringify(n),keepalive:!0}).catch(function(h){var p;(p=r.loggerProvider)===null||p===void 0||p.warn("Custom transport failed to send session replay interaction beacon:",h)})}catch(h){(i=this.loggerProvider)===null||i===void 0||i.warn("Custom transport threw while sending session replay interaction beacon:",h)}return}var d=new URLSearchParams({device_id:e,session_id:String(s),type:String(o),api_key:this.apiKey}),f="".concat(this.basePageUrl,"?").concat(d.toString());this.sendBeacon(f,n)||this.sendXhr(f,n)},t}(),h2e=function(){function t(e,n){var r=this;this.timestamp=Date.now(),this.hook=function(i){r.update(i)},this.send=function(i){return function(a){var s,o,c,l,u=i(),d=He();if(d&&u){var f=(s=d.scrollX)!==null&&s!==void 0?s:0,h=(o=d.scrollY)!==null&&o!==void 0?o:0;(f>0||h>0)&&r.update({id:1,x:f,y:h}),r.transport.send(u,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:X6(),viewportWidth:Q6(),pageUrl:jm(d.location.href,(l=(c=r.config.interactionConfig)===null||c===void 0?void 0:c.ugcFilterRules)!==null&&l!==void 0?l:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=Q6(),this._maxScrollHeight=X6(),this.config=n,this.transport=e}return t.default=function(e,n){return new t(new f2e(e,n),n)},Object.defineProperty(t.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),t.prototype.update=function(e){var n=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=Q6();this._maxScrollX=e.x;var i=e.x+r;i>this._maxScrollWidth&&(this._maxScrollWidth=i),this.timestamp=n}if(e.y>this._maxScrollY){var a=X6();this._maxScrollY=e.y;var s=e.y+a;s>this._maxScrollHeight&&(this._maxScrollHeight=s),this.timestamp=n}},t}(),pT=function(){function t(e){var n=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=n,n&&r&&(this.sessionReplayId=ode(n,r))}return t}(),p2e="AMP_SR_START_",g2e=10,QU=24*60*60*1e3,ej=function(t){return"".concat(p2e).concat(t.substring(0,g2e),"_")},QC=function(t,e){return"".concat(ej(t)).concat(e)},Wm=function(){try{var t=He();return t?.localStorage}catch{return}},y2e=function(t,e,n,r){var i=Wm();if(i){var a=QC(t,e);try{var s=i.getItem(a);if(s!==null){var o=Number(s);if(Number.isFinite(o)&&o>0&&o<=n&&n-o<QU)return o}return i.setItem(a,String(n)),n}catch(c){r?.debug("Failed to read/write replay start time from storage: ".concat(String(c)));return}}},m2e=function(t,e,n,r){var i=Wm();if(i)try{i.setItem(QC(t,e),String(n))}catch(a){r?.debug("Failed to write replay start time to storage: ".concat(String(a)))}},v2e=function(t,e,n){var r=Wm();if(r)try{r.removeItem(QC(t,e))}catch(i){n?.debug("Failed to remove replay start time from storage: ".concat(String(i)))}},w2e=function(t,e,n){var r,i,a=Wm();if(a){var s=ej(t);try{for(var o=[],c=0;c<a.length;c++){var l=a.key(c);if(!(!l||!l.startsWith(s))){var u=a.getItem(l);if(u!==null){var d=Number(u);(!Number.isFinite(d)||d<=0||e-d>=QU)&&o.push(l)}}}try{for(var f=Se(o),h=f.next();!h.done;h=f.next()){var l=h.value;a.removeItem(l)}}catch(p){r={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}catch(p){n?.debug("Failed to prune stale replay start times: ".concat(String(p)))}}},b2e=1e3*60*60*24*2,_2e=function(){function t(){var e=this;this.dbs={},this.createStore=function(n){return te(e,void 0,void 0,function(){return ee(this,function(r){switch(r.label){case 0:return[4,qU(n,1,{upgrade:function(i){i.objectStoreNames.contains("sessionTargetingMatch")||i.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,r.sent()]}})})},this.openOrCreateDB=function(n){return te(e,void 0,void 0,function(){var r,i;return ee(this,function(a){switch(a.label){case 0:return this.dbs&&this.dbs[n]?[2,this.dbs[n]]:(r="".concat(n.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(r)]);case 1:return i=a.sent(),this.dbs[n]=i,[2,i]}})})},this.getTargetingMatchForSession=function(n){var r=n.loggerProvider,i=n.apiKey,a=n.sessionId;return te(e,void 0,void 0,function(){var s,o,c,l;return ee(this,function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),[4,this.openOrCreateDB(i)];case 1:return s=u.sent(),o=String(a),[4,s.get("sessionTargetingMatch",o)];case 2:return c=u.sent(),[2,c?.targetingMatch];case 3:return l=u.sent(),Jr(r,"Failed to get targeting match for session id ".concat(a,": ").concat(l),l),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(n){var r=n.loggerProvider,i=n.apiKey,a=n.sessionId,s=n.targetingMatch;return te(e,void 0,void 0,function(){var o,c,l,u;return ee(this,function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),[4,this.openOrCreateDB(i)];case 1:return o=d.sent(),c=String(a),[4,o.put("sessionTargetingMatch",{targetingMatch:s,sessionId:c,lastUpdated:Date.now()})];case 2:return l=d.sent(),[2,l];case 3:return u=d.sent(),Jr(r,"Failed to store targeting match for session id ".concat(a,": ").concat(u),u),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(n){var r=n.loggerProvider,i=n.apiKey,a=n.currentSessionId;return te(e,void 0,void 0,function(){var s,o,c,l,u,d,f,h;return ee(this,function(p){switch(p.label){case 0:return p.trys.push([0,8,,9]),[4,this.openOrCreateDB(i)];case 1:return s=p.sent(),o=String(a),c=s.transaction("sessionTargetingMatch","readwrite"),[4,c.store.getAll()];case 2:l=p.sent(),u=0,p.label=3;case 3:return u<l.length?(d=l[u],f=Date.now()-d.lastUpdated,d.sessionId!==o&&f>b2e?[4,c.store.delete(d.sessionId)]:[3,5]):[3,6];case 4:p.sent(),p.label=5;case 5:return u++,[3,3];case 6:return[4,c.done];case 7:return p.sent(),[3,9];case 8:return h=p.sent(),Jr(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}}return t}(),e5=new _2e,C2e=function(t){var e=t.sessionId,n=t.targetingConfig,r=t.loggerProvider,i=t.apiKey,a=t.targetingParams,s=t.urlChange,o=s===void 0?!1:s;return te(void 0,void 0,void 0,function(){var c,l,u,d,f,h,p;return ee(this,function(g){switch(g.label){case 0:return[4,e5.clearStoreOfOldSessions({loggerProvider:r,apiKey:i,currentSessionId:e})];case 1:return g.sent(),[4,e5.getTargetingMatchForSession({loggerProvider:r,apiKey:i,sessionId:e})];case 2:if(c=g.sent(),c===!0&&!o)return[2,!0];l=!0,g.label=3;case 3:return g.trys.push([3,6,,7]),[4,Ne(()=>import("./index-CtcoxVkL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))];case 4:return u=g.sent().evaluateTargeting,d=re(re({},a),{flag:n,sessionId:typeof e=="string"?parseInt(e,10):e,apiKey:i,loggerProvider:r}),[4,u(d)];
36case 5:return f=g.sent(),f&&f.sr_targeting_config&&(l=f.sr_targeting_config.key==="on"),e5.storeTargetingMatchForSession({loggerProvider:r,apiKey:i,sessionId:e,targetingMatch:l}),[3,7];case 6:return h=g.sent(),p=h,r.warn(p.message),[3,7];case 7:return[2,l]}})})},k3=2654435761,$3=2246822519,gT=3266489917,E2e=668265263,yT=374761393;function Pl(t,e){return(t<<e|t>>>32-e)>>>0}function b1(t,e){return t=t+Math.imul(e,$3)>>>0,t=Pl(t,13),t=Math.imul(t,k3)>>>0,t}function Sf(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function S2e(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<t.length){var i=t.charCodeAt(n+1);i>=56320&&i<=57343&&(r=(r-55296<<10)+(i-56320)+65536,n++)}r<128?e.push(r):r<2048?e.push(192|r>>6,128|r&63):r<65536?e.push(224|r>>12,128|r>>6&63,128|r&63):e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}return new Uint8Array(e)}function A2e(t,e){e===void 0&&(e=0);var n=S2e(t),r=n.length,i,a=0;if(r>=16){for(var s=e+k3+$3>>>0,o=e+$3>>>0,c=e>>>0,l=e-k3>>>0;a<=r-16;)s=b1(s,Sf(n,a)),a+=4,o=b1(o,Sf(n,a)),a+=4,c=b1(c,Sf(n,a)),a+=4,l=b1(l,Sf(n,a)),a+=4;i=Pl(s,1)+Pl(o,7)+Pl(c,12)+Pl(l,18)>>>0}else i=e+yT>>>0;for(i=i+r>>>0;a<=r-4;)i=i+Math.imul(Sf(n,a),gT)>>>0,i=Math.imul(Pl(i,17),E2e)>>>0,a+=4;for(;a<r;)i=i+Math.imul(n[a],yT)>>>0,i=Math.imul(Pl(i,11),k3)>>>0,a++;return i^=i>>>15,i=Math.imul(i,$3)>>>0,i^=i>>>13,i=Math.imul(i,gT)>>>0,i^=i>>>16,i>>>0}function x2e(t,e){var n=A2e(t.toString()),r=n%1e6;return r/1e6<e}var t5="__amplitude_url_tracking_patched__",mT=new WeakMap;function tj(t,e,n){if(n===void 0&&(n={}),!t?.location)return function(){};var r=n.enablePolling,i=r===void 0?!1:r,a=n.pollingInterval,s=a===void 0?GC:a;if(i){var o=function(){var _;return(_=t.location.href)!==null&&_!==void 0?_:""},c=o(),l=t.setInterval(function(){var _=o();_!==c&&(c=_,e(_))},s);return function(){l!=null&&t.clearInterval(l)}}var u=mT.get(t);if(!u){var d=void 0,f=new Set,h=function(){var _;return(_=t.location.href)!==null&&_!==void 0?_:""},p=function(){var _=h();d!==void 0&&_===d||(d=_,f.forEach(function(E){return E(_)}))},g=function(_){var E=function(){for(var C=[],x=0;x<arguments.length;x++)C[x]=arguments[x];var $=_.apply(this,C);return p(),$};return E[t5]=!0,E},y=t.history;if(y?.pushState){var v=Reflect.get(y,"pushState");v[t5]||(y.pushState=g(v))}if(y?.replaceState){var b=Reflect.get(y,"replaceState");b[t5]||(y.replaceState=g(b))}u={callbacks:f,notify:p,onPopStateOrHashChange:function(){return p()},listenersAttached:!1},mT.set(t,u)}var w=u;return w.listenersAttached||(t.addEventListener("popstate",w.onPopStateOrHashChange),t.addEventListener("hashchange",w.onPopStateOrHashChange),w.listenersAttached=!0),w.callbacks.add(e),function(){w.callbacks.delete(e),w.callbacks.size===0&&w.listenersAttached&&(t.removeEventListener("popstate",w.onPopStateOrHashChange),t.removeEventListener("hashchange",w.onPopStateOrHashChange),w.listenersAttached=!1)}}function nj(t){return t===void 0&&(t={}),{name:"amplitude/url-tracking@1",observer:function(e,n,r){var i,a,s,o=re(re({},t),r),c=o.ugcFilterRules||[],l=(i=o.enablePolling)!==null&&i!==void 0?i:!1,u=(a=o.pollingInterval)!==null&&a!==void 0?a:GC,d=(s=o.captureDocumentTitle)!==null&&s!==void 0?s:!1;if(!n)return function(){};var f=void 0,h=function(){return n.location&&n.location.href||""},p=function(){var v=n.innerHeight,b=n.innerWidth,w=n.document,_=h(),E="";d&&(E=w?.title||"");var C=c.length>0?jm(_,c):_;return{href:C,title:E,viewportHeight:v,viewportWidth:b,type:"url-change-event"}},g=function(){var v=h();if(f===void 0||v!==f){f=v;var b=p();e(b)}},y=tj(n,function(){return g()},l?{enablePolling:!0,pollingInterval:u}:{});return g(),function(){return y()}},options:t}}nj();function I2e(){try{var t=He();return t?t.parent!==t:!1}catch{return!0}}var T2e=function(){function t(){this.pendingLoadListeners=new Map}return t.prototype.start=function(){var e=this,n;(n=this.mutationObserver)===null||n===void 0||n.disconnect();var r=He();r&&(this.sendToAllIframes({type:L3,action:"start"}),this.mutationObserver=new MutationObserver(function(i){var a,s,o,c,l,u;try{for(var d=Se(i),f=d.next();!f.done;f=d.next()){var h=f.value;try{for(var p=(o=void 0,Se(Array.from(h.addedNodes))),g=p.next();!g.done;g=p.next()){var y=g.value;y instanceof HTMLIFrameElement?e.sendToIframeAfterLoad(y):y instanceof Element&&y.querySelectorAll("iframe").forEach(function(_){e.sendToIframeAfterLoad(_)})}}catch(_){o={error:_}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(o)throw o.error}}
36try{for(var v=(l=void 0,Se(Array.from(h.removedNodes))),b=v.next();!b.done;b=v.next()){var y=b.value;if(y instanceof HTMLIFrameElement){var w=e.pendingLoadListeners.get(y);w&&(y.removeEventListener("load",w),e.pendingLoadListeners.delete(y))}}}catch(_){l={error:_}}finally{try{b&&!b.done&&(u=v.return)&&u.call(v)}finally{if(l)throw l.error}}}}catch(_){a={error:_}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))},t.prototype.stop=function(){var e;(e=this.mutationObserver)===null||e===void 0||e.disconnect(),this.mutationObserver=void 0,this.pendingLoadListeners.forEach(function(n,r){r.removeEventListener("load",n)}),this.pendingLoadListeners.clear(),this.sendToAllIframes({type:L3,action:"stop"})},t.prototype.sendToIframeAfterLoad=function(e){var n=this,r=function(){n.pendingLoadListeners.delete(e),n.sendToIframe(e,{type:L3,action:"start"})};this.pendingLoadListeners.set(e,r),e.addEventListener("load",r,{once:!0})},t.prototype.sendToAllIframes=function(e){var n=this,r=document.querySelectorAll("iframe");r.forEach(function(i){return n.sendToIframe(i,e)})},t.prototype.sendToIframe=function(e,n){var r;try{(r=e.contentWindow)===null||r===void 0||r.postMessage(n,"*")}catch{}},t}();function L2e(t){var e=He();if(!e)return function(){};var n=e.parent;function r(i){if(i.source===n){var a=i.data;a?.type===L3&&(a.action==="start"?t.onStart():a.action==="stop"&&t.onStop())}}return e.addEventListener("message",r),function(){return e.removeEventListener("message",r)}}var k2e=function(){function t(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.recordFunction=null,this.recordEventsInFlight=!1,this.recordingEnabled=!0,this.recordingGeneration=0,this.startChildRecordingOnSetup=!1,this.pendingEmitEvents=[],this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(n){var r=He();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),!n&&r.addEventListener("blur",e.blurListener),!n&&r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),!n&&r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),!n&&r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){var n;if(e.recordingEnabled)if(e.recordCancelCallback&&e.recordFunction){if(((n=e.config)===null||n===void 0?void 0:n.captureFullSnapshotOnFocus)===!1)return;try{e.recordFunction.takeFullSnapshot(!0)}catch(r){e.loggerProvider.warn("Failed to take full snapshot on focus:",r)}}else e.recordEventsInFlight||e.recordEvents(!1)},this.pageLeaveListener=function(n){var r;(r=e.eventCompressor)===null||r===void 0||r.flushQueue(),e.sendEvents(),e.pageLeaveFns.forEach(function(i){i(n)})},this.evaluateTargetingAndCapture=function(n,r,i,a){return r===void 0&&(r=!1),i===void 0&&(i=!1),a===void 0&&(a=!1),te(e,void 0,void 0,function(){var s,o,c,l,u,d,f,h,p,g,y,v,b;return ee(this,function(w){switch(w.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig)if(r)this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.");else return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];return this.lastTargetingParams=n,s=this.config.targetingConfig,o=s&&!this.sessionTargetingMatch,o?(c=a?this.latestUrlChangeTargetingEvaluationId:void 0,l=n.event,l&&Object.values(ni).includes(l.event_type)&&(l=void 0),u=(v=(
36p=(h=n.page)===null||h===void 0?void 0:h.url)!==null&&p!==void 0?p:(y=(g=He())===null||g===void 0?void 0:g.location)===null||y===void 0?void 0:y.href)!==null&&v!==void 0?v:"",d=(b=n.page)!==null&&b!==void 0?b:u!==""?{url:u}:void 0,[4,C2e({sessionId:this.identifiers.sessionId,targetingConfig:s,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:n.userProperties,event:l,page:d},urlChange:a})]):[3,2];case 1:if(f=w.sent(),a&&c!==void 0&&c!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(c,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||f,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:l,targetingParams:n},null,2)),w.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return i||!this.recordCancelCallback?(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]):[3,5];case 4:w.sent(),w.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i=!0),te(e,void 0,void 0,function(){var a,s,o,c;return ee(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),a=void 0,s=this.config,s&&n!==go.METADATA?(a={config:BU(s),version:Wg},i?[4,jU()]:[3,2]):[3,2];case 1:o=l.sent(),a=re(re({},o),a),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(n,re(re({},r),a)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(n," due to no ongoing recording.")),[3,4];case 3:return c=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",c),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var n,r,i;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,(n=e.networkObservers)===null||n===void 0||n.stop(),(r=e.crossOriginIframeCoordinator)===null||r===void 0||r.stop(),e.crossOriginIframeCoordinator=null,(i=e.crossOriginParentSignalCleanup)===null||i===void 0||i.call(e),e.crossOriginParentSignalCleanup=null}catch(s){var a=s;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(a.toString()))}},this.loggerProvider=new bw(new f2)}return t.prototype.init=function(e,n){return ir(this._init(e,n))},t.prototype.setupUrlChangeListener=function(){var e=this,n,r;(n=this.urlChangeCleanup)===null||n===void 0||n.call(this);var i=He();if(i?.location){var a=!!(!((r=this.config)===null||r===void 0)&&r.targetingConfig),s=function(c){if(e.currentPageUrl=c,a){var l=++e.latestUrlChangeTargetingEvaluationId;e.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:c}},!1,!1,!0),e.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(l," for ").concat(c,"."))}},o=tj(i,s);this.urlChangeCleanup=function(){o(),e.urlChangeCleanup=null}}},t.prototype.isBelowMinSessionDuration=function(){var e,n=(e=this.config)===null||e===void 0?void 0:e.minSessionDurationMs;return n===void 0||this.sessionStartTime===void 0?!1:Date.now()-this.sessionStartTime<n},t.prototype.getCurrentPageForTargeting=function(){var e,n,r=(n=(e=He())===null||e===void 0?void 0:e.location)===null||n===void 0?void 0:n.href;return r!=null?{url:r}:void 0},t.prototype._init=function(e,n){var r,i,a,s,o,c,l,u,d,f,h,p,g,y;return te(this,void 0,void 0,function(){var v,b,w,_,E,C,x,$,T,U,O,F,k,S,I,A,R,M,N,P,j,M,V,B,G,Z,ie,oe,z,J,K,ne,ce,xe=this;return ee(this,function(ke){switch(ke.label){case 0:return(r=this.urlChangeCleanup)===null||r===void 0||r.call(this),this.recordingEnabled=!0,this.startChildRecordingOnSetup=!1,this.loggerProvider=new bw(n.loggerProvider||new f2),Object.prototype.hasOwnProperty.call(n,"logLevel")&&this.loggerProvider.enable(n.logLevel),this.currentPageUrl=_w(),this.identifiers=new pT({sessionId:n.sessionId,deviceId:n.deviceId}),v=Date.now(),w2e(e,v,this.loggerProvider),this.sessionStartTime=n.sessionId!==void 0&&(i=y2e(e,n.sessionId,v,this.loggerProvider))!==null&&i!==void 0?i:v,b=this,[4,mde(e,n)];case 1:return b.joinedConfigGenerator=ke.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return w=ke.sent(),_=w.joinedConfig,E=w.localConfig,C=w.remoteConfig,this.config=_,this.setMetadata(n.sessionId,_,E,
36C,(a=n.version)===null||a===void 0?void 0:a.version,Wg,(s=n.version)===null||s===void 0?void 0:s.type),this.pageLeaveFns=[],n.sessionId&&(!((o=this.config.interactionConfig)===null||o===void 0)&&o.enabled)&&(x=h2e.default({sessionId:n.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[x.send(this.getDeviceId.bind(this)).bind(x)],this.scrollHook=x.hook.bind(x),this.clickHandler=new d2e(this.loggerProvider,x)),$=[],T=this.config.storeType,T==="idb"&&!(!((c=He())===null||c===void 0)&&c.indexedDB)&&(T="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(T," for event storage.")),F=He(),this.config.useWebWorker&&F&&F.Worker?[4,Ne(()=>import("./index-BUd4hCY-.js"),[])]:[3,4];case 3:k=ke.sent(),S=k.compressionScript,I=k.trackDestinationScript,U=S,O=I,ke.label=4;case 4:return ke.trys.push([4,6,,7]),[4,lT({config:this.config,type:"replay",minInterval:(l=this.config.flushIntervalConfig)===null||l===void 0?void 0:l.minIntervalMs,maxInterval:(u=this.config.flushIntervalConfig)===null||u===void 0?void 0:u.maxIntervalMs,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,storeType:T,trackDestinationWorkerScript:O,shouldSend:function(){return!xe.isBelowMinSessionDuration()}})];case 5:return A=ke.sent(),this.rrwebEventManager=A,$.push({name:"replay",manager:A}),[3,7];case 6:return R=ke.sent(),M=R,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(M.toString())),[3,7];case 7:if(!(!((d=this.config.interactionConfig)===null||d===void 0)&&d.enabled))return[3,11];N=this.config.interactionConfig.batch?u2e:l2e,ke.label=8;case 8:return ke.trys.push([8,10,,11]),[4,lT({config:this.config,type:"interaction",minInterval:(f=this.config.interactionConfig.trackEveryNms)!==null&&f!==void 0?f:Zue,maxInterval:Kue,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,payloadBatcher:N,storeType:T,trackDestinationWorkerScript:O})];case 9:return P=ke.sent(),$.push({name:"interaction",manager:P}),[3,11];case 10:return j=ke.sent(),M=j,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(M.toString())),[3,11];case 11:if(this.eventsManager=new(uT.bind.apply(uT,Qe([void 0],$e($),!1))),this.eventCompressor&&this.eventCompressor.terminate(),V=this.config.eagerFullSnapshotSend===!0?function(){return xe.sendEvents()}:void 0,this.eventCompressor=new Sde(this.eventsManager,this.config,this.getDeviceId(),U,V),this.pendingEmitEvents.length>0){B=this.pendingEmitEvents.splice(0);try{for(G=Se(B),Z=G.next();!Z.done;Z=G.next())ie=Z.value,oe=ie.event,z=ie.sessionId,this.eventCompressor.enqueueEvent(oe,z)}catch(Me){ne={error:Me}}finally{try{Z&&!Z.done&&(ce=G.return)&&ce.call(G)}finally{if(ne)throw ne.error}}}return this.pageLeaveFns=Qe(Qe([],$e(this.pageLeaveFns),!1),[function(){var Me;if(!(!xe.config||!(!((Me=xe.identifiers)===null||Me===void 0)&&Me.sessionId)||!A)){var $t=A.getBeaconEvents();if($t.length){var H=xe.getDeviceId();H&&(xe.isBelowMinSessionDuration()||A.trackDestination.sendBeacon({events:$t,sessionId:xe.identifiers.sessionId,deviceId:H,apiKey:xe.config.apiKey,serverZone:xe.config.serverZone}))}}}],!1),[4,this.initializeNetworkObservers()];case 12:return ke.sent(),!((h=He())===null||h===void 0)&&h.opener&&(J=SF(),AF(J),J.setup(re({logger:this.loggerProvider},this.config.serverZone&&{endpoint:CF[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:n.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return ke.sent(),K=this.config.targetingConfig||((y=(g=(p=this.config.privacyConfig)===null||p===void 0?void 0:p.urlMaskLevels)===null||g===void 0?void 0:g.length)!==null&&y!==void 0?y:0)>0,K&&this.setupUrlChangeListener(),[2]}})})},t.prototype.setSessionId=function(e,n){return ir(this.asyncSetSessionId(e,n))},t.prototype.asyncSetSessionId=function(e,n,r){var i,a,s,o;return te(this,void 0,void 0,function(){var c,l,u,d,f;return ee(this,function(h){switch(h.label){case 0:return c=(i=this.identifiers)===null||i===void 0?void 0:i.sessionId,l=this.getDeviceId(),c!==void 0&&c===e&&(n===void 0||n===l)&&(r?.userProperties===void 0||Object.keys(r.userProperties).length===0)?[2]:(this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,c&&this.sendEvents(c),u=c!==e,u&&((a=this.rrwebEventManager)===null||a===void 0||a.dropPendingBeaconEvents()),d=n||this.getDeviceId(),this.identifiers=new pT({sessionId:e,deviceId:d}),u&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,!((s=this.config)===null||s===void 0)&&s.apiKey&&(m2e(this.config.apiKey,e,this.sessionStartTime,this.loggerProvider),c!==void 0&&v2e(this.config.apiKey,c,this.loggerProvider))),this.joinedConfigGenerator&&c?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2]);case 1:f=h.sent().joinedConfig,this.config=f,h.label=2;case 2:return!((o=this.config)===null||o===void 0)&&o.targetingConfig?[4,this.evaluateTargetingAndCapture({userProperties:r?.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return h.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:h.sent(),h.label=6;case 6:return[2]}})})},t.prototype.getSessionReplayProperties=function(){var e,n=this.config,r=this.identifiers;if(!n||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var i=this.getShouldRecord(),a={};return i&&(a=(e={},e[Fue]=r.sessionReplayId?r.sessionReplayId:null,e),n.debugMode&&(a[Vue]=JSON.stringify({appHash:nw(n.apiKey).toString()}))),this.addCustomRRWebEvent(go.GET_SR_PROPS,{shouldRecord:i,eventProperties:a},this.eventCount===10),this.eventCount===10&&(this.eventCount=0),this.eventCount++,a},t.prototype.sendEvents=function(e){var n,r,i=e||((n=this.identifiers)===null||n===void 0?void 0:n.sessionId),a=this.getDeviceId();if(this.eventsManager&&i&&a){if(this.isBelowMinSessionDuration()){var s=this.sessionStartTime,o=this.config.minSessionDurationMs;this.loggerProvider.log("Session ".concat(i," not sent: duration ").concat(Date.now()-s,"ms is below minimum ").concat(o,"ms.")),this.suppressedSendCount++;return}if(!this.hasEmittedGateDecision&&((r=this.config)===null||r===void 0?void 0:r.minSessionDurationMs)!==void 0&&this.recordCancelCallback&&this.recordFunction){this.hasEmittedGateDecision=!0;var c=this.sessionStartTime!==void 0?Date.now()-this.sessionStartTime:void 0;this.addCustomRRWebEvent(go.REPLAY_GATE_DECISION,{sessionId:i,suppressedSendCount:this.suppressedSendCount,elapsedMs:c,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:i,deviceId:a})}},t.prototype.initialize=function(e){var n;return e===void 0&&(e=!1),te(this,void 0,void 0,function(){var r;return ee(this,function(i){return!((n=this.identifiers)===null||n===void 0)&&n.sessionId?(r=this.getDeviceId(),r?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()])):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},t.prototype.shouldOptOut=function(){var e,n,r;if(!((e=this.config)===null||e===void 0)&&e.instanceName){var i=gu(this.config.instanceName).identityStore;r=i.getIdentity().optOut}return r!==void 0?r:(n=this.config)===null||n===void 0?void 0:n.optOut},t.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.recordingEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured because recording was stopped.")),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e=!1,n="",r=!1;if(this.config.targetingConfig)this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),e=!0,r=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),e=!1,r=!1);else{var i=x2e(this.identifiers.sessionId,this.config.sampleRate);i?(e=!0,r=!0):(n="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(n),e=!1,r=!1)}return this.lastShouldRecordDecision!==e&&this.config.targetingConfig&&(this.addCustomRRWebEvent(go.TARGETING_DECISION,{message:n,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),e},t.prototype.getBlockSelectors=function(){var e,n,r,i=(r=(n=(e=this.config)===null||e===void 0?void 0:e.privacyConfig)===null||n===void 0?void 0:n.blockSelector)!==null&&r!==void 0?r:[];if(i.length!==0)return i},t.prototype.getMaskTextSelectors=function(){var e,n,r=(e=this.config)===null||e===void 0?void 0:e.privacyConfig,i=r?DU(this.currentPageUrl,r):void 0;if(i==="conservative"||!((n=r?.urlMaskLevels)===null||n===void 0)&&n.some(function(o){return o.maskLevel==="conservative"}))return"*";var a=r?.urlMaskLevels;if(r?.defaultMaskLevel==="conservative"&&a&&a.length>0)return"*";var s=r?.maskSelector;if(s)return s},t.prototype.getRecordingPlugins=function(e){var n,r,i,a,s,o;return te(this,void 0,void 0,function(){var c,l,u,d;return ee(this,function(f){switch(f.label){case 0:c=[];try{l=nj({ugcFilterRules:((r=(n=this.config)===null||n===void 0?void 0:n.interactionConfig)===null||r===void 0?void 0:r.ugcFilterRules)||[],enablePolling:((i=this.config)===null||i===void 0?void 0:i.enableUrlChangePolling)||!1,pollingInterval:(a=this.config)===null||a===void 0?void 0:a.urlChangePollingInterval,captureDocumentTitle:(s=this.config)===null||s===void 0?void 0:s.captureDocumentTitle}),c.push(l)}catch(h){this.loggerProvider.warn("Failed to create URL tracking plugin:",h)}if(!(!((o=e?.console)===null||o===void 0)&&o.enabled))return[3,4];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,Ne(()=>import("./rrweb-plugin-console-record-r1VHf89Q.js"),__vite__mapDeps([8,1,2,3]))];case 2:return u=f.sent().getRecordConsolePlugin,c.push(u({level:e.console.levels})),[3,4];case 3:return d=f.sent(),this.loggerProvider.warn("Failed to load console plugin:",d),[3,4];case 4:return[2,c.length>0?c:void 0]}})})},t.prototype.getRecordFunction=function(){return te(this,void 0,void 0,function(){var e,n;return ee(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ne(()=>import("./rrweb-record-DbaPEZ8K.js"),__vite__mapDeps([9,1,2,3]))];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return n=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",n),[2,null];case 4:return[2]}})})},t.prototype.recordEvents=function(e){return e===void 0&&(e=!0),te(this,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(this.recordEventsInFlight)return this.recordEventsPendingShouldLogMetadata=e,[2];this.recordEventsInFlight=!0,r.label=1;case 1:return r.trys.push([1,,6,7]),[4,this._recordEvents(e)];case 2:r.sent(),r.label=3;case 3:return this.recordEventsPendingShouldLogMetadata===null?[3,5]:(n=this.recordEventsPendingShouldLogMetadata,this.recordEventsPendingShouldLogMetadata=null,[4,this._recordEvents(n)]);case 4:return r.sent(),[3,3];case 5:return[3,7];case 6:return this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null,[7];case 7:return[2]}})})},t.prototype.shouldAbandonRecordStart=function(e){return!this.recordingEnabled||e!==this.recordingGeneration},t.prototype._recordEvents=function(e){var n,r,i,a,s,o,c,l;return e===void 0&&(e=!0),te(this,void 0,void 0,function(){var u,d,f,h,p,g,y,v,b,w,_,E,
36C,x,$,T,U,O=this;return ee(this,function(F){switch(F.label){case 0:return u=this.config,d=this.getShouldRecord(),f=(n=this.identifiers)===null||n===void 0?void 0:n.sessionId,!d||!f||!u?[2]:(this.stopRecordingEvents(),h=this.recordingGeneration,[4,this.getRecordFunction()]);case 1:return p=F.sent(),!p||this.shouldAbandonRecordStart(h)?[2]:[4,this.initializeNetworkObservers()];case 2:if(F.sent(),this.shouldAbandonRecordStart(h))return[2];g=(r=u.loggingConfig)===null||r===void 0?void 0:r.network,y=Ah(u.serverZone,u.trackServerUrl),v=[PU,RU,OU,y],(i=this.networkObservers)===null||i===void 0||i.start(function(k){v.some(function(S){return k.url.startsWith(S)})||O.addCustomRRWebEvent(go.FETCH_REQUEST,k)},g),b=u.interactionConfig,w=u.loggingConfig,_=b?.enabled?{mouseInteraction:this.eventsManager&&((a=this.clickHandler)===null||a===void 0?void 0:a.createHook({eventsManager:this.eventsManager,sessionId:f,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:(s=b.ugcFilterRules)!==null&&s!==void 0?s:[],performanceOptions:(o=u.performanceConfig)===null||o===void 0?void 0:o.interaction})),scroll:this.scrollHook}:{},E=b?.enabled&&b.ugcFilterRules?b.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(f,".")),F.label=3;case 3:return F.trys.push([3,5,,6]),C=!!(!((c=u.crossOriginIframes)===null||c===void 0)&&c.enabled),x=((l=u.crossOriginIframes)===null||l===void 0?void 0:l.coordinateChildren)!==!1,$=C&&I2e(),$&&x?(this.crossOriginParentSignalCleanup=L2e({onStart:function(){O.recordingEnabled&&O._recordEventsInChildMode(p,f,u,_)},onStop:function(){try{O.recordCancelCallback&&O.recordCancelCallback(),O.recordCancelCallback=null}catch(S){var k=S;O.loggerProvider.warn("Error occurred while stopping child iframe replay capture: ".concat(k.toString()))}}}),this.startChildRecordingOnSetup&&(this.startChildRecordingOnSetup=!1,this._recordEventsInChildMode(p,f,u,_)),[2]):(this.startChildRecordingOnSetup=!1,[4,this.getRecordingPlugins(w)]);case 4:return T=F.sent(),this.shouldAbandonRecordStart(h)?[2]:(this.recordCancelCallback=p(re(re({},this.buildRRWebRecordOptions(u,_,function(k){if(O.shouldOptOut()||!O.recordingEnabled){O.loggerProvider.log(O.shouldOptOut()?"Opting session ".concat(f," out of recording due to optOut config."):"Session Replay capture stopping for ".concat(f,".")),O.stopRecordingEvents(),O.sendEvents();return}k.type===Bm.Meta&&(k.data.href=jm(k.data.href,E)),O.eventCompressor?O.eventCompressor.enqueueEvent(k,f):O.pendingEmitEvents.push({event:k,sessionId:f})},"Error while capturing replay: ")),{plugins:T,recordCrossOriginIframes:C})),C&&!$&&x&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new T2e),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(go.DEBUG_INFO),e&&this.addCustomRRWebEvent(go.METADATA,this.metadata),[3,6]);case 5:return U=F.sent(),this.loggerProvider.warn("Failed to initialize session replay:",U),[3,6];case 6:return[2]}})})},t.prototype.buildRRWebRecordOptions=function(e,n,r,i){var a=this,s=e.privacyConfig;return re(re({emit:r,inlineStylesheet:e.shouldInlineStylesheet,hooks:n,maskAllInputs:!0,maskTextClass:kU,blockClass:Hue,blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements,maskInputFn:XI("input",s,function(){return a.currentPageUrl}),maskTextFn:XI("text",s,function(){return a.currentPageUrl}),maskAttributeFn:sde(s,function(){return a.currentPageUrl}),maskTextSelector:this.getMaskTextSelectors()},e.fullSnapshotIntervalMs!==void 0&&{checkoutEveryNms:e.fullSnapshotIntervalMs}),{recordCanvas:!1,captureAdoptedStyleSheets:e.captureAdoptedStyleSheets,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},errorHandler:function(o){var c=o;if(c.message.includes("insertRule")&&c.message.includes("CSSStyleSheet")||c._external_)throw c;return a.loggerProvider.warn(i,c.toString()),!0}})},t.prototype._recordEventsInChildMode=function(e,n,r,i){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(re(re({},this.buildRRWebRecordOptions(r,i,function(){},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log("Session Replay child iframe capture beginning for session ".concat(n,"."))}catch(a){this.loggerProvider.warn("Failed to initialize session replay in child iframe mode:",a)}},t.prototype.getDeviceId=function(){var e;return(e=this.identifiers)===null||e===void 0?void 0:e.deviceId},t.prototype.getSessionId=function(){var e;return(e=this.identifiers)===null||e===void 0?void 0:e.sessionId},t.prototype.start=function(){return ir(this._start())},t.prototype._start=function(){return te(this,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return this.recordingEnabled=!0,this.startChildRecordingOnSetup=!0,[4,this.recordEvents()];case 1:return e.sent(),[2]}})})},t.prototype.stop=function(){this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,this.stopRecordingEvents(),this.sendEvents()},t.prototype.flush=function(e){var n;return e===void 0&&(e=!1),te(this,void 0,void 0,function(){return ee(this,function(r){return[2,(n=this.eventsManager)===null||n===void 0?void 0:n.flush(e)]})})},t.prototype.shutdown=function(){var e,n;this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,(e=this.urlChangeCleanup)===null||e===void 0||e.call(this),(n=this.crossOriginParentSignalCleanup)===null||n===void 0||n.call(this),this.crossOriginParentSignalCleanup=null,this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},t.prototype.mapSDKType=function(e){return e==="plugin"?"@amplitude/plugin-session-replay-browser":e==="segment"?"@amplitude/segment-session-replay-plugin":null},t.prototype.setMetadata=function(e,n,r,i,a,s,o){var c=e?.toString()?nw(e.toString()):void 0;this.metadata={joinedConfig:n,localConfig:r,remoteConfig:i,sessionId:e,hashValue:c,sampleRate:n.sampleRate,replaySDKType:this.mapSDKType(o),replaySDKVersion:a,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:s}},t.prototype.initializeNetworkObservers=function(){var e,n,r;return te(this,void 0,void 0,function(){var i,a;return ee(this,function(s){switch(s.label){case 0:if(!(!((r=(n=(e=this.config)===null||e===void 0?void 0:e.loggingConfig)===null||n===void 0?void 0:n.network)===null||r===void 0)&&r.enabled&&!this.networkObservers))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Ne(()=>import("./observers-Ce9A8Dyt.js"),__vite__mapDeps([10,1,2,3,4,5,6,7]))];case 2:return i=s.sent().NetworkObservers,this.networkObservers=new i,[3,4];case 3:return a=s.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",a),[3,4];case 4:return[2]}})})},t}(),eo=function(t){return function(){var e=t.config,n=e||VU(),r=n.loggerProvider,i=n.logLevel;return{logger:r,logLevel:i}}},$2e=function(){var t=new k2e;return{init:Ct(t.init.bind(t),"init",eo(t)),evaluateTargetingAndCapture:Ct(t.evaluateTargetingAndCapture.bind(t),"evaluateTargetingAndRecord",eo(t)),setSessionId:Ct(t.setSessionId.bind(t),"setSessionId",eo(t)),getSessionId:Ct(t.getSessionId.bind(t),"getSessionId",eo(t)),getSessionReplayProperties:Ct(t.getSessionReplayProperties.bind(t),"getSessionReplayProperties",eo(t)),flush:Ct(t.flush.bind(t),"flush",eo(t)),start:Ct(t.start.bind(t),"start",eo(t)),stop:Ct(t.stop.bind(t),"stop",eo(t)),shutdown:Ct(t.shutdown.bind(t),"shutdown",eo(t))}};const Ko=$2e();var P2e=Ko.init,R2e=Ko.setSessionId,O2e=Ko.getSessionId,M2e=Ko.getSessionReplayProperties,N2e=Ko.flush,D2e=Ko.start,F2e=Ko.stop,U2e=Ko.shutdown,j2e=Ko.evaluateTargetingAndCapture,_c;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(_c||(_c={}));var vT;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(vT||(vT={}));var wT;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(wT||(wT={}));var B2e=[_c.SET,_c.SET_ONCE,_c.ADD,_c.APPEND,_c.PREPEND,_c.POSTINSERT],V2e=function(t){if(t.user_properties){var e={},n=Object.keys(t.user_properties);
36return n.forEach(function(r){if(B2e.includes(r)){var i=t.user_properties&&t.user_properties[r];e=re(re({},e),i)}}),e}},bT="1.34.0",H2e="[Amplitude]",W2e="".concat(H2e," Session Replay ID"),Iw=function(){function t(e){this.name=t.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:N2e,getSessionId:O2e,getSessionReplayProperties:M2e,init:P2e,setSessionId:R2e,start:D2e,stop:F2e,shutdown:U2e,evaluateTargetingAndCapture:j2e},this.options=re({forceSessionTracking:!1},e),this.srInitOptions=this.options}return t.prototype.setup=function(e,n){var r,i,a,s,o,c,l,u;return te(this,void 0,void 0,function(){var d,f,h;return ee(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),e?.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(bT,".")),this.config=e,this.options.forceSessionTracking&&(typeof e.defaultTracking=="boolean"?e.defaultTracking===!1&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=re(re({},e.defaultTracking),{sessions:!0})),d=gu(this.config.instanceName).identityStore,f=d.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:(r=this.options.deviceId)!==null&&r!==void 0?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||((i=this.config.remoteConfig)===null||i===void 0?void 0:i.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:(a=this.options.privacyConfig)===null||a===void 0?void 0:a.blockSelector,maskSelector:(s=this.options.privacyConfig)===null||s===void 0?void 0:s.maskSelector,unmaskSelector:(o=this.options.privacyConfig)===null||o===void 0?void 0:o.unmaskSelector,defaultMaskLevel:(c=this.options.privacyConfig)===null||c===void 0?void 0:c.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:bT},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:(l=this.options.useWebWorker)!==null&&l!==void 0?l:(u=this.options.experimental)===null||u===void 0?void 0:u.useWebWorker,userProperties:f,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval,captureAdoptedStyleSheets:this.options.captureAdoptedStyleSheets,crossOriginIframes:this.options.crossOriginIframes,flushIntervalConfig:this.options.flushIntervalConfig,eagerFullSnapshotSend:this.options.eagerFullSnapshotSend,captureFullSnapshotOnFocus:this.options.captureFullSnapshotOnFocus,maxPersistedEventsSizeBytes:this.options.maxPersistedEventsSizeBytes,maxSingleEventSizeBytes:this.options.maxSingleEventSizeBytes,sendTimeoutMs:this.options.sendTimeoutMs,handleSendEvents:this.options.handleSendEvents,handleFetchConfig:this.options.handleFetchConfig},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return p.sent(),[3,3];case 2:return h=p.sent(),e?.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(h.message)),[3,3];case 3:return[2]}})})},t.prototype.onSessionIdChanged=function(e){var n;return te(this,void 0,void 0,function(){return ee(this,function(r){switch(r.label){case 0:return(n=this.config)===null||n===void 0||n.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return r.sent(),[2]}})})},t.prototype.onOptOutChanged=function(e){var n;return te(this,void 0,void 0,function(){var r;return ee(this,function(i){switch(i.label){case 0:return(n=this.config)===null||n===void 0||n.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return r=this.config!=null,r?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r=i.sent(),i.label=3;case 3:i.label=4;case 4:return[2]}})})},t.prototype.execute=function(e){var n,r,i;return te(this,void 0,void 0,function(){var a,c,a,s,o,c,l;return ee(this,function(u){switch(u.label){case 0:return u.trys.push([0,9,,10]),this.options.customSessionId?(a=this.options.customSessionId(e),a?a===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(a).promise]:[3,3]):[3,4];case 1:u.sent(),u.label=2;case 2:c=this.sessionReplay.getSessionReplayProperties(),e.event_properties=re(re({},e.event_properties),c),u.label=3;case 3:return[3,8];case 4:return a=(n=this.config)===null||n===void 0?void 0:n.sessionId,a&&a!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(a).promise]:[3,6];case 5:u.sent(),u.label=6;case 6:return a&&a===e.session_id?(s=void 0,e.event_type===ni.IDENTIFY&&(s=V2e(e)),o=He(),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:s,page:((r=o?.location)===null||r===void 0?void 0:r.href)!=null?{url:o.location.href}:void 0})]):[3,8];case 7:u.sent(),c=this.sessionReplay.getSessionReplayProperties(),e.event_properties=re(re({},e.event_properties),c),u.label=8;case 8:return e.event_type===ni.IDENTIFY&&e.event_properties&&delete e.event_properties[W2e],[2,Promise.resolve(e)];case 9:return l=u.sent(),(i=this.config)===null||i===void 0||i.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(l.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},t.prototype.teardown=function(){var e;return te(this,void 0,void 0,function(){return ee(this,function(n){try{this.sessionReplay.shutdown(),this.config=null}catch(r){(e=this.config)===null||e===void 0||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(r.message))}return[2]})})},t.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},t.prototype.start=function(){return te(this,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,this.sessionReplay.start().promise];case 1:return e.sent(),[2]}})})},t.prototype.stop=function(){this.sessionReplay.stop()},t.pluginName="@amplitude/plugin-session-replay-browser",t}(),q2e=function(t){return new Iw(t)};const et={IS:"is",IS_NOT:"is not",CONTAINS:"contains",DOES_NOT_CONTAIN:"does not contain",LESS_THAN:"less",LESS_THAN_EQUALS:"less or equal",GREATER_THAN:"greater",GREATER_THAN_EQUALS:"greater or equal",VERSION_LESS_THAN:"version less",VERSION_LESS_THAN_EQUALS:"version less or equal",VERSION_GREATER_THAN:"version greater",VERSION_GREATER_THAN_EQUALS:"version greater or equal",SET_IS:"set is",SET_IS_NOT:"set is not",SET_CONTAINS:"set contains",SET_DOES_NOT_CONTAIN:"set does not contain",SET_CONTAINS_ANY:"set contains any",SET_DOES_NOT_CONTAIN_ANY:"set does not contain any",REGEX_MATCH:"regex match",REGEX_DOES_NOT_MATCH:"regex does not match"},z2e=t=>{const e=[];let n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)==55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)==56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return Uint8Array.from(e)},P3=-862048943,R3=461845907,O3=15,Z2e=13,K2e=5,G2e=-430675100,Y2e=(t,e=0)=>{const n=z2e(t),r=n.length,i=r>>2;let a=e;for(let c=0;c<i;c++){const l=c<<2,u=Q2e(n,l);a=J2e(u,a)}const s=i<<2;let o=0;switch(r-s){case 3:o^=n[s+2]<<16,o^=n[s+1]<<8,o^=n[s],o=Math.imul(o,P3),o=xh(o,O3),o=Math.imul(o,R3),a^=o;break;case 2:o^=n[s+1]<<8,o^=n[s],o=Math.imul(o,P3),o=xh(o,O3),o=Math.imul(o,R3),a^=o;break;case 1:o^=n[s],o=Math.imul(o,P3),o=xh(o,O3),o=Math.imul(o,R3),a^=o;break}return a^=r,X2e(a)>>>0},J2e=(t,e)=>{let n=t,r=e;return n=Math.imul(n,P3),n=xh(n,O3),n=Math.imul(n,R3),r^=n,r=xh(r,Z2e),r=Math.imul(r,K2e),r+G2e|0},X2e=t=>{let e=t;return e^=e>>>16,e=Math.imul(e,-2048144789),e^=e>>>13,e=Math.imul(e,-1028477387),e^=e>>>16,e},xh=(t,e,n=32)=>{e>n&&(e=e%n);const r=4294967295<<n-e>>>0,i=(t&r)>>>0>>>n-e>>>0;return(t<<e|i)>>>0},Q2e=(t,e=0)=>{const n=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return efe(n)},efe=t=>(t&-16777216)>>>24|(t&16711680)>>>8|(t&65280)<<8|(t&255)<<24,n5=(t,e)=>{if(!(!e||e.length===0)){for(const n of e){if(!n||!t||typeof t!="object")return;t=t[n]}if(t!=null)return t}}
36,tfe="(\\d+)\\.(\\d+)",nfe="(\\d+)",rfe="(-(([-\\w]+\\.?)*))?",ife=`^${tfe}(\\.${nfe}${rfe})?$`;class eE{constructor(e,n,r,i=void 0){this.major=e,this.minor=n,this.patch=r,this.preRelease=i}static parse(e){if(!e)return;const n=new RegExp(ife).exec(e);if(!n)return;const r=Number(n[1]),i=Number(n[2]);if(isNaN(r)||isNaN(i))return;const a=Number(n[4])||0,s=n[5]||void 0;return new eE(r,i,a,s)}compareTo(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0}}class afe{evaluate(e,n){const r={},i={context:e,result:r};for(const a of n){const s=this.evaluateFlag(i,a);s&&(r[a.key]=s)}return r}evaluateWithTraces(e,n){const r={},i={},a={context:e,result:r};for(const s of n){const{variant:o,trace:c}=this.evaluateFlagWithTrace(a,s);o&&(r[s.key]=o),i[s.key]=c}return{results:r,traces:i}}evaluateFlag(e,n){let r;for(const i of n.segments)if(r=this.evaluateSegment(e,n,i),r){const a=Object.assign(Object.assign(Object.assign({},n.metadata),i.metadata),r.metadata);r=Object.assign(Object.assign({},r),{metadata:a});break}return r}evaluateFlagWithTrace(e,n){var r,i;const a=[];let s,o,c;for(const u of n.segments){if(!u.conditions){const g=this.bucket(e,u),y=g!==void 0;a.push({segmentMetadata:u.metadata,conditionsPassed:!0,bucketed:y,bucketVariant:g,conditionResult:void 0,matched:y}),!s&&g!==void 0&&(s=n.variants[g],o=u,c=(r=u.metadata)===null||r===void 0?void 0:r.segmentName);continue}const d=[];let f=!1;for(const g of u.conditions){let y=!0;const v=[];for(const b of g){const w=n5(e,b.selector),_=this.matchCondition(e,b);if(v.push({propValue:w,condition:b,matched:_}),!_){y=!1;break}}if(d.push(v),y){f=!0;break}}let h=!1,p;f&&(p=this.bucket(e,u),h=p!==void 0),a.push({segmentMetadata:u.metadata,conditionsPassed:f,bucketed:h,bucketVariant:p,conditionResult:d,matched:f&&h}),f&&p!==void 0&&!s&&(s=n.variants[p],o=u,c=(i=u.metadata)===null||i===void 0?void 0:i.segmentName)}if(s&&o){const u=Object.assign(Object.assign(Object.assign({},n.metadata),o.metadata),s.metadata);s=Object.assign(Object.assign({},s),{metadata:u})}const l={flagKey:n.key,matched:s!==void 0,matchedSegment:c,steps:a};return{variant:s,trace:l}}evaluateSegment(e,n,r){if(!r.conditions){const a=this.bucket(e,r);return a!==void 0?n.variants[a]:void 0}if(this.evaluateConditions(e,r.conditions)){const a=this.bucket(e,r);return a!==void 0?n.variants[a]:void 0}}evaluateConditions(e,n){for(const r of n){let i=!0;for(const a of r)if(i=this.matchCondition(e,a),!i)break;if(i)return!0}return!1}matchCondition(e,n){const r=n5(e,n.selector);if(r==null)return this.matchNull(n.op,n.values);{const i=this.coerceStringArray(r);if(this.isSetOperator(n.op))return i?this.matchSet(i,n.op,n.values):!1;if(i)return this.matchStringsNonSet(i,n.op,n.values);{const a=this.coerceString(r);return a!==void 0?this.matchString(a,n.op,n.values):!1}}}getHash(e){return Y2e(e)}bucket(e,n){if(!n.bucket)return n.variant;const r=this.coerceString(n5(e,n.bucket.selector));if(!r||r.length===0)return n.variant;const i=`${n.bucket.salt}/${r}`,a=this.getHash(i),s=a%100,o=Math.floor(a/100);for(const c of n.bucket.allocations){const l=c.range[0],u=c.range[1];if(s>=l&&s<u)for(const d of c.distributions){const f=d.range[0],h=d.range[1];if(o>=f&&o<h)return d.variant}}return n.variant}matchNull(e,n){const r=this.containsNone(n);switch(e){case et.IS:case et.CONTAINS:case et.LESS_THAN:case et.LESS_THAN_EQUALS:case et.GREATER_THAN:case et.GREATER_THAN_EQUALS:case et.VERSION_LESS_THAN:case et.VERSION_LESS_THAN_EQUALS:case et.VERSION_GREATER_THAN:case et.VERSION_GREATER_THAN_EQUALS:case et.SET_IS:case et.SET_CONTAINS:case et.SET_CONTAINS_ANY:return r;case et.IS_NOT:case et.DOES_NOT_CONTAIN:case et.SET_DOES_NOT_CONTAIN:case et.SET_DOES_NOT_CONTAIN_ANY:return!r;default:return!1}}matchSet(e,n,r){switch(n){case et.SET_IS:return this.setEquals(e,r);case et.SET_IS_NOT:return!this.setEquals(e,r);case et.SET_CONTAINS:return this.matchesSetContainsAll(e,r);case et.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(e,r);case et.SET_CONTAINS_ANY:return this.matchesSetContainsAny(e,r);case et.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(e,r);default:return!1}}matchString(e,n,r){switch(n){case et.IS:return this.matchesIs(e,r);case et.IS_NOT:return!this.matchesIs(e,r);case et.CONTAINS:return this.matchesContains(e,r);case et.DOES_NOT_CONTAIN:return!this.matchesContains(e,r);case et.LESS_THAN:case et.LESS_THAN_EQUALS:case et.GREATER_THAN:case et.GREATER_THAN_EQUALS:return this.matchesComparable(e,n,r,i=>this.parseNumber(i),(i,a,s)=>this.comparator(i,a,s));case et.VERSION_LESS_THAN:case et.VERSION_LESS_THAN_EQUALS:case et.VERSION_GREATER_THAN:case et.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(e,n,r,i=>eE.parse(i),(i,a,s)=>this.versionComparator(i,a,s));case et.REGEX_MATCH:return this.matchesRegex(e,r);case et.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(e,r);default:return!1}}matchStringsNonSet(e,n,r){return e.some(i=>this.matchString(i,n,r))}matchesIs(e,n){if(this.containsBooleans(n)){const r=e.toLowerCase();if(r==="true"||r==="false")return n.some(i=>i.toLowerCase()===r)}return n.some(r=>e===r)}matchesContains(e,n){for(const r of n)if(e.toLowerCase().includes(r.toLowerCase()))return!0;return!1}matchesComparable(e,n,r,i,a){const s=i(e),o=r.map(c=>i(c)).filter(c=>c!==void 0);return s===void 0||o.length===0?r.some(c=>
36this.comparator(e,n,c)):o.some(c=>a(s,n,c))}comparator(e,n,r){switch(n){case et.LESS_THAN:case et.VERSION_LESS_THAN:return e<r;case et.LESS_THAN_EQUALS:case et.VERSION_LESS_THAN_EQUALS:return e<=r;case et.GREATER_THAN:case et.VERSION_GREATER_THAN:return e>r;case et.GREATER_THAN_EQUALS:case et.VERSION_GREATER_THAN_EQUALS:return e>=r;default:return!1}}versionComparator(e,n,r){const i=e.compareTo(r);switch(n){case et.LESS_THAN:case et.VERSION_LESS_THAN:return i<0;case et.LESS_THAN_EQUALS:case et.VERSION_LESS_THAN_EQUALS:return i<=0;case et.GREATER_THAN:case et.VERSION_GREATER_THAN:return i>0;case et.GREATER_THAN_EQUALS:case et.VERSION_GREATER_THAN_EQUALS:return i>=0;default:return!1}}matchesRegex(e,n){return n.some(r=>!!new RegExp(r).exec(e))}containsNone(e){return e.some(n=>n==="(none)")}containsBooleans(e){return e.some(n=>{switch(n.toLowerCase()){case"true":case"false":return!0;default:return!1}})}parseNumber(e){var n;return(n=Number(e))!==null&&n!==void 0?n:void 0}coerceString(e){if(e!=null)return typeof e=="object"?JSON.stringify(e):String(e)}coerceStringArray(e){if(Array.isArray(e))return e.map(i=>this.coerceString(i)).filter(Boolean);const n=String(e);if(n.startsWith("["))try{const r=JSON.parse(n);return Array.isArray(r)?r.map(i=>this.coerceString(i)).filter(Boolean):void 0}catch{return}}isSetOperator(e){switch(e){case et.SET_IS:case et.SET_IS_NOT:case et.SET_CONTAINS:case et.SET_DOES_NOT_CONTAIN:case et.SET_CONTAINS_ANY:case et.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}}setEquals(e,n){const r=new Set(e),i=new Set(n);return r.size===i.size&&[...i].every(a=>r.has(a))}matchesSetContainsAll(e,n){if(e.length<n.length)return!1;for(const r of n)if(!this.matchesIs(r,e))return!1;return!0}matchesSetContainsAny(e,n){for(const r of n)if(this.matchesIs(r,e))return!0;return!1}}const _T=(t,e)=>{const n=Object.assign({},t),r=[],i=e||Object.keys(n);for(const a of i){const s=rj(a,n);s&&r.push(...s)}return r},rj=(t,e,n=[])=>{const r=e[t];if(r){if(!r.dependencies||r.dependencies.length===0)return delete e[r.key],[r]}else return;n.push(r.key);const i=[];for(const a of r.dependencies){if(n.some(o=>o===a))throw Error(`Detected a cycle between flags ${n.join(", ")}`);const s=rj(a,e,n);s&&i.push(...s)}return i.push(r),n.pop(),delete e[r.key],i};function ij(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?a(u.value):i(u.value).then(o,c)}l((r=r.apply(t,[])).next())})}const aj="3.7.8",sfe=aj,Z2=typeof De=="function",CT=typeof TextDecoder=="function"?new TextDecoder:void 0,ET=typeof TextEncoder=="function"?new TextEncoder:void 0,ofe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ih=Array.prototype.slice.call(ofe),_1=(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(ih),cfe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,wr=String.fromCharCode.bind(String),ST=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),sj=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),oj=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),cj=t=>{let e,n,r,i,a="";const s=t.length%3;for(let o=0;o<t.length;){if((n=t.charCodeAt(o++))>255||(r=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=n<<16|r<<8|i,a+=ih[e>>18&63]+ih[e>>12&63]+ih[e>>6&63]+ih[e&63]}return s?a.slice(0,s-3)+"===".substring(s):a},tE=typeof btoa=="function"?t=>btoa(t):Z2?t=>De.from(t,"binary").toString("base64"):cj,Tw=Z2?t=>De.from(t).toString("base64"):t=>{let n=[];for(let r=0,i=t.length;r<i;r+=4096)n.push(wr.apply(null,t.subarray(r,r+4096)));return tE(n.join(""))},M3=(t,e=!1)=>e?sj(Tw(t)):Tw(t),lfe=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?wr(192|e>>>6)+wr(128|e&63):wr(224|e>>>12&15)+wr(128|e>>>6&63)+wr(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return wr(240|e>>>18&7)+wr(128|e>>>12&63)+wr(128|e>>>6&63)+wr(128|e&63)}},ufe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,lj=t=>t.replace(ufe,lfe),AT=Z2?t=>De.from(t,"utf8").toString("base64"):ET?t=>Tw(ET.encode(t)):t=>tE(lj(t)),Bd=(t,e=!1)=>e?sj(AT(t)):AT(t),xT=t=>Bd(t,!0),dfe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ffe=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),n=e-65536;return wr((n>>>10)+55296)+wr((n&1023)+56320);case 3:return wr((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return wr((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},uj=t=>t.replace(dfe,ffe),dj=t=>
36{if(t=t.replace(/\s+/g,""),!cfe.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,n,r,i=[];for(let a=0;a<t.length;)e=_1[t.charAt(a++)]<<18|_1[t.charAt(a++)]<<12|(n=_1[t.charAt(a++)])<<6|(r=_1[t.charAt(a++)]),n===64?i.push(wr(e>>16&255)):r===64?i.push(wr(e>>16&255,e>>8&255)):i.push(wr(e>>16&255,e>>8&255,e&255));return i.join("")},nE=typeof atob=="function"?t=>atob(oj(t)):Z2?t=>De.from(t,"base64").toString("binary"):dj,fj=Z2?t=>ST(De.from(t,"base64")):t=>ST(nE(t).split("").map(e=>e.charCodeAt(0))),hj=t=>fj(pj(t)),hfe=Z2?t=>De.from(t,"base64").toString("utf8"):CT?t=>CT.decode(fj(t)):t=>uj(nE(t)),pj=t=>oj(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),Lw=t=>hfe(pj(t)),pfe=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},gj=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),yj=function(){const t=(e,n)=>Object.defineProperty(String.prototype,e,gj(n));t("fromBase64",function(){return Lw(this)}),t("toBase64",function(e){return Bd(this,e)}),t("toBase64URI",function(){return Bd(this,!0)}),t("toBase64URL",function(){return Bd(this,!0)}),t("toUint8Array",function(){return hj(this)})},mj=function(){const t=(e,n)=>Object.defineProperty(Uint8Array.prototype,e,gj(n));t("toBase64",function(e){return M3(this,e)}),t("toBase64URI",function(){return M3(this,!0)}),t("toBase64URL",function(){return M3(this,!0)})},gfe=()=>{yj(),mj()},kw={version:aj,VERSION:sfe,atob:nE,atobPolyfill:dj,btoa:tE,btoaPolyfill:cj,fromBase64:Lw,toBase64:Bd,encode:Bd,encodeURI:xT,encodeURL:xT,utob:lj,btou:uj,decode:Lw,isValid:pfe,fromUint8Array:M3,toUint8Array:hj,extendString:yj,extendUint8Array:mj,extendBuiltins:gfe};
36let vj=class wj extends Error{constructor(e,n){super(n),this.statusCode=e,Object.setPrototypeOf(this,wj.prototype)}};class lp extends Error{constructor(e){super(e),Object.setPrototypeOf(this,lp.prototype)}}class yfe{constructor(e,n,r){this.deploymentKey=e,this.serverUrl=n,this.httpClient=r}getVariants(e,n){return ij(this,void 0,void 0,function*(){const r=kw.encodeURL(JSON.stringify(e)),i={Authorization:`Api-Key ${this.deploymentKey}`,"X-Amp-Exp-User":r};n?.flagKeys&&(i["X-Amp-Exp-Flag-Keys"]=kw.encodeURL(JSON.stringify(n.flagKeys))),n?.trackingOption&&(i["X-Amp-Exp-Track"]=n.trackingOption),n?.exposureTrackingOption&&(i["X-Amp-Exp-Exposure-Track"]=n.exposureTrackingOption);const a=new URL(`${this.serverUrl}/sdk/v2/vardata?v=0`);n?.evaluationMode&&a.searchParams.append("eval_mode",n?.evaluationMode),n?.deliveryMethod&&a.searchParams.append("delivery_method",n?.deliveryMethod);const s=yield this.httpClient.request({requestUrl:a.toString(),method:"GET",headers:i,timeoutMillis:n?.timeoutMillis});if(s.status!=200)throw new vj(s.status,`Fetch error response: status=${s.status}`);return JSON.parse(s.body)})}}class mfe{constructor(e,n,r){this.deploymentKey=e,this.serverUrl=n,this.httpClient=r}getFlags(e){return ij(this,void 0,void 0,function*(){const n={Authorization:`Api-Key ${this.deploymentKey}`};e?.libraryName&&e?.libraryVersion&&(n["X-Amp-Exp-Library"]=`${e.libraryName}/${e.libraryVersion}`),e?.user&&(n["X-Amp-Exp-User"]=kw.encodeURL(JSON.stringify(e.user)));const r=yield this.httpClient.request({requestUrl:`${this.serverUrl}/sdk/v2/flags`+(e?.deliveryMethod?`?delivery_method=${e.deliveryMethod}`:""),method:"GET",headers:n,timeoutMillis:e?.timeoutMillis});if(r.status!=200)throw Error(`Flags error response: status=${r.status}`);return JSON.parse(r.body).reduce((a,s)=>(a[s.key]=s,a),{})})}}const qr=()=>{if(typeof globalThis<"u"&&globalThis!==null)return globalThis;if(typeof window<"u"&&window!==null)return window;if(typeof self<"u"&&self!==null)return self;if(typeof rt<"u"&&rt!==null)return rt},vfe=()=>{const t=qr();if(t)try{const e="EXP_test";return t.localStorage.setItem(e,e),t.localStorage.removeItem(e),!0}catch{return!1}return!1},bj=()=>{var t;return(t=qr())===null||t===void 0?void 0:t.localStorage},_j=()=>{var t;return(t=qr())===null||t===void 0?void 0:t.sessionStorage},wfe=()=>{var t;return(t=qr())===null||t===void 0?void 0:t.document},bfe=()=>{const t=qr();return t?.fetch?t.fetch.bind(t):void 0},rE=()=>{const t=qr();return t?.setTimeout?t.setTimeout.bind(t):void 0},_fe=()=>{const t=qr();return t?.clearTimeout?t.clearTimeout.bind(t):void 0},Cj=()=>{const t=qr();return t?.setInterval?t.setInterval.bind(t):void 0},Ej=()=>{const t=qr();return t?.clearInterval?t.clearInterval.bind(t):void 0};class Cfe{constructor(e,n){this.poller=void 0,this.action=e,this.ms=n}start(){if(this.poller)return;const e=Cj();e&&(this.poller=e(()=>{this.action()},this.ms),this.action())}stop(){if(!this.poller)return;const e=Ej();e&&e(this.poller),this.poller=void 0}}var $w={exports:{}};(function(t,e){(function(n,r){var i="0.7.33",a="",s="?",o="function",c="undefined",l="object",u="string",d="major",f="model",h="name",p="type",g="vendor",y="version",v="architecture",b="console",w="mobile",_="tablet",E="smarttv",C="wearable",x="embedded",$=350,T="Amazon",U="Apple",O="ASUS",F="BlackBerry",k="Browser",S="Chrome",I="Edge",A="Firefox",R="Google",N="Huawei",P="LG",j="Microsoft",M="Motorola",V="Opera",B="Samsung",G="Sharp",Z="Sony",ie="Xiaomi",oe="Zebra",z="Facebook",J=function(ye,ge){var Pe={};for(var _e in ye)ge[_e]&&ge[_e].length%2===0?Pe[_e]=ge[_e].concat(ye[_e]):Pe[_e]=ye[_e];return Pe},K=function(ye){for(var ge={},Pe=0;Pe<ye.length;Pe++)ge[ye[Pe].toUpperCase()]=ye[Pe];return ge},ne=function(ye,ge){return typeof ye===u?ce(ge).indexOf(ce(ye))!==-1:!1},ce=function(ye){return ye.toLowerCase()},xe=function(ye){return typeof ye===u?ye.replace(/[^\d\.]/g,a).split(".")[0]:r},ke=function(ye,ge){if(typeof ye===u)return ye=ye.replace(/^\s\s*/,a),typeof ge===c?ye:ye.substring(0,$)},Me=function(ye,ge){for(var Pe=0,_e,Ie,qe,Fe,pt,ze;Pe<ge.length&&!pt;){var Ue=ge[Pe],Ve=ge[Pe+1];for(_e=Ie=0;_e<Ue.length&&!pt;)if(pt=Ue[_e++].exec(ye),pt)for(qe=0;qe<Ve.length;qe++)ze=pt[++Ie],Fe=Ve[qe],typeof Fe===l&&Fe.length>0?Fe.length===2?typeof Fe[1]==o?this[Fe[0]]=Fe[1].call(this,ze):this[Fe[0]]=Fe[1]:Fe.length===3?typeof Fe[1]===o&&!(Fe[1].exec&&Fe[1].test)?this[Fe[0]]=ze?Fe[1].call(this,ze,Fe[2]):r:this[Fe[0]]=ze?ze.replace(Fe[1],Fe[2]):r:Fe.length===4&&(this[Fe[0]]=ze?Fe[3].call(this,ze.replace(Fe[1],Fe[2])):r):this[Fe]=ze||r;Pe+=2}},$t=function(ye,ge){for(var Pe in ge)if(typeof ge[Pe]===l&&ge[Pe].length>0){for(var _e=0;_e<ge[Pe].length;_e++)if(ne(ge[Pe][_e],ye))return Pe===s?r:Pe}else if(ne(ge[Pe],ye))return Pe===s?r:Pe;return ye},H={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},se={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,V+" Mini"]],[/\bopr\/([\w\.]+)/i],[y,[h,V]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[y,[h,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/yabrowser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+k],y],[/\bfocus\/([\w\.]+)/i],[y,[h,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,V+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,V+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[y,[h,A]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+k],y],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[h,y],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,z],y],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,S+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+k]],[/(chrome|omniweb|arora|[t
vendor: 4,754 bytes, line 36
36izenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,$t,H]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[h,y],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[v,"amd64"]],[/(ia32(?=;))/i],[[v,ce]],[/((?:i[346]|x)86)[;\)]/i],[[v,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[v,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[v,"armhf"]],[/windows (ce|mobile); ppc;/i],[[v,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[v,/ower/,a,ce]],[/(sun4\w)[;\)]/i],[[v,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[v,ce]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[g,B],[p,_]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[g,B],[p,w]],[/((ipod|iphone)\d+,\d+)/i],[f,[g,U],[p,w]],[/(ipad\d+,\d+)/i],[f,[g,U],[p,_]],[/\((ip(?:hone|od)[\w ]*);/i],[f,[g,U],[p,w]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[g,U],[p,_]],[/(macintosh);/i],[f,[g,U]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[g,N],[p,_]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[g,N],[p,w]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[g,ie],[p,w]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[g,ie],[p,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[g,"OPPO"],[p,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[g,"Vivo"],[p,w]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[g,"Realme"],[p,w]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[g,M],[p,w]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[g,M],[p,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[g,P],[p,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[g,P],[p,w]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[g,"Lenovo"],[p,_]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[g,"Nokia"],[p,w]],[/(pixel c)\b/i],[f,[g,R],[p,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[g,R],[p,w]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[g,Z],[p,w]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[g,Z],[p,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[g,"OnePlus"],[p,w]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[g,T],[p,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[g,T],[p,w]],[/(playbook);[-\w\),; ]+(rim)/i],[f,g,[p,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[g,F],[p,w]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[g,O],[p,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[g,O],[p,w]],[/(nexus 9)/i],[f,[g,"HTC"],[p,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[f,/_/g," "],[p,w]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[g,"Acer"],[p,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[g,"Meizu"],[p,w]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[g,G],[p,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asu
vendor: 6,789 bytes, line 36
36s)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,f,[p,w]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,f,[p,_]],[/(surface duo)/i],[f,[g,j],[p,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[g,"Fairphone"],[p,w]],[/(u304aa)/i],[f,[g,"AT&T"],[p,w]],[/\bsie-(\w*)/i],[f,[g,"Siemens"],[p,w]],[/\b(rct\w+) b/i],[f,[g,"RCA"],[p,_]],[/\b(venue[\d ]{2,7}) b/i],[f,[g,"Dell"],[p,_]],[/\b(q(?:mv|ta)\w+) b/i],[f,[g,"Verizon"],[p,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[g,"Barnes & Noble"],[p,_]],[/\b(tm\d{3}\w+) b/i],[f,[g,"NuVision"],[p,_]],[/\b(k88) b/i],[f,[g,"ZTE"],[p,_]],[/\b(nx\d{3}j) b/i],[f,[g,"ZTE"],[p,w]],[/\b(gen\d{3}) b.+49h/i],[f,[g,"Swiss"],[p,w]],[/\b(zur\d{3}) b/i],[f,[g,"Swiss"],[p,_]],[/\b((zeki)?tb.*\b) b/i],[f,[g,"Zeki"],[p,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],f,[p,_]],[/\b(ns-?\w{0,9}) b/i],[f,[g,"Insignia"],[p,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[g,"NextBook"],[p,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],f,[p,w]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],f,[p,w]],[/\b(ph-1) /i],[f,[g,"Essential"],[p,w]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[g,"Envizen"],[p,_]],[/\b(trio[-\w\. ]+) b/i],[f,[g,"MachSpeed"],[p,_]],[/\btu_(1491) b/i],[f,[g,"Rotor"],[p,_]],[/(shield[\w ]+) b/i],[f,[g,"Nvidia"],[p,_]],[/(sprint) (\w+)/i],[g,f,[p,w]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[g,j],[p,w]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[g,oe],[p,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[g,oe],[p,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,f,[p,b]],[/droid.+; (shield) bui/i],[f,[g,"Nvidia"],[p,b]],[/(playstation [345portablevi]+)/i],[f,[g,Z],[p,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[g,j],[p,b]],[/smart-tv.+(samsung)/i],[g,[p,E]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[g,B],[p,E]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,P],[p,E]],[/(apple) ?tv/i],[g,[f,U+" TV"],[p,E]],[/crkey/i],[[f,S+"cast"],[g,R],[p,E]],[/droid.+aft(\w)( bui|\))/i],[f,[g,T],[p,E]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[g,G],[p,E]],[/(bravia[\w ]+)( bui|\))/i],[f,[g,Z],[p,E]],[/(mitv-\w{5}) bui/i],[f,[g,ie],[p,E]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[g,ke],[f,ke],[p,E]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,E]],[/((pebble))app/i],[g,f,[p,C]],[/droid.+; (glass) \d/i],[f,[g,R],[p,C]],[/droid.+; (wt63?0{2,3})\)/i],[f,[g,oe],[p,C]],[/(quest( 2)?)/i],[f,[g,z],[p,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[p,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[p,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[p,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,w]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,I+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[h,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[h,[y,$t,q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,"Windows"],[y,$t,q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,"Mac OS"],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,y],[/\(bb(10);/i],[y,[h,F]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/crkey\/([\d\.]+)/i],[y,[h,S+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[h,"Chromium OS"],y],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[h,y]]},de=function(ye,ge){if(typeof ye===l&&(ge=ye,ye=r),!(this instanceof de))return new de(ye,ge).getResult();var Pe=ye||(typeof n!==c&&n.navigator&&n.navigator.userAgent?n.navigator.userAgent:a),_e=ge?J(se,ge):se;return this.getBrowser=function(){var Ie={};return Ie[h]=r,Ie[y]=r,Me.call(Ie,Pe,_e.browser),Ie.major=xe(Ie.version),Ie},this.getCPU=function(){var Ie={};return Ie[v]=r,Me.call(Ie,Pe,_e.cpu),Ie},this.getDevice=function(){var Ie={};return Ie[g]=r,Ie[f]=r,Ie[p]=r,Me.call(Ie,Pe,_e.device),Ie},this.getEngine=function(){var Ie={};return Ie[h]=r,Ie[y]=r,Me.call(Ie,Pe,_e.engine),Ie},this.getOS=function(){var Ie={};return Ie[h]=r,Ie[y]=r,Me.call(Ie,Pe,_e.os),Ie},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Pe},this.setUA=function(Ie){return Pe=typeof Ie===u&&Ie.length>$?ke(Ie,$):Ie,this},this.setUA(Pe),this};de.VERSION=i,de.BROWSER=K([h,y,d]),de.CPU=K([v]),de.DEVICE=K([f,g,p,b,w,E,_,C,x]),de.ENGINE=de.OS=K([h,y]),t.exports&&(e=t.exports=de),e.UAParser=de;var he=typeof n!==c&&(n.jQuery||n.Zepto);if(he&&!he.ua){var pe=new de;he.ua=pe.getResult(),he.ua.get=function(){return pe.getUA()},he.ua.set=function(ye){pe.setUA(ye);var ge=pe.getResult();for(var Pe in ge)he.ua[Pe]=ge[Pe]}}})(typeof window=="object"?window:_s)}
36)($w,$w.exports);var Efe=$w.exports;function rr(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?a(u.value):i(u.value).then(o,c)}l((r=r.apply(t,e||[])).next())})}const IT=(t,e=!1)=>{const n=iE(t,e);let r;const i=wfe();if(!i)return;const a=i.cookie.split("; ");for(const s of a){const[o,c]=s.split("=",2);o===n&&(r=decodeURIComponent(c))}if(r)try{if(e){const c=atob(r);return JSON.parse(decodeURIComponent(c))}const s=r.split(".");let o;return s.length>=2&&s[1]&&(o=atob(s[1])),{deviceId:s[0],userId:o}}catch{return}},Sfe=t=>{const e=iE(t,!0);try{const n=bj();if(!n)return;const r=n.getItem(e);if(!r)return;const i=JSON.parse(r);return typeof i!="object"?void 0:i}catch{return}},Afe=t=>{const e=iE(t,!0);try{const n=_j();if(!n)return;const r=n.getItem(e);if(!r)return;const i=JSON.parse(r);return typeof i!="object"?void 0:i}catch{return}},iE=(t,e)=>{if(e)return t?.length<10?void 0:`AMP_${t.substring(0,10)}`;if(!(t?.length<6))return`amp_${t.substring(0,6)}`};class xfe{constructor(e,n,r){this.type="integration",this.apiKey=e,this.identityStore=n.identityStore,this.eventBridge=n.eventBridge,this.contextProvider=n.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}setup(e,n){return rr(this,void 0,void 0,function*(){return e?.automaticFetchOnAmplitudeIdentityChange&&this.identityStore.addIdentityListener(()=>{n?.fetch()}),this.waitForConnectorIdentity(this.timeoutMillis)})}getUser(){const e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}}track(e){return this.eventBridge.receiver?(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0):!1}loadPersistedState(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;let e=IT(this.apiKey,!0);return e?(this.commitIdentityToConnector(e),!0):(e=IT(this.apiKey,!1),e?(this.commitIdentityToConnector(e),!0):(e=Sfe(this.apiKey),e?(this.commitIdentityToConnector(e),!0):(e=Afe(this.apiKey),e?(this.commitIdentityToConnector(e),!0):!1)))}commitIdentityToConnector(e){const n=this.identityStore.editIdentity();n.setDeviceId(e.deviceId),e.userId&&n.setUserId(e.userId),n.commit()}waitForConnectorIdentity(e){return rr(this,void 0,void 0,function*(){const n=this.identityStore.getIdentity();if(!n.userId&&!n.deviceId)return Promise.race([new Promise(r=>{const i=()=>{r(),this.identityStore.removeIdentityListener(i)};this.identityStore.addIdentityListener(i)}),new Promise((r,i)=>{const a=rE();if(!a){i("Timed out waiting for Amplitude Analytics SDK to initialize.");return}a(i,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])})}}function Ife(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest,a=[],s=[],o={},c=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:c,headers:{keys:function(){return a},entries:function(){return s},get:function(u){return o[u.toLowerCase()]},has:function(u){return u.toLowerCase()in o}}}};for(var l in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(u,d,f){a.push(d=d.toLowerCase()),s.push([d,f]),o[d]=o[d]?o[d]+","+f:f}),n(c())},i.onerror=r,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(l,e.headers[l]);i.send(e.body||null)})}const Tfe=bfe()||Ife,Lfe=(t,e)=>e==null||e<=0?t:new Promise(function(n,r){const i=rE();i&&i(function(){r(new lp(`Request timeout after ${e} milliseconds`))},e),t.then(n,r)}),kfe=(t,e,n,r,i)=>Lfe(rr(void 0,void 0,void 0,function*(){const s=yield Tfe(t,{method:e,headers:n,body:r});return{status:s.status,body:yield s.text()}}),i);class $fe{constructor(e){this.client=e}request(e){return rr(this,void 0,void 0,function*(){return yield this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)})}}const Sj={request:kfe};var Ha;(function(t){t[t.Disable=0]="Disable",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug",t[t.Verbose=5]="Verbose"})(Ha||(Ha={}));var bo;(function(t){t.LocalStorage="localStorage",t.InitialVariants="initialVariants"})(bo||(bo={}));var Gn;(function(t){t.LocalStorage="storage",t.InitialVariants="initial",t.SecondaryLocalStorage="secondary-storage",t.SecondaryInitialVariants="secondary-initial",t.FallbackInline="fallback-inline",t.FallbackConfig="fallback-config",t.L
36ocalEvaluation="local-evaluation"})(Gn||(Gn={}));const TT=t=>!t||t===Gn.FallbackInline||t===Gn.FallbackConfig||t===Gn.SecondaryInitialVariants,Id={debug:!1,logLevel:Ha.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:bo.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:Sj};var LT="1.23.0";const Aj=512;class Pfe{constructor(e,n){var r;this.isReady=new Promise(a=>{this.resolve=a}),this.config=e,this.client=n;const i=(r=e.instanceName)!==null&&r!==void 0?r:Id.instanceName;this.queue=new Ofe(i,Aj,e.internalPersistenceAllowed),this.cache=new Rfe(i,e.internalPersistenceAllowed)}ready(){return this.integration?this.isReady:Promise.resolve()}setIntegration(e){this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(()=>{this.queue.setTracker(this.integration.track.bind(e)),this.resolve()},()=>{this.queue.setTracker(this.integration.track.bind(e)),this.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())}getUser(){return this.integration?this.integration.getUser():{}}track(e,n){if(this.cache.shouldTrack(e,n)){const r=this.getExposureEvent(e);this.queue.push(r)}}getExposureEvent(e){var n,r,i;let a={eventType:"$exposure",eventProperties:e};return!((n=e.metadata)===null||n===void 0)&&n.exposureEvent?a={eventType:(r=e.metadata)===null||r===void 0?void 0:r.exposureEvent,eventProperties:e}:((i=e.metadata)===null||i===void 0?void 0:i.deliveryMethod)==="web"&&(a={eventType:"$impression",eventProperties:e}),a}}class Rfe{constructor(e,n){this.persistenceAllowed=n,this.clearStoredOnReopen=!1,this.hasGatedEntries=!1,this.inMemoryCache={},this.identity={},this.storageKey=`EXP_sent_v3_${e}`}isGated(){return this.persistenceAllowed!==void 0&&!this.persistenceAllowed()}usableStorage(){if(this.isGated())return;this.isSessionStorageAvailable===void 0&&(this.isSessionStorageAvailable=Mfe());const e=_j();if(!(!this.isSessionStorageAvailable||!e))return this.clearStoredOnReopen&&(this.clearStoredOnReopen=!1,e.removeItem(this.storageKey)),e}shouldTrack(e,n){var r,i;if(((r=e.metadata)===null||r===void 0?void 0:r.deliveryMethod)==="web")return!0;const a={userId:n?.user_id,deviceId:n?.device_id};this.identityEquals(this.identity,a)||this.clearCache(),this.identity=a,this.loadCache();const s=e.flag_key in this.inMemoryCache,o=this.inMemoryCache[e.flag_key],c=(i=e.variant)!==null&&i!==void 0?i:null,l=o??null;let u=!1;return(!s||l!==c)&&(u=!0,this.inMemoryCache[e.flag_key]=c,this.isGated()&&(this.hasGatedEntries=!0)),this.storeCache(),u}clearCache(){this.inMemoryCache={},this.hasGatedEntries=!1;const e=this.usableStorage();e?e.removeItem(this.storageKey):this.isGated()&&(this.clearStoredOnReopen=!0)}identityEquals(e,n){return e.userId&&n.userId?e.userId===n.userId:!e.userId&&!n.userId?e.deviceId===n.deviceId:!1}loadCache(){const e=this.usableStorage();if(e){const n=e.getItem(this.storageKey),r=n?JSON.parse(n):{};this.hasGatedEntries?(this.inMemoryCache=Object.assign(Object.assign({},r),this.inMemoryCache),this.hasGatedEntries=!1):this.inMemoryCache=r}}storeCache(){const e=this.usableStorage();if(e)try{e.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))}catch{}}}class Ofe{constructor(e,n=Aj,r){this.persistenceAllowed=r,this.inMemoryQueue=[],this.holdsGatedEvents=!1,this.storageKey=`EXP_unsent_${e}`,this.maxQueueSize=n}push(e){this.loadQueue(),this.inMemoryQueue.push(e),this.canPersist()||(this.holdsGatedEvents=!0),this.flush(),this.storeQueue()}setTracker(e){this.tracker=e;const n=Cj();n&&(this.poller=n(()=>{this.loadFlushStore()},1e3)),this.loadFlushStore()}flush(){if(!this.tracker||this.inMemoryQueue.length===0)return;let e=0;for(;e<this.inMemoryQueue.length;e++)try{if(!this.tracker(this.inMemoryQueue[e]))break}catch{break}if(this.inMemoryQueue=this.inMemoryQueue.slice(e),this.inMemoryQueue.length===0&&this.poller){const n=Ej();n&&n(this.poller),this.poller=void 0}}canPersist(){return this.persistenceAllowed?this.persistenceAllowed():!0}usableStorage(){if(!this.canPersist())return;this.isLocalStorageAvailable===void 0&&(this.isLocalStorageAvailable=vfe());const e=bj();return this.isLocalStorageAvailable&&e?e:void 0}loadQueue(){const e=this.usableStorage();if(e){const n=e.getItem(this.storageKey),r=n?JSON.parse(n):[];this.holdsGatedEvents?(this.inMemoryQueue=[...r,...this.inMemoryQueue],this.holdsGatedEvents=!1):this.inMemoryQueue=r}}storeQueue(){const e=this.usableStorage();if(e){if(this.inMemoryQueue.length===0){e.removeItem(this.storageKey);return}this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),e.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue))}}loadFlushStore(){this.loadQueue(),this.flush(),this.storeQueue()}}const Mfe=()=>{const t=qr();if(t)try{const e="EXP_test";return t.sessionStorage.setItem(e,e),t.sessionStorage.removeItem(e),!0}catch{return!1}return!1};class Nfe{constructor(e,n=Ha.Error){this.logger=e,this.logLevel=n}error(e,...n){this.logLevel>=Ha.Error&&this.logger.error(e,...n)}warn(e,...n){this.logLevel>=Ha.Warn&&this.logger.warn(e,...n)}info(e,...n){this.logLevel>=Ha.Info&&this.logger.info(e,...n)}debug(e,...n){this.logLevel>=Ha.Debug&&this.logger.debug(e,...n)}verbose(e,...n){this.logLevel>=Ha.Verbose&&this.logger.verbose(e,...n)}}class Dfe{error(e,...n){console.error(e,...n)}warn(e,...n){console.warn(e,...n)}info(e,...n){console.info(e,...n)}debug(e,...n){console.debug(e,...n)}verbose(e,...n){console.debug(e,...n)}}class qm{constructor(){this.globalScope=qr()}get(e){var n;return(n=this.globalScope)===null||n===void 0?void 0:n.localStorage.getItem(e)}put(e,n){var r;(r=this.globalScope)===null||r===void 0||r.localStorage.setItem(e,n)}delete(e){var n;(n=this.globalScope)===null||n===void 0||n.localStorage.removeItem(e)}}const Ffe=(t,e,n)=>{const r=t.substring(t.length-6),i=`amp-exp-${e}-${r}`;return new xj(i,n,Ij)},Ufe=(t,e,n=new qm)=>{const r=t.substring(t.length-6),i=`amp-exp-${e}-${r}-flags`;return new xj(i,n)},jfe=(t,e,n=new qm)=>{const r=t.substring(t.length-6),i=`amp-exp-${e}-${r}-variants-options`;return new Bfe(i,n)};class Bfe{constructor(e,n){this.namespace=e,this.storage=n}get(){return this.value}put(e){this.value=e}load(){const e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))}store(){this.value===void 0?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))}}class xj{constructor(e,n,r){this.cache={},this.namespace=e,this.storage=n,this.transformer=r}get(e){return this.cache[e]}getAll(){return Object.assign({},this.cache)}put(e,n){this.cache[e]=n}putAll(e){for(const n of Object.keys(e))this.cache[n]=e[n]}remove(e){delete this.cache[e]}clear(){this.cache={}}load(){const e=this.storage.get(this.namespace);let n;try{n=JSON.parse(e)||{}}catch{return}const r={};for(const i of Object.keys(n))try{let a;this.transformer?a=this.transformer(n[i]):a=n[i],a&&(r[i]=a)}catch{}this.clear(),this.putAll(r)}store(e=this.cache){this.storage.put(this.namespace,JSON.stringify(e))}}const Ij=t=>{if(typeof t=="string")return{key:t,value:t};if(typeof t=="object"){const e=t.key,n=t.value,r=t.payload;let i=t.metadata,a=t.expKey;i&&i.experimentKey?a=i.experimentKey:a&&(i=i||{},i.experimentKey=a);const s={};return e?s.key=e:n&&(s.key=n),n&&(s.value=n),i&&(s.metadata=i),r&&(s.payload=r),a&&(s.expKey=a),s}};class Tj{constructor(){this.globalScope=qr()}get(e){var n;return(n=this.globalScope)===null||n===void 0?void 0:n.sessionStorage.getItem(e)}put(e,n){var r;(r=this.globalScope)===null||r===void 0||r.sessionStorage.setItem(e,n)}delete(e){var n;(n=this.globalScope)===null||n===void 0||n.sessionStorage.removeItem(e)}}const Vfe=(t,e,n,r)=>{const i="[Experiment] Exposure",a=n?.value,s=`[Experiment] ${e}`;return{name:i,user:t,key:e,variant:n,userProperty:s,properties:{key:e,variant:a,source:r},userProperties:{[s]:a}}},Ua=t=>t==null,r5=t=>Ua(t)?!0:t&&Object.keys(t).length===0,Hfe=t=>{if(!t||typeof t!="object")return{};const e={};for(const[n,r]of Object.entries(t))Ua(r)||(e[n]=r);return e},kT=t=>{var e;return((e=t?.metadata)===null||e===void 0?void 0:e.evaluationMode)==="local"};class Wfe{constructor(e,n,r,i){this.started=!1,this.done=!1,this.attempts=e,this.min=n,this.max=r,this.scalar=i}start(e){return rr(this,void 0,void 0,function*(){if(!this.started)this.started=!0;else throw Error("Backoff already started");yield this.backoff(e,0,this.min)})}cancel(){this.done=!0;const e=_fe();e&&e(this.timeoutHandle)}backoff(e,n,r){return rr(this,void 0,void 0,function*(){if(this.done)return;const i=rE();i&&(this.timeoutHandle=i(()=>{rr(this,void 0,void 0,function*(){try{yield e()}catch{const s=n+1;if(s<this.attempts){const o=Math.min(r*this.scalar,this.max);yield this.backoff(e,s,o)}}})},r))})}}const $T=t=>{var e,n;if(!t)return{};const r={user:t},i=qr();i?.location&&(r.page={url:i.location.href});const a={};if(!t.groups)return r;for(const s of Object.keys(t.groups)){const o=t.groups[s];if(o.length>0&&o[0]){const c=o[0],l={group_name:c},u=(n=(e=t.group_properties)===null||e===void 0?void 0:e[s])===null||n===void 0?void 0:n[c];u&&Object.keys(u).length>0&&(l.group_properties=u),a[s]=l}}return Object.keys(a).length>0&&(r.groups=a),delete r.user.groups,delete r.user.group_properties,r},Yr=t=>t==null?{}:typeof t=="string"?{key:t,value:t}:t,PT=t=>{if(!t)return{};let e;t.metadata&&(e=t.metadata.experimentKey);const n={};return t.key&&(n.key=t.key),t.value&&(n.value=t.value),t.payload&&(n.payload=t.payload),e&&(n.expKey=e),t.metadata&&(n.metadata=t.metadata),n};class qfe{constructor(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}track(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))}setUserProperty(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)}unsetUserProperty(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))}}class zfe{constructor(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}track(e,n){const r={userId:n?.user_id,deviceId:n?.device_id};this.identityEquals(this.identity,r)||(this.tracked={}),this.identity=r;const i=e.flag_key in this.tracked,a=this.tracked[e.flag_key];i&&a===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))}identityEquals(e,n){return e.userId===n.userId&&e.deviceId===n.deviceId}}const Zfe=1e4,Kfe=8,Gfe=500,Yfe=1e4,Jfe=1.5,RT=6e4,Xfe="https://api.lab.eu.amplitude.com",Qfe="https://flag.lab.eu.amplitude.com";class aE{constructor(e,n){var r,i,a,s,o;this.engine=new afe,this.isRunning=!1,this.apiKey=e,n=Hfe(n),this.config=Object.assign(Object.assign(Object.assign({},Id),n),{serverUrl:n?.serverUrl||(((r=n?.serverZone)===null||r===void 0?void 0:r.toLowerCase())==="eu"?Xfe:Id.serverUrl),flagsServerUrl:n?.flagsServerUrl||(((i=n?.serverZone)===null||i===void 0?void 0:i.toLowerCase())==="eu"?Qfe:Id.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<RT?RT:(a=n.flagConfigPollingIntervalMillis)!==null&&a!==void 0?a:Id.flagConfigPollingIntervalMillis}),this.logger=new Nfe(this.config.loggerProvider||new Dfe,aE.getLogLevel(n));const c=(s=this.config)===null||s===void 0?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment=c==="web",this.poller=new Cfe(()=>rr(this,void 0,void 0,function*(){try{yield this.doFlags()}catch(f){this.logger.info(f)}}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(const f in this.config.initialVariants)this.config.initialVariants[f]=Ij(this.config.initialVariants[f]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new qfe(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new zfe(this.config.exposureTrackingProvider)),this.integrationManager=new Pfe
36(this.config,this);const l=new $fe(this.config.httpClient||Sj);this.flagApi=new mfe(this.apiKey,this.config.flagsServerUrl,l),this.evaluationApi=new yfe(this.apiKey,this.config.serverUrl,l);let u;const d=c?`${this.config.instanceName}-${String(c)}`:this.config.instanceName;if(this.isWebExperiment){const f=(o=this.config)===null||o===void 0?void 0:o.internalCacheStorage;u=f??new Tj}else u=new qm;this.variants=Ffe(this.apiKey,d,u),this.flags=Ufe(this.apiKey,d,u),this.fetchVariantsOptions=jfe(this.apiKey,d,u);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch{}this.mergeInitialFlagsWithStorage()}start(e){return rr(this,void 0,void 0,function*(){var n;if(!this.isRunning){this.isRunning=!0,this.setUser(e);try{const r=this.doFlags();((n=this.config.fetchOnStart)!==null&&n!==void 0?n:!0)?yield Promise.all([this.fetch(e),r]):yield r}catch(r){if(this.config.throwOnError)throw r}this.config.pollOnStart&&this.poller.start()}})}stop(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)}fetch(){return rr(this,arguments,void 0,function*(e=this.user,n){this.setUser(e||{});try{yield this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,n)}catch(r){if(this.config.throwOnError)throw r;r instanceof lp?this.logger.debug(r):this.logger.error(r)}return this})}variant(e,n){var r,i;if(!this.apiKey)return{value:void 0};const a=this.variantAndSource(e,n);return this.config.automaticExposureTracking&&this.exposureInternal(e,a),this.logger.debug(`[Experiment] variant for ${e} is ${((r=a.variant)===null||r===void 0?void 0:r.key)||((i=a.variant)===null||i===void 0?void 0:i.value)}`),a.variant||{}}exposure(e){const n=this.variantAndSource(e);this.exposureInternal(e,n)}all(){if(!this.apiKey)return{};const e=this.evaluate();for(const n in e){const r=this.flags.get(n);kT(r)||delete e[n]}return Object.assign(Object.assign(Object.assign({},this.secondaryVariants()),this.sourceVariants()),e)}clear(){this.variants.clear();try{this.variants.store()}catch{}}getUser(){var e;if(!this.user)return this.user;if(!((e=this.user)===null||e===void 0)&&e.user_properties){const n=Object.assign({},this.user.user_properties);return Object.assign(Object.assign({},this.user),{user_properties:n})}else return Object.assign({},this.user)}setUser(e){var n;if(!e){this.user=null;return}if(!((n=this.user)===null||n===void 0)&&n.user_properties){const r=Object.assign({},e.user_properties);this.user=Object.assign(Object.assign({},e),{user_properties:r})}else this.user=Object.assign({},e)}getUserProvider(){return this.userProvider}setUserProvider(e){return this.userProvider=e,this}mergeInitialFlagsWithStorage(){this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(n=>{this.flags.get(n.key)||this.flags.put(n.key,n)})}evaluate(e){const n=this.addContext(this.user),r=_T(this.flags.getAll(),e),i=$T(n),a=this.engine.evaluate(i,r),s={};for(const o of Object.keys(a))s[o]=PT(a[o]);return s}getEvaluationTraces(e){const n=this.addContext(this.user),r=_T(this.flags.getAll(),e),i=$T(n),{traces:a}=this.engine.evaluateWithTraces(i,r);return a}variantAndSource(e,n){let r={};this.config.source===bo.LocalStorage?r=this.localStorageVariantAndSource(e,n):this.config.source===bo.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,n));const i=this.flags.get(e);return(kT(i)||!r.variant&&i)&&(r=this.localEvaluationVariantAndSource(e,i,n)),r}localEvaluationVariantAndSource(e,n,r){var i;let a={};const s=this.evaluate([n.key])[e],o=Gn.LocalEvaluation,c=(i=s?.metadata)===null||i===void 0?void 0:i.default;if(!Ua(s)&&!c)return{variant:Yr(s),source:o,hasDefaultVariant:!1};if(c&&(a={variant:Yr(s),source:o,hasDefaultVariant:!0}),!Ua(r))return{variant:Yr(r),source:Gn.FallbackInline,hasDefaultVariant:a.hasDefaultVariant};const l=this.config.initialVariants[e];if(!Ua(l))return{variant:Yr(l),source:Gn.SecondaryInitialVariants,hasDefaultVariant:a.hasDefaultVariant};const u=Yr(this.config.fallbackVariant),d={variant:u,source:Gn.FallbackConfig,hasDefaultVariant:a.hasDefaultVariant};return r5(u)?a:d}localStorageVariantAndSource(e,n){var r;let i={};const a=this.variants.get(e),s=(r=a?.metadata)===null||r===void 0?void 0:r.default;if(!Ua(a)&&!s)return{variant:Yr(a),source:Gn.LocalStorage,hasDefaultVariant:!1};if(s&&(i={variant:Yr(a),source:Gn.LocalStorage,hasDefaultVariant:!0}),!Ua(n))return{variant:Yr(n),source:Gn.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};const o=this.config.initialVariants[e];if(!Ua(o))return{variant:Yr(o),source:Gn.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};const c=Yr(this.config.fallbackVariant),l={variant:c,source:Gn.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return r5(c)?i:l}initialVariantsVariantAndSource(e,n){var r;let i={};const a=this.config.initialVariants[e];if(!Ua(a))return{variant:Yr(a),source:Gn.InitialVariants,hasDefaultVariant:!1};const s=this.variants.get(e),o=(r=s?.metadata)===null||r===void 0?void 0:r.default;if(!Ua(s)&&!o)return{variant:Yr(s),source:Gn.LocalStorage,hasDefaultVariant:!1};if(o&&(i={variant:Yr(s),source:Gn.LocalStorage,hasDefaultVariant:!0}),!Ua(n))return{variant:Yr(n),source:Gn.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};const c=Yr(this.config.fallbackVariant),l={variant:c,source:Gn.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return r5(c)?i:l}fetchInternal(e,n,r,i){return rr(this,void 0,void 0,function*(){var a;if(!this.apiKey)throw Error("Experiment API key is empty");
36this.logger.debug(`[Experiment] Fetch all: retry=${String(r)}`),r&&this.stopRetries();try{const s=yield this.doFetch(e,n,Object.assign({trackingOption:(a=this.fetchVariantsOptions.get())===null||a===void 0?void 0:a.trackingOption},i));return yield this.storeVariants(s,i),s}catch(s){throw r&&this.shouldRetryFetch(s)&&this.startRetries(e,i),s}})}setTracksAssignment(e){return rr(this,void 0,void 0,function*(){this.fetchVariantsOptions.put(Object.assign(Object.assign({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store()})}cleanUserPropsForFetch(e){const n=Object.assign({},e);return delete n.cookie,n}doFetch(e,n,r){return rr(this,void 0,void 0,function*(){e=yield this.addContextOrWait(e),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e);const i=yield this.evaluationApi.getVariants(e,Object.assign({timeoutMillis:n},r)),a={};for(const s of Object.keys(i))a[s]=PT(i[s]);return this.logger.debug("[Experiment] Received variants: ",a),a})}doFlags(){return rr(this,void 0,void 0,function*(){try{let e;this.isWebExperiment&&(e=yield this.addContextOrWait(this.getUser()));const n=yield this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:LT,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:e?.user_id||e?.device_id?{user_id:e?.user_id,device_id:e?.device_id}:void 0});this.flags.clear(),this.flags.putAll(n)}catch(e){if(e instanceof lp){if(this.logger.debug(e),this.config.throwOnError)throw e}else throw e}try{this.flags.store()}catch{}this.mergeInitialFlagsWithStorage()})}storeVariants(e,n){return rr(this,void 0,void 0,function*(){let r=n&&n.flagKeys?n.flagKeys:[];r.length===0&&this.variants.clear();for(const i in e)r=r.filter(a=>a!==i),this.variants.put(i,e[i]);for(const i of r)this.variants.remove(i);try{this.variants.store()}catch{}this.logger.debug("[Experiment] Stored variants: ",e)})}startRetries(e,n){return rr(this,void 0,void 0,function*(){this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Wfe(Kfe,Gfe,Yfe,Jfe),this.retriesBackoff.start(()=>rr(this,void 0,void 0,function*(){yield this.fetchInternal(e,Zfe,!1,n)}))})}stopRetries(){this.retriesBackoff&&this.retriesBackoff.cancel()}addContext(e){var n;const r=(n=this.userProvider)===null||n===void 0?void 0:n.getUser(),i=this.integrationManager.getUser(),a=Object.assign(Object.assign(Object.assign({},r?.user_properties),i.user_properties),e?.user_properties);return Object.assign(Object.assign(Object.assign(Object.assign({library:`experiment-js-client/${LT}`},r),i),e),{user_properties:a})}addContextOrWait(e){return rr(this,void 0,void 0,function*(){return yield this.integrationManager.ready(),this.addContext(e)})}sourceVariants(){if(this.config.source==bo.LocalStorage)return this.variants.getAll();if(this.config.source==bo.InitialVariants)return this.config.initialVariants}secondaryVariants(){if(this.config.source==bo.LocalStorage)return this.config.initialVariants;if(this.config.source==bo.InitialVariants)return this.variants.getAll()}exposureInternal(e,n){var r,i,a,s,o,c,l,u,d;if(!((a=(i=(r=n.variant)===null||r===void 0?void 0:r.metadata)===null||i===void 0?void 0:i.trackExposure)!==null&&a!==void 0?a:!0))return;this.legacyExposureInternal(e,n.variant,n.source);const h={flag_key:e},p=TT(n.source);if(p&&!n.hasDefaultVariant)return;!((s=n.variant)===null||s===void 0)&&s.expKey&&(h.experiment_key=(o=n.variant)===null||o===void 0?void 0:o.expKey);const g=(c=n.variant)===null||c===void 0?void 0:c.metadata;if(!p&&!g?.default&&(!((l=n.variant)===null||l===void 0)&&l.key?h.variant=n.variant.key:!((u=n.variant)===null||u===void 0)&&u.value&&(h.variant=n.variant.value)),g&&(h.metadata=g),this.isWebExperiment&&(h.time=Date.now()),this.isWebExperiment){const v=qr();if(v?.location)try{const b=v.location.href;h.metadata.url=b.split("?")[0]||""}catch{}}const y=this.addContext(this.getUser());(d=this.userSessionExposureTracker)===null||d===void 0||d.track(h,y),this.integrationManager.track(h,y)}legacyExposureInternal(e,n,r){var i,a,s,o,c;if(this.analyticsProvider){const l=this.addContext(this.getUser()),u=Vfe(l,e,n,r);TT(r)||!n?.value?(a=(i=this.analyticsProvider)===null||i===void 0?void 0:i.unsetUserProperty)===null||a===void 0||a.call(i,u):n?.value&&((o=(s=this.analyticsProvider)===null||s===void 0?void 0:s.setUserProperty)===null||o===void 0||o.call(s,u),(c=this.analyticsProvider)===null||c===void 0||c.track(u))}}static getLogLevel(e){var n;return e.debug===!0?Ha.Debug:(n=e.logLevel)!==null&&n!==void 0?n:Ha.Error}shouldRetryFetch(e){return e instanceof vj?e.statusCode<400||e.statusCode>=500||e.statusCode===429:!0}addPlugin(e){e.type==="integration"&&this.integrationManager.setIntegration(e)}}class ehe{constructor(e,n,r){var i,a,s;this.globalScope=qr(),this.userAgent=typeof((i=this.globalScope)===null||i===void 0?void 0:i.navigator)<"u"?(a=this.globalScope)===null||a===void 0?void 0:a.navigator.userAgent:void 0,this.ua=new Efe.UAParser(this.userAgent).getResult(),this.localStorage=new qm,this.sessionStorage=new Tj,this.userProvider=e,this.apiKey=n,this.persistenceAllowed=r,this.storageKey=`EXP_${(s=this.apiKey)===null||s===void 0?void 0:s.slice(0,10)}_DEFAULT_USER_PROVIDER`}canPersist(){return this.persistenceAllowed?this.persistenceAllowed():!0}getUser(){var e,n,r,i,a;const s=((e=this.userProvider)===null||e===void 0?void 0:e.getUser())||{};return Object.assign({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:(r=(n=this.ua.device)===null||n===void 0?void 0:n.type)!==null&&r!==void 0?r:"desktop",referring_url:(a=(i=this.globalScope)===null||i===void 0?void 0:i.document)===null||a===void 0?void 0:a.referrer.replace(/\/$/,""),cookie
36:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},s)}getLanguage(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""}getOs(e){var n,r;return[(n=e.browser)===null||n===void 0?void 0:n.name,(r=e.browser)===null||r===void 0?void 0:r.major].filter(i=>i!=null).join(" ")}getDeviceModel(e){var n;return(n=e.os)===null||n===void 0?void 0:n.name}getBrowser(e){var n;let r=(n=e.browser)===null||n===void 0?void 0:n.name;return r?.includes("Chrom")&&(r="Chrome"),r?.includes("Firefox")&&(r="Firefox"),r?.includes("Safari")&&(r="Safari"),r?.includes("Edge")&&(r="Edge"),r?.includes("Opera")&&(r="Opera"),r}getCookie(){var e,n,r,i,a;if(this.canPersist()&&!((n=(e=this.globalScope)===null||e===void 0?void 0:e.document)===null||n===void 0)&&n.cookie)return Object.fromEntries((a=(i=(r=this.globalScope)===null||r===void 0?void 0:r.document)===null||i===void 0?void 0:i.cookie)===null||a===void 0?void 0:a.split("; ").map(s=>s.split("=")))}getLandingUrl(){var e,n;if(!this.canPersist())return(e=this.gatedLandingUrl)!==null&&e!==void 0||(this.gatedLandingUrl=this.getCurrentUrl()),this.gatedLandingUrl;try{const r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=(n=this.gatedLandingUrl)!==null&&n!==void 0?n:this.getCurrentUrl(),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch{return}}getCurrentUrl(){var e,n;return(n=(e=this.globalScope)===null||e===void 0?void 0:e.location)===null||n===void 0?void 0:n.href.replace(/\/$/,"")}getFirstSeen(){if(!this.canPersist())return(Date.now()/1e3).toString();try{const e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch{return}}getUrlParam(){var e;if(!this.globalScope)return;const n={};try{const r=new URL(this.globalScope.location.href);for(const[i,a]of r.searchParams)n[i]=[...(e=n[i])!==null&&e!==void 0?e:[],...a.split(",")]}catch{return}return Object.entries(n).reduce((r,[i,a])=>(r[i]=a.length==1?a[0]:a,r),{})}}var i5;const Ih=qr();Ih&&(Ih.experimentInstances={});const OT=(i5=Ih?.experimentInstances)!==null&&i5!==void 0?i5:{},the=(t,e)=>ihe(t,e,()=>new xfe(t,Rm.getInstance(Lj(e)),1e4)),Lj=t=>t?.instanceName||Id.instanceName,nhe=(t,e)=>{const n=Lj(e),r=e?.internalInstanceNameSuffix;return r?`${n}.${t}.${String(r)}`:`${n}.${t}`},rhe=(t,e)=>new aE(t,Object.assign(Object.assign({},e),{userProvider:new ehe(e?.userProvider,t,e?.internalPersistenceAllowed)})),ihe=(t,e,n)=>{const r=nhe(t,e);let i=OT[r];return i||(i=rhe(t,e),n&&i.addPlugin(n()),OT[r]=i,i)};var N3=function(){function t(e){this.name=t.pluginName,this.config=e}return t.prototype.setup=function(e,n){var r;return hg(this,void 0,void 0,function(){return pg(this,function(i){return this.experiment=the(((r=this.config)===null||r===void 0?void 0:r.deploymentKey)||e.apiKey,this.config),[2]})})},t.pluginName="@amplitude/experiment-analytics-plugin",t}(),ahe=function(t){return new N3(t)},she=function(){function t(){}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ohe(),platform:"Web",os:void 0,deviceModel:void 0}},t}(),ohe=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},che=function(){function t(){this.queue=[]}return t.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},t.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(n){e(n)}),this.queue=[])},t}(),Cc=function(){return Cc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Cc.apply(this,arguments)};function D3(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function MT(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}var F3=function(t,e){var n,r,i=["string","number","boolean","undefined"],a=typeof t,s=typeof e;if(a!==s)return!1;try{for(var o=D3(i),c=o.next();!c.done;c=o.next()){var l=c.value;if(l===a)return t===e}}catch(y){n={error:y}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(t==null&&e==null)return!0;
vendor: 4,846 bytes, line 36
36if(t==null||e==null||t.length!==e.length)return!1;var u=Array.isArray(t),d=Array.isArray(e);if(u!==d)return!1;if(u&&d){for(var f=0;f<t.length;f++)if(!F3(t[f],e[f]))return!1}else{var h=Object.keys(t).sort(),p=Object.keys(e).sort();if(!F3(h,p))return!1;var g=!0;return Object.keys(t).forEach(function(y){F3(t[y],e[y])||(g=!1)}),g}return!0},lhe="$set",uhe="$unset",dhe="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r});var fhe=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var e=this,n=Cc({},this.identity.userProperties),r=Cc(Cc({},this.identity),{userProperties:n});return{setUserId:function(i){return r.userId=i,this},setDeviceId:function(i){return r.deviceId=i,this},setUserProperties:function(i){return r.userProperties=i,this},setOptOut:function(i){return r.optOut=i,this},updateUserProperties:function(i){var a,s,o,c,l,u,d=r.userProperties||{};try{for(var f=D3(Object.entries(i)),h=f.next();!h.done;h=f.next()){var p=MT(h.value,2),g=p[0],y=p[1];switch(g){case lhe:try{for(var v=(o=void 0,D3(Object.entries(y))),b=v.next();!b.done;b=v.next()){var w=MT(b.value,2),_=w[0],E=w[1];d[_]=E}}catch($){o={error:$}}finally{try{b&&!b.done&&(c=v.return)&&c.call(v)}finally{if(o)throw o.error}}break;case uhe:try{for(var C=(l=void 0,D3(Object.keys(y))),x=C.next();!x.done;x=C.next()){var _=x.value;delete d[_]}}catch($){l={error:$}}finally{try{x&&!x.done&&(u=C.return)&&u.call(C)}finally{if(l)throw l.error}}break;case dhe:d={};break}}}catch($){a={error:$}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return r.userProperties=d,this},commit:function(){return e.setIdentity(r),this}}},t.prototype.getIdentity=function(){return Cc({},this.identity)},t.prototype.setIdentity=function(e){var n=Cc({},this.identity);this.identity=Cc({},e),F3(n,this.identity)||this.listeners.forEach(function(r){r(e)})},t.prototype.addIdentityListener=function(e){this.listeners.add(e)},t.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},t}(),Af=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,hhe=function(){function t(){this.identityStore=new fhe,this.eventBridge=new che,this.applicationContextProvider=new she}return t.getInstance=function(e){return Af.analyticsConnectorInstances||(Af.analyticsConnectorInstances={}),Af.analyticsConnectorInstances[e]||(Af.analyticsConnectorInstances[e]=new t),Af.analyticsConnectorInstances[e]},t}(),NT=["boot"],phe="$default_instance",a5=Symbol.for("amplitude-engagement-plugin-caller");function ghe(t){var e,n,r,i,a,s,o,c,l,u,d;let f=typeof window<"u"?window.engagement:void 0,h=!1,p={_q:(e=f?._q)!=null?e:[],_configuration:{apiKey:(r=(n=f?._configuration)==null?void 0:n.apiKey)!=null?r:"",serverUrl:(i=f?._configuration)==null?void 0:i.serverUrl,chatUrl:(a=f?._configuration)==null?void 0:a.chatUrl,mediaUrl:(s=f?._configuration)==null?void 0:s.mediaUrl,serverZone:(c=(o=f?._configuration)==null?void 0:o.serverZone)!=null?c:"US",autoRefreshIntervalSeconds:(l=f?._configuration)==null?void 0:l.autoRefreshIntervalSeconds,integrations:(u=f?._configuration)==null?void 0:u.integrations,options:{...(d=f?._configuration)==null?void 0:d.options}},init(y,v){var b,w,_,E;if(p._configuration.apiKey){console.log("Engagement SDK has already been initialized. Ignoring additional init call.");return}if(v?.skip===!0){console.log("Engagement SDK init skipped via `skip: true`. The SDK bundle will not be loaded."),h=!0;return}if(h&&(p._q.length=0),h=!1,v!=null&&v.useEngagementDomain){let U=((b=v.serverZone)!=null?b:p._configuration.serverZone)==="EU",O="amplitudeengagement.com";v.serverUrl||(v.serverUrl=U?`https://gs.eu.${O}`:`https://gs.${O}`),v.chatUrl||(v.chatUrl=U?`https://houston-chat.eu.${O}`:`https://houston-chat.${O}`),v.mediaUrl||(v.mediaUrl=U?`https://engagement-static.eu.${O}`:`https://engagement-static.${O}`),v.cdnUrl||(v.cdnUrl=U?`https://cdn.eu.${O}`:`https://cdn.${O}`)}p._configuration={...p._configuration,...v,apiKey:y,options:{splitting:!0,...p._configuration.options,...v?.options}},(_=(w=p._configuration)==null?void 0:w.options)!=null&&_.logger&&p._configuration.options.logger.enable((E=p._configuration.options.logLevel)!=null?E:2);let C;if(v!=null&&v.cdnUrl)p._configuration.options.splitting?C=`${v.cdnUrl}/engagement-browser/prod/split/index.js`:C=v.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let U=p._configuration.serverZone==="EU"?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";p._configuration.options.splitting?C=`${U}/engagement-browser/prod/split/index.js`:C=`${U}/engagement-browser/prod/index.min.js.gz`}let x=null,$=()=>{if(h=!0,x&&(clearTimeout(x),x=null),p._q&&p._q.length>0)for(console.warn(`Engagement SDK failed to load within ${T}
36ms. Resolving pending calls gracefully.`);p._q.length>0;){let U=p._q.shift();if(!U)continue;let O=U[0],F=NT.includes(O);if(console.warn(`Engagement SDK method '${O}' still in queue (isAsyncMethod=${F}); attempting to resolve as no-op.`),F&&U[1]instanceof Function&&U[2]instanceof Function){let k=U[1];console.warn(`Engagement SDK method '${O}' resolved as no-op due to script loading failure`),k(void 0)}}};t(C,p._configuration.options.splitting?"module":void 0,v?.nonce,$);let T=1e4;x=setTimeout(()=>{$()},T)},plugin(y){let v=p.init,b=y?.token,w=y?.skip===!0,_=(E,C,x)=>{let $=x.getIdentity(),T=typeof b=="function"?b():b;return{user_id:E.getUserId(),device_id:E.getDeviceId(),version:C.appVersion,user_properties:$.userProperties,getSessionId:E.getSessionId,...T?{token:T}:{}}};return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(E,C){var x;if(w){v(E.apiKey,{skip:!0});return}let $=(x=E.instanceName)!=null?x:phe,T=hhe.getInstance($).identityStore;p._configuration._installedViaPlugin=!0,v(E.apiKey,{serverZone:E.serverZone,...y,options:{logLevel:E.logLevel,logger:E.loggerProvider,...y?.options}});let U=[{track:O=>{C.track(O)}}];await window.engagement.boot({user:()=>_(C,E,T),integrations:U},a5),T.addIdentityListener(O=>{var F,k,S,I;if(!((F=window.engagement)!=null&&F._.user)||!((k=window.engagement)!=null&&k._analytics.hasBooted)){console.warn("Engagement SDK not booted. Ignoring identity change.");return}((I=(S=window.engagement)==null?void 0:S._.user)==null?void 0:I.user_id)!==O.userId?(window.engagement.shutdown(a5),window.engagement.boot({user:()=>_(C,E,T),integrations:U},a5)):window.engagement._setUserProperties(O.userProperties)})},async execute(E){return w||window.engagement.forwardEvent(E),E}}}},g=p;return new Proxy(p,{get:function(y,v){if(v in g)return g[v];if(v!=="then")return v==="gs"||v==="rc"||v==="assistant"?new Proxy({},{get:function(b,w){return function(){let _=Array.from(arguments),E=`${v}.${w}`;_.unshift(E),p._q.push(_)}}}):NT.includes(v)?function(){let b=Array.prototype.slice.call(arguments);return new Promise((w,_)=>{b.unshift(v,w,_),p._q.push(b),h&&w(void 0)})}:function(){let b=Array.prototype.slice.call(arguments);b.unshift(v),p._q.push(b)}}})}var kj=(t=>(t.Local="https://local.amplitude.com:3010/",t.Staging="https://apps.stag2.amplitude.com/",t.Production="https://app.amplitude.com/",t.ProductionEU="https://app.eu.amplitude.com/",t))(kj||{}),yhe=t=>{if(typeof window<"u"&&window.opener)for(let e of Object.values(kj))window.opener.postMessage({message:t},e)};function mhe(t,e,n,r){for(let i of t){let a=document.createElement("script");a.src=i,a.id="engagement-sdk-bundle",n&&a.setAttribute("nonce",n),e&&a.setAttribute("type",e),r&&(a.onerror=r);let s=document.getElementsByTagName("head")[0];s&&s.appendChild(a)}}var vhe=()=>(yhe("ENGAGEMENT_SNIPPET"),ghe((t,e,n,r)=>mhe([t||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],e,n,r))),DT=vhe(),whe=t=>(typeof window<"u"&&!window.engagement&&(window.engagement=DT),DT.plugin(t)),bhe="1.1.31",_he="amplitude-ts-unified",Che=function(){return{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(t){var e;return hg(this,void 0,void 0,function(){return pg(this,function(n){return t.library="".concat(_he,"/").concat(bhe,"-").concat((e=t.library)!==null&&e!==void 0?e:""),[2,t]})})}}},Ehe=function(t){IJ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.sessionReplay=function(){return this._sessionReplay},e.prototype.experiment=function(){if(this.config!==void 0){var n=this.plugins(N3);if(n.length===0){this.config.loggerProvider.debug("".concat(N3.pluginName," plugin is not found."));return}else{if(n.length===1)return n[0].experiment;this.config.loggerProvider.debug("Multiple instances of ".concat(N3.pluginName," are found."));return}}},e.prototype.initAll=function(n,r){return hg(this,void 0,void 0,function(){var i=this;return pg(this,function(a){return this._initAllPromise?[2,this._initAllPromise]:(this._initAllPromise=function(){return hg(i,void 0,void 0,function(){var s,o;return pg(this,function(c){switch(c.label){case 0:return s={serverZone:r?.serverZone,instanceName:r?.instanceName},t.prototype.add.call(this,Che()),[4,t.prototype.init.call(this,n,nc(nc({},r?.analytics),s)).promise];case 1:return c.sent(),[4,t.prototype.add.call(this,q2e(nc(nc({}
36,r?.sessionReplay),s))).promise];case 2:return c.sent(),[4,t.prototype.add.call(this,ahe(nc(nc({},r?.experiment),s))).promise];case 3:return c.sent(),o=this.plugin(Iw.pluginName),o===void 0?this.config.loggerProvider.debug("".concat(Iw.pluginName," plugin is not found.")):this._sessionReplay=o.sessionReplay,[4,t.prototype.add.call(this,whe(nc(nc({},r?.engagement),s))).promise];case 4:return c.sent(),[2]}})})}().finally(function(){i._initAllPromise=void 0}),[2,this._initAllPromise])})})},e.prototype.init=function(n,r,i){n===void 0&&(n="");var a=t.prototype.init.call(this,n,r,i);return a},e}(Due),She=function(){var t=new Ehe;return{_setDiagnosticsSampleRate:Ct(t._setDiagnosticsSampleRate.bind(t),"_setDiagnosticsSampleRate",Wt(t),qt(t,["config"])),experiment:Ct(t.experiment.bind(t),"experiment",Wt(t),qt(t,["config"])),sessionReplay:Ct(t.sessionReplay.bind(t),"sessionReplay",Wt(t),qt(t,["config"])),initAll:Ct(t.initAll.bind(t),"initAll",Wt(t),qt(t,["config"])),init:Ct(t.init.bind(t),"init",Wt(t),qt(t,["config"])),add:Ct(t.add.bind(t),"add",Wt(t),qt(t,["config.apiKey","timeline.plugins"])),remove:Ct(t.remove.bind(t),"remove",Wt(t),qt(t,["config.apiKey","timeline.plugins"])),track:Ct(t.track.bind(t),"track",Wt(t),qt(t,["config.apiKey","timeline.queue.length"])),logEvent:Ct(t.logEvent.bind(t),"logEvent",Wt(t),qt(t,["config.apiKey","timeline.queue.length"])),identify:Ct(t.identify.bind(t),"identify",Wt(t),qt(t,["config.apiKey","timeline.queue.length"])),groupIdentify:Ct(t.groupIdentify.bind(t),"groupIdentify",Wt(t),qt(t,["config.apiKey","timeline.queue.length"])),setGroup:Ct(t.setGroup.bind(t),"setGroup",Wt(t),qt(t,["config.apiKey","timeline.queue.length"])),revenue:Ct(t.revenue.bind(t),"revenue",Wt(t),qt(t,["config.apiKey","timeline.queue.length"])),flush:Ct(t.flush.bind(t),"flush",Wt(t),qt(t,["config.apiKey","timeline.queue.length"])),getUserId:Ct(t.getUserId.bind(t),"getUserId",Wt(t),qt(t,["config","config.userId"])),setUserId:Ct(t.setUserId.bind(t),"setUserId",Wt(t),qt(t,["config","config.userId"])),getDeviceId:Ct(t.getDeviceId.bind(t),"getDeviceId",Wt(t),qt(t,["config","config.deviceId"])),setDeviceId:Ct(t.setDeviceId.bind(t),"setDeviceId",Wt(t),qt(t,["config","config.deviceId"])),reset:Ct(t.reset.bind(t),"reset",Wt(t),qt(t,["config","config.userId","config.deviceId"])),getSessionId:Ct(t.getSessionId.bind(t),"getSessionId",Wt(t),qt(t,["config"])),setSessionId:Ct(t.setSessionId.bind(t),"setSessionId",Wt(t),qt(t,["config"])),extendSession:Ct(t.extendSession.bind(t),"extendSession",Wt(t),qt(t,["config"])),setOptOut:Ct(t.setOptOut.bind(t),"setOptOut",Wt(t),qt(t,["config"])),getOptOut:Ct(t.getOptOut.bind(t),"getOptOut",Wt(t),qt(t,["config"])),setTransport:Ct(t.setTransport.bind(t),"setTransport",Wt(t),qt(t,["config"])),getIdentity:Ct(t.getIdentity.bind(t),"getIdentity",Wt(t),qt(t,["config"])),setIdentity:Ct(t.setIdentity.bind(t),"setIdentity",Wt(t),qt(t,["config","config.userId","config.deviceId"]))}};const l0=She();var frt=l0.initAll,hrt=l0.identify,Ahe=l0.reset,xhe=l0.setUserId,FT=l0.track;const prt=(t,e)=>Bt({queryKey:["admin-inventory-analytics","authed",e],queryFn:async()=>{if(!t)throw new Error("Admin password required");const n=await xn(In["inventory-analytics"].$get,e&&e!=="all"?{query:{collection:e}}:void 0,{headers:t});if(!n.ok)throw new Error("Failed to fetch inventory analytics");return n.json()},enabled:!!t}),grt=()=>it({mutationFn:async t=>{const e=await xn(In.inventory["validate-csv"].$post,{form:{csv:t.file}},{headers:t.adminHeaders});if(!e.ok){const n=await e.json();throw new Error(n.error||"Validation failed")}return e.json()}}),yrt=()=>it({mutationFn:async t=>{const e={psaId:t.psaId,cost:String(t.cost),location:t.location,collection:t.collection};t.customImage&&(e.customImage=t.customImage);const n=await xn(In.inventory["process-single"].$post,{form:e},{headers:t.adminHeaders});if(!n.ok){const r=await n.json();throw new Error(r.error||"Upload failed")}return n.json()}}),mrt=()=>it({mutationFn:async t=>{const e=await xn(In.inventory["analyze-csv"].$post,{form:{csv:t.file}},{headers:t.adminHeaders});if(!e.ok){const n=await e.json();throw new Error(n?.error||"Analysis failed")}return e.json()}}),vrt=()=>it({mutationFn:async t=>{const e=await xn(In.inventory["analyze-single-psa"].$post,{json:{psaId:t.psaId}},{headers:t.adminHeaders});if(!e.ok){const n=await e.json();throw new Error(n?.error||"Analysis failed")}return e.json()}}),wrt=()=>it({mutationFn:async t=>{const e=await xn(In.inventory["export-psa"].$post,void 0,{headers:t.adminHeaders});if(!e.ok){const n=await e.json();throw new Error(n?.error||"Export failed")}return e.json()}}),brt=()=>it({mutationFn:async t=>{const e=await xn(In.inventory["bulk-search-cert"].$post,{form:{csv:t.file}},{headers:t.adminHeaders});if(!e.ok){const n=await e.json();throw new Error(n?.error||"Bulk search failed")}return e.json()}}),_rt=()=>it({mutationFn:async t=>{const e=await xn(In.inventory["redemption-status"].$post,{json:{cardIds:t.cardIds,redemptionStatus:t.redemptionStatus}},{headers:t.adminHeaders});if(!e.ok){const n=await e.json();throw new Error(n?.error||"Failed to update redemption status")}return e.json()}}),Crt=()=>it({mutationKey:["refetch-inventory-images"],mutationFn:async t=>{const e=await xn(In.inventory["refetch-images"].$post,t.customImage?{form:{psaId:t.psaId,customImage:t.customImage}}:{json:{psaId:t.psaId}},{headers:t.adminHeaders});if(!e.ok){const n=await qn(e,"Failed to refetch images");throw new Error(n)}return e.json()}}),Ert=()=>it({mutationFn:async t=>{const e=new FormData;e.append("psaId",t.psaId),e.append("cost",String(t.cost)),e.append("location",t.location),e.append("collection",t.collection),e.append("altAssetId",t.altAssetId),e.append("name",t.name),e.a
36ppend("grade",t.grade),e.append("year",t.year),e.append("setName",t.setName),t.cardNumber&&e.append("cardNumber",t.cardNumber),t.variety&&e.append("variety",t.variety),e.append("lang",t.lang),e.append("gradingService",t.gradingService),e.append("totalPopulation",String(t.totalPopulation)),t.frontImageUrl&&e.append("frontImageUrl",t.frontImageUrl),t.backImageUrl&&e.append("backImageUrl",t.backImageUrl),t.customFrontImage&&e.append("customFrontImage",t.customFrontImage),t.customBackImage&&e.append("customBackImage",t.customBackImage);const n=await zo(`${Zo}/api/admin/inventory/process-manual`,{method:"POST",headers:t.adminHeaders,body:e});if(!n.ok){const r=await n.json();throw new Error(r.error||"Manual upload failed")}return n.json()}}),Srt=t=>Bt({queryKey:["admin-inventory-sync","authed","list"],queryFn:async()=>{if(!t)throw new Error("Admin password required");const e=await zo(`${Zo}/api/admin/inventory/sync`,{headers:t});if(!e.ok){const n=await e.json();throw new Error(n.error||"Failed to fetch sync data")}return e.json()},enabled:!!t}),Art=()=>it({mutationFn:async t=>{const e=await zo(`${Zo}/api/admin/inventory/export?uuids=${t.uuids.join(",")}`,{headers:t.adminHeaders}),n=await e.json();if(!e.ok)throw new Error(n.error||"Export failed");return n}}),xrt=()=>it({mutationFn:async t=>{const e=await zo(`${Zo}/api/admin/inventory/import-preview`,{method:"POST",headers:{...t.adminHeaders,"Content-Type":"application/json"},body:JSON.stringify({items:t.items})}),n=await e.json();if(!e.ok)throw new Error(n.error||"Preview failed");return n}}),Irt=()=>it({mutationFn:async t=>{const e=await zo(`${Zo}/api/admin/inventory/import-apply`,{method:"POST",headers:{...t.adminHeaders,"Content-Type":"application/json"},body:JSON.stringify({items:t.items,priceHistory:t.priceHistory})}),n=await e.json();if(!e.ok)throw new Error(n.error||"Import failed");return n}}),Trt=()=>it({mutationFn:async t=>{const e=await zo(`${Zo}/api/admin/inventory/price-history/import-apply`,{method:"POST",headers:{...t.adminHeaders,"Content-Type":"application/json"},body:JSON.stringify({priceHistory:t.priceHistory})}),n=await e.json();if(!e.ok)throw new Error(n.error||"Price history import failed");return n}}),Lrt=()=>it({mutationFn:async t=>{const e=await zo(`${Zo}/api/admin/inventory/${t.uuid}/enabled`,{method:"PATCH",headers:{...t.adminHeaders,"Content-Type":"application/json"},body:JSON.stringify({enabled:t.enabled})});if(!e.ok){const n=await e.json();throw new Error(n.error||"Enable/disable update failed")}return e.json()}}),krt=()=>it({mutationFn:async t=>{const e={cost:t.cost};t.location!==void 0&&(e.location=t.location);const n=await zo(`${Zo}/api/admin/inventory/${t.uuid}`,{method:"PATCH",headers:{...t.adminHeaders,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.error||"Cost update failed")}return n.json()}}),Aa={all:["admin-cgc-inventory","authed"],list:t=>[...Aa.all,"list",t]},$rt=(t,e)=>Bt({queryKey:Aa.list(t),queryFn:async()=>{if(!e)throw new Error("Admin password required");const n=await xn(In.inventory.cgc.$get,{query:{page:String(t.page),pageSize:String(t.pageSize),...t.search?{search:t.search}:{},...t.binding?{binding:t.binding}:{}}},{headers:e});if(!n.ok)throw new Error(await qn(n,"Failed to load CGC inventory"));return n.json()},enabled:!!e}),Ihe={all:[...Aa.all,"operator-gas-balance"]},Prt=t=>Bt({queryKey:Ihe.all,queryFn:async()=>{if(!t)throw new Error("Admin password required");const e=await xn(In.inventory.cgc["operator-gas-balance"].$get,{},{headers:t});if(!e.ok)throw new Error(await qn(e,"Failed to load operator wallet gas balance"));return e.json()},enabled:!!t,staleTime:6e4});class The extends Error{game;draftToken;constructor(e,n,r){super(r),this.name="CgcUnsupportedGameError",this.game=e,this.draftToken=n}}class Lhe extends Error{constructor(e){super(e),this.name="CgcRegistrationDraftExpiredError"}}const Rrt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc.register.$post,{json:{certNumber:e.certNumber,listPriceUsdc:e.listPriceUsdc,...e.location?{location:e.location}:{},...e.collectionOverride?{collectionOverride:e.collectionOverride}:{},...e.draftToken?{draftToken:e.draftToken}:{},costUsdc:e.costUsdc}},{headers:e.adminHeaders});if(!n.ok)throw new Error("Could not register the CGC card. Try again.");let r=null,i=null;if(await uC(n,(a,s)=>{if(a==="phase")e.onPhase?.(s);else if(a==="done")r=JSON.parse(s);else if(a==="error")try{const o=JSON.parse(s);o.code==="unsupported_game"?i=new The(o.game??null,o.draftToken??null,o.message??"CGC game is not mapped to a collection yet"):o.code==="draft_expired"?i=new Lhe(o.message??"The CGC registration draft expired"):i=new Error(o.message??"Could not register the CGC card. Try again.")}catch{i=new Error(s)}}),i)throw i;if(!r)throw new Error("Could not register the CGC card. Try again.");return r},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Ort=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc[":certNumber"].price.$patch,{param:{certNumber:e.certNumber},json:{listPriceUsdc:e.listPriceUsdc}},{headers:e.adminHeaders});if(!n.ok)throw new Error(await qn(n,"Could not update the CGC list price. Try again."));return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Mrt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc[":uuid"].location.$patch,{param:{uuid:e.uuid},json:{location:e.location}},{headers:e.adminHeaders});if(!n.ok)throw new Error(n.status===404?"CGC card not found or already minted":"Could not update the CGC location. Try again.");return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Nrt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc[":uuid"].enabled.$patch,{param:{uuid:e.uuid},json:{enabled:e.enabled}},{headers:e.adminHeaders});if(!n.ok)throw new Error(await qn(n,"Could not update the CGC card's enabled state."));return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Drt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc[":uuid"].mint.$post,{param:{uuid:e.uuid}},{headers:e.adminHeaders});if(!n.ok)throw new Error(await qn(n,"Could not mint this CGC card."));return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Frt="house_wallet_seaport_approval_required";
36class khe extends Error{constructor(e,n,r){super(e),this.status=n,this.code=r,this.name="CgcListError"}}const $he="house_wallet_insufficient_gas";class Phe extends Error{constructor(e,n,r,i){super(e),this.status=n,this.code=r,this.gas=i,this.name="CgcSeaportApprovalError"}}const Urt=()=>it({mutationFn:async t=>{const e=await xn(In.inventory.cgc["approve-seaport"].$post,{},{headers:t.adminHeaders});if(!e.ok){const n=await e.json().catch(()=>null),r=n&&typeof n=="object"&&"code"in n&&typeof n.code=="string"?n.code:void 0,i=r===$he&&n&&typeof n=="object"&&"wallet"in n&&typeof n.wallet=="string"&&"balanceWei"in n&&typeof n.balanceWei=="string"&&/^\d+$/.test(n.balanceWei)&&"requiredFeeWei"in n&&typeof n.requiredFeeWei=="string"&&/^\d+$/.test(n.requiredFeeWei)?{wallet:n.wallet,balanceWei:n.balanceWei,requiredFeeWei:n.requiredFeeWei}:void 0;throw new Phe(EN(n)??SN(e,"Could not approve Seaport for the house wallet."),e.status,r,i)}return e.json()}}),jrt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc[":uuid"].list.$post,{param:{uuid:e.uuid}},{headers:e.adminHeaders});if(!n.ok){const r=await n.json().catch(()=>null),i=r&&typeof r=="object"&&"code"in r&&typeof r.code=="string"?r.code:void 0;throw new khe(EN(r)??SN(n,"Could not list this CGC card."),n.status,i)}return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Brt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc[":uuid"]["cancel-listing"].$post,{param:{uuid:e.uuid}},{headers:e.adminHeaders});if(!n.ok)throw new Error(await qn(n,"Could not cancel this CGC listing. Try again."));return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Vrt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc["bulk-mint-list"].$post,{json:{uuids:e.uuids}},{headers:e.adminHeaders});if(!n.ok)throw new Error(await qn(n,"Could not run bulk mint & list."));let r=null;if(await uC(n,(i,a)=>{i==="row"?e.onRow?.(JSON.parse(a)):i==="done"&&(r=JSON.parse(a))}),!r)throw new Error("Could not run bulk mint & list.");return r},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},Hrt=()=>{const t=ns();return it({mutationFn:async e=>{const n=await xn(In.inventory.cgc["bulk-register"].$post,{form:{csv:e.file}},{headers:e.adminHeaders});if(!n.ok)throw new Error("Could not import the CGC CSV. Try again.");let r=null;if(await uC(n,(i,a)=>{i==="phase"?e.onPhase?.(JSON.parse(a)):i==="row"?e.onRow?.(JSON.parse(a)):i==="done"&&(r=JSON.parse(a))}),!r)throw new Error("Could not import the CGC CSV. Try again.");return r},onSuccess:()=>{t.invalidateQueries({queryKey:Aa.all})}})},sE=[{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bytes4",name:"_initializerSelector",type:"bytes4"},{internalType:"address",name:"_registry",type:"address"},{internalType:"bytes32",name:"_proxyBytecodeHash",type:"bytes32"},{internalType:"address",name:"_deployer",type:"address"},{internalType:"address",name:"_owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ALREADY_CREATED",type:"error"},{inputs:[],name:"DEPLOYMENT_FAILED",type:"error"},{inputs:[],name:"INVALID_INITIALIZER",type:"error"},{inputs:[],name:"NOT_FROM_DEPLOYER",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"}],name:"AGWAccountCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"}],name:"AGWAccountDeployed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"deployer",type:"address"},{indexed:!0,internalType:"bool",name:"authorized",type:"bool"}],name:"DeployerAuthorized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newImplementation",type:"address"}],name:"ImplementationChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferStarted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newRegistry",type:"address"}],name:"RegistryChanged",type:"event"},{inputs:[],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"accountToDeployer",outputs:[{internalType:"address",name:"deployer",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"accountAddress",type:"address"}],name:"agwAccountCreated",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"deployer",type:"address"}],name:"authorizedDeployers",outputs:[{internalType:"bool",name:"authorized",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes4",name:"newInitializerSelector",type:"bytes4"}],name:"changeImplementation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRegistry",type:"address"}],name:"changeRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"initializer",type:"bytes"}],name:"deployAccount",outputs:[{internalType:"address",name:"accountAddress",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"getAddressForSalt",outputs:[{internalType:"address",name:"accountAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"address",name:"_implementation",type:"address"}],name:"getAddressForSaltAndImplementation",outputs:[{internalType:"address",name:"accountAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementationAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initializerSelector",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pendingOwner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxyBytecodeHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"registry",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"saltToAccount",outputs:[{internalType:"address",name:"accountAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"deployer",type:"address"},{internalType:"bool",name:"authorized",type:"bool"}],name:"setDeployer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],oE="0x9B947df68D35281C972511B3E7BC875926f26C1A",Do="0x74b9ae28EC45E3FA11533c7954752597C3De3e7A",si="0x34ca1501FAE231cC2ebc995CE013Dbe882d7d081",Rhe="0x0000000000000000000000000000000000008006",Ohe="0xd3bdf4b5",Mhe="0x5a0694d2",Nhe="0x8f0273a9",zm="0xe7931438",$j="0x0000000078CC4Cc1C14E27c0fa35ED6E5E58825D",Pj="0xc10dcfe266c1f71ef476efbd3223555750dc271e4115626b";_g.id+"",np.id+"";const s5="0xfD20b9d7A406e2C4f5D6Df71ABE3Ee48B2EccC9F";class Dhe extends Kt{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join(` 37`),{name:"InvalidEip712TransactionError"})}}function Rj(t){return!!(t.type==="eip712"||"customSignature"in t&&t.customSignature||"paymaster"in t&&t.paymaster||"paymasterInput"in t&&t.paymasterInput||"gasPerPubdata"in t&&typeof t.gasPerPubdata=="bigint"||"factoryDeps"in t&&t.factoryDeps)}function Fhe(t){if(!Rj(t))throw new Dhe;nC(t)}const Rs={[_g.id]:_g,[np.id]:np,[mx.id]:mx,[vx.id]:vx};async function Oj(t,e){if(t===void 0)throw new Error("Initial signer is required to get smart account address");const n=lC(t),r=F2(n);return await e.readContract({address:oE,abi:sE,functionName:"getAddressForSalt",args:[r]})}async function cE(t,e){return await Zt(t,oC,"getCode")({address:e})!==void 0}function Mj(t,e,n){return Qi({abi:[{name:"initialize",type:"function",inputs:[{name:"initialK1Owner",type:"address"},{name:"initialK1Validator",type:"address"},{name:"modules",type:"bytes[]"},{name:"initCall",type:"tuple",components:[{name:"target",type:"address"}
37,{name:"allowFailure",type:"bool"},{name:"value",type:"uint256"},{name:"callData",type:"bytes"}]}],outputs:[],stateMutability:"nonpayable"}],functionName:"initialize",args:[t,e,[],n]})}function Nj(t,e){if(t)for(const n of e)xo(t[n])&&(t[n]=bh(t[n],"bigint"))}function lE(t){return t.message&&t.domain?.name==="zkSync"&&t.domain?.version==="2"&&Rj(t.message)}function Dj(t){if(!lE(t))throw new Kt("Typed data is not an EIP712 transaction");if(t.domain?.chainId===void 0)throw new Kt("Chain ID is required for EIP712 transaction");return{chainId:Number(t.domain.chainId),account:Dt(An(BigInt(t.message.from),{size:20})),to:An(BigInt(t.message.to),{size:20}),gas:BigInt(t.message.gasLimit),gasPerPubdata:BigInt(t.message.gasPerPubdataByteLimit),maxFeePerGas:BigInt(t.message.maxFeePerGas),maxPriorityFeePerGas:BigInt(t.message.maxPriorityFeePerGas),paymaster:t.message.paymaster!=="0"?An(BigInt(t.message.paymaster),{size:20}):void 0,nonce:t.message.nonce,value:BigInt(t.message.value),data:t.message.data==="0x0"?"0x":t.message.data,factoryDeps:t.message.factoryDeps,paymasterInput:t.message.paymasterInput!=="0x"?t.message.paymasterInput:void 0}}function Fj(t){const e=t,n=e.abi?Qi({abi:e.abi,functionName:e.functionName,args:e.args}):e.data;return{data:e.dataSuffix&&n?Gh([n,e.dataSuffix]):n,to:e.to,value:e.value}}function Uj(t){return t.map(Fj)}function Uhe(t){return t.map(e=>{const n=Fj(e);return{callData:n.data??"0x",target:n.to,value:n.value??0n,allowFailure:!1}})}const K2=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ADDRESS_ALREADY_EXISTS",type:"error"},{inputs:[],name:"ADDRESS_NOT_EXISTS",type:"error"},{inputs:[],name:"BYTES_ALREADY_EXISTS",type:"error"},{inputs:[],name:"BYTES_NOT_EXISTS",type:"error"},{inputs:[],name:"CALL_FAILED",type:"error"},{inputs:[],name:"EMPTY_HOOK_ADDRESS",type:"error"},{inputs:[],name:"EMPTY_MODULE_ADDRESS",type:"error"},{inputs:[],name:"EMPTY_OWNERS",type:"error"},{inputs:[],name:"EMPTY_VALIDATORS",type:"error"},{inputs:[],name:"FEE_PAYMENT_FAILED",type:"error"},{inputs:[],name:"HOOK_ERC165_FAIL",type:"error"},{inputs:[],name:"INSUFFICIENT_FUNDS",type:"error"},{inputs:[],name:"INVALID_ADDRESS",type:"error"},{inputs:[],name:"INVALID_BYTES",type:"error"},{inputs:[],name:"INVALID_KEY",type:"error"},{inputs:[],name:"INVALID_PUBKEY_LENGTH",type:"error"},{inputs:[],name:"INVALID_SALT",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"MODULE_ERC165_FAIL",type:"error"},{inputs:[{internalType:"uint256",name:"actualValue",type:"uint256"},{internalType:"uint256",name:"expectedValue",type:"uint256"}],name:"MsgValueMismatch",type:"error"},{inputs:[],name:"NOT_FROM_BOOTLOADER",type:"error"},{inputs:[],name:"NOT_FROM_DEPLOYER",type:"error"},{inputs:[],name:"NOT_FROM_HOOK",type:"error"},{inputs:[],name:"NOT_FROM_MODULE",type:"error"},{inputs:[],name:"NOT_FROM_SELF",type:"error"},{inputs:[],name:"NOT_FROM_SELF_OR_MODULE",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[],name:"RECUSIVE_MODULE_CALL",type:"error"},{inputs:[],name:"SAME_IMPLEMENTATION",type:"error"},{inputs:[],name:"UNAUTHORIZED_OUTSIDE_TRANSACTION",type:"error"},{inputs:[],name:"VALIDATION_HOOK_FAILED",type:"error"},{inputs:[],name:"VALIDATOR_ERC165_FAIL",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"hook",type:"address"}],name:"AddHook",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"module",type:"address"}],name:"AddModule",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"AddModuleValidator",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[],name:"FeePaid",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"addr",type:"address"}],name:"K1AddOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"K1AddValidator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"addr",type:"address"}],name:"K1RemoveOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"K1RemoveValidator",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes",name:"pubKey",type:"bytes"}],name:"R1AddOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"R1AddValidator",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes",name:"pubKey",type:"bytes"}],name:"R1RemoveOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"R1RemoveValidator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"hook",type:"address"}],name:"RemoveHook",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"module",type:"address"}],name:"RemoveModule",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"RemoveModuleValidator",type:"event"},{anonymous:!1,inputs:[],name:"ResetOwners",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldImplementation",type:"address"},{indexed:!0,internalType:"address",name:"newImplementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"VERSION",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"hookAndData",type:"bytes"},{internalType:"bool",name:"isValidation",type:"bool"}],name:"addHook",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"moduleAndData",type:"bytes"}],name:"addModule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"},{internalType:"bytes",name:"initialAccountValidationKey",type:"bytes"}],name:"addModuleValidator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"}
37,{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Call[]",name:"_calls",type:"tuple[]"}],name:"batchCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"agwMessageTypeHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Call[]",name:"_calls",type:"tuple[]"}],name:"batchCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"executeFromModule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{components:[{internalType:"uint256",name:"txType",type:"uint256"},{internalType:"uint256",name:"from",type:"uint256"},{internalType:"uint256",name:"to",type:"uint256"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"uint256",name:"gasPerPubdataByteLimit",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"uint256",name:"paymaster",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256[4]",name:"reserved",type:"uint256[4]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes32[]",name:"factoryDeps",type:"bytes32[]"},{internalType:"bytes",name:"paymasterInput",type:"bytes"},{internalType:"bytes",name:"reservedDynamic",type:"bytes"}],internalType:"struct Transaction",name:"transaction",type:"tuple"}],name:"executeTransaction",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"txType",type:"uint256"},{internalType:"uint256",name:"from",type:"uint256"},{internalType:"uint256",name:"to",type:"uint256"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"uint256",name:"gasPerPubdataByteLimit",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"uint256",name:"paymaster",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256[4]",name:"reserved",type:"uint256[4]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes32[]",name:"factoryDeps",type:"bytes32[]"},{internalType:"bytes",name:"paymasterInput",type:"bytes"},{internalType:"bytes",name:"reservedDynamic",type:"bytes"}],internalType:"struct Transaction",name:"transaction",type:"tuple"}],name:"executeTransactionFromOutside",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"signedHash",type:"bytes32"}],internalType:"struct ERC1271Handler.AGWMessage",name:"agwMessage",type:"tuple"}],name:"getEip712Hash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"hook",type:"address"},{internalType:"bytes32",name:"key",type:"bytes32"}],name:"getHookData",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementationAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"initialK1Owner",type:"address"},{internalType:"address",name:"initialK1Validator",type:"address"},{internalType:"bytes[]",name:"modules",type:"bytes[]"},{components:[{internalType:"address",name:"target",type:"address"}
37,{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Call",name:"initCall",type:"tuple"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"isHook",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"isModule",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"isModuleValidator",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"signedHash",type:"bytes32"},{internalType:"bytes",name:"signatureAndValidator",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"magicValue",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"k1AddOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"k1AddValidator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"k1IsOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"k1IsValidator",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"k1ListOwners",outputs:[{internalType:"address[]",name:"k1OwnerList",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"k1ListValidators",outputs:[{internalType:"address[]",name:"validatorList",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"k1RemoveOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"k1RemoveValidator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bool",name:"isValidation",type:"bool"}],name:"listHooks",outputs:[{internalType:"address[]",name:"hookList",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"listModuleValidators",outputs:[{internalType:"address[]",name:"validatorList",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"listModules",outputs:[{internalType:"address[]",name:"moduleList",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{components:[{internalType:"uint256",name:"txType",type:"uint256"},{internalType:"uint256",name:"from",type:"uint256"},{internalType:"uint256",name:"to",type:"uint256"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"uint256",name:"gasPerPubdataByteLimit",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"uint256",name:"paymaster",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256[4]",name:"reserved",type:"uint256[4]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes32[]",name:"factoryDeps",type:"bytes32[]"},{internalType:"bytes",name:"paymasterInput",type:"bytes"},{internalType:"bytes",name:"reservedDynamic",type:"bytes"}],internalType:"struct Transaction",name:"transaction",type:"tuple"}],name:"payForTransaction",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{components:[{internalType:"uint256",name:"txType",type:"uint256"},{internalType:"uint256",name:"from",type:"uint256"},{internalType:"uint256",name:"to",type:"uint256"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"uint256",name:"gasPerPubdataByteLimit",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"uint256",name:"paymaster",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256[4]",name:"reserved",type:"uint256[4]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes32[]",name:"factoryDeps",type:"bytes32[]"},{internalType:"bytes",name:"paymasterInput",type:"bytes"},{internalType:"bytes",name:"reservedDynamic",type:"bytes"}],internalType:"struct Transaction",name:"transaction",type:"tuple"}],name:"prepareForPaymaster",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"pubKey",type:"bytes"}],name:"r1AddOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"r1AddValidator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"pubKey",type:"bytes"}],name:"r1IsOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"r1IsValidator",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"r1ListOwners",outputs:[{internalType:"bytes[]",name:"r1OwnerList",type:"bytes[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"r1ListValidators",outputs:[{internalType:"address[]",name:"validatorList",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"pubKey",type:"bytes"}],name:"r1RemoveOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"r1RemoveValidator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"hook",type:"address"},{internalType:"bool",name:"isValidation",type:"bool"}],name:"removeHook",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"module",type:"address"}],name:"removeModule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"validator",type:"address"}],name:"removeModuleValidator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"pubKey",type:"bytes"}],name:"resetOwners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"key",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setHookData",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"suggestedSignedHash",type:"bytes32"},{components:[{internalType:"uint256",name:"txType",type:"uint256"},{internalType:"uint256",name:"from",type:"uint256"},{internalType:"uint256",name:"to",type:"uint256"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"uint256",name:"gasPerPubdataByteLimit",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"uint256",name:"paymaster",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256[4]",name:"reserved",type:"uint256[4]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes32[]",name:"factoryDeps",type:"bytes32[]"},{internalType:"bytes",name:"paymasterInput",type:"bytes"},{internalType:"bytes",name:"reservedDynamic",type:"bytes"}],internalType:"struct Transaction",name:"transaction",type:"tuple"}],name:"validateTransaction",outputs:[{internalType:"bytes4",name:"magic",type:"bytes4"}],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}],u0=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"}],name:"Disabled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"}],name:"Inited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"bytes32",name:"sessionHash",type:"bytes32"},{components:[{internalType:"address",name:"signer",type:"address"},{internalType:"uint256",name:"expiresAt",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"feeLimit",type:"tuple"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"},{internalType:"uint256",name:"maxValuePerUse",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"valueLimit",type:"tuple"},{components:[{internalType:"enum SessionLib.Condition",name:"condition",type:"uint8"},{internalType:"uint64",name:"index",type:"uint64"},{internalType:"bytes32",name:"refValue",type:"bytes32"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"limit",type:"tuple"}],internalType:"struct SessionLib.Constraint[]",name:"constraints",type:"tuple[]"}],internalType:"struct SessionLib.CallSpec[]",name:"callPolicies",type:"tuple[]"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"maxValuePerUse",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"valueLimit",type:"tuple"}],internalType:"struct SessionLib.TransferSpec[]",name:"transferPolicies",type:"tuple[]"}
37],indexed:!1,internalType:"struct SessionLib.SessionSpec",name:"sessionSpec",type:"tuple"}],name:"SessionCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"bytes32",name:"sessionHash",type:"bytes32"}],name:"SessionRevoked",type:"event"},{inputs:[{internalType:"bytes",name:"sessionData",type:"bytes"}],name:"addValidationKey",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"signer",type:"address"},{internalType:"uint256",name:"expiresAt",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"feeLimit",type:"tuple"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"},{internalType:"uint256",name:"maxValuePerUse",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"valueLimit",type:"tuple"},{components:[{internalType:"enum SessionLib.Condition",name:"condition",type:"uint8"},{internalType:"uint64",name:"index",type:"uint64"},{internalType:"bytes32",name:"refValue",type:"bytes32"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"limit",type:"tuple"}],internalType:"struct SessionLib.Constraint[]",name:"constraints",type:"tuple[]"}],internalType:"struct SessionLib.CallSpec[]",name:"callPolicies",type:"tuple[]"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"maxValuePerUse",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"valueLimit",type:"tuple"}],internalType:"struct SessionLib.TransferSpec[]",name:"transferPolicies",type:"tuple[]"}],internalType:"struct SessionLib.SessionSpec",name:"sessionSpec",type:"tuple"}],name:"createSession",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"disable",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"enum OperationType",name:"operationType",type:"uint8"},{internalType:"bytes32",name:"signedHash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"handleValidation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"smartAccount",type:"address"}],name:"isInited",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"sessionHash",type:"bytes32"}],name:"revokeKey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32[]",name:"sessionHashes",type:"bytes32[]"}],name:"revokeKeys",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{components:[{internalType:"address",name:"signer",type:"address"},{internalType:"uint256",name:"expiresAt",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"feeLimit",type:"tuple"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"},{internalType:"uint256",name:"maxValuePerUse",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"valueLimit",type:"tuple"},{components:[{internalType:"enum SessionLib.Condition",name:"condition",type:"uint8"},{internalType:"uint64",name:"index",type:"uint64"},{internalType:"bytes32",name:"refValue",type:"bytes32"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"limit",type:"tuple"}],internalType:"struct SessionLib.Constraint[]",name:"constraints",type:"tuple[]"}],internalType:"struct SessionLib.CallSpec[]",name:"callPolicies",type:"tuple[]"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"maxValuePerUse",type:"uint256"},{components:[{internalType:"enum SessionLib.LimitType",name:"limitType",type:"uint8"},{internalType:"uint256",name:"limit",type:"uint256"},{internalType:"uint256",name:"period",type:"uint256"}],internalType:"struct SessionLib.UsageLimit",name:"valueLimit",type:"tuple"}],internalType:"struct SessionLib.TransferSpec[]",name:"transferPolicies",type:"tuple[]"}
37],internalType:"struct SessionLib.SessionSpec",name:"spec",type:"tuple"}],name:"sessionState",outputs:[{components:[{internalType:"uint256",name:"expiresAt",type:"uint256"},{internalType:"enum SessionLib.Status",name:"status",type:"uint8"},{internalType:"uint256",name:"feesRemaining",type:"uint256"},{components:[{internalType:"uint256",name:"remaining",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],internalType:"struct SessionLib.LimitState[]",name:"transferValue",type:"tuple[]"},{components:[{internalType:"uint256",name:"remaining",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],internalType:"struct SessionLib.LimitState[]",name:"callValue",type:"tuple[]"},{components:[{internalType:"uint256",name:"remaining",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],internalType:"struct SessionLib.LimitState[]",name:"callParams",type:"tuple[]"}],internalType:"struct SessionLib.SessionState",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"bytes32",name:"sessionHash",type:"bytes32"}],name:"sessionStatus",outputs:[{internalType:"enum SessionLib.Status",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"signedHash",type:"bytes32"},{components:[{internalType:"uint256",name:"txType",type:"uint256"},{internalType:"uint256",name:"from",type:"uint256"},{internalType:"uint256",name:"to",type:"uint256"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"uint256",name:"gasPerPubdataByteLimit",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"uint256",name:"paymaster",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256[4]",name:"reserved",type:"uint256[4]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes32[]",name:"factoryDeps",type:"bytes32[]"},{internalType:"bytes",name:"paymasterInput",type:"bytes"},{internalType:"bytes",name:"reservedDynamic",type:"bytes"}],internalType:"struct Transaction",name:"transaction",type:"tuple"},{internalType:"bytes",name:"hookData",type:"bytes"}],name:"validationHook",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"}];class ul extends Kt{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` 38`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}var za;(function(t){t[t.Unlimited=0]="Unlimited",t[t.Lifetime=1]="Lifetime",t[t.Allowance=2]="Allowance"})(za||(za={}));za.Unlimited;za.Lifetime;var qg;(function(t){t[t.Unconstrained=0]="Unconstrained",t[t.Equal=1]="Equal",t[t.Greater=2]="Greater",t[t.Less=3]="Less",t[t.GreaterEqual=4]="GreaterEqual",t[t.LessEqual=5]="LessEqual",t[t.NotEqual=6]="NotEqual"})(qg||(qg={}));var UT;(function(t){t[t.NotInitialized=0]="NotInitialized",t[t.Active=1]="Active",t[t.Closed=2]="Closed",t[t.Expired=3]="Expired"})(UT||(UT={}));function uE(){return nQ({abi:u0,name:"createSession"}).inputs[0]}function jj(t){return M2([uE()],[t])}function Zm(t,e){return M2([uE(),{type:"uint64[]"}],[t,e])}const Km=t=>{const e=t.timestamp||BigInt(Math.floor(Date.now()/1e3)),n=_t(t.target),r=l=>l.limitType===za.Allowance?e/l.period:0n,i=()=>t.sessionConfig.transferPolicies.find(l=>l.target.toLowerCase()===n.toLowerCase()),a=()=>t.sessionConfig.callPolicies.find(l=>l.target.toLowerCase()===n.toLowerCase()&&l.selector===t.selector),s=!!t.selector&&t.selector.length>=10,o=s?a():i();if(!o)throw new Error("Transaction does not fit any policy");return[r(t.sessionConfig.feeLimit),r(o.valueLimit),...s?o.constraints.map(l
38=>r(l.limit)):[]]};function dE(t){return F2(jj(t))}async function jhe(t,e){const{account:n=t.account,chain:r=t.chain,session:i,...a}=e;if(typeof n>"u")throw new ul({docsPath:"/docs/actions/wallet/sendTransaction"});const s=Dt(n),o=await Bhe(s,t,i);return{transactionHash:await Zt(t,zp,"sendTransaction")({...o,...a,account:s,chain:r}),session:i}}async function Bhe(t,e,n){const r=Dt(t);if(await cE(e,r.address)?await Vhe(r,e):!1)return{to:si,value:0n,data:Qi({abi:u0,functionName:"createSession",args:[n]})};{const s=jj(n);return{to:r.address,value:0n,data:Qi({abi:K2,functionName:"addModule",args:[JM([si,s])]})}}}async function Vhe(t,e){return(await Zt(e,Us,"readContract")({address:t.address,abi:K2,functionName:"listHooks",args:[!0]})).some(i=>i===si)}class up extends Kt{constructor(){super(["Insufficient balance for transaction."].join(` 39`),{name:"InsufficientBalanceError"})}}const Pw=(t,e)=>typeof t=="bigint"?e(t):Array.isArray(t)?t.map(n=>Pw(n,e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([n,r])=>[n,Pw(r,e)])):t;async function Hhe(t,e){return await t.request({method:"privy_signSmartWalletMessage",params:[e.message]},{retryCount:0})}async function Whe(t,e){return await t.request({method:"privy_signSmartWalletTypedData",params:[t.account.address,e]},{retryCount:0})}async function d0(t,e){const{chain:n,account:r,...i}=e;return await t.request({method:"privy_signSmartWalletTx",params:[Pw(i,An)]},{retryCount:0})}const Bj=[{type:"function",name:"DELEGATE_REGISTRY",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"GLOBAL_DELEGATION",inputs:[],outputs:[{name:"",type:"bytes24",internalType:"bytes24"}],stateMutability:"view"},{type:"function",name:"decodeRightsExpiration",inputs:[{name:"rights",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"bytes24",internalType:"bytes24"},{name:"",type:"uint40",internalType:"uint40"}],stateMutability:"pure"},{type:"function",name:"delegatedWalletsByRights",inputs:[{name:"wallet",type:"address",internalType:"address"},{name:"rights",type:"bytes24",internalType:"bytes24"}],outputs:[{name:"",type:"address[]",internalType:"address[]"}],stateMutability:"view"},{type:"function",name:"exclusiveOwnerByRights",inputs:[{name:"contractAddress",type:"address",internalType:"address"},{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"rights",type:"bytes24",internalType:"bytes24"}],outputs:[{name:"owner",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"exclusiveWalletByRights",inputs:[{name:"vault",type:"address",internalType:"address"},{name:"rights",type:"bytes24",internalType:"bytes24"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"generateRightsWithExpiration",inputs:[{name:"rightsIdentifier",type:"bytes24",internalType:"bytes24"},{name:"expiration",type:"uint40",internalType:"uint40"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"pure"}];async function Vj(t,e,n){const r=typeof n=="string"?n:dE(n);return await t.readContract({address:si,abi:u0,functionName:"sessionStatus",args:[e,r]})}async function Hj(t,e,n,r,i,a=void 0){const s=r.data?`0x${r.data.slice(2,10)}`:void 0;if(!r.to)throw new Kt("Transaction to field is not specified");return h0(t,e,n,r,si,{[si]:Zm(i,Km({sessionConfig:i,target:r.to,selector:s,timestamp:BigInt(Math.floor(Date.now()/1e3))}))},a)}async function Wj(t,e,n,r,i,a=void 0){const{throwOnReceiptRevert:s,timeout:o,...c}=r,l=c.data?`0x${c.data.slice(2,10)}`:void 0;if(!c.to)throw new Kt("Transaction to field is not specified");return h0(t,e,n,c,si,{[si]:Zm(i,Km({sessionConfig:i,target:c.to,selector:l,timestamp:BigInt(Math.floor(Date.now()/1e3))}))},a,u=>Zt(t,Xh,"sendRawTransactionSync")({serializedTransaction:u,throwOnReceiptRevert:s,timeout:o}))}const o5=[{inputs:[],stateMutability:"nonpayable",type:"constructor"}
39,{inputs:[],name:"AccessControlBadConfirmation",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"bytes32",name:"neededRole",type:"bytes32"}],name:"AccessControlUnauthorizedAccount",type:"error"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"implementation",type:"address"}],name:"ERC1967InvalidImplementation",type:"error"},{inputs:[],name:"ERC1967NonPayable",type:"error"},{inputs:[],name:"FailedCall",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[],name:"UUPSUnauthorizedCallContext",type:"error"},{inputs:[{internalType:"bytes32",name:"slot",type:"bytes32"}],name:"UUPSUnsupportedProxiableUUID",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"enum PolicyType",name:"policyType",type:"uint8"},{indexed:!0,internalType:"address",name:"target",type:"address"},{indexed:!0,internalType:"bytes32",name:"data",type:"bytes32"},{indexed:!1,internalType:"enum Status",name:"status",type:"uint8"}],name:"PolicyStatusChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"UPGRADE_INTERFACE_VERSION",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"target",type:"address"}],name:"getApprovalTargetStatus",outputs:[{internalType:"enum Status",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"getCallPolicyStatus",outputs:[{internalType:"enum Status",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"getTransferPolicyStatus",outputs:[{internalType:"enum Status",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"callerConfirmation",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"target",type:"address"},{internalType:"enum Status",name:"status",type:"uint8"}
39],name:"setApprovalTargetStatus",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes4",name:"selector",type:"bytes4"},{internalType:"enum Status",name:"status",type:"uint8"}],name:"setCallPolicyStatus",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"target",type:"address"},{internalType:"enum Status",name:"status",type:"uint8"}],name:"setTransferPolicyStatus",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"}],qhe=new Set([jc("function setApprovalForAll(address, bool)"),jc("function approve(address, uint256)"),jc("function transfer(address, uint256)")]);var zg;(function(t){t[t.Unset=0]="Unset",t[t.Allowed=1]="Allowed",t[t.Denied=2]="Denied"})(zg||(zg={}));async function zhe(t,e,n,r){if(e!==np.id)return;const i=[];if(r.to===n.address&&r.data?.substring(0,10)===Nhe){const a=I7({abi:K2,data:r.data});if(a.functionName==="batchCall")for(const s of a.args[0]){const o={...r,to:s.target,data:s.callData},c=jT(n,o);c&&i.push(c)}}else{const a=jT(n,r);a&&i.push(a)}if(i.length!==0)for(const a of i){const s=a.callPolicies,o=a.transferPolicies,c=[];for(const u of s)if(qhe.has(u.selector)){const d=u.constraints.filter(f=>f.index===0n&&f.condition===qg.Equal);if(d.length===0)throw new Kt(`Unconstrained token approval/transfer destination in call policy. Selector: ${u.selector}; Target: ${u.target}`);for(const f of d){const[h]=wN([{type:"address"}],f.refValue);c.push({target:h,check:{address:s5,abi:o5,functionName:"getApprovalTargetStatus",args:[u.target,h]}})}}else c.push({target:u.target,check:{address:s5,abi:o5,functionName:"getCallPolicyStatus",args:[u.target,u.selector]}});for(const u of o)c.push({target:u.target,check:{address:s5,abi:o5,functionName:"getTransferPolicyStatus",args:[u.target]}});const l=await t.multicall({contracts:c.map(u=>u.check),allowFailure:!1});for(let u=0;u<c.length;u++){const d=l[u],f=c[u];if(Number(d)!==zg.Allowed)throw new Kt(`Session key policy violation. Target: ${f?.target}; Status: ${zg[Number(d)]}`)}}}function jT(t,e){if(e.to===si&&e.data?.substring(0,10)===Mhe){const n=I7({abi:u0,data:e.data});if(n.functionName==="createSession")return n.args[0]}if(e.to===t?.address&&e.data?.substring(0,10)===Ohe){const n=I7({abi:K2,data:e.data});if(n.functionName==="addModule"&&n.args[0].toLowerCase().startsWith(si.toLowerCase())){const r=n.args[0].substring(42);return wN([uE()],`0x${r}`)[0]}}}async function f0(t,e,n,r,i,a={},s=void 0,o=!1){const c=t.chain;if(o)return d0(t,r);if(!c?.serializers?.transaction)throw new Kt("transaction serializer not found on chain.");const{transaction:l,customSignature:u}=await qj(t,e,n,r,i,a,s);return c.serializers.transaction({...l,customSignature:u,type:"eip712"},{r:"0x0",s:"0x0",v:0n})}async function qj(t,e,n,r,i,a={},s=void 0){r.type="eip712";const{account:o=t.account,chain:c=t.chain,...l}=r;if(Nj(l,["value","nonce","maxFeePerGas","maxPriorityFeePerGas","gas","chainId","gasPerPubdata"]),!o)throw new ul({docsPath:"/docs/actions/wallet/signTransaction"});const u=Dt(o),d=l.from===e.account.address,f=d?e.account:u;if(Fhe({account:f,chain:c,...l}),!c||Rs[c.id]===void 0)throw new Kt("Invalid chain specified");if(!c?.custom?.getEip712Domain)throw new Kt("`getEip712Domain` not found on chain.");const h=await Zt(t,$u,"getChainId")({});c!==null&&pm({currentChainId:h,chain:c}),await zhe(n,h,f,l);const p=await Zhe(h,f,l,s);p.data===void 0&&(p.data="0x");const g=c?.custom.getEip712Domain({...p,type:"eip712"}),y=await iC(e,{...g,account:e.account});let v;if(d)v=y;else{const b=[];if(!d){const w=await Zt(t,Us,"readContract")({address:t.account.address,abi:K2,functionName:"listHooks",args:[!0]});for(const _ of w)b.push(a[_]??"0x")}v=M2(TN(["bytes","address","bytes[]"]),[y,i,b])}return{transaction:p,customSignature:v}}async function Zhe(t,e,n,r=void 0){if(r&&!n.paymaster&&!n.paymasterInput){const i=await r({chainId:t,from:e.address,data:n.data,gas:n.gas??0n,gasPrice:n.gasPrice??0n,gasPerPubdata:n.gasPerPubdata??0n,maxFeePerGas:n.maxFeePerGas??0n,maxPriorityFeePerGas:n.maxPriorityFeePerGas??0n,nonce:n.nonce??0,to:n.to??"0x0",value:n.value??0n});return{...n,...i,from:e.address,chainId:t}}return{...n,from:e.address,chainId:t}}async function Khe(t,e,n,r,i,a=void 0){if(!await cE(n,t.account.address))throw new Kt("Smart account not deployed");const o=r.data?`0x${r.data.slice(2,10)}`:void 0;if(!r.to)throw new Kt("Transaction to field is not specified");return await f0(t,e,n,r,si,{[si]:Zm(i,Km({sessionConfig:i,target:r.to,selector:o,timestamp:BigInt(Math.floor(Date.now()/1e3))}))},a)}async function zj(t){const{client:e,signer:n,messageHash:r}=t,i=e.chain.id,a=e.account,s=await iC(n,{domain:{name:"AbstractGlobalWallet",version:"1.0.0",chainId:BigInt(i),verifyingContract:a.address},types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],AGWMessage:[{name:"signedHash",type:"bytes32"}]},message:{signedHash:r},primaryType:"AGWMessage"}),o=M2(TN(["bytes","address"]),[s,Do]);if(await oC(e,{address:a.address})!==void 0)return o;const l=lC(n.account.address),u=F2(l);return mee({address:oE,data:Qi({abi:sE,functionName:"deployAccount",args:[u,Mj(n.account.address,Do,{target:Ls,allowF
39ailure:!1,callData:"0x",value:0n})]}),signature:o})}async function Ghe(t,e,n,r,i=!1){if(lE(r)){const a=Dj(r);if(a.chainId!==t.chain.id)throw new Kt("Chain ID mismatch in AGW typed signature");const s=await f0(t,e,n,{...a,chain:t.chain},Do,{},void 0,i);if(!s.startsWith("0x71"))throw new Kt("Expected RLP encoded EIP-712 transaction as signature");const o=`0x${s.slice(4)}`,c=lee(o,"hex");if(c.length<15)throw new Kt("Expected RLP encoded EIP-712 transaction with at least 15 fields");return c[14]}else if(i)return await Whe(t,r);return await zj({client:t,signer:e,messageHash:mN(r)})}async function Yhe(t,e,n,r,i,a){if(!lE(r))throw new Kt("Session client can only sign EIP712 transactions as typed data");const s=Dj(r);if(!s.to)throw new Kt("Transaction must have a to address");const o={[si]:Zm(i,Km({sessionConfig:i,target:s.to,selector:s.data?.slice(0,10)??"0x",timestamp:BigInt(Math.floor(Date.now()/1e3))}))},{customSignature:c}=await qj(t,e,n,{chain:t.chain,...s},si,o,a);return c}async function Jhe(t,e,n,r,i,a=void 0){const{abi:s,account:o=t.account,address:c,args:l,dataSuffix:u,functionName:d,...f}=r;if(!o)throw new ul({docsPath:"/docs/contract/writeContract"});const h=Dt(o),p=Qi({abi:s,args:l,functionName:d});try{return await Hj(t,e,n,{data:`${p}${u?u.replace("0x",""):""}`,to:c,account:h,...f},i,a)}catch(g){throw wm(g,{abi:s,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:d,sender:h.address})}}async function Xhe(t,e,n,r,i,a=void 0){const{abi:s,account:o=t.account,address:c,args:l,dataSuffix:u,functionName:d,throwOnReceiptRevert:f,timeout:h,...p}=r;if(!o)throw new ul({docsPath:"/docs/contract/writeContract"});const g=Dt(o),y=Qi({abi:s,args:l,functionName:d});try{return await Wj(t,e,n,{data:`${y}${u?u.replace("0x",""):""}`,to:c,account:g,throwOnReceiptRevert:f,timeout:h,...p},i,a)}catch(v){throw wm(v,{abi:s,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:d,sender:g.address})}}function Qhe(t,e,n,r){return i=>({sendTransaction:a=>Hj(i,t,e,a,n,r),writeContract:a=>Jhe(i,t,e,a,n,r),sendTransactionSync:a=>Wj(i,t,e,a,n,r),writeContractSync:a=>Xhe(i,t,e,a,n,r),signTransaction:a=>Khe(i,t,e,a,n,r),signTypedData:a=>Yhe(i,t,e,a,n,r),getSessionStatus:()=>Vj(e,Dt(i.account).address,n)})}function epe({client:t,signer:e,session:n,paymasterHandler:r}){return tpe({account:t.account,chain:t.chain,session:n,signer:e,transport:Y_(t.transport),paymasterHandler:r})}function tpe({account:t,signer:e,chain:n,transport:r,session:i,paymasterHandler:a,nonceManager:s}){r||(r=Ii(void 0,{batch:!0}));const o=ti({transport:r,chain:n}),c=typeof t=="string"?xm(t):t;s&&(c.nonceManager=s);const l=ym({account:c,chain:n,transport:r}),u=Sm({account:e,chain:n,transport:r});return l.extend(Qhe(u,o,i,a))}const npe=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function Zj(t,e,n,r){Nj(r,["value","nonce","maxFeePerGas","maxPriorityFeePerGas","gas","chainId","gasPerPubdata"]);const i="paymaster"in r&&"paymasterInput"in r&&r.paymaster!==void 0&&r.paymasterInput!==void 0,{gas:a,nonce:s,chain:o,nonceManager:c,parameters:l=npe}=r,u=await cE(n,t.account.address);if(!u){const b={target:r.to,allowFailure:!1,value:r.value??0,callData:r.data??"0x"},w=Mj(e.account.address,Do,b),_=lC(e.account.address),E=F2(_),C=Qi({abi:sE,functionName:"deployAccount",args:[E,w]});r.to=oE,r.data=C}const d=Dt(u?t.account:e.account),f={...r,from:d.address},h=[];let p;(!i||f.value!==void 0&&f.value>0n)&&h.push(rQ(n,{address:d.address}).then(b=>{p=b}));let g;async function y(){return g||(o?o.id:typeof r.chainId<"u"?r.chainId:(g=await Zt(t,$u,"getChainId")({}),g))}l.includes("nonce")&&typeof s>"u"&&d&&(c?h.push((async()=>{const b=await y();f.nonce=await c.consume({address:d.address,chainId:b,client:n})})()):h.push(Zt(n,Qh,"getTransactionCount")({address:d.address,blockTag:"pending"}).then(b=>{f.nonce=b}))),l.includes("fees")&&typeof f.maxFeePerGas>"u"&&h.push((async()=>{f.maxFeePerGas=await iQ(n),f.maxPriorityFeePerGas=0n})()),l.includes("gas")&&typeof a>"u"&&h.push((async()=>{try{f.gas=await Zt(n,aQ,"estimateGas")({...f,account:d?{address:d.address,type:"json-rpc"}:void 0})}catch(b){throw b instanceof Error&&b.message.includes(zm)?new up:b instanceof sQ&&b.details.includes("execution reverted")?new oQ({message:`${b.data}`}):b}})()),await Promise.all(h);const v=i||!f.gas||!f.maxFeePerGas?0n:f.gas*f.maxFeePerGas;if(p!==void 0&&p<(f.value??0n)+v)throw new up;return nC(f),delete f.parameters,delete f.isInitialTransaction,delete f.nonceManager,f}async function h0(t,e,n,r,i,a={},s=void 0,o){const{chain:c=t.chain}=r;if(!e.account)throw new ul({docsPath:"/docs/actions/wallet/sendTransaction"});const l=Dt(e.account);
39try{const u=await Zj(t,e,n,{...r,parameters:["gas","nonce","fees"],isSponsored:s!==void 0||r.paymaster!==void 0,nonceManager:l.nonceManager});let d;c!==null&&(d=await Zt(e,$u,"getChainId")({}),pm({currentChainId:d,chain:c}));const f=await f0(t,e,n,{...u,chainId:d},i,a,s);return o?await o(f):await Zt(t,gm,"sendRawTransaction")({serializedTransaction:f})}catch(u){throw u instanceof Error&&u.message.includes(zm)?new up:Zp(u,{...r,account:l,chain:c})}}async function Zg(t,e,n,r,i=!1,a=void 0){if(i)try{let s={};const o=r;a&&!o.paymaster&&!o.paymasterInput&&(s=await a({...r,from:t.account.address,chainId:r.chain?.id??t.chain.id}));const c={...r,...s},l=await d0(t,c);return await n.sendRawTransaction({serializedTransaction:l})}catch(s){throw s instanceof Error&&s.message.includes(zm)?new up:Zp(s,{...r,account:r.account?Dt(r.account):null,chain:r.chain??void 0})}return h0(t,e,n,r,Do,{},a)}function rpe(t,e,n,r,i=!1){const{abi:a,args:s,bytecode:o,deploymentType:c,salt:l,...u}=r,d=cQ({abi:a,args:s,bytecode:o,deploymentType:c,salt:l});return u.factoryDeps=u.factoryDeps||[],u.factoryDeps.includes(o)||u.factoryDeps.push(o),Zg(t,e,n,{...u,data:d,to:Rhe},i)}async function ipe(t,e){if(!xo(e.id))throw new lQ({param:"id"});let n;try{n=await uQ(t,{hash:e.id})}catch(a){if(a instanceof dQ)n=void 0;else throw a}const[r,i]=n?n.status==="success"?["success",200]:n.status==="reverted"?["failure",500]:[void 0,400]:["pending",100];return{atomic:!0,chainId:t.chain.id,receipts:n?[n]:void 0,status:r,id:e.id,statusCode:i,version:"2.0.0"}}var Th;(function(t){t[t.Pending=100]="Pending",t[t.Confirmed=200]="Confirmed",t[t.OffchainFailure=400]="OffchainFailure",t[t.Reverted=500]="Reverted",t[t.PartiallyReverted=600]="PartiallyReverted"})(Th||(Th={}));function ape(t){switch(t?.status){case void 0:return Th.Pending;case"0x1":return Th.Confirmed;case"0x0":return Th.Reverted}}const dp={atomicBatch:{supported:!0},atomic:{status:"supported"}};async function spe(t,e={}){const{chainId:n}=e,r={};if(n){if(!Rs[n])throw new fQ(new Error(`Chain ${n} not supported`));return dp}for(const i of Object.keys(Rs))r[Number(i)]=dp;return r}async function ope(t,e){const{agwAddress:n}=e;if(!t2(n,{strict:!1}))throw new wg({address:n});const r=_t(n);return{linkedAccounts:[...await Zt(t,Us,"readContract")({abi:Bj,address:$j,functionName:"delegatedWalletsByRights",args:[r,Pj]})]}}async function cpe(t,e){const{address:n=t.account?.address}=e??{};if(n===void 0)throw new Kt("No address provided");if(!t2(n,{strict:!1}))throw new wg({address:n});const r=_t(n),i=await Zt(t,Us,"readContract")({abi:Bj,address:$j,functionName:"exclusiveWalletByRights",args:[r,Pj]});return i===r?{agw:void 0}:{agw:i}}async function lpe(t,e){const{address:n}=e;if(t.account===void 0)throw new ul({docsPath:"/docs/contract/readContract"});const r=Dt(t.account),{agw:i}=await cpe(t,{address:n});return i===r.address}async function upe(t,e){const{session:n,...r}=e,i=typeof n=="string"?[n]:Array.isArray(n)?n.map(dpe):[dE(n)];return{transactionHash:await Zt(t,ol,"writeContract")({address:si,abi:u0,functionName:"revokeKeys",args:[i],...r})}}function dpe(t){return typeof t=="string"?t:dE(t)}function Kj(t,e){const{calls:n,paymaster:r,paymasterInput:i}=e,a=Uhe(n),s=Qi({abi:K2,functionName:"batchCall",args:[a]}),o=a.reduce((c,l)=>c+BigInt(l.value),BigInt(0));return{to:t,data:s,value:o,paymaster:r,paymasterInput:i,type:"eip712"}}async function Gj(t,e,n,r,i=!1,a=void 0){const{calls:s,...o}=r;if(s.length===0)throw new Error("No calls provided");if(i){const l=await d0(t,{...o,calls:Uj(s)});return await n.sendRawTransaction({serializedTransaction:l})}const c=Kj(t.account.address,{calls:s,...o});return h0(t,e,n,{...c,...o},Do,{},a)}async function fpe(t,e,n,r,i=!1,a=void 0){const{calls:s,capabilities:o}=r;if(o){const l=Object.entries(o).filter(([u,d])=>!d.optional);for(const[u]of l)if(!dp[u]){const d=`non-optional capability ${u} is not supported`;throw new GM(new Kt(d,{details:d}))}}return{id:await Gj(t,e,n,{calls:s},i,a)}}async function Yj(t,e,n,r,i=!1,a=void 0){const{throwOnReceiptRevert:s,timeout:o,...c}=r;if(i)try{let l={};const u=c;
39a&&!u.paymaster&&!u.paymasterInput&&(l=await a({...c,from:t.account.address,chainId:c.chain?.id??t.chain.id}));const d={...c,...l},f=await d0(t,d);return await Xh(n,{serializedTransaction:f,throwOnReceiptRevert:s,timeout:o})}catch(l){throw l instanceof Error&&l.message.includes(zm)?new up:Zp(l,{...c,account:c.account?Dt(c.account):null,chain:c.chain??void 0})}return h0(t,e,n,c,Do,{},a,l=>Zt(t,Xh,"sendRawTransactionSync")({serializedTransaction:l,throwOnReceiptRevert:s,timeout:o}))}async function hpe(t,e,n,r=!1){return r?(typeof n.message=="object"&&(n.message.raw instanceof Uint8Array?n.message=hQ(n.message.raw):n.message=bh(n.message.raw,"string")),await Hhe(t,n)):await zj({client:t,signer:e,messageHash:yN(n.message)})}async function ppe(t,e,n,r,i,a={},s=void 0,o=!1){const{calls:c,...l}=r;if(c.length===0)throw new Error("No calls provided");if(o)return await d0(t,{...l,calls:Uj(c)});const u=Kj(t.account.address,{calls:c,...l});return f0(t,e,n,{...u,...l},i,a,s)}async function gpe(t,e,n,r,i=!1){const{abi:a,account:s=t.account,address:o,args:c,dataSuffix:l,functionName:u,...d}=r;if(!s)throw new ul({docsPath:"/docs/contract/writeContract"});const f=Dt(s),h=Qi({abi:a,args:c,functionName:u});try{return await Zg(t,e,n,{data:`${h}${l?l.replace("0x",""):""}`,to:o,account:f,...d},i)}catch(p){throw wm(p,{abi:a,address:o,args:c,docsPath:"/docs/contract/writeContract",functionName:u,sender:f.address})}}async function ype(t,e,n,r,i=!1,a=void 0){const{abi:s,account:o=t.account,address:c,args:l,dataSuffix:u,functionName:d,throwOnReceiptRevert:f,timeout:h,...p}=r;if(!o)throw new ul({docsPath:"/docs/contract/writeContract"});const g=Dt(o),y=Qi({abi:s,args:l,functionName:d});try{return await Yj(t,e,n,{data:`${y}${u?u.replace("0x",""):""}`,to:c,account:g,throwOnReceiptRevert:f,timeout:h,...p},i,a)}catch(v){throw wm(v,{abi:s,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:d,sender:g.address})}}function mpe(t,e,n=!1,r){return i=>({getChainId:()=>$u(i),getLinkedAccounts:()=>ope(i,{agwAddress:Dt(i.account).address}),isLinkedAccount:a=>lpe(i,a),createSession:a=>jhe(i,a),revokeSessions:a=>upe(i,a),prepareAbstractTransactionRequest:a=>Zj(i,t,e,a),sendTransaction:a=>Zg(i,t,e,a,n,r),sendTransactionBatch:a=>Gj(i,t,e,a,n,r),signMessage:a=>hpe(i,t,a,n),signTransaction:a=>f0(i,t,e,a,Do,{},r,n),signTransactionBatch:a=>ppe(i,t,e,a,Do,{},r,n),signTypedData:a=>Ghe(i,t,e,a,n),deployContract:a=>rpe(i,t,e,a,n),writeContract:a=>gpe(Object.assign(i,{sendTransaction:s=>Zg(i,t,e,s,n,r)}),t,e,a,n),sendTransactionSync:a=>Yj(i,t,e,a,n,r),writeContractSync:a=>ype(i,t,e,a,n,r),toSessionClient:(a,s)=>epe({client:i,signer:a,session:s,paymasterHandler:r}),getSessionStatus:a=>Vj(e,Dt(i.account).address,a),getCallsStatus:a=>ipe(e,a),sendCalls:a=>fpe(i,t,e,a,n,r),getCapabilities:a=>spe(i,a),showCallsStatus:a=>Promise.resolve()})}async function Jj({signer:t,chain:e,transport:n,address:r,isPrivyCrossApp:i=!1,publicTransport:a=Ii(void 0,{batch:!0}),customPaymasterHandler:s}){if(!n)throw new Error("Transport is required");const o=ti({chain:e,transport:a}),c=r??await Oj(t.address,o),l=ym({account:xm(c),chain:e,transport:n}),u=Sm({account:t,chain:e,transport:n});return l.extend(mpe(u,o,i,s))}async function BT(t,e,n){const r=ti({chain:t,transport:e});return await Oj(n,r)}async function _l(t,e="eth_accounts"){return(await t.request({method:e}))?.[0]}async function C1(t,e,n,r,i,a){const s=Sm({account:t,transport:n}),o=xm({address:t,signMessage:s.signMessage,signTransaction:s.signTransaction,signTypedData:s.signTypedData});return await Jj({chain:e,signer:o,transport:n,isPrivyCrossApp:r,publicTransport:i,customPaymasterHandler:a})}function vpe(t){const{provider:e,chain:n,transport:r,isPrivyCrossApp:i=!1,customPaymasterHandler:a}=t,s=Y_(e),o=async c=>{const{method:l,params:u}=c;switch(l){case"eth_requestAccounts":{const d=await _l(e,l);return d?[await BT(n,s,d),d]:[]}case"eth_accounts":{const d=await _l(e);return d?[await BT(n,s,d),d]:[]}case"eth_signTypedData_v4":{const d=await _l(e);if(!d)throw new Error("Account not found");return u[0]===d?e.request(c):(await C1(d,n,s,i,r,a)).signTypedData(JSON.parse(u[1]))}case"personal_sign":{const d=await _l(e);if(!d)throw new Error("Account not found");return u[1]===d?e.request(c):await(await C1(d,n,s,i,r,a)).signMessage({message:{raw:u[0]}})}case"eth_signTransaction":case"eth_sendTransaction":{const d=await _l(e);if(!d)throw new Error("Account not found");const f=u[0];if(f.from===d)return await e.request(c);const h=await C1(d,n,s,i,r,a);if(f.eip712Meta?.paymasterParams&&(f.paymaster=f.eip712Meta.paymasterParams.paymaster,f.paymasterInput=An(f.eip712Meta.paymasterParams.paymasterInput)),l==="eth_signTransaction")return await h.signTransaction(f);if(l==="eth_sendTransaction")return await h.sendTransaction(f);throw new Error("Should not have reached this point")}case"wallet_sendCalls":{const d=await _l(e);if(!d)throw new Error("Account not found");const f=u[0];if(f.from===d)return await e.request(c);
39if((f.version==="1.0"||f.version===void 0)&&f.calls.forEach(y=>{y.chainId&&pm({chain:n,currentChainId:bh(y.chainId,"number")})}),f.version==="2.0.0"&&bh(f.chainId,"number")!==n.id)return{code:5710,message:"Chain not supported"};const h=await C1(d,n,s,i,r,a);if(f.from!==Dt(h.account).address)return{code:4001,message:"Unauthorized"};const p=[];for(const y of f.calls){if(!y.to)return{code:-32602,message:"Invalid call to unspecified address"};p.push({to:y.to,value:y.value?gg(y.value):0n,data:y.data??"0x"})}const g=await h.sendTransactionBatch({calls:p});return f.version===void 0||f.version==="1.0"?g:{id:g}}case"wallet_getCallsStatus":{const d=await e.request({method:"eth_getTransactionReceipt",params:u});return{version:"2.0.0",id:u[0],chainId:An(n.id),status:ape(d??void 0),atomic:!0,receipts:d!=null?[d]:void 0}}case"wallet_addEthereumChain":case"wallet_switchEthereumChain":{const f=u[0].chainId;if(!f)throw new Error("Chain ID is required");const h=xo(f)?A7(f):f;if(!Object.values(Rs).find(g=>g.id===h))throw new Error(`Chain ${h} not supported`);return await e.request(c)}case"wallet_showCallsStatus":return;case"wallet_getCapabilities":{const d=await _l(e);if(!d)throw new Error("Account not found");if(u[0]===d)return await e.request(c);const f=u[1];if(f){const h={};for(const p of f)Rs[bh(p,"number")]&&(h[p]=dp);return h}else return Object.keys(Rs).reduce((h,p)=>(h[An(Number(p))]=dp,h),{})}default:return await e.request(c)}};return{...e,on:e.on,removeListener:e.removeListener,request:o}}const wpe="2.22.1",bpe=()=>`@wagmi/core@${wpe}`;var Xj=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Kg,Qj;let eB=class Rw extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return bpe()}constructor(e,n={}){super(),Kg.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof Rw?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof Rw&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` 40`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return Xj(this,Kg,"m",Qj).call(this,this,e)}};Kg=new WeakSet,Qj=function t(e,n){return n?.(e)?e:e.cause?Xj(this,Kg,"m",t).call(this,e.cause,n):e};class tB extends eB{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Es extends eB{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}fE.type="injected";function fE(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{..._pe[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l?.ethereum}}}let i,a,s,o;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:fE.type,async setup(){const l=await this.getProvider();l?.on&&t.target&&(s||(s=this.onConnect.bind(this),l.on("connect",s)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:u,withCapabilities:d}={}){const f=await this.getProvider();if(!f)throw new Es;let h=[];if(u)h=await this.getAccounts().catch(()=>[]);else if(e)try{h=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0]?.caveats?.[0]?.value?.map(g=>_t(g)),h.length>0&&(h=await this.getAccounts())}catch(p){const g=p;if(g.code===ar.code)throw new ar(g);if(g.code===Dd.code)throw g}try{!h?.length&&!u&&(h=(await f.request({method:"eth_requestAccounts"})).map(y=>_t(y))),s&&(f.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),f.on("disconnect",o));let p=await this.getChainId();return l&&p!==l&&(p=(await this.switchChain({chainId:l}).catch(y=>{if(y.code===ar.code)throw y;return{id:p}}))?.id??p),e&&await c.storage?.removeItem(`${this.id}.disconnected`),t.target||await c.storage?.setItem("injected.connected",!0),{accounts:d?h.map(g=>({address:g,capabilities:{}})):h,chainId:p}}catch(p){const g=p;throw g.code===ar.code?new ar(g):g.code===Dd.code?new Dd(g):g}},async disconnect(){const l=await this.getProvider();if(!l)throw new Es;a&&(l.removeListener("chainChanged",a),a=void 0),o&&(l.removeListener("disconnect",o),o=void 0),s||(s=this.onConnect.bind(this),l.on("connect",s));try{await vN(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await c.storage?.setItem(`${this.id}.disconnected`,!0),t.target||await c.storage?.removeItem("injected.connected")},async getAccounts(){const l=await this.getProvider();if(!l)throw new Es;return(await l.request({method:"eth_accounts"})).map(d=>_t(d))},async getChainId(){const l=await this.getProvider();if(!l)throw new Es;const u=await l.request({method:"eth_chainId"});return Number(u)}
40,async getProvider(){if(typeof window>"u")return;let l;const u=r();return typeof u.provider=="function"?l=u.provider(window):typeof u.provider=="string"?l=U3(window,u.provider):l=u.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){try{if(e&&await c.storage?.getItem(`${this.id}.disconnected`)||!t.target&&!await c.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const f=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",f),!!await this.getProvider()),h=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(g=>window.addEventListener("ethereum#initialized",()=>g(f()),{once:!0}))]:[],new Promise(g=>setTimeout(()=>g(f()),h))]))return!0}throw new Es}return!!(await X_(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){const d=await this.getProvider();if(!d)throw new Es;const f=c.chains.find(p=>p.id===u);if(!f)throw new tp(new tB);const h=new Promise(p=>{const g=y=>{"chainId"in y&&y.chainId===u&&(c.emitter.off("change",g),p())};c.emitter.on("change",g)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:Xi(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),h]),f}catch(p){const g=p;if(g.code===4902||g?.data?.originalError?.code===4902)try{const{default:y,...v}=f.blockExplorers??{};let b;l?.blockExplorerUrls?b=l.blockExplorerUrls:y&&(b=[y.url,...Object.values(v).map(E=>E.url)]);let w;l?.rpcUrls?.length?w=l.rpcUrls:w=[f.rpcUrls.default?.http[0]??""];const _={blockExplorerUrls:b,chainId:Xi(u),chainName:l?.chainName??f.name,iconUrls:l?.iconUrls,nativeCurrency:l?.nativeCurrency??f.nativeCurrency,rpcUrls:w};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[_]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new ar(new Error("User rejected switch after adding network."))}),h]),f}catch(y){throw new ar(y)}throw g.code===ar.code?new ar(g):new tp(g)}},async onAccountsChanged(l){if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const u=(await this.getChainId()).toString();this.onConnect({chainId:u}),e&&await c.storage?.removeItem(`${this.id}.disconnected`)}else c.emitter.emit("change",{accounts:l.map(u=>_t(u))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onConnect(l){const u=await this.getAccounts();if(u.length===0)return;const d=Number(l.chainId);c.emitter.emit("connect",{accounts:u,chainId:d});const f=await this.getProvider();f&&(s&&(f.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),f.on("disconnect",o)))},async onDisconnect(l){const u=await this.getProvider();l&&l.code===1013&&u&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),u&&(a&&(u.removeListener("chainChanged",a),a=void 0),o&&(u.removeListener("disconnect",o),o=void 0),s||(s=this.onConnect.bind(this),u.on("connect",s))))}})}const _pe={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t?.coinbaseWalletExtension?t.coinbaseWalletExtension:U3(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return U3(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(e[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){return t?.phantom?.ethereum?t.phantom?.ethereum:U3(t,"isPhantom")}}};function U3(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r?.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}async function Cpe({providerAppId:t,apiUrl:e}){let n=await fetch(`${e}/api/v1/apps/${t}/cross-app/details`,{method:"GET",headers:{"Content-Type":"application/json"}}),{custom_connect_url:r,custom_transact_url:i,custom_api_url:a,icon_url:s,name:o}=await n.json();return{url:a,customConnectUrl:r,customTransactUrl:i,name:o,iconUrl:s}}const Epe=({w:t,h:e})=>{let n=window.screenLeft!==void 0?window.screenLeft:window.screenX,r=window.screenTop!==void 0?window.screenTop:window.screenY,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;return`toolbar=0,location=0,menubar=0,height=${e},width=${t}
40,popup=1,left=${(i-t)/2/(i/window.screen.availWidth)+n},top=${(a-e)/2/(a/window.screen.availHeight)+r}`},nB=t=>window.open(t?.location,void 0,Epe({w:440,h:680})),rB=12e4;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Spe(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Ape(...t){const e=a=>a,n=(a,s)=>o=>a(s(o)),r=t.map(a=>a.encode).reduceRight(n,e),i=t.map(a=>a.decode).reduce(n,e);return{encode:r,decode:i}}function xpe(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(n=>{if(n<0||n>=t.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${t.length})`);return t[n]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=t.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${t}`);return r})}}}function Ipe(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function Tpe(t,e="="){if(typeof e!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*t%8;)n.push(e);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if(!((r-1)*t%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}const iB=(t,e)=>e?iB(e,t%e):t,Gg=(t,e)=>t+(e-iB(t,e));function VT(t,e,n,r){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Gg(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${Gg(e,n)}`);let i=0,a=0;const s=2**n-1,o=[];for(const c of t){if(c>=2**e)throw new Error(`convertRadix2: invalid data word=${c} from=${e}`);if(i=i<<e|c,a+e>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${e}`);for(a+=e;a>=n;a-=n)o.push((i>>a-n&s)>>>0);i&=2**a-1}if(i=i<<n-a&s,!r&&a>=e)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&a>0&&o.push(i>>>0),o}function Lpe(t,e=!1){if(t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Gg(8,t)>32||Gg(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!Spe(n))throw new Error("radix2.encode input should be Uint8Array");return VT(Array.from(n),8,t,!e)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(VT(n,t,8,e))}}}const Lh=Ape(Lpe(6),xpe("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Tpe(6),Ipe(""));var jr=Uint8Array,Yi=Uint16Array,hE=Int32Array,Gm=new jr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ym=new jr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ow=new jr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aB=function(t,e){for(var n=new Yi(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new hE(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},sB=aB(Gm,2),oB=sB.b,Mw=sB.r;oB[28]=258,Mw[258]=28;var cB=aB(Ym,0),kpe=cB.b,HT=cB.r,Nw=new Yi(32768);for(var fn=0;fn<32768;++fn){var ic=(fn&43690)>>1|(fn&21845)<<1;ic=(ic&52428)>>2|(ic&13107)<<2,ic=(ic&61680)>>4|(ic&3855)<<4,Nw[fn]=((ic&65280)>>8|(ic&255)<<8)>>1}var Os=function(t,e,n){for(var r=t.length,i=0,a=new Yi(e);i<r;++i)t[i]&&++a[t[i]-1];var s=new Yi(e);for(i=1;i<e;++i)s[i]=s[i-1]+a[i-1]<<1;var o;if(n){o=new Yi(1<<e);var c=15-e;for(i=0;i<r;++i)if(t[i])for(var l=i<<4|t[i],u=e-t[i],d=s[t[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)o[Nw[d]>>c]=l}else for(o=new Yi(r),i=0;i<r;++i)t[i]&&(o[i]=Nw[s[t[i]-1]++]>>15-t[i]);return o},tl=new jr(288);for(var fn=0;fn<144;++fn)tl[fn]=8;for(var fn=144;fn<256;++fn)tl[fn]=9;for(var fn=256;fn<280;++fn)tl[fn]=7;for(var fn=280;fn<288;++fn)tl[fn]=8;var fp=new jr(32);for(var fn=0;fn<32;++fn)fp[fn]=5;var $pe=Os(tl,9,0),Ppe=Os(tl,9,1),Rpe=Os(fp,5,0),Ope=Os(fp,5,1),c5=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Pa=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},l5=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},pE=function(t){return(t+7)/8|0},lB=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new jr(t.subarray(e,n))}
vendor: 8,588 bytes, line 40
40,Mpe=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Va=function(t,e,n){var r=new Error(e||Mpe[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Va),!n)throw r;return r},Npe=function(t,e,n,r){var i=t.length,a=0;if(!i||e.f&&!e.l)return n||new jr(0);var s=!n,o=s||e.i!=2,c=e.i;s&&(n=new jr(i*3));var l=function(ne){var ce=n.length;if(ne>ce){var xe=new jr(Math.max(ce*2,ne));xe.set(n),n=xe}},u=e.f||0,d=e.p||0,f=e.b||0,h=e.l,p=e.d,g=e.m,y=e.n,v=i*8;do{if(!h){u=Pa(t,d,1);var b=Pa(t,d+1,3);if(d+=3,b)if(b==1)h=Ppe,p=Ope,g=9,y=5;else if(b==2){var C=Pa(t,d,31)+257,x=Pa(t,d+10,15)+4,$=C+Pa(t,d+5,31)+1;d+=14;for(var T=new jr($),U=new jr(19),O=0;O<x;++O)U[Ow[O]]=Pa(t,d+O*3,7);d+=x*3;for(var F=c5(U),k=(1<<F)-1,S=Os(U,F,1),O=0;O<$;){var I=S[Pa(t,d,k)];d+=I&15;var w=I>>4;if(w<16)T[O++]=w;else{var A=0,R=0;for(w==16?(R=3+Pa(t,d,3),d+=2,A=T[O-1]):w==17?(R=3+Pa(t,d,7),d+=3):w==18&&(R=11+Pa(t,d,127),d+=7);R--;)T[O++]=A}}var N=T.subarray(0,C),P=T.subarray(C);g=c5(N),y=c5(P),h=Os(N,g,1),p=Os(P,y,1)}else Va(1);else{var w=pE(d)+4,_=t[w-4]|t[w-3]<<8,E=w+_;if(E>i){c&&Va(0);break}o&&l(f+_),n.set(t.subarray(w,E),f),e.b=f+=_,e.p=d=E*8,e.f=u;continue}if(d>v){c&&Va(0);break}}o&&l(f+131072);for(var j=(1<<g)-1,M=(1<<y)-1,V=d;;V=d){var A=h[l5(t,d)&j],B=A>>4;if(d+=A&15,d>v){c&&Va(0);break}if(A||Va(2),B<256)n[f++]=B;else if(B==256){V=d,h=null;break}else{var G=B-254;if(B>264){var O=B-257,Z=Gm[O];G=Pa(t,d,(1<<Z)-1)+oB[O],d+=Z}var ie=p[l5(t,d)&M],oe=ie>>4;ie||Va(3),d+=ie&15;var P=kpe[oe];if(oe>3){var Z=Ym[oe];P+=l5(t,d)&(1<<Z)-1,d+=Z}if(d>v){c&&Va(0);break}o&&l(f+131072);var z=f+G;if(f<P){var J=a-P,K=Math.min(P,z);for(J+f<0&&Va(3);f<K;++f)n[f]=r[J+f]}for(;f<z;++f)n[f]=n[f-P]}}e.l=h,e.p=V,e.b=f,e.f=u,h&&(u=1,e.m=g,e.d=p,e.n=y)}while(!u);return f!=n.length&&s?lB(n,0,f):n.subarray(0,f)},to=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},xf=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},u5=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,a=n.slice();if(!i)return{t:dB,l:0};if(i==1){var s=new jr(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(E,C){return E.f-C.f}),n.push({s:-1,f:25001});var o=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};u!=i-1;)o=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:o.f+c.f,l:o,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var h=new Yi(f+1),p=Dw(n[u-1],h,0);if(p>e){var r=0,g=0,y=p-e,v=1<<y;for(a.sort(function(C,x){return h[x.s]-h[C.s]||C.f-x.f});r<i;++r){var b=a[r].s;if(h[b]>e)g+=v-(1<<p-h[b]),h[b]=e;else break}for(g>>=y;g>0;){var w=a[r].s;h[w]<e?g-=1<<e-h[w]++-1:++r}for(;r>=0&&g;--r){var _=a[r].s;h[_]==e&&(--h[_],++g)}p=e}return{t:new jr(h),l:p}},Dw=function(t,e,n){return t.s==-1?Math.max(Dw(t.l,e,n+1),Dw(t.r,e,n+1)):e[t.s]=n},WT=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Yi(++e),r=0,i=t[0],a=1,s=function(c){n[r++]=c},o=1;o<=e;++o)if(t[o]==i&&o!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(i),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(i);a=1,i=t[o]}return{c:n.subarray(0,r),n:e}},If=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},uB=function(t,e,n){var r=n.length,i=pE(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var a=0;a<r;++a)t[i+a+4]=n[a];return(i+4+r)*8},qT=function(t,e,n,r,i,a,s,o,c,l,u){to(e,u++,n),++i[256];for(var d=u5(i,15),f=d.t,h=d.l,p=u5(a,15),g=p.t,y=p.l,v=WT(f),b=v.c,w=v.n,_=WT(g),E=_.c,C=_.n,x=new Yi(19),$=0;$<b.length;++$)++x[b[$]&31];for(var $=0;$<E.length;++$)++x[E[$]&31];for(var T=u5(x,7),U=T.t,O=T.l,F=19;F>4&&!U[Ow[F-1]];--F);var k=l+5<<3,S=If(i,tl)+If(a,fp)+s,I=If(i,f)+If(a,g)+s+14+3*F+If(x,U)+2*x[16]+3*x[17]+7*x[18];if(c>=0&&k<=S&&k<=I)return uB(e,u,t.subarray(c,c+l));var A,R,N,P;if(to(e,u,1+(I<S)),u+=2,I<S){A=Os(f,h,0),R=f,N=Os(g,y,0),P=g;var j=Os(U,O,0);to(e,u,w-257),to(e,u+5,C-1),to(e,u+10,F-4),u+=14;for(var $=0;$<F;++$)to(e,u+3*$,U[Ow[$]]);u+=3*F;for(var M=[b,E],V=0;V<2;++V)for(var B=M[V],$=0;$<B.length;++$){var G=B[$]&31;to(e,u,j[G]),u+=U[G],G>15&&(to(e,u,B[$]>>5&127),u+=B[$]>>12)}}else A=$pe,R=tl,N=Rpe,P=fp;for(var $=0;$<o;++$){var Z=r[$];if(Z>255){var G=Z>>18&31;xf(e,u,A[G+257]),u+=R[G+257],G>7&&(to(e,u,Z>>23&31),u+=Gm[G]);var ie=Z&31;xf(e,u,N[ie]),u+=P[ie],ie>3&&(xf(e,u,Z>>5&8191),u+=Ym[ie])}else xf(e,u,A[Z]),u+=R[Z]}return xf(e,u,A[256]),u+R[256]},Dpe=new hE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),dB=new jr(0),Fpe=function(t,e,n,r,i,a){var s=a.z||t.length,o=new jr(r+s+5*(1+Math.ceil(s/7e3))+i),c=o.subarray(r,o.length-i),l=a.l,u=(a.r||0)&7;if(e){u&&(c[0]=a.r>>3);for(var d=Dpe[e-1],f=d>>13,h=d&8191,p=(1<<n)-1,g=a.p||new Yi(32768),y=a.h||new Yi(p+1),v=Math.ceil(n/3),b=2*v,w=function(ke){return(t[ke]^t[ke+1]<<v^t[ke+2]<<b)&p},_=new hE(25e3),E=new Yi(288),C=new Yi(32),x=0,$=0,T=a.i||0,U=0,O=a.w||0,F=0;T+2<s;++T){var k=w(T),S=T&32767,I=y[k];if(g[S]=I,y[k]=S,O<=T){var A=s-T;if((x>7e3||U>24576)&&(A>423||!l)){u=qT(t,c,0,_,E,C,$,U,F,T-F,u),U=x=$=0,F=T;for(var R=0;R<286;++R)E[R]=0;for(var R=0;R<30;++R)C[R]=0}var N=2,P=0,j=h,M=S-I&32767;if(A>2&&k==w(T-M))for(var V=Math.min(f,A)-1,B=Math.min(32767,T),G=Math.min(258,A);M<=B&&--j&&S!=I;){if(t[T+N]==t[T+N-M]){for(var Z=0;Z<G&&t[T+Z]==t[T+Z-M];++Z);if(Z>N){if(N=Z,P=M,Z>V)break;for(var ie=Math.min(M,Z-2),oe=0,R=0;R<ie;++R){var z=T-M+R&32767,J=g[z],K=z-J&32767;K>oe&&(oe=K,I=z)}}}S=I,I=g[S],M+=S-I&32767}if(P){_[U++]=268435456|Mw[N]<<18|HT[P];var ne=Mw[N]&31,ce=HT[P]&31;$+=Gm[ne]+Ym[ce],++E[257+ne],++C[ce],O=T+N,++x}else _[U++]=t[T],++E[t[T]]}}for(T=Math.max(T,O);T<s;++T)_[U++]=t[T],++E[t[T]];u=qT(t,c,l,_,E,C,$,U,F,T-F,u),l||(a.r=u&7|c[u/8|0]<<3,u-=7,a.h=y,a.p=g,a.i=T,a.w=O)}else{for(var T=a.w||0;T<s+l;T+=65535){var xe=T+65535;xe>=s&&(c[u/8|0]=l,xe=s),u=uB(c,u+1,t.subarray(T,xe))}a.i=s}return lB(o,0,r+pE(u)+i)},fB=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,a=n.length|0,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=r+=n[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}t=r,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},Upe=function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),s=new jr(a.length+t.length);s.set(a),s.set(t,a.length),t=s,i.w=a.length}return Fpe(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,i)},hB=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},jpe=function(t,e){var n=e.level,r=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=fB();i.p(e.dictionary),hB(t,2,i.d())}},Bpe=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&Va(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&Va(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2};function Vpe(t,e){e||(e={});var n=fB();n.p(t);var r=Upe(t,e,e.dictionary?6:2,4);return jpe(r,e),hB(r,r.length-4,n.d()),r}function Hpe(t,e){return Npe(t.subarray(Bpe(t,e),-4),{i:2},e,e)}var Wpe=typeof TextDecoder<"u"&&new TextDecoder,qpe=0;try{Wpe.decode(dB,{stream:!0}),qpe=1}catch{}const zpe=t=>Bc.encode(t),Zpe=t=>{try{return Uint8Array.from(Bc.decode(t))}catch(e){if(e instanceof Error&&e.message.includes("string should have whole number of bytes"))return Uint8Array.from($D.decode(t));throw e}},Kpe=t=>Tm.encode(t),Gpe=t=>Uint8Array.from(Tm.decode(t)),Ype=t=>Uint8Array.from(Lm.decode(t.startsWith("0x")?t.slice(2):t)),Jpe=t=>Lm.encode(t);let Xpe=new TextEncoder;const Qpe=t=>Uint8Array.from(Xpe.encode(t));let e0e=new TextDecoder,t0e=new TextDecoder("utf-8",{fatal:!0});const n0e=(t,e)=>(e?.fatal?t0e:e0e).decode(t),Wc={utf8:{fromBytes:n0e,toBytes:Qpe},base64:{fromBytes:zpe,toBytes:Zpe},base64url:{fromBytes:Kpe,toBytes:Gpe},hex:{fromBytes:Jpe,toBytes:Ype}};function r0e(){let t=K7.utils.randomPrivateKey(),e=K7.getPublicKey(t);return{privateKey:Lh.encode(t),publicKey:Lh.encode(e)}}function i0e({privateKey:t,publicKey:e}){let n=K7.getSharedSecret(Lh.decode(t),Lh.decode(e)).slice(1);return Lh.encode(n)}async function a0e(t,e){let n=JSON.stringify(t),r=Vpe(Wc.utf8.toBytes(n)),i=Wc.base64.toBytes(e),a=await crypto.subtle.importKey("raw",i,{name:"AES-GCM"},!0,["encrypt"]),s=crypto.getRandomValues(new Uint8Array(12)),o=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},a,new Uint8Array(r));
40return{iv:Wc.base64.fromBytes(s),encryptedRequest:Wc.base64.fromBytes(new Uint8Array(o))}}async function s0e({encryptedResult:t,iv:e,sharedSecret:n}){let r=Wc.base64.toBytes(n),i=Wc.base64.toBytes(e),a=await crypto.subtle.importKey("raw",r,{name:"AES-GCM"},!0,["decrypt"]),s=Wc.base64.toBytes(t),o=await crypto.subtle.decrypt({name:"AES-GCM",iv:i},a,s),c=Hpe(TJ.from(o));return Wc.utf8.fromBytes(c)}async function o0e({request:t,apiUrl:e,publicKey:n,sharedSecret:r,providerAppId:i,timeout:a=rB}){let s=nB();if(!s)throw Error("Failed to initialize request");let o=new URL(e),{encryptedRequest:c,iv:l}=await a0e(t,r);return o.searchParams.set("requester_public_key",n),o.searchParams.set("encrypted_request",c),o.searchParams.set("requester_origin",window.location.origin),o.searchParams.set("iv",l),o.searchParams.set("provider_app_id",i),o.searchParams.set("signout_enabled","true"),o.searchParams.set("v","1"),s.location=o.href,new Promise((u,d)=>{let f=setTimeout(()=>{g(),d(new kh("Request timeout"))},a),h=setInterval(()=>{s.closed&&(g(),d(new kh("User rejected request")))},300),p=async y=>{y.data&&(y.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&y.data.encryptedResult&&(g(),u(await s0e({encryptedResult:y.data.encryptedResult,iv:y.data.iv,sharedSecret:r}))),y.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&y.data.error&&(g(),d(new kh(y.data.error,{mwp:y.data.mwp,code:y.data?.errorCode}))))};window.addEventListener("message",p);let g=()=>{s.close(),clearInterval(h),clearTimeout(f),window.removeEventListener("message",p)}})}let kh=class extends Error{constructor(e,n){super(e),n?.mwp?.action&&(this.action=n.mwp.action),n?.code&&(this.code=n.code)}};async function c0e({url:t,timeout:e=rB}){let n=nB({location:t.href});if(!n)throw Error("");return new Promise((r,i)=>{let a,s=setTimeout(()=>{i(Error(`Authorization request timed out after ${e} ms.`)),o()},e);function o(){n?.close(),window.removeEventListener("message",l)}let c=setInterval(()=>{n?.closed&&!a&&(o(),clearInterval(c),clearTimeout(s),i(Error("User rejected request")))},300);function l(u){u.data&&(u.data.type==="PRIVY_CROSS_APP_CONNECT_RESPONSE"&&(r(u.data),n?.close()),u.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&(clearTimeout(s),i(Error(u.data.error)),o()),u.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&((a=new BroadcastChannel("popup-privy-oauth")).onmessage=l))}window.addEventListener("message",l)})}async function l0e({providerAppId:t,providerUrl:e,connectionOpts:n,defaultPopupTimeout:r}){let i=new URL(e),{privateKey:a,publicKey:s}=r0e();i.searchParams.set("requester_public_key",s),i.searchParams.set("connect","true"),i.searchParams.set("provider_app_id",t),i.searchParams.set("requester_origin",window.location.origin),i.searchParams.set("smart_wallet_mode",n?.smartWalletMode?"true":"false");let{address:o,providerPublicKey:c,exp:l}=await c0e({url:i,timeout:r});return{address:o,sharedSecret:i0e({privateKey:a,publicKey:c}),publicKey:s,exp:l}}let u0e=class{get(e){return this._cache[e]}put(e,n){n!==void 0?this._cache[e]=n:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}},d0e=class{get(e){let n=localStorage.getItem(e);return n===null?void 0:JSON.parse(n)}put(e,n){n!==void 0?localStorage.setItem(e,JSON.stringify(n)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}};var nd=typeof window<"u"&&window.localStorage?new d0e:new u0e;const f0e=({providerAppId:t,chains:e,chainId:n,apiUrl:r,connectionOpts:i,defaultPopupTimeout:a,overrideConnectUrl:s,overrideTransactUrl:o})=>new h0e(t,e,n,r,i,a,s,o);let h0e=class{get STORAGE_CONNECTION_KEY(){let{smartWalletMode:e}=this._connectionOpts??{};return`privy-caw:${this.providerAppId}:connection${e?":smart-wallet":""}`}get STORAGE_CHAIN_ID_KEY(){let{smartWalletMode:e}=this._connectionOpts??{};return`privy-caw:${this.providerAppId}:connection_chain_id${e?":smart-wallet":""}`}async loadProviderDetails(){if(!this._providerDetailsLoaded){let{url:e,customConnectUrl:n,customTransactUrl:r}=await Cpe({providerAppId:this.providerAppId,apiUrl:this._apiUrl});this._providerConnectUrl=this._overrideConnectUrl||n||`${e}/cross-app/connect`,this._providerTransactUrl=this._overrideTransactUrl||r||`${e}/cross-app/transact`,this._providerDetailsLoaded=!0}}async getProviderConnectUrl(){return await this.loadProviderDetails(),this._providerConnectUrl}async getProviderTransactUrl(){return await this.loadProviderDetails(),this._providerTransactUrl}clearConnection(){this._sharedSecret=void 0,this._publicKey=void 0,this._address=void 0,nd.del(this.STORAGE_CONNECTION_KEY),nd.del(this.STORAGE_CHAIN_ID_KEY)}get chain(){return this.chains.find(({id:e})=>e===this.chainId)}get address(){return this._address}async requestConnection(){let{address:e,sharedSecret:n,publicKey:r,exp:i}=await l0e({providerAppId:this.providerAppId,providerUrl:await this.getProviderConnectUrl(),connectionOpts:this._connectionOpts,defaultPopupTimeout:this._defaultPopupTimeout});nd.put(this.STORAGE_CONNECTION_KEY,{address:e,sharedSecret:n,publicKey:r,exp:i}),this._address=e,this._sharedSecret=n,this._publicKey=r}switchChain({id:e}){this.chainId=e,nd.put(this.STORAGE_CHAIN_ID_KEY,this.chainId)}async sendRequest(e,n){if(!this._sharedSecret||!this._publicKey)throw Error(`Must call 'eth_requestAccounts' before ${e}`);try{return await o0e({request:{method:e,params:n,chainId:this.chainId},apiUrl:await this.getProviderTransactUrl(),publicKey:this._publicKey,providerAppId:this.providerAppId,sharedSecret:this._sharedSecret,timeout:this._defaultPopupTimeout})}catch(r){throw r instanceof kh&&r.action==="clear"&&this.clearConnection(),r}}constructor(e,n,r,i,a,s,o,c){this._providerDetailsLoaded=!1,this.providerAppId=e,this.chains=n,this._apiUrl=i??"https://auth.privy.io",this._connectionOpts=a,this._defaultPopupTimeout=s,this._overrideConnectUrl=o,this._overrideTransactUrl=c;let l=nd.get(this.STORAGE_CONNECTION_KEY),u=l&&l.exp>new Date().getTime(),d=nd.get(this.STORAGE_CHAIN_ID_KEY);this.chainId=r??d??n[0].id,u?(this._sharedSecret=l.sharedSecret,this._publicKey=l.publicKey,this._address=l.address):this.clearConnection(),typeof window<"u"&&this.loadProviderDetails()}};const p0e=t=>{let e=f0e({providerAppId:t.providerAppId,chains:t.chains,chainId:t.chainId,apiUrl:t.apiUrl,connectionOpts:{smartWalletMode:t.smartWalletMode},defaultPopupTimeout:t.defaultPopupTimeout,overrideConnectUrl:t.overrideConnectUrl,overrideTransactUrl:t.overrideTransactUrl}),n=ti({chain:e.chain,transport:t.transports?.[e.chain.id]??Ii()}),r={accountsChanged:[],connect:[],chainChanged:[],disconnect:[],message:[]},i=()=>{e.clearConnection(),r.accountsChanged?.forEach(a=>a([]))};return{on:(a,s)=>{r[a].push(s)},removeListener:(a,s)=>{let o=r[a].indexOf(s);o>-1&&r[a].splice(o)},request:async a=>{t.smartWalletMode&&(a.method==="eth_sendTransaction"&&(a.method="privy_sendSmartWalletTx"),a.method==="eth_signTransaction"&&(a.method="privy_signSmartWalletTx"),a.method==="personal_sign"&&(a.method="privy_signSmartWalletMessage"),a.method==="eth_signTypedData_v4"&&(a.method="privy_signSmartWalletTypedData"));let{method:s,params:o}=a;if(console.debug("PrivyWalletProvider.request",{method:s,params:o}),s==="wallet_requestPermissions"||s==="eth_requestAccounts"&&!e.address)return await e.requestConnection(),r.accountsChanged?.forEach(c=>c([e.address])),void r.connect?.forEach(c=>c({chainId:zT(e.chain.id)}));if(s==="eth_chainId")return e.chain.id;if(y0e(s))return n.request({method:s,params:o});switch(s){case"eth_requestAccounts":case"eth_accounts":return e.address?[e.address]:[];case"wallet_switchEthereumChain":return e.switchChain({id:Number(o[0].chainId)}),n=ti({chain:e.chain,transport:t.transports?.[e.chain.id]??Ii()}),r.chainChanged.forEach(c=>c(zT(e.chain.id))),null;case"wallet_revokePermissions":return void i();case"eth_sendTransaction":case"eth_signTransaction":case"eth_signTypedData_v4":case"eth_sign":case"privy_signSmartWalletMessage":case"privy_signSmartWalletTypedData":case"privy_signSmartWalletTx":case"privy_sendSmartWalletTx":case"personal_sign":["eth_sendTransaction","eth_signTransaction","privy_sendSmartWalletTx","privy_signSmartWalletTx"].includes(s)&&(o[0].chainId??=e.chain.id);try{return await e.sendRequest(s,o)}catch(c){throw c instanceof kh&&(c.action==="clear"&&i(),c.code===void 0&&c.message==="User rejected request")?new h6(Error("User rejected request"),{code:4001,shortMessage:"User rejected request"}):new h6(c,{code:c.code??-1,shortMessage:c.message})}default:throw new h6(Error("Unsupported method"),{code:4200,shortMessage:`Unsupported method: ${s}`})}}}};let zT=t=>`0x${t.toString(16)}`,g0e={web3_clientVersion:!0,web3_sha3:!0,net_listening:!0,net_peerCount:!0,net_version:!0,eth_blobBaseFee:!0,eth_blockNumber:!0,eth_call:!0,eth_chainId:!0,eth_coinbase:!0,eth_estimateGas:!0,eth_feeHistory:!0,eth_fillTransaction:!0,eth_gasPrice:!0,eth_getBalance:!0,eth_getBlockByHash:!0,eth_getBlockByNumber:!0,eth_getBlockReceipts:!0,eth_getBlockTransactionCountByHash:!0,eth_getBlockTransactionCountByNumber:!0,eth_getCode:!0,eth_getFilterChanges:!0,eth_getFilterLogs:!0,eth_getLogs:!0,eth_getProof:!0,eth_getStorageAt:!0,eth_getTransactionByBlockHashAndIndex:!0,eth_getTransactionByBlockNumberAndIndex:!0,eth_getTransactionByHash:!0,eth_getTransactionBySenderAndNonce:!0,eth_getTransactionCount:!0,eth_getTransactionReceipt:!0,eth_getUncleByBlockHashAndIndex:!0,eth_getUncleByBlockNumberAndIndex:!0,eth_getUncleCountByBlockHash:!0,eth_getUncleCountByBlockNumber:!0,eth_maxPriorityFeePerGas:!0,eth_newBlockFilter:!0,eth_newFilter:!0,eth_newPendingTransactionFilter:!0,eth_protocolVersion:!0,eth_sendRawTransaction:!0,eth_uninstallFilter:!0,zks_estimateFee:!0,eth_createAccessList:!0,eth_simulateV1:!0},y0e=t=>!!g0e[t];function m0e(t,e){let n,r,i,a,s=null;return o=>({id:t.id,name:t.name,icon:t.iconUrl,type:"privy",...e,isWalletConnectMod
40alConnector:!1,async setup(){let c=await this.getProvider();c&&(i||(i=this.onConnect.bind(this),c.on("connect",i)),n||(n=this.onAccountsChanged.bind(this),c.on("accountsChanged",n)))},async connect(c){let l=await this.getProvider();if(l&&await this.isAuthorized()){let[f,h]=await Promise.all([this.getAccounts(),this.getChainId()]);return{accounts:f,chainId:h}}if(c?.isReconnecting)return{accounts:[],chainId:1};await l.request({method:"eth_requestAccounts"}),i&&(l.removeListener("connect",i),i=void 0),n||(n=this.onAccountsChanged.bind(this),l.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),l.on("chainChanged",r)),a||(a=this.onDisconnect.bind(this),l.on("disconnect",a)),c?.chainId&&await this.switchChain({chainId:c.chainId});let[u,d]=await Promise.all([this.getAccounts(),this.getChainId()]);return{accounts:u,chainId:d}},async disconnect(){let c=await this.getProvider();r&&(c.removeListener("chainChanged",r),r=void 0),a&&(c.removeListener("disconnect",a),a=void 0),i||(i=this.onConnect.bind(this),c.on("connect",i)),await c.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),this.onDisconnect()},async getAccounts(){let c=await this.getProvider();if(!c)throw new Es;return(await c.request({method:"eth_accounts"})).map(l=>_t(l))},async getChainId(){let c=await this.getProvider();if(!c)throw new Es;return Number(await c.request({method:"eth_chainId"}))}
40,async getProvider(){if(s||(s=p0e({chains:o.chains,transports:o.transports,providerAppId:t.id,apiUrl:t.apiUrl,smartWalletMode:t.smartWalletMode,defaultPopupTimeout:t.defaultPopupTimeout,overrideConnectUrl:t.overrideConnectUrl,overrideTransactUrl:t.overrideTransactUrl})),!s)throw new Es;return s},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({chainId:c}){let l=await this.getProvider();if(!l)throw new Es;let u=o.chains.find(d=>d.id===c);if(!u)throw new tp(new tB);return c===Number(await l.request({method:"eth_chainId"}))||(await l.request({method:"wallet_switchEthereumChain",params:[{chainId:`0x${c.toString(16)}`}]}),o.emitter.emit("change",{chainId:c})),u},async onAccountsChanged(c){if(c.length!==0)if(o.emitter.listenerCount("connect")){let l=(await this.getChainId()).toString();this.onConnect?.({chainId:l})}else o.emitter.emit("change",{accounts:c.map(l=>_t(l))});else this.onDisconnect()},onChainChanged(c){let l=Number(c);o.emitter.emit("change",{chainId:l})},async onConnect(c){let l=await this.getAccounts();if(l.length===0)return;let u=Number(c.chainId);o.emitter.emit("connect",{accounts:l,chainId:u});let d=await this.getProvider();d&&(i&&(d.removeListener("connect",i),i=void 0),n||(n=this.onAccountsChanged.bind(this),d.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),d.on("chainChanged",r)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a)))},async onDisconnect(){o.emitter.emit("disconnect")}})}const v0e="cm04asygd041fmry9zmcyn5o5",w0e="https://abstract-assets.abs.xyz/icons/light.png";function b0e(t={}){const{rkDetails:e,customPaymasterHandler:n}=t;return r=>{const i=[...r.chains];let a=r.chains[0];const s=Object.keys(Rs).map(Number).sort((u,d)=>u-d);for(const u of s){const d=i.findIndex(h=>h.id===u);if(d!==-1){a=i.splice(d,1)[0]??a;break}}const o=m0e({iconUrl:w0e,id:v0e,name:"Abstract"})({...r,chains:[a,...i]});return{...o,...e,getProvider:async u=>{const d=u?.chainId??a.id;if(!Rs[d])throw new Error("Unsupported chain");const f=r.chains.find(g=>g.id===d)??Rs[d],h=await o.getProvider({chainId:d}),p=r.transports?.[d]??Ii(void 0,{batch:!0});return vpe({provider:h,chain:f,transport:p,isPrivyCrossApp:!0,customPaymasterHandler:n})},type:"injected",id:"xyz.abs.privy"}}}const _0e=({chain:t,transport:e,queryClient:n=new LJ,customPaymasterHandler:r,children:i})=>{if(!Rs[t.id])throw new Error(`Chain ${t.id} is not supported`);const a=L.useMemo(()=>jD({chains:[t],ssr:!0,connectors:[b0e({customPaymasterHandler:r})],transports:{[t.id]:e??Ii(void 0,{batch:!0})},multiInjectedProviderDiscovery:!1}),[t,e,r]);return tt.createElement(qM,{config:a},tt.createElement(S7,{client:n},i))};function C0e(t={}){const e=LC(t);return e.addresses?.[1]?{...e,address:e.addresses[1]}:{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isReconnecting:!1,isConnecting:!1,isDisconnected:!0,status:"disconnected"}}function E0e(t={}){const{address:e}=C0e();return Aie({...t,account:e})}const S0e=({customPaymasterHandler:t}={})=>{const{data:e,status:n,error:r}=E0e(),[i]=wie(),a=ts();return Bt({gcTime:0,queryKey:["abstractClient",i?.id,e?.account?.address,t??null],queryFn:async()=>{if(r)throw r;if(!e)throw new Error("No signer found");return await Jj({signer:e.account,chain:i,transport:Y_(e.transport),isPrivyCrossApp:!0,publicTransport:a?._internal.transports[i.id],customPaymasterHandler:t})},enabled:n!=="pending"})},A0e={path:"/api/v1/analytics_events",method:"POST"},x0e={path:"/api/v1/apps/:app_id",method:"GET"},I0e={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},T0e={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"},L0e={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"},k0e={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"},$0e={path:"/api/v1/custom_jwt_account/link",method:"POST"},P0e={path:"/api/v1/farcaster/init",method:"POST"},R0e={path:"/api/v1/farcaster/authenticate",method:"POST"},O0e={path:"/api/v1/farcaster/link",method:"POST"},M0e={path:"/api/v1/farcaster/unlink",method:"POST"},N0e={path:"/api/v1/farcaster/status",method:"GET"},D0e={path:"/api/v2/farcaster/init",method:"POST"},F0e={path:"/api/v2/farcaster/authenticate",method:"POST"},U0e={path:"/api/v1/guest/authenticate",method:"POST"},j0e={path:"/api/v1/mfa/passkeys/init",method:"POST"},B0e={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},V0e={path:"/api/v1/oauth/authenticate",method:"POST"},H0e={path:"/api/v1/oauth/init",method:"POST"},W0e={path:"/api/v1/oauth/link",method:"POST"},q0e={path:"/api/v1/oauth/unlink",method:"POST"},z0e={path:"/api/v1/passkeys/link",method:"POST"},Z0e={path:"/api/v1/passkeys/authenticate",method:"POST"},K0e={path:"/api/v1/passkeys/register",method:"POST"},G0e={path:"/api/v1/passkeys/authenticate/init",method:"POST"},Y0e={path:"/api/v1/passkeys/register/init",method:"POST"},J0e={path:"/api/v1/passkeys/link/init",method:"POST"},X0e={path:"/api/v1/passwordless/authenticate",method:"POST"},Q0e={path:"/api/v1/passwordless/init",method:"POST"},e1e={path:"/api/v1/passwordless/link",method:"POST"},t1e={path:"/api/v1/passwordless/unlink",method:"POST"},n1e={path:"/api/v1/passwordless/update",method:"POST"},r1e={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},i1e={path:"/api/v1/passwordless_sms/init",method:"POST"},a1e={path:"/api/v1/passwordless_sms/link",method:"POST"},s1e={path:"/api/v1/passwordless_sms/unlink",method:"POST"},o1e={path:"/api/v1/passwordless_sms/update",method:"POST"},c1e={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},l1e={path:"/api/v1/recovery/oauth/init",method:"POST"},u1e={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},d1e={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},f1e={path:"/api/v1/recovery/configuration_icloud",method:"POST"},h1e={path:"/api/v1/onramp/deposit_addresses/quote",method:"POST"},gE={path:"/api/v1/onramp/deposit_addresses/orders/:order_id",method:"GET"},p1e={path:"/api/v1/onramp/deposit_addresses/:deposit_address_id/next_order",method:"GET"},pB={path:"/api/v1/onramp/deposit_addresses/deposit_config",method:"GET"},g1e=(t,e)=>e?Object.entries(e).reduce((n,[r,i])=>n.replace(`:${r}`,`${i}`),t):t,ZT={path:"/api/v1/sessions",method:"POST"},y1e={path:"/api/v1/sessions/logout",method:"POST"},m1e={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},gB={path:"/api/v1/siwe/init",method:"POST"},v1e={path:"/api/v1/siwe/authenticate",method:"POST"},w1e={path:"/api/v1/siwe/link",method:"POST"},b1e={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},_1e={path:"/api/v1/siwe/unlink",method:"POST"},C1e={path:"/api/v1/siws/init",method:"POST"},E1e={path:"/api/v1/siws/authenticate",method:"POST"},S1e={path:"/api/v1/siws/link",method:"POST"},A1e={path:"/api/v1/siws/unlink",method:"POST"},x1e={path:"/api/v1/users/me/accept_terms",method:"POST"},I1e={path:"/api/v1/telegram/authenticate",method:"POST"},T1e={path:"/api/v1/telegram/link",method:"POST"},L1e={path:"/api/v1/telegram/unlink",method:"POST"},k1e={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"},$1e={path:"/api/v1/fiat/customer",method:"GET"},P1e={path:"/api/v1/fiat/customer",method:"PUT"},R1e={path:"/api/v1/fiat/customer/virtual_accounts",method:"PUT"},O1e={path:"/api/v1/onramp/fiat/quotes",method:"PUT"},M1e={path:"/api/v1/onramp/fiat/provider_session_url",method:"POST"},N1e={path:"/api/v1/onramp/fiat/status",method:"GET"},Krt={path:"/api/v1/onramp/stripe/create_link_auth_intent",method:"POST"},Grt={path:"/api/v1/onramp/stripe/exchange_tokens",method:"POST"},Yrt={path:"/api/v1/onramp/stripe/customer",method:"GET"},Jrt={path:"/api/v1/onramp/stripe/customer/wallets",method:"GET"},Xrt={path:"/api/v1/onramp/stripe/customer/payment_tokens",method:"GET"},Qrt={path:"/api/v1/onramp/stripe/create_onramp_session",method:"POST"},eit={path:"/api/v1/onramp/stripe/quote/:session_id",method:"POST"},tit={path:"/api/v1/onramp/stripe/checkout/:session_id",method:"POST"},yB={path:"/api/v1/wallets",method:"POST"},d5={path:"/api/v1/wallets/:wallet_id/rpc",method:"POST"},D1e={path:"/api/v1/wallets/revoke",method:"POST"},F1e=new TextEncoder,mB=new TextDecoder,U1e=t=>{let e=t;typeof e=="string"&&(e=F1e.encode(e));const n=32768,r=[];for(let i=0;i<e.length;i+=n)r.push(String.fromCharCode.apply(null,e.subarray(i,i+n)));return btoa(r.join(""))},j1e=t=>U1e(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),B1e=t=>{const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},V1e=t=>{let e=t;e instanceof Uint8Array&&(e=mB.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return B1e(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};
40class H1e extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var n;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class Cl extends H1e{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function W1e(t){return typeof t=="object"&&t!==null}function q1e(t){if(!W1e(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const mu=j1e,z1e=V1e;function Fw(t){if(typeof t!="string")throw new Cl("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(n===5)throw new Cl("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new Cl("Invalid JWT");if(!e)throw new Cl("JWTs must contain a payload");let r;try{r=z1e(e)}catch{throw new Cl("Failed to base64url decode the payload")}let i;try{i=JSON.parse(mB.decode(r))}catch{throw new Cl("Failed to parse the decoded payload as JSON")}if(!q1e(i))throw new Cl("Invalid JWT Claims Set");return i}function Z1e(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const Go={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},yE={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]}
40,default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},Yo={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},mE={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},Jo={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},vE={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},K1e={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},G1e={id:56,network:"bsc",name:"Binance Smart Chain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{privy:{http:["https://bsc-mainnet.rpc.privy.systems"]},default:{http:["https://56.rpc.thirdweb.com"]},public:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://bscscan.com"},default:{name:"BscScan",url:"https://bscscan.com"}}},wE={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},Y1e={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},J1e={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},X1e={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},Q1e={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}
40,rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}},e3e={id:43419,name:"Gunz Mainnet",network:"gunz",nativeCurrency:{name:"GUN",symbol:"GUN",decimals:18},rpcUrls:{privy:{http:["https://gunz-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.gunzchain.io/ext/bc/2M47TxWHGnhNtq6pM5zPXdATBtuqubxn5EPFgFmEawCQr9WFML/rpc"]},public:{http:["https://rpc.gunzchain.io/ext/bc/2M47TxWHGnhNtq6pM5zPXdATBtuqubxn5EPFgFmEawCQr9WFML/rpc"]}},blockExplorers:{default:{name:"Gunz Explorer",url:"https://gunzscan.io"}}},t3e={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},n3e={id:13371,name:"Immutable zkEVM",network:"immutable-zkevm",nativeCurrency:{name:"Immutable Coin",symbol:"IMX",decimals:18},rpcUrls:{privy:{http:["https://immutable-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.immutable.com"]},public:{http:["https://rpc.immutable.com"]}},blockExplorers:{default:{name:"Immutable Explorer",url:"https://explorer.immutable.com"}}},r3e={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},i3e={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},a3e={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},Ks={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},s3e={id:1088,name:"Metis Andromeda",network:"metis",nativeCurrency:{name:"Metis",symbol:"METIS",decimals:18},rpcUrls:{privy:{http:["https://metis-mainnet.rpc.privy.systems"]},default:{http:["https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"]},public:{http:["https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"]}},blockExplorers:{default:{name:"Metis Explorer",url:"https://explorer.metis.io"}}},Ru={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},bE={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol
40:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},Gs={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},_E={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},o3e={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},CE={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},c3e={id:1868,name:"Soneium Mainnet",network:"soneium",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://soneium-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.soneium.org"]},public:{http:["https://rpc.soneium.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://soneium.blockscout.com"}}},l3e={id:130,name:"Unichain",network:"unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://unichain-mainnet.rpc.privy.systems"]},default:{http:["https://mainnet.unichain.org"]},public:{http:["https://mainnet.unichain.org"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz"}}},u3e={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{privy:{http:["https://zora-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},d3e={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},f3e={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},p0=[Ks,CE,t3e,Go,yE,Ru,bE,Gs,_E,wE,Y1e,J1e,X1e,Jo,vE,K1e,G1e,e3e,n3e,a3e,r3e,i3e,s3e,Yo,mE,c3e,l3e,u3e,f3e,d3e,o3e,Q1e],vB=new Set(p0.map(t=>
40t.id));function nit(t){let e=t.filter(n=>!vB.has(n.id));return p0.concat(e)}const wB=t=>t.map(e=>{if(e.rpcUrls.privyWalletOverride)return e;let n=p0.find(r=>r.id===e.id)?.rpcUrls.privy?.http[0];return n?Z1e(e,n):e}),h3e={id:999,name:"HyperEVM Mainnet",network:"hyperevm",nativeCurrency:{name:"HYPE",symbol:"HYPE",decimals:18},rpcUrls:{privy:{http:["https://hyperevm-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.hyperliquid.xyz/evm"]},public:{http:["https://rpc.hyperliquid.xyz/evm"]}},blockExplorers:{default:{name:"HyperEVM Mainnet Explorer",url:""}}},Ou={id:143,name:"Monad",network:"monad",nativeCurrency:{name:"Monad",symbol:"MON",decimals:18},rpcUrls:{privy:{http:["https://monad-mainnet.rpc.privy.systems"]},default:{http:["https://rpc.monad.xyz"]},public:{http:["https://rpc.monad.xyz"]}},blockExplorers:{default:{name:"Monadscan",url:"https://mainnet-beta.monvision.io"}}},E1={0:"legacy",1:"eip2930",2:"eip1559",3:"eip4844",4:"eip7702"},bB={legacy:0,eip2930:1,eip1559:2,eip4844:3,eip7702:4},qi=t=>t===void 0?void 0:BigInt(t);function Yg(t){let{type:e=2,authorizationList:n,...r}=typeof t=="string"?JSON.parse(t):t,i;r.accessList&&Array.isArray(r.accessList)?i=r.accessList.map(u=>Array.isArray(u)?{address:u[0],storageKeys:u[1]}:u):r.accessList&&(i=Object.entries(r.accessList).map(u=>({address:u[0],storageKeys:u[1]})));let a=Number(r.chainId??1),s=xo(r.data)?r.data:r.data?An(Uint8Array.from(r.data)):void 0,o=r.nonce?Number(r.nonce):void 0,c={chainId:a,data:s,nonce:o,value:qi(r.value),gas:qi(r.gas??r.gasLimit)},l=Number(e);if(l===0)return{...r,type:E1[l],...c,gasPrice:qi(r.gasPrice),accessList:void 0,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(l===1)return{...r,type:E1[l],...c,gasPrice:qi(r.gasPrice),accessList:i,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0};if(l===2)return{...r,type:E1[l],...c,nonce:o,accessList:i,maxFeePerGas:qi(r.maxFeePerGas),maxPriorityFeePerGas:qi(r.maxPriorityFeePerGas),gasPrice:void 0,maxFeePerBlobGas:void 0};if(l===4){let u=(n??[]).map(d=>({address:d.address,chainId:Number(d.chainId),nonce:Number(d.nonce),r:d.r,s:d.s,yParity:d.yParity??(d.v===void 0?0:Number(d.v)-27)}));return{...r,type:E1[l],...c,nonce:o,accessList:i,maxFeePerGas:qi(r.maxFeePerGas),maxPriorityFeePerGas:qi(r.maxPriorityFeePerGas),authorizationList:u,gasPrice:void 0,maxFeePerBlobGas:void 0}}throw Error(`Unsupported transaction type: ${e}`)}const Jm=118,_B="tempo",f5=(t,e)=>{if(t===void 0)return;let n=Number(t);if(!Number.isSafeInteger(n)||n<0)throw Error(`Invalid Tempo ${e}: ${String(t)}`);return n};function Vd(t){if(!t||typeof t!="object")return!1;let e=t.type;if(!(e===118||typeof e=="string"&&e.toLowerCase()==="tempo"))return!1;let n=t.calls;return Array.isArray(n)&&n.length>0}function KT(t){let e;if(typeof t=="string")try{e=JSON.parse(t)}catch(s){let o=s instanceof Error?s.message:String(s);throw Error(`Invalid Tempo transaction JSON: ${o}`)}else e=t;let n;if(e.accessList&&Array.isArray(e.accessList)?n=e.accessList.map(s=>Array.isArray(s)?{address:s[0],storageKeys:s[1]}:s):e.accessList&&(n=Object.entries(e.accessList).map(s=>({address:s[0],storageKeys:s[1]}))),e.chainId===void 0||e.chainId===null)throw Error("Tempo transactions require a chainId");let r=Number(e.chainId);if(!Number.isSafeInteger(r)||r<=0)throw Error(`Invalid Tempo chainId: ${String(e.chainId)}`);let i=f5(e.nonce,"nonce");if(!Array.isArray(e.calls)||e.calls.length===0)throw Error("Tempo transactions require at least one call");let a=e.calls.map(s=>({to:s.to,data:s.data,value:qi(s.value)}));return{type:_B,chainId:r,from:e.from,nonce:i,gas:qi(e.gasLimit),maxFeePerGas:qi(e.maxFeePerGas),maxPriorityFeePerGas:qi(e.maxPriorityFeePerGas),calls:a,feeToken:e.feeToken,nonceKey:qi(e.nonceKey),validBefore:f5(e.validBefore,"validBefore"),validAfter:f5(e.validAfter,"validAfter"),feePayerSignature:e.feePayerSignature,accessList:n}}function p3e(t,e){let{chain:n,gas:r,...i}=t;return{...i,...r!==void 0&&e===void 0?{gasLimit:r}:{}}}var g3e=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,a,s)=>`${i}${s===0?"":","}${t(a===void 0||typeof a=="symbol"?null:a)}`,"")}]`:`{${Object.keys(e).sort().reduce((r,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return r;const a=r.length===0?"":",";return`${r}${a}${t(i)}:${t(e[i])}`},"")}}`};const y3e=Zs(g3e),m3e=t=>Bc.encode(t),v3e=t=>{try{return Uint8Array.from(Bc.decode(t))}catch(e){if(e instanceof Error&&e.message.includes("string should have whole number of bytes"))return Uint8Array.from($D.decode(t));throw e}},w3e=t=>Tm.encode(t),b3e=t=>Uint8Array.from(Tm.decode(t)),_3e=t=>Uint8Array.from(Lm.decode(t.startsWith("0x")?t.slice(2):t)),C3e=t=>Lm.encode(t),E3e=new TextEncoder,S3e=t=>Uint8Array.from(E3e.encode(t)),A3e=new TextDecoder,x3e=new TextDecoder("utf-8",{fatal:!0}),I3e=(t,e)=>(e?.fatal?x3e:A3e).decode(t),Hd={utf8:{fromBytes:I3e,toBytes:S3e},base64:{fromBytes:m3e,toBytes:v3e},base64url:{fromBytes:w3e,toBytes:b3e},hex:{fromBytes:C3e,toBytes:_3e}};var CB={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(_s,function(){var n=function(a,s){if(s=s||{},typeof a!="function")throw new i("fetch must be a function");if(typeof s!="object")throw new i("defaults must be an object");
40if(s.retries!==void 0&&!r(s.retries))throw new i("retries must be a positive integer");if(s.retryDelay!==void 0&&!r(s.retryDelay)&&typeof s.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(s.retryOn!==void 0&&!Array.isArray(s.retryOn)&&typeof s.retryOn!="function")throw new i("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return s=Object.assign(o,s),function(l,u){var d=s.retries,f=s.retryDelay,h=s.retryOn;if(u&&u.retries!==void 0)if(r(u.retries))d=u.retries;else throw new i("retries must be a positive integer");if(u&&u.retryDelay!==void 0)if(r(u.retryDelay)||typeof u.retryDelay=="function")f=u.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(u&&u.retryOn)if(Array.isArray(u.retryOn)||typeof u.retryOn=="function")h=u.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(p,g){var y=function(b){var w=typeof Request<"u"&&l instanceof Request?l.clone():l;a(w,u).then(function(_){if(Array.isArray(h)&&h.indexOf(_.status)===-1)p(_);else if(typeof h=="function")try{return Promise.resolve(h(b,null,_)).then(function(E){E?v(b,null,_):p(_)}).catch(g)}catch(E){g(E)}else b<d?v(b,null,_):p(_)}).catch(function(_){if(typeof h=="function")try{Promise.resolve(h(b,_,null)).then(function(E){E?v(b,_,null):g(_)}).catch(function(E){g(E)})}catch(E){g(E)}else b<d?v(b,_,null):g(_)})};function v(b,w,_){var E=typeof f=="function"?f(b,w,_):f;setTimeout(function(){y(++b)},E)}y(0)})}};function r(a){return Number.isInteger(a)&&a>=0}function i(a){this.name="ArgumentError",this.message=a}return n})})(CB);var T3e=CB.exports;const EB=Zs(T3e);var kt;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(kt||(kt={}));var GT;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(GT||(GT={}));const Ze=kt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ec=t=>{switch(typeof t){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return Number.isNaN(t)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(t)?Ze.array:t===null?Ze.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ze.promise:typeof Map<"u"&&t instanceof Map?Ze.map:typeof Set<"u"&&t instanceof Set?Ze.set:typeof Date<"u"&&t instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}}
vendor: 31,044 bytes, line 40
40,Le=kt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Fo extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(n(s))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return i(this),r}static assert(e){if(!(e instanceof Fo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,kt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Fo.create=t=>new Fo(t);const Uw=(t,e)=>{let n;switch(t.code){case Le.invalid_type:t.received===Ze.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Le.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,kt.jsonStringifyReplacer)}`;break;case Le.unrecognized_keys:n=`Unrecognized key(s) in object: ${kt.joinValues(t.keys,", ")}`;break;case Le.invalid_union:n="Invalid input";break;case Le.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${kt.joinValues(t.options)}`;break;case Le.invalid_enum_value:n=`Invalid enum value. Expected ${kt.joinValues(t.options)}, received '${t.received}'`;break;case Le.invalid_arguments:n="Invalid function arguments";break;case Le.invalid_return_type:n="Invalid function return type";break;case Le.invalid_date:n="Invalid date";break;case Le.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:kt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Le.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Le.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Le.custom:n="Invalid input";break;case Le.invalid_intersection_types:n="Intersection results could not be merged";break;case Le.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Le.not_finite:n="Number must be finite";break;default:n=e.defaultError,kt.assertNever(t)}return{message:n}};let L3e=Uw;function k3e(){return L3e}const $3e=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)o=l(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}};function Be(t,e){const n=k3e(),r=$3e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Uw?void 0:Uw].filter(i=>!!i)});t.common.issues.push(r)}class oi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return lt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,s=await i.value;r.push({key:a,value:s})}return oi.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return lt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}}const lt=Object.freeze({status:"aborted"}),ah=t=>({status:"dirty",value:t}),xa=t=>({status:"valid",value:t}),YT=t=>t.status==="aborted",JT=t=>t.status==="dirty",g2=t=>t.status==="valid",Jg=t=>typeof Promise<"u"&&t instanceof Promise;var Je;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Je||(Je={}));class Hs{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const XT=(t,e)=>{if(g2(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Fo(t.common.issues);return this._error=n,this._error}}};function yt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{const{message:c}=t;return s.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:i}}class Et{get description(){return this._def.description}_getType(e){return Ec(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ec(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new oi,ctx:{common:e.parent.common,data:e.data,parsedType:Ec(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Jg(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ec(e)},i=this._parseSync({data:e,path:r.path,parent:r});return XT(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ec(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return g2(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>g2(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ec(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(Jg(i)?i:Promise.resolve(i));return XT(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:Le.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Uo({schema:this,typeName:ut.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Po.create(this,this._def)}nullable(){return Cu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ms.create(this)}promise(){return oy.create(this,this._def)}or(e){return ty.create([this,e],this._def)}and(e){return ny.create(this,e,this._def)}transform(e){return new Uo({...yt(this._def),schema:this,typeName:ut.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new cy({...yt(this._def),innerType:this,defaultValue:n,typeName:ut.ZodDefault})}brand(){return new IB({typeName:ut.ZodBranded,type:this,...yt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ly({...yt(this._def),innerType:this,catchValue:n,typeName:ut.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return SE.create(this,e)}readonly(){return uy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const P3e=/^c[^\s-]{8,}$/i,R3e=/^[0-9a-z]+$/,O3e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,M3e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,N3e=/^[a-z0-9_-]{21}$/i,D3e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,F3e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,U3e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,j3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let h5;const B3e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,V3e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,H3e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,W3e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,q3e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z3e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,SB="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Z3e=new RegExp(`^${SB}$`);function AB(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function K3e(t){return new RegExp(`^${AB(t)}$`)}function G3e(t){let e=`${SB}T${AB(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Y3e(t,e){return!!((e==="v4"||!e)&&B3e.test(t)||(e==="v6"||!e)&&H3e.test(t))}function J3e(t,e){if(!D3e.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function X3e(t,e){return!!((e==="v4"||!e)&&V3e.test(t)||(e==="v6"||!e)&&W3e.test(t))}class ks extends Et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ze.string){const a=this._getOrReturnCtx(e);return Be(a,{code:Le.invalid_type,expected:Ze.string,received:a.parsedType}),lt}const r=new oi;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?Be(i,{code:Le.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&Be(i,{code:Le.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")U3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"email",code:Le.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")h5||(h5=new RegExp(j3e,"u")),h5.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"emoji",code:Le.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")M3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"uuid",code:Le.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")N3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"nanoid",code:Le.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")P3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cuid",code:Le.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")R3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cuid2",code:Le.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")O3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"ulid",code:Le.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Be(i,{validation:"url",code:Le.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"regex",code:Le.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?G3e(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Z3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?K3e(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?F3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"duration",code:Le.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Y3e(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"ip",code:Le.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?J3e(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"jwt",code:Le.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?X3e(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cidr",code:Le.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?q3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"base64",code:Le.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?z3e.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"base64url",code:Le.invalid_string,message:a.message}),r.dirty()):kt.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Le.invalid_string,...Je.errToObj(r)})}_addCheck(e){return new ks({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Je.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Je.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Je.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Je.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Je.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Je.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Je.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Je.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Je.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Je.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Je.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Je.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Je.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Je.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Je.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Je.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Je.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Je.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Je.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Je.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Je.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Je.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Je.errToObj(n)})}nonempty(e){return this.min(1,Je.errToObj(e))}trim(){return new ks({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ks({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ks({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ks.create=t=>new ks({checks:[],typeName:ut.ZodString,coerce:t?.coerce??!1,...yt(t)});function Q3e(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}class vu extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ze.number){const a=this._getOrReturnCtx(e);return Be(a,{code:Le.invalid_type,expected:Ze.number,received:a.parsedType}),lt}let r;const i=new oi;for(const a of this._def.checks)a.kind==="int"?kt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Q3e(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.not_finite,message:a.message}),i.dirty()):kt.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Je.toString(n))}setLimit(e,n,r,i){return new vu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new vu({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Je.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Je.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&kt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}vu.create=t=>new vu({checks:[],typeName:ut.ZodNumber,coerce:t?.coerce||!1,...yt(t)});class wu extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ze.bigint)return this._getInvalidInput(e);let r;const i=new oi;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Le.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):kt.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Be(n,{code:Le.invalid_type,expected:Ze.bigint,received:n.parsedType}),lt}gte(e,n){return this.setLimit("min",e,!0,Je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Je.toString(n))}setLimit(e,n,r,i){return new wu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new wu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}wu.create=t=>new wu({checks:[],typeName:ut.ZodBigInt,coerce:t?.coerce??!1,...yt(t)});class Xg extends Et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ze.boolean){const r=this._getOrReturnCtx(e);return Be(r,{code:Le.invalid_type,expected:Ze.boolean,received:r.parsedType}),lt}return xa(e.data)}}Xg.create=t=>new Xg({typeName:ut.ZodBoolean,coerce:t?.coerce||!1,...yt(t)});class y2 extends Et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ze.date){const a=this._getOrReturnCtx(e);return Be(a,{code:Le.invalid_type,expected:Ze.date,received:a.parsedType}),lt}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return Be(a,{code:Le.invalid_date}),lt}const r=new oi;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Le.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):kt.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new y2({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Je.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Je.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}y2.create=t=>new y2({checks:[],coerce:t?.coerce||!1,typeName:ut.ZodDate,...yt(t)});
vendor: 3,361 bytes, line 40
40class jw extends Et{_parse(e){if(this._getType(e)!==Ze.symbol){const r=this._getOrReturnCtx(e);return Be(r,{code:Le.invalid_type,expected:Ze.symbol,received:r.parsedType}),lt}return xa(e.data)}}jw.create=t=>new jw({typeName:ut.ZodSymbol,...yt(t)});class Qg extends Et{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return Be(r,{code:Le.invalid_type,expected:Ze.undefined,received:r.parsedType}),lt}return xa(e.data)}}Qg.create=t=>new Qg({typeName:ut.ZodUndefined,...yt(t)});class ey extends Et{_parse(e){if(this._getType(e)!==Ze.null){const r=this._getOrReturnCtx(e);return Be(r,{code:Le.invalid_type,expected:Ze.null,received:r.parsedType}),lt}return xa(e.data)}}ey.create=t=>new ey({typeName:ut.ZodNull,...yt(t)});class Bw extends Et{constructor(){super(...arguments),this._any=!0}_parse(e){return xa(e.data)}}Bw.create=t=>new Bw({typeName:ut.ZodAny,...yt(t)});class Vw extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xa(e.data)}}Vw.create=t=>new Vw({typeName:ut.ZodUnknown,...yt(t)});class nl extends Et{_parse(e){const n=this._getOrReturnCtx(e);return Be(n,{code:Le.invalid_type,expected:Ze.never,received:n.parsedType}),lt}}nl.create=t=>new nl({typeName:ut.ZodNever,...yt(t)});class Hw extends Et{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return Be(r,{code:Le.invalid_type,expected:Ze.void,received:r.parsedType}),lt}return xa(e.data)}}Hw.create=t=>new Hw({typeName:ut.ZodVoid,...yt(t)});class Ms extends Et{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ze.array)return Be(n,{code:Le.invalid_type,expected:Ze.array,received:n.parsedType}),lt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(Be(n,{code:s?Le.too_big:Le.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Be(n,{code:Le.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Be(n,{code:Le.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new Hs(n,s,n.path,o)))).then(s=>oi.mergeArray(r,s));const a=[...n.data].map((s,o)=>i.type._parseSync(new Hs(n,s,n.path,o)));return oi.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new Ms({...this._def,minLength:{value:e,message:Je.toString(n)}})}max(e,n){return new Ms({...this._def,maxLength:{value:e,message:Je.toString(n)}})}length(e,n){return new Ms({...this._def,exactLength:{value:e,message:Je.toString(n)}})}nonempty(e){return this.min(1,e)}}Ms.create=(t,e)=>new Ms({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ut.ZodArray,...yt(e)});function wd(t){if(t instanceof Sn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Po.create(wd(r))}return new Sn({...t._def,shape:()=>e})}else return t instanceof Ms?new Ms({...t._def,type:wd(t.element)}):t instanceof Po?Po.create(wd(t.unwrap())):t instanceof Cu?Cu.create(wd(t.unwrap())):t instanceof bu?bu.create(t.items.map(e=>wd(e))):t}
vendor: 4,880 bytes, line 40
40class Sn extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=kt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ze.object){const l=this._getOrReturnCtx(e);return Be(l,{code:Le.invalid_type,expected:Ze.object,received:l.parsedType}),lt}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof nl&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||o.push(l);const c=[];for(const l of s){const u=a[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Hs(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof nl){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")o.length>0&&(Be(i,{code:Le.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of o){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Hs(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key,f=await u.value;l.push({key:d,value:f,alwaysSet:u.alwaysSet})}return l}).then(l=>oi.mergeObjectSync(r,l)):oi.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Je.errToObj,new Sn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Je.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Sn({...this._def,unknownKeys:"strip"})}passthrough(){return new Sn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Sn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Sn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ut.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Sn({...this._def,catchall:e})}pick(e){const n={};for(const r of kt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Sn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of kt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Sn({...this._def,shape:()=>n})}deepPartial(){return wd(this)}partial(e){const n={};for(const r of kt.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new Sn({...this._def,shape:()=>n})}required(e){const n={};for(const r of kt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Po;)a=a._def.innerType;n[r]=a}return new Sn({...this._def,shape:()=>n})}keyof(){return xB(kt.objectKeys(this.shape))}}Sn.create=(t,e)=>new Sn({shape:()=>t,unknownKeys:"strip",catchall:nl.create(),typeName:ut.ZodObject,...yt(e)});Sn.strictCreate=(t,e)=>new Sn({shape:()=>t,unknownKeys:"strict",catchall:nl.create(),typeName:ut.ZodObject,...yt(e)});Sn.lazycreate=(t,e)=>new Sn({shape:t,unknownKeys:"strip",catchall:nl.create(),typeName:ut.ZodObject,...yt(e)});class ty extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new Fo(o.ctx.common.issues));return Be(n,{code:Le.invalid_union,unionErrors:s}),lt}if(n.common.async)return Promise.all(r.map(async a=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(c=>new Fo(c));return Be(n,{code:Le.invalid_union,unionErrors:o}),lt}}get options(){return this._def.options}}ty.create=(t,e)=>new ty({options:t,typeName:ut.ZodUnion,...yt(e)});const uo=t=>t instanceof iy?uo(t.schema):t instanceof Uo?uo(t.innerType()):t instanceof ay?[t.value]:t instanceof _u?t.options:t instanceof sy?kt.objectValues(t.enum):t instanceof cy?uo(t._def.innerType):t instanceof Qg?[void 0]:t instanceof ey?[null]:t instanceof Po?[void 0,...uo(t.unwrap())]:t instanceof Cu?[null,...uo(t.unwrap())]:t instanceof IB||t instanceof uy?uo(t.unwrap()):t instanceof ly?uo(t._def.innerType):[];
vendor: 4,348 bytes, line 40
40class EE extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.object)return Be(n,{code:Le.invalid_type,expected:Ze.object,received:n.parsedType}),lt;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(Be(n,{code:Le.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const a of n){const s=uo(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new EE({typeName:ut.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...yt(r)})}}function Ww(t,e){const n=Ec(t),r=Ec(e);if(t===e)return{valid:!0,data:t};if(n===Ze.object&&r===Ze.object){const i=kt.objectKeys(e),a=kt.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const c=Ww(t[o],e[o]);if(!c.valid)return{valid:!1};s[o]=c.data}return{valid:!0,data:s}}else if(n===Ze.array&&r===Ze.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],c=Ww(s,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Ze.date&&r===Ze.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ny extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(YT(a)||YT(s))return lt;const o=Ww(a.value,s.value);return o.valid?((JT(a)||JT(s))&&n.dirty(),{status:n.value,value:o.data}):(Be(r,{code:Le.invalid_intersection_types}),lt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ny.create=(t,e,n)=>new ny({left:t,right:e,typeName:ut.ZodIntersection,...yt(n)});class bu extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.array)return Be(r,{code:Le.invalid_type,expected:Ze.array,received:r.parsedType}),lt;if(r.data.length<this._def.items.length)return Be(r,{code:Le.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),lt;!this._def.rest&&r.data.length>this._def.items.length&&(Be(r,{code:Le.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((s,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Hs(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>oi.mergeArray(n,s)):oi.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new bu({...this._def,rest:e})}}bu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bu({items:t,typeName:ut.ZodTuple,rest:null,...yt(e)})};class ry extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.object)return Be(r,{code:Le.invalid_type,expected:Ze.object,received:r.parsedType}),lt;const i=[],a=this._def.keyType,s=this._def.valueType;for(const o in r.data)i.push({key:a._parse(new Hs(r,o,r.path,o)),value:s._parse(new Hs(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?oi.mergeObjectAsync(n,i):oi.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Et?new ry({keyType:e,valueType:n,typeName:ut.ZodRecord,...yt(r)}):new ry({keyType:ks.create(),valueType:e,typeName:ut.ZodRecord,...yt(n)})}}class qw extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.map)return Be(r,{code:Le.invalid_type,expected:Ze.map,received:r.parsedType}),lt;const i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,c],l)=>
vendor: 4,178 bytes, line 40
40({key:i._parse(new Hs(r,o,r.path,[l,"key"])),value:a._parse(new Hs(r,c,r.path,[l,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return lt;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(l.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return lt;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(l.value,u.value)}return{status:n.value,value:o}}}}qw.create=(t,e,n)=>new qw({valueType:e,keyType:t,typeName:ut.ZodMap,...yt(n)});class m2 extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.set)return Be(r,{code:Le.invalid_type,expected:Ze.set,received:r.parsedType}),lt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Be(r,{code:Le.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Be(r,{code:Le.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return lt;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const o=[...r.data.values()].map((c,l)=>a._parse(new Hs(r,c,r.path,l)));return r.common.async?Promise.all(o).then(c=>s(c)):s(o)}min(e,n){return new m2({...this._def,minSize:{value:e,message:Je.toString(n)}})}max(e,n){return new m2({...this._def,maxSize:{value:e,message:Je.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}m2.create=(t,e)=>new m2({valueType:t,minSize:null,maxSize:null,typeName:ut.ZodSet,...yt(e)});class iy extends Et{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}iy.create=(t,e)=>new iy({getter:t,typeName:ut.ZodLazy,...yt(e)});class ay extends Et{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Be(n,{received:n.data,code:Le.invalid_literal,expected:this._def.value}),lt}return{status:"valid",value:e.data}}get value(){return this._def.value}}ay.create=(t,e)=>new ay({value:t,typeName:ut.ZodLiteral,...yt(e)});function xB(t,e){return new _u({values:t,typeName:ut.ZodEnum,...yt(e)})}class _u extends Et{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Be(n,{expected:kt.joinValues(r),received:n.parsedType,code:Le.invalid_type}),lt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Be(n,{received:n.data,code:Le.invalid_enum_value,options:r}),lt}return xa(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return _u.create(e,{...this._def,...n})}exclude(e,n=this._def){return _u.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}_u.create=xB;class sy extends Et{_parse(e){const n=kt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ze.string&&r.parsedType!==Ze.number){const i=kt.objectValues(n);return Be(r,{expected:kt.joinValues(i),received:r.parsedType,code:Le.invalid_type}),lt}if(this._cache||(this._cache=new Set(kt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=kt.objectValues(n);return Be(r,{received:r.data,code:Le.invalid_enum_value,options:i}),lt}return xa(e.data)}get enum(){return this._def.values}}sy.create=(t,e)=>new sy({values:t,typeName:ut.ZodNativeEnum,...yt(e)});class oy extends Et{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.promise&&n.common.async===!1)return Be(n,{code:Le.invalid_type,expected:Ze.promise,received:n.parsedType}),lt;
vendor: 9,561 bytes, line 40
40const r=n.parsedType===Ze.promise?n.data:Promise.resolve(n.data);return xa(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}oy.create=(t,e)=>new oy({type:t,typeName:ut.ZodPromise,...yt(e)});class Uo extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ut.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{Be(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return lt;const c=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return c.status==="aborted"?lt:c.status==="dirty"||n.value==="dirty"?ah(c.value):c});{if(n.value==="aborted")return lt;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?lt:o.status==="dirty"||n.value==="dirty"?ah(o.value):o}}if(i.type==="refinement"){const s=o=>{const c=i.refinement(o,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?lt:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?lt:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!g2(s))return lt;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>g2(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):lt);kt.assertNever(i)}}Uo.create=(t,e,n)=>new Uo({schema:t,typeName:ut.ZodEffects,effect:e,...yt(n)});Uo.createWithPreprocess=(t,e,n)=>new Uo({schema:e,effect:{type:"preprocess",transform:t},typeName:ut.ZodEffects,...yt(n)});class Po extends Et{_parse(e){return this._getType(e)===Ze.undefined?xa(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Po.create=(t,e)=>new Po({innerType:t,typeName:ut.ZodOptional,...yt(e)});class Cu extends Et{_parse(e){return this._getType(e)===Ze.null?xa(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cu.create=(t,e)=>new Cu({innerType:t,typeName:ut.ZodNullable,...yt(e)});class cy extends Et{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}cy.create=(t,e)=>new cy({innerType:t,typeName:ut.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...yt(e)});class ly extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Jg(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Fo(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Fo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ly.create=(t,e)=>new ly({innerType:t,typeName:ut.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...yt(e)});class zw extends Et{_parse(e){if(this._getType(e)!==Ze.nan){const r=this._getOrReturnCtx(e);return Be(r,{code:Le.invalid_type,expected:Ze.nan,received:r.parsedType}),lt}return{status:"valid",value:e.data}}}zw.create=t=>new zw({typeName:ut.ZodNaN,...yt(t)});class IB extends Et{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class SE extends Et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?lt:a.status==="dirty"?(n.dirty(),ah(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?lt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new SE({in:e,out:n,typeName:ut.ZodPipeline})}}class uy extends Et{_parse(e){const n=this._def.innerType._parse(e),r=i=>(g2(i)&&(i.value=Object.freeze(i.value)),i);return Jg(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}uy.create=(t,e)=>new uy({innerType:t,typeName:ut.ZodReadonly,...yt(e)});Sn.lazycreate;var ut;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ut||(ut={}));const jt=ks.create,ma=vu.create;zw.create;wu.create;const TB=Xg.create,ege=y2.create;jw.create;Qg.create;ey.create;const v2=Bw.create;Vw.create;nl.create;Hw.create;const Xm=Ms.create,Xn=Sn.create;Sn.strictCreate;const LB=ty.create,tge=EE.create;ny.create;bu.create;const uu=ry.create;qw.create;m2.create;iy.create;const nge=ay.create,Ys=_u.create,rge=sy.create;oy.create;Uo.create;Po.create;Cu.create;Uo.createWithPreprocess;const ige={string:t=>ks.create({...t,coerce:!0}),number:t=>vu.create({...t,coerce:!0}),boolean:t=>Xg.create({...t,coerce:!0}),bigint:t=>wu.create({...t,coerce:!0}),date:t=>y2.create({...t,coerce:!0})};let Zw=function(t){return t.OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",t.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",t.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",t.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",t.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",t.MISSING_MFA_ENROLLMENT="missing_mfa_enrollment",t.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",t.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",t.INVALID_DATA="invalid_data",t.INVALID_CREDENTIALS="invalid_credentials",t.INVALID_CAPTCHA="invalid_captcha",t.LINKED_TO_ANOTHER_USER="linked_to_another_user",t.ALLOWLIST_REJECTED="allowlist_rejected",t.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",t.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",t.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",t.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",t.TOO_MANY_REQUESTS="too_many_requests",t.RESOURCE_CONFLICT="resource_conflict",t.INVALID_ORIGIN="invalid_origin",t.MISSING_ORIGIN="missing_origin",t.INVALID_NATIVE_APP_ID="invalid_native_app_id",t.TOKEN_ALREADY_USED="token_already_used",t.ALREADY_LOGGED_OUT="already_logged_out",t.NOT_SUPPORTED="not_supported",t.USER_UNSUBSCRIBED="user_unsubscribed",t.MAX_APPS_REACHED="max_apps_reached",t.USER_LIMIT_REACHED="max_accounts_reached",t.DEVICE_REVOKED="device_revoked",t.WALLET_PASSWORD_EXISTS="wallet_password_exists",t.OAUTH_STATE_MISMATCH="oauth_state_mismatch",t.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",t.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",t.DISALLOWED_LOGIN_METHOD="disallowed_login_method",t.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",t.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",t.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",t.CANNOT_SET_PASSWORD="cannot_set_password",t.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",t.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",t.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",t.USER_DOES_NOT_EXIST="user_does_not_exist",t.ALREADY_EXISTS="resource_already_exists",t.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",t.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",t.FEATURE_NOT_ENABLED="feature_not_enabled",t.ONRAMP_MINIMUM_IDENTITY_VERIFICATION_REQUIRED="onramp_minimum_identity_verification_required",t.ONRAMP_IDENTITY_VERIFICATION_REQUIRED="onramp_identity_verification_required",t.ONRAMP_DOCUMENT_VERIFICATION_REQUIRED="onramp_document_verification_required",t.ONRAMP_UNSUPPORTED_INFORMATION="onramp_unsupported_information",t.ONRAMP_TRANSACTION_LIMIT_REACHED="transaction_limit_reached",t.ON
vendor: 5,748 bytes, line 40
40RAMP_QUOTE_EXPIRED="onramp_quote_expired",t.INSUFFICIENT_FUNDS="insufficient_funds",t.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",t.TRANSACTION_EXECUTION_FAILURE="transaction_execution_failure",t.INVALID_SOLANA_TRANSACTION="invalid_solana_transaction",t.INVALID_POLICY_FORMAT="invalid_policy_format",t.INVALID_AGGREGATION_FORMAT="invalid_aggregation_format",t.POLICY_VIOLATION="policy_violation",t.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",t.COMPLIANCE_BLOCKED="compliance_blocked",t.INVALID_REQUEST="invalid_request",t.SIGNUP_DISABLED="signup_disabled",t.INVALID_STATE="invalid_state",t}({});Xn({error:jt(),cause:jt().optional(),code:rge(Zw).optional()});/*! js-cookie v3.0.8 | MIT */function S1(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)r!=="__proto__"&&(t[r]=n[r])}return t}var age={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Kw(t,e){function n(i,a,s){if(!(typeof document>"u")){s=S1({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var c in s)s[c]&&(o+="; "+c,s[c]!==!0&&(o+="="+s[c].split(";")[0]));return document.cookie=i+"="+t.write(a,i)+o}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],s={},o=0;o<a.length;o++){var c=a[o].split("="),l=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(u in s||(s[u]=t.read(l,u)),i===u)break}catch{}}return i?s[i]:s}}return Object.create({set:n,get:r,remove:function(i,a){n(i,"",S1({},a,{expires:-1}))},withAttributes:function(i){return Kw(this.converter,S1({},this.attributes,i))},withConverter:function(i){return Kw(S1({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Qt=Kw(age,{path:"/"});const sge={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"450001234",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"0195123456",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"34412345",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"60123456",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"2221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},kB
vendor: 12,668 bytes, line 40
40={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[2-467])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[024-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-7]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]|50"]],["(\\d{8})","$1",["[5-7]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}
vendor: 13,185 bytes, line 40
40|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8}
vendor: 7,686 bytes, line 40
40)","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|3[01]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","(?:400|[5-9]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[4-9]"]]]],ET:["251","00","(?:11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","[235]\\d{8}|800\\d{5,6}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2358]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[
402-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|80[6-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6
vendor: 21,963 bytes, line 40
40]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["11|2[16]"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-37-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85
40"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[013]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|9[2-9]"]],["(\\d)(\\d{7})","$1 $2",["[267]|904"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[346-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-9]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[3689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4}
40)","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[0-79]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["826"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["83"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["82"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[25]0|37|49|8[09]"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-478])|7[1-9]","[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:472[2-47-9]|983[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[02469]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}",[7,8,9,10],[["(\\d{4})(\\d{4,6})","$1 $2",["1(?:2[02]|[89])"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[26]|6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4}
40)","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function g0(t,e){var n=Array.prototype.slice.call(e);return n.push(kB),t.apply(this,n)}function QT(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),i=0;i<3;i++){var a=Number(n[i]),s=Number(r[i]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var oge={}.constructor;function du(t){return t!=null&&t.constructor===oge}var cge=/^\d+$/;function lge(t){return cge.test(t)}function w2(t){"@babel/helpers - typeof";return w2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w2(t)}function Qm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dge(r.key),r)}}function ev(t,e,n){return e&&uge(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function dge(t){var e=fge(t,"string");return w2(e)=="symbol"?e:e+""}function fge(t,e){if(w2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(w2(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var hge="1.2.0",pge="1.7.35",eL=" ext. ",dr=function(){function t(e){Qm(this,t),$B(e),this.metadata=e,PB.call(this,e)}return ev(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var r=this.countryCallingCodes()[n];if(r&&r.length===1&&r[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,r){var i,a;if(n&&(lge(n)?a=n:i=n),r&&(a=r),i&&i!=="001"){var s=this.getCountryMetadata(i);if(!s)throw new Error("Unknown country: ".concat(i));this.numberingPlan=new tL(s,this)}else if(a){if(!this.hasCallingCode(a))throw new Error("Unknown calling code: ".concat(a));this.numberingPlan=new tL(this.getNumberingPlanMetadata(a),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var r=this.countryCallingCodes()[n];if(r)return r.length===1&&r[0].length===3?void 0:r}},{key:"getCountryCodeForCallingCode",value:function(n){var r=this.getCountryCodesForCallingCode(n);if(r)return r[0]}},{key:"getNumberingPlanMetadata",value:function(n){var r=this.getCountryCodeForCallingCode(n);if(r)return this.getCountryMetadata(r);if(this.nonGeographic()){var i=this.nonGeographic()[n];if(i)return i}else{var a=this.countryCallingCodes()[n];if(a&&a.length===1&&a[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])}(),tL=function(){function t(e,n){Qm(this,t),this.globalMetadataObject=n,this.metadata=e,PB.call(this,n.metadata)}return ev(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"_getDefaultCountryMetadataForThisCallingCode",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this._getDefaultCountryMetadataForThisCallingCode()}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,r=this._getFormats(this.metadata)||this._getFormats(this._getDefaultCountryMetadataForThisCallingCode())||[];return r.map(function(i){return new gge(i,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(n){if(this.hasTypes()&&nL(this.types(),n))return new mge(nL(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?eL:this.metadata[13]||eL}}])}(),gge=function(){function t(e,n){Qm(this,t),this._format=e,this.metadata=n}return ev(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!yge.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])}(),yge=/^\(?\$1\)?$/,mge=function(){function t(e,n){Qm(this,t),this.type=e,this.metadata=n}return ev(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.t
vendor: 4,744 bytes, lines 40-41
40ype[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])}();function nL(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function $B(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!du(t)||!du(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(du(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+vge(t)+": "+t,"."))}var vge=function(e){return w2(e)};function AE(t,e){var n=new dr(e);if(n.hasCountry(t))return n.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function wge(t,e){return e.countries.hasOwnProperty(t)}function PB(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?QT(e,hge)===-1?this.v2=!0:QT(e,pge)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function y0(t,e,n){return bge(t,void 0,e,n)}function bge(t,e,n,r){n&&(r=new dr(r.metadata),r.selectNumberingPlan(n));var i=r.type(e),a=i&&i.possibleLengths()||r.possibleLengths();if(!a)return"IS_POSSIBLE";var s=t.length,o=a[0];return o===s?"IS_POSSIBLE":o>s?"TOO_SHORT":a[a.length-1]<s?"TOO_LONG":a.indexOf(s,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function _ge(t,e,n){e===void 0&&(e={});var r=new dr(n);if(e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.country||t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return RB(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function RB(t,e){switch(y0(t,void 0,e)){case"IS_POSSIBLE":return!0;default:return!1}}function jo(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function Cge(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Ege(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 41In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ege(t,e){if(t){if(typeof t=="string")return rL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rL(t,e):void 0}}function rL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Sge=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function xE(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){var r=new dr(n);r.selectNumberingPlan(t.country||t.countryCallingCode);var i=e.v2?t.nationalNumber:t.phone;if(jo(i,r.nationalNumberPattern())){if(p5(i,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||p5(i,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var a=Cge(Sge),s;!(s=a()).done;){var o=s.value;if(p5(i,o,r))return o}}}}function p5(t,e,n){var r=n.type(e);return!r||!r.pattern()||r.possibleLengths()&&r.possibleLengths().indexOf(t.length)<0?!1:jo(t,r.pattern())}function Age(t,e,n){e=e||{};var r=new dr(n);if(r.selectNumberingPlan(t.country||t.countryCallingCode),r.hasTypes())return xE(t,e,r.metadata)!==void 0;var i=e.v2?t.nationalNumber:t.phone;return jo(i,r.nationalNumberPattern())}var xge=/^[A-Z]{2}$/;function Ige(t){return xge.test(t)}function Tge(t,e){var n,r,i=new dr(e);return Ige(t)?(n=t,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=t,{country:n,callingCode:r}}function Lge(t,e,n){var r=new dr(n),i=r.getCountryCodesForCallingCode(t);return i?i.filter(function(a){return kge(e,a,n)}):[]}function kge(t,e,n){var r=new dr(n);return r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0}var IE=2,$ge=17,Pge=3,ci="0-9ï¼-ï¼Ù -Ù©Û°-Û¹",Rge="-â-ââã¼ï¼",Oge="ï¼/",Mge="ï¼.",Nge="  Ââ
41â ã",Dge="()ï¼ï¼ï¼»ï¼½\\[\\]",Fge="~ââ¼ï½",Ya="".concat(Rge).concat(Oge).concat(Mge).concat(Nge).concat(Dge).concat(Fge),tv="+ï¼",Uge=new RegExp("(["+ci+"])");function OB(t,e,n,r){if(e){var i=new dr(r);i.selectNumberingPlan(e||n);var a=new RegExp(i.IDDPrefix());if(t.search(a)===0){t=t.slice(t.match(a)[0].length);var s=t.match(Uge);if(!(s&&s[1]!=null&&s[1].length>0&&s[1]==="0"))return t}}}function Gw(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var i,a,s=r.length-1,o=s>0&&r[s];if(e.nationalPrefixTransformRule()&&o)i=t.replace(n,e.nationalPrefixTransformRule()),s>1&&(a=r[1]);else{var c=r[0];i=t.slice(c.length),o&&(a=r[1])}var l;if(o){var u=t.indexOf(r[1]),d=t.slice(0,u);d===e.numberingPlan.nationalPrefix()&&(l=e.numberingPlan.nationalPrefix())}else l=r[0];return{nationalNumber:i,nationalPrefix:l,carrierCode:a}}}return{nationalNumber:t}}function jge(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Bge(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 42In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bge(t,e){if(t){if(typeof t=="string")return iL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iL(t,e):void 0}}function iL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function MB(t,e,n){for(var r=new dr(n),i=jge(e),a;!(a=i()).done;){var s=a.value;if(r.selectNumberingPlan(s),r.leadingDigits()){if(t&&t.search(r.leadingDigits())===0)return s}else if(xE({phone:t,country:s},void 0,r.metadata))return s}}function TE(t,e){var n=e.nationalNumber,r=e.metadata,i=r.getCountryCodesForCallingCode(t);if(i)return i.length===1?i[0]:MB(n,i,r.metadata)}function Yw(t,e,n){var r=Gw(t,n),i=r.carrierCode,a=r.nationalNumber;if(a!==t){if(!Vge(t,a,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=TE(n.numberingPlan.callingCode(),{nationalNumber:a,metadata:n})),!Hge(a,e,n)))return{nationalNumber:t}}return{nationalNumber:a,carrierCode:i}}function Vge(t,e,n){return!(jo(t,n.nationalNumberPattern())&&!jo(e,n.nationalNumberPattern()))}function Hge(t,e,n){switch(y0(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function NB(t,e,n,r,i){if(!(e||n||r))return{number:t};var a=e||n?AE(e||n,i):r;if(t.indexOf(a)===0){var s=new dr(i);s.selectNumberingPlan(e||n||r);var o=t.slice(a.length),c=Yw(o,void 0,s),l=c.nationalNumber,u=Yw(t,void 0,s),d=u.nationalNumber;if(!jo(d,s.nationalNumberPattern())&&jo(l,s.nationalNumberPattern())||y0(d,void 0,s)==="TOO_LONG")return{countryCallingCode:a,number:o}}return{number:t}}function LE(t,e,n,r,i){if(!t)return{};var a;if(t[0]!=="+"){var s=OB(t,e||n,r,i);if(s&&s!==t)a=!0,t="+"+s;else{if(e||n||r){var o=NB(t,e,n,r,i),c=o.countryCallingCode,l=o.number;if(c)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:c,number:l}}return{number:t}}}if(t[1]==="0")return{};for(var u=new dr(i),d=2;d-1<=Pge&&d<=t.length;){var f=t.slice(1,d);if(u.hasCallingCode(f))return u.selectNumberingPlan(f),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:f,number:t.slice(d)};d++}return{}}function DB(t){return t.replace(new RegExp("[".concat(Ya,"]+"),"g")," ").trim()}var FB=/(\$\d)/;function UB(t,e,n){var r=n.useInternationalFormat,i=n.withNationalPrefix;n.carrierCode,n.metadata;var a=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(FB,e.nationalPrefixFormattingRule()):e.format());return r?DB(a):a}var Wge=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function qge(t,e,n){var r=new dr(n);if(r.selectNumberingPlan(t||e),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(Wge.test(r.IDDPrefix()))return r.IDDPrefix()}var zge=";ext=",rd=function(e){return"([".concat(ci,"]{1,").concat(e,"})")};function jB(t){var e="20",n="15",r="9",i="6",a="[  \\t,]*",s="[:\\.ï¼]?[  \\t,-]*",o="#?",c="(?:e?xt(?:ensi(?:oÌ?|ó))?n?|ï½ ?ï½ï½ï½?|доб|anexo)",l="(?:[xï½#ï¼~ï½]|int|ï½ï½ï½)",u="[- ]+",d="[  \\t]*",f="(?:,{2}|;)",h=zge+rd(e),p=a+c+s+rd(e)+o,g=a+l+s+rd(r)+o,y=u+rd(i)+"#",v=d+f+s+rd(n)+o,b=d+"(?:,)+"+s+rd(r)+o;return h+"|"+p+"|"+g+"|"+y+"|"+v+"|"+b}var Zge="["+ci+"]{"+IE+"}",Kge="["+tv+"]{0,1}(?:["+Ya+"]*["+ci+"]){3,}["+Ya+ci+"]*",Gge=new RegExp("^["+tv+"]{0,1}(?:["+Ya+"]*["+ci+"]){1,2}$","i"),Yge=Kge+"(?:"+jB()+")?",Jge=new RegExp("^"+Zge+"$|^"+Yge+"$","i");function Xge(t){return t.length>=IE&&Jge.test(t)}function Qge(t){return Gge.test(t)}function eye(t){var e=t.number,n=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}var aL={formatExtension:function(e,n,r){return"".concat(e).concat(r.ext()).concat(n)}};function tye(t,e,n,r){n?n=iye({},aL,n):n=aL;var i=new dr(r);if(t.country&&t.country!=="001"){if(!i.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));i.selectNumberingPlan(t.country)}else if(t.countryCallingCode)i.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var a=i.countryCallingCode(),s=n.v2?t.nationalNumber:t.phone,o;switch(e){case"NATIONAL":return s?(o=dy(s,t.carrierCode,"NATIONAL",i,n),g5(o,t.ext,i,n.formatExtension)):"";case"INTERNATIONAL":return s?(o=dy(s,null,"INTERNATIONAL",i,n),o="+".concat(a," ").concat(o),g5(o,t.ext,i,n.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(s);case"RFC3966":return eye({number:"+".concat(a).concat(s),ext:t.ext});case"IDD":if(!n.fromCountry)return;var c=rye(s,t.carrierCode,a,n.fromCountry,i);return c?g5(c,t.ext,i,n.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function dy(t,e,n,r,i){var a=nye(r.formats(),t);return a?UB(t,a,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:e,metadata:r}):t}function nye(t,e){return aye(t,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(e.search(r)!==0)return!1}return jo(e,n.pattern())})}function g5(t,e,n,r){return e?r(t,e,n):t}function rye(t,e,n,r,i){var a=AE(r,i.metadata);if(a===n){var s=dy(t,e,"NATIONAL",i);return n==="1"?n+" "+s:s}var o=qge(r,void 0,i.metadata);if(o)return"".concat(o," ").concat(n," ").concat(dy(t,null,"INTERNATIONAL",i))}function iye(){for(var t=1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(;t<n.length;){if(n[t])for(var i in n[t])n[0][i]=n[t][i];t++}return n[0]}function aye(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}function hp(t){"@babel/helpers - typeof";return hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hp(t)}function sL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function oL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 5,014 bytes, line 42
42e%2?sL(Object(n),!0).forEach(function(r){sye(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sye(t,e,n){return(e=BB(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,BB(r.key),r)}}function lye(t,e,n){return e&&cye(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function BB(t){var e=uye(t,"string");return hp(e)=="symbol"?e:e+""}function uye(t,e){if(hp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(hp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kE=function(){function t(e,n,r){if(oye(this,t),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(du(n)&&du(n.countries)){r=n;var i=e;if(!dye.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var a=LE(i,void 0,void 0,void 0,r),s=a.countryCallingCode,o=a.number;if(n=o,e=s,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");$B(r);var c=Tge(e,r),l=c.country,u=c.callingCode;this.country=l,this.countryCallingCode=u,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return lye(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Lge(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return _ge(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Age(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new dr(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return xE(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return tye(this,n,r?oL(oL({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}])}(),dye=/^\+\d+$/;function Jw(t){"@babel/helpers - typeof";return Jw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jw(t)}function fye(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function hye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pye(t,e,n){return e=gp(e),gye(t,$E()?Reflect.construct(e,n||[],gp(t).constructor):e.apply(t,n))}function gye(t,e){if(e&&(Jw(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yye(t)}function yye(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mye(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pp(t,e)}function Xw(t){var e=typeof Map=="function"?new Map:void 0;return Xw=function(r){if(r===null||!wye(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return vye(r,arguments,gp(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),pp(i,r)},Xw(t)}function vye(t,e,n){if($E())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&pp(i,n.prototype),i}function $E(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($E=function(){return!!t})()}function wye(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}
vendor: 5,408 bytes, lines 42-44
42function pp(t,e){return pp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},pp(t,e)}function gp(t){return gp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gp(t)}var _o=function(t){function e(n){var r;return hye(this,e),r=pye(this,e,[n]),Object.setPrototypeOf(r,e.prototype),r.name=r.constructor.name,r}return mye(e,t),fye(e)}(Xw(Error)),cL=new RegExp("(?:"+jB()+")$","i");function bye(t){var e=t.search(cL);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(cL),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}function _ye(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Cye(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 43In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cye(t,e){if(t){if(typeof t=="string")return lL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lL(t,e):void 0}}function lL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Eye={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","ï¼":"0","ï¼":"1","ï¼":"2","ï¼":"3","ï¼":"4","ï¼":"5","ï¼":"6","ï¼":"7","ï¼":"8","ï¼":"9","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9"};function VB(t){return Eye[t]}function fy(t){for(var e="",n=_ye(t.split("")),r;!(r=n()).done;){var i=r.value,a=VB(i);a&&(e+=a)}return e}function Sye(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Aye(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 44In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aye(t,e){if(t){if(typeof t=="string")return uL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uL(t,e):void 0}}function uL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function dL(t){for(var e="",n=Sye(t.split("")),r;!(r=n()).done;){var i=r.value;e+=xye(i,e)||""}return e}function xye(t,e,n){return t==="+"?e?void 0:"+":VB(t)}var HB="+",Iye="[\\-\\.\\(\\)]?",fL="(["+ci+"]|"+Iye+")",Tye="^\\"+HB+fL+"*["+ci+"]"+fL+"*$",Lye=new RegExp(Tye,"g"),Qw=ci,kye="["+Qw+"]+((\\-)*["+Qw+"])*",$ye="a-zA-Z",Pye="["+$ye+"]+((\\-)*["+Qw+"])*",Rye="^("+kye+"\\.)*"+Pye+"\\.?$",Oye=new RegExp(Rye,"g"),hL="tel:",e8=";phone-context=",Mye=";isub=";function Nye(t){var e=t.indexOf(e8);if(e<0)return null;var n=e+e8.length;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}function Dye(t){return t===null?!0:t.length===0?!1:Lye.test(t)||Oye.test(t)}function Fye(t,e){var n=e.extractFormattedPhoneNumber,r=Nye(t);if(!Dye(r))throw new _o("NOT_A_NUMBER");var i;if(r===null)i=n(t)||"";else{i="",r.charAt(0)===HB&&(i+=r);var a=t.indexOf(hL),s;a>=0?s=a+hL.length:s=0;var o=t.indexOf(e8);i+=t.substring(s,o)}var c=i.indexOf(Mye);if(c>0&&(i=i.substring(0,c)),i!=="")return i}var Uye=250,jye=new RegExp("["+tv+ci+"]"),Bye=new RegExp("[^"+ci+"#]+$");function Vye(t,e,n){e=e||{};var r=new dr(n);if(e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new _o("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var i=Wye(t,e.v2,e.extract),a=i.number,s=i.ext,o=i.error;if(!a){if(e.v2)throw o==="TOO_SHORT"?new _o("TOO_SHORT"):new _o("NOT_A_NUMBER");return{}}var c=zye(a,e.defaultCountry,e.defaultCallingCode,r),l=c.country,u=c.nationalNumber,d=c.countryCallingCode,f=c.countryCallingCodeSource,h=c.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new _o("INVALID_COUNTRY");return{}}if(!u||u.length<IE){if(e.v2)throw new _o("TOO_SHORT");return{}}if(u.length>$ge){if(e.v2)throw new _o("TOO_LONG");return{}}if(e.v2){var p=new kE(d,u,r.metadata);return l&&(p.country=l),h&&(p.carrierCode=h),s&&(p.ext=s),p.__countryCallingCodeSource=f,p}var g=(e.extended?r.hasSelectedNumberingPlan():l)?jo(u,r.nationalNumberPattern()):!1;return e.extended?{country:l,countryCallingCode:d,carrierCode:h,valid:g,possible:g?!0:!!(e.extended===!0&&r.possibleLengths()&&RB(u,r)),phone:u,ext:s}:g?qye(l,u,s):{}}function Hye(t,e,n){if(t){if(t.length>Uye){if(n)throw new _o("TOO_LONG");return}if(e===!1)return t;var r=t.search(jye);if(!(r<0))return t.slice(r).replace(Bye,"")}}function Wye(t,e,n){var r=Fye(t,{extractFormattedPhoneNumber:function(s){return Hye(s,n,e)}});if(!r)return{};if(!Xge(r))return Qge(r)?{error:"TOO_SHORT"}:{};var i=bye(r);return i.ext?i:{number:r}}function qye(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function zye(t,e,n,r){var i=LE(dL(t),void 0,e,n,r.metadata),a=i.countryCallingCodeSource,s=i.countryCallingCode,o=i.number,c;if(s)r.selectNumberingPlan(s);
vendor: 5,050 bytes, lines 44-45
44else if(o&&(e||n))e?(c=e,r.selectNumberingPlan(e),s=r.numberingPlan.callingCode()):(r.selectNumberingPlan(n),s=n);else return{};if(!o)return{countryCallingCodeSource:a,countryCallingCode:s};var l=Yw(dL(o),void 0,r),u=l.nationalNumber,d=l.carrierCode,f=TE(s,{nationalNumber:u,metadata:r});return f&&(c=f,f==="001"||r.selectNumberingPlan(c)),{country:c,countryCallingCode:s,countryCallingCodeSource:a,nationalNumber:u,carrierCode:d}}function yp(t){"@babel/helpers - typeof";return yp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yp(t)}function pL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function gL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pL(Object(n),!0).forEach(function(r){Zye(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Zye(t,e,n){return(e=Kye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kye(t){var e=Gye(t,"string");return yp(e)=="symbol"?e:e+""}function Gye(t,e){if(yp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(yp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yye(t,e,n){return Vye(t,gL(gL({},e),{},{v2:!0}),n)}function mp(t){"@babel/helpers - typeof";return mp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mp(t)}function yL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Jye(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?yL(Object(n),!0).forEach(function(r){Xye(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xye(t,e,n){return(e=Qye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qye(t){var e=eme(t,"string");return mp(e)=="symbol"?e:e+""}function eme(t,e){if(mp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(mp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tme(t,e){return ame(t)||ime(t,e)||rme(t,e)||nme()}function nme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 45In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rme(t,e){if(t){if(typeof t=="string")return mL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mL(t,e):void 0}}function mL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ime(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}function ame(t){if(Array.isArray(t))return t}function WB(t){var e=Array.prototype.slice.call(t),n=tme(e,4),r=n[0],i=n[1],a=n[2],s=n[3],o,c,l;if(typeof r=="string")o=r;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")s?(c=a,l=s):(c=void 0,l=a),i&&(c=Jye({defaultCountry:i},c));else if(du(i))a?(c=i,l=a):l=i;else throw new Error("Invalid second argument: ".concat(i));return{text:o,options:c,metadata:l}}function vp(t){"@babel/helpers - typeof";return vp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vp(t)}function vL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function wL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 11,116 bytes, lines 45-46
45e%2?vL(Object(n),!0).forEach(function(r){sme(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sme(t,e,n){return(e=ome(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ome(t){var e=cme(t,"string");return vp(e)=="symbol"?e:e+""}function cme(t,e){if(vp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(vp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qB(t,e,n){e&&e.defaultCountry&&!wge(e.defaultCountry,n)&&(e=wL(wL({},e),{},{defaultCountry:void 0}));try{return Yye(t,e,n)}catch(r){if(!(r instanceof _o))throw r}}function wp(t){"@babel/helpers - typeof";return wp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wp(t)}function bL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _L(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?bL(Object(n),!0).forEach(function(r){lme(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function lme(t,e,n){return(e=ume(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ume(t){var e=dme(t,"string");return wp(e)=="symbol"?e:e+""}function dme(t,e){if(wp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(wp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fme(){var t=WB(arguments),e=t.text,n=t.options,r=t.metadata;n=_L(_L({},n),{},{extract:!1});var i=qB(e,n,r);return i&&i.isValid()||!1}function bp(t){"@babel/helpers - typeof";return bp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bp(t)}function CL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function EL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?CL(Object(n),!0).forEach(function(r){hme(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):CL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function hme(t,e,n){return(e=pme(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pme(t){var e=gme(t,"string");return bp(e)=="symbol"?e:e+""}function gme(t,e){if(bp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(bp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yme(){var t=WB(arguments),e=t.text,n=t.options,r=t.metadata;n=EL(EL({},n),{},{extract:!1});var i=qB(e,n,r);return i&&i.isPossible()||!1}function _p(t){"@babel/helpers - typeof";return _p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_p(t)}function mme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vme(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bme(r.key),r)}}function wme(t,e,n){return e&&vme(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function bme(t){var e=_me(t,"string");return _p(e)=="symbol"?e:e+""}function _me(t,e){if(_p(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(_p(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Cme=function(){function t(e){var n=e.onCountryChange,r=e.onCallingCodeChange;mme(this,t),this.onCountryChange=n,this.onCallingCodeChange=r}return wme(t,[{key:"reset",value:function(n){var r=n.country,i=n.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(r,i)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(n){for(var r=0,i=Object.keys(n);r<i.length;r++){var a=i[r];this[a]=n[a]}}},{key:"initCountryAndCallingCode",value:function(n,r){this.setCountry(n),this.setCallingCode(r)}},{key:"setCountry",value:function(n){this.country=n,this.onCountryChange(n)}},{key:"setCallingCode",value:function(n){this.callingCode=n,this.onCallingCodeChange(n,this.country)}},{key:"startInternationalNumber",value:function(n,r){this.international=!0,this.initCountryAndCallingCode(n,r)}},{key:"appendDigits",value:function(n){this.digits+=n}},{key:"appendNationalSignificantNumberDigits",value:function(n){this.nationalSignificantNumber+=n}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])}();function Eme(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Sme(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 46In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sme(t,e){if(t){if(typeof t=="string")return SL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SL(t,e):void 0}}function SL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var ja="x",y5=new RegExp(ja);function j3(t,e){if(e<1)return"";for(var n="";e>1;)e&1&&(n+=t),e>>=1,t+=t;return n+t}function AL(t,e){return t[e]===")"&&e++,Ame(t.slice(0,e))}function Ame(t){for(var e=[],n=0;n<t.length;)t[n]==="("?e.push(n):t[n]===")"&&e.pop(),n++;var r=0,i="";e.push(t.length);for(var a=0,s=e;a<s.length;a++){var o=s[a];i+=t.slice(r,o),r=o+1}return i}function xme(t,e,n){for(var r=Eme(n.split("")),i;!(i=r()).done;){var a=i.value;if(t.slice(e+1).search(y5)<0)return;e=t.search(y5),t=t.replace(y5,a)}return[t,e]}function Ime(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,a=n.getSeparatorAfterNationalPrefix,s=new RegExp("^(?:".concat(e.pattern(),")$"));if(s.test(t.nationalSignificantNumber))return Lme(t,e,{metadata:r,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:a})}function Tme(t,e){return y0(t,void 0,e)==="IS_POSSIBLE"}function Lme(t,e,n){var r=n.metadata,i=n.shouldTryNationalPrefixFormattingRule,a=n.getSeparatorAfterNationalPrefix;if(t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode,i(e)){var s=xL(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:a,metadata:r});if(s)return s}return xL(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:a,metadata:r})}function xL(t,e,n){var r=n.metadata,i=n.useNationalPrefixFormattingRule,a=n.getSeparatorAfterNationalPrefix,s=UB(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:i,metadata:r});if(i||(t.nationalPrefix?s=t.nationalPrefix+a(e)+s:t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(s=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+s)),kme(s,t))return s}function kme(t,e){return fy(t)===e.getNationalDigits()}function Cp(t){"@babel/helpers - typeof";return Cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cp(t)}function $me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pme(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ome(r.key),r)}}function Rme(t,e,n){return e&&Pme(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ome(t){var e=Mme(t,"string");return Cp(e)=="symbol"?e:e+""}function Mme(t,e){if(Cp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Cp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Nme=function(){function t(){$me(this,t)}return Rme(t,[{key:"parse",value:function(n){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(n),this.context.length!==1)throw new Error("Non-finalized contexts left when pattern parse ended");var r=this.context[0],i=r.branches,a=r.instructions;if(i)return{op:"|",args:i.concat([m5(a)])};if(a.length===0)throw new Error("Pattern is required");return a.length===1?a[0]:a}},{key:"startContext",value:function(n){this.context.push(n)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(n){if(!n)throw new Error("Pattern is required");var r=n.match(Ume);if(!r){if(Fme.test(n))throw new Error("Illegal characters found in a pattern: ".concat(n));this.getContext().instructions=this.getContext().instructions.concat(n.split(""));return}var i=r[1],a=n.slice(0,r.index),s=n.slice(r.index+i.length);switch(i){case"(?:":a&&this.parsePattern(a),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(a&&this.parsePattern(a),this.getContext().instructions.length===0)throw new Error('No instructions foun
46d after "|" operator in an "or" group');var o=this.getContext(),c=o.branches;c.push(m5(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:c});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(a&&this.parsePattern(a),!this.getContext().branches)if(this.context.length===1)this.getContext().branches=[];else throw new Error('"branches" not found in an "or" group context');this.getContext().branches.push(m5(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":a&&this.parsePattern(a),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:Dme(a)});break;default:throw new Error("Unknown operator: ".concat(i))}s&&this.parsePattern(s)}}])}();function Dme(t){for(var e=[],n=0;n<t.length;){if(t[n]==="-"){if(n===0||n===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var r=t[n-1].charCodeAt(0)+1,i=t[n+1].charCodeAt(0)-1,a=r;a<=i;)e.push(String.fromCharCode(a)),a++}else e.push(t[n]);n++}return e}var Fme=/[\(\)\[\]\?\:\|]/,Ume=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function m5(t){return t.length===1?t[0]:t}function IL(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=jme(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 47In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jme(t,e){if(t){if(typeof t=="string")return TL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TL(t,e):void 0}}function TL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ep(t){"@babel/helpers - typeof";return Ep=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ep(t)}function Bme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vme(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Wme(r.key),r)}}function Hme(t,e,n){return e&&Vme(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wme(t){var e=qme(t,"string");return Ep(e)=="symbol"?e:e+""}function qme(t,e){if(Ep(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ep(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var zme=function(){function t(e){Bme(this,t),this.matchTree=new Nme().parse(e)}return Hme(t,[{key:"match",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.allowOverflow;if(!n)throw new Error("String is required");var a=t8(n.split(""),this.matchTree,!0);if(a&&a.match&&delete a.matchedChars,!(a&&a.overflow&&!i))return a}}])}();function t8(t,e,n){if(typeof e=="string"){var r=t.join("");return e.indexOf(r)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:r.indexOf(e)===0?n&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),a=0;a<e.length;){var s=e[a],o=t8(i,s,n&&a===e.length-1);if(o){if(o.overflow)return o;if(o.match){if(i=i.slice(o.matchedChars.length),i.length===0)return a===e.length-1?{match:!0,matchedChars:t}:{partialMatch:!0}}else{if(o.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result: 48`.concat(JSON.stringify(o,null,2)))}}else return;a++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-i.length)}}switch(e.op){case"|":for(var c,l=IL(e.args),u;!(u=l()).done;){var d=u.value,f=t8(t,d,n);if(f){if(f.overflow)return f;if(f.match)return{match:!0,matchedChars:f.matchedChars};if(f.partialMatch)c=!0;else throw new Error(`Unsupported match result: 49`.concat(JSON.stringify(f,null,2)))}}return c?{partialMatch:!0}:void 0;case"[]":for(var h=IL(e.args),p;!(p=h()).done;){var g=p.value;if(t[0]===g)return t.length===1?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[g]}}return;default:throw new Error("Unsupported instruction tree: ".concat(e))}}function Sp(t){"@babel/helpers - typeof";return Sp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sp(t)}function LL(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Zme(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 50In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zme(t,e){if(t){if(typeof t=="string")return kL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kL(t,e):void 0}}function kL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Kme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gme(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jme(r.key),r)}}function Yme(t,e,n){return e&&Gme(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jme(t){var e=Xme(t,"string");return Sp(e)=="symbol"?e:e+""}function Xme(t,e){if(Sp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Sp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var n8="9",Qme=15,eve=j3(n8,Qme),tve=/[- ]/,nve=function(){return/\[([^\[\]])*\]/g},rve=function(){return/\d(?=[^,}][^,}])/g},ive=new RegExp("["+Ya+"]*\\$1["+Ya+"]*(\\$\\d["+Ya+"]*)*$"),$L=3,ave=function(){function t(e){e.state;var n=e.metadata;Kme(this,t),this.metadata=n,this.resetFormat()}return Yme(t,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(n,r){this.resetFormat(),n?(this.isNANP=n.callingCode()==="1",this.matchingFormats=n.formats(),r.nationalSignificantNumber&&this.narrowDownMatchingFormats(r)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(n,r){var i=this;if(Tme(r.nationalSignificantNumber,this.metadata))for(var a=LL(this.matchingFormats),s;!(s=a()).done;){var o=s.value,c=Ime(r,o,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(u){return i.shouldTryNationalPrefixFormattingRule(u,{international:r.international,nationalPrefix:r.nationalPrefix})},getSeparatorAfterNationalPrefix:function(u){return i.getSeparatorAfterNationalPrefix(u)}});if(c)return this.resetFormat(),this.chosenFormat=o,this.setNationalNumberTemplate(c.replace(/\d/g,ja),r),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(ja),c}return this.formatNationalNumberWithNextDigits(n,r)}},{key:"formatNationalNumberWithNextDigits",value:function(n,r){var i=this.chosenFormat,a=this.chooseFormat(r);if(a)return a===i?this.formatNextNationalNumberDigits(n):this.formatNextNationalNumberDigits(r.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(n){var r=this,i=n.nationalSignificantNumber,a=n.nationalPrefix,s=n.international,o=i,c=o.length-$L;c<0&&(c=0),this.matchingFormats=this.matchingFormats.filter(function(l){return r.formatSuits(l,s,a)&&r.formatMatches(l,o,c)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(n,r,i){return!(i&&!n.usesNationalPrefix()&&!n.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!r&&!i&&n.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(n,r,i){var a=n.leadingDigitsPatterns().length;if(a===0)return!0;
vendor: 14,740 bytes, lines 50-52
50i=Math.min(i,a-1);var s=n.leadingDigitsPatterns()[i];if(r.length<$L)try{return new zme(s).match(r,{allowOverflow:!0})!==void 0}catch(o){return console.error(o),!0}return new RegExp("^(".concat(s,")")).test(r)}},{key:"getFormatFormat",value:function(n,r){return r?n.internationalFormat():n.format()}},{key:"chooseFormat",value:function(n){for(var r=this,i=function(){var l=o.value;return r.chosenFormat===l?0:ive.test(r.getFormatFormat(l,n.international))?r.createTemplateForFormat(l,n)?(r.chosenFormat=l,0):(r.matchingFormats=r.matchingFormats.filter(function(u){return u!==l}),1):1},a,s=LL(this.matchingFormats.slice()),o;!(o=s()).done&&(a=i(),a!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(n,r){if(!(n.pattern().indexOf("|")>=0)){var i=this.getTemplateForFormat(n,r);if(i)return this.setNationalNumberTemplate(i,r),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(n){return this.isNANP||n&&n.nationalPrefixFormattingRule()&&tve.test(n.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(n,r){var i=n.IDDPrefix,a=n.missingPlus;return i?r&&r.spacing===!1?i:i+" ":a?"":"+"}},{key:"getTemplate",value:function(n){if(this.template){for(var r=-1,i=0,a=n.international?this.getInternationalPrefixBeforeCountryCallingCode(n,{spacing:!1}):"";i<a.length+n.getDigitsWithoutInternationalPrefix().length;)r=this.template.indexOf(ja,r+1),i++;return AL(this.template,r+1)}}},{key:"setNationalNumberTemplate",value:function(n,r){this.nationalNumberTemplate=n,this.populatedNationalNumberTemplate=n,this.populatedNationalNumberTemplatePosition=-1,r.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(r).replace(/[\d\+]/g,ja)+j3(ja,r.callingCode.length)+" "+n:this.template=n}},{key:"getTemplateForFormat",value:function(n,r){var i=r.nationalSignificantNumber,a=r.international,s=r.nationalPrefix,o=r.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,c=n.pattern();c=c.replace(nve(),"\\d").replace(rve(),"\\d");var l=eve.match(c)[0];if(!(i.length>l.length)){var u=new RegExp("^"+c+"$"),d=i.replace(/\d/g,n8);u.test(d)&&(l=d);var f=this.getFormatFormat(n,a),h;if(this.shouldTryNationalPrefixFormattingRule(n,{international:a,nationalPrefix:s})){var p=f.replace(FB,n.nationalPrefixFormattingRule());if(fy(n.nationalPrefixFormattingRule())===(s||"")+fy("$1")&&(f=p,h=!0,s))for(var g=s.length;g>0;)f=f.replace(/\d/,ja),g--}var y=l.replace(new RegExp(c),f).replace(new RegExp(n8,"g"),ja);return h||(o?y=j3(ja,o.length)+" "+y:s&&(y=j3(ja,s.length)+this.getSeparatorAfterNationalPrefix(n)+y)),a&&(y=DB(y)),y}}},{key:"formatNextNationalNumberDigits",value:function(n){var r=xme(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,n);if(!r){this.resetFormat();return}return this.populatedNationalNumberTemplate=r[0],this.populatedNationalNumberTemplatePosition=r[1],AL(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(n,r){var i=r.international,a=r.nationalPrefix;if(n.nationalPrefixFormattingRule()){var s=n.usesNationalPrefix();if(s&&a||!s&&!i)return!0}}}])}();function Ap(t){"@babel/helpers - typeof";return Ap=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ap(t)}function zB(t,e){return lve(t)||cve(t,e)||ove(t,e)||sve()}function sve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 51In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ove(t,e){if(t){if(typeof t=="string")return PL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PL(t,e):void 0}}function PL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function cve(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}function lve(t){if(Array.isArray(t))return t}function uve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dve(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hve(r.key),r)}}function fve(t,e,n){return e&&dve(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function hve(t){var e=pve(t,"string");return Ap(e)=="symbol"?e:e+""}function pve(t,e){if(Ap(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ap(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var gve="["+Ya+ci+"]+",yve=new RegExp("^"+gve+"$","i"),mve="(?:["+tv+"]["+Ya+ci+"]*|["+Ya+ci+"]+)",vve=new RegExp("[^"+Ya+ci+"]+.*$"),wve=/[^\d\[\]]/,bve=function(){function t(e){var n=e.defaultCountry,r=e.defaultCallingCode,i=e.metadata,a=e.onNationalSignificantNumberChange;uve(this,t),this.defaultCountry=n,this.defaultCallingCode=r,this.metadata=i,this.onNationalSignificantNumberChange=a}return fve(t,[{key:"input",value:function(n,r){var i=Eve(n),a=zB(i,2),s=a[0],o=a[1],c=fy(s),l;return o&&(r.digits||(r.startInternationalNumber(void 0,void 0),c||(l=!0))),c&&this.inputDigits(c,r),{digits:c,justLeadingPlus:l}}},{key:"inputDigits",value:function(n,r){var i=r.digits,a=i.length<3&&i.length+n.length>=3;if(r.appendDigits(n),a&&this.extractIddPrefix(r),this.isWaitingForCountryCallingCode(r)){if(!this.extractCountryCallingCode(r))return}else r.appendNationalSignificantNumberDigits(n);r.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(r.getNationalDigits(),function(s){return r.update(s)})}},{key:"isWaitingForCountryCallingCode",value:function(n){var r=n.international,i=n.callingCode;return r&&!i}},{key:"extractCountryCallingCode",value:function(n){var r=LE("+"+n.getDigitsWithoutInternationalPrefix(),n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode,a=r.number;if(i)return n.setCallingCode(i),n.update({nationalSignificantNumber:a}),!0}},{key:"reset",value:function(n){if(n){this.hasSelectedNumberingPlan=!0;var r=n._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=r&&wve.test(r)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(n,r){if(this.hasSelectedNumberingPlan){var i=Gw(n,this.metadata),a=i.nationalPrefix,s=i.nationalNumber,o=i.carrierCode;if(s!==n)return this.onExtractedNationalNumber(a,o,s,n,r),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(n,r,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(n,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var a=Gw(n,this.metadata),s=a.nationalPrefix,o=a.nationalNumber,c=a.carrierCode;if(o!==r)return this.onExtractedNationalNumber(s,c,o,n,i),!0}}},{key:"onExtractedNationalNumber",value:function(n,r,i,a,s){var o=!1,c,l=a.lastIndexOf(i);if(l<0||l!==a.length-i.length)o=!0;else{var u=a.slice(0,l);u&&u!==n&&(c=u)}s({nationalPrefix:n,carrierCode:r,nationalSignificantNumber:i,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:c}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(n){if(this.extractAnotherNationalSignificantNumber(n.getNationalDigits(),n.nationalSignificantNumber,function(r){return n.update(r)}))return!0;if(this.extractIddPrefix(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0;if(this.fixMissingPlus(n))return this.extractCallingCodeAndNationalSignificantNumber(n),!0}},{key:"extractIddPrefix",value:function(n){var r=n.international,i=n.IDDPrefix,a=n.digits;if(n.nationalSignificantNumber,!(r||i)){var s=OB(a,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(s!==void 0&&s!==a)return n.update({IDDPrefix:a.slice(0,a.length-s.length)}),this.startInternationalNumber(n,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(n){if(!n.international){var r=NB(n.digits,n.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=r.countryCallingCode;if(i)return n.update({missingPlus:!0}),this.startInternationalNumber(n,{country:n.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(n,r){var i=r.country,a=r.callingCode;n.startInternationalNumber(i,a),n.nationalSignificantNumber&&(n.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(n){this.extractCountryCallingCode(n)&&this.extractNationalSignificantNumber(n.getNationalDigits(),function(r){return n.update(r)})}}])}();function _ve(t){var e=t.search(mve);if(!(e<0)){t=t.slice(e);var n;return t[0]==="+"&&(n=!0,t=t.slice(1)),t=t.replace(vve,""),n&&(t="+"+t),t}}function Cve(t){var e=_ve(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function Eve(t){var e=Cve(t),n=zB(e,2),r=n[0],i=n[1];return yve.test(r)||(r=""),[r,i]}function xp(t){"@babel/helpers - typeof";return xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xp(t)}function Sve(t,e){return Tve(t)||Ive(t,e)||xve(t,e)||Ave()}function Ave(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 52In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xve(t,e){if(t){if(typeof t=="string")return RL(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?RL(t,e):void 0}}function RL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ive(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,o=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}function Tve(t){if(Array.isArray(t))return t}function Lve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kve(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pve(r.key),r)}}function $ve(t,e,n){return e&&kve(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pve(t){var e=Rve(t,"string");return xp(e)=="symbol"?e:e+""}function Rve(t,e){if(xp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(xp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ZB=function(){function t(e,n){Lve(this,t),this.metadata=new dr(n);var r=this.getCountryAndCallingCode(e),i=Sve(r,2),a=i[0],s=i[1];this.defaultCountry=a,this.defaultCallingCode=s,this.reset()}return $ve(t,[{key:"getCountryAndCallingCode",value:function(n){var r,i;return n&&(du(n)?(r=n.defaultCountry,i=n.defaultCallingCode):r=n),r&&!this.metadata.hasCountry(r)&&(r=void 0),[r,i]}},{key:"input",value:function(n){var r=this.parser.input(n,this.state),i=r.digits,a=r.justLeadingPlus;if(a)this.formattedOutput="+";else if(i){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var s;if(this.metadata.hasSelectedNumberingPlan()&&(s=this.formatter.format(i,this.state)),s===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var o=this.state.getNationalDigits();o&&(s=this.formatter.format(o,this.state))}this.formattedOutput=s?this.getFullNumber(s):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var n=this;return this.state=new Cme({onCountryChange:function(i){n.country=i},onCallingCodeChange:function(i,a){n.metadata.selectNumberingPlan(a||i),n.formatter.reset(n.metadata.numberingPlan,n.state),n.parser.reset(n.metadata.numberingPlan)}}),this.formatter=new ave({state:this.state,metadata:this.metadata}),this.parser=new bve({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){n.determineTheCountryIfNeeded(),n.formatter.reset(n.metadata.numberingPlan,n.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var n=this.state.digits;if(n)return this._getCountry()}},{key:"_getCountry",value:function(){var n=this.state.country;return n}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(n){var r=this;if(this.isInternational()){var i=function(o){return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state,{spacing:!!o})+o},a=this.state.callingCode;return i(a?n?"".concat(a," ").concat(n):a:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return n}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,a=n.nationalPrefix,s=r,o=i||a;return o&&(s=o+s),s}},{key:"getNonFormattedNumber",value:function(){var n=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(n?this.state.getNationalDigits():this.getNon
52FormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var n=this.getNonFormattedNumber();if(n)return n.replace(/[\+\d]/g,ja)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var n=this.state.callingCode,r=this.metadata.getCountryCodesForCallingCode(n);return r&&r.length>1}},{key:"determineTheCountry",value:function(){var n=TE(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata});n!==this.state.country&&(this.state.setCountry(n),n&&this.metadata.selectNumberingPlan(n))}},{key:"getNumberValue",value:function(){var n=this.state,r=n.digits,i=n.callingCode,a=n.country,s=n.nationalSignificantNumber;if(r){if(this.isInternational())return i?"+"+i+s:"+"+r;if(a||i){var o=a?this.metadata.countryCallingCode():i;return"+"+o+s}}}},{key:"getNumber",value:function(){var n=this.state,r=n.nationalSignificantNumber,i=n.carrierCode,a=n.callingCode;if(r){var s=this._getCountry();if(!(!s&&!a)){if(s&&s===this.defaultCountry){var o=this.metadata.numberingPlan.callingCode(),c=Ove(o,r,this.metadata);c&&(s=c)}var l=new kE(s||a,r,this.metadata.metadata);return i&&(l.carrierCode=i),l}}}},{key:"isPossible",value:function(){var n=this.getNumber();return n?n.isPossible():!1}},{key:"isValid",value:function(){var n=this.getNumber();return n?n.isValid():!1}},{key:"validateLength",value:function(){var n=this.state,r=n.digits,i=n.nationalSignificantNumber;if(!r)return"NOT_A_NUMBER";if(!this.metadata.numberingPlan)return"INVALID_COUNTRY";if(!i)return"TOO_SHORT";var a=y0(i,void 0,this.metadata);if(a!=="IS_POSSIBLE")return a}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])}();function Ove(t,e,n){var r=n.getCountryCodesForCallingCode(t);if(r.length>1)return MB(e,r,n.metadata)}function Mve(t){return new dr(t).getCountries()}function Nve(t,e,n){if(e[t])return new kE(t,e[t],n)}function Dve(){return g0(fme,arguments)}function Fve(){return g0(yme,arguments)}function Ip(t){return ZB.call(this,t,kB)}Ip.prototype=Object.create(ZB.prototype,{});Ip.prototype.constructor=Ip;function Uve(){return g0(Mve,arguments)}function KB(){return g0(AE,arguments)}function jve(){return g0(Nve,arguments)}var OL=Object.defineProperty,nv=(t,e)=>{let n={};for(var r in t)OL(n,r,{get:t[r],enumerable:!0});return OL(n,Symbol.toStringTag,{value:"Module"}),n};function Bve(t){return{digest:t?.digest??((e,n)=>globalThis.crypto.subtle.digest(e,n)),randomUUID:t?.randomUUID??(()=>globalThis.crypto.randomUUID())}}var Vve=class{_privyInternal;_smartWalletConfig;constructor(e){this._privyInternal=e}getConfig(){return this._privyInternal.config}async getSmartWalletConfig(){return this._smartWalletConfig||=await this._privyInternal.fetch(m1e,{params:{app_id:this.appId}}),this._smartWalletConfig}get appId(){return this._privyInternal.appId}},Rl=class GB{static parse(e){try{return new GB(e)}catch{return null}}value;_decoded;constructor(e){this.value=e,this._decoded=Fw(e)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=(this.expiration-e)*1e3}},Hve=class r8{_storage;_privyInternal;constructor(e,n){this._privyInternal=e,this._storage=n}static providerAccessTokenStorageKey=e=>`privy:cross-app:${e}`;async updateOnCrossAppAuthentication(e,n){let r=n.access_token,i=r8.providerAccessTokenStorageKey(e);await this._storage.put(i,r)}async getProviderAccessToken(e){let n=r8.providerAccessTokenStorageKey(e),r=await this._storage.get(n);if(typeof r!="string")return null;try{if(new Rl(r).isExpired())throw Error("JWT is expired");return r}catch{return await this._storage.del(n),null}}async getCrossAppConnections(){return await this._privyInternal.fetch(L0e,{params:{app_id:this._privyInternal.appId}})}},Wve=class{_privyInternal;constructor(e){this._privyInternal=e}async revoke(){await this._privyInternal.fetch(D1e,{})}}
52,v5=class extends Error{name="PrivyApiError";error;code;status;constructor({error:e,code:n,status:r}){super(e),this.error=e,this.code=n,this.status=r}},at=class extends Error{error;code;constructor({error:e,code:n}){super(e),this.code=n,this.error=e}},qve=class extends Error{error;code;response;constructor({error:e,code:n,response:r}){super(e),this.code=n,this.error=e,this.response=r}};const xs=t=>!!t.id&&t.recovery_method==="privy-v2",zve=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","mfa_timeout","missing_or_invalid_mfa","mfa_verification_max_attempts_reached"];(function(t){return t.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",t.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",t.INVALID_DATA="invalid_data",t.LINKED_TO_ANOTHER_USER="linked_to_another_user",t.ALLOWLIST_REJECTED="allowlist_rejected",t.OAUTH_USER_DENIED="oauth_user_denied",t.UNKNOWN_AUTH_ERROR="unknown_auth_error",t.USER_EXITED_AUTH_FLOW="exited_auth_flow",t.MUST_BE_AUTHENTICATED="must_be_authenticated",t.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",t.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",t.CLIENT_REQUEST_TIMEOUT="client_request_timeout",t.INVALID_CREDENTIALS="invalid_credentials",t})({});var Zve=class extends Error{cause;privyErrorCode;constructor(e,n,r){super(e),n instanceof Error&&(this.cause=n),this.privyErrorCode=r}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},B3=class extends Error{type;constructor(e,n){super(n),this.type=e}},YB=class extends Zve{type="connector_error";constructor(e,n,r){super(e,n,r)}},w5=class extends Error{code;data;constructor(e,n,r){super(e),this.code=n,this.data=r}};const bd={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail
52:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Unlock your wallet and try again.",retryable:!0},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};function Kve(t){let e=t.type;return typeof e=="string"&&zve.includes(e)}function PE(t){return Kve(t)&&t.type==="wallet_not_on_device"}const hy=t=>/^0x[0-9a-fA-F]*$/.test(t),i8=t=>De.from(t,"utf8"),py=t=>`0x${t.toString("hex")}`;async function Gve(t,e){let n;if(e instanceof Uint8Array)n=Hd.base64.fromBytes(e);else{let i=y3e(e);if(i===void 0)throw new at({error:"Failed to prepare the payload for signing",code:"invalid_input"});n=Hd.base64.fromBytes(Hd.utf8.toBytes(i))}let{signature:r}=await t({message:n});return{signature:r}}const ML="privy-request-expiry",Yve=1800*1e3;async function ya(t,e,{wallet_id:n,headers:r,...i}){let a=t.getCompiledPath(d5,{params:{wallet_id:n}}),s=String(Date.now()+Yve),{signature:o}=await Gve(e,{version:1,url:a,method:d5.method,headers:{"privy-app-id":t.app.appId,[ML]:s},body:{...i}});if(Date.now()>Number(s))throw new at({error:"Wallet request expired before it could be sent. Please try again.",code:"embedded_wallet_request_expired"});return await t.fetchPrivyRoute(d5,{body:i,params:{wallet_id:n},headers:{"privy-authorization-signature":o,[ML]:s,...r??{}}})}function JB(t){return Vd(t)?Xve(t):Jve(t)}function Jve(t){return{from:t.from,to:t.to??void 0,nonce:Fr(t.nonce),chain_id:Fr(t.chainId),data:n6e(t.data),value:Fr(t.value),type:t.type,gas_limit:Fr(t.gasLimit),gas_price:Fr(t.gasPrice),max_fee_per_gas:Fr(t.maxFeePerGas),max_priority_fee_per_gas:Fr(t.maxPriorityFeePerGas)}}function Xve(t){return{type:Jm,from:t.from,chain_id:Fr(t.chainId),nonce:Fr(t.nonce),nonce_key:Fr(t.nonceKey),gas_limit:Fr(t.gasLimit),max_fee_per_gas:Fr(t.maxFeePerGas),max_priority_fee_per_gas:Fr(t.maxPriorityFeePerGas),fee_token:t.feeToken,valid_after:Fr(t.validAfter),valid_before:Fr(t.validBefore),fee_payer_signature:e6e(t.feePayerSignature),access_list:Qve(t.accessList),calls:t.calls.map(e=>({to:e.to,data:e.data,value:Fr(e.value)}))}}function Qve(t){if(t)return Array.isArray(t)?t.map(e=>"address"in e?{address:e.address,storage_keys:[...e.storageKeys]}:{address:e[0],storage_keys:[...e[1]]}):Object.entries(t).map(([e,n])=>({address:e,storage_keys:[...n]}))}function e6e(t){if(!t)return;let e=t6e(t);if(e!==0&&e!==1)throw Error("Tempo fee payer signatures require a valid yParity value");return{r:t.r,s:t.s,y_parity:e}}function t6e(t){if(t.yParity!==void 0)return t.yParity;if(t.v!==void 0)return Number(t.v)-27}function n6e(t){if(t!==void 0)return typeof t=="string"?hy(t)?t:py(i8(t)):py(De.from(Uint8Array.from(t)))}function Fr(t){if(typeof t=="number"||typeof t=="bigint")return`0x${BigInt(t).toString(16)}`;if(typeof t=="string"){if(hy(t))return t;throw Error(`Invalid quantity string: expected a hex-prefixed value (0xâ¦), got "${t}". Use a number, bigint, or hex string instead.`)}}function r6e(t){return typeof t=="string"&&(t=JSON.parse(t)),{types:t.types,primary_type:String(t.primaryType),domain:t.domain,message:t.message}}async function XB({context:t,account:e,rpcRequest:n}){switch(n.chainType){case"ethereum":return i6e({context:t,account:e,rpcRequest:n.request});case"solana":return a6e({context:t,account:e,rpcRequest:n.request})}}async function i6e({context:t,account:e,rpcRequest:n}){switch(n.method){case"personal_sign":{let[r]=n.params,i=await ya(t,t.signRequest,{chain_type:"ethereum",method:"personal_sign",wallet_id:e.id,params:r.startsWith("0x")?{message:r.slice(2),encoding:"hex"}:{message:r,encoding:"utf-8"}});if(i.method!=="personal_sign")throw Error("Unable to sign message");return{data:i.data.signature}}case"eth_signTransaction":{let[r]=n.params,i=await ya(t,t.signRequest,{chain_type:"ethereum",method:"eth_signTransaction",wallet_id:e.id,params:{transaction:JB(r)}});if(i.method!=="eth_signTransaction")throw Error("Unable to sign transaction");return{data:i.data.signed_transaction}}case"eth_signTypedData_v4":{let[,r]=n.params,i=await ya(t,t.signRequest,{chain_type:"ethereum",method:n.method,wallet_id:e.id,params:{typed_data:r6e(r)}});if(i.method!=="eth_signTypedData_v4")throw Error("Unable to sign typed data");return{data:i.data.signature}}case"eth_sign":{let[,r]=n.params,i=await ya(t,t.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:e.id,params:{hash:hy(r)?r:py(i8(r))}});if(i.method!=="secp256k1_sign")throw Error("Unable to sign message");return{data:i.data.signature}}case"secp256k1_sign":{let[r]=n.params,i=await ya(t,t.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:e.id,params:{hash:hy(r)?r:py(i8(r))}});if(i.method!=="secp256k1_sign")throw Error("Unable to sign message");return{data:i.data.signature}}case"csw_signUserOperation":case"eth_sendTransaction":case"eth_populateTransactionRequest":throw Error(`This wallet does not support the method: ${n.method}`)}}async function a6e({context:t,account:e,rpcRequest:n}){switch(n.method){case"signMessage":{let{message:r}=n.params,i=await ya(t,t.signRequest,{chain_type:"solana",method:"signMessage",wallet_id:e.id,params:{message:r,encoding:"base64"}});if(i.method!=="signMessage")throw Error("Unable to sign message");return{data:i.data.signature}}}}const NL=(t,e,n,r)=>{let i=Number(t),a=e.find(o=>o.id===i);if(!a)throw new YB(`Unsupported chainId ${t}`,4901);let s=o6e(a,n,r.appId);if(i===ou.id||i===op.id){let o=i===ou.id?ou:op;return ti({transport:Ii(s),chain:o})}return ti({transport:Ii(s),chain:a})};function s6e(t){return t===ou.id||t===op.id}const o6e=(t,e,n)=>{let r=t.id,i=Number(t.id),a;if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])a=t.rpcUrls.privyWalletOverride.http[0];
52else if(e.rpcUrls&&e.rpcUrls[i])a=e.rpcUrls[i];else if(t.rpcUrls.privy?.http[0]){let s=new URL(t.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",n),a=s.toString()}else a=t.rpcUrls.public?.http[0]?t.rpcUrls.public.http[0]:t.rpcUrls.default?.http[0];if(!a)throw new YB(`No RPC url found for ${r}`);return a};function c6e({currentRecoveryMethod:t,upgradeToRecoveryMethod:e}){switch(t){case"privy":case"user-passcode":case"recovery-encryption-key":return!0;case"icloud":case"google-drive":if(t===e)throw Error("Cannot upgrade to the existing cloud platform");return!0;default:throw Error("Unknown recovery method")}}const l6e=new Set(["eth_sign","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"]);var b5=class extends ll{_walletProxy;_privyInternal;_account;_entropyId;_entropyIdVerifier;_chainId;_chains;_onNeedsRecovery;_client;_appApi;constructor({walletProxy:e,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:a,chains:s,onNeedsRecovery:o,chainId:c=s[0].id,appApi:l}){super(),this._walletProxy=e,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=a,this._chainId=c,this._chains=s,this._onNeedsRecovery=o,this._client=NL(c,s,{rpcUrls:[]},{appId:l.appId}),this._appApi=l}async request(e){if(l6e.has(e.method))return this.handleIFrameRpc(e);switch(e.method){case"eth_accounts":case"eth_requestAccounts":return this._account.address?[this._account.address]:[];case"eth_chainId":return`0x${this._chainId.toString(16)}`;case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_signTransaction":{let n=e.params?.[0];return this.handleSignTransaction(n)}case"eth_sendTransaction":{let n=e.params?.[0];return this.handleSendTransaction(n)}case"eth_populateTransactionRequest":{let n=e.params?.[0];return this.handlePopulateTransaction(n)}default:return this.handleJsonRpc(e)}}ensureChainId(e){let n={chainId:this._chainId,...e};return this.internalSwitchEthereumChain(n.chainId),n}internalSwitchEthereumChain(e){!e||Number(e)===this._chainId||(this._chainId=Number(e),this._client=NL(this._chainId,this._chains,{rpcUrls:[]},{appId:this._privyInternal.appId}),this.emit("chainChanged",e))}async handlePopulateTransaction(e){let n=this.ensureChainId(e);if(Vd(n)){let s=KT(n),o=p3e(await this.requireTempoClient().prepareTransactionRequest({account:n.from??this._account.address,...s}),n.gasLimit);return{...n,...o,type:Jm}}let r=Yg(n),{gas:i,...a}=await this._client.prepareTransactionRequest({account:n.from??this._account.address,...r});return{...a,gasLimit:i,type:bB[a.type],authorizationList:n.authorizationList}}async handleSignTransaction(e){let n={...e};for(let r of Object.keys(n)){let i=n[r];typeof i=="bigint"&&(n[r]=An(i))}return Vd(n)&&(n.calls=n.calls.map(r=>({...r,value:typeof r.value=="bigint"?An(r.value):r.value}))),await this.handleIFrameRpc({method:"eth_signTransaction",params:[n]})}async handleSendTransaction(e){let n=await this.handlePopulateTransaction(e),r=await this.handleSignTransaction(n);return await this.handleJsonRpc({method:"eth_sendRawTransaction",params:[r]})}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");let n=e.params?.[0],r=this.ensureChainId(n);if(Vd(r)){let a=KT(r);return await this.requireTempoClient().estimateGas({account:r.from??this._account.address,...a})}let i=Yg(r);return await this._client.estimateGas({account:r.from??this._account.address,...i})}handleSwitchEthereumChain(e){if(!e.params||!Array.isArray(e.params))throw new w5(`Invalid params for ${e.method}`,4200);let n;if(typeof e.params[0]=="string")n=e.params[0];else if("chainId"in e.params[0]&&typeof e.params[0].chainId=="string")n=e.params[0].chainId;else throw new w5(`Invalid params for ${e.method}`,4200);this.internalSwitchEthereumChain(n)}async handleIFrameRpc(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address});let r=this._account;if(xs(r)){let{data:i}=await XB({context:{app:this._appApi,fetchPrivyRoute:(...a)=>this._privyInternal.fetch(...a),getCompiledPath:(...a)=>this._privyInternal.getPath(...a),signRequest:({message:a})=>this._walletProxy.signWithUserSigner({accessToken:n,message:a})},account:r,rpcRequest:{chainType:"ethereum",request:e}});return i}try{await this._walletProxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:n})}catch(i){let a=PE(i);
52if(a&&this._account.recovery_method==="privy")await this._walletProxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:n});else if(a&&this._onNeedsRecovery){let s;await new Promise(async(o,c)=>{s=setTimeout(()=>c(new at({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await this._onNeedsRecovery?.({recoveryMethod:this._account.recovery_method,onRecovered:()=>o(!0)})}).finally(()=>clearTimeout(s))}else throw i}return(await this._walletProxy.rpcWallet({accessToken:n,request:e,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:"ethereum"})).response.data}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:r}),new at({code:"embedded_wallet_request_error",error:r})}}async handleJsonRpc(e){return this._client.request(e)}requireTempoClient(){if(!s6e(this._chainId))throw new w5(`Cannot send a Tempo (type 118) transaction on chain ${this._chainId}`,4901);return this._client}toJSON(){return`PrivyEIP1193Provider { address: '${this._account.address}', chainId: ${this._chainId}, request: [Function] }`}};function a8(t){return"version"in t}function DL(t,e){let n=(a8(t)?t.message:t.compileMessage()).staticAccountKeys.find(r=>r.toBase58()===e);if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}var u6e=class{_proxy;_privyInternal;_app;_entropyId;_entropyIdVerifier;_account;_onNeedsRecovery;constructor({proxy:e,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:a,onNeedsRecovery:s,app:o}){this._proxy=e,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=a,this._onNeedsRecovery=s,this._app=o}async request(e){if(!await this._privyInternal.getAccessTokenInternal())throw new at({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});switch(e.method){case"signAndSendTransaction":return await this.handleSignAndSendTransaction(e);case"signTransaction":return await this.handleSignTransaction(e);default:return await this.handleIFrameRpc(e)}}get _publicKey(){return this._account.address}async connectAndRecover(e){if(this._account.recovery_method!=="privy-v2")try{await this._proxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e})}catch(n){let r=PE(n);if(r&&this._account.recovery_method==="privy")await this._proxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e});else if(r&&this._onNeedsRecovery){let i;await new Promise(async(a,s)=>{i=setTimeout(()=>s(new at({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await this._onNeedsRecovery?.({recoveryMethod:this._account.recovery_method,onRecovered:()=>a(!0)})}).finally(()=>clearTimeout(i))}else throw n}}async signMessageRpc(e,n){let r=this._account;if(xs(r)){let{data:i}=await XB({context:{app:this._app,fetchPrivyRoute:(...a)=>this._privyInternal.fetch(...a),getCompiledPath:(...a)=>this._privyInternal.getPath(...a),signRequest:({message:a})=>this._proxy.signWithUserSigner({accessToken:n,message:a})},account:r,rpcRequest:{chainType:"solana",request:e}});return{signature:i}}else return(await this._proxy.rpcWallet({accessToken:n,request:e,chainType:"solana",hdWalletIndex:this._account.wallet_index,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier})).response.data}async handleIFrameRpc(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(n),await this.signMessageRpc(e,n)}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:r}),new at({code:"embedded_wallet_request_error",error:r})}}async handleSignAndSendTransaction(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(n);let{transaction:r,connection:i,options:a}=e.params,s=DL(r,this._account.address),o=a8(r)?De.from(r.message.serialize()):r.serializeMessage(),{signature:c}=await this.signMessageRpc({method:"signMessage",params:{message:o.toString("base64")}},n);return r.addSignature(s,De.from(c,"base64")),{signature:await i.sendRawTransaction(r.serialize(),a)}}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:r}),new at({code:"embedded_wallet_request_error",error:r})}}async handleSignTransaction(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(n);let{transaction:r}=e.params,i=DL(r,this._account.address),a=a8(r)?De.from(r.message.serialize()):r.serializeMessage(),{signature:s}=await this.signMessageRpc({method:"signMessage",params:{message:a.toString("base64")}},n);return r.addSignature(i,De.from(s,"base64")),{signedTransaction:r}}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.wallet_index,error:r}),new at({code:"embedded_wallet_request_error",error:r})}}
52toJSON(){return`PrivyEmbeddedSolanaProvider { address: '${this._account.address}', request: [Function] }`}},d6e=class{_proxy;_privyInternal;_account;_entropyId;_entropyIdVerifier;constructor({proxy:e,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:a}){this._proxy=e,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=a}async sign({message:e}){return await this.request({method:"sign",params:{message:new TextDecoder("utf8").decode(e)}})}async signTransaction({psbt:e}){return await this.request({method:"signTransaction",params:{psbt:e}})}async request(e){if(xs(this._account))throw new at({code:"unsupported_wallet_type",error:"Bitcoin wallet providers are only supported for on-device execution and this app uses TEE execution. Use the useSignRawHash hook from @privy-io/expo/extended-chains to sign over a hash with this wallet. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(!await this._privyInternal.getAccessTokenInternal())throw new at({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return this.handleIFrameRpc(e)}async handleIFrameRpc(e){try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing access token. User must be authenticated.");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),(await this._proxy.rpcWallet({accessToken:n,request:e,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:this._account.chain_type})).response.data}catch(n){console.error(n);let r=n instanceof Error?n.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:r}),new at({code:"embedded_wallet_request_error",error:r})}}toJSON(){return`PrivyEmbeddedBitcoinProvider { address: '${this._account.address}', request: [Function] }`}},f6e=class{callbacks={};enqueue(e,n){this.callbacks[e]=n}flush(e){let n=Object.values(this.callbacks);this.callbacks={};for(let{reject:r}of n)r(e)}dequeue(e,n){let r=this.callbacks[n];if(!r)return console.warn(`[Privy] No callback found for "${e}" (id: ${n})`),null;switch(delete this.callbacks[n],e){case"privy:iframe:ready":return r;case"privy:wallets:create":return r;case"privy:user-signer:sign":return r;case"privy:wallets:add":return r;case"privy:wallets:set-recovery":return r;case"privy:wallets:connect":return r;case"privy:wallets:recover":return r;case"privy:wallets:rpc":return r;case"privy:wallet:create":return r;case"privy:wallet:connect":return r;case"privy:wallet:recover":return r;case"privy:wallet:rpc":return r;case"privy:solana-wallet:create":return r;case"privy:solana-wallet:create-additional":return r;case"privy:solana-wallet:connect":return r;case"privy:solana-wallet:recover":return r;case"privy:solana-wallet:rpc":return r;case"privy:delegated-actions:consent":return r;case"privy:mfa:verify":return r;case"privy:mfa:init-enrollment":return r;case"privy:mfa:submit-enrollment":return r;case"privy:mfa:unenroll":return r;case"privy:mfa:clear":return r;case"privy:auth:unlink-passkey":return r;default:throw Error(`invalid wallet event type ${e}`)}}};async function h6e(t,e,n,r,i=!1,a,s){let o=i,c=async u=>o?(u===+!i?r():n.current?.reject(new B3("missing_or_invalid_mfa","MFA verification failed, retry.")),await t(await new Promise((d,f)=>{e.current={resolve:d,reject:f},setTimeout(()=>{let h=new B3("mfa_timeout","Timed out waiting for MFA code");n.current?.reject(h),f(h)},s)}))):await t(),l=null;for(let u=0;u<a;u++)try{l=await c(u),n.current?.resolve(void 0);break}catch(d){if(d.type==="missing_or_invalid_mfa")o=!0;else throw n.current?.resolve(void 0),d}if(l===null){let u=new B3("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw n.current?.reject(u),u}return l}function p6e(t){return t.error!==void 0}const g6e=function(t){return()=>`id-${t++}`}(0),y6e=(t,e)=>typeof e=="bigint"?e.toString():e,m6e=(t,e)=>`${t}${JSON.stringify(e,y6e)}`,no=async(t,{ms:e,msg:n})=>{let r,i=new Promise((a,s)=>{r=setTimeout(()=>{s(Error(n))},e??15e3)});try{return await Promise.race([t,i])}finally{r!==void 0&&clearTimeout(r)}},_5=new f6e;var FL=class{ready;_waitForReadyPromise=null;cache;_embeddedWalletMessagePoster;mfa;constructor(e,n){this.ready=!1,this.cache=new Map,this._embeddedWalletMessagePoster=e,this.mfa=n}invokeWithMfa(e,n){return no(h6e(r=>no(this.waitForReady().then(()=>e(r)),{msg:n.timeoutMsg,ms:n.timeoutMs}),this.mfa.rootPromise,this.mfa.submitPromise,()=>this.mfa.emit("mfaRequired"),n.mfaAlwaysRequired??!1,4,3e5),{msg:"Operation reached timeout: MFA verification",ms:126e4})}reload(){return this.ready=!1,this._waitForReadyPromise=null,_5.flush(Error("Embedded wallet WebView was reloaded")),this.cache.clear(),this._embeddedWalletMessagePoster.reload()}
52onBackground(){this.ready=!1}ping(e=15e3){return no(this.invoke("privy:iframe:ready",{}),{msg:"Ping reached timeout",ms:e})}create(e){return no(this.waitForReady().then(()=>this.invoke("privy:wallet:create",e)),{msg:"Operation reached timeout: create"})}rpc(e){return this.invokeWithMfa(n=>this.invoke("privy:wallet:rpc",{...n,...e}),{timeoutMsg:"Operation reached timeout: rpc"})}createSolana(e){return this.invokeWithMfa(n=>this.invoke("privy:solana-wallet:create",{...n,...e}),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}createAdditionalSolana(e){return no(this.waitForReady().then(()=>this.invoke("privy:solana-wallet:create-additional",e)),{msg:"Operation reached timeout: create"})}solanaRpc(e){return this.invokeWithMfa(n=>this.invoke("privy:solana-wallet:rpc",{...n,...e}),{timeoutMsg:"Operation reached timeout: solana-rpc"})}delegateWallets(e){return this.invokeWithMfa(n=>this.invoke("privy:delegated-actions:consent",{...n,...e}),{timeoutMsg:"Operation reached timeout: delegated-actions:consent"})}verifyMfa(e){return this.invokeWithMfa(n=>this.invoke("privy:mfa:verify",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:verify",mfaAlwaysRequired:!0})}initEnrollMfa(e){return this.invokeWithMfa(n=>this.invoke("privy:mfa:init-enrollment",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:init-enrollment"})}submitEnrollMfa(e){return e.method==="passkey"?this.invokeWithMfa(n=>this.invoke("privy:mfa:submit-enrollment",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:submit-enrollment"}):no(this.waitForReady().then(()=>this.invoke("privy:mfa:submit-enrollment",e)),{msg:"Operation reached timeout: mfa:submit-enrollment"})}unenrollMfa(e){return this.invokeWithMfa(n=>this.invoke("privy:mfa:unenroll",{...n,...e}),{timeoutMsg:"Operation reached timeout: mfa:unenroll",mfaAlwaysRequired:!0})}unlinkPasskey(e){return this.invokeWithMfa(n=>this.invoke("privy:auth:unlink-passkey",{...n,...e}),{timeoutMsg:"Operation reached timeout: auth:unlink-passkey",mfaAlwaysRequired:!0})}clearMfa(e){return no(this.waitForReady().then(()=>this.invoke("privy:mfa:clear",e)),{msg:"Operation reached timeout: mfa:clear"})}createWallet(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:create",{...n,...e}),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}signWithUserSigner(e){return this.invokeWithMfa(n=>this.invoke("privy:user-signer:sign",{...n,...e}),{timeoutMsg:"Operation reached timeout: user-signer:sign"})}addWallet(e){return no(this.waitForReady().then(()=>this.invoke("privy:wallets:add",e)),{msg:"Operation reached timeout: wallets:add"})}setRecovery(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:set-recovery",{...n,...e}),{timeoutMsg:"Operation reached timeout: wallets:set-recovery",timeoutMs:6e4})}connect(e){return no(this.waitForReady().then(()=>this.invoke("privy:wallets:connect",e)),{msg:"Operation reached timeout: wallets:connect"})}recover(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:recover",{...n,...e}),{timeoutMsg:"Operation reached timeout: wallets:recover",timeoutMs:6e4})}rpcWallet(e){return this.invokeWithMfa(n=>this.invoke("privy:wallets:rpc",{...n,...e}),{timeoutMsg:"Operation reached timeout: wallets:rpc"})}handleEmbeddedWalletMessages(e){if(!e.event.startsWith("privy:")){console.warn(`Unsupported event type: ${e.event}`);return}let n=_5.dequeue(e.event,e.id);if(n)return p6e(e)?n.reject(new B3(e.error.type,e.error.message)):n.resolve(e.data)}waitForReady(){return this.ready?Promise.resolve():(this._waitForReadyPromise||=new Promise((e,n)=>{(async()=>{for(let r=0;r<100&&!this.ready;r++)this.invoke("privy:iframe:ready",{}).then(()=>{this.ready=!0,this._waitForReadyPromise=null,e()}).catch(()=>{}),await new Promise(i=>setTimeout(i,150));this.ready||(this._waitForReadyPromise=null,n(Error("Embedded wallet WebView failed to become ready")))})()}),this._waitForReadyPromise)}invoke(e,n){let r=m6e(e,n);if(e==="privy:wallet:create"||e==="privy:solana-wallet:create"){let a=this.cache.get(r);if(a)return a}let i=new Promise((a,s)=>{let o=g6e();_5.enqueue(o,{resolve:a,reject:s}),this._embeddedWalletMessagePoster.postMessage(JSON.stringify({id:o,event:e,data:n}),"*")}).finally(()=>{this.cache.delete(r)});return this.cache.set(r,i),i}};async function s8(t,{request:e,headers:n}
52){return await t.fetchPrivyRoute(yB,{body:e,headers:n})}async function C5({context:t,chainType:e,idempotencyKey:n}){return{wallet:await s8(t,{request:{chain_type:e,owner_id:void 0},headers:n?{"privy-idempotency-key":n}:void 0})}}var v6e=class{_privyInternal;_proxy;_chains=Array.from(p0);_mfa;_mfaPromises;_appApi;constructor(e,n,r,i,a,s){if(this._privyInternal=e,n&&(this._proxy=new FL(n,a),i.setProxy(this._proxy)),r){let o=wB(r);this._chains=o}this._mfa=i,this._mfaPromises=a,this._appApi=s}setMessagePoster(e){this._proxy=new FL(e,this._mfaPromises),this._mfa.setProxy(this._proxy)}async signWithUserSigner(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw new at({error:"User must be logged in to sign a message with the user signer",code:"user_signer_sign_error"});let{signature:r}=await this._proxy.signWithUserSigner({accessToken:n,message:e.message});return{signature:r}}async add(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(this._privyInternal.config?.embedded_wallet_config.mode==="user-controlled-server-wallets-only")await C5({context:{app:this._appApi,fetchPrivyRoute:(...r)=>this._privyInternal.fetch(...r),getCompiledPath:(...r)=>this._privyInternal.getPath(...r)},chainType:e.chainType});else{let r=await this._privyInternal.getAccessTokenInternal();if(!r)throw new at({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.addWallet({accessToken:r,...e})}let{user:n}=await this._privyInternal.refreshSession();return{user:n}}async getBitcoinProvider({wallet:e,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:a,recoverySecretOverride:s}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return xs(e)||await this._load({entropyId:n,entropyIdVerifier:r,wallet:e,recoveryPassword:i,recoveryAccessToken:a,recoverySecretOverride:s}),new d6e({account:e,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:n,entropyIdVerifier:r})}async create({password:e,recoveryMethod:n,recoveryToken:r,recoveryKey:i,recoverySecretOverride:a,iCloudRecordNameOverride:s,solanaAccount:o,skipCallbacks:c,idempotencyKey:l}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(this._privyInternal.config?.embedded_wallet_config.mode==="user-controlled-server-wallets-only"){if(n&&!n.startsWith("privy"))throw new at({error:"User-controlled server wallets do not support custom recovery methods",code:"embedded_wallet_creation_error"});await C5({context:{app:this._appApi,fetchPrivyRoute:(...u)=>this._privyInternal.fetch(...u),getCompiledPath:(...u)=>this._privyInternal.getPath(...u)},chainType:"ethereum",idempotencyKey:l})}else{let u;if(u=n||(e?"user-passcode":"privy"),e&&typeof e!="string")throw Error("Invalid recovery password, must be a string");if(u==="privy"&&this._privyInternal.config?.embedded_wallet_config.require_user_password_on_create)throw Error("Password not provided yet is required by App configuration");let d=await this._privyInternal.getAccessTokenInternal();if(!d)throw Error("User must be logged in to create an embedded wallet");let{address:f}=await this._proxy.create({accessToken:d,recoveryMethod:u,recoveryKey:i,recoveryPassword:e,recoveryAccessToken:r,recoverySecretOverride:a,iCloudRecordNameOverride:s,solanaAddress:o?.address});if(!f)throw Error("Failed to create wallet")}return await this._privyInternal.refreshSession(c)}async createSolana(e){if(!this._proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});if(this._privyInternal.config?.embedded_wallet_config.mode==="user-controlled-server-wallets-only")await C5({context:{app:this._appApi,fetchPrivyRoute:(...n)=>this._privyInternal.fetch(...n),getCompiledPath:(...n)=>this._privyInternal.getPath(...n)},chainType:"solana",idempotencyKey:e?.idempotencyKey});else{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw new at({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});e?.ethereumAccount&&await this.getProvider(e.ethereumAccount);let{publicKey:r}=await this._proxy.createSolana({accessToken:n,ethereumAddress:e?.ethereumAccount?.address});if(!r)throw new at({error:"Failed to create wallet",code:"embedded_wallet_creation_error"})}return await this._privyInternal.refreshSession()}async delegateWallets({delegatedWallets:e,rootWallet:n}){if(!this._proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});let r=await this._privyInternal.getAccessTokenInternal();if(!r)throw new at({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.delegateWallets({accessToken:r,delegatedWallets:e,rootWallet:n})}async getProvider(e,n,r,i,a){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");
52return xs(e)||await this._load({wallet:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",recoveryPassword:n,recoveryKey:a,recoveryAccessToken:r,recoverySecretOverride:i}),new b5({account:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi})}async getEthereumProvider({wallet:e,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:a,recoverySecretOverride:s,recoveryKey:o,onNeedsRecovery:c}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return xs(e)||(!c||i||a||s||o)&&await this._load({entropyId:n,entropyIdVerifier:r,wallet:e,recoveryPassword:i,recoveryAccessToken:a,recoverySecretOverride:s,recoveryKey:o}),new b5({account:e,entropyId:n,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,onNeedsRecovery:c,appApi:this._appApi})}async getSolanaProvider(e,n,r,i,a,s,o){if(!this._proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return xs(e)||(!o||i||a||s)&&await this._load({wallet:e,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:a,recoverySecretOverride:s}),new u6e({account:e,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:n,entropyIdVerifier:r,onNeedsRecovery:o,app:this._appApi})}async setRecovery(e){let{wallet:n,...r}=e;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(xs(n))throw new at({error:"This wallet does not support setting recovery methods",code:"unsupported_recovery_method"});c6e({currentRecoveryMethod:n.recovery_method,upgradeToRecoveryMethod:r.recoveryMethod==="icloud-native"?"icloud":r.recoveryMethod}),await this._load(n.chain_type==="solana"?{wallet:n,entropyId:n.address,entropyIdVerifier:"solana-address-ver
52ifier"}:{wallet:n,entropyId:n.address,entropyIdVerifier:"ethereum-address-verifier"});let i=await this._privyInternal.getAccessTokenInternal();if(!i)throw Error("User must be logged in to interact with embedded wallets");let a=n.recovery_method;this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_started",{address:n.address,target_recovery_method:r.recoveryMethod,existing_recovery_method:a});try{let s;if(r.recoveryMethod==="user-passcode")s={recoveryMethod:"user-passcode",recoveryPassword:r.password};else if(r.recoveryMethod==="google-drive")s={recoveryMethod:"google-drive",recoveryAccessToken:r.recoveryAccessToken};else if(r.recoveryMethod==="icloud")s={recoveryMethod:"icloud",recoveryAccessToken:r.recoveryAccessToken};else if(r.recoveryMethod==="icloud-native")s={recoveryMethod:"icloud-native",iCloudRecordNameOverride:r.iCloudRecordNameOverride,recoverySecretOverride:r.recoverySecretOverride};else if(r.recoveryMethod==="recovery-encryption-key")s={recoveryMethod:"recovery-encryption-key",recoveryKey:r.recoveryKey};else if(r.recoveryMethod==="privy")s={recoveryMethod:"privy"};else throw Error(`Unknown recovery method: ${r.recoveryMethod}`);await this._proxy.setRecovery({accessToken:i,entropyId:n.address,entropyIdVerifier:n.chain_type==="solana"?"solana-address-ver
52ifier":"ethereum-address-verifier",...s}),this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_completed",{address:n.address,target_recovery_method:r.recoveryMethod,existing_recovery_method:a});let{user:o}=await this._privyInternal.refreshSession();return{user:o,provider:n.chain_type==="ethereum"?new b5({account:n,entropyId:n.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi}):null}}catch(s){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_failed",{address:n.address,recovery_method:n.recovery_method,error:s instanceof Error?s.message:"Unable to recover wallet"}),s}}getURL(){let e=new URL(`${this._privyInternal.baseUrl}/apps/${this._privyInternal.appId}/embedded-wallets`);return this._privyInternal.caid&&e.searchParams.append("caid",this._privyInternal.caid),this._privyInternal.appClientId&&e.searchParams.append("client_id",this._privyInternal.appClientId),e.href}get chains(){return this._chains}onMessage(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return this._proxy.handleEmbeddedWalletMessages(e)}reload(){if(!this._proxy){this._privyInternal.logger.warn("Attempted to reload proxy before initialized");return}this._proxy.reload()}onBackground(){this._proxy?.onBackground()}async ping(e){try{if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return await this._proxy.ping(e),!0}catch(n){return this._privyInternal.logger.debug(n),!1}}async _load({entropyId:e,entropyIdVerifier:n,wallet:r,recoveryPassword:i,recoveryKey:a,recoveryAccessToken:s,recoverySecretOverride:o}){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let c=await this._privyInternal.getAccessTokenInternal();if(!c)throw Error("User must be logged in to interact with embedded wallets");try{return await this._proxy.connect({accessToken:c,entropyId:e,entropyIdVerifier:n}),e}catch(l){if(PE(l)){try{if(r.recovery_method==="privy"){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let u=await this._proxy.recover({accessToken:c,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),u.entropyId}if(r.recovery_method==="user-passcode"&&i){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let u=await this._proxy.recover({accessToken:c,recoveryPassword:i,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),u.entropyId}if(["google-drive","icloud"].includes(r.recovery_method)&&s){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let u=await this._proxy.recover({accessToken:c,recoveryAccessToken:s,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),u.entropyId}if(r.recovery_method==="icloud"&&o){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:"icloud-native"});let u=await this._proxy.recover({accessToken:c,recoverySecretOverride:o,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:"icloud-native"}),u.entropyId}if(r.recovery_method==="recovery-encryption-key"&&a){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let u=await this._proxy.recover({accessToken:c,recoveryKey:a,entropyId:e,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.re
52covery_method}),u.entropyId}}catch(u){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_failed",{address:r.address,recovery_method:r.recovery_method,error:u instanceof Error?u.message:`Unable to recover wallet: ${e}`}),u}throw l}else throw l}}},w6e=class extends ll{rootPromise;submitPromise;constructor(){super(),this.rootPromise={current:null},this.submitPromise={current:null}}};const A1="privy:active-user",E5="privy:saved-users",Tf=t=>t?`privy:${t}:token`:"privy:token",Lf=t=>t?`privy:${t}:pat`:"privy:pat",kf=t=>t?`privy:${t}:refresh_token`:"privy:refresh_token",$f=t=>t?`privy:${t}:id-token`:"privy:id-token",S5=t=>t?`privy-${t}-token`:"privy-token",A5=t=>t?`privy-${t}-refresh-token`:"privy-refresh-token",x5=t=>t?`privy-${t}-id-token`:"privy-id-token",Pf=t=>t?`privy-${t}-session`:"privy-session",Rf=Promise.allSettled.bind(Promise)??(t=>Promise.all(t.map(e=>e.then(n=>({status:"fulfilled",value:n})).catch(n=>({status:"rejected",reason:n}))))),b6e=["storage_cleared","token_cleared","refresh_token_cleared","identity_token_cleared","token_stored","refresh_token_stored","identity_token_stored","oauth_tokens_granted","error_storing_tokens"];var _6e=class extends ll{static events=b6e;_storage;_isUsingServerCookies=!1;GUEST_CREDENTIAL_STORAGE_KEY;_setStoredUsers;_hasEmittedStoredUsers=!1;constructor(e){super(),this._storage=e.storage,this.GUEST_CREDENTIAL_STORAGE_KEY=`privy:guest:${e.appId}`,this._setStoredUsers=e.setStoredUsers}set isUsingServerCookies(e){this._isUsingServerCookies=e}setStoredUsersCallback(e){this._setStoredUsers=e,this.getSavedUserIds().then(n=>{this._hasEmittedStoredUsers||this._setStoredUsers?.({users:n.map(r=>({id:r}))})})}async getCustomerAccessToken(){let e=await this.getActiveUserId(),n=await this._storage.get(Tf(e));try{return typeof n=="string"?new Rl(n).value:null}catch(r){return console.error(r),await this.destroyLocalState({reason:"getToken_error"}),null}}async getPrivyAccessToken(){let e=await this.getActiveUserId(),n=await this._storage.get(Lf(e));try{return typeof n=="string"?new Rl(n).value:null}catch(r){return console.error(r),await this.destroyLocalState({reason:"getToken_error"}),null}}async getRefreshToken(){let e=await this.getActiveUserId(),n=await this._storage.get(kf(e));return typeof n=="string"?n:null}async getIdentityToken(){let e=await this.getActiveUserId(),n=await this._storage.get($f(e));return typeof n=="string"?n:null}async mightHaveServerCookies(){try{let e=await this.getActiveUserId(),n=Qt.get(Pf(e));if(n!==void 0&&n.length>0)return!0;let r=Qt.get(Pf(null));return r!==void 0&&r.length>0}catch(e){console.error(e)}return!1}async hasRefreshCredentials(e,n){return await this.mightHaveServerCookies()||typeof e=="string"&&typeof n=="string"}tokenIsActive(e){if(!e)return!1;let n=Rl.parse(e);return n!==null&&!n.isExpired(30)}async destroyLocalState(e){let n=await this.getActiveUserId(),r=[this._storage.del(Tf(null)),this._storage.del(Lf(null)),this._storage.del(kf(null)),this._storage.del($f(null)),this._storage.del(this.GUEST_CREDENTIAL_STORAGE_KEY),this._storage.del(A1)];n&&r.push(this._storage.del(Tf(n)),this._storage.del(Lf(n)),this._storage.del(kf(n)),this._storage.del($f(n)),this.removeSavedUserId(n)),await Rf(r),Qt.remove(S5(null)),Qt.remove(A5(null)),Qt.remove(x5(null)),Qt.remove(Pf(null)),n&&(Qt.remove(S5(n)),Qt.remove(A5(n)),Qt.remove(x5(n)),Qt.remove(Pf(n))),e?.reason&&this.emit("storage_cleared",{reason:e.reason})}async storeCustomerAccessToken(e){let n=await this.getActiveUserId();await this.storeCustomerAccessTokenForUser(n,e)}async storeCustomerAccessTokenForUser(e,n){let r=Tf(e),i=S5(e);if(typeof n=="string"){let a=await this._storage.get(r);if(await this._storage.put(r,n),!this._isUsingServerCookies){let s=Rl.parse(n)?.expiration;Qt.set(i,n,{sameSite:"Strict",secure:!0,expires:s?new Date(s*1e3):void 0})}a!==n&&this.emit("token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let a=await this._storage.get(r);await this._storage.del(r),Qt.remove(i),a!==null&&this.emit("token_cleared",{reason:"set_with_non_string_value"})}}async storePrivyAccessToken(e){let n=await this.getActiveUserId();await this.storePrivyAccessTokenForUser(n,e)}async storePrivyAccessTokenForUser(e,n){let r=Lf(e);typeof n=="string"?await this._storage.put(r,n):await this._storage.del(r)}async storeRefreshTokenForUser(e,n){let r=kf(e),i=A5(e),a=Pf(e);typeof n=="string"?(await this._storage.put(r,n),this._isUsingServerCookies||(Qt.set(a,"t",{sameSite:"Str
52ict",secure:!0,expires:30}),Qt.set(i,n,{sameSite:"Strict",secure:!0,expires:30})),this.emit("refresh_token_stored",{cookiesEnabled:this._isUsingServerCookies})):(await this._storage.del(r),Qt.remove(i),Qt.remove(a),this.emit("refresh_token_cleared",{reason:"set_with_non_string_value"}))}async updateWithTokensResponse(e){let n=e.user.id,r=(await Rf([this.storeCustomerAccessTokenForUser(n,e.token),this.storePrivyAccessTokenForUser(n,e.privy_access_token),this.storeRefreshTokenForUser(n,e.refresh_token),this.storeIdentityTokenForUser(n,e.identity_token)])).filter(s=>s.status==="rejected");if(r.length>0){this.emit("error_storing_tokens",r.map(s=>String(s.reason)).join(", "));return}let i=(await Rf([this.storeCustomerAccessTokenForUser(null,e.token),this.storePrivyAccessTokenForUser(null,e.privy_access_token),this.storeRefreshTokenForUser(null,e.refresh_token),this.storeIdentityTokenForUser(null,e.identity_token)])).filter(s=>s.status==="rejected");if(i.length>0){this.emit("error_storing_tokens",i.map(s=>String(s.reason)).join(", "));return}await this.storeActiveUserId(n);let a=(await Rf([this.processOAuthTokens(e.oauth_tokens)])).filter(s=>s.status==="rejected");a.length>0&&this.emit("error_storing_tokens",a.map(s=>String(s.reason)).join(", "))}async backfillLegacySession(){if(await this.getActiveUserId())return;let[e,n,r,i]=await Promise.all([this._storage.get(Tf(null)),this._storage.get(Lf(null)),this._storage.get(kf(null)),this._storage.get($f(null))]);if(typeof e!="string"||typeof r!="string")return;let a=Rl.parse(e)?.subject;if(typeof a!="string"||a.length===0)return;let s=[this.storeCustomerAccessTokenForUser(a,e),this.storeRefreshTokenForUser(a,r)];typeof n=="string"&&s.push(this.storePrivyAccessTokenForUser(a,n)),typeof i=="string"&&s.push(this.storeIdentityTokenForUser(a,i));let o=(await Rf(s)).filter(c=>c.status==="rejected");if(o.length>0){this.emit("error_storing_tokens",o.map(c=>String(c.reason)).join(", "));return}await this.storeActiveUserId(a)}async processOAuthTokens(e){e&&this.emit("oauth_tokens_granted",e)}async storeIdentityToken(e){let n=await this.getActiveUserId();await this.storeIdentityTokenForUser(n,e)}async storeIdentityTokenForUser(e,n){let r=$f(e),i=x5(e);if(typeof n=="string"){let a=await this._storage.get(r);if(await this._storage.put(r,n),!this._isUsingServerCookies){let s=Rl.parse(n)?.expiration;Qt.set(i,n,{sameSite:"Strict",secure:!0,expires:s?new Date(s*1e3):void 0})}a!==n&&this.emit("identity_token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let a=await this._storage.get(r);await this._storage.del(r),Qt.remove(i),a!==null&&this.emit("identity_token_cleared",{reason:"set_with_non_string_value"})}}async getOrCreateGuestCredential(){let e=await this._storage.get(this.GUEST_CREDENTIAL_STORAGE_KEY);if(e&&typeof e=="string")return e;let n=mu(crypto.getRandomValues(new Uint8Array(32)));return await this._storage.put(this.GUEST_CREDENTIAL_STORAGE_KEY,n),n}async getActiveUserId(){let e=await this._storage.get(A1);return typeof e=="string"?e:null}
52async storeActiveUserId(e){let n=await this.getSavedUserIds();await this.storeSavedUserIds([...n,e]),await this._storage.put(A1,e)}async getSavedUserIds(){let e=await this._storage.get(E5);if(typeof e!="string")return[];try{let n=JSON.parse(e),r=Array.isArray(n)?n.filter(i=>typeof i=="string"):[];return[...new Set(r)]}catch{return[]}}async storeSavedUserIds(e){let n=[...new Set(e)];n.length>0?await this._storage.put(E5,JSON.stringify(n)):await this._storage.del(E5),this._setStoredUsers&&(this._hasEmittedStoredUsers=!0,this._setStoredUsers({users:n.map(r=>({id:r}))}))}async removeSavedUserId(e){let n=await this.getSavedUserIds();await this.storeSavedUserIds(n.filter(r=>r!==e))}async switchActiveUserId(e){if(!(await this.getSavedUserIds()).includes(e))throw new at({code:"invalid_input",error:"Cannot switch active user because the user ID is not saved on this device"});await this._storage.put(A1,e)}};const UL=t=>{let e=new AbortController;return setTimeout(()=>e.abort(),t),e.signal};function C6e(t){let e=new URLSearchParams;for(let n in t)t[n]!=null&&e.append(n,String(t[n]));return Array.from(e).length?"?"+e.toString():""}const x1=()=>{},ac={NONE:-1/0,ERROR:1,WARN:2,INFO:3,DEBUG:1/0},E6e=({level:t,logger:e})=>({get level(){return t},error:ac[t]>=ac.ERROR?e.error:x1,warn:ac[t]>=ac.WARN?e.warn:x1,info:ac[t]>=ac.INFO?e.info:x1,debug:ac[t]>=ac.DEBUG?e.debug:x1}),I5="privy:caid";var S6e=class{baseUrl;callbacks;appId;appClientId;logger;session;_config;_analyticsId;_storage;_sdkVersion="js-sdk-core:0.69.1";_fetch;nativeAppIdentifier;_crypto;isMultiUserModeEnabled;_cache=new Map;constructor(e){this.logger=E6e({level:e.logger?.level??e.logLevel??"ERROR",logger:e.logger??console}),this._storage=e.storage,this._crypto=e.crypto,this._analyticsId=null,this._getOrGenerateClientAnalyticsId(),this.baseUrl=e.baseUrl??"https://auth.privy.io",this.appId=e.appId,this.appClientId=e.appClientId,this._sdkVersion=e.sdkVersion??this._sdkVersion,this.callbacks=e.callbacks,this.nativeAppIdentifier=e.nativeAppIdentifier,this.isMultiUserModeEnabled=e.isMultiUserModeEnabled,this.session=new _6e({storage:this._storage,isUsingServerCookies:!1,appId:e.appId,setStoredUsers:e.callbacks?.setStoredUsers}),this._fetch=EB(globalThis.fetch,{retries:3,retryDelay:n=>3**n*500,retryOn:[408,409,425,500,502,503,504]}),this.session.on("error_storing_tokens",n=>{this.createAnalyticsEvent("error_updating_tokens_in_storage",{reason:n})})}setCallbacks(e){this.callbacks={...this.callbacks,...e},this.session.setStoredUsersCallback(this.callbacks?.setStoredUsers)}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){if(this.isReady){this.callbacks?.setIsReady?.(!0);return}if(!await this.isStorageAccessible())throw new at({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),this._config?.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),this.isMultiUserModeEnabled&&await this.session.backfillLegacySession(),this.callbacks?.setIsReady?.(!0),this._sdkVersion.startsWith("react-auth:")||this.createAnalyticsEvent("sdk_initialize",{})}getPath(e,{params:n,query:r}){return`${this.baseUrl}${g1e(e.path,n)}${C6e(r)}`}async fetchWithoutAuthentication(e,n){if(!this.isMultiUserModeEnabled)throw new at({code:"invalid_input",error:'Unauthenticated requests require sessions.mode to be set to "multi-user"'});return this.fetch(e,{...n,onRequest:this._beforeRequestWithoutAuth.bind(this)})}async fetchForLogin(e,n){return this.isMultiUserModeEnabled?this.fetchWithoutAuthentication(e,n):this.fetch(e,n)}async fetch(e,{body:n,params:r,query:i,headers:a,onRequest:s=this._beforeRequest.bind(this)}){let o=new Request(this.getPath(e,{params:r,query:i}),{method:e.method,body:JSON.stringify(n),headers:a}),c=await s(o),l=await this._fetch(o,c),u=await l.json();if(l.status>299)throw new v5({...u,status:l.status});return u}async _beforeRequestWithoutInitialize(e){let n=await this.session.getPrivyAccessToken()??await this.session.getCustomerAccessToken(),r=new Headers(e.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-client",this._sdkVersion),n&&r.set("Authorization",`Bearer ${n}`),r.set("Content-Type","application/json"),r.set("Accept","application/json");let i=await this._getOrGenerateClientAnalyticsId();return i&&r.set("privy-ca-id",i),this.nativeAppIdentifier&&r.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:UL(2e4),headers:r,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequestWithoutAuth(e){await this._initialize();let n=new Headers(e.headers);n.set("privy-app-id",this.appId),this.appClientId&&n.set("privy-client-id",this.appClientId),n.set("privy-client",this._sdkVersion),n.set("Content-Type","application/json"),n.set("Accept","application/json");let r=await this._getOrGenerateClientAnalyticsId();return r&&n.set("privy-ca-id",r),this.nativeAppIdentifier&&n.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:UL(2e4),headers:n}}async _beforeRequest(e){return await this._initialize(),await this.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch(x0e,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(I5);if(typeof e=="string"&&e.length>0)return this._analyticsId=e,e}catch(e){this.logger.error("Unable to load clientId",e)}try{this._analyticsId=this._crypto.randomUUID()}catch(e){this.logger.error("Unable to generate uuidv4",e)}if(this._analyticsId){try{await this._storage.put(I5,this._analyticsId)}catch(e){this.logger.error(`Unable to store clientId: ${this._analyticsId}`,e)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(I5)}catch(e){this.logger.error("Unable to delete clientId",e)}}async createAnalyticsEvent(e,n){try{await this.fetch(A0e,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:n},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch{}}async refreshSession(e=!1){if(!await this.isStorageAccessible())throw new at({code:"storage_error",error:"Unable to access storage"});let n=await this.session.getRefreshToken()??void 0,r=n??"key",i=this._cache.get(r);if(i)return this.logger.debug("[privy:refresh] found in-flight session refresh request, deduping"),await i;let a=this._refreshSession(n,e);this._cache.set(r,a);try{return await a}finally{this._cache.delete(r)}}async _refreshSession(e,n){let r=await this.session.getCustomerAccessToken();if(!await this.session.hasRefreshCredentials(r,e??null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new v5({code:Zw.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage",status:401});try{this.logger.debug(`[privy:refresh] fetching: ${ZT.path}`);let i=await this.fetch(ZT,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),a=i.session_update_action;return this.logger.debug(`[privy:refresh] response: ${a}`),a==="set"&&(await this.session.updateWithTokensResponse(i),this.logger.debug("[privy:refresh] tokens stored")),a==="clear"&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),!n&&this.callbacks?.setUser?.(null)),a==="ignore"&&(i.token&&(await this.session.storeCustomerAccessToken(i.token),this.logger.debug("[privy:refresh] token stored (CAT)")),i.privy_access_token&&(await this.session.storePrivyAccessToken(i.privy_access_token),this.logger.debug("[privy:refresh] token stored (PAT)")),i.identity_token&&(this.logger.debug("[privy:refresh] token stored (IDT)"),await this.session.storeIdentityToken(i.identity_token))),this.logger.debug("[privy:refresh] returning response"),
52!n&&this.callbacks?.setUser?.(i.user),i}catch(i){throw this.logger.debug(`[privy:refresh] error: ${i.message??"unknown error"}`),i instanceof v5&&i.code===Zw.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),!n&&this.callbacks?.setUser?.(null)),i}}async getAccessToken(){let[e,n]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(e&&!this.session.tokenIsActive(e)&&await this.session.hasRefreshCredentials(e,n)){let r=await this.refreshSession(),i=await this.session.getCustomerAccessToken();return r.token||this.logger.debug("[privy:getAccessToken] expected token received null"),r.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),i===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),r.token??i}return e&&!this.session.tokenIsActive(e)?(this.logger.debug("[privy:getAccessToken] unable to refresh inactive token"),this.callbacks?.setUser?.(null),await this.session.destroyLocalState(),null):e}async getAccessTokenInternal(){let e=await this.getAccessToken();return await this.session.getPrivyAccessToken()??e}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e=`privy:__storage__test-${this._crypto.randomUUID()}`,n="blobby";await this._storage.put(e,n);let r=await this._storage.get(e);return await this._storage.del(e),r===n}catch(e){return this.logger.error(e),!1}}},A6e=class{_privyInternal;_embedded;_isMultiUserModeEnabled;constructor(e,n,r){this._privyInternal=e,this._embedded=n,this._isMultiUserModeEnabled=r}async get(){let{user:e}=await this._privyInternal.refreshSession();return{user:e}}async acceptTerms(){return{user:await this._privyInternal.fetch(x1e,{})}}async switchActiveUser(e){if(!this._isMultiUserModeEnabled)throw new at({code:"invalid_input",error:'User switching requires sessions.mode to be set to "multi-user"'});await this._privyInternal.session.switchActiveUserId(e.userId);try{this._embedded.reload();let{user:n}=await this._privyInternal.refreshSession(!0);if(n.id!==e.userId)throw new at({code:"invalid_input",error:"Cannot switch active user because the refreshed user did not match the requested user ID"});return this._privyInternal.callbacks?.setUser?.(n),{user:n}}catch(n){throw await this._privyInternal.session.destroyLocalState(),this._privyInternal.callbacks?.setUser?.(null),n}}};const QB=t=>t.type==="wallet"&&t.wallet_client_type==="privy"&&t.connector_type==="embedded",RE=t=>t?t.linked_accounts.filter(QB).filter(e=>e.chain_type==="ethereum").sort((e,n)=>e.wallet_index-n.wallet_index):[],o8=t=>RE(t).find(e=>e.wallet_index===0)??null,OE=t=>t?t.linked_accounts.filter(QB).filter(e=>e.chain_type==="solana").sort((e,n)=>e.wallet_index-n.wallet_index):[],eV=t=>OE(t).find(e=>e.wallet_index===0)??null,x6e=(t,e)=>e==="off"||RE(t).length>0?!1:t.linked_accounts.filter(n=>n.type==="wallet"&&n.chain_type==="ethereum").length>0?e==="all-users":!0,I6e=(t,e)=>e==="off"||OE(t).length>0?!1:t.linked_accounts.filter(n=>n.type==="wallet"&&n.chain_type==="solana").length>0?e==="all-users":!0,T5=(t,e)=>({...t,is_new_user:e.is_new_user,oauth_tokens:e.oauth_tokens}),_a=async(t,e,n)=>{let r=x6e(e.user,n?.ethereum?.createOnLogin??"off"),i=I6e(e.user,n?.solana?.createOnLogin??"off");if(r&&i){let a=await t.create({recoveryMethod:"privy",skipCallbacks:!0}),s=await t.createSolana({ethereumAccount:o8(a.user)??void 0});return T5(s,e)}if(r){let a=await t.create({recoveryMethod:"privy",solanaAccount:eV(e.user)??void 0});return T5(a,e)}if(i){let a=await t.createSolana({ethereumAccount:o8(e.user)??void 0});return T5(a,e)}return e};var T6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async syncWithToken(e,n,r){let i=await this._privyInternal.fetchForLogin(k0e,{body:{token:e,mode:r}});await this._privyInternal.session.updateWithTokensResponse(i);let a=await _a(this._embedded,i,n?.embedded);return this._privyInternal.callbacks?.setUser?.(a.user),a}async linkWithToken(e){await this._privyInternal.fetch($0e,{body:{token:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},L6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async sendCode(e,n){return this._privyInternal.fetch(Q0e,{body:{email:e,token:n}})}async loginWithCode(e,n,r,i){let a=await this._privyInternal.fetchForLogin(X0e,{body:{email:e,code:n,mode:r}});
52await this._privyInternal.session.updateWithTokensResponse(a);let s=await _a(this._embedded,a,i?.embedded);return this._privyInternal.callbacks?.setUser?.(s.user),s}async linkWithCode(e,n){await this._privyInternal.fetch(e1e,{body:{email:e,code:n}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}async updateEmail({oldEmailAddress:e,newEmailAddress:n,code:r}){await this._privyInternal.fetch(n1e,{body:{oldAddress:e,newAddress:n,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(t1e,{body:{address:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},k6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async initializeAuth({relyingParty:e,redirectUrl:n,token:r}){return await this._privyInternal.fetch(P0e,{body:{relying_party:e,redirect_url:n,token:r}})}async getFarcasterStatus({channel_token:e}){return await this._privyInternal.fetch(N0e,{headers:{"farcaster-channel-token":e}})}async authenticate({channel_token:e,message:n,signature:r,fid:i,mode:a},s){let o=await this._privyInternal.fetchForLogin(R0e,{body:{channel_token:e,message:n,signature:r,fid:i,mode:a}});await this._privyInternal.session.updateWithTokensResponse(o);let c=await _a(this._embedded,o,s?.embedded);return this._privyInternal.callbacks?.setUser?.(c.user),c}async link({channel_token:e,message:n,signature:r,fid:i}){await this._privyInternal.fetch(O0e,{body:{channel_token:e,message:n,signature:r,fid:i}});let a=await this._privyInternal.refreshSession();return{user:a.user,identity_token:a.identity_token}}async unlink({fid:e}){await this._privyInternal.fetch(M0e,{body:{fid:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},$6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async initializeAuth(){return await this._privyInternal.fetch(D0e,{body:{}})}async authenticate({message:e,signature:n,fid:r},i){let a=await this._privyInternal.fetchForLogin(F0e,{body:{message:e,signature:n,fid:r}});await this._privyInternal.session.updateWithTokensResponse(a);let s=await _a(this._embedded,a,i?.embedded);return this._privyInternal.callbacks?.setUser?.(s.user),s}},P6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async create(e){let n=await this._privyInternal.session.getOrCreateGuestCredential(),r=await this._privyInternal.fetch(U0e,{body:{guest_credential:n}});await this._privyInternal.session.updateWithTokensResponse(r);let i=await _a(this._embedded,r,e?.embedded);return this._privyInternal.callbacks?.setUser?.(i.user),i}};const $c="privy:state_code",Pc="privy:code_verifier";async function R6e(t,e){let n=await e("SHA-256",new TextEncoder().encode(t));return new Uint8Array(n)}function O6e(t){return crypto.getRandomValues(new Uint8Array(t))}function ME(){return mu(O6e(36))}function tV(){return ME()}async function nV({codeVerifier:t,method:e="S256",digest:n}){if(e=="S256"){let r=await R6e(t,n);return mu(r)}else return t}var M6e=class{_privyInternal;_storage;_crypto;_embedded;constructor(e,n,r,i){this._privyInternal=e,this._embedded=n,this._storage=r,this._crypto=i}async generateURL(e,n){let r=ME(),i=tV(),a=await nV({codeVerifier:r,digest:this._crypto.digest});return await Promise.all([this._storage.put(Pc,r),this._storage.put($c,i)]),this._privyInternal.fetchForLogin(H0e,{body:{redirect_to:n,provider:e,code_challenge:a,state_code:i}})}async loginWithCode(e,n,r,i,a,s){let[o,c]=await Promise.all([this._storage.get(Pc),this._storage.get($c)]);if(c!==n)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:r,storedStateCode:c??"",returnedStateCode:n??""}),new at({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let l=await this._privyInternal.fetchForLogin(V0e,{body:{authorization_code:e,code_type:i,state_code:c,code_verifier:o,mode:a}});await this._privyInternal.session.updateWithTokensResponse(l);let u=await _a(this._embedded,l,s?.embedded);return await Promise.all([this._storage.del(Pc),this._storage.del($c)]),this._privyInternal.callbacks?.setUser?.(u.user),u}async linkWithCode(e,n,r,i){let[a,s]=await Promise.all([this._storage.get(Pc),this._storage.get($c)]);if(s!==n)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:r,storedStateCode:s??"",returnedStateCode:n??""}),new at({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let o=await this._privyInternal.fetch(W0e,{body:{authorization_code:e,code_type:i,state_code:s,code_verifier:a}});await this._privyInternal.session.processOAuthTokens(o.oauth_tokens);let c=await this._privyInternal.refreshSession();return await Promise.all([this._storage.del(Pc),this._storage.del($c)]),{user:c.user,identity_token:c.identity_token}}async unlink(e,n){await this._privyInternal.fetch(q0e,{body:{provider:e,subject:n}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}},N6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async generateRegistrationOptions(e){return await this._privyInternal.fetch(J0e,{body:{relying_party:e}})}async generateAuthenticationOptions(e){return await this._privyInternal.fetch(G0e,{body:{relying_party:e}})}async generateSignupOptions(e){return await this._privyInternal.fetch(Y0e,{body:{relying_party:e}})}async loginWithPasskey(e,n,r,i){let a=await this._privyInternal.fetchForLogin(Z0e,{body:{relying_party:r,challenge:n,authenticator_response:this._transformAuthenticationResponseToSnakeCase(e)}});
52await this._privyInternal.session.updateWithTokensResponse(a);let s=await _a(this._embedded,a,i?.embedded);return this._privyInternal.callbacks?.setUser?.(s.user),s}async signupWithPasskey(e,n,r){let i=await this._privyInternal.fetchForLogin(K0e,{body:{relying_party:n,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});await this._privyInternal.session.updateWithTokensResponse(i);let a=await _a(this._embedded,i,r?.embedded);return this._privyInternal.callbacks?.setUser?.(a.user),a}async linkWithPasskey(e,n){await this._privyInternal.fetch(z0e,{body:{relying_party:n,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}_transformRegistrationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData||void 0,transports:e.response.transports||void 0,public_key:e.response.publicKey||void 0,public_key_algorithm:e.response.publicKeyAlgorithm||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}_transformAuthenticationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_id:e.rawId,response:{signature:e.response.signature,client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,user_handle:e.response.userHandle||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}},D6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async sendCode(e,n){return this._privyInternal.fetch(i1e,{body:{phoneNumber:e,token:n}})}async loginWithCode(e,n,r,i){let a=await this._privyInternal.fetchForLogin(r1e,{body:{phoneNumber:e,code:n,mode:r}});await this._privyInternal.session.updateWithTokensResponse(a);let s=await _a(this._embedded,a,i?.embedded);return this._privyInternal.callbacks?.setUser?.(s.user),s}async linkWithCode(e,n){await this._privyInternal.fetch(a1e,{body:{phoneNumber:e,code:n}});let r=await this._privyInternal.refreshSession();return{user:r.user,identity_token:r.identity_token}}async updatePhone({oldPhoneNumber:e,newPhoneNumber:n,code:r}){await this._privyInternal.fetch(o1e,{body:{old_phone_number:e,new_phone_number:n,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(s1e,{body:{phoneNumber:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},F6e=class{_privyInternal;_embedded;_wallet=void 0;_preparedMessage;constructor(e,n){this._privyInternal=e,this._embedded=n}async unlinkWallet(e){await this._privyInternal.fetch(_1e,{body:{address:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}async linkWithSiwe(e,n,r){let i=n||this._wallet,a=r||this._preparedMessage;if(!i)throw Error("A wallet must be provided in the init step or as an argument to linkWithSiwe");if(!a)throw Error("A message must be generated and signed before being used to link a wallet to privy");await this._privyInternal.fetch(w1e,{body:{message:a,signature:e,chainId:i.chainId,walletClientType:i.walletClientType??null,connectorType:i.connectorType??null}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async loginWithSiwe(e,n,r,i,a){let s=n||this._wallet,o=r||this._preparedMessage;if(!s)throw Error("A wallet must be provided in the init step or as an argument to loginWithSiwe");if(!o)throw Error("A message must be generated and signed before being used to login to privy with a wallet");let c=await this._privyInternal.fetchForLogin(v1e,{body:{signature:e,message:o,chainId:s.chainId,walletClientType:s.walletClientType??null,connectorType:s.connectorType??null,mode:i}});await this._privyInternal.session.updateWithTokensResponse(c);let l=await _a(this._embedded,c,a?.embedded);return this._privyInternal.callbacks?.setUser?.(l.user),l}async init(e,n,r){this._wallet=e;let{nonce:i}=await this._privyInternal.fetch(gB,{body:{address:e.address}}),a=U6e({chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:new Date().toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:n,nonce:i,uri:r});return this._preparedMessage=a,{nonce:i,message:a}}};function U6e(t){return`${t.domain} wants you to sign in with your Ethereum account: 53${t.address} 54 55${t.statement} 56 57URI: ${t.uri} 58Version: 1 59Chain ID: ${t.chainId} 60Nonce: ${t.nonce} 61Issued At: ${t.issuedAt} 62Resources: 63- https://privy.io`}var j6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async unlink({address:e}){await this._privyInternal.fetch(A1e,{body:{address:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}async link({message:e,signature:n,walletClientType:r,connectorType:i}){await this._privyInternal.fetch(S1e,{body:{message:e,signature:n,walletClientType:r??null,connectorType:i??null}});let a=await this._privyInternal.refreshSession();return{user:a.user,identity_token:a.identity_token}}async login({mode:e,message:n,signature:r,walletClientType:i,connectorType:a,opts:s}){let o=await this._privyInternal.fetchForLogin(E1e,{body:{signature:r,message:n,walletClientType:i??null,connectorType:a??null,mode:e}});await this._privyInternal.session.updateWithTokensResponse(o);let c=await _a(this._embedded,o,s?.embedded);return this._privyInternal.callbacks?.setUser?.(c.user),c}async fetchNonce({address:e}){let{nonce:n}=await this._privyInternal.fetch(C1e,{body:{address:e}});return{nonce:n}}},B6e=class{_privyInternal;constructor(e){this._privyInternal=e}async link(e,n,r,i){await this._privyInternal.fetch(b1e,{body:{message:e,signature:n,smart_wallet_type:r,smart_wallet_version:i}});let a=await this._privyInternal.refreshSession();return{user:a.user,identity_token:a.identity_token}}async init(e){let{nonce:n}=await this._privyInternal.fetch(gB,{body:{address:e.address}});return{nonce:n,message:V6e({chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:new Date().toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:"privy.io",uri:"https://auth.privy.io",nonce:n})}}};function V6e(t){return`${t.domain} wants you to sign in with your Ethereum account: 64${t.address} 65 66${t.statement} 67 68URI: ${t.uri} 69Version: 1 70Chain ID: ${t.chainId} 71Nonce: ${t.nonce} 72Issued At: ${t.issuedAt} 73Resources: 74- https://privy.io`}var H6e=class{_privyInternal;_embedded;constructor(e,n){this._privyInternal=e,this._embedded=n}async authenticate({telegramWebAppData:e,telegramAuthResult:n,captchaToken:r,mode:i="login-or-sign-up"},a){let s=await this._privyInternal.fetchForLogin(I1e,{body:{telegram_web_app_data:e,telegram_auth_result:n,captcha_token:r,mode:i}});await this._privyInternal.session.updateWithTokensResponse(s);let o=await _a(this._embedded,s,a?.embedded);return this._privyInternal.callbacks?.setUser?.(o.user),o}async link({telegramWebAppData:e,telegramAuthResult:n,captchaToken:r}){await this._privyInternal.fetch(T1e,{body:{telegram_web_app_data:e,telegram_auth_result:n,captcha_token:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink({telegramUserId:e}){await this._privyInternal.fetch(L1e,{body:{telegram_user_id:e}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}},W6e=class{_privyInternal;_mfa;customProvider;phone;email;oauth;siwe;siws;smartWallet;passkey;farcaster;farcasterV2;guest;telegram;constructor(e,n,r,i,a){this._privyInternal=e,this._mfa=a,this.customProvider=new T6e(this._privyInternal,n),this.phone=new D6e(this._privyInternal,n),this.email=new L6e(this._privyInternal,n),this.oauth=new M6e(this._privyInternal,n,r,i),this.guest=new P6e(this._privyInternal,n),this.siwe=new F6e(this._privyInternal,n),this.siws=new j6e(this._privyInternal,n),this.smartWallet=new B6e(this._privyInternal),this.passkey=new N6e(this._privyInternal,n),this.farcaster=new k6e(this._privyInternal,n),this.farcasterV2=new $6e(this._privyInternal,n),this.telegram=new H6e(this._privyInternal,n)}async logout(e){try{let n=await this._privyInternal.session.getRefreshToken()??void 0;await this._privyInternal.fetch(y1e,{body:{refresh_token:n}})}catch{console.warn("Error destroying session")}await Promise.all([this._privyInternal.session.destroyLocalState({reason:"logout"}),this._privyInternal.destroyClientAnalyticsId(),e?.userId&&this._mfa.clearMfa({userId:e.userId})]),this._privyInternal.callbacks?.setUser?.(null)}},q6e=class{_privyInternal;constructor(e){this._privyInternal=e}async initOnRampSession(e){return await this._privyInternal.fetch(I0e,{body:e})}async getStatus(e){return await this._privyInternal.fetch(T0e,{query:{partnerUserId:e}})}};const z6e={prod:{url:"https://api.moonpay.com/v1",key:"pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL"},sandbox:{url:"https://api.moonpay.com/v1",key:"pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI"}},Z6e=new Set([Ks.id,Go.id,Jo.id,Gs.id,Yo.id,wE.id,Ou.id]),K6e=new Set([Ks.id,Go.id,Ru.id,Jo.id,Gs.id,Yo.id]);function Nit(t,e){switch(e){case"native-currency":return Z6e.has(t);case"USDC":return K6e.has(t);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}}function Dit(t,e){switch(t){case Go.id:return e==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case Yo.id:return e==="native-currency"?"AVAX_CCHAIN":"USDC_CCHAIN";case Jo.id:return e==="native-currency"?"ETH_BASE":"USDC_BASE";case wE.id:return"CELO_CELO";case Gs.id:return e==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case Ou.id:return"MON_MON";case Ks.id:return e==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${t} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}var G6e=class{_privyInternal;constructor(e){this._privyInternal=e}async sign(e){return await this._privyInternal.fetch(k1e,{body:e})}async getTransactionStatus({transactionId:e,useSandbox:n}){let{url:r,key:i}=z6e[n?"sandbox":"prod"],a=await EB(fetch,{retries:3,retryDelay:500})(`${r}/transactions/ext/${e}?apiKey=${i}`);if(!a.ok)throw new qve({error:`Failed to fetch transaction status for Transaction ${e}`,code:"failed_to_fetch_moonpay_transaction_status",response:a});let s=await a.json();return Array.isArray(s)?s.at(0):void 0}},Y6e=class{moonpay;coinbase;constructor(e){this.moonpay=new G6e(e),this.coinbase=new q6e(e)}},J6e=class{_privyInternal;constructor(e){this._privyInternal=e}async generateAuthenticationOptions(e){return await this._privyInternal.fetch(j0e,{body:e})}},X6e=class{_privyInternal;constructor(e){this._privyInternal=e}async sendCode(e){return await this._privyInternal.fetch(B0e,{body:e})}},Q6e=class{privyInternal;proxy;sms;passkey;constructor(e,n){this.proxy=n,this.privyInternal=e,this.sms=new X6e(e),this.passkey=new J6e(e)}setProxy(e){this.proxy=e}async getAccessTokenInternal(){let e=await this.privyInternal.getAccessTokenInternal();if(!e)throw new at({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return e}async verifyMfa(){if(!this.proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.verifyMfa({accessToken:await this.getAccessTokenInternal()})}async initEnrollMfa(e){if(!this.proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.initEnrollMfa({...e,accessToken:await this.getAccessTokenInternal()})}async submitEnrollMfa(e){if(!this.proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let n=await this.proxy.submitEnrollMfa({...e,accessToken:await this.getAccessTokenInternal()}),r=await this.privyInternal.refreshSession();if(r.user.mfa_methods.length===0)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}return n}async unenrollMfa(e){if(!this.proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let n=await this.proxy.unenrollMfa({method:e,accessToken:await this.getAccessTokenInternal()}),r=await this.privyInternal.refreshSession();if(r.user.mfa_methods.length===0)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}return n}async unlinkPasskey({credentialId:e,removeAsMfa:n}){if(!this.proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});await this.proxy.unlinkPasskey({credentialId:e,removeAsMfa:n,accessToken:await this.getAccessTokenInternal()});let r=await this.privyInternal.refreshSession();if(r.user.mfa_methods.length===0)try{await this.proxy.clearMfa({userId:r.user.id})}catch{}}async clearMfa(e){if(!this.proxy)throw new at({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.clearMfa(e)}},e5e=class{_privyInternal;constructor(e){this._privyInternal=e}async init(e){return this._privyInternal.fetch(d1e,{body:{client_type:e}})}async getICloudConfiguration(e){return this._privyInternal.fetch(f1e,{body:{client_type:e}})}},t5e=class{_privyInternal;_storage;_crypto;constructor(e,n,r){this._privyInternal=e,this._storage=n,this._crypto=r}async generateURL(e){let n=ME(),r=tV(),i=await nV({codeVerifier:n,digest:this._crypto.digest});return await Promise.all([this._storage.put(Pc,n),this._storage.put($c,r)]),this._privyInternal.fetch(l1e,{body:{redirect_to:e,code_challenge:i,state_code:r}})}async authorize(e,n){let[r,i]=await Promise.all([this._storage.get(Pc),this._storage.get($c)]);if(i!==n)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"recovery_oauth",storedStateCode:i??"",returnedStateCode:n??""}),new at({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let a=await this._privyInternal.fetch(u1e,{body:{authorization_code:e,state_code:i,code_verifier:r}});return await Promise.all([this._storage.del(Pc),this._storage.del($c)]),a}},n5e=class{_privyInternal;auth;icloudAuth;constructor(e,n,r){this._privyInternal=e,this.auth=new t5e(this._privyInternal,n,r),this.icloudAuth=new e5e(this._privyInternal)}async getRecoveryKeyMaterial(e,n){return this._privyInternal.fetch(c1e,{body:{chain_type:n},params:{address:e}})}},r5e=class{auth;user;embeddedWallet;recovery;mfa;app;mfaPromises;funding;delegated;crossApp;isMultiUserModeEnabled;_privyInternal;constructor({clientId:e,sessions:n,...r}){let i=Bve(r.crypto);this.isMultiUserModeEnabled=n?.mode==="multi-user",this._privyInternal=new S6e({...r,appClientId:e,crypto:i,isMultiUserModeEnabled:this.isMultiUserModeEnabled}
74),this.mfa=new Q6e(this._privyInternal),this.mfaPromises=new w6e,this.app=new Vve(this._privyInternal),this.embeddedWallet=new v6e(this._privyInternal,r.embeddedWalletMessagePoster,r.supportedChains,this.mfa,this.mfaPromises,this.app),this.user=new A6e(this._privyInternal,this.embeddedWallet,n?.mode==="multi-user"),this.auth=new W6e(this._privyInternal,this.embeddedWallet,r.storage,i,this.mfa),this.recovery=new n5e(this._privyInternal,r.storage,i),this.funding=new Y6e(this._privyInternal),this.delegated=new Wve(this._privyInternal),this.crossApp=new Hve(this._privyInternal,r.storage)}async initialize(){await this._privyInternal._initialize()}setMessagePoster(e){this.embeddedWallet.setMessagePoster(e)}addOAuthTokensListener(e){return this._privyInternal.session.on("oauth_tokens_granted",e),{unsubscribe:()=>{this._privyInternal.session.removeListener("oauth_tokens_granted",e)}}}setCallbacks(e){this._privyInternal.setCallbacks(e)}getAccessToken(){return this._privyInternal.getAccessToken()}getIdentityToken(){return this._privyInternal.getIdentityToken()}getCompiledPath(e,n){return this._privyInternal.getPath(e,n)}async fetchPrivyRoute(e,n){return this._privyInternal.fetch(e,n)}get logger(){return this._privyInternal.logger}};const Zit=(t,e)=>Fve(String(t),e),Kit=(t,e)=>`+${KB(e)} ${t}`,Git=t=>`*${t.replaceAll("-","").slice(-4)}`,Yit=t=>new Ip(t),Jit=Uve().map(t=>({code:t,callCode:KB(t)})),Xit=t=>{let e=jve(t,sge)?.formatInternational();return e?.substring(e.indexOf(" ")+1)},Qit=t=>{let e=new Ip;e.input(t);let n=e.getCountry()||"US",r=e.getCallingCode()||"1";return{countryCode:n,phone:t.replace("+"+r,"")}},eat=(t,e=!0)=>t.reduce((n,r)=>({...n,[r]:e}),{}),tat={[Ks.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[CE.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[Ru.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[bE.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Gs.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[_E.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Jo.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[vE.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[Yo.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[mE.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Go.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[yE.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};async function nat(t,e){let n=`${t}-auto-${e==="ethereum"?"eth":"sol"}`,r=new TextEncoder().encode(n),i=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(i)).map(a=>a.toString(16).padStart(2,"0")).join("")}const i5e=new Set([Ks.id,Jo.id,Ru.id,Gs.id,Go.id,Yo.id,Ou.id]),a
745e=new Set([Ks.id,Jo.id,Gs.id,Ru.id,Go.id,Yo.id,Ou.id]),s5e={buy:"CARD",send:"CRYPTO_ACCOUNT"},o5e={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1",MON:"92aa538f-b005-45cc-a237-71d6466f54d9"};Ks.id+"",Jo.id+"",Ru.id+"",Gs.id+"",Go.id+"",Yo.id+"",Ou.id+"";function c5e(t){return t.startsWith(".")?`0${t}`:t}function rat({appId:t,input:e,amount:n,blockchain:r,asset:i,experience:a}){let s=new URL("https://pay.coinbase.com/buy/select-asset");return s.searchParams.set("appId",e.app_id),s.searchParams.set("sessionToken",e.session_token),s.searchParams.set("endPartnerName",`privy:${t}`),s.searchParams.set("defaultExperience",a),s.searchParams.set("presetCryptoAmount",c5e(n)),s.searchParams.set("defaultNetwork",r),s.searchParams.set("defaultPaymentMethod",s5e[a]),s.searchParams.set("defaultAsset",o5e[i]),s.searchParams.set("partnerUserId",e.partner_user_id),{url:s}}const iat=(t,e)=>{switch(e){case"native-currency":return i5e.has(t);case"USDC":return a5e.has(t);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function aat(t,e){return t===Gs.id?"POL":t===Ou.id?"MON":"ETH"}const l5e="solana offchain",jL=1232;function u5e(t){let e=Hd.utf8.toBytes(t),n=new Uint8Array(32);return n.set(e.slice(0,32)),n}function d5e({message:t,signerPublicKey:e,domain:n}){let r=Hd.utf8.toBytes(t);if(e.length!==32)throw Error("Signer public key must be 32 bytes");let i=85+r.length;if(i>jL)throw Error(`Combined message length (${i}) exceeds maximum (${jL})`);let a=u5e(n),s=new Uint8Array(i),o=0;s[o]=255,o+=1;let c=Hd.utf8.toBytes(l5e);return s.set(c,o),o+=c.length,s[o]=0,o+=1,s.set(a,o),o+=32,s[o]=1,o+=1,s[o]=1,o+=1,s.set(e,o),o+=32,s[o]=r.length&255,s[o+1]=r.length>>8&255,o+=2,s.set(r,o),s}const f5e=["privy"],h5e=["metamask","phantom","brave_wallet","rainbow"],p5e=["coinbase_wallet"],g5e="metamask.trust.safe.rainbow.uniswap.zerion.argent.spot.omni.cryptocom.blockchain.safepal.bitget_wallet.zengo.1inch.binance.exodus.mew_wallet.alphawallet.keyring_pro.mathwallet.unstoppable.obvious.ambire.internet_money_wallet.coin98.abc_wallet.arculus_wallet.haha.cling_wallet.broearn.copiosa.burrito_wallet.enjin_wallet.plasma_wallet.avacus.bee.pitaka.pltwallet.minerva.kryptogo.prema.slingshot.kriptonio.timeless.secux.bitizen.blocto.safemoon".split("."),y5e=["unknown"];[...h5e,...p5e,...g5e,...f5e,...y5e];function sat(t){return t?`${t.slice(0,5)}â¦${t.slice(-4)}`:""}function oat({wei:t,precision:e=3}){return parseFloat(pQ(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function cat({amount:t,decimals:e}){return rC(BigInt(t),e)}const rV=t=>[...RE(t),...OE(t)],m5e=(t,e)=>t.imported?t:o8(e)??eV(e),v5e=t=>async({address:e,chainType:n})=>{let{user:r}=await t.user.get();if(!r)throw new at({code:"delegated_actions_before_logged_in",error:"Must be logged in to delegate wallets"});if(n!=="solana"&&n!=="ethereum")throw new at({code:"unsupported_chain_type",error:"Only Solana and Ethereum embedded wallets are supported for delegation and revocation."});let i=rV(r).find(o=>o.chain_type===n&&o.address===e);if(!i)throw new at({code:"delegated_actions_wallet_not_found",error:"Address to delegate is not associated with current user."});if(xs(i))throw new at({code:"unsupported_wallet_type",error:"useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(i.delegated)return{user:r};let a=m5e(i,r);if(!a)throw new at({code:"delegated_actions_wallet_not_found",error:"Address to delegate is not associated with current user."});await t.embeddedWallet.delegateWallets({rootWallet:{address:a.address,chainType:a.chain_type,imported:a.imported},delegatedWallets:[{address:i.address,chainType:i.chain_type,walletIndex:i.wallet_index}]});let{user:s}=await t.user.get();return{user:s}},w5e=t=>async()=>{let{user:e}=await t.user.get();if(!e)throw new at({code:"delegated_actions_before_logged_in",error:"Must be logged in to revoke delegated
74wallets"});let n=rV(e);if(n.some(xs))throw new at({code:"unsupported_wallet_type",error:"revokeWallets is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to manage server side access on behalf of your users. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(n.every(i=>!i.delegated))throw new at({code:"delegated_actions_no_wallet_to_revoke",error:"User has no delegated wallets to revoke."});await t.delegated.revoke();let{user:r}=await t.user.get();return{user:r}};nv({delegateWallet:()=>v5e,revokeWallets:()=>w5e});const b5e=({client:t,openAuthSession:e})=>async({providerAppId:n,redirectUrl:r})=>{let i=`privy:${n}`,{url:a}=await t.auth.oauth.generateURL(i,r),s=await e(a,r),o=s.privy_oauth_state,c=s.privy_oauth_code;if(!o||!c)throw new at({code:"login_with_oauth_returned_with_invalid_credentials",error:"Auth session oauth returned invalid credentials"});let l=await t.auth.oauth.loginWithCode(c,o,i),u=l.oauth_tokens;return u&&await t.crossApp.updateOnCrossAppAuthentication(n,u),l},iV=({client:t,openAuthSession:e})=>async({providerAppId:n,redirectUrl:r})=>{let i=`privy:${n}`,{url:a}=await t.auth.oauth.generateURL(i,r),s=await e(a,r),o=s.privy_oauth_state,c=s.privy_oauth_code;if(!o||!c)throw new at({code:"login_with_oauth_returned_with_invalid_credentials",error:"Auth session oauth returned invalid credentials"});let l=t.addOAuthTokensListener(d=>{t.crossApp.updateOnCrossAppAuthentication(n,d)}),{user:u}=await t.auth.oauth.linkWithCode(c,o,i);return l.unsubscribe(),u};function NE(t,e){return t.linked_accounts.filter(n=>n.type==="cross_app").flatMap(n=>n.smart_wallets).some(n=>n.address===e)}const _5e=(t,e)=>t.linked_accounts.filter(n=>n.type==="cross_app").find(({embedded_wallets:n,smart_wallets:r})=>[...n,...r].some(i=>i.address===e)),C5e=({client:t,openAuthSession:e})=>{let n=iV({client:t,openAuthSession:e});return async({providerAppId:r,redirectUrl:i})=>await t.crossApp.getProviderAccessToken(r)||(await n({providerAppId:r,redirectUrl:i}),await t.crossApp.getProviderAccessToken(r))},DE=({client:t,openAuthSession:e})=>{let n=C5e({client:t,openAuthSession:e});return async({user:r,request:i,redirectUrl:a,address:s})=>{let o=_5e(r,s);if(!o)throw new at({code:"cross_app_invalid_wallet",error:"Cannot operate with this wallet address"});let c=o.provider_app_id,{connections:l}=await t.crossApp.getCrossAppConnections(),u=l.find(y=>y.provider_app_id===c);if(!u)throw new at({code:"cross_app_invalid_app",error:"Invalid connected app"});if(u.read_only)throw new at({code:"cross_app_read_only",error:"Cannot transact against a read-only provider app"});let d=await n({providerAppId:c,redirectUrl:a});if(!d)throw new at({code:"cross_app_request_error",error:"Wallet operations require a valid token"});let f={content:{request:{request:i}},timestamp:Date.now(),callbackUrl:a},h=new URL(`${u.provider_app_custom_api_url}/oauth/transact`);h.searchParams.set("communicationMode","redirect"),h.searchParams.set("token",d),h.searchParams.set("request",JSON.stringify(f));let{privy_cross_app_type:p,privy_cross_app_payload:g}=await e(h.href,a);if(!p||!g)throw new at({code:"cross_app_request_error",error:"Cross app request returned an invalid result"});if(p==="PRIVY_CROSS_APP_ACTION_ERROR")throw new at({code:"cross_app_request_error",error:g});if(p!=="PRIVY_CROSS_APP_ACTION_RESPONSE")throw new at({code:"cross_app_request_error",error:"Cross app request returned an invalid result"});return{result:g}}};function FE(t){if(!t)throw new at({code:"attempted_cross_app_request_before_logged_in",error:"Must be logged in to sign messages with a cross-app wallet"})}const E5e=({client:t,openAuthSession:e})=>{let n=DE({client:t,openAuthSession:e});return async({user:r,address:i,message:a,redirectUrl:s})=>{FE(r);let o={method:NE(r,i)?"privy_signSmartWalletMessage":"personal_sign",params:[a,i]},{result:c}=await n({user:r,request:o,address:i,redirectUrl:s});return{signature:c}}};function S5e(t){let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=t.types.EIP712Domain??Object.entries(t.domain??{}).map(([i,a])=>{if(a!=null&&typeof i=="string"&&i in e)return{name:i,type:e[i]}}).filter(i=>!!i),r={...t.types};return r.EIP712Domain=n,{...t,types:r}}
74const A5e=({client:t,openAuthSession:e})=>{let n=DE({client:t,openAuthSession:e});return async({user:r,typedData:i,address:a,redirectUrl:s})=>{FE(r);let o={method:NE(r,a)?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[a,S5e(i)]},{result:c}=await n({user:r,request:o,address:a,redirectUrl:s});return{signature:c}}},x5e=({client:t,openAuthSession:e})=>{let n=DE({client:t,openAuthSession:e});return async({user:r,transaction:i,address:a,redirectUrl:s})=>{FE(r);let o={method:NE(r,a)?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[i]},{result:c}=await n({user:r,request:o,address:a,redirectUrl:s});return{transactionHash:c}}};var I5e=nv({sendTransaction:()=>x5e,signMessage:()=>E5e,signTypedData:()=>A5e});nv({linkWithCrossAppAuth:()=>iV,loginWithCrossAppAuth:()=>b5e,wallet:()=>I5e});function aV(t){if(t.startsWith("eip155:"))return"ethereum";if(t.startsWith("solana:"))return"solana";if(t.startsWith("bip122:"))return"bitcoin-segwit";if(t.startsWith("tron:"))return"tron"}function T5e(t,e){let n=aV(t);if(!n)return;let r=e.linked_accounts.find(i=>i.type==="wallet"&&i.chain_type===n&&"address"in i&&i.address);return r&&"address"in r?r.address:void 0}async function sV(t){let{user:e}=await t.privy.user.get();if(!e)return{ok:!1,error:"NOT_AUTHENTICATED"};let n=T5e(t.caip2,e);if(n)return{ok:!0,address:n};let r=aV(t.caip2);if(!r)return{ok:!1,error:"UNSUPPORTED_CHAIN"};try{let i=await t.privy.fetchPrivyRoute(yB,{body:{chain_type:r}});return await t.onWalletCreated?.(),{ok:!0,address:i.address}}catch{return{ok:!1,error:"REFUND_WALLET_CREATION_FAILED"}}}async function L5e(t){let{user:e}=await t.privy.user.get();if(!e)throw Error("NOT_AUTHENTICATED");let n=t.refundAddress;if(!n){let r=await sV({privy:t.privy,caip2:t.sourceChain,onWalletCreated:t.onWalletCreated});if(!r.ok)throw Error(r.error);n=r.address}return await t.privy.fetchPrivyRoute(h1e,{body:{source_chain:t.sourceChain,source_currency:t.sourceCurrency,destination_chain:t.destinationChain,destination_currency:t.destinationCurrency,destination_address:t.destinationAddress,refund_address:n,...t.slippageBps==null?{}:{slippage_bps:t.slippageBps}}})}function L5(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}const oV=async({operation:t,until:e,delay:n,interval:r,attempts:i,signal:a})=>{n&&await L5(n);let s=0,o,c;for(;s<i;){if(a?.aborted)return{status:"aborted",result:o,attempts:s,error:c};s++;try{if(c=void 0,o=await t(),e(o))return{status:"success",result:o,attempts:s};s<i&&await L5(r)}catch(l){l instanceof Error&&(c=l),s<i&&await L5(r)}}return{status:"max_attempts",result:o,attempts:s,error:c}},cV=2e3,lV=1800*1e3;function uV(t,e){return Math.ceil(e/t)}function dV(t){return t.status==="success"?t.result?{status:"success",order:t.result}:{status:"timeout"}:t.status==="aborted"?{status:"aborted",error:t.error}:{status:"timeout",error:t.error}}async function k5e(t){return await t.privy.fetchPrivyRoute(gE,{params:{order_id:t.orderId}})}async function $5e(t){let e=t.pollIntervalMs??cV,n=t.timeoutMs??lV,r=t.signal??new AbortController().signal;return dV(await oV({operation:async()=>{let i=await t.privy.fetchPrivyRoute(p1e,{params:{deposit_address_id:t.depositAddressId},query:{after:t.quoteCreatedAt}});if(i.order)return await t.privy.fetchPrivyRoute(gE,{params:{order_id:i.order.id}})},until:i=>i!==void 0,delay:e,interval:e,attempts:uV(e,n),signal:r}))}async function P5e(t){let e=t.pollIntervalMs??cV,n=t.timeoutMs??lV,r=t.signal??new AbortController().signal;return dV(await oV({operation:()=>t.privy.fetchPrivyRoute(gE,{params:{order_id:t.orderId}}),until:i=>i.status!=="executing",delay:e,interval:e,attempts:uV(e,n),signal:r}))}var lat=nv({generateDepositAddress:()=>L5e,getConfig:()=>R5e,getDeposit:()=>k5e,resolveRefundAddress:()=>sV,waitForCompletion:()=>P5e,waitForDeposit:()=>$5e});async function R5e(t){let e=await t.fetchPrivyRoute(pB,{});return{currencies:e.currencies,chains:e.chains}}var O5e=class{#e;#t;get standardWallet(){return this.#e}get address(){return this.#t.address}constructor({wallet:e,account:n}){this.#e=e,this.#t=n}async disconnect(){if(!this.#e.features["standard:disconnect"]?.disconnect)throw Error("Wallet does not support disconnect");await this.#e.features["standard:disconnect"].disconnect()}async signMessage(...e){if(!this.#e.features["solana:signMessage"]?.signMessage)throw Error("Wallet does not support signMessage");let n=await this.#e.features["solana:signMessage"].signMessage(...e.map(r=>({...r,account:this.#t})));return e.length===1?n[0]:[...n]}async signTransaction(...e){if(!this.#e.features["solana:signTransaction"]?.signTransaction)throw Error("Wallet does not support signTransaction");let n=await this.#e.features["solana:signTransaction"].signTransaction(...e.map(r=>({...r,account:this.#t})));return e.length===1?n[0]:[...n]}async signAndSendTransaction(...e){if(!this.#e.features["solana:signAndSendTransaction"]?.signAndSendTransaction)throw Error("Wallet does not support signAndSendTransaction");let n=await this.#e.features["solana:signAndSendTransaction"].signAndSendTransaction(...e.map(r=>({...r,account:this.#t})));return e.length===1?n[0]:[...n]}async signAndSendAllTransactions(e){if(!this.#e.features["solana:signAndSendTransaction"]?.signAndSendTransaction)throw Error("Wallet does not support signAndSendTransaction");return[...await this.#e.features["solana:signAndSendTransaction"].signAndSendTransaction(...e.map(n=>({...n,account:this.#t})))]}},M5e=r5e;const fV=(t,e)=>t===e?!0:t.startsWith("0x")&&e.startsWith("0x")&&t.length===42&&e.length===42?_t(t)===_t(e):!1,ue=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},dat=t=>()=>{throw Error(t.trim())},hV=()=>{},pV=L.createContext({setAuthenticated:ue,setUser:ue,setIsNewUser:ue,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:ue,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:ue,initializeWalletProxy:ue,getAuthMeta:ue,getAuthFlow:ue,closePrivyModal:ue,openPrivyModal:ue,connectWallet:ue,initLoginWithWallet:ue,loginWithWallet:ue,initLoginWithFarcaster:ue,loginWithFarcaster:ue,loginWithCode:ue,initLoginWithEmail:ue,initLoginWithSms:ue,initUpdateEmail:ue,initUpdatePhone:ue,resendEmailCode:ue,resendSmsCode:ue,initLoginWithHeadlessOAuth:ue,loginWithHeadlessOAuth:ue,crossAppAuthFlow:ue,initLoginWithOAuth:ue,loginWithOAuth:ue,passkeyAuthState:{status:"initial"},setPasskeyAuthState:ue,initSignupWithPasskey:ue,signupWithPasskey:ue,
74initLoginWithPasskey:ue,loginWithPasskey:ue,initLinkWithPasskey:ue,linkWithPasskey:ue,refreshSessionAndUser:ue,walletProxy:null,createAnalyticsEvent:ue,acceptTerms:ue,getUsdTokenPrice:ue,getUsdPriceForSol:ue,getSplTokenMetadata:ue,recoverEmbeddedWallet:ue,updateWallets:ue,fundWallet:ue,openModal:ue,setReadyToTrue:ue,requestFarcasterSignerStatus:ue,initLoginWithTelegram:ue,loginWithTelegram:ue,generateSiweMessage:ue,generateSiweMessageForSmartWallet:ue,loginWithSiwe:ue,linkWithSiwe:ue,linkSmartWallet:ue,delegateWallet:ue,revokeDelegatedWallets:ue,connectCoinbaseSmartWallet:ue,connectBaseAccount:ue,initiateAccountTransfer:ue,emailOtpState:{status:"initial"},setEmailOtpState:ue,smsOtpState:{status:"initial"},setSmsOtpState:ue,siweState:{status:"initial"},setSiweState:ue,oAuthState:{status:"initial"},setOAuthState:ue,telegramAuthState:{status:"initial"},setTelegramAuthState:ue,isHeadlessOAuthLoading:!1,isHeadlessSigning:ue,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:ue}),Vt=()=>L.useContext(pV);function rv(t){return typeof t=="string"&&/^custom:[a-zA-Z0-9_-]+$/i.test(t)}const Ki=t=>!!t.id&&t.recoveryMethod==="privy-v2";function ft(t){return t?new Date(1e3*t):null}function fr(t,e){return t.slice().sort((n,r)=>(n.firstVerifiedAt?.getTime()??0)-(r.firstVerifiedAt?.getTime()??0)).find(n=>n.type===e)}const Yc=t=>t?N5e(t).find(e=>e.walletIndex===0)??null:null,N5e=t=>t?gV(t,"ethereum"):[],gV=(t,e)=>t.linkedAccounts.filter(n=>n.type==="wallet"&&n.walletClientType==="privy"&&!n.imported&&n.chainType===e),D5e=t=>t?gV(t,"solana"):[],gy=t=>t?D5e(t).find(e=>e.walletIndex===0)??null:null,UE=t=>(t?.linkedAccounts??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.imported&&e.chainType==="ethereum"),jE=t=>(t?.linkedAccounts??[]).filter(e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana"),_d=(t,e)=>t?.linkedAccounts.find(n=>n.type==="wallet"&&n.walletClientType==="privy"&&fV(n.address,e))||null,I1=(t,e)=>t.find(n=>fV(n.address,e))||null,Tp=t=>{let e=Yc(t),n=gy(t);return e&&n&&!Ki(n)&&Ki(e)?n:Yc(t)??gy(t)};function mr(t){if(!t)return null;let e=function(_){let E=[];for(let C of _){let x=C.type;switch(C.type){case"wallet":let $={id:C.id,address:C.address,type:C.type,imported:C.imported,delegated:C.delegated,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at),chainType:C.chain_type,walletClientType:C.wallet_client_type,connectorType:C.connector_type,recoveryMethod:C.recovery_method,walletIndex:C.wallet_index,publicKey:C.public_key};E.push($);break;case"smart_wallet":let T={address:C.address,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at),smartWalletType:C.smart_wallet_type,smartWalletVersion:C.smart_wallet_version};E.push(T);break;case"cross_app":let U={type:C.type,subject:C.subject,embeddedWallets:C.embedded_wallets,smartWallets:C.smart_wallets,providerApp:{id:C.provider_app_id},firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(U);break;case"email":let O={address:C.address,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(O);break;case"phone":let F={number:C.phoneNumber,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(F);break;case"google_oauth":let k={subject:C.subject,email:C.email,name:C.name,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(k);break;case"spotify_oauth":let S={subject:C.subject,email:C.email,name:C.name,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(S);break;case"instagram_oauth":let I={subject:C.subject,username:C.username,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(I);break;case"twitter_oauth":let A={subject:C.subject,username:C.username,name:C.name,type:C.type,profilePictureUrl:C.profile_picture_url,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(A);break;case"discord_oauth":let R={subject:C.subject,username:C.username,email:C.email,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(R);break;case"github_oauth":let N={subject:C.subject,username:C.username,name:C.name,email:C.email,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(N);break;case"tiktok_oauth":let P={subject:C.subject,username:C.username,name:C.name,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(P);break;case"line_oauth":let j={subject:C.subject,name:C.name,email:C.email,profilePictureUrl:C.profile_picture_url,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(j);break;case"twitch_oauth":let M={subject:C.subject,username:C.username,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(M);break;case"linkedin_oauth":let V={subject:C.subject,name:C.name,email:C.email,vanityName:C.vanity_name,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(V);break;case"apple_oauth":let B={subject:C.subject,email:C.email,type:C.type,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(B);break;case"custom_auth":E.push({type:C.type,customUserId:C.custom_user_id,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)});break;case"farcaster":let G={type:C.type,fid:C.fid,ownerAddress:C.owner_address,displayName:C.display_name,username:C.username,bio:C.bio,pfp:C.profile_picture_url,url:C.homepage_url,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at),signerPublicKey:C.signer_public_key};E.push(G);break;case"passkey":let Z={type:C.type,enrolledInMfa:C.enrolled_in_mfa,credentialId:C.credential_id,publicKey:C.public_key,authenticatorName:C.authenticator_name,createdWithDevice:C.created_with_device,createdWithOs:C.created_with_os,createdWithBrowser:C.created_with_browser,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(Z);break;case"telegram":let ie={type:C.type,telegramUserId:C.telegram_user_id,firstName:C.first_name,lastName:C.last_name,username:C.username,photoUrl:C.photo_url,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(ie);break;default:if(rv(C.type)){let oe={type:C.type,subject:C.subject,name:C.name,username:C.username,email:C.email,profilePictureUrl:C.profile_picture_url,firstVerifiedAt:ft(C.first_verified_at),latestVerifiedAt:ft(C.latest_verified_at)};E.push(oe);break}console.warn(`Unrecognized account type: ${x}. Please consider upgrading the Privy SDK.`)}}return E}(t.linked_accounts),n=fr(e,"wallet"),r=fr(e,"smart_wallet"),i=fr(e,"email"),a=fr(e,"phone"),s=fr(e,"google_oauth"),o=fr(e,"twitter_oauth"),c=fr(e,"discord_oauth"),l=fr(e,"github_oauth"),u=fr(e,"spotify_oauth"),d=fr(e,"instagram_oauth"),f=fr(e,"tiktok_oauth"),h=fr(e,"line_oauth"),p=fr(e,"twitch_oauth"),g=fr(e,"linkedin_oauth"),y=fr(e,"apple_oauth"),v=fr(e,"farcaster"),b=fr(e,"telegram"),w=t.mfa_methods.map(({type:_,verified_at:E})=>({type:_,verifiedAt:ft(E)}));return{id:t.id,createdAt:ft(t.created_at),linkedAccounts:e,email:i&&{address:i?.address},phone:a&&{number:a?.number},wallet:n&&{id:n.id,address:n.address,chainType:n.chainType,walletClientType:n.walletClientType,connectorType:n.connectorType,recoveryMethod:n.recoveryMethod,imported:n.imported,delegated:n.delegated,walletIndex:n.walletIndex,publicKey:n.publicKey},smartWallet:r&&{address:r.address,smartWalletType:r.smartWalletType,smartWalletVersion:r.smartWalletVersion},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:c&&{subject:c.subject,username:c.username,email:c.email},github:l&&{subject:l.subject,username:l.username,name:l.name,email:l.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},line:h&&{subject:h.subject,name:h.name,email:h.email,profilePictureUrl:h.profilePictureUrl},twitch:p&&{subject:p.subject,username:p.username},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:y&&{subject:y.subject,email:y.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:b&&{telegramUserId:b.telegramUserId,firstName:b.firstName,lastName:b.lastName,username:b.username,photoUrl:b.photoUrl},delegatedWallets:[],mfaMethods:w.map(_=>_.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}const Ia=L.createContext({ready:!1,authenticated:!1,user:null,error:null,walletConnectors:null,connectWallet:ue,login:ue,connectOrCreateWallet:ue,linkEmail:ue,linkPhone:ue,linkFarcaster:ue,linkWallet:ue,linkGoogle:ue,linkTwitter:ue,linkTwitch:ue,linkDiscord:ue,linkGithub:ue,linkSpotify:ue,linkInstagram:ue,linkTelegram:ue,linkTiktok:ue,linkLine:ue,linkLinkedIn:ue,linkApple:ue,linkPasskey:ue,linkOAuth:ue,logout:ue,getAccessToken:ue,signMessage:ue,signTypedData:ue,enrollInMfa:ue,initEnrollmentWithSms:ue,initEnrollmentWithTotp:ue,initEnrollmentWithPasskey:ue,promptMfa:ue,init:ue,submitEnrollmentWithSms:ue,submitEnrollmentWithTotp:ue,submitEnrollmentWithPasskey:ue,unenroll:ue,clear:ue,submit:ue,cancel:ue,sendTransaction:ue,signTransaction:ue,setWalletPassword:ue,setWalletRecovery:ue,
vendor: 11,860 bytes, line 74
74isModalOpen:!1,mfaMethods:[]}),$i=()=>L.useContext(Ia),F5e=t=>t;function U5e(t,e=F5e){const n=tt.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getInitialState()));return tt.useDebugValue(n),n}const BL=t=>{const e=C3(t),n=r=>U5e(e,r);return Object.assign(n,e),n},Pi=t=>t?BL(t):BL;function yy(t){"@babel/helpers - typeof";return yy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yy(t)}var j5e=/^\s+/,B5e=/\s+$/;function We(t,e){if(t=t||"",e=e||{},t instanceof We)return t;if(!(this instanceof We))return new We(t,e);var n=V5e(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}We.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n,r,i,a,s,o;return n=e.r/255,r=e.g/255,i=e.b/255,n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*s+.0722*o},setAlpha:function(e){return this._a=yV(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=HL(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=HL(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=VL(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=VL(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return WL(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return z5e(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(gn(this._r,255)*100)+"%",g:Math.round(gn(this._g,255)*100)+"%",b:Math.round(gn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(gn(this._r,255)*100)+"%, "+Math.round(gn(this._g,255)*100)+"%, "+Math.round(gn(this._b,255)*100)+"%)":"rgba("+Math.round(gn(this._r,255)*100)+"%, "+Math.round(gn(this._g,255)*100)+"%, "+Math.round(gn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:i4e[WL(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n="#"+qL(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?"GradientType = 1, ":"";if(e){var a=We(e);r="#"+qL(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+n+",endColorstr="+r+")"},toString:function(e){var n=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0,a=!n&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return a?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return We(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(Y5e,arguments)},brighten:function(){return this._applyModification(J5e,arguments)},darken:function(){return this._applyModification(X5e,arguments)},desaturate:function(){return this._applyModification(Z5e,arguments)},saturate:function(){return this._applyModification(K5e,arguments)},greyscale:function(){return this._applyModification(G5e,arguments)},spin:function(){return this._applyModification(Q5e,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(n4e,arguments)},complement:function(){return this._applyCombination(e4e,arguments)},monochromatic:function(){return this._applyCombination(r4e,arguments)},splitcomplement:function(){return this._applyCombination(t4e,arguments)},triad:function(){return this._applyCombination(zL,[3])},tetrad:function(){return this._applyCombination(zL,[4])}};We.fromRatio=function(t,e){if(yy(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=sh(t[r]));t=n}return We(t,e)};function V5e(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,a=null,s=!1,o=!1;return typeof t=="string"&&(t=c4e(t)),yy(t)=="object"&&(ro(t.r)&&ro(t.g)&&ro(t.b)?(e=H5e(t.r,t.g,t.b),s=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):ro(t.h)&&ro(t.s)&&ro(t.v)?(r=sh(t.s),i=sh(t.v),e=q5e(t.h,r,i),s=!0,o="hsv"):ro(t.h)&&ro(t.s)&&ro(t.l)&&(r=sh(t.s),a=sh(t.l),e=W5e(t.h,r,a),s=!0,o="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=yV(n),{ok:s,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function H5e(t,e,n){return{r:gn(t,255)*255,g:gn(e,255)*255,b:gn(n,255)*255}}function VL(t,e,n){t=gn(t,255),e=gn(e,255),n=gn(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),a,s,o=(r+i)/2;if(r==i)a=s=0;else{var c=r-i;switch(s=o>.5?c/(2-r-i):c/(r+i),r){case t:a=(e-n)/c+(e<n?6:0);break;case e:a=(n-t)/c+2;break;case n:a=(t-e)/c+4;break}a/=6}return{h:a,s,l:o}}function W5e(t,e,n){var r,i,a;t=gn(t,360),e=gn(e,100),n=gn(n,100);function s(l,u,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?l+(u-l)*6*d:d<1/2?u:d<2/3?l+(u-l)*(2/3-d)*6:l}if(e===0)r=i=a=n;else{var o=n<.5?n*(1+e):n+e-n*e,c=2*n-o;r=s(c,o,t+1/3),i=s(c,o,t),a=s(c,o,t-1/3)}return{r:r*255,g:i*255,b:a*255}}function HL(t,e,n){t=gn(t,255),e=gn(e,255),n=gn(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),a,s,o=r,c=r-i;if(s=r===0?0:c/r,r==i)a=0;else{switch(r){case t:a=(e-n)/c+(e<n?6:0);break;case e:a=(n-t)/c+2;break;case n:a=(t-e)/c+4;break}a/=6}return{h:a,s,v:o}}function q5e(t,e,n){t=gn(t,360)*6,e=gn(e,100),n=gn(n,100);var r=Math.floor(t),i=t-r,a=n*(1-e),s=n*(1-i*e),o=n*(1-(1-i)*e),c=r%6,l=[n,s,a,a,o,n][c],u=[o,n,n,s,a,a][c],d=[a,a,o,n,n,s][c];return{r:l*255,g:u*255,b:d*255}}function WL(t,e,n,r){var i=[Za(Math.round(t).toString(16)),Za(Math.round(e).toString(16)),Za(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function z5e(t,e,n,r,i){var a=[Za(Math.round(t).toString(16)),Za(Math.round(e).toString(16)),Za(Math.round(n).toString(16)),Za(mV(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function qL(t,e,n,r){var i=[Za(mV(r)),Za(Math.round(t).toString(16)),Za(Math.round(e).toString(16)),Za(Math.round(n).toString(16))];return i.join("")}We.equals=function(t,e){return!t||!e?!1:We(t).toRgbString()==We(e).toRgbString()};We.random=function(){return We.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Z5e(t,e){e=e===0?0:e||10;var n=We(t).toHsl();return n.s-=e/100,n.s=iv(n.s),We(n)}function K5e(t,e){e=e===0?0:e||10;var n=We(t).toHsl();return n.s+=e/100,n.s=iv(n.s),We(n)}function G5e(t){return We(t).desaturate(100)}function Y5e(t,e){e=e===0?0:e||10;var n=We(t).toHsl();return n.l+=e/100,n.l=iv(n.l),We(n)}function J5e(t,e){e=e===0?0:e||10;var n=We(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),We(n)}function X5e(t,e){e=e===0?0:e||10;var n=We(t).toHsl();return n.l-=e/100,n.l=iv(n.l),We(n)}function Q5e(t,e){var n=We(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,We(n)}function e4e(t){var e=We(t).toHsl();return e.h=(e.h+180)%360,We(e)}function zL(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=We(t).toHsl(),r=[We(t)],i=360/e,a=1;a<e;a++)r.push(We({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function t4e(t){var e=We(t).toHsl(),n=e.h;return[We(t),We({h:(n+72)%360,s:e.s,l:e.l}),We({h:(n+216)%360,s:e.s,l:e.l})]}function n4e(t,e,n){e=e||6,n=n||30;var r=We(t).toHsl(),i=360/n,a=[We(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(We(r));return a}function r4e(t,e){e=e||6;for(var n=We(t).toHsv(),r=n.h,i=n.s,a=n.v,s=[],o=1/e;e--;)s.push(We({h:r,s:i,v:a})),a=(a+o)%1;return s}We.mix=function(t,e,n){n=n===0?0:n||50;var r=We(t).toRgb(),i=We(e).toRgb(),a=n/100,s={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return We(s)};We.readability=function(t,e){var n=We(t),r=We(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};We.isReadable=function(t,e,n){var r=We.readability(t,e),i,a;switch(a=!1,i=l4e(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a};We.mostReadable=function(t,e,n){var r=null,i=0,a,s,o,c;n=n||{},s=n.includeFallbackColors,o=n.level,c=n.size;for(var l=0;l<e.length;l++)a=We.readability(t,e[l]),a>i&&(i=a,r=We(e[l]));return We.isReadable(t,r,{level:o,size:c})||!s?r:(n.includeFallbackColors=!1,We.mostReadable(t,["#fff","#000"],n))};var c8=We.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
740",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},i4e=We.hexNames=a4e(c8);function a4e(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function yV(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function gn(t,e){s4e(t)&&(t="100%");var n=o4e(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function iv(t){return Math.min(1,Math.max(0,t))}function Vi(t){return parseInt(t,16)}function s4e(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function o4e(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Za(t){return t.length==1?"0"+t:""+t}function sh(t){return t<=1&&(t=t*100+"%"),t}function mV(t){return Math.round(parseFloat(t)*255).toString(16)}function ZL(t){return Vi(t)/255}var Na=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"
74+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ro(t){return!!Na.CSS_UNIT.exec(t)}function c4e(t){t=t.replace(j5e,"").replace(B5e,"").toLowerCase();var e=!1;if(c8[t])t=c8[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Na.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=Na.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Na.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=Na.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Na.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=Na.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Na.hex8.exec(t))?{r:Vi(n[1]),g:Vi(n[2]),b:Vi(n[3]),a:ZL(n[4]),format:e?"name":"hex8"}:(n=Na.hex6.exec(t))?{r:Vi(n[1]),g:Vi(n[2]),b:Vi(n[3]),format:e?"name":"hex"}:(n=Na.hex4.exec(t))?{r:Vi(n[1]+""+n[1]),g:Vi(n[2]+""+n[2]),b:Vi(n[3]+""+n[3]),a:ZL(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=Na.hex3.exec(t))?{r:Vi(n[1]+""+n[1]),g:Vi(n[2]+""+n[2]),b:Vi(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function l4e(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}const l8="https://auth.privy.io",u4e=2e4,fat=1400,hat=2500,pat=4e3,d4e="3.37.1",oh="privy:token",KL="privy-token",k5="privy:refresh_token",f4e="privy-refresh-token",V3="privy:pat",GL="privy:id_token",YL="privy-id-token",$5="privy-session",u8="privy:caid",vV=t=>`privy:guest:${t}`,T1=t=>`privy:cross-app:${t}`,my="privy:state_code",ch="privy:code_verifier",vy="privy:headless_oauth",$h="privy:oauth_disable_signup",P5=t=>`privy:wallet:${t}`,wV="privy:connections",av=12e4,gat=1,JL="0x1",h4e=3e4,yat="https://api.moonpay.com/v1",mat="https://api.moonpay.com/v1",vat="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",wat="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",p4e="deprecated",wc={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","robinhood_wallet","base_account","wallet_connect","phantom"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let g4e=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","jupiter","binance","binanceus","bitget_wallet","kraken_wallet","robinhood_wallet"]),XL=t=>g4e.has(t),QL=(t,e,n)=>n.indexOf(t)===e;const y4e=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(XL).filter(QL):t?t.filter(XL).filter(QL):wc.appearance.walletList;let m4e=/paymaster\.biconomy\.io\/api/i,v4e={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const w4e=(t,e)=>t&&m4e.test(t)?v4e:e&&e.policy_id?{policyId:e.policy_id}:void 0;function L1(t,e){let n=Math.max(0,Math.min(1,t.toHsl().l+e));return We({...t.toHsl(),l:n})}function R5(t,e){let n=t.getLuminance(),r=e.getLuminance();return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function b4e(t,e){if(!t){let r=e?lh:H3;return{accent:We(r.background.interactive),accentLight:We(r.background.interactive),accentHover:We(r.background["interactive-hover"]),accentDark:We(r.background["interactive-clicked"]),accentDarkest:We(r.background["interactive-disabled"])}}let n=We(t);return{accent:n,accentLight:L1(n,.15),accentHover:L1(n,.3),accentDark:L1(n,-.06),accentDarkest:L1(n,-.6)}}function _4e({backgroundTheme:t,accentHex:e}){let n,r;t==="light"?n=!1:t==="dark"?n=!0:(n=.5>=We(t).getLuminance(),r=We(t).toHslString());let i=n?"dark":"light",a=n?lh:H3,{accent:s,accentLight:o,accentHover:c,accentDark:l,accentDarkest:u}=b4e(e,n),d=function(p){let g=We(H3.text.default),y=We(lh.text.default),v=R5(p,g),b=R5(p,y),w=p.toHsl();return w.h>=220&&w.h<=300&&b>=3?lh.text.default:v>b?H3.text.default:lh.text.default}(s),f=We(d),h=R5(s,We(a.background.default))>=3;return{colorScheme:i,background:r||a.background.default,background2:a.background.elevated,background3:a.background.interactive,foreground:a.text.default,foreground2:a.text.muted,foreground3:a.text.placeholder,foreground4:a.border.default,accent:s.to
74HslString(),accentLight:o.toHslString(),accentHover:c.toHslString(),accentDark:l.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:f.toHslString(),success:a.background.success,successDark:a.text.success,successLight:a.background.success,error:a.text.error,errorLight:a.background.error,warn:a.background.warning,warnLight:a.background.warning,warningDark:a.text.warning,errorDark:a.text.error,successBg:a.background.success,errorBg:a.background.error,errorBgHover:a.background["error-hover"],warnBg:a.background.warning,infoBg:a.background.info,infoBgHover:a.background["info-hover"],borderDefault:a.border.default,borderHover:a.border["default-hover"],borderFocus:a.border.focused,borderError:a.border.error,borderSuccess:a.border.success,borderWarning:a.border.warning,borderInfo:a.border.info,borderInteractive:a.border.interactive,borderInteractiveHover:a.border["interactive-hover"],backgroundHover:a.background["default-hover"],backgroundClicked:a.background["default-clicked"],backgroundDisabled:a.background["default-disabled"],backgroundInteractive:a.background.interactive,backgroundInteractiveHover:a.background["interactive-hover"],backgroundInteractiveClicked:a.background["interactive-clicked"],backgroundInteractiveDisabled:a.background["interactive-disabled"],foregroundHover:a.text.default,foregroundClicked:a.text.default,foregroundDisabled:a.text["default-disabled"],foregroundInteractive:a.text.interactive,foregroundInteractiveHover:a.text["interactive-hover"],accentHasGoodContrast:h?"1":"0",linkNavigationColor:h?s.toHslString():a.text.default,linkNavigationDecoration:h?"none":"underline",iconDefault:a.icon.default,iconMuted:a.icon.muted,iconSubtle:a.icon.subtle,iconInverse:a.icon.inverse,iconSuccess:a.icon.success,iconWarning:a.icon.warning,iconError:a.icon.error,iconInteractive:a.icon.interactive,iconDefaultHover:a.icon["default-hover"],iconMutedHover:a.icon["muted-hover"],iconSubtleHover:a.icon["subtle-hover"],iconDefaultClicked:a.icon["default-clicked"],iconMutedClicked:a.icon["muted-clicked"],iconSubtleClicked:a.icon["subtle-clicked"],iconDefaultDisabled:a.icon["default-disabled"],iconMutedDisabled:a.icon["muted-disabled"],iconSubtleDisabled:a.icon["subtle-disabled"],iconErrorHover:a.icon["error-hover"],iconInteractiveHover:a.icon["interactive-hover"],iconErrorClicked:a.icon["error-clicked"],iconInteractiveClicked:a.icon["interactive-clicked"],iconMutedDisabledAlt:a.icon["muted-disabled"],iconSubtleDisabledAlt:a.icon["subtle-disabled"]}}const lh={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#
74EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},H3={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}},C4e=["sms","totp","passkey"],E4e=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","crypto.com_wallet_extension","crypto.com_onchain","binance","bitget_wallet","coinbase_wallet","coinbase_smart_wallet","base_account","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitget_wallet","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","privy","unknown","phantom","solflare","glow","backpack","jupiter","mobile_wallet_adapter"];function bV(t,e,n,r,i){let a,s,o,c,l,u,d,f,h,p,g,y,v,b,w,_,E,C,x=n?console.warn:()=>{},$=[];if(e?.loginMethods)for(let K of(a=e.loginMethods.includes("email"),s=e.loginMethods.includes("sms"),c=e.loginMethods.includes("wallet"),l=e.loginMethods.includes("google"),u=e.loginMethods.includes("twitter"),d=e.loginMethods.includes("discord"),g=e.loginMethods.includes("spotify"),y=e.loginMethods.includes("instagram"),f=e.loginMethods.includes("tiktok"),h=e.loginMethods.includes("line"),p=e.loginMethods.includes("twitch"),b=e.loginMethods.includes("github"),v=e.loginMethods.includes("linkedin"),w=e.loginMethods.includes("apple"),_=e.loginMethods.includes("farcaster"),E=e.loginMethods.includes("telegram"),o=e.loginMethods.includes("passkey"),e.loginMethods))typeof K=="string"&&K.startsWith("privy:")&&$.push(K);else a=t.email_auth,s=t.sms_auth,c=t.wallet_auth||t.solana_wallet_auth,l=t.google_oauth,u=t.twitter_oauth,d=t.discord_oauth,b=t.github_oauth,g=t.spotify_oauth,y=t.instagram_oauth,f=t.tiktok_oauth,h=t.line_oauth,p=t.twitch_oauth,v=t.linkedin_oauth,w=t.apple_oauth,_=t.farcaster_auth,E=t.telegram_auth||t.telegram_oauth,o=t.passkey_auth,C=t.custom_jwt_auth;t.passkey_auth&&(o=!0),typeof window<"u"&&typeof window.PublicKeyCredential!="function"&&(o=!1);let T=[a,s].filter(Boolean),U=[l,u,d,b,g,y,f,h,p,v,w,_,E].filter(Boolean),O=[c].filter(Boolean),F=e?.loginMethods?.includes("passkey")??!1,k=t.passkeys_for_signup_enabled??!1,S=[o&&(k||F)].filter(
74Boolean),I=[C].filter(Boolean);if(T.length+U.length+O.length+S.length+I.length+$.length===0)throw Error("You must enable at least one login method");let A=e?.appearance?.showWalletLoginFirst!==void 0?e?.appearance?.showWalletLoginFirst:t.show_wallet_login_first;A&&O.length===0?(x("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),A=!1):A||U.length+T.length!==0||(x("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),A=!0);let R=e?.externalWallets?.walletConnect?.enabled??!0;e?.loginMethods&&e.loginMethodsAndOrder&&x("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let N=y4e({input:e?.appearance?.walletList,overrides:e?.loginMethodsAndOrder});if((N.includes("wallet_connect_qr")||N.includes("wallet_connect"))&&N.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let P=(({input:K})=>{if(!K||!K.primary[0])return;let ne=[K.primary[0]],ce=[];for(let xe of(K.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),K.primary.slice(1)))ne.includes(xe)?console.warn(`Duplicated login method: ${xe}`):ne.push(xe);for(let xe of K.overflow??[])ne.includes(xe)||ce.includes(xe)?console.warn(`Duplicated login method: ${xe}`):ce.push(xe);return{primary:ne,overflow:ce}})({input:e?.loginMethodsAndOrder}),j=e?.intl?.defaultCountry??"US",{chains:M,defaultChain:V}=function({supportedChains:K,defaultChainFromConfig:ne}){let ce;if(K){if(K.length===0)throw Error("`supportedChains` must contain at least one chain");ce=wB(K)}else ce=[...p0];let xe=K?ce[0]:Ks,ke=ne??xe;if(!ce.find(Me=>Me.id===ke.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:ce,defaultChain:ke}}({supportedChains:e?.supportedChains,defaultChainFromConfig:e?.defaultChain}),B=!!e?.defaultChain,G=e?.customAuth?.getCustomAccessToken&&e?.customAuth?.enabled!==!1,Z=G?"all-users":t.embedded_wallet_config.ethereum.create_on_login,ie=t.embedded_wallet_config.solana.create_on_login;t.solana_wallet_auth&&!e?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let oe=t.telegram_auth_config?{botId:t.telegram_auth_config.bot_id,botName:t.telegram_auth_config.bot_name,linkEnabled:t.telegram_auth_config.link_enabled,seamlessAuthEnabled:t.telegram_auth_config.seamless_auth_enabled}:void 0,z=t.funding_config?{methods:t.funding_config.methods,options:t.funding_config.options,defaultRecommendedAmount:t.funding_config.default_recommended_amount,defaultRecommendedCurrency:t.funding_config.default_recommended_currency,promptFundingOnWalletCreation:t.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:t.funding_config.cross_chain_bridging_enabled}:void 0,J=t.smart_wallet_config;return{id:t.id,appClientId:i,name:t.name,scriptNonce:e?.scriptNonce,allowlistConfig:{errorTitle:t.allowlist_config.error_title,errorDetail:t.allowlist_config.error_detail,errorCtaText:t.allowlist_config.cta_text,errorCtaLink:t.allowlist_config.cta_link},legacyWalletUiConfig:t.legacy_wallet_ui_config,appearance:{logo:e?.appearance?.logo??t.logo_url??void 0,emailDomain:e?.appearance?.emailDomain,landingHeader:e?.appearance?.landingHeader??wc.appearance.landingHeader,loginMessage:typeof e?.appearance?.loginMessage=="string"?e?.appearance?.loginMessage.slice(0,100):e?.appearance?.loginMessage,footerLogo:e?.appearance?.footerLogo,palette:_4e({backgroundTheme:e?.appearance?.theme??wc.appearance.theme,accentHex:e?.appearance?.accentColor??t.accent_color}),loginGroupPriority:A?"web3-first":"web2-first",hideDirectWeb2Inputs:!!e?.appearance?.hideDirectWeb2Inputs,walletList:N,walletChainType:e?.appearance?.walletChainType??(({evmWalletAuth:K,solanaWalletAuth:ne})=>K&&ne?"ethereum-and-solana":K?"ethereum-only":ne?"solana-only":"ethereum-only")({evmWalletAuth:t.wallet_auth??!1,solanaWalletAuth:t.solana_wallet_auth??!1})},loginMethods:{wallet:c,email:a,sms:s,passkey:o,google:l,twitter:u,discord:d,github:b,spotify:g,instagram:y,tiktok:f,line:h,twitch:p,linkedin:v,apple:w,farcaster:_,telegram:E},globalDisablePasskeys:e?.globalDisablePasskeys??!1,customOAuthProviders:(t.custom_oauth_providers??[]).filter(K=>K.enabled!==!1),crossAppProviders:$,disablePlusEmails:t.disable_plus_emails,loginMethodsAndOrder:P,legal:{termsAndConditionsUrl:e?.legal?.termsAndConditionsUrl??t.terms_and_conditions_url,privacyPolicyUrl:e?.legal?.privacyPolicyUrl??t.privacy_policy_url,requireUsersAcceptTerms:t.require_users_accept_terms??!1},walletConnectCloudProjectId:e?.walletConnectCloudProjectId??t.wallet_connect_cloud_project_id??wc.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:e?.externalWallets?.signatureRequestTimeouts??{}},chains:M,defaultChain:V,intl:{defaultCountry:j,textLocalization:e?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:B,captcha:{enabledProvider:t.enabled_captcha_provider??null,siteKey:t.captcha_site_key},externalWallets:{coinbaseWallet:{config:{appName:t.name,appLogoUrl:t.logo_url,preference:{options:"all",...e?.externalWallets?.coinbaseWallet?.config?.preference},...e?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:t.name,appLogoUrl:t.logo_url,...e?.externalWallets?.baseA
74ccount?.config,preference:{...e?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:R},solana:{connectors:e?.externalWallets?.solana?.connectors},disableAllExternalWallets:e?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!G&&(t.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:G?["user-passcode"]:t.embedded_wallet_config.user_owned_recovery_options,priceDisplay:e?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:e?.embeddedWallets?.ethereum?.createOnLogin??Z},solana:{createOnLogin:e?.embeddedWallets?.solana?.createOnLogin??ie},disableAutomaticMigration:e?.embeddedWallets?.disableAutomaticMigration??!1,mode:t.embedded_wallet_config.mode,showWalletUIs:e?.embeddedWallets?.showWalletUIs??t.enforce_wallet_uis??!0,extendedCalldataDecoding:e?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:e?.embeddedWallets?.transactionScanning?.enabled??!1,domain:e?.embeddedWallets?.transactionScanning?.domain??r??"https://auth.privy.io"}},mfa:{methods:(t.mfa_methods??[]).filter(K=>C4e.includes(K)),noPromptOnMfaRequired:e?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:e?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:e?.passkeys?.shouldUnenrollMfaOnUnlink,registration:e?.passkeys?.registration},customAuth:G?{enabled:!0,...e.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:oe,telegramHasHmacCredentials:!!t.telegram_auth,telegramSeamlessAuthEnabled:!!t.telegram_seamless_auth_enabled,passkeysForSignupEnabled:t.passkeys_for_signup_enabled},headless:!!e?.headless,render:{standalone:e?._render?.standalone??wc._render.standalone},fundingConfig:z,fundingMethodConfig:{...e?.fundingMethodConfig??wc.fundingMethodConfig,moonpay:{...e?.fundingMethodConfig?.moonpay??wc.fundingMethodConfig.moonpay,useSandbox:e?.fundingMethodConfig?.moonpay.useSandbox??wc.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!t.whatsapp_enabled,customOAuthRedirectUrl:e?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:e?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":e?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":e?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":e?.solana?.rpcs?.["solana:testnet"]??null},smartWallets:J?.enabled?{enabled:J.enabled,smartWalletVersion:J.smart_wallet_version,smartWalletType:J.smart_wallet_type,configuredNetworks:J.configured_networks.map(K=>({chainId:K.chain_id,bundlerUrl:K.bundler_url,paymasterUrl:K.paymaster_url,paymasterContext:w4e(K.paymaster_url,K.paymaster_context)}))}:{enabled:J?.enabled??!1},connectorsDebugLogs:e?.connectorsDebugLogs??!1}}const _V={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let sv=L.createContext({appConfig:bV(_V,void 0,!1),isServerConfigLoaded:!1,initializationError:null,setInitializationError:()=>{}});const S4e=({children:t,client:e,legacyClient:n,clientConfig:r,appClientId:i})=>{let[a,s]=L.useState(null),[o,c]=L.useState(null),l=L.useMemo(()=>bV(a??_V,r,!!a,typeof window<"u"?window.location.origin:void 0,i),[a,r,i]);return L.useEffect(()=>{if(!a)return;let u=function(h){if(!h)return{};let{appearance:p,scriptNonce:g,supportedChains:y,defaultChain:v,externalWallets:b,...w}=h;return{...w,...y?{supportedChains:y.map(_=>_.id)}:void 0,...v?{defaultChain:v.id}:void 0,...b?{walletConnect:b.walletConnect?{enabled:b.walletConnect.enabled}
74:void 0,coinbaseWallet:b.coinbaseWallet,solana:{connectors:b.solana?.connectors?.get().map(_=>_.walletClientType)}}:void 0}}(r),d=function(h,p=0){let g=3735928559^p,y=1103547991^p;for(let v,b=0;b<h.length;b++)g=Math.imul(g^(v=h.charCodeAt(b)),2654435761),y=Math.imul(y^v,1597334677);return g=Math.imul(g^g>>>16,2246822507)^Math.imul(y^y>>>13,3266489909),4294967296*(2097151&(y=Math.imul(y^y>>>16,2246822507)^Math.imul(g^g>>>13,3266489909)))+(g>>>0)}(JSON.stringify(u)).toString(),f=`privy:sent:${a.id}:${d}`;localStorage.getItem(f)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:u}),localStorage.setItem(f,"t"))},[r,a]),L.useEffect(()=>{a||(async()=>{try{await e.initialize();let u=e.app.getConfig();u.custom_api_url&&n.updateApiUrl(u.custom_api_url),s(u)}catch(u){let d=u instanceof Error?u:Error(String(u));c(d),console.warn("Error generating app config: ",d)}})()},[]),m.jsx(sv.Provider,{value:{appConfig:l,isServerConfigLoaded:!!a,initializationError:o,setInitializationError:c},children:t})},zr=()=>{let{appConfig:t}=L.useContext(sv);return t},BE=()=>{let{isServerConfigLoaded:t}=L.useContext(sv);return t},A4e=()=>{let{initializationError:t,setInitializationError:e}=L.useContext(sv);return{initializationError:t,setInitializationError:e}},x4e=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,I4e=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,T4e=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function L4e(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){k4e(t);return}return e}function k4e(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function uh(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const n=t.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!T4e.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(x4e.test(t)||I4e.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,L4e)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}const $4e=/#/g,P4e=/&/g,R4e=/\//g,O4e=/=/g,VE=/\+/g,M4e=/%5e/gi,N4e=/%60/gi,D4e=/%7c/gi,F4e=/%20/gi;function U4e(t){return encodeURI(""+t).replace(D4e,"|")}function d8(t){return U4e(typeof t=="string"?t:JSON.stringify(t)).replace(VE,"%2B").replace(F4e,"+").replace($4e,"%23").replace(P4e,"%26").replace(N4e,"`").replace(M4e,"^").replace(R4e,"%2F")}function O5(t){return d8(t).replace(O4e,"%3D")}function CV(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function j4e(t){return CV(t.replace(VE," "))}function B4e(t){return CV(t.replace(VE," "))}function V4e(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const n of t.split("&")){const r=n.match(/([^=]+)=?(.*)/)||[];if(r.length<2)continue;const i=j4e(r[1]);if(i==="__proto__"||i==="constructor")continue;const a=B4e(r[2]||"");e[i]===void 0?e[i]=a:Array.isArray(e[i])?e[i].push(a):e[i]=[e[i],a]}return e}function H4e(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(n=>`${O5(t)}=${d8(n)}`).join("&"):`${O5(t)}=${d8(e)}`:O5(t)}function W4e(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>H4e(e,t[e])).filter(Boolean).join("&")}const q4e=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,z4e=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Z4e=/^([/\\]\s*){2,}[^/\\]/,K4e=/^\.?\//;function EV(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?q4e.test(t):z4e.test(t)||(e.acceptRelative?Z4e.test(t):!1)}function G4e(t="",e){return t.endsWith("/")}function Y4e(t="",e){return(G4e(t)?t.slice(0,-1):t)||"/"}function J4e(t="",e){return t.endsWith("/")?t:t+"/"}function X4e(t,e){if(e7e(e)||EV(t))return t;const n=Y4e(e);
74if(t.startsWith(n)){const r=t[n.length];if(!r||r==="/"||r==="?")return t}return n7e(n,t)}function Q4e(t,e){const n=r7e(t),r={...V4e(n.search),...e};return n.search=W4e(r),i7e(n)}function e7e(t){return!t||t==="/"}function t7e(t){return t&&t!=="/"}function n7e(t,...e){let n=t||"";for(const r of e.filter(i=>t7e(i)))if(n){const i=r.replace(K4e,"");n=J4e(n)+i}else n=r;return n}const SV=Symbol.for("ufo:protocolRelative");function r7e(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,d,f=""]=n;return{protocol:d.toLowerCase(),pathname:f,href:d+f,auth:"",host:"",search:"",hash:""}}if(!EV(t,{acceptRelative:!0}))return ek(t);const[,r="",i,a=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,s="",o=""]=a.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:c,search:l,hash:u}=ek(o);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:s,pathname:c,search:l,hash:u,[SV]:!r}}function ek(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}function i7e(t){const e=t.pathname||"",n=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",r=t.hash||"",i=t.auth?t.auth+"@":"",a=t.host||"";return(t.protocol||t[SV]?(t.protocol||"")+"//":"")+i+a+e+n+r}class AV extends Error{constructor(e,n){super(e,n),this.name="FetchError",n?.cause&&!this.cause&&(this.cause=n.cause)}}function a7e(t){const e=t.error?.message||t.error?.toString()||"",n=t.request?.method||t.options?.method||"GET",r=t.request?.url||String(t.request)||"/",i=`[${n}] ${JSON.stringify(r)}`,a=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",s=`${i}: ${a}${e?` ${e}`:""}`,o=new AV(s,t.error?{cause:t.error}:void 0);for(const c of["request","options","response"])Object.defineProperty(o,c,{get(){return t[c]}});for(const[c,l]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(o,c,{get(){return t.response&&t.response[l]}});return o}const s7e=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function tk(t="GET"){return s7e.has(t.toUpperCase())}function o7e(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const c7e=new Set(["image/svg","application/xml","application/xhtml","application/html"]),l7e=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function u7e(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return l7e.test(e)?"json":c7e.has(e)||e.startsWith("text/")?"text":"blob"}function d7e(t,e,n,r){const i=f7e(e?.headers??t?.headers,n?.headers,r);let a;return(n?.query||n?.params||e?.params||e?.query)&&(a={...n?.params,...n?.query,...e?.params,...e?.query}),{...n,...e,query:a,params:a,headers:i}}function f7e(t,e,n){if(!e)return new n(t);const r=new n(e);if(t)for(const[i,a]of Symbol.iterator in t||Array.isArray(t)?t:new n(t))r.set(i,a);return r}async function k1(t,e){if(e)if(Array.isArray(e))for(const n of e)await n(t);else await e(t)}const h7e=new Set([408,409,425,429,500,502,503,504]),p7e=new Set([101,204,205,304]);function xV(t={}){const{fetch:e=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=t;async function i(o){const c=o.error&&o.error.name==="AbortError"&&!o.options.timeout||!1;if(o.options.retry!==!1&&!c){let u;typeof o.options.retry=="number"?u=o.options.retry:u=tk(o.options.method)?0:1;const d=o.response&&o.response.status||500;if(u>0&&(Array.isArray(o.options.retryStatusCodes)?o.options.retryStatusCodes.includes(d):h7e.has(d))){const f=typeof o.options.retryDelay=="function"?o.options.retryDelay(o):o.options.retryDelay||0;return f>0&&await new Promise(h=>setTimeout(h,f)),a(o.request,{...o.options,retry:u-1})}}const l=a7e(o);throw Error.captureStackTrace&&Error.captureStackTrace(l,a),l}const a=async function(c,l={}){const u={request:c,options:d7e(c,l,t.defaults,n),response:void 0,error:void 0};u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&await k1(u,u.options.onRequest),typeof u.request=="string"&&(u.options.baseURL&&(u.request=X4e(u.request,u.options.baseURL)),u.options.query&&(u.request=Q4e(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&tk(u.options.method)&&(o7e(u.options.body)?(u.options.body=typeof u.options.body=="str
74ing"?u.options.body:JSON.stringify(u.options.body),u.options.headers=new n(u.options.headers||{}),u.options.headers.has("content-type")||u.options.headers.set("content-type","application/json"),u.options.headers.has("accept")||u.options.headers.set("accept","application/json")):("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half")));let d;if(!u.options.signal&&u.options.timeout){const h=new r;d=setTimeout(()=>{const p=new Error("[TimeoutError]: The operation was aborted due to timeout");p.name="TimeoutError",p.code=23,h.abort(p)},u.options.timeout),u.options.signal=h.signal}try{u.response=await e(u.request,u.options)}catch(h){return u.error=h,u.options.onRequestError&&await k1(u,u.options.onRequestError),await i(u)}finally{d&&clearTimeout(d)}if((u.response.body||u.response._bodyInit)&&!p7e.has(u.response.status)&&u.options.method!=="HEAD"){const h=(u.options.parseResponse?"json":u.options.responseType)||u7e(u.response.headers.get("content-type")||"");switch(h){case"json":{const p=await u.response.text(),g=u.options.parseResponse||uh;u.response._data=g(p);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[h]()}}return u.options.onResponse&&await k1(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await k1(u,u.options.onResponseError),await i(u)):u.response},s=async function(c,l){return(await a(c,l))._data};return s.raw=a,s.native=(...o)=>e(...o),s.create=(o={},c={})=>xV({...t,...c,defaults:{...t.defaults,...c.defaults,...o}}),s}const wy=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof rt<"u")return rt;throw new Error("unable to locate global object")}(),g7e=wy.fetch?(...t)=>wy.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),y7e=wy.Headers,m7e=wy.AbortController,v7e=xV({fetch:g7e,Headers:y7e,AbortController:m7e});var Ye;let dl=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,n,r){super(e),n instanceof Error&&(this.cause=n),this.privyErrorCode=r}},by=class extends dl{constructor(e,n,r,i,a,s){super(r,i,a),this.type=e,this.status=n,this.data=s}},Q=class extends dl{constructor(e,n,r){super(e,n,r),this.type="client_error"}},w7e=class extends Q{constructor(){super("Request timed out",void 0,"client_request_timeout")}},dn=class extends dl{constructor(e,n,r){super(e,n,r),this.type="connector_error"}};const xt=t=>{if(t instanceof dl)return t;if(!(t instanceof AV))return pn(t);if(!t.response)return new by("api_error",null,t.message,t);let{type:e,message:n,error:r,code:i}=t.data;return new by(e||"ApiError",t.response.status,n||r,t,i,t.data)},pn=t=>t instanceof dl?t:t instanceof Error?new Q(t.message,t):new Q(`Internal error: ${t}`);var fe=((Ye={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",Ye.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",Ye.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",Ye.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",Ye.INVALID_DATA="invalid_data",Ye.INVALID_CAPTCHA="invalid_captcha",Ye.LINKED_TO_ANOTHER_USER="linked_to_another_user",Ye.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",Ye.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",Ye.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",Ye.USER_EXITED_UPDATE_FLOW="exited_update_flow",Ye.ALLOWLIST_REJECTED="allowlist_rejected",Ye.OAUTH_USER_DENIED="oauth_user_denied",Ye.OAUTH_UNEXPECTED="oauth_unexpected",Ye.UNKNOWN_AUTH_ERROR="unknown_auth_error",Ye.USER_EXITED_AUTH_FLOW="exited_auth_flow",Ye.USER_EXITED_LINK_FLOW="exited_link_flow",Ye.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",Ye.MUST_BE_AUTHENTICATED="must_be_authenticated",Ye.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",Ye.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",Ye.CLIENT_REQUEST_TIMEOUT="client_request_timeout",Ye.INVALID_CREDENTIALS="invalid_credentials",Ye.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",Ye.UNKNOWN_MFA_ERROR="unknown_mfa_error",Ye.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",Ye.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",Ye.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",Ye.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",Ye.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",Ye.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",Ye.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",Ye.TRANSACTION_FAILURE="transaction_failure",Ye.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",Ye.NOT_SUPPORTED="not_supported",Ye.CAPTCHA_TIMEOUT="captcha_timeout",Ye.INVALID_MESSAGE="invalid_message",Ye.UNABLE_TO_SIGN="unable_to_sign",Ye.CAPTCHA_FAILURE="captcha_failure",Ye.CAPTCHA_DISABLED="captcha_disabled",Ye.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",Ye.TOO_MANY_REQUESTS="too_many_requests",Ye.USER_LIMIT_REACHED="max_accounts_reached",Ye.DISALLOWED_LOGIN_METHOD="disallowed_login_method",Ye.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",Ye.PASSKEY_NOT_ALLOWED="passkey_not_allowed",Ye.USER_DOES_NOT_EXIST="user_does_not_exist",Ye.INSUFFICIENT_BALANCE="insufficient_balance",Ye.ONRAMP_MINIMUM_IDENTITY_VERIFICATION_REQUIRED="onramp_minimum_identity_verification_required",Ye.ONRAMP_IDENTITY_VERIFICATION_REQUIRED="onramp_identity_verification_required",Ye.ONRAMP_DOCUMENT_VERIFICATION_REQUIRED="onramp_document_verification_required",Ye.ONRAMP_UNSUPPORTED_INFORMATION="onramp_unsupported_information",Ye.ONRAMP_TRANSACTION_LIMIT_REACHED="transaction_limit_reached",Ye.ONRAMP_QUOTE_EXPIRED="onramp_quote_expired",Ye.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",Ye.BUFFER_NOT_DEFINED="buffer_not_defined",Ye.UNSUPPORTED_WALLET_TYPE="unsupported_wallet_type",Ye.NO_SOLANA_ACCOUNTS="no_solana_accounts",Ye.UNKNOWN_FUNDING_ERROR="unknown_funding_error",Ye);let El=class extends Q{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},xat=class extends Q{constructor(e="Embedded wallet error",n){super(e,n,"unknown_embedded_wallet_error")}},Tat=class extends Q{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},kat=class extends Q{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}},nk=class extends dn{constructor(){super("No Solana accounts found in wallet",void 0,"no_solana_accounts")}};const _y=(t,e,n,r)=>{let i=Number(t),a=e.find(o=>o.id===i);if(!a)throw new dn(`Unsupported chainId ${t}`,4901);let s=IV(a,n,r.appId);if(i===ou.id||i===op.id){let o=i===ou.id?ou:op;return ti({transport:Ii(s),chain:o})}return ti({transport:Ii(s),chain:a})},IV=(t,e,n)=>{let r,i=t.id,a=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])r=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[a])r=e.rpcUrls[a];else if(t.rpcUrls.privy?.http[0]){let s=new URL(t.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",n),r=s.toString()}else r=t.rpcUrls.public?.http[0]?t.rpcUrls.public.http[0]:t.rpcUrls.default?.http[0];if(!r)throw new dn(`No RPC url found for ${i}`);return r},TV=t=>t.isApexWallet?"Apex Wallet":t.isAvalanche?"Core Wallet":t.isBackpack?"Backpack":t.isBifrost?"Bifrost Wallet":t.isBitKeep?"BitKeep":t.isBitski?"Bitski":t.isBlockWallet?"BlockWallet":t.isBraveWallet?"Brave Wallet":t.isClover?"Clover":t.isCoin98?"Coin98 Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isDawn?"Dawn Wallet":t.isDefiant?"Defiant":t.isDesig?"Desig Wallet":t.isEnkrypt?"Enkrypt":t.isExodus?"Exodus":t.isFordefi?"Fordefi":t.isFrame?"Frame":t.isFrontier?"Frontier Wallet":t.isGamestop?"GameStop Wallet":t.isHaqqWallet?"HAQQ Wallet":t.isHyperPay?"HyperPay Wallet":t.isImToken?"ImToken":t.isHaloWallet?"Halo Wallet":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isNovaWallet?"Nova Wallet":t.isOkxWallet||t.isOKExWallet?"OKX Wallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOneKey?"OneKey Wallet":t.isOpera?"Opera":t.isPhantom||"isPhantom"in t?"Phantom":t.isPortal?"Ripio Portal":t.isRabby?"Rabby Wallet":t.isRainbow?"Rainbow":t.isSafePal?"SafePal Wallet":t.isStatus?"Status":t.isSubWallet?"SubWallet":t.isTalisman?"Talisman":t.isTally||t.isTaho?"Taho":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isTTWallet?"TTWallet":t.isXDEFI?"XDEFI Wallet":t.isZeal?"Zeal":t.isZerion?"Zerion":t.isMetaMask?"MetaMask":void 0,LV=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;
74if(t.isBraveWallet&&!t._events&&!t._state||TV(t)!=="MetaMask")return!1;if(t.providers){for(let n of t.providers)if(!LV(n))return!1}return!0},Rat=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let e of t.ethereum.providers)if(e&&e.isCoinbaseWallet)return!0}return!1},Oat=(t,e)=>{let n=[],r=[];for(let[i,a]of t.entries())i<e?n.push(a):r.push(a);return[n,r]},Mat=t=>!!String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Nat=(t,e)=>{let n=t.slice(0),r=[];for(;n.length;)r.push(n.splice(0,e));return r},b7e=(t,e=3,n=4,r="ethereum")=>{if(!t)return"";let i=r==="ethereum"?2:0;return e+n+i+3>=t.length?t:`${t.slice(0,i+e)}...${t.slice(t.length-n,t.length)}`},Dat=(t,e=3,n=4)=>b7e(t,e,n,"solana"),Cy=t=>new Promise(e=>setTimeout(e,t));function rk(t,{interval:e=100,timeout:n=5e3}={}){return new Promise((r,i)=>{let a,s=0,o=()=>{s>=n?i("Max attempts reached without result"):(a=t(),s+=e,a==null?setTimeout(o,e):r(a))};o()})}const f8=(t,e={})=>{let n=e.delayMs||150,r=e.maxAttempts||270;return new Promise(async(i,a)=>{let s=!1,o=0;for(;!s&&o<r;){if(e.abortSignal?.aborted)return;t().then(c=>{s=!0,i(c)},(...c)=>{s=!0,a(...c)}),o+=1,await Cy(n)}s||a(Error("Exceeded max attempts before resolving function"))})},_7e=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),$1=t=>typeof t=="string"?t:"0x"+t.toString(16);async function C7e({store:t,walletList:e,externalWalletConfig:n,walletChainType:r,timeout:i=3e3}){let a=!1,s=window;return new Promise(o=>{function c(){if(a)return;a=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map(d=>d.info));let u=[];for(let d of l)e.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||r==="solana-only"&&d.info.rdns==="app.phantom"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});if(r!=="solana-only")for(let d of function(){let f=window,h=f.ethereum;if(!h)return[];let p=[];if(h.providers?.length)for(let g of h.providers)g&&p.push(g);return p.push(f.ethereum),p}()){let f=TV(d);if(!l.some(h=>h.info.name===f)){if(LV(d,!0)&&!u.find(h=>h.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(f==="Phantom"&&!u.find(h=>h.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(f==="Coinbase Wallet"&&!u.find(h=>h.type==="coinbase_wallet"&&n.coinbaseWallet?.config?.preference?.options!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(h=>h.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}o(u)}s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},i))})}function Ph(t){return`eip155:${String(Number(t))}`}const E7e=(t,e,n,r)=>{let i=Number(t),a=e.find(s=>s.id===i);if(!a)throw new dn(`Unsupported chainId ${t}`,4901);return IV(a,n,r)},Fat=(t,e)=>{let n=Number(t),r=e.find(i=>i.id===n);if(!r)throw new dn(`Unsupported chainId ${t}`,4901);return r.blockExplorers?.default.url},Ey=t=>{let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=t.types.EIP712Domain??Object.entries(t.domain).map(([r,i])=>{if(i!=null&&typeof r=="string"&&r in e)return{name:r,type:e[r]}}).filter(r=>r!==void 0);return{...t,types:{...t.types,EIP712Domain:n}}};function Uat(t,{min:e,max:n}){return Math.min(Math.max(t,e),n)}const ik=t=>t?.map(e=>({signer_id:e.signerId,override_policy_ids:e.policyIds}));let P1="[Privy:Connectors]";function R1(t){if(!t||Object.keys(t).length===0)return"";let e=Object.entries(t).filter(([,n])=>n!=null).map(([n,r])=>`${n}=${String(r)}`);return e.length>0?` (${e.join(", ")})`:""}const Ce=new class{setEnabled(t){this._enabled=t,t&&this.info("Debug logging enabled")}get enabled(){return this._enabled}debug(t,e){this._enabled&&console.debug(`${P1} ${t}${R1(e)}`)}info(t,e){this._enabled&&console.info(`${P1} ${t}${R1(e)}`)}warn(t,e){this._enabled&&console.warn(`${P1} ${t}${R1(e)}`)}error(t,e,n){if(!this._enabled)return;
74let r=e instanceof Error?e.message:e?String(e):void 0,i=r?{...n,error:r}:n;console.error(`${P1} ${t}${R1(i)}`)}connectionStart(t,e,n){this.info("Connection attempt started",{wallet:t,method:e,...n})}connectionSuccess(t,e){this.info("Connection successful",{wallet:t,...e})}connectionFailed(t,e,n){this.error("Connection failed",e,{wallet:t,...n})}connectorInit(t,e,n){this.debug("Connector initialized",{connector:t,wallet:e,...n})}connectorCreated(t,e,n){this.debug("Connector created",{connector:t,wallet:e,...n})}providerEvent(t,e,n){this.debug(`Provider event: ${t}`,{wallet:e,...n})}rpcRequest(t,e,n){this.debug(`RPC request: ${t}`,{wallet:e,...n})}rpcResponse(t,e,n){this.debug(`RPC response: ${t}`,{wallet:e,...n})}constructor(){this._enabled=!1}};let S7e=class extends dn{constructor(){super("Wallet timeout"),this.type="wallet_error",Ce.warn("Wallet request timed out")}};const fl=t=>{if(t instanceof dn)return Ce.debug("Connector error (already formatted)",{error:t.message}),t;if(typeof t?.code=="number"){let n=new ps(t);return Ce.debug("Provider RPC error",{code:n.code,error:n.message}),n}let e=t instanceof Error?t.message:String(t);return Ce.debug("Unknown connector error",{error:e}),new dn(e||"Unknown connector error",t)};let A7e=class extends dl{constructor(e,n,r){super(e),this.type="provider_error",this.code=n,this.data=r}},ps=class extends A7e{constructor(e){super(e.message,e.code,e.data);let n=Object.values(bd).find(r=>r.eipCode===e.code);this.details=n||bd.UNKNOWN_ERROR,e.code===-32002&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=bd.E32002_CONNECTION_ALREADY_PENDING:this.details=bd.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=bd.E32002_WALLET_LOCKED))}};const Hat={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...bd};let kV=class{get(e){let n=localStorage.getItem(e);return n===null?void 0:JSON.parse(n)}put(e,n){n!==void 0?localStorage.setItem(e,JSON.stringify(n)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}};function h8(){try{let t="privy:__session_storage__test",e=new kV;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var nt=typeof window<"u"&&window.localStorage?new kV:new class{get(t){return this._cache[t]}put(t,e){e!==void 0?this._cache[t]=e:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};let $V=class extends ll{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}};const HE=()=>{let t=nt.get(wV);return t&&Array.isArray(t)&&t.map(e=>(n=>n&&typeof n.address=="string"&&typeof n.connectorType=="string"&&typeof n.walletClientType=="string"&&typeof n.connectedAt=="number")(e)).every(Boolean)?t:[]};let x7e=["phantom","glow","solflare","backpack","okx_wallet","walletconnect","mobile_wallet_adapter","jupiter","tokenpocket"];function I7e(t){return t.toLowerCase().split(" ").join("_")}let T7e=class extends $V{get isInstalled(){return!0}get wallet(){return this._wallet}buildConnectedWallet(){return this._wallet.accounts.map(e=>({type:"solana",provider:new O5e({wallet:this._wallet,account:e}),address:e.address,connectedAt:Date.now(),walletClientType:this._wallet.name,connectorType:this.connectorType,imported:!1,meta:{name:this._wallet.name,id:this._wallet.name,icon:this._wallet.icon},isConnected:async()=>this._wallet.accounts.length>0,disconnect:async()=>{await this.disconnect()}}))}async syncAccounts(){this.wallets=this.buildConnectedWallet(),this.emit("walletsUpdated")}get walletBranding(){return{id:ak(this.wallet)?"walletconnect_solana":this.wallet.name,name:this.wallet.name,icon:this.wallet.icon}}async initialize(){Ce.debug("Initializing Solana connector",{wallet:this.walletClientType}),this.subscribeListeners(),await this.syncAccounts(),this.shouldAttemptAutoConnect()&&
74(Ce.debug("Attempting Solana auto-connect",{wallet:this.walletClientType}),await this.wallet.features["standard:connect"]?.connect({silent:!0}).catch(()=>{}),await this.isConnected()&&(Ce.debug("Solana auto-connect successful",{wallet:this.walletClientType}),await this.syncAccounts())),this.initialized=!0,this.emit("initialized")}async connect(e){if(Ce.connectionStart(this.walletClientType,"solana_adapter",{showPrompt:e.showPrompt}),e.showPrompt)try{await this.promptConnection()}catch(r){throw this._wallet.accounts.length===0?(Ce.warn("Solana wallet connected but has no accounts",{wallet:this.walletClientType}),new nk):(Ce.connectionFailed(this.walletClientType,r,{method:"solana_adapter"}),r)}if(!await this.isConnected())throw Ce.warn("Solana wallet not connected after prompt",{wallet:this.walletClientType}),new nk;await this.syncAccounts();let n=await this.getConnectedWallet();return n&&Ce.connectionSuccess(this.walletClientType),n}async getConnectedWallet(){return this.wallets.sort((e,n)=>n.connectedAt-e.connectedAt)[0]||null}async isConnected(){return this._wallet.accounts.length>0}subscribeListeners(){this._unsubscribeListeners=this.wallet.features["standard:events"]?.on("change",this.onChange)}unsubscribeListeners(){this._unsubscribeListeners?.()}shouldAttemptAutoConnect(){return!(!this.autoConnectEnabled||!x7e.includes(this.walletClientType))&&(this.walletClientType!=="phantom"||HE().some(({walletClientType:e})=>e==="phantom"))}constructor(e,n){super(I7e(ak(e)?"walletconnect_solana":e.name)),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=async()=>{Ce.debug("Disconnecting Solana wallet",{wallet:this.walletClientType}),await this.wallet.features["standard:disconnect"]?.disconnect().catch(r=>{Ce.error("Error disconnecting Solana wallet",r,{wallet:this.walletClientType})}),await this.syncAccounts()},this.promptConnection=async()=>{Ce.debug("Prompting Solana connection",{wallet:this.walletClientType});try{await this.wallet.features["standard:connect"]?.connect()}catch(r){throw Ce.connectionFailed(this.walletClientType,r,{method:"solana_adapter"}),fl(r)}},this.onChange=()=>{this.syncAccounts()},this._wallet=e,this.autoConnectEnabled=n,this.wallets=[]}};function ak(t){return"isWalletConnectSolana"in t&&t.isWalletConnectSolana}const Zat=({style:t,...e})=>{let n=zr();return m.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[m.jsx("rect",{width:"28",height:"28",rx:"3",fill:n?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),m.jsx("g",{clipPath:"url(#clip0_1765_9946)",children:m.jsx("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3
74639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_1765_9946",children:m.jsx("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},L7e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC";var Ke={},p8={exports:{}};(function(t,e){(function(n,r){var i="1.0.40",a="",s="?",o="function",c="undefined",l="object",u="string",d="major",f="model",h="name",p="type",g="vendor",y="version",v="architecture",b="console",w="mobile",_="tablet",E="smarttv",C="wearable",x="embedded",$=500,T="Amazon",U="Apple",O="ASUS",F="BlackBerry",k="Browser",S="Chrome",I="Edge",A="Firefox",R="Google",N="Huawei",P="LG",j="Microsoft",M="Motorola",V="Opera",B="Samsung",G="Sharp",Z="Sony",ie="Xiaomi",oe="Zebra",z="Facebook",J="Chromium OS",K="Mac OS",ne=" Browser",ce=function(_e,Ie){var qe={};for(var Fe in _e)Ie[Fe]&&Ie[Fe].length%2===0?qe[Fe]=Ie[Fe].concat(_e[Fe]):qe[Fe]=_e[Fe];return qe},xe=function(_e){for(var Ie={},qe=0;qe<_e.length;qe++)Ie[_e[qe].toUpperCase()]=_e[qe];return Ie},ke=function(_e,Ie){return typeof _e===u?Me(Ie).indexOf(Me(_e))!==-1:!1},Me=function(_e){return _e.toLowerCase()},$t=function(_e){return typeof _e===u?_e.replace(/[^\d\.]/g,a).split(".")[0]:r},H=function(_e,Ie){if(typeof _e===u)return _e=_e.replace(/^\s\s*/,a),typeof Ie===c?_e:_e.substring(0,$)},q=function(_e,Ie){for(var qe=0,Fe,pt,ze,Ue,Ve,st;qe<Ie.length&&!Ve;){var as=Ie[qe],Ku=Ie[qe+1];for(Fe=pt=0;Fe<as.length&&!Ve&&as[Fe];)if(Ve=as[Fe++].exec(_e),Ve)for(ze=0;ze<Ku.length;ze++)st=Ve[++pt],Ue=Ku[ze],typeof Ue===l&&Ue.length>0?Ue.length===2?typeof Ue[1]==o?this[Ue[0]]=Ue[1].call(this,st):this[Ue[0]]=Ue[1]:Ue.length===3?typeof Ue[1]===o&&!(Ue[1].exec&&Ue[1].test)?this[Ue[0]]=st?Ue[1].call(this,st,Ue[2]):r:this[Ue[0]]=st?st.replace(Ue[1],Ue[2]):r:Ue.length===4&&(this[Ue[0]]=st?Ue[3].call(this,st.replace(Ue[1],Ue[2])):r):this[Ue]=st||r;qe+=2}},se=function(_e,Ie){for(var qe in Ie)if(typeof Ie[qe]===l&&Ie[qe].length>0){for(var Fe=0;Fe<Ie[qe].length;Fe++)if(ke(Ie[qe][Fe],_e))return qe===s?r:qe}else if(ke(Ie[qe],_e))return qe===s?r:qe;return Ie.hasOwnProperty("*")?Ie["*"]:_e},de={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},he={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},pe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,V+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,V+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,V]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+k],y],[/\bfocus\/([\w\.]+)/i],[y,[h,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,V+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,V+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI"+ne]],[/fxios\/([\w\.-]+)/i],[y,[h,A]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+ne],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,B+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,z],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.
vendor: 5,884 bytes, line 74
74+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,S+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,se,de]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[h,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[v,"amd64"]],[/(ia32(?=;))/i],[[v,Me]],[/((?:i[346]|x)86)[;\)]/i],[[v,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[v,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[v,"armhf"]],[/windows (ce|mobile); ppc;/i],[[v,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[v,/ower/,a,Me]],[/(sun4\w)[;\)]/i],[[v,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[v,Me]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[g,B],[p,_]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[f,[g,B],[p,w]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[g,U],[p,w]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[g,U],[p,_]],[/(macintosh);/i],[f,[g,U]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[g,G],[p,w]],[/(?:honor)([-\w ]+)[;\)]/i],[f,[g,"Honor"],[p,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[g,N],[p,_]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[g,N],[p,w]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[f,/_/g," "],[g,ie],[p,w]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[g,ie],[p,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[g,"OPPO"],[p,w]],[/\b(opd2\d{3}a?) bui/i],[f,[g,"OPPO"],[p,_]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[g,"Vivo"],[p,w]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[f,[g,"Realme"],[p,w]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[g,M],[p,w]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[g,M],[p,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[g,P],[p,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[g,P],[p,w]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[g,"Lenovo"],[p,_]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[g,"Nokia"],[p,w]],[/(pixel c)\b/i],[f,[g,R],[p,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[g,R],[p,w]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[g,Z],[p,w]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[g,Z],[p,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[g,"OnePlus"],[p,w]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[g,T],[p,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[g,T],[p,w]],[/(playbook);[-\w\),; ]+(rim)/i],[f,g,[p,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[g,F],[p,w]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[g,O],[p,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[g,O],[p,w]],[/(nexus 9)/i],[f,[g,"HTC"],[p,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[f,/_/g," "],[p,w]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[f,[g,"TCL"],[p,_]],[/(itel) ((\w+))/i],[[g,Me],f,[p,se,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[g,"Acer"],[p,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[g,"Meizu"],[p,w]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[f,[g,"Ulefone"],[p,w]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[f,[g,"Energizer"],[p,w]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[f,[g,"Cat"],[p,w]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[f,[g,"Smartfren"],[p,w]],[/droid.+; (a(?:015|06[35]|142p?))/i],[f,[g,"Nothing"],[p,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/;
vendor: 6,368 bytes, line 74
74 (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,f,[p,w]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,f,[p,_]],[/(surface duo)/i],[f,[g,j],[p,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[g,"Fairphone"],[p,w]],[/(u304aa)/i],[f,[g,"AT&T"],[p,w]],[/\bsie-(\w*)/i],[f,[g,"Siemens"],[p,w]],[/\b(rct\w+) b/i],[f,[g,"RCA"],[p,_]],[/\b(venue[\d ]{2,7}) b/i],[f,[g,"Dell"],[p,_]],[/\b(q(?:mv|ta)\w+) b/i],[f,[g,"Verizon"],[p,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[g,"Barnes & Noble"],[p,_]],[/\b(tm\d{3}\w+) b/i],[f,[g,"NuVision"],[p,_]],[/\b(k88) b/i],[f,[g,"ZTE"],[p,_]],[/\b(nx\d{3}j) b/i],[f,[g,"ZTE"],[p,w]],[/\b(gen\d{3}) b.+49h/i],[f,[g,"Swiss"],[p,w]],[/\b(zur\d{3}) b/i],[f,[g,"Swiss"],[p,_]],[/\b((zeki)?tb.*\b) b/i],[f,[g,"Zeki"],[p,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],f,[p,_]],[/\b(ns-?\w{0,9}) b/i],[f,[g,"Insignia"],[p,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[g,"NextBook"],[p,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],f,[p,w]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],f,[p,w]],[/\b(ph-1) /i],[f,[g,"Essential"],[p,w]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[g,"Envizen"],[p,_]],[/\b(trio[-\w\. ]+) b/i],[f,[g,"MachSpeed"],[p,_]],[/\btu_(1491) b/i],[f,[g,"Rotor"],[p,_]],[/(shield[\w ]+) b/i],[f,[g,"Nvidia"],[p,_]],[/(sprint) (\w+)/i],[g,f,[p,w]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[g,j],[p,w]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[g,oe],[p,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[g,oe],[p,w]],[/smart-tv.+(samsung)/i],[g,[p,E]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[g,B],[p,E]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,P],[p,E]],[/(apple) ?tv/i],[g,[f,U+" TV"],[p,E]],[/crkey/i],[[f,S+"cast"],[g,R],[p,E]],[/droid.+aft(\w+)( bui|\))/i],[f,[g,T],[p,E]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[g,G],[p,E]],[/(bravia[\w ]+)( bui|\))/i],[f,[g,Z],[p,E]],[/(mitv-\w{5}) bui/i],[f,[g,ie],[p,E]],[/Hbbtv.*(technisat) (.*);/i],[g,f,[p,E]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,H],[f,H],[p,E]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,E]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,f,[p,b]],[/droid.+; (shield) bui/i],[f,[g,"Nvidia"],[p,b]],[/(playstation [345portablevi]+)/i],[f,[g,Z],[p,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[g,j],[p,b]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[f,[g,B],[p,C]],[/((pebble))app/i],[g,f,[p,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[g,U],[p,C]],[/droid.+; (glass) \d/i],[f,[g,R],[p,C]],[/droid.+; (wt63?0{2,3})\)/i],[f,[g,oe],[p,C]],[/droid.+; (glass) \d/i],[f,[g,R],[p,C]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,f,[p,C]],[/; (quest( \d| pro)?)/i],[f,[g,z],[p,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[p,x]],[/(aeobc)\b/i],[f,[g,T],[p,x]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[f,[p,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[p,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,w]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,I+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[y,se,he]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,se,he],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,K],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,y],[/\(bb(10);/i],[y,[h,F]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,J],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},ye=function(_e,Ie){if(typeof _e===l&&(Ie=_e,_e=r),!(this instanceof ye))return new ye(_e,Ie).getResult();var qe=typeof n!==c&&n.navigator?n.navigator:r,Fe=_e||(qe&&qe.userAgent?qe.userAgent:a),pt=qe&&qe.userAgentData?qe.userAgentData:r,ze=Ie?ce(pe,Ie):pe,Ue=qe&&qe.userAgent==Fe;return this.getBrowser=function(){var Ve={};
74return Ve[h]=r,Ve[y]=r,q.call(Ve,Fe,ze.browser),Ve[d]=$t(Ve[y]),Ue&&qe&&qe.brave&&typeof qe.brave.isBrave==o&&(Ve[h]="Brave"),Ve},this.getCPU=function(){var Ve={};return Ve[v]=r,q.call(Ve,Fe,ze.cpu),Ve},this.getDevice=function(){var Ve={};return Ve[g]=r,Ve[f]=r,Ve[p]=r,q.call(Ve,Fe,ze.device),Ue&&!Ve[p]&&pt&&pt.mobile&&(Ve[p]=w),Ue&&Ve[f]=="Macintosh"&&qe&&typeof qe.standalone!==c&&qe.maxTouchPoints&&qe.maxTouchPoints>2&&(Ve[f]="iPad",Ve[p]=_),Ve},this.getEngine=function(){var Ve={};return Ve[h]=r,Ve[y]=r,q.call(Ve,Fe,ze.engine),Ve},this.getOS=function(){var Ve={};return Ve[h]=r,Ve[y]=r,q.call(Ve,Fe,ze.os),Ue&&!Ve[h]&&pt&&pt.platform&&pt.platform!="Unknown"&&(Ve[h]=pt.platform.replace(/chrome os/i,J).replace(/macos/i,K)),Ve},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Fe},this.setUA=function(Ve){return Fe=typeof Ve===u&&Ve.length>$?H(Ve,$):Ve,this},this.setUA(Fe),this};ye.VERSION=i,ye.BROWSER=xe([h,y,d]),ye.CPU=xe([v]),ye.DEVICE=xe([f,g,p,b,w,E,_,C,x]),ye.ENGINE=ye.OS=xe([h,y]),t.exports&&(e=t.exports=ye),e.UAParser=ye;var ge=typeof n!==c&&(n.jQuery||n.Zepto);if(ge&&!ge.ua){var Pe=new ye;ge.ua=Pe.getResult(),ge.ua.get=function(){return Pe.getUA()},ge.ua.set=function(_e){Pe.setUA(_e);var Ie=Pe.getResult();for(var qe in Ie)ge.ua[qe]=Ie[qe]}}})(typeof window=="object"?window:_s)})(p8,p8.exports);var k7e=p8.exports;Object.defineProperty(Ke,"__esModule",{value:!0});function $7e(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Vr=L,nn=$7e(Vr),PV=k7e,hl=new PV,Zr=hl.getBrowser(),P7e=hl.getCPU(),na=hl.getDevice(),WE=hl.getEngine(),pl=hl.getOS(),m0=hl.getUA(),RV=function(e){return hl.setUA(e)},v0=function(e){if(!e){console.error("No userAgent string was provided");return}var n=new PV(e);return{UA:n,browser:n.getBrowser(),cpu:n.getCPU(),device:n.getDevice(),engine:n.getEngine(),os:n.getOS(),ua:n.getUA(),setUserAgent:function(i){return n.setUA(i)}}},OV=Object.freeze({ClientUAInstance:hl,browser:Zr,cpu:P7e,device:na,engine:WE,os:pl,ua:m0,setUa:RV,parseUserAgent:v0});function sk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function R7e(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?sk(Object(n),!0).forEach(function(r){D7e(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Rh(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rh=function(e){return typeof e}:Rh=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rh(t)}function O7e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M7e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N7e(t,e,n){return e&&M7e(t.prototype,e),t}function D7e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g8(){return g8=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},g8.apply(this,arguments)}function F7e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m8(t,e)}function y8(t){return y8=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},y8(t)}function m8(t,e){return m8=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},m8(t,e)}function U7e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Ta(t,e){if(t==null)return{};var n=U7e(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function W3(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j7e(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W3(t)}function B7e(t,e){return V7e(t)||H7e(t,e)||W7e(t,e)||q7e()}function V7e(t){if(Array.isArray(t))return t}function H7e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,s,o;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw o}}return r}}function W7e(t,e){if(t){if(typeof t=="string")return ok(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ok(t,e)}}function ok(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}
74function q7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 75In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ur={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},Ti={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},G2={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},z7e={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},Z7e=function(e){switch(e){case Ur.Mobile:return{isMobile:!0};case Ur.Tablet:return{isTablet:!0};case Ur.SmartTv:return{isSmartTV:!0};case Ur.Console:return{isConsole:!0};case Ur.Wearable:return{isWearable:!0};case Ur.Browser:return{isBrowser:!0};case Ur.Embedded:return{isEmbedded:!0};default:return z7e}},K7e=function(e){return RV(e)},dt=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return e||n},qE=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},zE=function(e){var n=qE();return n&&n.platform&&(n.platform.indexOf(e)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},G7e=function(e,n,r,i,a){return{isBrowser:e,browserMajorVersion:dt(n.major),browserFullVersion:dt(n.version),browserName:dt(n.name),engineName:dt(r.name),engineVersion:dt(r.version),osName:dt(i.name),osVersion:dt(i.version),userAgent:dt(a)}},ck=function(e,n,r,i){return R7e({},e,{vendor:dt(n.vendor),model:dt(n.model),os:dt(r.name),osVersion:dt(r.version),ua:dt(i)})},Y7e=function(e,n,r,i){return{isSmartTV:e,engineName:dt(n.name),engineVersion:dt(n.version),osName:dt(r.name),osVersion:dt(r.version),userAgent:dt(i)}},J7e=function(e,n,r,i){return{isConsole:e,engineName:dt(n.name),engineVersion:dt(n.version),osName:dt(r.name),osVersion:dt(r.version),userAgent:dt(i)}},X7e=function(e,n,r,i){return{isWearable:e,engineName:dt(n.name),engineVersion:dt(n.version),osName:dt(r.name),osVersion:dt(r.version),userAgent:dt(i)}},Q7e=function(e,n,r,i,a){return{isEmbedded:e,vendor:dt(n.vendor),model:dt(n.model),engineName:dt(r.name),engineVersion:dt(r.version),osName:dt(i.name),osVersion:dt(i.version),userAgent:dt(a)}};function ewe(t){var e=t?v0(t):OV,n=e.device,r=e.browser,i=e.engine,a=e.os,s=e.ua,o=Z7e(n.type),c=o.isBrowser,l=o.isMobile,u=o.isTablet,d=o.isSmartTV,f=o.isConsole,h=o.isWearable,p=o.isEmbedded;if(c)return G7e(c,r,i,a,s);if(d)return Y7e(d,i,a,s);if(f)return J7e(f,i,a,s);if(l||u)return ck(o,n,a,s);if(h)return X7e(h,i,a,s);if(p)return Q7e(p,n,i,a,s)}var MV=function(e){var n=e.type;return n===Ur.Mobile},NV=function(e){var n=e.type;return n===Ur.Tablet},DV=function(e){var n=e.type;return n===Ur.Mobile||n===Ur.Tablet},FV=function(e){var n=e.type;return n===Ur.SmartTv},Sy=function(e){var n=e.type;return n===Ur.Browser},UV=function(e){var n=e.type;return n===Ur.Wearable},jV=function(e){var n=e.type;return n===Ur.Console},BV=function(e){var n=e.type;return n===Ur.Embedded},VV=function(e){var n=e.vendor;return dt(n)},HV=function(e){var n=e.model;return dt(n)},WV=function(e){var n=e.type;return dt(n,"browser")},qV=function(e){var n=e.name;return n===G2.Android},zV=function(e){var n=e.name;return n===G2.Windows},ZV=function(e){var n=e.name;return n===G2.MAC_OS},KV=function(e){var n=e.name;return n===G2.WindowsPhone},GV=function(e){var n=e.name;return n===G2.IOS},YV=function(e){var n=e.version;return dt(n)},JV=function(e){var n=e.name;return dt(n)},XV=function(e){var n=e.name;return n===Ti.Chrome},QV=function(e){var n=e.name;return n===Ti.Firefox},eH=function(e){var n=e.name;return n===Ti.Chromium},Ay=function(e){var n=e.name;return n===Ti.Edge},tH=function(e){var n=e.name;return n===Ti.Yandex},nH=function(e){var n=e.name;return n===Ti.Safari||n===Ti.MobileSafari},rH=function(e){var n=e.name;return n===Ti.MobileSafari},iH=function(e){var n=e.name;return n===Ti.Opera},aH=function(e){var n=e.name;return n===Ti.InternetExplorer||n===Ti.Ie},sH=function(e){var n=e.name;return n===Ti.MIUI},oH=function(e){var n=e.name;return n===Ti.SamsungBrowser},cH=function(e){var n=e.version;return dt(n)},lH=function(e){var n=e.major;return dt(n)},uH=function(e){var n=e.name;return dt(n)},dH=function(e){var n=e.name;return dt(n)},fH=function(e){var n=e.version;return dt(n)},hH=function(){var e=qE(),n=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},Wd=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},pH=function(){var e=qE();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},Is=function(){return zE("iPad")},gH=function(){return zE("iPhone")},yH=function(){return zE("iPod")},mH=function(e){return dt(e)};function vH(t){var e=t||OV,n=e.device,r=e.browser,i=e.os,a=e.engine,s=e.ua;return{isSmartTV:FV(n),isConsole:jV(n),isWearable:UV(n),isEmbedded:BV(n),isMobileSafari:rH(r)||Is(),isChromium:eH(r),isMobile:DV(n)||Is(),isMobileOnly:MV(n),isTablet:NV(n)||Is(),isBrowser:Sy(n),isDesktop:Sy(n),isAndroid:qV(i),isWinPhone:KV(i),isIOS:GV(i)||Is(),isChrome:XV(r),isFirefox:QV(r),isSafari:nH(r),isOpera:iH(r),isIE:aH(r),osVersion:YV(i),osName:JV(i),fullBrowserVersion:cH(r),browserVersion:lH(r),browserName:uH(r),mobileVendor:VV(n),mobileModel:HV(n),engineName:dH(a),engineVersion:fH(a),getUA:mH(s),isEdge:Ay(r)||Wd(s),isYandex:tH(r),deviceType:WV(n),isIOS13:pH(),isIPad13:Is(),isIPhone13:gH(),isIPod13:yH(),isElectron:hH(),isEdgeChromium:Wd(s),isLegacyEdge:Ay(r)&&!Wd(s),isWindows:zV(i),isMacOs:ZV(i),isMIUI:sH(r),isSamsungBrowser:oH(r)}}var wH=FV(na),bH=jV(na),_H=UV(na),twe=BV(na),nwe=rH(Zr)||Is(),rwe=eH(Zr),ov=DV(na)||Is(),CH=MV(na),EH=NV(na)||Is(),SH=Sy(na),iwe=Sy(na),AH=qV(pl),xH=KV(pl),IH=GV(pl)||Is(),awe=XV(Zr),swe=QV(Zr),owe=nH(Zr),cwe=iH(Zr),TH=aH(Zr),lwe=YV(pl),uwe=JV(pl),dwe=cH(Zr),fwe=lH(Zr),hwe=uH(Zr),pwe
75=VV(na),gwe=HV(na),ywe=dH(WE),mwe=fH(WE),vwe=mH(m0),wwe=Ay(Zr)||Wd(m0),bwe=tH(Zr),_we=WV(na),Cwe=pH(),Ewe=Is(),Swe=gH(),Awe=yH(),xwe=hH(),Iwe=Wd(m0),Twe=Ay(Zr)&&!Wd(m0),Lwe=zV(pl),kwe=ZV(pl),$we=sH(Zr),Pwe=oH(Zr),Rwe=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var n=v0(e),r=n.device,i=n.browser,a=n.os,s=n.engine,o=n.ua;return vH({device:r,browser:i,os:a,engine:s,ua:o})},Owe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return AH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Mwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return SH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Nwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return TH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Dwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return IH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Fwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return ov?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Uwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return EH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},jwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return xH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Bwe=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=Ta(e,["renderWithFragment","children","viewClassName","style"]);return CH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Vwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return wH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Hwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return bH?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},Wwe=function(e){var n=e.renderWithFragment,r=e.children,i=Ta(e,["renderWithFragment","children"]);return _H?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",i,r):null},qwe=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=e.condition,a=Ta(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?nn.createElement(Vr.Fragment,null,r):nn.createElement("div",a,r):null};function zwe(t){return function(e){F7e(n,e);function n(r){var i;return O7e(this,n),i=j7e(this,y8(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(W3(i)),i.onOrientationChange=i.onOrientationChange.bind(W3(i)),i.onPageLoad=i.onPageLoad.bind(W3(i)),i.state={isLandscape:!1,isPortrait:!1},i}return N7e(n,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var i=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:i===0,isLandscape:i===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":Rh(window))!==void 0&&ov&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return nn.createElement(t,g8({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(nn.Component)}function Zwe(){var t=Vr.useState(function(){var a=window.innerWidth>window.innerHeight?90:0;return{isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"}}),e=B7e(t,2),n=e[0],r=e[1],i=Vr.useCallback(function(){var a=window.innerWidth>window.innerHeight?90:0,s={isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"};n.orientation!==s.orientation&&r(s)},[n.orientation]);return Vr.useEffect(function(){return(typeof window>"u"?"undefined":Rh(window))!==void 0&&ov&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),n}function LH(t){var e=t||window.navigator.userAgent;return v0(e)}function Kwe(t){var e=t||window.navigator.userAgent,n=LH(e),r=vH(n);return[r,n]}Ke.AndroidView=Owe;Ke.BrowserTypes=Ti;Ke.BrowserView=Mwe;Ke.ConsoleView=Hwe;Ke.CustomView=qwe;Ke.IEView=Nwe;Ke.IOSView=Dwe;Ke.MobileOnlyView=Bwe;Ke.MobileView=Fwe;Ke.OsTypes=G2;Ke.SmartTVView=Vwe;Ke.TabletView=Uwe;Ke.WearableView=Wwe;Ke.WinPhoneView=jwe;Ke.browserName=hwe;Ke.browserVersion=fwe;Ke.deviceDetect=ewe;Ke.deviceType=_we;Ke.engineName=ywe;Ke.engineVersion=mwe;Ke.fullBrowserVersion=dwe;Ke.getSelectorsByUserAgent=Rwe;Ke.getUA=vwe;var kH=Ke.isAndroid=AH;Ke.isBrowser=SH;Ke.isChrome=awe;Ke.isChromium=rwe;Ke.isConsole=bH;Ke.isDesktop=iwe;Ke.isEdge=wwe;Ke.isEdgeChromium=Iwe;Ke.isElectron=xwe;Ke.isEmbedded=twe;var lk=Ke.isFirefox=swe;Ke.isIE=TH;var Gwe=Ke.isIOS=IH;Ke.isIOS13=Cwe;Ke.isIPad13=Ewe;Ke.isIPhone13=Swe;Ke.isIPod13=Awe;Ke.isLegacyEdge=Twe;Ke.isMIUI=$we;Ke.isMacOs=kwe;var Lp=Ke.isMobile=ov;Ke.isMobileOnly=CH;Ke.isMobileSafari=nwe;Ke.isOpera=cwe;var Ywe=Ke.isSafari=owe;Ke.isSamsungBrowser=Pwe;Ke.isSmartTV=wH;Ke.isTablet=EH;Ke.isWearable=_H;Ke.isWinPhone=xH;Ke.isWindows=Lwe;Ke.isYandex=bwe;Ke.mobileModel=gwe;Ke.mobileVendor=pwe;Ke.osName=uwe;Ke.osVersion=lwe;Ke.parseUserAgent=v0;Ke.setUserAgent=K7e;Ke.useDeviceData=LH;Ke.useDeviceSelectors=Kwe;Ke.useMobileOrientation=Zwe;
75Ke.withOrientationChange=zwe;const kp=Pi(()=>({listings:[],loading:!1})),M5=kp.setState,Jwe=t=>kp.getState().listings.find(({slug:e})=>xy(e)===xy(t)),N5=t=>{let e;try{e=new URL(t).hostname}catch{return}return kp.getState().listings.find(({homepage:n})=>{let r;try{r=new URL(n).hostname}catch{return!1}return e.includes(r)})},$H=(t=!0)=>{let e=zr(),n=kp(a=>a.listings),r=kp(a=>a.loading),i=!!n.length;return L.useEffect(()=>{t&&!i&&(M5({listings:[],loading:!0}),(async a=>{let s=new URL("v3/wallets","https://explorer-api.walletconnect.com");s.searchParams.append("projectId",a);let o=await fetch(s);return o.ok?Object.values((await o.json()).listings).sort(({slug:c},{slug:l})=>c==="rainbow"&&l==="metamask"?1:c==="metamask"||c==="rainbow"?-1:1):(console.debug(`Failed to fetch WalletConnect listings: ${await o.text().catch(()=>"No response.")}`),[])})(e.walletConnectCloudProjectId).then(a=>M5({listings:a,loading:!1})).catch(a=>{console.error(a),M5({listings:[],loading:!1})}))},[t,i,e.walletConnectCloudProjectId]),{listings:n,loading:r}},Kat=t=>{let{listings:e}=$H();return e.find(({slug:n})=>xy(n)===xy(t))};function xy(t){return t==="cryptocom"?"cryptocom-defi":t==="binance"?"binance-defi":t.replace(/[-_]wallet$/,"")}function v8(t){return["wallet_connect","backpack","binance","binanceus","bitget_wallet","bybit_wallet","cryptocom","haha_wallet","jupiter","metamask","okx_wallet","phantom","rabby_wallet","rainbow","ronin_wallet","safe","solflare","uniswap","zerion","kraken_wallet","robinhood_wallet"].some(e=>t?.includes(e))}function Sc(t){return t.type==="ethereum"}function PH(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r?.address!==i?.address||r&&i&&Sc(r)&&Sc(i)&&r?.chainId!==i?.chainId||r?.connectorType!==i?.connectorType||r?.connectedAt!==i?.connectedAt||r?.walletClientType!==i?.walletClientType||r?.isConnected!==i?.isConnected||r?.linked!==i?.linked)return!1}return!0}const ZE=(t,e)=>t.rpcTimeouts&&t.rpcTimeouts[e]||av;function D5(t){return t.chainType==="ethereum"}let Y2=class extends $V{buildConnectedWallet(e,n,r,i){let a=async()=>!!this.wallets.find(s=>_t(s.address)===_t(e));return{type:"ethereum",address:_t(e),chainId:n,meta:r,imported:i,switchChain:async s=>{let o,c;if(!a)throw new dn("Wallet is not currently connected.");let l=this.wallets.find(f=>_t(f.address)===_t(e))?.chainId;if(!l)throw new dn("Unable to determine current chainId.");if(typeof s=="number"?(o=`0x${s.toString(16)}`,c=s):(o=s,c=Number(s)),l===Ph(o))return;let u=this.chains.find(f=>f.id===c);if(!u)throw new dn(`Unsupported chainId: ${s}`);let d=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})};try{return await d()}catch(f){if(((h,p)=>{switch(p){case"coinbase_wallet":case"base_account":return h.message.includes("addEthereumChain");case"rabby_wallet":return h.message.includes("Unrecognized chain ID");default:return h.code===4902||h.message?.includes("4902")}})(f,this.walletClientType))return this.walletClientType==="rabby_wallet"&&await Cy(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[u.rpcUrls.default?.http[0]??""],blockExplorerUrls:[u.blockExplorers?.default.url??""]}]}),d();throw this.walletClientType==="rainbow"&&f.message?.includes("wallet_switchEthereumChain")?new dn(`Rainbow does not support the chainId ${n}`):f}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new dn("Wallet is not currently connected.");return this.proxyProvider},sign:async s=>{if(!await a())throw new dn("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let n;Ce.debug("Syncing accounts",{wallet:this.walletClientType});let r=e;try{if(r===void 0){Ce.rpcRequest("eth_accounts",this.walletClientType);let c=await f8(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Ce.rpcResponse("eth_accounts",this.walletClientType),Array.isArray(c)&&(r=c)}}catch{Ce.warn("Wallet did not respond to eth_accounts, using prefetched accounts",{wallet:this.walletClientType})}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return void Ce.debug("No accounts found",{wallet:this.walletClientType});let i=r[0];if(!t2(i))return;let a=_t(i),s=[];if(this.walletClientType==="privy"){let c=nt.get(P5(a));this.chains.find(l=>l.id===Number(c))||(nt.del(P5(a)),c=null),n=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})}catch{Ce.warn("Unable to switch embedded wallet chain on initialization",{wallet:this.walletClientType,chainId:n})}}else try{Ce.rpcRequest("eth_chainId",this.walletClientType);let c=await f8(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(Ce.rpcResponse("eth_chainId",this.walletClientType),typeof c=="string")n=c;else{if(typeof c!="number")throw Error("Invalid chainId returned from provider");n=`0x${c.toString(16)}`}}catch{Ce.warn("Failed to get chainId from provider, using default",{wallet:this.walletClientType,defaultChainId:JL}),n=JL}let o=Ph(n);if(!s.find(c=>_t(c.address)===a)){let c={name:this.walletBranding.name,icon:this.walletBranding.icon,id:this.walletBranding.id};s.push(this.buildConnectedWallet(_t(i),o,c,this.connectorType==="embedded_imported"))}PH(s,this.wallets)||(Ce.debug("Wallets updated",{wallet:this.walletClientType,address:a,chainId:o}
75),this.wallets=s,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((n,r)=>r.connectedAt-n.connectedAt).find(n=>e.find(r=>_t(r)===_t(n.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[An(e),this.wallets[0]?.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,n,r,i){super(e),this.chainType="ethereum",this.onAccountsChanged=a=>{Ce.providerEvent("accountsChanged",this.walletClientType,{accountsCount:a.length}),a.length===0?this.onDisconnect():this.syncAccounts(a)},this.onChainChanged=a=>{Ce.providerEvent("chainChanged",this.walletClientType,{chainId:a}),this.wallets.forEach(s=>{s.chainId=Ph(a),this.walletClientType==="privy"&&nt.put(P5(s.address),a)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{Ce.providerEvent("disconnect",this.walletClientType),this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{Ce.providerEvent("connect",this.walletClientType),this.connectorType==="base_account"&&this.connected||(this.connected=!0,this.connectorType==="coinbase_wallet"&&await Cy(500),this.syncAccounts())},this.wallets=[],this.walletClientType=e,this.chains=n,this.defaultChain=r,this.rpcConfig=i,this.rpcTimeoutDuration=ZE(i,e),this.connected=!1,this.initialized=!1}},Mu=class{on(e,n){if(this.walletProvider)return this.walletProvider.on(e,n);this._subscriptions.push({eventName:e,listener:n})}async request(e){if(!this.walletProvider)throw new dn(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(n=>{throw fl(n)})}constructor(e,n){this.removeListener=(r,i)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(r,i)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(r=new S7e,i=this.rpcTimeoutDuration)=>new Promise((a,s)=>setTimeout(()=>{s(r)},i)),this.setWalletProvider=r=>{this.walletProvider&&this._subscriptions.forEach(i=>{this.removeListener(i.eventName,i.listener)}),this.walletProvider=r,this._subscriptions.forEach(i=>{this.walletProvider?.on(i.eventName,i.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=n||av,this._subscriptions=[]}},Xwe=class extends Y2{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the EthereumNullConnector for ${e}`)}constructor({id:e,name:n,icon:r,walletClientType:i,defaultChain:a}){super(i,[],a,{}),this.connectorType="null",this.proxyProvider=new Mu(void 0,av),this.id=e,this.name=n,this.icon=r}};const Qwe=({...t}={})=>m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...t,children:[m.jsx("rect",{width:"32",height:"32",rx:"6",fill:"#121314"}),m.jsx("g",{transform:"translate(4, 4)",children:m.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 318.6 318.6",children:[m.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),m.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),m.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),m.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),m.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),m.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),m.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),m.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),m.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),m.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),m.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),m.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),m.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h4
756.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]})})]}),RH=Object.freeze({phantom:{client:"phantom",name:"Phantom",installLink:lk?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",chainTypes:["ethereum","solana"],get isInstalled(){if("phantom"in window){let t=window;if(t?.phantom?.ethereum?.isPhantom&&t?.phantom?.ethereum?.chainId||t?.phantom?.solana?.isPhantom)return!0}return!1},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=Of({client:this.client,isSolana:e,connectOnly:n});return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`}},solflare:{client:"solflare",name:"Solflare",installLink:lk?"https://addons.mozilla.org/es/firefox/addon/solflare-wallet/":"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",chainTypes:["solana"],get isInstalled(){return"solflare"in window&&!!window?.solflare?.isSolflare},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=Of({client:this.client,isSolana:e,connectOnly:n});return`${t?"solflare://ul/v1/":"https://solflare.com/ul/v1/"}browse/${r}?ref=${r}`}},jupiter:{client:"jupiter",name:"Jupiter Wallet",installLink:"https://chromewebstore.google.com/detail/jupiter-wallet/iledlaeogohbilgbfhmbgkgmpplbfboh",chainTypes:["solana"],get isInstalled(){return"jupiter"in window&&!!window?.jupiter?.isJupiter},getMobileRedirect({isSolana:t,connectOnly:e}){let n=Of({client:this.client,isSolana:t,connectOnly:e});return`jupjupjup://jup.ag/browse/${n}?ref=${n}`}},backpack:{client:"backpack",name:"Backpack",installLink:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",chainTypes:["ethereum","solana"],get isInstalled(){return!(!("backpack"in window)||!window?.backpack?.ethereum?.isBackpack&&!window?.backpack?.solana?.isBackpack)},getMobileRedirect({useUniversalLink:t,isSolana:e,connectOnly:n}){let r=Of({client:this.client,isSolana:e,connectOnly:n});return`${t?"backpack://ul/v1/":"https://backpack.app/ul/v1/"}browse/${r}?ref=${r}`}},okx_wallet:{client:"okx_wallet",name:"OKX Wallet",installLink:"https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",chainTypes:["ethereum","solana"],get isInstalled(){return"okxwallet"in window&&!!window?.okxwallet?.isOkxWallet},getMobileRedirect({isSolana:t,connectOnly:e}){return`okx://wallet/dapp/url?dappUrl=${Of({client:this.client,isSolana:t,connectOnly:e})}`}}});function e8e({connectorType:t,walletClientType:e}){for(let n of E4e)if(t===n||e===n)return RH[n]}function Xat({isMobile:t,walletConfig:e}){return!t&&e?.client==="phantom"}function Of({client:t,isSolana:e,connectOnly:n}){let r=new URL(window.location.href);return r.searchParams.set("privy_connector",e?"solana_adapter":"injected"),r.searchParams.set("privy_wallet_client",t),r.searchParams.set("privy_connect_only",String(n)),encodeURIComponent(r.href.replace(/\/$/g,""))}let t8e=class extends T7e{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor({id:e,name:n,icon:r}){super({name:n},!1),this.connectorType="null",this.proxyProvider=new Mu(void 0,av),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")},this.id=e,this.name=n,this.icon=r}};function n8e(t){return t.chainType==="solana"}function r8e(t){return t.type==="solana"}class Ws{constructor(e,n){this.scope=e,this.module=n}storeObject(e,n){this.setItem(e,JSON.stringify(n))}loadObject(e){const n=this.getItem(e);return n?JSON.parse(n):void 0}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new Ws("CBWSDK").clear(),new Ws("walletlink").clear()}}const Ln={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},w8={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},OH="Unspecified error message.",i8e="Unspecified server error.";function KE(t,e=OH){if(t&&Number.isInteger(t)){const n=t.toString();if(b8(w8,n))return w8[n].message;if(MH(t))return i8e}return e}function a8e(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(w8[e]||MH(t))}function s8e(t,{shouldIncludeStack:e=!1}={}){const n={};if(t&&typeof t=="object"&&!Array.isArray(t)&&b8(t,"code")&&a8e(t.code)){const r=t;n.code=r.code,r.message&&typeof r.message=="string"?(n.message=r.message,b8(r,"data")&&(n.data=r.data)):(n.message=KE(n.code),n.data={originalError:uk(t)})}else n.code=Ln.rpc.internal,n.message=dk(t,"message")?t.message:OH,n.data={originalError:uk(t)};return e&&(n.stack=dk(t,"stack")?t.stack:void 0),n}function MH(t){return t>=-32099&&t<=-32e3}function uk(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function b8(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function dk(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const Lt={rpc:{parse:t=>sa(Ln.rpc.parse,t),invalidRequest:t=>sa(Ln.rpc.invalidRequest,t),invalidParams:t=>sa(Ln.rpc.invalidParams,t),methodNotFound:t=>sa(Ln.rpc.methodNotFound,t),internal:t=>sa(Ln.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code
75<= -32005');return sa(e,t)},invalidInput:t=>sa(Ln.rpc.invalidInput,t),resourceNotFound:t=>sa(Ln.rpc.resourceNotFound,t),resourceUnavailable:t=>sa(Ln.rpc.resourceUnavailable,t),transactionRejected:t=>sa(Ln.rpc.transactionRejected,t),methodNotSupported:t=>sa(Ln.rpc.methodNotSupported,t),limitExceeded:t=>sa(Ln.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>id(Ln.provider.userRejectedRequest,t),unauthorized:t=>id(Ln.provider.unauthorized,t),unsupportedMethod:t=>id(Ln.provider.unsupportedMethod,t),disconnected:t=>id(Ln.provider.disconnected,t),chainDisconnected:t=>id(Ln.provider.chainDisconnected,t),unsupportedChain:t=>id(Ln.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new FH(e,n,r)}}};function sa(t,e){const[n,r]=NH(e);return new DH(t,n||KE(t),r)}function id(t,e){const[n,r]=NH(e);return new FH(t,n||KE(t),r)}function NH(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;
75if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}class DH extends Error{constructor(e,n,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,r!==void 0&&(this.data=r)}}class FH extends DH{constructor(e,n,r){if(!o8e(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,r)}}function o8e(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function GE(){return t=>t}const $p=GE(),c8e=GE(),l8e=GE();function Co(t){return Math.floor(t)}const UH=/^[0-9]*$/,jH=/^[a-f0-9]*$/;function Ul(t){return YE(crypto.getRandomValues(new Uint8Array(t)))}function YE(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function q3(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function Oh(t,e=!1){const n=t.toString("hex");return $p(e?`0x${n}`:n)}function F5(t){return Oh(_8(t),!0)}function os(t){return l8e(t.toString(10))}function qc(t){return $p(`0x${BigInt(t).toString(16)}`)}function BH(t){return t.startsWith("0x")||t.startsWith("0X")}function JE(t){return BH(t)?t.slice(2):t}function VH(t){return BH(t)?`0x${t.slice(2)}`:`0x${t}`}function cv(t){if(typeof t!="string")return!1;const e=JE(t).toLowerCase();return jH.test(e)}function u8e(t,e=!1){if(typeof t=="string"){const n=JE(t).toLowerCase();if(jH.test(n))return $p(e?`0x${n}`:n)}throw Lt.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function XE(t,e=!1){let n=u8e(t,!1);return n.length%2===1&&(n=$p(`0${n}`)),e?$p(`0x${n}`):n}function sc(t){if(typeof t=="string"){const e=JE(t).toLowerCase();if(cv(e)&&e.length===40)return c8e(VH(e))}throw Lt.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function _8(t){if(De.isBuffer(t))return t;if(typeof t=="string"){if(cv(t)){const e=XE(t,!1);return De.from(e,"hex")}return De.from(t,"utf8")}throw Lt.rpc.invalidParams(`Not binary data: ${String(t)}`)}function Mh(t){if(typeof t=="number"&&Number.isInteger(t))return Co(t);if(typeof t=="string"){if(UH.test(t))return Co(Number(t));if(cv(t))return Co(Number(BigInt(XE(t,!0))))}throw Lt.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Mf(t){if(t!==null&&(typeof t=="bigint"||f8e(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(Mh(t));if(typeof t=="string"){if(UH.test(t))return BigInt(t);if(cv(t))return BigInt(XE(t,!0))}throw Lt.rpc.invalidParams(`Not an integer: ${String(t)}`)}function d8e(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Lt.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function f8e(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}async function h8e(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function p8e(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function g8e(t,e){const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,new TextEncoder().encode(e));return{iv:n,cipherText:r}}async function y8e(t,{iv:e,cipherText:n}){const r=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,n);return new TextDecoder().decode(r)}function HH(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function WH(t,e){const n=HH(t),r=await crypto.subtle.exportKey(n,e);return YE(new Uint8Array(r))}async function qH(t,e){const n=HH(t),r=q3(e).buffer;return await crypto.subtle.importKey(n,new Uint8Array(r),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function m8e(t,e){const n=JSON.stringify(t,(r,i)=>{if(!(i instanceof Error))return i;const a=i;return Object.assign(Object.assign({},a.code?{code:a.code}:{}),{message:a.message})});return g8e(e,n)}async function v8e(t,e){return JSON.parse(await y8e(e,t))}const U5={storageKey:"ownPrivateKey",keyType:"private"},j5={storageKey:"ownPublicKey",keyType:"public"},B5={storageKey:"peerPublicKey",keyType:"public"};
75class w8e{constructor(){this.storage=new Ws("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(B5,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(j5.storageKey),this.storage.removeItem(U5.storageKey),this.storage.removeItem(B5.storageKey)}async generateKeyPair(){const e=await h8e();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(U5,e.privateKey),await this.storeKey(j5,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(U5)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(j5)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(B5)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await p8e(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const n=this.storage.getItem(e.storageKey);return n?qH(e.keyType,n):null}async storeKey(e,n){const r=await WH(e.keyType,n);this.storage.setItem(e.storageKey,r)}}const w0="4.3.2",zH="@coinbase/wallet-sdk";async function QE(t,e){const n=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}
75),r=await window.fetch(e,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":w0,"X-Cbw-Sdk-Platform":zH}}),{result:i,error:a}=await r.json();if(a)throw a;return i}function b8e(){return globalThis.coinbaseWalletExtension}function _8e(){var t,e;try{const n=globalThis;return(t=n.ethereum)!==null&&t!==void 0?t:(e=n.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function C8e({metadata:t,preference:e}){var n,r;const{appName:i,appLogoUrl:a,appChainIds:s}=t;if(e.options!=="smartWalletOnly"){const c=b8e();if(c)return(n=c.setAppInfo)===null||n===void 0||n.call(c,i,a,s,e),c}const o=_8e();if(o?.isCoinbaseBrowser)return(r=o.setAppInfo)===null||r===void 0||r.call(o,i,a,s,e),o}function E8e(t){if(!t||typeof t!="object"||Array.isArray(t))throw Lt.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if(typeof e!="string"||e.length===0)throw Lt.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Lt.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw Lt.provider.unsupportedMethod()}}const fk="accounts",hk="activeChain",pk="availableChains",gk="walletCapabilities";class S8e{constructor(e){var n,r,i;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new w8e,this.storage=new Ws("CBWSDK","SCWStateManager"),this.accounts=(n=this.storage.loadObject(fk))!==null&&n!==void 0?n:[],this.chain=this.storage.loadObject(hk)||{id:(i=(r=e.metadata.appChainIds)===null||r===void 0?void 0:r[0])!==null&&i!==void 0?i:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var n,r,i,a;await((r=(n=this.communicator).waitForPopupLoaded)===null||r===void 0?void 0:r.call(n));const s=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(i=e.params)!==null&&i!==void 0?i:{})}}),o=await this.communicator.postRequestAndWaitForResponse(s);if("failure"in o.content)throw o.content.failure;const c=await qH("public",o.sender);await this.keyManager.setPeerPublicKey(c);const u=(await this.decryptResponseMessage(o)).result;if("error"in u)throw u.error;switch(e.method){case"eth_requestAccounts":{const d=u.value;this.accounts=d,this.storage.storeObject(fk,d),(a=this.callback)===null||a===void 0||a.call(this,"accountsChanged",d);break}}}async request(e){var n;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw Lt.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:qc(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return qc(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(gk);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw Lt.rpc.internal("No RPC URL set for chain");return QE(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var n,r;await((r=(n=this.communicator).waitForPopupLoaded)===null||r===void 0?void 0:r.call(n));const i=await this.sendEncryptedRequest(e),s=(await this.decryptResponseMessage(i)).result;if("error"in s)throw s.error;return s.value}async cleanup(){var e,n;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(n=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:1}}async handleSwitchChainRequest(e){var n;const r=e.params;if(!r||!(!((n=r[0])===null||n===void 0)&&n.chainId))throw Lt.rpc.invalidParams();const i=Mh(r[0].chainId);if(this.updateChain(i))return null;const s=await this.sendRequestToPopup(e);return s===null&&this.updateChain(i),s}async sendEncryptedRequest(e){const n=await this.keyManager.getSharedSecret();if(!n)throw Lt.provider.unauthorized("No valid session found, try requestAccounts before other methods");const r=await m8e({action:e,chainId:this.chain.id},n),i=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const n=await WH("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:n,content:e,timestamp:new Date}}async decryptResponseMessage(e){var n,r;const i=e.content;if("failure"in i)throw i.failure;
75const a=await this.keyManager.getSharedSecret();if(!a)throw Lt.provider.unauthorized("Invalid session");const s=await v8e(i.encrypted,a),o=(n=s.data)===null||n===void 0?void 0:n.chains;if(o){const l=Object.entries(o).map(([u,d])=>({id:Number(u),rpcUrl:d}));this.storage.storeObject(pk,l),this.updateChain(this.chain.id,l)}const c=(r=s.data)===null||r===void 0?void 0:r.capabilities;return c&&this.storage.storeObject(gk,c),s}updateChain(e,n){var r;const i=n??this.storage.loadObject(pk),a=i?.find(s=>s.id===e);return a?(a!==this.chain&&(this.chain=a,this.storage.storeObject(hk,a),(r=this.callback)===null||r===void 0||r.call(this,"chainChanged",qc(a.id))),!0):!1}}const{keccak_256:A8e}=kJ;function ZH(t){return De.allocUnsafe(t).fill(0)}function x8e(t){return t.toString(2).length}function KH(t,e){let n=t.toString(16);n.length%2!==0&&(n="0"+n);const r=n.match(/.{1,2}/g).map(i=>parseInt(i,16));for(;r.length<e;)r.unshift(0);return De.from(r)}function I8e(t,e){const n=t<0n;let r;if(n){const i=(1n<<BigInt(e))-1n;r=(~t&i)+1n}else r=t;return r&=(1n<<BigInt(e))-1n,r}function GH(t,e,n){const r=ZH(e);return t=lv(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function T8e(t,e){return GH(t,e,!0)}function lv(t){if(!De.isBuffer(t))if(Array.isArray(t))t=De.from(t);else if(typeof t=="string")YH(t)?t=De.from($8e(JH(t)),"hex"):t=De.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=De.allocUnsafe(0);else if(typeof t=="bigint")t=KH(t);else if(t.toArray)t=De.from(t.toArray());else throw new Error("invalid type");return t}function L8e(t){return t=lv(t),"0x"+t.toString("hex")}function k8e(t,e){if(t=lv(t),e||(e=256),e!==256)throw new Error("unsupported");return De.from(A8e(new Uint8Array(t)))}function $8e(t){return t.length%2?"0"+t:t}function YH(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function JH(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var XH={zeros:ZH,setLength:GH,setLengthRight:T8e,isHexString:YH,stripHexPrefix:JH,toBuffer:lv,bufferToHex:L8e,keccak:k8e,bitLengthFromBigInt:x8e,bufferBEFromBigInt:KH,twosFromBigInt:I8e};const ei=XH;function QH(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function qd(t){return Number.parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function yk(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[Number.parseInt(e[1],10),Number.parseInt(e[2],10)]}function eW(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":Number.parseInt(e[2],10):null}function jl(t){var e=typeof t;if(e==="string"||e==="number")return BigInt(t);if(e==="bigint")return t;throw new Error("Argument is not a number")}function vs(t,e){var n,r,i,a;if(t==="address")return vs("uint160",jl(e));if(t==="bool")return vs("uint8",e?1:0);if(t==="string")return vs("bytes",new De(e,"utf8"));if(R8e(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=eW(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(a in e)i.push(vs(t,e[a]));if(n==="dynamic"){var s=vs("uint256",e.length);i.unshift(s)}return De.concat(i)}else{if(t==="bytes")return e=new De(e),i=De.concat([vs("uint256",e.length),e]),e.length%32!==0&&(i=De.concat([i,ei.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=qd(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return ei.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=qd(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);r=jl(e);const o=ei.bitLengthFromBigInt(r);if(o>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+o);if(r<0)throw new Error("Supplied uint is negative");return ei.bufferBEFromBigInt(r,32)}else if(t.startsWith("int")){if(n=qd(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);r=jl(e);const o=ei.bitLengthFromBigInt(r);if(o>n)throw new Error("Supplied int exceeds width: "+n+" vs "+o);const c=ei.twosFromBigInt(r,256);return ei.bufferBEFromBigInt(c,32)}else if(t.startsWith("ufixed")){if(n=yk(t),r=jl(e),r<0)throw new Error("Supplied ufixed is negative");return vs("uint256",r*BigInt(2)**BigInt(n[1]))}else if(t.startsWith("fixed"))return n=yk(t),vs("int256",jl(e)*BigInt(2)**BigInt(n[1]))}throw new Error("Unsupported or invalid type: "+t)}function P8e(t){return t==="string"||t==="bytes"||eW(t)==="dynamic"}function R8e(t){return t.lastIndexOf("]")===t.length-1}function O8e(t,e){var n=[],r=[],i=32*t.length;for(var a in t){var s=QH(t[a]),o=e[a],c=vs(s,o);P8e(s)?(n.push(vs("uint256",i)),r.push(c),i+=c.length):n.push(c)}return De.concat(n.concat(r))}function tW(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],a=0;a<t.length;a++){var s=QH(t[a]),o=e[a];if(s==="bytes")i.push(o);else if(s==="string")i.push(new De(o,"utf8"));else if(s==="bool")i.push(new De(o?"01":"00","hex"));else if(s==="address")i.push(ei.setLength(o,20));else if(s.startsWith("bytes")){if(n=qd(s),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(ei.setLengthRight(o,n))}else if(s.startsWith("uint")){if(n=qd(s),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);r=jl(o);const c=ei.bitLengthFromBigInt(r);if(c>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+c);i.push(ei.bufferBEFromBigInt(r,n/8))}else if(s.startsWith("int")){if(n=qd(s),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);r=jl(o);const c=ei.bitLengthFromBigInt(r);if(c>n)throw new Error("Supplied int exceeds width: "+n+" vs "+c);const l=ei.twosFromBigInt(r,n);i.push(ei.bufferBEFromBigInt(l,n/8))}else throw new Error("Unsupported or invalid type: "+s)}return De.concat(i)}function M8e(t,e){return ei.keccak(tW(t,e))}var N8e={rawEncode:O8e,solidityPack:tW,soliditySHA3:M8e};const Da=XH,Nh=N8e,nW={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},V5={encodeData(t,e,n,r=!0){const i=["bytes32"],a=[this.hashType(t,n)];if(r){const s=(o,c,l)=>{if(n[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Da.keccak(this.encodeData(c,l,n,r))];if(l===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",Da.keccak(l)];if(c==="string")return typeof l=="string"&&(l=De.from(l,"utf8")),["bytes32",Da.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const u=c.slice(0,c.lastIndexOf("[")),d=l.map(f=>s(o,u,f));return["bytes32",Da.keccak(Nh.rawEncode(d.map(([f])=>f),d.map(([,f])=>f)))]}return[c,l]};for(const o of n[t]){const[c,l]=s(o.name,o.type,e[o.name]);i.push(c),a.push(l)}}else for(const s of n[t]){let o=e[s.name];
75if(o!==void 0)if(s.type==="bytes")i.push("bytes32"),o=Da.keccak(o),a.push(o);else if(s.type==="string")i.push("bytes32"),typeof o=="string"&&(o=De.from(o,"utf8")),o=Da.keccak(o),a.push(o);else if(n[s.type]!==void 0)i.push("bytes32"),o=Da.keccak(this.encodeData(s.type,o,n,r)),a.push(o);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),a.push(o)}}return Nh.rawEncode(i,a)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:s,type:o})=>o+" "+s).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return Da.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return Da.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in nW.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[De.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),Da.keccak(De.concat(r))}};var D8e={TYPED_MESSAGE_SCHEMA:nW,TypedDataUtils:V5,hashForSignTypedDataLegacy:function(t){return F8e(t.data)},hashForSignTypedData_v3:function(t){return V5.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return V5.hash(t.data)}};function F8e(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(a){return a.type==="bytes"?Da.toBuffer(a.value):a.value}),r=t.map(function(a){return a.type}),i=t.map(function(a){if(!a.name)throw e;return a.type+" "+a.name});return Nh.soliditySHA3(["bytes32","bytes32"],[Nh.soliditySHA3(new Array(t.length).fill("string"),i),Nh.soliditySHA3(r,n)])}const O1=Zs(D8e),U8e="walletUsername",C8="Addresses",j8e="AppVersion";function vr(t){return t.errorMessage!==void 0}class B8e{constructor(e){this.secret=e}async encrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",q3(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},i,a.encode(e)),o=16,c=s.slice(s.byteLength-o),l=s.slice(0,s.byteLength-o),u=new Uint8Array(c),d=new Uint8Array(l),f=new Uint8Array([...r,...u,...d]);return YE(f)}async decrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");return new Promise((r,i)=>{(async function(){const a=await crypto.subtle.importKey("raw",q3(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=q3(e),o=s.slice(0,12),c=s.slice(12,28),l=s.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(o)};try{const f=await window.crypto.subtle.decrypt(d,a,u),h=new TextDecoder;r(h.decode(f))}catch(f){i(f)}})()})}}class V8e{constructor(e,n,r){this.linkAPIUrl=e,this.sessionId=n;const i=`${n}:${r}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var e;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:r,error:i}=await n.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const a=(e=r?.filter(s=>s.event==="Web3Response").map(s=>({type:"Event",sessionId:this.sessionId,eventId:s.id,event:s.event,data:s.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${n.status}`)}}var To;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(To||(To={}));class H8e{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}
75async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,n)=>{var r;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(a){n(a);return}(r=this.connectionStateListener)===null||r===void 0||r.call(this,To.CONNECTING),i.onclose=a=>{var s;this.clearWebSocket(),n(new Error(`websocket error ${a.code}: ${a.reason}`)),(s=this.connectionStateListener)===null||s===void 0||s.call(this,To.DISCONNECTED)},i.onopen=a=>{var s;e(),(s=this.connectionStateListener)===null||s===void 0||s.call(this,To.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},i.onmessage=a=>{var s,o;if(a.data==="h")(s=this.incomingDataListener)===null||s===void 0||s.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(a.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:n}=this;if(n){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,To.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{n.close()}catch{}}}sendData(e){const{webSocket:n}=this;if(!n){this.pendingData.push(e),this.connect();return}n.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const mk=1e4,W8e=6e4;class q8e{constructor({session:e,linkAPIUrl:n,listener:r}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=Co(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",o=>a.JsonRpcUrl&&this.handleChainUpdated(o,a.JsonRpcUrl)]]).forEach((o,c)=>{const l=a[c];l!==void 0&&o(l)})},this.handleDestroyed=a=>{var s;a==="1"&&((s=this.listener)===null||s===void 0||s.resetAndReload())},this.handleAccountUpdated=async a=>{var s;const o=await this.cipher.decrypt(a);(s=this.listener)===null||s===void 0||s.accountUpdated(o)},this.handleMetadataUpdated=async(a,s)=>{var o;const c=await this.cipher.decrypt(s);(o=this.listener)===null||o===void 0||o.metadataUpdated(a,c)},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(U8e,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(j8e,a)},this.handleChainUpdated=async(a,s)=>{var o;const c=await this.cipher.decrypt(a),l=await this.cipher.decrypt(s);(o=this.listener)===null||o===void 0||o.chainUpdated(c,l)},this.session=e,this.cipher=new B8e(e.secret),this.listener=r;const i=new H8e(`${n}/rpc`,WebSocket);i.setConnectionStateListener(async a=>{let s=!1;switch(a){case To.DISCONNECTED:if(!this.destroyed){const o=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||i.connect().catch(()=>{o()})};o()}break;case To.CONNECTED:s=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},mk),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case To.CONNECTING:break}this.connected!==s&&(this.connected=s)}),i.setIncomingDataListener(a=>{var s;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const o=a.type==="IsLinkedOK"?a.linked:void 0;this.linked=o||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((s=this.requestResolutions.get(a.id))===null||s===void 0||s(a))}),this.ws=i,this.http=new V8e(n,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:Co(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var n,r;this._linked=e,e&&((n=this.onceLinked)===null||n===void 0||n.call(this)),(r=this.listener)===null||r===void 0||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(n=>{this.linked?e().then(n):this.onceLinked=()=>{e().then(n),this.onceLinked=void 0}})}async handleIncomingEvent(e){var n;if(e.type!=="Event"||e.event!=="Web3Response")return;const r=await this.cipher.decrypt(e.data),i=JSON.parse(r);if(i.type!=="WEB3_RESPONSE")return;const{id:a,response:s}=i;(n=this.listener)===null||n===void 0||n.handleWeb3ResponseMessage(
75a,s)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(n=>this.handleIncomingEvent(n))}async publishEvent(e,n,r=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),a={type:"PublishEvent",id:Co(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:r};return this.setOnceLinked(async()=>{const s=await this.makeRequest(a);if(s.type==="Fail")throw new Error(s.error||"failed to publish event");return s.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>mk*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,n={timeout:W8e}){const r=e.id;this.sendData(e);let i;return Promise.race([new Promise((a,s)=>{i=window.setTimeout(()=>{s(new Error(`request ${r} timed out`))},n.timeout)}),new Promise(a=>{this.requestResolutions.set(r,s=>{clearTimeout(i),a(s),this.requestResolutions.delete(r)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:Co(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:Co(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:Co(this.nextReqId++),sessionId:this.session.id}),!0)}}class z8e{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=VH(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}const vk="session:id",wk="session:secret",bk="session:linked";class zd{constructor(e,n,r,i=!1){this.storage=e,this.id=n,this.secret=r,this.key=su(gQ(`${n}, ${r} WalletLink`)),this._linked=!!i}static create(e){const n=Ul(16),r=Ul(32);return new zd(e,n,r).save()}static load(e){const n=e.getItem(vk),r=e.getItem(bk),i=e.getItem(wk);return n&&i?new zd(e,n,i,r==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(vk,this.id),this.storage.setItem(wk,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(bk,this._linked?"1":"0")}}function Z8e(){try{return window.frameElement!==null}catch{return!1}}function K8e(){try{return Z8e()&&window.top?window.top.location:window.location}catch{return window.location}}function G8e(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window?.navigator)===null||t===void 0?void 0:t.userAgent)}function rW(){var t,e;return(e=(t=window?.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const Y8e='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';function iW(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(Y8e)),document.documentElement.appendChild(t)}function aW(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=aW(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Dh(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=aW(t))&&(r&&(r+=" "),r+=e);return r}var uv,hn,sW,Ac,_k,oW,cW,H5,z3,Fh,lW,eS,E8,S8,Iy={},Ty=[],J8e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dv=Array.isArray;function Lo(t,e){for(var n in e)t[n]=e[n];return t}function tS(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ut(t,e,n){var r,i,a,s={};for(a in e)a=="key"?r=e[a]:a=="ref"?i=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?uv.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)s[a]===void 0&&(s[a]=t.defaultProps[a]
vendor: 14,276 bytes, line 75
75);return Z3(t,s,r,i,null)}function Z3(t,e,n,r,i){var a={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++sW,__i:-1,__u:0};return i==null&&hn.vnode!=null&&hn.vnode(a),a}function fv(t){return t.children}function K3(t,e){this.props=t,this.context=e}function b2(t,e){if(e==null)return t.__?b2(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?b2(t):null}function X8e(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],i=[],a=Lo({},e);a.__v=e.__v+1,hn.vnode&&hn.vnode(a),nS(t.__P,a,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??b2(e),!!(32&e.__u),i),a.__v=e.__v,a.__.__k[a.__i]=a,hW(r,a,i),e.__e=e.__=null,a.__e!=n&&uW(a)}}function uW(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),uW(t)}function Ck(t){(!t.__d&&(t.__d=!0)&&Ac.push(t)&&!Ly.__r++||_k!=hn.debounceRendering)&&((_k=hn.debounceRendering)||oW)(Ly)}function Ly(){try{for(var t,e=1;Ac.length;)Ac.length>e&&Ac.sort(cW),t=Ac.shift(),e=Ac.length,X8e(t)}finally{Ac.length=Ly.__r=0}}function dW(t,e,n,r,i,a,s,o,c,l,u){var d,f,h,p,g,y,v,b=r&&r.__k||Ty,w=e.length;for(c=Q8e(n,e,b,c,w),d=0;d<w;d++)(h=n.__k[d])!=null&&(f=h.__i!=-1&&b[h.__i]||Iy,h.__i=d,y=nS(t,h,f,i,a,s,o,c,l,u),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&rS(f.ref,null,h),u.push(h.ref,h.__c||p,h)),g==null&&p!=null&&(g=p),(v=!!(4&h.__u))||f.__k===h.__k?(c=fW(h,c,t,v),v&&f.__e&&(f.__e=null)):typeof h.type=="function"&&y!==void 0?c=y:p&&(c=p.nextSibling),h.__u&=-7);return n.__e=g,c}function Q8e(t,e,n,r,i){var a,s,o,c,l,u=n.length,d=u,f=0;for(t.__k=new Array(i),a=0;a<i;a++)(s=e[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=t.__k[a]=Z3(null,s,null,null,null):dv(s)?s=t.__k[a]=Z3(fv,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[a]=Z3(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[a]=s,c=a+f,s.__=t,s.__b=t.__b+1,o=null,(l=s.__i=ebe(s,n,c,d))!=-1&&(d--,(o=n[l])&&(o.__u|=2)),o==null||o.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof s.type!="function"&&(s.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,s.__u|=4))):t.__k[a]=null;if(d)for(a=0;a<u;a++)(o=n[a])!=null&&!(2&o.__u)&&(o.__e==r&&(r=b2(o)),gW(o,o));return r}function fW(t,e,n,r){var i,a;if(typeof t.type=="function"){for(i=t.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=t,e=fW(i[a],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=b2(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ebe(t,e,n,r){var i,a,s,o=t.key,c=t.type,l=e[n],u=l!=null&&(2&l.__u)==0;if(l===null&&o==null||u&&o==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<e.length;)if((l=e[s=i>=0?i--:a++])!=null&&!(2&l.__u)&&o==l.key&&c==l.type)return s}return-1}function Ek(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||J8e.test(e)?n:n+"px"}function M1(t,e,n,r,i){var a,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Ek(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||Ek(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(lW,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=n,n?r?n[Fh]=r[Fh]:(n[Fh]=eS,t.addEventListener(e,a?S8:E8,a)):t.removeEventListener(e,a?S8:E8,a);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Sk(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[z3]==null)e[z3]=eS++;else if(e[z3]<n[Fh])return;return n(hn.event?hn.event(e):e)}}}function nS(t,e,n,r,i,a,s,o,c,l){var u,d,f,h,p,g,y,v,b,w,_,E,C,x,$,T=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[o=e.__e=n.__e]),(u=hn.__b)&&u(e);e:if(typeof T=="function")try{if(v=e.props,b=T.prototype&&T.prototype.render,w=(u=T.contextType)&&r[u.__c],_=u?w?w.props.value:u.__:r,n.__c?y=(d=e.__c=n.__c).__=d.__E:(b?e.__c=d=new T(v,_):(e.__c=d=new K3(v,_),d.constructor=T,d.render=nbe),w&&w.sub(d),d.state||(d.state={}),d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),b&&d.__s==null&&(d.__s=d.state),b&&T.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Lo({},d.__s)),Lo(d.__s,T.getDerivedStateFromProps(v,d.__s))),h=d.props,p=d.state,d.__v=e,f)b&&T.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),b&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(b&&T.getDerivedStateFromProps==null&&v!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,_),e.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,_)===!1){e.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(U){U&&(U.__=e)}),Ty.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,_),b&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,p,g)})}if(d.context=_,d.props=v,d.__P=t,d.__e=!1,E=hn.__r,C=0,b)d.state=d.__s,d.__d=!1,E&&E(e),u=d.render(d.props,d.state,d.context),Ty.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,E&&E(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(r=Lo(Lo({},r),d.getChildContext())),b&&!f&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(h,p)),x=u!=null&&u.type===fv&&u.key==null?pW(u.props.children):u,o=dW(t,dv(x)?x:[x],e,n,r,i,a,s,o,c,l),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),y&&(d.__E=d.__=null)}catch(U){if(e.__v=null,c||a!=null)if(U.then){for(e.__u|=c?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;a[a.indexOf(o)]=null,e.__e=o}else{for($=a.length;$--;)tS(a[$]);A8(e)}else e.__e=n.__e,e.__k=n.__k,U.then||A8(e);hn.__e(U,e,n)}else a==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):o=e.__e=tbe(n.__e,e,n,r,i,a,s,c,l);return(u=hn.diffed)&&u(e),128&e.__u?void 0:o}function A8(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(A8))}function hW(t,e,n){for(var r=0;r<n.length;r++)rS(n[r],n[++r],n[++r]);hn.__c&&hn.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(a){a.call(i)})}catch(a){hn.__e(a,i.__v)}})}function pW(t){return typeof t!="object"||t==null||t.__b>0?t:dv(t)?t.map(pW):t.constructor!==void 0?null:Lo({},t)}function tbe(t,e,n,r,i,a,s,o,c){var l,u,d,f,h,p,g,y=n.props||Iy,v=e.props,b=e.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l<a.length;l++)if((h=a[l])&&"setAttribute"in h==!!b&&(b?h.localName==b:h.nodeType==3)){t=h,a[l]=null;break}}if(t==null){if(b==null)return document.createTextNode(v);t=document.createElementNS(i,b,v.is&&v),o&&(hn.__m&&hn.__m(e,a),o=!1),a=null}if(b==null)y===v||o&&t.data==v||(t.data=v);else{if(a=b=="textarea"&&v.defaultValue!=null?null:a&&uv.call(t.childNodes),!o&&a!=null)for(y={},l=0;l<t.attributes.length;l++)y[(h=t.attributes[l]).name]=h.value;for(l in y)h=y[l],l=="dangerouslySetInnerHTML"?d=h:l=="children"||l in v||l=="value"&&"defaultValue"in v||l=="checked"&&"defaultChecked"in v||M1(t,l,null,h,i);for(l in v)h=v[l],l=="children"?f=h:l=="dangerouslySetInnerHTML"?u=h:l=="value"?p=h:l=="checked"?g=h:o&&typeof h!="function"||y[l]===h||M1(t,l,h,y[l],i);if(u)o||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),dW(e.type=="template"?t.content:t,dv(f)?f:[f],e,n,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&b2(n,0),o,c),a!=null)for(l=a.length;l--;)tS(a[l]);o&&b!="textarea"||(l="value",b=="progress"&&p==null?t.removeAttribute("value"):p!=null&&(p!==t[l]||b=="progress"&&!p||b=="option"&&p!=y[l])&&M1(t,l,p,y[l],i),l="checked",g!=null&&g!=t[l]&&M1(t,l,g,y[l],i))}return t}function rS(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){hn.__e(i,n)}}function gW(t,e,n){var r,i;if(hn.unmount&&hn.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||rS(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){hn.__e(a,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&gW(r[i],e,n||typeof t.type!="function");n||tS(t.__e),t.__c=t.__=t.__e=void 0}function nbe(t,e,n){return this.constructor(t,n)}function x8(t,e,n){var r,i,a,s;e==document&&(e=document.documentElement),hn.__&&hn.__(t,e),i=(r=typeof n=="function")?null:e.__k,a=[],s=[],nS(e,t=(!r&&n||e).__k=Ut(fv,null,[t]),i||Iy,Iy,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?uv.call(e.childNodes):null,a,!r&&n?n:i?i.__e:e.firstChild,r,s),hW(a,t,s)}uv=Ty.slice,hn={__e:function(t,e,n,r){for(var i,a,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),s=i.__d),s)return i.__E=i}catch(o){t=o}throw t}},sW=0,K3.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Lo({},this.state),typeof t=="function"&&(t=t(Lo({},n),this.props)),t&&Lo(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Ck(this))},K3.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ck(this))},K3.prototype.render=fv,Ac=[],oW=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,cW=function(t,e){return t.__v.__b-e.__v.__b},Ly.__r=0,H5=Math.random().toString(8),z3="__d"+H5,Fh="__a"+H5,lW=/(PointerCapture)$|Capture$/i,eS=0,E8=Sk(!1),S8=Sk(!0);var Pp,Pn,W5,Ak,I8=0,yW=[],Bn=hn,xk=Bn.__b,Ik=Bn.__r,Tk=Bn.diffed,Lk=Bn.__c,kk=Bn.unmount,$k=Bn.__;function iS(t,e){Bn.__h&&Bn.__h(Pn,t,I8||e),I8=0;var n=Pn.__H||(Pn.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Pk(t){return I8=1,rbe(vW,t)}function rbe(t,e,n){var r=iS(Pp++,2);if(r.t=t,!r.__c&&(r.__=[vW(void 0,e),function(o){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,o);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=Pn,!Pn.__f)){var i=function(o,c,l){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!a||a.call(this,o,c,l);var d=r.__c.props!==o;return u.some(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(d=!0)}}),a&&a.call(this,o,c,l)||d};Pn.__f=!0;var a=Pn.shouldComponentUpdate,s=Pn.componentWillUpdate;Pn.componentWillUpdate=function(o,c,l){if(this.__e){var u=a;a=void 0,i(o,c,l),a=u}s&&s.call(this,o,c,l)},Pn.shouldComponentUpdate=i}return r.__N||r.__}function ibe(t,e){var n=iS(Pp++,3);!Bn.__s&&mW(n.__H,e)&&(n.__=t,n.u=e,Pn.__H.__h.push(n))}function est(t,e){var n=iS(Pp++,7);return mW(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function abe(){for(var t;t=yW.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(G3),e.__h.some(T8),e.__h=[]}catch(n){e.__h=[],Bn.__e(n,t.__v)}}}Bn.__b=function(t){Pn=null,xk&&xk(t)},Bn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),$k&&$k(t,e)},Bn.__r=function(t){Ik&&Ik(t),Pp=0;var e=(Pn=t.__c).__H;e&&(W5===Pn?(e.__h=[],Pn.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(G3),e.__h.some(T8),e.__h=[],Pp=0)),W5=Pn},Bn.diffed=function(t){Tk&&Tk(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(yW.push(e)!==1&&Ak===Bn.requestAnimationFrame||((Ak=Bn.requestAnimationFrame)||sbe)(abe)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),W5=Pn=null},Bn.__c=function(t,e){e.some(function(n){try{n.__h.some(G3),n.__h=n.__h.filter(function(r){return!r.__||T8(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Bn.__e(r,n.__v)}}),Lk&&Lk(t,e)},Bn.unmount=function(t){kk&&kk(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(r){try{G3(r)}catch(i){e=i}}),n.__H=void 0,e&&Bn.__e(e,n.__v))};var Rk=typeof requestAnimationFrame=="function";function sbe(t){var e,n=function(){clearTimeout(r),Rk&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);Rk&&(e=requestAnimationFrame(n))}function G3(t){var e=Pn,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Pn=e}function T8(t){var e=Pn;t.__c=t.__(),Pn=e}function mW(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function vW(t,e){return typeof e=="function"?e(t):e}const obe=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}
75.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",cbe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",lbe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class wW{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=rW()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const n=this.nextItemKey++;return this.items.set(n,e),this.render(),()=>{this.items.delete(n),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&x8(Ut("div",null,Ut(bW,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,n])=>Ut(ube,Object.assign({},n,{key:e}))))),this.root)}}const bW=t=>Ut("div",{class:Dh("-cbwsdk-snackbar-container")},Ut("style",null,obe),Ut("div",{class:"-cbwsdk-snackbar"},t.children)),ube=({autoExpand:t,message:e,menuItems:n})=>{const[r,i]=Pk(!0),[a,s]=Pk(t??!1);ibe(()=>{const c=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{s(!0)},1e4)];return()=>
75{c.forEach(window.clearTimeout)}});const o=()=>{s(!a)};return Ut("div",{class:Dh("-cbwsdk-snackbar-instance",r&&"-cbwsdk-snackbar-instance-hidden",a&&"-cbwsdk-snackbar-instance-expanded")},Ut("div",{class:"-cbwsdk-snackbar-instance-header",onClick:o},Ut("img",{src:cbe,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",Ut("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),Ut("div",{class:"-gear-container"},!a&&Ut("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ut("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),Ut("img",{src:lbe,class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&Ut("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((c,l)=>Ut("div",{class:Dh("-cbwsdk-snackbar-instance-menu-item",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:c.onClick,key:l},Ut("svg",{width:c.svgWidth,height:c.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ut("path",{"fill-rule":c.defaultFillRule,"clip-rule":c.defaultClipRule,d:c.path,fill:"#AAAAAA"})),Ut("span",{class:Dh("-cbwsdk-snackbar-instance-menu-item-info",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},c.info)))))},_W="M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z";class dbe{constructor(){this.attached=!1,this.snackbar=new wW}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.snackbar.attach(n),this.attached=!0,iW()}showConnecting(e){let n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:_W,defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(n)}}const fbe=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
75.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";class hbe{constructor(){this.root=null,this.darkMode=rW()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),iW()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(x8(null,this.root),e&&x8(Ut(pbe,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const pbe=({title:t,buttonText:e,darkMode:n,onButtonClick:r,onDismiss:i})=>{const a=n?"dark":"light";return Ut(bW,{darkMode:n},Ut("div",{class:"-cbwsdk-redirect-dialog"},Ut("style",null,fbe),Ut("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),Ut("div",{class:Dh("-cbwsdk-redirect-dialog-box",a)},Ut("p",null,t),Ut("button",{onClick:r},e))))},gbe="https://keys.coinbase.com/connect",ybe="https://rpc.wallet.coinbase.com",Ok="https://www.walletlink.org",mbe="https://go.cb-w.com/walletlink";class Mk{constructor(){this.attached=!1,this.redirectDialog=new hbe}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const n=new URL(mbe);n.searchParams.append("redirect_url",K8e().href),e&&n.searchParams.append("wl_url",e);const r=document.createElement("a");r.target="cbw-opener",r.href=n.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class Eo{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=G8e(),this.linkedUpdated=a=>{this.isLinked=a;const s=this.storage.getItem(C8);if(a&&(this._session.linked=a),this.isUnlinkedErrorState=!1,s){const o=s.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!a&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(a,s)=>{this.storage.setItem(a,s)},this.chainUpdated=(a,s)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===s||(this.chainCallbackParams={chainId:a,jsonRpcUrl:s},this.chainCallback&&this.chainCallback(s,Number.parseInt(a,10)))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Eo.accountRequestCallbackIds.size>0&&(Array.from(Eo.accountRequestCallbackIds.values()).forEach(s=>{this.invokeCallback(s,{method:"requestEthereumAccounts",result:[a]})}),Eo.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:n,ui:r,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=new z8e,this.ui=r,this.ui.attach()}subscribe(){const e=zd.load(this.storage)||zd.create(this.storage),{linkAPIUrl:n}=this,r=new q8e({session:e,linkAPIUrl:n,listener:this}),i=this.isMobileWeb?new Mk:new dbe;return r.connect(),{session:e,ui:i,connection:r}}resetAndReload(){this.connection.destroy().then(()=>{const e=zd.load(this.storage);e?.id===this._session.id&&Ws.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:os(e.weiValue),data:Oh(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?os(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?os(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?os(e.gasPriceInWei):null,gasLimit:e.gasLim
75it?os(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:os(e.weiValue),data:Oh(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?os(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?os(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?os(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?os(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:Oh(e,!0),chainId:n}})}getWalletLinkSession(){return this._session}sendRequest(e){let n=null;const r=Ul(8),i=a=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,a),n?.()};return new Promise((a,s)=>{n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,o=>{if(n?.(),vr(o))return s(new Error(o.errorMessage));a(o)}),this.publishWeb3RequestEvent(r,e)})}publishWeb3RequestEvent(e,n){const r={type:"WEB3_REQUEST",id:e,request:n};this.publishEvent("Web3Request",r,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage(r.id,{method:n.method,errorMessage:i.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(n.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof Mk)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const n={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",n,!1).then()}publishEvent(e,n,r){return this.connection.publishEvent(e,n,r)}handleWeb3ResponseMessage(e,n){if(n.method==="requestEthereumAccounts"){Eo.accountRequestCallbackIds.forEach(r=>this.invokeCallback(r,n)),Eo.accountRequestCallbackIds.clear();return}this.invokeCallback(e,n)}handleErrorResponse(e,n,r){var i;const a=(i=r?.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:n,errorMessage:a})}invokeCallback(e,n){const r=this.relayEventManager.callbacks.get(e);r&&(r(n),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:n}=this.metadata,r={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:n}},i=Ul(8);return new Promise((a,s)=>{this.relayEventManager.callbacks.set(i,o=>{if(vr(o))return s(new Error(o.errorMessage));a(o)}),Eo.accountRequestCallbackIds.add(i),this.publishWeb3RequestEvent(i,r)})}watchAsset(e,n,r,i,a,s){const o={method:"watchAsset",params:{type:e,options:{address:n,symbol:r,decimals:i,image:a},chainId:s}};let c=null;const l=Ul(8),u=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,d),c?.()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((d,f)=>{this.relayEventManager.callbacks.set(l,h=>{if(c?.(),vr(h))return f(new Error(h.errorMessage));d(h)}),this.publishWeb3RequestEvent(l,o)})}addEthereumChain(e,n,r,i,a,s){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:n,blockExplorerUrls:i,chainName:a,iconUrls:r,nativeCurrency:s}};let c=null;const l=Ul(8),u=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,d),c?.()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((d,f)=>{this.relayEventManager.callbacks.set(l,h=>{if(c?.(),vr(h))return f(new Error(h.errorMessage));d(h)}),this.publishWeb3RequestEvent(l,o)})}switchEthereumChain(e,n){const r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:n})};let i=null;const a=Ul(8),s=o=>{this.publishWeb3RequestCanceledEvent(a),this.handleErrorResponse(a,r.method,o),i?.()};return i=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),new Promise((o,c)=>{this.relayEventManager.callbacks.set(a,l=>{if(i?.(),vr(l)&&l.errorCode)return c(Lt.provider.custom({code:l.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(vr(l))return c(new Error(l.errorMessage));o(l)}),this.publishWeb3RequestEvent(a,r)})}}Eo.accountRequestCallbackIds=new Set;const Nk="DefaultChainId",Dk="DefaultJsonRpcUrl";class CW{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new Ws("walletlink",Ok),this.callback=e.callback||null;const n=this._storage.getItem(C8);if(n){const r=n.split(" ");r[0]!==""&&(this._addresses=r.map(i=>
75sc(i)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:n,secret:r}=e.getWalletLinkSession();return{id:n,secret:r}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Dk))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(Dk,e)}updateProviderInfo(e,n){var r;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(Nk,n.toString(10)),Mh(n)!==i&&((r=this.callback)===null||r===void 0||r.call(this,"chainChanged",qc(n)))}async watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw Lt.rpc.invalidParams("Type is required");if(n?.type!=="ERC20")throw Lt.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!n?.options)throw Lt.rpc.invalidParams("Options are required");if(!n?.options.address)throw Lt.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:i,symbol:a,image:s,decimals:o}=n.options,l=await this.initializeRelay().watchAsset(n.type,i,a,o,s,r?.toString());return vr(l)?!1:!!l.result}async addEthereumChain(e){var n,r;const i=e[0];if(((n=i.rpcUrls)===null||n===void 0?void 0:n.length)===0)throw Lt.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!i.chainName||i.chainName.trim()==="")throw Lt.rpc.invalidParams("chainName is a required field");if(!i.nativeCurrency)throw Lt.rpc.invalidParams("nativeCurrency is a required field");const a=Number.parseInt(i.chainId,16);if(a===this.getChainId())return!1;const s=this.initializeRelay(),{rpcUrls:o=[],blockExplorerUrls:c=[],chainName:l,iconUrls:u=[],nativeCurrency:d}=i,f=await s.addEthereumChain(a.toString(),o,u,c,l,d);if(vr(f))return!1;if(((r=f.result)===null||r===void 0?void 0:r.isApproved)===!0)return this.updateProviderInfo(o[0],a),null;throw Lt.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const n=e[0],r=Number.parseInt(n.chainId,16),a=await this.initializeRelay().switchEthereumChain(r.toString(10),this.selectedAddress||void 0);if(vr(a))throw a;const s=a.result;return s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,r),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,n){var r;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(a=>sc(a));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(r=this.callback)===null||r===void 0||r.call(this,"accountsChanged",i),this._storage.setItem(C8,i.join(" ")))}async request(e){const n=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return qc(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(n);case"wallet_switchEthereumChain":return this.switchEthereumChain(n);case"wallet_watchAsset":return this.watchAsset(n);default:if(!this.jsonRpcUrl)throw Lt.rpc.internal("No RPC URL set for chain");return QE(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const n=sc(e);if(!this._addresses.map(i=>sc(i)).includes(n))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?sc(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const r=e.to?sc(e.to):null,i=e.value!=null?Mf(e.value):BigInt(0),a=e.data?_8(e.data):De.alloc(0),s=e.nonce!=null?Mh(e.nonce):null,o=e.gasPrice!=null?Mf(e.gasPrice):null,c=e.maxFeePerGas!=null?Mf(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?Mf(e.maxPriorityFeePerGas):null,u=e.gas!=null?Mf(e.gas):null,d=e.chainId?Mh(e.chainId):this.getChainId();return{fromAddress:n,toAddress:r,weiValue:i,data:a,nonce:s,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLim
75it:u,chainId:d}}async ecRecover(e){const{method:n,params:r}=e;if(!Array.isArray(r))throw Lt.rpc.invalidParams();const a=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:F5(r[0]),signature:F5(r[1]),addPrefix:n==="personal_ecRecover"}});if(vr(a))throw a;return a.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem(Nk))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,n;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:qc(this.getChainId())}),this._addresses;const i=await this.initializeRelay().requestEthereumAccounts();if(vr(i))throw i;if(!i.result)throw new Error("accounts received is empty");return this._setAddresses(i.result),(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:qc(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw Lt.rpc.invalidParams();const n=e[1],r=e[0];this._ensureKnownAddress(n);const a=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:sc(n),message:F5(r),addPrefix:!0,typedDataJson:null}});if(vr(a))throw a;return a.result}async _eth_signTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signEthereumTransaction(n);if(vr(i))throw i;return i.result}async _eth_sendRawTransaction(e){const n=_8(e[0]),i=await this.initializeRelay().submitEthereumTransaction(n,this.getChainId());if(vr(i))throw i;return i.result}async _eth_sendTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signAndSubmitEthereumTransaction(n);if(vr(i))throw i;return i.result}async signTypedData(e){const{method:n,params:r}=e;if(!Array.isArray(r))throw Lt.rpc.invalidParams();const i=l=>{const u={eth_signTypedData_v1:O1.hashForSignTypedDataLegacy,eth_signTypedData_v3:O1.hashForSignTypedData_v3,eth_signTypedData_v4:O1.hashForSignTypedData_v4,eth_signTypedData:O1.hashForSignTypedData_v4};return Oh(u[n]({data:d8e(l)}),!0)},a=r[n==="eth_signTypedData_v1"?1:0],s=r[n==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(a);const c=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:sc(a),message:i(s),typedDataJson:JSON.stringify(s,null,2),addPrefix:!1}});if(vr(c))throw c;return c.result}initializeRelay(){return this._relay||(this._relay=new Eo({linkAPIUrl:Ok,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const EW="SignerType",SW=new Ws("CBWSDK","SignerConfigurator");function vbe(){return SW.getItem(EW)}function wbe(t){SW.setItem(EW,t)}async function bbe(t){const{communicator:e,metadata:n,handshakeRequest:r,callback:i}=t;Cbe(e,n,i).catch(()=>{});const a={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:r})},{data:s}=await e.postRequestAndWaitForResponse(a);return s}function _be(t){const{signerType:e,metadata:n,communicator:r,callback:i}=t;switch(e){case"scw":return new S8e({metadata:n,callback:i,communicator:r});case"walletlink":return new CW({metadata:n,callback:i})}}async function Cbe(t,e,n){await t.onMessage(({event:i})=>i==="WalletLinkSessionRequest");const r=new CW({metadata:e,callback:n});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const Ebe=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app. 76 77Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,Sbe=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,n=await fetch(e,{method:"HEAD"});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const r=n.headers.get("Cross-Origin-Opener-Policy");t=r??"null",t==="same-origin"&&console.error(Ebe)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:Abe,getCrossOriginOpenerPolicy:xbe}=Sbe(),Fk=420,Uk=540,Ibe={isRed:!1,info:"Retry",svgWidth:"10",svgHeight:"11",path:_W,defaultFillRule:"evenodd",defaultClipRule:"evenodd"},Tbe="Popup was blocked. Try again.";let N1=null;function Lbe(t){const e=(window.innerWidth-Fk)/2+window.screenX,n=(window.innerHeight-Uk)/2+window.screenY;$be(t);function r(){const a=`wallet_${crypto.randomUUID()}`,s=window.open(t,a,`width=${Fk}, height=${Uk}, left=${e}, top=${n}`);return s?.focus(),s||null}let i=r();if(!i){const a=Pbe();return new Promise((s,o)=>{a.presentItem({autoExpand:!0,message:Tbe,menuItems:[Object.assign(Object.assign({},Ibe),{onClick:()=>{i=r(),i?s(i):o(Lt.rpc.internal("Popup window was blocked")),a.clear()}})]})})}return Promise.resolve(i)}function kbe(t){t&&!t.closed&&t.close()}function $be(t){const e={sdkName:zH,sdkVersion:w0,origin:window.location.origin,coop:xbe()};for(const[n,r]of Object.entries(e))t.searchParams.append(n,r.toString())}function Pbe(){if(!N1){const t=document.createElement("div");t.className="-cbwsdk-css-reset",document.body.appendChild(t),N1=new wW,N1.attach(t)}return N1}class Rbe{constructor({url:e=gbe,metadata:n,preference:r}){this.popup=null,this.listeners=new Map,this.postMessage=async i=>{(await this.waitForPopupLoaded()).postMessage(i,this.url.origin)},this.postRequestAndWaitForResponse=async i=>{const a=this.onMessage(({requestId:s})=>s===i.id);return this.postMessage(i),await a},this.onMessage=async i=>new Promise((a,s)=>{const o=c=>{if(c.origin!==this.url.origin)return;const l=c.data;i(l)&&(a(l),window.removeEventListener("message",o),this.listeners.delete(o))};window.addEventListener("message",o),this.listeners.set(o,{reject:s})}),this.disconnect=()=>
77{kbe(this.popup),this.popup=null,this.listeners.forEach(({reject:i},a)=>{i(Lt.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",a)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=await Lbe(this.url),this.onMessage(({event:i})=>i==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:i})=>i==="PopupLoaded").then(i=>{this.postMessage({requestId:i.id,data:{version:w0,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw Lt.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=n,this.preference=r}}function Obe(t){const e=s8e(Mbe(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",w0),n.searchParams.set("code",e.code.toString()),n.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:n.href})}function Mbe(t){var e;if(typeof t=="string")return{message:t,code:Ln.rpc.internal};if(vr(t)){const n=t.errorMessage,r=(e=t.errorCode)!==null&&e!==void 0?e:n.match(/(denied|rejected)/i)?Ln.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:n,code:r,data:{method:t.method}})}return t}class Nbe extends ll{}var Dbe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};class Fbe extends Nbe{constructor(e){var{metadata:n}=e,r=e.preference,{keysUrl:i}=r,a=Dbe(r,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=n,this.preference=a,this.communicator=new Rbe({url:i,metadata:n,preference:a});const s=vbe();s&&(this.signer=this.initSigner(s))}async request(e){try{if(E8e(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const n=await this.requestSignerSelection(e),r=this.initSigner(n);await r.handshake(e),this.signer=r,wbe(n);break}case"wallet_sendCalls":{const n=this.initSigner("scw");await n.handshake({method:"handshake"});const r=await n.request(e);return await n.cleanup(),r}case"wallet_getCallsStatus":return QE(e,ybe);case"net_version":return 1;case"eth_chainId":return qc(1);default:throw Lt.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(n){const{code:r}=n;return r===Ln.provider.unauthorized&&this.disconnect(),Promise.reject(Obe(n))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await((e=this.signer)===null||e===void 0?void 0:e.cleanup()),this.signer=null,Ws.clearAll(),this.emit("disconnect",Lt.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return bbe({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return _be({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function Ube(t){if(t){if(!["all","smartWalletOnly","eoaOnly"].includes(t.options))throw new Error(`Invalid options: ${t.options}`);if(t.attribution&&t.attribution.auto!==void 0&&t.attribution.dataSuffix!==void 0)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}function jbe(t){var e;const n={metadata:t.metadata,preference:t.preference};return(e=C8e(n))!==null&&e!==void 0?e:new Fbe(n)}const Bbe={options:"all"};function jk(t){var e;new Ws("CBWSDK").setItem("VERSION",w0),Abe();const r={metadata:{appName:t.appName||"Dapp",appLogoUrl:t.appLogoUrl||"",appChainIds:t.appChainIds||[]},preference:Object.assign(Bbe,(e=t.preference)!==null&&e!==void 0?e:{})};Ube(r.preference);let i=null;return{getProvider:()=>(i||(i=jbe(r)),i)}}var Bk=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;
vendor: 29,658 bytes, lines 77-91
77r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))},Vbe=function(){function t(e,n,r){this.name=e,this.version=n,this.os=r,this.type="browser"}return t}(),Hbe=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=ur.platform}return t}(),Wbe=function(){function t(e,n,r,i){this.name=e,this.version=n,this.os=r,this.bot=i,this.type="bot-device"}return t}(),qbe=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),zbe=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Zbe=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Kbe=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Vk=3,Gbe=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Zbe]],Hk=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Ybe(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new zbe:typeof navigator<"u"?Xbe(navigator.userAgent):e9e()}function Jbe(t){return t!==""&&Gbe.reduce(function(e,n){var r=n[0],i=n[1];if(e)return e;var a=i.exec(t);return!!a&&[r,a]},!1)}function Xbe(t){var e=Jbe(t);if(!e)return null;var n=e[0],r=e[1];if(n==="searchbot")return new qbe;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<Vk&&(i=Bk(Bk([],i,!0),t9e(Vk-i.length),!0)):i=[];var a=i.join("."),s=Qbe(t),o=Kbe.exec(t);return o&&o[1]?new Wbe(n,a,s,o[1]):new Vbe(n,a,s)}function Qbe(t){for(var e=0,n=Hk.length;e<n;e++){var r=Hk[e],i=r[0],a=r[1],s=a.exec(t);if(s)return i}return null}function e9e(){var t=typeof ur<"u"&&ur.version;return t?new Hbe(ur.version.slice(1)):null}function t9e(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}var Oe={};/*! ***************************************************************************** 78Copyright (c) Microsoft Corporation. 79 80Permission to use, copy, modify, and/or distribute this software for any 81purpose with or without fee is hereby granted. 82 83THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 84REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 85AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 86INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 87LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 88OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 89PERFORMANCE OF THIS SOFTWARE. 90***************************************************************************** */var L8=function(t,e){return L8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},L8(t,e)};function n9e(t,e){L8(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var k8=function(){return k8=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},k8.apply(this,arguments)};function r9e(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function i9e(t,e,n,r){var i=arguments.length,a=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,r);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,n,a):s(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function a9e(t,e){return function(n,r){e(n,r,t)}}function s9e(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function o9e(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(u){try{l(r.next(u))}catch(d){s(d)}}function c(u){try{l(r.throw(u))}catch(d){s(d)}}function l(u){u.done?a(u.value):i(u.value).then(o,c)}l((r=r.apply(t,e||[])).next())})}function c9e(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function l9e(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}function u9e(t,e){for(var n in t)n!=="default"&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function $8(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function AW(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function d9e(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(AW(arguments[e]));return t}function f9e(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)r[i]=a[s];return r}function Rp(t){return this instanceof Rp?(this.v=t,this):new Rp(t)}function h9e(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(f){r[f]&&(i[f]=function(h){return new Promise(function(p,g){a.push([f,h,p,g])>1||o(f,h)})})}function o(f,h){try{c(r[f](h))}catch(p){d(a[0][3],p)}}function c(f){f.value instanceof Rp?Promise.resolve(f.value.v).then(l,u):d(a[0][2],f)}function l(f){o("next",f)}function u(f){o("throw",f)}function d(f,h){f(h),a.shift(),a.length&&o(a[0][0],a[0][1])}}function p9e(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,a){e[i]=t[i]?function(s){return(n=!n)?{value:Rp(t[i](s)),done:i==="return"}:a?a(s):s}:a}}function g9e(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof $8=="function"?$8(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(s){return new Promise(function(o,c){s=t[a](s),i(o,c,s.done,s.value)})}}function i(a,s,o,c){Promise.resolve(c).then(function(l){a({value:l,done:o})},s)}}function y9e(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function m9e(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function v9e(t){return t&&t.__esModule?t:{default:t}}function w9e(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function b9e(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}const _9e=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return k8},__asyncDelegator:p9e,__asyncGenerator:h9e,__asyncValues:g9e,__await:Rp,__awaiter:o9e,__classPrivateFieldGet:w9e,__classPrivateFieldSet:b9e,__createBinding:l9e,__decorate:i9e,__exportStar:u9e,__extends:n9e,__generator:c9e,__importDefault:v9e,__importStar:m9e,__makeTemplateObject:y9e,__metadata:s9e,__param:a9e,__read:AW,__rest:r9e,__spread:d9e,__spreadArrays:f9e,__values:$8},Symbol.toStringTag,{value:"Module"})),b0=yQ(_9e);var q5={},Nf={},Wk;function C9e(){if(Wk)return Nf;Wk=1,Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.delay=void 0;function t(e){return new Promise(n=>{setTimeout(()=>{n(!0)},e)})}return Nf.delay=t,Nf}var Sl={},z5={},Al={},qk;function E9e(){return qk||(qk=1,Object.defineProperty(Al,"__esModule",{value:!0}),Al.ONE_THOUSAND=Al.ONE_HUNDRED=void 0,Al.ONE_HUNDRED=100,Al.ONE_THOUSAND=1e3),Al}var Z5={},zk;function S9e(){return zk||(zk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(Z5)),Z5}var Zk;function xW(){return Zk||(Zk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=b0;e.__exportStar(E9e(),t),e.__exportStar(S9e(),t)}(z5)),z5}var Kk;function A9e(){if(Kk)return Sl;Kk=1,Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.fromMiliseconds=Sl.toMiliseconds=void 0;const t=xW();function e(r){return r*t.ONE_THOUSAND}Sl.toMiliseconds=e;function n(r){return Math.floor(r/t.ONE_THOUSAND)}return Sl.fromMiliseconds=n,Sl}var Gk;function x9e(){return Gk||(Gk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=b0;e.__exportStar(C9e(),t),e.__exportStar(A9e(),t)}(q5)),q5}var ad={},Yk;function I9e(){if(Yk)return ad;Yk=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(n){if(this.timestamps.has(n))throw new Error(`Watch already started for label: ${n}`);this.timestamps.set(n,{started:Date.now()})}stop(n){const r=this.get(n);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${n}`);const i=Date.now()-r.started;this.timestamps.set(n,{started:r.started,elapsed:i})}get(n){const r=this.timestamps.get(n);if(typeof r>"u")throw new Error(`No timestamp found for label: ${n}`);return r}elapsed(n){const r=this.get(n);return r.elapsed||Date.now()-r.started}}return ad.Watch=t,ad.default=t,ad}var K5={},Df={},Jk;function T9e(){if(Jk)return Df;Jk=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.IWatch=void 0;class t{}return Df.IWatch=t,Df}var Xk;function L9e(){return Xk||(Xk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),b0.__exportStar(T9e(),t)}(K5)),K5}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=b0;e.__exportStar(x9e(),t),e.__exportStar(I9e(),t),e.__exportStar(L9e(),t),e.__exportStar(xW(),t)})(Oe);var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.getLocalStorage=tn.getLocalStorageOrThrow=tn.getCrypto=tn.getCryptoOrThrow=IW=tn.getLocation=tn.getLocationOrThrow=aS=tn.getNavigator=tn.getNavigatorOrThrow=Eu=tn.getDocument=tn.getDocumentOrThrow=tn.getFromWindowOrThrow=tn.getFromWindow=void 0;function Nu(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}tn.getFromWindow=Nu;function J2(t){const e=Nu(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}tn.getFromWindowOrThrow=J2;function k9e(){return J2("document")}tn.getDocumentOrThrow=k9e;function $9e(){return Nu("document")}var Eu=tn.getDocument=$9e;function P9e(){return J2("navigator")}tn.getNavigatorOrThrow=P9e;function R9e(){return Nu("navigator")}var aS=tn.getNavigator=R9e;function O9e(){return J2("location")}tn.getLocationOrThrow=O9e;function M9e(){return Nu("location")}var IW=tn.getLocation=M9e;function N9e(){return J2("crypto")}tn.getCryptoOrThrow=N9e;function D9e(){return Nu("crypto")}tn.getCrypto=D9e;function F9e(){return J2("localStorage")}tn.getLocalStorageOrThrow=F9e;function U9e(){return Nu("localStorage")}tn.getLocalStorage=U9e;var sS={};Object.defineProperty(sS,"__esModule",{value:!0});var TW=sS.getWindowMetadata=void 0;const Qk=tn;function j9e(){let t,e;try{t=Qk.getDocumentOrThrow(),e=Qk.getLocationOrThrow()}catch{return null}function n(){const d=t.getElementsByTagName("link"),f=[];for(let h=0;h<d.length;h++){const p=d[h],g=p.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const y=p.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let v=e.protocol+"//"+e.host;if(y.indexOf("/")===0)v+=y;else{const b=e.pathname.split("/");b.pop();const w=b.join("/");v+=w+"/"+y}f.push(v)}else if(y.indexOf("//")===0){const v=e.protocol+y;f.push(v)}else f.push(y)}}return f}function r(...d){const f=t.getElementsByTagName("meta");for(let h=0;h<f.length;h++){const p=f[h],g=["itemprop","property","name"].map(y=>p.getAttribute(y)).filter(y=>y?d.includes(y):!1);if(g.length&&g){const y=p.getAttribute("content");if(y)return y}}return""}function i(){let d=r("name","og:site_name","og:title","twitter:title");return d||(d=t.title),d}function a(){return r("description","og:description","twitter:description","keywords")}const s=i(),o=a(),c=e.origin,l=n();return{description:o,url:c,icons:l,name:s}}TW=sS.getWindowMetadata=j9e;const B9e="0.1.1";function V9e(){return B9e}class vn extends Error{constructor(e,n={}){const r=(()=>{if(n.cause instanceof vn){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:n.cause?.message?n.cause.message:n.details})(),i=n.cause instanceof vn&&n.cause.docsPath||n.docsPath,s=`https://oxlib.sh${i??""}`,o=[e||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||i?["",r?`Details: ${r}`:void 0,i?`See: ${s}`:void 0]:[]].filter(c=>typeof c=="string").join(` 91`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${V9e()}`}),this.cause=n.cause,this.details=r,this.docs=s,this.docsPath=i,this.shortMessage=e}walk(e){return LW(this,e)}}function LW(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?LW(t.cause,e):e?null:t}function H9e(t,e){if(r$(t)>e)throw new u_e({givenSize:r$(t),maxSize:e})}const io={zero:48,nine:57,A:65,F:70,a:97,f:102};function e$(t){if(t>=io.zero&&t<=io.nine)return t-io.zero;if(t>=io.A&&t<=io.F)return t-(io.A-10);if(t>=io.a&&t<=io.f)return t-(io.a-10)}function W9e(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;if(t.length>r)throw new d_e({size:t.length,targetSize:r,type:"Bytes"});const i=new Uint8Array(r);for(let a=0;a<r;a++){const s=n==="right";i[s?a:r-a-1]=t[s?a:t.length-a-1]}return i}function kW(t,e){if(rl(t)>e)throw new e_e({givenSize:rl(t),maxSize:e})}function q9e(t,e){if(typeof e=="number"&&e>0&&e>rl(t)-1)throw new RW({offset:e,position:"start",size:rl(t)})}function z9e(t,e,n){if(typeof e=="number"&&typeof n=="number"&&rl(t)!==n-e)throw new RW({offset:n,position:"end",size:rl(t)})}function $W(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;const i=t.replace("0x","");if(i.length>r*2)throw new t_e({size:Math.ceil(i.length/2),targetSize:r,type:"Hex"});return`0x${i[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const Z9e="#__bigint";function oS(t,e,n){return JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString()+Z9e:i,n)}const K9e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function G9e(t,e={}){const{strict:n=!1}=e;if(!t)throw new t$(t);if(typeof t!="string")throw new t$(t);if(n&&!/^0x[0-9a-fA-F]*$/.test(t))throw new n$(t);if(!t.startsWith("0x"))throw new n$(t)}function Y9e(...t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}function cS(t){return t instanceof Uint8Array?ky(t):Array.isArray(t)?ky(new Uint8Array(t)):t}function ky(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=K9e[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(kW(r,e.size),PW(r,e.size)):r}function G5(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const s=typeof a=="bigint"&&n?-a-1n:0;if(a&&i>a||i<s){const l=typeof t=="bigint"?"n":"";throw new Q9e({max:a?`${a}${l}`:void 0,min:`${s}${l}`,signed:n,size:r,value:`${t}${l}`})}const c=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?J9e(c,r):c}function J9e(t,e){return $W(t,{dir:"left",size:e})}function PW(t,e){return $W(t,{dir:"right",size:e})}function mo(t,e,n,r={}){const{strict:i}=r;q9e(t,e);const a=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return i&&z9e(a,e,n),a}function rl(t){return Math.ceil((t.length-2)/2)}function X9e(t,e={}){const{strict:n=!1}=e;try{return G9e(t,{strict:n}),!0}catch{return!1}}class Q9e extends vn{constructor({max:e,min:n,signed:r,size:i,value:a}){super(`Number \`${a}\` is not in safe${i?` ${i*8}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class t$ extends vn{constructor(e){super(`Value \`${typeof e=="object"?oS(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class n$ extends vn{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}let e_e=class extends vn{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};class RW extends vn{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}let t_e=class extends vn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};const n_e=new TextEncoder;function r_e(t){if(!(t instanceof Uint8Array)){if(!t)throw new D1(t);if(typeof t!="object")throw new D1(t);if(!("BYTES_PER_ELEMENT"in t))throw new D1(t);if(t.BYTES_PER_ELEMENT!==1||t.constructor.name!=="Uint8Array")throw new D1(t)}}function i_e(t){return t instanceof Uint8Array?t:typeof t=="string"?s_e(t):a_e(t)}function a_e(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function s_e(t,e={}){const{size:n}=e;let r=t;n&&(kW(t,n),r=PW(t,n));let i=r.slice(2);i.length%2&&(i=`0${i}`);const a=i.length/2,s=new Uint8Array(a);for(let o=0,c=0;o<a;o++){const l=e$(i.charCodeAt(c++)),u=e$(i.charCodeAt(c++));if(l===void 0||u===void 0)throw new vn(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);s[o]=l*16+u}return s}function o_e(t,e={}){const{size:n}=e,r=n_e.encode(t);return typeof n=="number"?(H9e(r,n),c_e(r,n)):r}function c_e(t,e){return W9e(t,{dir:"right",size:e})}function r$(t){return t.length}function l_e(t){try{return r_e(t),!0}catch{return!1}}class D1 extends vn{constructor(e){super(`Value \`${typeof e=="object"?oS(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class u_e extends vn{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class d_e extends vn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}function OW(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=mQ(i_e(t));return n==="Bytes"?r:ky(r)}class f_e extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const h_e={checksum:new f_e(8192)},Y5=h_e.checksum;function MW(t,e={}){const{compressed:n}=e,{prefix:r,x:i,y:a}=t;if(n===!1||typeof i=="bigint"&&typeof a=="bigint"){if(r!==4)throw new i$({prefix:r,cause:new w_e});return}if(n===!0||typeof i=="bigint"&&typeof a>"u"){if(r!==3&&r!==2)throw new i$({prefix:r,cause:new v_e});return}throw new m_e({publicKey:t})}function p_e(t){const e=(()=>{if(X9e(t))return NW(t);if(l_e(t))return g_e(t);const{prefix:n,x:r,y:i}=t;return typeof r=="bigint"&&typeof i=="bigint"?{prefix:n??4,x:r,y:i}:{prefix:n,x:r}})();return MW(e),e}function g_e(t){return NW(ky(t))}function NW(t){if(t.length!==132&&t.length!==130&&t.length!==68)throw new b_e({publicKey:t});if(t.length===130){const r=BigInt(mo(t,0,32)),i=BigInt(mo(t,32,64));return{prefix:4,x:r,y:i}}if(t.length===132){const r=Number(mo(t,0,1)),i=BigInt(mo(t,1,33)),a=BigInt(mo(t,33,65));return{prefix:r,x:i,y:a}}const e=Number(mo(t,0,1)),n=BigInt(mo(t,1,33));return{prefix:e,x:n}}function y_e(t,e={}){MW(t);const{prefix:n,x:r,y:i}=t,{includePrefix:a=!0}=e;return Y9e(a?G5(n,{size:1}):"0x",G5(r,{size:32}),typeof i=="bigint"?G5(i,{size:32}):"0x")}class m_e extends vn{constructor({publicKey:e}){super(`Value \`${oS(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class i$ extends vn{constructor({prefix:e,cause:n}){super(`Prefix "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class v_e extends vn{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class w_e extends vn{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let b_e=class extends vn{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${rl(cS(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const __e=/^0x[a-fA-F0-9]{40}$/;function DW(t,e={}){const{strict:n=!0}=e;if(!__e.test(t))throw new a$({address:t,cause:new S_e});if(n){if(t.toLowerCase()===t)return;if(FW(t)!==t)throw new a$({address:t,cause:new A_e})}}function FW(t){if(Y5.has(t))return Y5.get(t);DW(t,{strict:!1});const e=t.substring(2).toLowerCase(),n=OW(o_e(e),{as:"Bytes"}),r=e.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&r[a]&&(r[a]=r[a].toUpperCase()),(n[a>>1]&15)>=8&&r[a+1]&&(r[a+1]=r[a+1].toUpperCase());const i=`0x${r.join("")}`;return Y5.set(t,i),i}function C_e(t,e={}){const{checksum:n=!1}=e;return DW(t),n?FW(t):t}function E_e(t,e={}){const n=OW(`0x${y_e(t).slice(4)}`).substring(26);return C_e(`0x${n}`,e)}class a$ extends vn{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class S_e extends vn{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class A_e extends vn{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function x_e(t){if(t.length!==130&&t.length!==132)throw new T_e({signature:t});const e=BigInt(mo(t,0,32)),n=BigInt(mo(t,32,64)),r=(()=>{const i=+`0x${t.slice(130)}`;if(!Number.isNaN(i))try{return I_e(i)}catch{throw new L_e({value:i})}})();return typeof r>"u"?{r:e,s:n}:{r:e,s:n,yParity:r}}function I_e(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new k_e({value:t})}class T_e extends vn{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${rl(cS(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class L_e extends vn{constructor({value:e}){super(`Value \`${e}
91\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class k_e extends vn{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function $_e(t){return E_e(P_e(t))}function P_e(t){const{payload:e,signature:n}=t,{r,s:i,yParity:a}=n,o=new O2.Signature(BigInt(r),BigInt(i)).addRecoveryBit(a).recoverPublicKey(cS(e).substring(2));return p_e(o)}function R_e(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let l=0;l<e.length;l++)e[l]=255;for(let l=0;l<t.length;l++){const u=t.charAt(l),d=u.charCodeAt(0);if(e[d]!==255)throw new TypeError(u+" is ambiguous");e[d]=l}const n=t.length,r=t.charAt(0),i=Math.log(n)/Math.log(256),a=Math.log(256)/Math.log(n);function s(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let u=0,d=0,f=0;const h=l.length;for(;f!==h&&l[f]===0;)f++,u++;const p=(h-f)*a+1>>>0,g=new Uint8Array(p);for(;f!==h;){let b=l[f],w=0;for(let _=p-1;(b!==0||w<d)&&_!==-1;_--,w++)b+=256*g[_]>>>0,g[_]=b%n>>>0,b=b/n>>>0;if(b!==0)throw new Error("Non-zero carry");d=w,f++}let y=p-d;for(;y!==p&&g[y]===0;)y++;let v=r.repeat(u);for(;y<p;++y)v+=t.charAt(g[y]);return v}function o(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let u=0,d=0,f=0;for(;l[u]===r;)d++,u++;const h=(l.length-u)*i+1>>>0,p=new Uint8Array(h);for(;u<l.length;){const b=l.charCodeAt(u);if(b>255)return;let w=e[b];if(w===255)return;let _=0;for(let E=h-1;(w!==0||_<f)&&E!==-1;E--,_++)w+=n*p[E]>>>0,p[E]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");f=_,u++}let g=h-f;for(;g!==h&&p[g]===0;)g++;const y=new Uint8Array(d+(h-g));let v=d;for(;g!==h;)y[v++]=p[g++];return y}function c(l){const u=o(l);if(u)return u;throw new Error("Non-base"+n+" character")}return{encode:s,decodeUnsafe:o,decode:c}}var O_e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const _0=R_e(O_e);function M_e(t){const e=t.length;let n=0,r=0;for(;r<e;){let i=t.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<e){const a=t.charCodeAt(r);(a&64512)===56320&&(++r,i=((i&1023)<<10)+(a&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function N_e(t,e,n){const r=t.length;let i=n,a=0;for(;a<r;){let s=t.charCodeAt(a++);if(s&4294967168)if(!(s&4294965248))e[i++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&a<r){const o=t.charCodeAt(a);(o&64512)===56320&&(++a,s=((s&1023)<<10)+(o&1023)+65536)}s&4294901760?(e[i++]=s>>18&7|240,e[i++]=s>>12&63|128,e[i++]=s>>6&63|128):(e[i++]=s>>12&15|224,e[i++]=s>>6&63|128)}else{e[i++]=s;continue}e[i++]=s&63|128}}const D_e=new TextEncoder,F_e=50;function U_e(t,e,n){D_e.encodeInto(t,e.subarray(n))}function j_e(t,e,n){t.length>F_e?U_e(t,e,n):N_e(t,e,n)}const B_e=4096;function UW(t,e,n){let r=e;const i=r+n,a=[];let s="";for(;r<i;){const o=t[r++];if(!(o&128))a.push(o);else if((o&224)===192){const c=t[r++]&63;a.push((o&31)<<6|c)}else if((o&240)===224){const c=t[r++]&63,l=t[r++]&63;a.push((o&31)<<12|c<<6|l)}else if((o&248)===240){const c=t[r++]&63,l=t[r++]&63,u=t[r++]&63;let d=(o&7)<<18|c<<12|l<<6|u;d>65535&&(d-=65536,a.push(d>>>10&1023|55296),d=56320|d&1023),a.push(d)}else a.push(o);a.length>=B_e&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}const V_e=new TextDecoder,H_e=200;function W_e(t,e,n){const r=t.subarray(e,e+n);return V_e.decode(r)}function q_e(t,e,n){return n>H_e?W_e(t,e,n):UW(t,e,n)}class F1{constructor(e,n){this.type=e,this.data=n}}class zi extends Error{constructor(e){super(e);const n=Object.create(zi.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:zi.name})}}const Ff=4294967295;function z_e(t,e,n){const r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function jW(t,e,n){const r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function BW(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function Z_e(t,e){const n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}const K_e=-1,G_e=4294967296-1,Y_e=17179869184-1;function J_e({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Y_e)if(e===0&&t<=G_e){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,i=new Uint8Array(8),a=new DataView(i.buffer);return a.setUint32(0,e<<2|n&3),a.setUint32(4,r),i}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),jW(r,4,t),n}}function X_e(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function Q_e(t){if(t instanceof Date){const e=X_e(t);return J_e(e)}else return null}function eCe(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),i=(n&3)*4294967296+r,a=n>>>2;return{sec:i,nsec:a}}case 12:{const n=BW(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new zi(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function tCe(t){const e=eCe(t);return new Date(e.sec*1e3+e.nsec/1e6)}const nCe={type:K_e,encode:Q_e,decode:tCe};class $y{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(nCe)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const i=-1-e;this.builtInEncoders[i]=n,this.builtInDecoders[i]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const i=this.builtInEncoders[r];if(i!=null){const a=i(e,n);if(a!=null){const s=-1-r;return new F1(s,a)}}}for(let r=0;r<this.encoders.length;r++){const i=this.encoders[r];if(i!=null){const a=i(e,n);if(a!=null){const s=r;return new F1(s,a)}}}return e instanceof F1?e:null}decode(e,n,r){const i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new F1(n,e)}}$y.defaultCodec=new $y;function rCe(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function P8(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):rCe(t)?new Uint8Array(t):Uint8Array.from(t)}const iCe=100,aCe=2048;
vendor: 21,981 bytes, line 91
91let sCe=class VW{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??$y.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??iCe,this.initialBufferSize=e?.initialBufferSize??aCe,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new VW({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=M_e(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),j_e(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=P8(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const i of e)this.doEncode(i,n+1)}countWithoutUndefined(e,n){let r=0;for(const i of n)e[i]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const a of r){const s=e[a];this.ignoreUndefined&&s===void 0||(this.encodeString(a),this.doEncode(s,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),i=r.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),z_e(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),jW(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function oCe(t,e){return new sCe(e).encodeSharedRef(t)}function J5(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const cCe=16,lCe=16;class uCe{constructor(e=cCe,n=lCe){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=n,this.caches=[];for(let r=0;r<this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,n,r){const i=this.caches[r-1];e:for(const a of i){const s=a.bytes;for(let o=0;o<r;o++)if(s[o]!==e[n+o])continue e;return a.str}return null}store(e,n){const r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)}decode(e,n,r){const i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;const a=UW(e,n,r),s=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(s,a),a}}const R8="array",Uh="map_key",HW="map_value",dCe=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new zi("The type of key must be string or number but "+typeof t)};class fCe{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const n=this.getUninitializedStateFromPool();n.type=R8,n.position=0,n.size=e,n.array=new Array(e)}pushMapState(e){const n=this.getUninitializedStateFromPool();n.type=Uh,n.readCount=0,n.size=e,n.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===R8){const r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===Uh||e.type===HW){const r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const Uf=-1,lS=new DataView(new ArrayBuffer(0)),hCe=new Uint8Array(lS.buffer);try{lS.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const s$=new RangeError("Insufficient data"),pCe=new uCe;let gCe=class WW{constructor(e){this.totalPos=0,this.pos=0,this.view=lS,this.bytes=hCe,this.headByte=Uf,this.stack=new fCe,this.entered=!1,this.extensionCodec=e?.extensionCodec??$y.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??Ff,this.maxBinLength=e?.maxBinLength??Ff,this.maxArrayLength=e?.maxArrayLength??Ff,this.maxMapLength=e?.maxMapLength??Ff,this.maxExtLength=e?.maxExtLength??Ff,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:pCe,this.mapKeyConverter=e?.mapKeyConverter??dCe}clone(){return new WW({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=Uf,this.stack.reset()}setBuffer(e){const n=P8(e);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===Uf&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),r=P8(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:n,pos:r}=this;return new RangeError(`Extra ${n.byteLength-r} of ${n.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let n=!1,r;for await(const o of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{r=this.doDecodeSync(),n=!0}catch(c){if(!(c instanceof RangeError))throw c}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}const{headByte:i,pos:a,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${J5(i)} at ${s} (${a} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){if(this.entered){yield*this.clone().decodeMultiAsync(e,n);return}try{this.entered=!0;let r=n,i=-1;for await(const a of e){if(n&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a),r&&(i=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(s){if(!(s instanceof RangeError))throw s}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let n;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else{const i=e-160;n=this.decodeString(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){const i=this.lookU8();n=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();n=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();n=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===196){const i=this.lookU8();n=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();n=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();n=this.decodeBinary(i,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();n=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();n=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();n=this.decodeExtension(i,4)}else throw new zi(`Unrecognized type byte: ${J5(e)}`);this.complete();const r=this.stack;for(;r.length>0;){const i=r.top();if(i.type===R8)if(i.array[i.position]=n,i.position++,i.position===i.size)n=i.array,r.release(i);else continue e;else if(i.type===Uh){if(n==="__proto__")throw new zi("The key __proto__ is not allowed");i.key=this.mapKeyConverter(n),i.type=HW;continue e}else if(i.map[i.key]=n,i.readCount++,i.readCount===i.size)n=i.map,r.release(i);else{i.key=null,i.type=Uh;continue e}}return n}}readHeadByte(){return this.headByte===Uf&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=Uf}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new zi(`Unrecognized array type byte: ${J5(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new zi(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new zi(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)}decodeUtf8String(e,n){if(e>this.maxStrLength)throw new zi(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw s$;const r=this.pos+n;let i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,r,e):i=q_e(this.bytes,r,e),this.pos+=n+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Uh:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new zi(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw s$;const r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i}decodeExtension(e,n){if(e>this.maxExtLength)throw new zi(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=Z_e(this.view,this.pos);return this.pos+=8,e}readI64(){const e=BW(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function yCe(t,e){return new gCe(e).decode(t)}const mCe=t=>JSON.stringify(t,(e,n)=>typeof n=="bigint"?n.toString()+"n":n),vCe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,n=t.replace(e,'$1"$2n"$3');return JSON.parse(n,(r,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Su(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return vCe(t)}catch{return t}}function Bo(t){return typeof t=="string"?t:mCe(t)||""}function wCe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function qW(t,...e){if(!wCe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function o$(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function bCe(t,e){qW(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const sd=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const X5=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function _Ce(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function zW(t){return typeof t=="string"&&(t=_Ce(t)),qW(t),t}let CCe=class{clone(){return this._cloneInto()}};function ECe(t){const e=r=>t().update(zW(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function ZW(t=32){if(sd&&typeof sd.getRandomValues=="function")return sd.getRandomValues(new Uint8Array(t));if(sd&&typeof sd.randomBytes=="function")return sd.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function SCe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),s=Number(n>>i&a),o=Number(n&a),c=r?4:0,l=r?0:4;t.setUint32(e+c,s,r),t.setUint32(e+l,o,r)}let ACe=class extends CCe{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=X5(this.buffer)}update(e){o$(this);const{view:n,buffer:r,blockLen:i}=this;e=zW(e);const a=e.length;for(let s=0;s<a;){const o=Math.min(i-this.pos,a-s);if(o===i){const c=X5(e);for(;i<=a-s;s+=i)this.process(c,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){o$(this),bCe(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:a}=this;let{pos:s}=this;n[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;SCe(r,i-8,BigInt(this.length*8),a),this.process(r,0);const o=X5(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)o.setUint32(4*d,u[d],a)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:a,destroyed:s,pos:o}=this;return e.length=i,e.pos=o,e.finished=a,e.destroyed=s,i%n&&e.buffer.set(r),e}};const U1=BigInt(2**32-1),O8=BigInt(32);function KW(t,e=!1){return e?{h:Number(t&U1),l:Number(t>>O8&U1)}:{h:Number(t>>O8&U1)|0,l:Number(t&U1)|0}}function xCe(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:a,l:s}=KW(t[i],e);[n[i],r[i]]=[a,s]}return[n,r]}const ICe=(t,e)=>BigInt(t>>>0)<<O8|BigInt(e>>>0),TCe=(t,e,n)=>t>>>n,LCe=(t,e,n)=>t<<32-n|e>>>n,kCe=(t,e,n)=>t>>>n|e<<32-n,$Ce=(t,e,n)=>t<<32-n|e>>>n,PCe=(t,e,n)=>t<<64-n|e>>>n-32,RCe=(t,e,n)=>t>>>n-32|e<<64-n,OCe=(t,e)=>e,MCe=(t,e)=>t,NCe=(t,e,n)=>t<<n|e>>>32-n,DCe=(t,e,n)=>e<<n|t>>>32-n,FCe=(t,e,n)=>e<<n-32|t>>>64-n,UCe=(t,e,n)=>t<<n-32|e>>>64-n;function jCe(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const BCe=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),VCe=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,HCe=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),WCe=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,qCe=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),zCe=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,mt={fromBig:KW,split:xCe,toBig:ICe,shrSH:TCe,shrSL:LCe,rotrSH:kCe,rotrSL:$Ce,rotrBH:PCe,rotrBL:RCe,rotr32H:OCe,rotr32L:MCe,rotlSH:NCe,rotlSL:DCe,rotlBH:FCe,rotlBL:UCe,add:jCe,add3L:BCe,add3H:VCe,add4L:HCe,add4H:WCe,add5H:z
91Ce,add5L:qCe},[ZCe,KCe]=mt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0
91x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),oc=new Uint32Array(80),cc=new Uint32Array(80);let GCe=class extends ACe{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:a,Cl:s,Dh:o,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:p,Hh:g,Hl:y}=this;return[e,n,r,i,a,s,o,c,l,u,d,f,h,p,g,y]}set(e,n,r,i,a,s,o,c,l,u,d,f,h,p,g,y){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=a|0,this.Cl=s|0,this.Dh=o|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=h|0,this.Gl=p|0,this.Hh=g|0,this.Hl=y|0}process(e,n){for(let w=0;w<16;w++,n+=4)oc[w]=e.getUint32(n),cc[w]=e.getUint32(n+=4);for(let w=16;w<80;w++){const _=oc[w-15]|0,E=cc[w-15]|0,C=mt.rotrSH(_,E,1)^mt.rotrSH(_,E,8)^mt.shrSH(_,E,7),x=mt.rotrSL(_,E,1)^mt.rotrSL(_,E,8)^mt.shrSL(_,E,7),$=oc[w-2]|0,T=cc[w-2]|0,U=mt.rotrSH($,T,19)^mt.rotrBH($,T,61)^mt.shrSH($,T,6),O=mt.rotrSL($,T,19)^mt.rotrBL($,T,61)^mt.shrSL($,T,6),F=mt.add4L(x,O,cc[w-7],cc[w-16]),k=mt.add4H(F,C,U,oc[w-7],oc[w-16]);oc[w]=k|0,cc[w]=F|0}let{Ah:r,Al:i,Bh:a,Bl:s,Ch:o,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:p,Gh:g,Gl:y,Hh:v,Hl:b}=this;for(let w=0;w<80;w++){const _=mt.rotrSH(d,f,14)^mt.rotrSH(d,f,18)^mt.rotrBH(d,f,41),E=mt.rotrSL(d,f,14)^mt.rotrSL(d,f,18)^mt.rotrBL(d,f,41),C=d&h^~d&g,x=f&p^~f&y,$=mt.add5L(b,E,x,KCe[w],cc[w]),T=mt.add5H($,v,_,C,ZCe[w],oc[w]),U=$|0,O=mt.rotrSH(r,i,28)^mt.rotrBH(r,i,34)^mt.rotrBH(r,i,39),F=mt.rotrSL(r,i,28)^mt.rotrBL(r,i,34)^mt.rotrBL(r,i,39),k=r&a^r&o^a&o,S=i&s^i&c^s&c;v=g|0,b=y|0,g=h|0,y=p|0,h=d|0,p=f|0,{h:d,l:f}=mt.add(l|0,u|0,T|0,U|0),l=o|0,u=c|0,o=a|0,c=s|0,a=r|0,s=i|0;const I=mt.add3L(U,F,S);r=mt.add3H(I,T,O,k),i=I|0}({h:r,l:i}=mt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:a,l:s}=mt.add(this.Bh|0,this.Bl|0,a|0,s|0),{h:o,l:c}=mt.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:l,l:u}=mt.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=mt.add(this.Eh|0,this.El|0,d|0,f|0),{h,l:p}=mt.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:g,l:y}=mt.add(this.Gh|0,this.Gl|0,g|0,y|0),{h:v,l:b}=mt.add(this.Hh|0,this.Hl|0,v|0,b|0),this.set(r,i,a,s,o,c,l,u,d,f,h,p,g,y,v,b)}roundClean(){oc.fill(0),cc.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const YCe=ECe(()=>new GCe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const uS=BigInt(0),GW=BigInt(1),JCe=BigInt(2);function dS(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function fS(t){if(!dS(t))throw new Error("Uint8Array expected")}function Q5(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const XCe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function hS(t){fS(t);let e="";for(let n=0;n<t.length;n++)e+=XCe[t[n]];return e}function YW(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?uS:BigInt("0x"+t)}const ao={_0:48,_9:57,A:65,F:70,a:97,f:102};function c$(t){if(t>=ao._0&&t<=ao._9)return t-ao._0;if(t>=ao.A&&t<=ao.F)return t-(ao.A-10);if(t>=ao.a&&t<=ao.f)return t-(ao.a-10)}function JW(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,a=0;i<n;i++,a+=2){const s=c$(t.charCodeAt(a)),o=c$(t.charCodeAt(a+1));if(s===void 0||o===void 0){const c=t[a]+t[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[i]=s*16+o}return r}function QCe(t){return YW(hS(t))}function Y3(t){return fS(t),YW(hS(Uint8Array.from(t).reverse()))}function XW(t,e){return JW(t.toString(16).padStart(e*2,"0"))}function M8(t,e){return XW(t,e).reverse()}function so(t,e,n){let r;if(typeof e=="string")try{r=JW(e)}catch(a){throw new Error(t+" must be hex string or Uint8Array, cause: "+a)}else if(dS(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function l$(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];fS(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const a=t[r];n.set(a,i),i+=a.length}return n}const e4=t=>typeof t=="bigint"&&uS<=t;function eEe(t,e,n){return e4(t)&&e4(e)&&e4(n)&&e<=t&&t<n}function jf(t,e,n,r){if(!eEe(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function tEe(t){let e;for(e=0;t>uS;t>>=GW,e+=1);return e}const nEe=t=>(JCe<<BigInt(t-1))-GW,rEe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||dS(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function pS(t,e,n={}){const r=(i,a,s)=>{const o=rEe[a];if(typeof o!="function")throw new Error("invalid validator function");const c=t[i];if(!(s&&c===void 0)&&!o(c,t))throw new Error("param "+String(i)+" is invali
91d. Expected "+a+", got "+c)};for(const[i,a]of Object.entries(e))r(i,a,!1);for(const[i,a]of Object.entries(n))r(i,a,!0);return t}function u$(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const a=t(n,...r);return e.set(n,a),a}}const lr=BigInt(0),Rn=BigInt(1),Bl=BigInt(2),iEe=BigInt(3),N8=BigInt(4),d$=BigInt(5),f$=BigInt(8);function Yn(t,e){const n=t%e;return n>=lr?n:e+n}function aEe(t,e,n){if(e<lr)throw new Error("invalid exponent, negatives unsupported");if(n<=lr)throw new Error("invalid modulus");if(n===Rn)return lr;let r=Rn;for(;e>lr;)e&Rn&&(r=r*t%n),t=t*t%n,e>>=Rn;return r}function cs(t,e,n){let r=t;for(;e-- >lr;)r*=r,r%=n;return r}function h$(t,e){if(t===lr)throw new Error("invert: expected non-zero number");if(e<=lr)throw new Error("invert: expected positive modulus, got "+e);let n=Yn(t,e),r=e,i=lr,a=Rn;for(;n!==lr;){const s=r/n,o=r%n,c=i-a*s;r=n,n=o,i=a,a=c}if(r!==Rn)throw new Error("invert: does not exist");return Yn(i,e)}function sEe(t){const e=(t-Rn)/Bl;let n,r,i;for(n=t-Rn,r=0;n%Bl===lr;n/=Bl,r++);for(i=Bl;i<t&&aEe(i,e,t)!==t-Rn;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const s=(t+Rn)/N8;return function(o,c){const l=o.pow(c,s);if(!o.eql(o.sqr(l),c))throw new Error("Cannot find square root");return l}}const a=(n+Rn)/Bl;return function(s,o){if(s.pow(o,e)===s.neg(s.ONE))throw new Error("Cannot find square root");let c=r,l=s.pow(s.mul(s.ONE,i),n),u=s.pow(o,a),d=s.pow(o,n);for(;!s.eql(d,s.ONE);){if(s.eql(d,s.ZERO))return s.ZERO;let f=1;for(let p=s.sqr(d);f<c&&!s.eql(p,s.ONE);f++)p=s.sqr(p);const h=s.pow(l,Rn<<BigInt(c-f-1));l=s.sqr(h),u=s.mul(u,h),d=s.mul(d,l),c=f}return u}}function oEe(t){if(t%N8===iEe){const e=(t+Rn)/N8;return function(n,r){const i=n.pow(r,e);if(!n.eql(n.sqr(i),r))throw new Error("Cannot find square root");return i}}if(t%f$===d$){const e=(t-d$)/f$;return function(n,r){const i=n.mul(r,Bl),a=n.pow(i,e),s=n.mul(r,a),o=n.mul(n.mul(s,Bl),a),c=n.mul(s,n.sub(o,n.ONE));if(!n.eql(n.sqr(c),r))throw new Error("Cannot find square root");return c}}return sEe(t)}const cEe=(t,e)=>(Yn(t,e)&Rn)===Rn,lEe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function uEe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=lEe.reduce((r,i)=>(r[i]="function",r),e);return pS(t,n)}function dEe(t,e,n){if(n<lr)throw new Error("invalid exponent, negatives unsupported");if(n===lr)return t.ONE;if(n===Rn)return e;let r=t.ONE,i=e;for(;n>lr;)n&Rn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Rn;return r}function fEe(t,e){const n=new Array(e.length),r=e.reduce((a,s,o)=>t.is0(s)?a:(n[o]=a,t.mul(a,s)),t.ONE),i=t.inv(r);return e.reduceRight((a,s,o)=>t.is0(s)?a:(n[o]=t.mul(a,n[o]),t.mul(a,s)),i),n}function QW(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function eq(t,e,n=!1,r={}){if(t<=lr)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:a}=QW(t,e);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const o=Object.freeze({ORDER:t,isLE:n,BITS:i,BYTES:a,MASK:nEe(i),ZERO:lr,ONE:Rn,create:c=>Yn(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return lr<=c&&c<t},is0:c=>c===lr,isOdd:c=>(c&Rn)===Rn,neg:c=>Yn(-c,t),eql:(c,l)=>c===l,sqr:c=>Yn(c*c,t),add:(c,l)=>Yn(c+l,t),sub:(c,l)=>Yn(c-l,t),mul:(c,l)=>Yn(c*l,t),pow:(c,l)=>dEe(o,c,l),div:(c,l)=>Yn(c*h$(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>h$(c,t),sqrt:r.sqrt||(c=>(s||(s=oEe(t)),s(o,c))),invertBatch:c=>fEe(o,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>n?M8(c,a):XW(c,a),fromBytes:c=>{if(c.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+c.length);return n?Y3(c):QCe(c)}});return Object.freeze(o)}const p$=BigInt(0),j1=BigInt(1);function t4(t,e){const n=e.negate();return t?n:e}function tq(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function n4(t,e){tq(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1);return{windows:n,windowSize:r}}function hEe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function pEe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const r4=new WeakMap,nq=new WeakMap;function i4(t){return nq.get(t)||1}function gEe(t,e){return{constTimeNegate:t4,hasPrecomputes(n){return i4(n)!==1},unsafeLadder(n,r,i=t.ZERO){let a=n;for(;r>p$;)r&j1&&(i=i.add(a)),a=a.double(),r>>=j1;return i},precomputeWindow(n,r){const{windows:i,windowSize:a}=n4(r,e),s=[];let o=n,c=o;for(let l=0;l<i;l++){c=o,s.push(c);for(let u=1;u<a;u++)c=c.add(o),s.push(c);o=c.double()}return s},wNAF(n,r,i){const{windows:a,windowSize:s}=n4(n,e);let o=t.ZERO,c=t.BASE;const l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let f=0;f<a;f++){const h=f*s;let p=Number(i&l);i>>=d,p>s&&(p-=u,i+=j1);const g=h,y=h+Math.abs(p)-1,v=f%2!==0,b=p<0;p===0?c=c.add(t4(v,r[g])):o=o.add(t4(b,r[y]))}return{p:o,f:c}},wNAFUnsafe(n,r,i,a=t.ZERO){const{windows:s,windowSize:o}=n4(n,e),c=BigInt(2**n-1),l=2**n,u=BigInt(n);for(let d=0;d<s;d++){const f=d*o;if(i===p$)break;let h=Number(i&c);if(i>>=u,h>o&&(h-=l,i+=j1),h===0)continue;let p=r[f+Math.abs(h)-1];h<0&&(p=p.negate()),a=a.add(p)}return a},getPrecomputes(n,r,i){let a=r4.get(r);
vendor: 15,000 bytes, line 91
91return a||(a=this.precomputeWindow(r,n),n!==1&&r4.set(r,i(a))),a},wNAFCached(n,r,i){const a=i4(n);return this.wNAF(a,this.getPrecomputes(a,n,i),r)},wNAFCachedUnsafe(n,r,i,a){const s=i4(n);return s===1?this.unsafeLadder(n,r,a):this.wNAFUnsafe(s,this.getPrecomputes(s,n,i),r,a)},setWindowSize(n,r){tq(r,e),nq.set(n,r),r4.delete(n)}}}function yEe(t,e,n,r){if(hEe(n,t),pEe(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,a=tEe(BigInt(n.length)),s=a>12?a-3:a>4?a-2:a?2:1,o=(1<<s)-1,c=new Array(o+1).fill(i),l=Math.floor((e.BITS-1)/s)*s;let u=i;for(let d=l;d>=0;d-=s){c.fill(i);for(let h=0;h<r.length;h++){const p=r[h],g=Number(p>>BigInt(d)&BigInt(o));c[g]=c[g].add(n[h])}let f=i;for(let h=c.length-1,p=i;h>0;h--)p=p.add(c[h]),f=f.add(p);if(u=u.add(f),d!==0)for(let h=0;h<s;h++)u=u.double()}return u}function mEe(t){return uEe(t.Fp),pS(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...QW(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const Ra=BigInt(0),gi=BigInt(1),B1=BigInt(2),vEe=BigInt(8),wEe={zip215:!0};function bEe(t){const e=mEe(t);return pS(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function _Ee(t){const e=bEe(t),{Fp:n,n:r,prehash:i,hash:a,randomBytes:s,nByteLength:o,h:c}=e,l=B1<<BigInt(o*8)-gi,u=n.create,d=eq(e.n,e.nBitLength),f=e.uvRatio||((I,A)=>{try{return{isValid:!0,value:n.sqrt(I*n.inv(A))}}catch{return{isValid:!1,value:Ra}}}),h=e.adjustScalarBytes||(I=>I),p=e.domain||((I,A,R)=>{if(Q5("phflag",R),A.length||R)throw new Error("Contexts/pre-hash are not supported");return I});function g(I,A){jf("coordinate "+I,A,Ra,l)}function y(I){if(!(I instanceof w))throw new Error("ExtendedPoint expected")}const v=u$((I,A)=>{const{ex:R,ey:N,ez:P}=I,j=I.is0();A==null&&(A=j?vEe:n.inv(P));const M=u(R*A),V=u(N*A),B=u(P*A);if(j)return{x:Ra,y:gi};if(B!==gi)throw new Error("invZ was invalid");return{x:M,y:V}}),b=u$(I=>{const{a:A,d:R}=e;if(I.is0())throw new Error("bad point: ZERO");const{ex:N,ey:P,ez:j,et:M}=I,V=u(N*N),B=u(P*P),G=u(j*j),Z=u(G*G),ie=u(V*A),oe=u(G*u(ie+B)),z=u(Z+u(R*u(V*B)));if(oe!==z)throw new Error("bad point: equation left != right (1)");const J=u(N*P),K=u(j*M);if(J!==K)throw new Error("bad point: equation left != right (2)");return!0});class w{constructor(A,R,N,P){this.ex=A,this.ey=R,this.ez=N,this.et=P,g("x",A),g("y",R),g("z",N),g("t",P),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(A){if(A instanceof w)throw new Error("extended point not allowed");const{x:R,y:N}=A||{};return g("x",R),g("y",N),new w(R,N,gi,u(R*N))}static normalizeZ(A){const R=n.invertBatch(A.map(N=>N.ez));return A.map((N,P)=>N.toAffine(R[P])).map(w.fromAffine)}static msm(A,R){return yEe(w,d,A,R)}_setWindowSize(A){C.setWindowSize(this,A)}assertValidity(){b(this)}equals(A){y(A);const{ex:R,ey:N,ez:P}=this,{ex:j,ey:M,ez:V}=A,B=u(R*V),G=u(j*P),Z=u(N*V),ie=u(M*P);return B===G&&Z===ie}is0(){return this.equals(w.ZERO)}negate(){return new w(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:A}=e,{ex:R,ey:N,ez:P}=this,j=u(R*R),M=u(N*N),V=u(B1*u(P*P)),B=u(A*j),G=R+N,Z=u(u(G*G)-j-M),ie=B+M,oe=ie-V,z=B-M,J=u(Z*oe),K=u(ie*z),ne=u(Z*z),ce=u(oe*ie);return new w(J,K,ce,ne)}add(A){y(A);const{a:R,d:N}=e,{ex:P,ey:j,ez:M,et:V}=this,{ex:B,ey:G,ez:Z,et:ie}=A;if(R===BigInt(-1)){const se=u((j-P)*(G+B)),de=u((j+P)*(G-B)),he=u(de-se);if(he===Ra)return this.double();const pe=u(M*B1*ie),ye=u(V*B1*Z),ge=ye+pe,Pe=de+se,_e=ye-pe,Ie=u(ge*he),qe=u(Pe*_e),Fe=u(ge*_e),pt=u(he*Pe);return new w(Ie,qe,pt,Fe)}const oe=u(P*B),z=u(j*G),J=u(V*N*ie),K=u(M*Z),ne=u((P+j)*(B+G)-oe-z),ce=K-J,xe=K+J,ke=u(z-R*oe),Me=u(ne*ce),$t=u(xe*ke),H=u(ne*ke),q=u(ce*xe);return new w(Me,$t,q,H)}subtract(A){return this.add(A.negate())}wNAF(A){return C.wNAFCached(this,A,w.normalizeZ)}multiply(A){const R=A;jf("scalar",R,gi,r);const{p:N,f:P}=this.wNAF(R);return w.normalizeZ([N,P])[0]}multiplyUnsafe(A,R=w.ZERO){const N=A;return jf("scalar",N,Ra,r),N===Ra?E:this.is0()||N===gi?this:C.wNAFCachedUnsafe(this,N,w.normalizeZ,R)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return C.unsafeLadder(this,r).is0()}toAffine(A){return v(this,A)}clearCofactor(){const{h:A}=e;return A===gi?this:this.multiplyUnsafe(A)}static fromHex(A,R=!1){const{d:N,a:P}=e,j=n.BYTES;A=so("pointHex",A,j),Q5("zip215",R);const M=A.slice(),V=A[j-1];M[j-1]=V&-129;const B=Y3(M),G=R?l:n.ORDER;jf("pointHex.y",B,Ra,G);const Z=u(B*B),ie=u(Z-gi),oe=u(N*Z-P);let{isValid:z,value:J}=f(ie,oe);if(!z)throw new Error("Point.fromHex: invalid y coordinate");const K=(J&gi)===gi,ne=(V&128)!==0;if(!R&&J===Ra&&ne)throw new Error("Point.fromHex: x=0 and x_0=1");return ne!==K&&(J=u(-J)),w.fromAffine({x:J,y:B})}static fromPrivateKey(A){return T(A).point}toRawBytes(){const{x:A,y:R}=this.toAffine(),N=M8(R,n.BYTES);return N[N.length-1]|=A&gi?128:0,N}toHex(){return hS(this.toRawBytes())}}w.BASE=new w(e.Gx,e.Gy,gi,u(e.Gx*e.Gy)),w.ZERO=new w(Ra,gi,gi,Ra);const{BASE:_,ZERO:E}=w,C=gEe(w,o*8);function x(I){return Yn(I,r)}function $(I){return x(Y3(I))}function T(I){const A=n.BYTES;I=so("private key",I,A);const R=so("hashed private key",a(I),2*A),N=h(R.slice(0,A)),P=R.slice(A,2*A),j=$(N),M=_.multiply(j),V=M.toRawBytes();return{head:N,prefix:P,scalar:j,point:M,pointBytes:V}}function U(I){return T(I).pointBytes}function O(I=new Uint8Array,...A){const R=l$(...A);return $(a(p(R,so("context",I),!!i)))}function F(I,A,R={}){I=so("message",I),i&&(I=i(I));const{prefix:N,scalar:P,pointBytes:j}=T(A),M=O(R.context,N,I),V=_.multiply(M).toRawBytes(),B=O(R.context,V,j,I),G=x(M+B*P);jf("signature.s",G,Ra,r);const Z=l$(V,M8(G,n.BYTES));return so("result",Z,n.BYTES*2)}const k=wEe;function S(I,A,R,N=k){const{context:P,zip215:j}=N,M=n.BYTES;I=so("signature",I,2*M),A=so("message",A),R=so("publicKey",R,M),j!==void 0&&Q5("zip215",j),i&&(A=i(A));const V=Y3(I.slice(M,2*M));let B,G,Z;try{B=w.fromHex(R,j),G=w.fromHex(I.slice(0,M),j),Z=_.multiplyUnsafe(V)}catch{return!1}if(!j&&B.isSmallOrder())return!1;const ie=O(P,G.toRawBytes(),B.toRawBytes(),A);return G.add(B.multiplyUnsafe(ie)).subtract(Z).clearCofactor().equals(w.ZERO)}return _._setWindowSize(8),{CURVE:e,getPublicKey:U,sign:F,verify:S,ExtendedPoint:w,utils:{getExtendedPublicKey:T,randomPrivateKey:()=>s(n.BYTES),precompute(I=8,A=w.BASE){return A._setWindowSize(I),A.multiply(BigInt(3)),A}}}}BigInt(0),BigInt(1);const gS=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),g$=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const CEe=BigInt(1),y$=BigInt(2);BigInt(3);const EEe=BigInt(5),SEe=BigInt(8);function AEe(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=gS,s=t*t%a*t%a,o=cs(s,y$,a)*s%a,c=cs(o,CEe,a)*t%a,l=cs(c,EEe,a)*c%a,u=cs(l,e,a)*l%a,d=cs(u,n,a)*u%a,f=cs(d,r,a)*d%a,h=cs(f,i,a)*f%a,p=cs(h,i,a)*f%a,g=cs(p,e,a)*l%a;return{pow_p_5_8:cs(g,y$,a)*t%a,b2:s}}function xEe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function IEe(t,e){const n=gS,r=Yn(e*e*e,n),i=Yn(r*r*e,n),a=AEe(t*i).pow_p_5_8;let s=Yn(t*r*a,n);const o=Yn(e*s*s,n),c=s,l=Yn(s*g$,n),u=o===t,d=o===Yn(-t,n),f=o===Yn(-t*g$,n);return u&&(s=c),(d||f)&&(s=l),cEe(s,n)&&(s=Yn(-s,n)),{isValid:u||d,value:s}}const TEe=eq(gS,void 0,!0),LEe={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:TEe,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:SEe,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:YCe,randomBytes:ZW,adjustScalarBytes:xEe,uvRatio:IEe},rq=_Ee(LEe),kEe="EdDSA",$Ee="JWT",Py=".",hv="base64url",iq="utf8",aq="utf8",PEe=":",REe="did",OEe="key",m$="base58btc",MEe="z",NEe="K36",DEe=32;function yS(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function sq(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?yS(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function oq(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const n=sq(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return yS(n)}function FEe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),s=a.charCodeAt(0);if(n[s]!==255)throw new TypeError(a+" is ambiguous");n[s]=i}var o=t.length,c=t.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var g=0,y=0,v=0,b=p.length;v!==b&&p[v]===0;)v++,g++;for(var w=(b-v)*u+1>>>0,_=new Uint8Array(w);v!==b;){for(var E=p[v],C=0,x=w-1;(E!==0||C<y)&&x!==-1;x--,C++)E+=256*_[x]>>>0,_[x]=E%o>>>0,E=E/o>>>0;if(E!==0)throw new Error("Non-zero carry");y=C,v++}for(var $=w-y;$!==w&&_[$]===0;)$++;for(var T=c.repeat(g);$<w;++$)T+=t.charAt(_[$]);return T}function f(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var g=0;if(p[g]!==" "){for(var y=0,v=0;p[g]===c;)y++,g++;for(var b=(p.length-g)*l+1>>>0,w=new Uint8Array(b);p[g];){var _=n[p.charCodeAt(g)];if(_===255)return;for(var E=0,C=b-1;(_!==0||E<v)&&C!==-1;C--,E++)_+=o*w[C]>>>0,w[C]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");v=E,g++}if(p[g]!==" "){for(var x=b-v;x!==b&&w[x]===0;)x++;for(var $=new Uint8Array(y+(b-x)),T=y;x!==b;)$[T++]=w[x++];return $}}}function h(p){var g=f(p);if(g)return g;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var UEe=FEe,jEe=UEe;const cq=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},BEe=t=>new TextEncoder().encode(t),VEe=t=>new TextDecoder().decode(t);let HEe=class{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},WEe=class{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return lq(this,e)}},qEe=class{constructor(e){this.decoders=e}or(e){return lq(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const lq=(t,e)=>new qEe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let zEe=class{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new HEe(e,n,r),this.decoder=new WEe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const pv=({name:t,prefix:e,encode:n,decode:r})=>new zEe(t,e,n,r),C0=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=jEe(n,e);return pv({prefix:t,name:e,encode:r,decode:a=>cq(i(a))})},ZEe=(t,e,n,r)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let a=t.length;for(;t[a-1]==="=";)--a;const s=new Uint8Array(a*n/8|0);let o=0,c=0,l=0;for(let u=0;u<a;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,o+=n,o>=8&&(o-=8,s[l++]=255&c>>o)}if(o>=n||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return s},KEe=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let a="",s=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],s+=8;s>n;)s-=n,a+=e[i&o>>s];if(s&&(a+=e[i&o<<n-s]),r)for(;a.length*n&7;)a+="=";return a},Er=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>pv({prefix:e,name:t,encode(i){return KEe(i,r,n)},decode(i){return ZEe(i,r,n,t)}}),GEe=pv({prefix:"\0",name:"identity",encode:t=>VEe(t),decode:t=>BEe(t)});var YEe=Object.freeze({__proto__:null,identity:GEe});const JEe=Er({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var XEe=Object.freeze({__proto__:null,base2:JEe});const QEe=Er({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var eSe=Object.freeze({__proto__:null,base8:QEe});const tSe=C0({prefix:"9",name:"base10",alphabet:"0123456789"});var nSe=Object.freeze({__proto__:null,base10:tSe});const rSe=Er({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),iSe=Er({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var aSe=Object.freeze({__proto__:null,base16:rSe,base16upper:iSe});const sSe=Er({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),oSe=Er({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),cSe=Er({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),lSe=Er({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),uSe=Er({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),dSe=Er({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),fSe=Er({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),hSe=Er({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),pSe=Er({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var gSe=Object.freeze({__proto__:null,base32:sSe,base32upper:oSe,base32pad:cSe,base32padupper:lSe,base32hex:uSe,base32hexupper:dSe,base32hexpad:fSe,base32hexpadupper:hSe,base32z:pSe});const ySe=C0({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),mSe=C0({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var vSe=Object.freeze({__proto__:null,base36:ySe,base36upper:mSe});const wSe=C0({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),bSe=C0({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var _Se=Object.freeze({__proto__:null,base58btc:wSe,base58flickr:bSe});const CSe=Er({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
91+/",bitsPerChar:6}),ESe=Er({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),SSe=Er({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ASe=Er({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var xSe=Object.freeze({__proto__:null,base64:CSe,base64pad:ESe,base64url:SSe,base64urlpad:ASe});const uq=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),ISe=uq.reduce((t,e,n)=>(t[n]=e,t),[]),TSe=uq.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function LSe(t){return t.reduce((e,n)=>(e+=ISe[n],e),"")}function kSe(t){const e=[];for(const n of t){const r=TSe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const $Se=pv({prefix:"ð",name:"base256emoji",encode:LSe,decode:kSe});var PSe=Object.freeze({__proto__:null,base256emoji:$Se}),RSe=dq,v$=128,OSe=127,MSe=~OSe,NSe=Math.pow(2,31);function dq(t,e,n){e=e||[],n=n||0;for(var r=n;t>=NSe;)e[n++]=t&255|v$,t/=128;for(;t&MSe;)e[n++]=t&255|v$,t>>>=7;return e[n]=t|0,dq.bytes=n-r+1,e}var DSe=D8,FSe=128,w$=127;function D8(t,r){var n=0,r=r||0,i=0,a=r,s,o=t.length;do{if(a>=o)throw D8.bytes=0,new RangeError("Could not decode varint");s=t[a++],n+=i<28?(s&w$)<<i:(s&w$)*Math.pow(2,i),i+=7}while(s>=FSe);return D8.bytes=a-r,n}var USe=Math.pow(2,7),jSe=Math.pow(2,14),BSe=Math.pow(2,21),VSe=Math.pow(2,28),HSe=Math.pow(2,35),WSe=Math.pow(2,42),qSe=Math.pow(2,49),zSe=Math.pow(2,56),ZSe=Math.pow(2,63),KSe=function(t){return t<USe?1:t<jSe?2:t<BSe?3:t<VSe?4:t<HSe?5:t<WSe?6:t<qSe?7:t<zSe?8:t<ZSe?9:10},GSe={encode:RSe,decode:DSe,encodingLength:KSe},fq=GSe;const b$=(t,e,n=0)=>(fq.encode(t,e,n),e),_$=t=>fq.encodingLength(t),F8=(t,e)=>{const n=e.byteLength,r=_$(t),i=r+_$(n),a=new Uint8Array(i+n);return b$(t,a,0),b$(n,a,r),a.set(e,i),new YSe(t,n,e,a)};let YSe=class{constructor(e,n,r,i){this.code=e,this.size=n,this.digest=r,this.bytes=i}};const hq=({name:t,code:e,encode:n})=>new JSe(t,e,n);let JSe=class{constructor(e,n,r){this.name=e,this.code=n,this.encode=r}digest(e){if(e instanceof Uint8Array){const n=this.encode(e);return n instanceof Uint8Array?F8(this.code,n):n.then(r=>F8(this.code,r))}else throw Error("Unknown type, must be binary type")}};const pq=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),XSe=hq({name:"sha2-256",code:18,encode:pq("SHA-256")}),QSe=hq({name:"sha2-512",code:19,encode:pq("SHA-512")});var eAe=Object.freeze({__proto__:null,sha256:XSe,sha512:QSe});const gq=0,tAe="identity",yq=cq,nAe=t=>F8(gq,yq(t)),rAe={code:gq,name:tAe,encode:yq,digest:nAe};var iAe=Object.freeze({__proto__:null,identity:rAe});new TextEncoder,new TextDecoder;const C$={...YEe,...XEe,...eSe,...nSe,...aSe,...gSe,...vSe,..._Se,...xSe,...PSe};({...eAe,...iAe});function mq(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const E$=mq("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),a4=mq("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=sq(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),vq={utf8:E$,"utf-8":E$,hex:C$.base16,latin1:a4,ascii:a4,binary:a4,...C$};
vendor: 4,276 bytes, line 91
91function gv(t,e="utf8"){const n=vq[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}function X2(t,e="utf8"){const n=vq[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?yS(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}function S$(t){return Su(gv(X2(t,hv),iq))}function Ry(t){return gv(X2(Bo(t),iq),hv)}function wq(t){const e=X2(NEe,m$),n=MEe+gv(oq([e,t]),m$);return[REe,OEe,n].join(PEe)}function aAe(t){return gv(t,hv)}function sAe(t){return X2(t,hv)}function oAe(t){return X2([Ry(t.header),Ry(t.payload)].join(Py),aq)}function cAe(t){return[Ry(t.header),Ry(t.payload),aAe(t.signature)].join(Py)}function U8(t){const e=t.split(Py),n=S$(e[0]),r=S$(e[1]),i=sAe(e[2]),a=X2(e.slice(0,2).join(Py),aq);return{header:n,payload:r,signature:i,data:a}}function A$(t=ZW(DEe)){const e=rq.getPublicKey(t);return{secretKey:oq([t,e]),publicKey:e}}async function lAe(t,e,n,r,i=Oe.fromMiliseconds(Date.now())){const a={alg:kEe,typ:$Ee},s=wq(r.publicKey),o=i+n,c={iss:s,sub:t,aud:e,iat:i,exp:o},l=oAe({header:a,payload:c}),u=rq.sign(l,r.secretKey.slice(0,32));return cAe({header:a,payload:c,signature:u})}function mS(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function bq(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?mS(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function jh(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const n=bq(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return mS(n)}function uAe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),s=a.charCodeAt(0);if(n[s]!==255)throw new TypeError(a+" is ambiguous");n[s]=i}var o=t.length,c=t.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var g=0,y=0,v=0,b=p.length;v!==b&&p[v]===0;)v++,g++;for(var w=(b-v)*u+1>>>0,_=new Uint8Array(w);v!==b;){for(var E=p[v],C=0,x=w-1;(E!==0||C<y)&&x!==-1;x--,C++)E+=256*_[x]>>>0,_[x]=E%o>>>0,E=E/o>>>0;if(E!==0)throw new Error("Non-zero carry");y=C,v++}for(var $=w-y;$!==w&&_[$]===0;)$++;for(var T=c.repeat(g);$<w;++$)T+=t.charAt(_[$]);return T}function f(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var g=0;if(p[g]!==" "){for(var y=0,v=0;p[g]===c;)y++,g++;for(var b=(p.length-g)*l+1>>>0,w=new Uint8Array(b);p[g];){var _=n[p.charCodeAt(g)];if(_===255)return;for(var E=0,C=b-1;(_!==0||E<v)&&C!==-1;C--,E++)_+=o*w[C]>>>0,w[C]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");v=E,g++}if(p[g]!==" "){for(var x=b-v;x!==b&&w[x]===0;)x++;for(var $=new Uint8Array(y+(b-x)),T=y;x!==b;)$[T++]=w[x++];return $}}}function h(p){var g=f(p);if(g)return g;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var dAe=uAe,fAe=dAe;const hAe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},pAe=t=>new TextEncoder().encode(t),gAe=t=>new TextDecoder().decode(t);class yAe{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class mAe{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
91 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return _q(this,e)}}class vAe{constructor(e){this.decoders=e}or(e){return _q(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const _q=(t,e)=>new vAe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class wAe{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new yAe(e,n,r),this.decoder=new mAe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const yv=({name:t,prefix:e,encode:n,decode:r})=>new wAe(t,e,n,r),E0=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=fAe(n,e);return yv({prefix:t,name:e,encode:r,decode:a=>hAe(i(a))})},bAe=(t,e,n,r)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let a=t.length;for(;t[a-1]==="=";)--a;const s=new Uint8Array(a*n/8|0);let o=0,c=0,l=0;for(let u=0;u<a;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,o+=n,o>=8&&(o-=8,s[l++]=255&c>>o)}if(o>=n||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return s},_Ae=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let a="",s=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],s+=8;s>n;)s-=n,a+=e[i&o>>s];if(s&&(a+=e[i&o<<n-s]),r)for(;a.length*n&7;)a+="=";return a},Sr=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>yv({prefix:e,name:t,encode(i){return _Ae(i,r,n)},decode(i){return bAe(i,r,n,t)}}),CAe=yv({prefix:"\0",name:"identity",encode:t=>gAe(t),decode:t=>pAe(t)}),EAe=Object.freeze(Object.defineProperty({__proto__:null,identity:CAe},Symbol.toStringTag,{value:"Module"})),SAe=Sr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),AAe=Object.freeze(Object.defineProperty({__proto__:null,base2:SAe},Symbol.toStringTag,{value:"Module"})),xAe=Sr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),IAe=Object.freeze(Object.defineProperty({__proto__:null,base8:xAe},Symbol.toStringTag,{value:"Module"})),TAe=E0({prefix:"9",name:"base10",alphabet:"0123456789"}),LAe=Object.freeze(Object.defineProperty({__proto__:null,base10:TAe},Symbol.toStringTag,{value:"Module"})),kAe=Sr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$Ae=Sr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),PAe=Object.freeze(Object.defineProperty({__proto__:null,base16:kAe,base16upper:$Ae},Symbol.toStringTag,{value:"Module"})),RAe=Sr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),OAe=Sr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),MAe=Sr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),NAe=Sr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),DAe=Sr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),FAe=Sr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),UAe=Sr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),jAe=Sr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),BAe=Sr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),VAe=Object.freeze(Object.defineProperty({__proto__:null,base32:RAe,base32hex:DAe,base32hexpad:UAe,base32hexpadupper:jAe,base32hexupper:FAe,base32pad:MAe,base32padupper:NAe,base32upper:OAe,base32z:BAe},Symbol.toStringTag,{value:"Module"})),HAe=E0({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),WAe=E0({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),qAe=Object.freeze(Object.defineProperty({__proto__:null,base36:HAe,base36upper:WAe},Symbol.toStringTag,{value:"Module"})),zAe=E0({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ZAe=E0({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),KAe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:zAe,base58flickr:ZAe},Symbol.toStringTag,{value:"Module"})),GAe=Sr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
91+/",bitsPerChar:6}),YAe=Sr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),JAe=Sr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),XAe=Sr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),QAe=Object.freeze(Object.defineProperty({__proto__:null,base64:GAe,base64pad:YAe,base64url:JAe,base64urlpad:XAe},Symbol.toStringTag,{value:"Module"})),Cq=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð ððµðð¤²ð¤ ð¤§ððµð ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),exe=Cq.reduce((t,e,n)=>(t[n]=e,t),[]),txe=Cq.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function nxe(t){return t.reduce((e,n)=>(e+=exe[n],e),"")}function rxe(t){const e=[];for(const n of t){const r=txe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const ixe=yv({prefix:"ð",name:"base256emoji",encode:nxe,decode:rxe}),axe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:ixe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const x$={...EAe,...AAe,...IAe,...LAe,...PAe,...VAe,...qAe,...KAe,...QAe,...axe};function Eq(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const I$=Eq("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),s4=Eq("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=bq(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),Sq={utf8:I$,"utf-8":I$,hex:x$.base16,latin1:s4,ascii:s4,binary:s4,...x$};function va(t,e="utf8"){const n=Sq[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?mS(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}function xi(t,e="utf8"){const n=Sq[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}const sxe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},oxe="Input must be an string, Buffer or Uint8Array";function cxe(t){let e;if(t instanceof Uint8Array)e=t;else if(typeof t=="string")e=new TextEncoder().encode(t);else throw new Error(oxe);return e}function lxe(t){return Array.prototype.map.call(t,function(e){return(e<16?"0":"")+e.toString(16)}).join("")}function V1(t){return(4294967296+t).toString(16).substring(1)}function uxe(t,e,n){let r=` 92`+t+" = ";for(let i=0;i<e.length;i+=2){if(n===32)r+=V1(e[i]).toUpperCase(),r+=" ",r+=V1(e[i+1]).toUpperCase();else if(n===64)r+=V1(e[i+1]).toUpperCase(),r+=V1(e[i]).toUpperCase();else throw new Error("Invalid size "+n);i%6===4?r+=` 93`+new Array(t.length+4).join(" "):i<e.length-2&&(r+=" ")}console.log(r)}function dxe(t,e,n){let r=new Date().getTime();const i=new Uint8Array(e);for(let s=0;s<e;s++)i[s]=s%256;const a=new Date().getTime();console.log("Generated random input in "+(a-r)+"ms"),r=a;for(let s=0;s<n;s++){const o=t(i),c=new Date().getTime(),l=c-r;
vendor: 37,998 bytes, line 93
93r=c,console.log("Hashed in "+l+"ms: "+o.substring(0,20)+"..."),console.log(Math.round(e/(1<<20)/(l/1e3)*100)/100+" MB PER SECOND")}}var Aq={normalizeInput:cxe,toHex:lxe,debugPrint:uxe,testSpeed:dxe};const J3=Aq;function H1(t,e,n){const r=t[e]+t[n];let i=t[e+1]+t[n+1];r>=4294967296&&i++,t[e]=r,t[e+1]=i}function T$(t,e,n,r){let i=t[e]+n;n<0&&(i+=4294967296);let a=t[e+1]+r;i>=4294967296&&a++,t[e]=i,t[e+1]=a}function xq(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function lc(t,e,n,r,i,a){const s=dh[i],o=dh[i+1],c=dh[a],l=dh[a+1];H1(gt,t,e),T$(gt,t,s,o);let u=gt[r]^gt[t],d=gt[r+1]^gt[t+1];gt[r]=d,gt[r+1]=u,H1(gt,n,r),u=gt[e]^gt[n],d=gt[e+1]^gt[n+1],gt[e]=u>>>24^d<<8,gt[e+1]=d>>>24^u<<8,H1(gt,t,e),T$(gt,t,c,l),u=gt[r]^gt[t],d=gt[r+1]^gt[t+1],gt[r]=u>>>16^d<<16,gt[r+1]=d>>>16^u<<16,H1(gt,n,r),u=gt[e]^gt[n],d=gt[e+1]^gt[n+1],gt[e]=d>>>31^u<<1,gt[e+1]=u>>>31^d<<1}const Iq=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),fxe=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],Tr=new Uint8Array(fxe.map(function(t){return t*2})),gt=new Uint32Array(32),dh=new Uint32Array(32);function Tq(t,e){let n=0;for(n=0;n<16;n++)gt[n]=t.h[n],gt[n+16]=Iq[n];for(gt[24]=gt[24]^t.t,gt[25]=gt[25]^t.t/4294967296,e&&(gt[28]=~gt[28],gt[29]=~gt[29]),n=0;n<32;n++)dh[n]=xq(t.b,4*n);for(n=0;n<12;n++)lc(0,8,16,24,Tr[n*16+0],Tr[n*16+1]),lc(2,10,18,26,Tr[n*16+2],Tr[n*16+3]),lc(4,12,20,28,Tr[n*16+4],Tr[n*16+5]),lc(6,14,22,30,Tr[n*16+6],Tr[n*16+7]),lc(0,10,20,30,Tr[n*16+8],Tr[n*16+9]),lc(2,12,22,24,Tr[n*16+10],Tr[n*16+11]),lc(4,14,16,26,Tr[n*16+12],Tr[n*16+13]),lc(6,8,18,28,Tr[n*16+14],Tr[n*16+15]);for(n=0;n<16;n++)t.h[n]=t.h[n]^gt[n]^gt[n+16]}const uc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function Lq(t,e,n,r){if(t===0||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(e&&e.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&n.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(r&&r.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};uc.fill(0),uc[0]=t,e&&(uc[1]=e.length),uc[2]=1,uc[3]=1,n&&uc.set(n,32),r&&uc.set(r,48);for(let a=0;a<16;a++)i.h[a]=Iq[a]^xq(uc,a*4);return e&&(vS(i,e),i.c=128),i}function vS(t,e){for(let n=0;n<e.length;n++)t.c===128&&(t.t+=t.c,Tq(t,!1),t.c=0),t.b[t.c++]=e[n]}function kq(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;Tq(t,!0);const e=new Uint8Array(t.outlen);for(let n=0;n<t.outlen;n++)e[n]=t.h[n>>2]>>8*(n&3);return e}function $q(t,e,n,r,i){n=n||64,t=J3.normalizeInput(t),r&&(r=J3.normalizeInput(r)),i&&(i=J3.normalizeInput(i));const a=Lq(n,e,r,i);return vS(a,t),kq(a)}function hxe(t,e,n,r,i){const a=$q(t,e,n,r,i);return J3.toHex(a)}var pxe={blake2b:$q,blake2bHex:hxe,blake2bInit:Lq,blake2bUpdate:vS,blake2bFinal:kq};const Pq=Aq;function gxe(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function dc(t,e,n,r,i,a){Ot[t]=Ot[t]+Ot[e]+i,Ot[r]=W1(Ot[r]^Ot[t],16),Ot[n]=Ot[n]+Ot[r],Ot[e]=W1(Ot[e]^Ot[n],12),Ot[t]=Ot[t]+Ot[e]+a,Ot[r]=W1(Ot[r]^Ot[t],8),Ot[n]=Ot[n]+Ot[r],Ot[e]=W1(Ot[e]^Ot[n],7)}function W1(t,e){return t>>>e^t<<32-e}const Rq=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Lr=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),Ot=new Uint32Array(16),hr=new Uint32Array(16);function Oq(t,e){let n=0;for(n=0;n<8;n++)Ot[n]=t.h[n],Ot[n+8]=Rq[n];for(Ot[12]^=t.t,Ot[13]^=t.t/4294967296,e&&(Ot[14]=~Ot[14]),n=0;n<16;n++)hr[n]=gxe(t.b,4*n);for(n=0;n<10;n++)dc(0,4,8,12,hr[Lr[n*16+0]],hr[Lr[n*16+1]]),dc(1,5,9,13,hr[Lr[n*16+2]],hr[Lr[n*16+3]]),dc(2,6,10,14,hr[Lr[n*16+4]],hr[Lr[n*16+5]]),dc(3,7,11,15,hr[Lr[n*16+6]],hr[Lr[n*16+7]]),dc(0,5,10,15,hr[Lr[n*16+8]],hr[Lr[n*16+9]]),dc(1,6,11,12,hr[Lr[n*16+10]],hr[Lr[n*16+11]]),dc(2,7,8,13,hr[Lr[n*16+12]],hr[Lr[n*16+13]]),dc(3,4,9,14,hr[Lr[n*16+14]],hr[Lr[n*16+15]]);for(n=0;n<8;n++)t.h[n]^=Ot[n]^Ot[n+8]}function Mq(t,e){if(!(t>0&&t<=32))throw new Error("Incorrect output length, should be in [1, 32]");const n=e?e.length:0;if(e&&!(n>0&&n<=32))throw new Error("Incorrect key length, should be in [1, 32]");const r={h:new Uint32Array(Rq),b:new Uint8Array(64),c:0,t:0,outlen:t};return r.h[0]^=16842752^n<<8^t,n>0&&(wS(r,e),r.c=64),r}function wS(t,e){for(let n=0;n<e.length;n++)t.c===64&&(t.t+=t.c,Oq(t,!1),t.c=0),t.b[t.c++]=e[n]}function Nq(t){for(t.t+=t.c;t.c<64;)t.b[t.c++]=0;Oq(t,!0);const e=new Uint8Array(t.outlen);for(let n=0;n<t.outlen;n++)e[n]=t.h[n>>2]>>8*(n&3)&255;return e}function Dq(t,e,n){n=n||32,t=Pq.normalizeInput(t);const r=Mq(n,e);return wS(r,t),Nq(r)}function yxe(t,e,n){const r=Dq(t,e,n);return Pq.toHex(r)}var mxe={blake2s:Dq,blake2sHex:yxe,blake2sInit:Mq,blake2sUpdate:wS,blake2sFinal:Nq};const Bf=pxe,Vf=mxe;var vxe={blake2b:Bf.blake2b,blake2bHex:Bf.blake2bHex,blake2bInit:Bf.blake2bInit,blake2bUpdate:Bf.blake2bUpdate,blake2bFinal:Bf.blake2bFinal,blake2s:Vf.blake2s,blake2sHex:Vf.blake2sHex,blake2sInit:Vf.blake2sInit,blake2sUpdate:Vf.blake2sUpdate,blake2sFinal:Vf.blake2sFinal},mv={exports:{}};function wxe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var bxe=_xe;function _xe(t,e,n){var r=n&&n.stringify||wxe,i=1;if(typeof t=="object"&&t!==null){var a=e.length+i;if(a===1)return t;var s=new Array(a);s[0]=r(t);for(var o=1;o<a;o++)s[o]=r(e[o]);return s.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var l="",u=1-i,d=-1,f=t&&t.length||0,h=0;h<f;){if(t.charCodeAt(h)===37&&h+1<f){switch(d=d>-1?d:0,t.charCodeAt(h+1)){case 100:case 102:if(u>=c||e[u]==null)break;d<h&&(l+=t.slice(d,h)),l+=Number(e[u]),d=h+2,h++;break;case 105:if(u>=c||e[u]==null)break;d<h&&(l+=t.slice(d,h)),l+=Math.floor(Number(e[u])),d=h+2,h++;break;case 79:case 111:case 106:if(u>=c||e[u]===void 0)break;d<h&&(l+=t.slice(d,h));var p=typeof e[u];if(p==="string"){l+="'"+e[u]+"'",d=h+2,h++;break}if(p==="function"){l+=e[u].name||"<anonymous>",d=h+2,h++;break}l+=r(e[u]),d=h+2,h++;break;case 115:if(u>=c)break;d<h&&(l+=t.slice(d,h)),l+=String(e[u]),d=h+2,h++;break;case 37:d<h&&(l+=t.slice(d,h)),l+="%",d=h+2,h++,u--;break}++u}++h}return d===-1?t:(d<f&&(l+=t.slice(d)),l)}const L$=bxe;mv.exports=Vo;const Op=Nxe().console||{},Cxe={mapHttpRequest:q1,mapHttpResponse:q1,wrapRequestSerializer:o4,wrapResponseSerializer:o4,wrapErrorSerializer:o4,req:q1,res:q1,err:$$,errWithCause:$$};function zc(t,e){return t==="silent"?1/0:e.levels.values[t]}const bS=Symbol("pino.logFuncs"),j8=Symbol("pino.hierarchy"),Exe={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function k$(t,e){const n={logger:e,parent:t[j8]};e[j8]=n}function Sxe(t,e,n){const r={};e.forEach(i=>{r[i]=n[i]?n[i]:Op[i]||Op[Exe[i]||"log"]||Zd}),t[bS]=r}function Axe(t,e){return Array.isArray(t)?t.filter(function(r){return r!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function Vo(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const n=t.browser.write||Op;t.browser.write&&(t.browser.asObject=!0);const r=t.serializers||{},i=Axe(t.browser.serialize,r);let a=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);const s=Object.keys(t.customLevels||{}),o=["error","fatal","warn","info","debug","trace"].concat(s);typeof n=="function"&&o.forEach(function(g){n[g]=n}),(t.enabled===!1||t.browser.disabled)&&(t.level="silent");const c=t.level||"info",l=Object.create(n);l.log||(l.log=Zd),Sxe(l,o,n),k$({},l),Object.defineProperty(l,"levelVal",{get:d}),Object.defineProperty(l,"level",{get:f,set:h});const u={transmit:e,serialize:i,asObject:t.browser.asObject,asObjectBindingsOnly:t.browser.asObjectBindingsOnly,formatters:t.browser.formatters,levels:o,timestamp:Rxe(t),messageKey:t.messageKey||"msg",onChild:t.onChild||Zd};l.levels=xxe(t),l.level=c,l.isLevelEnabled=function(g){return this.levels.values[g]?this.levels.values[g]>=this.levels.values[this.level]:!1},l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=Zd,l.serializers=r,l._serialize=i,l._stdErrSerialize=a,l.child=function(...g){return p.call(this,u,...g)},e&&(l._logEvent=B8());function d(){return zc(this.level,this)}function f(){return this._level}function h(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,xl(this,u,l,"error"),xl(this,u,l,"fatal"),xl(this,u,l,"warn"),xl(this,u,l,"info"),xl(this,u,l,"debug"),xl(this,u,l,"trace"),s.forEach(y=>{xl(this,u,l,y)})}function p(g,y,v){if(!y)throw new Error("missing bindings for child Pino");v=v||{},i&&y.serializers&&(v.serializers=y.serializers);const b=v.serializers;if(i&&b){var w=Object.assign({},r,b),_=t.browser.serialize===!0?Object.keys(w):i;delete y.serializers,_S([y],_,w,this._stdErrSerialize)}function E(x){this._childLevel=(x._childLevel|0)+1,this.bindings=y,w&&(this.serializers=w,this._serialize=_),e&&(this._logEvent=B8([].concat(x._logEvent.bindings,y)))}E.prototype=this;const C=new E(this);return k$(this,C),C.child=function(...x){return p.call(this,g,...x)},C.level=v.level||this.level,g.onChild(C),C}return l}function xxe(t){const e=t.customLevels||{},n=Object.assign({},Vo.levels.values,e),r=Object.assign({},Vo.levels.labels,Ixe(e));return{values:n,labels:r}}function Ixe(t){const e={};return Object.keys(t).forEach(function(n){e[t[n]]=n}),e}Vo.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Vo.stdSerializers=Cxe;Vo.stdTimeFunctions=Object.assign({},{nullTime:Fq,epochTime:Uq,unixTime:Oxe,isoTime:Mxe});function Txe(t){const e=[];t.bindings&&e.push(t.bindings);let n=t[j8];for(;n.parent;)n=n.parent,n.logger.bindings&&e.push(n.logger.bindings);return e.reverse()}function xl(t,e,n,r){if(Object.defineProperty(t,r,{value:zc(t.level,n)>zc(r,n)?Zd:n[bS][r],writable:!0,enumerable:!0,configurable:!0}),t[r]===Zd){if(!e.transmit)return;const a=e.transmit.level||t.level,s=zc(a,n);if(zc(r,n)<s)return}t[r]=kxe(t,e,n,r);const i=Txe(t);i.length!==0&&(t[r]=Lxe(i,t[r]))}function Lxe(t,e){return function(){return e.apply(this,[...t,...arguments])}}function kxe(t,e,n,r){return function(i){return function(){const s=e.timestamp(),o=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Op?Op:this;for(var l=0;l<o.length;l++)o[l]=arguments[l];var u=!1;if(e.serialize&&(_S(o,this._serialize,this.serializers,this._stdErrSerialize),u=!0),e.asObject||e.formatters?i.call(c,...$xe(this,r,o,s,e)):i.apply(c,o),e.transmit){const d=e.transmit.level||t._level,f=zc(d,n),h=zc(r,n);if(h<f)return;Pxe(this,{ts:s,methodLevel:r,methodValue:h,transmitLevel:d,transmitValue:n.levels.values[e.transmit.level||t._level],send:e.transmit.send,val:zc(t._level,n)},o,u)}}}(t[bS][r])}function $xe(t,e,n,r,i){const{level:a,log:s=d=>d}=i.formatters||{},o=n.slice();let c=o[0];const l={};let u=(t._childLevel|0)+1;if(u<1&&(u=1),r&&(l.time=r),a){const d=a(e,t.levels.values[e]);Object.assign(l,d)}else l.level=t.levels.values[e];if(i.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;u--&&typeof o[0]=="object";)Object.assign(l,o.shift());return[s(l),...o]}else{if(c!==null&&typeof c=="object"){for(;u--&&typeof o[0]=="object";)Object.assign(l,o.shift());c=o.length?L$(o.shift(),o):void 0}else typeof c=="string"&&(c=L$(o.shift(),o));return c!==void 0&&(l[i.messageKey]=c),[s(l)]}}function _S(t,e,n,r){for(const i in t)if(r&&t[i]instanceof Error)t[i]=Vo.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i])&&e)for(const a in t[i])e.indexOf(a)>-1&&a in n&&(t[i][a]=n[a](t[i][a]))}function Pxe(t,e,n,r=!1){const i=e.send,a=e.ts,s=e.methodLevel,o=e.methodValue,c=e.val,l=t._logEvent.bindings;r||_S(n,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=a,t._logEvent.messages=n.filter(function(u){return l.indexOf(u)===-1}),t._logEvent.level.label=s,t._logEvent.level.value=o,i(s,t._logEvent,c),t._logEvent=B8(l)}function B8(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function $$(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const n in t)e[n]===void 0&&(e[n]=t[n]);return e}function Rxe(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Fq:Uq}function q1(){return{}}function o4(t){return t}function Zd(){}function Fq(){return!1}function Uq(){return Date.now()}function Oxe(){return Math.round(Date.now()/1e3)}function Mxe(){return new Date(Date.now()).toISOString()}function Nxe(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}mv.exports.default=Vo;mv.exports.pino=Vo;var Cd=mv.exports;const jq=Zs(Cd),Dxe={level:"info"},vv="custom_context",CS=1e3*1024;var Fxe=Object.defineProperty,Uxe=(t,e,n)=>e in t?Fxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rc=(t,e,n)=>Uxe(t,typeof e!="symbol"?e+"":e,n);let jxe=class{constructor(e){Rc(this,"nodeValue"),Rc(this,"sizeInBytes"),Rc(this,"next"),this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},P$=class{constructor(e){Rc(this,"lengthInNodes"),Rc(this,"sizeInBytes"),Rc(this,"head"),Rc(this,"tail"),Rc(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const n=new jxe(e);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let n=this.head;for(;n!==null;)e.push(n.value),n=n.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const n=e.value;return e=e.next,{done:!1,value:n}}}}};var Bxe=Object.defineProperty,Vxe=(t,e,n)=>e in t?Bxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z1=(t,e,n)=>Vxe(t,typeof e!="symbol"?e+"":e,n);let Bq=class{constructor(e,n=CS){z1(this,"logs"),z1(this,"level"),z1(this,"levelValue"),z1(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=Cd.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new P$(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,n){n===Cd.levels.values.error?console.error(e):n===Cd.levels.values.warn?console.warn(e):n===Cd.levels.values.debug?console.debug(e):n===Cd.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Bo({timestamp:new Date().toISOString(),log:e}));const n=typeof e=="string"?JSON.parse(e).level:e.level;n>=this.levelValue&&this.forwardToConsole(e,n)}getLogs(){return this.logs}clearLogs(){this.logs=new P$(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const n=this.getLogArray();return n.push(Bo({extraMetadata:e})),new Blob(n,{type:"application/json"})}};var Hxe=Object.defineProperty,Wxe=(t,e,n)=>e in t?Hxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qxe=(t,e,n)=>Wxe(t,e+"",n);let zxe=class{constructor(e,n=CS){qxe(this,"baseChunkLogger"),this.baseChunkLogger=new Bq(e,n)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const n=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=n,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}};var Zxe=Object.defineProperty,Kxe=(t,e,n)=>e in t?Zxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gxe=(t,e,n)=>Kxe(t,e+"",n);let Yxe=class{constructor(e,n=CS){Gxe(this,"baseChunkLogger"),this.baseChunkLogger=new Bq(e,n)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var Jxe=Object.defineProperty,Xxe=Object.defineProperties,Qxe=Object.getOwnPropertyDescriptors,R$=Object.getOwnPropertySymbols,eIe=Object.prototype.hasOwnProperty,tIe=Object.prototype.propertyIsEnumerable,O$=(t,e,n)=>e in t?Jxe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Oy=(t,e)=>{for(var n in e||(e={}))eIe.call(e,n)&&O$(t,n,e[n]);if(R$)for(var n of R$(e))tIe.call(e,n)&&O$(t,n,e[n]);return t},My=(t,e)=>Xxe(t,Qxe(e));function nIe(t){return My(Oy({},t),{level:t?.level||Dxe.level})}function rIe(t,e,n=vv){return t[n]=e,t}function Ri(t,e=vv){return t[e]||""}function iIe(t,e,n=vv){const r=Ri(t,n);return r.trim()?`${r}/${e}`:e}function ra(t,e,n=vv){const r=iIe(t,e,n),i=t.child({context:r});return rIe(i,r,n)}function aIe(t){var e,n;const r=new zxe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:jq(My(Oy({},t.opts),{level:"trace",browser:My(Oy({},(n=t.opts)==null?void 0:n.browser),{write:i=>r.write(i)})})),chunkLoggerController:r}}function sIe(t){var e;const n=new Yxe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:jq(My(Oy({},t.opts),{level:"trace"}),n),chunkLoggerController:n}}function Vq(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?aIe(t):sIe(t)}var oIe={};const cIe=":";function Ro(t){const[e,n]=t.split(cIe);return{namespace:e,reference:n}}function M$(t,e=[]){const n=[];return Object.keys(t).forEach(r=>{if(e.length&&!e.includes(r))return;const i=t[r];n.push(...i.accounts)}),n}function Hq(t,e){return t.includes(":")?[t]:e.chains||[]}var lIe=Object.defineProperty,uIe=Object.defineProperties,dIe=Object.getOwnPropertyDescriptors,N$=Object.getOwnPropertySymbols,fIe=Object.prototype.hasOwnProperty,hIe=Object.prototype.propertyIsEnumerable,V8=(t,e,n)=>e in t?lIe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,D$=(t,e)=>{for(var n in e||(e={}))fIe.call(e,n)&&V8(t,n,e[n]);if(N$)for(var n of N$(e))hIe.call(e,n)&&V8(t,n,e[n]);return t},pIe=(t,e)=>uIe(t,dIe(e)),F$=(t,e,n)=>V8(t,typeof e!="symbol"?e+"":e,n);const gIe="ReactNative",Ji={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},yIe="js";function Ny(){return typeof ur<"u"&&typeof ur.versions<"u"&&typeof ur.versions.node<"u"}function gl(){return!Eu()&&!!aS()&&navigator.product===gIe}function mIe(){return gl()&&typeof rt<"u"&&typeof rt?.Platform<"u"&&rt?.Platform.OS==="android"}function vIe(){return gl()&&typeof rt<"u"&&typeof rt?.Platform<"u"&&rt?.Platform.OS==="ios"}function Q2(){return!Ny()&&!!aS()&&!!Eu()}function S0(){return gl()?Ji.reactNative:Ny()?Ji.node:Q2()?Ji.browser:Ji.unknown}function U$(){var t;try{return gl()&&typeof rt<"u"&&typeof rt?.Application<"u"?(t=rt.Application)==null?void 0:t.applicationId:void 0}catch{return}}function wIe(t,e){const n=new URLSearchParams(t);return Object.entries(e).sort(([r],[i])=>r.localeCompare(i)).forEach(([r,i])=>{i!=null&&n.set(r,String(i))}),n.toString()}function bIe(t){var e,n;const r=Wq();try{return t!=null&&t.url&&r.url&&new URL(t.url).host!==new URL(r.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${t.url} differs from the actual page url:${r.url}. This is probably unintended and can lead to issues.`),t.url=r.url),(e=t?.icons)!=null&&e.length&&t.icons.length>0&&(t.icons=t.icons.filter(i=>i!=="")),pIe(D$(D$({},r),t),{url:t?.url||r.url,name:t?.name||r.name,description:t?.description||r.description,icons:(n=t?.icons)!=null&&n.length&&t.icons.length>0?t.icons:r.icons})}catch(i){return console.warn("Error populating app metadata",i),t||r}}function Wq(){return TW()||{name:"",description:"",url:"",icons:[""]}}function _Ie(){if(S0()===Ji.reactNative&&typeof rt<"u"&&typeof rt?.Platform<"u"){const{OS:n,Version:r}=rt.Platform;return[n,r].join("-")}const t=Ybe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function CIe(){var t;const e=S0();return e===Ji.browser?[e,((t=IW())==null?void 0:t.host)||"unknown"].join(":"):e}function qq(t,e,n){const r=_Ie(),i=CIe();return[[t,e].join("-"),[yIe,n].join("-"),r,i].join("/")}function EIe({protocol:t,version:e,relayUrl:n,sdkVersion:r,auth:i,projectId:a,useOnCloseEvent:s,bundleId:o,packageName:c}){const l=n.split("?"),u=qq(t,e,r),d={auth:i,ua:u,projectId:a,useOnCloseEvent:s||void 0,packageName:c||void 0,bundleId:o||void 0},f=wIe(l[1]||"",d);return l[0]+"?"+f}function Jl(t,e){return t.filter(n=>e.includes(n)).length===t.length}function H8(t){return Object.fromEntries(t.entries())}function W8(t){return new Map(Object.entries(t))}function Ol(t=Oe.FIVE_MINUTES,e){const n=Oe.toMiliseconds(t||Oe.FIVE_MINUTES);let r,i,a,s;return{resolve:o=>{a&&r&&(clearTimeout(a),r(o),s=Promise.resolve(o))},reject:o=>{a&&i&&(clearTimeout(a),i(o))},done:()=>new Promise((o,c)=>{if(s)return o(s);a=setTimeout(()=>{const l=new Error(e);s=Promise.reject(l),c(l)},n),r=o,i=c})}}function $s(t,e,n){return new Promise(async(r,i)=>{const a=setTimeout(()=>i(new Error(n)),e);try{const s=await t;r(s)}catch(s){i(s)}clearTimeout(a)})}function zq(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function SIe(t){return zq("topic",t)}function AIe(t){return zq("id",t)}function Zq(t){const[e,n]=t.split(":"),r={id:void 0,topic:void 0};if(e==="topic"&&typeof n=="string")r.topic=n;else if(e==="id"&&Number.isInteger(Number(n)))r.id=Number(n);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${n}`);return r}function Un(t,e){return Oe.fromMiliseconds(Date.now()+Oe.toMiliseconds(t))}function Ss(t){return Date.now()>=Oe.toMiliseconds(t)}function Nt(t,e){return`${t}${e?`:${e}`:""}`}function Ns(t=[],e=[]){return[...new Set([...t,...e])]}async function xIe({id:t,topic:e,wcDeepLink:n}){var r;try{if(!n)return;const i=typeof n=="string"?JSON.parse(n):n,a=i?.href;if(typeof a!="string")return;const s=IIe(a,t,e),o=S0();if(o===Ji.browser){if(!((r=Eu())!=null&&r.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}TIe(s)}else o===Ji.reactNative&&typeof rt?.Linking<"u"&&await rt.Linking.openURL(s)}catch(i){console.error(i)}}function IIe(t,e,n){const r=`requestId=${e}&sessionTopic=${n}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const a=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${a}${PIe(r,!0)}`}else i=`${i}/wc?${r}`;return i}function TIe(t){let e="_self";$Ie()?e="_top":(kIe()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function LIe(t,e){let n="";try{if(Q2()&&(n=localStorage.getItem(e),n))return n;n=await t.getItem(e)}catch(r){console.error(r)}return n}function j$(t,e){if(!t.includes(e))return null;const n=t.split(/([&,?,=])/),r=n.indexOf(e);return n[r+2]}function B$(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function ES(){return typeof ur<"u"&&oIe.IS_VITEST==="true"}function kIe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function $Ie(){try{return window.self!==window.top}catch{return!1}}function PIe(t,e=!1){const n=De.from(t).toString("base64");return e?n.replace(/[=]/g,""):n}function Kq(t){return De.from(t,"base64").toString("utf-8")}function RIe(t){return new Promise(e=>setTimeout(e,t))}let OIe=class{constructor({limit:e}){F$(this,"limit"),F$(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const n=this.set.values().next().value;n&&this.set.delete(n)}this.set.add(e)}}has(e){return this.set.has(e)}};const Z1=BigInt(2**32-1),V$=BigInt(32);function Gq(t,e=!1){return e?{h:Number(t&Z1),l:Number(t>>V$&Z1)}:{h:Number(t>>V$&Z1)|0,l:Number(t&Z1)|0}}function Yq(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){const{h:s,l:o}=Gq(t[a],e);[r[a],i[a]]=[s,o]}return[r,i]}const H$=(t,e,n)=>t>>>n,W$=(t,e,n)=>t<<32-n|e>>>n,xc=(t,e,n)=>t>>>n|e<<32-n,Ic=(t,e,n)=>t<<32-n|e>>>n,fh=(t,e,n)=>t<<64-n|e>>>n-32,hh=(t,e,n)=>t>>>n-32|e<<64-n,MIe=(t,e)=>e,NIe=(t,e)=>t,DIe=(t,e,n)=>t<<n|e>>>32-n,FIe=(t,e,n)=>e<<n|t>>>32-n,UIe=(t,e,n)=>e<<n-32|t>>>64-n,jIe=(t,e,n)=>t<<n-32|e>>>64-n;function Ba(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const SS=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),AS=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,BIe=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),VIe=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,HIe=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),WIe=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,od=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function wv(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Ho(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Qa(t,...e){if(!wv(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function bv(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Ho(t.outputLen),Ho(t.blockLen)}function il(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function xS(t,e){Qa(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Mp(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Ca(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function c4(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ls(t,e){return t<<32-e|t>>>e}const Jq=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Xq(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const fo=Jq?t=>t:t=>Xq(t);function qIe(t){for(let e=0;e<t.length;e++)t[e]=Xq(t[e]);return t}const Tc=Jq?t=>t:qIe,Qq=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",zIe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Kd(t){if(Qa(t),Qq)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=zIe[t[n]];return e}const oo={_0:48,_9:57,A:65,F:70,a:97,f:102};function q$(t){if(t>=oo._0&&t<=oo._9)return t-oo._0;if(t>=oo.A&&t<=oo.F)return t-(oo.A-10);if(t>=oo.a&&t<=oo.f)return t-(oo.a-10)}function Dy(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(Qq)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,a=0;i<n;i++,a+=2){const s=q$(t.charCodeAt(a)),o=q$(t.charCodeAt(a+1));if(s===void 0||o===void 0){const c=t[a]+t[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[i]=s*16+o}return r}function ez(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Ja(t){return typeof t=="string"&&(t=ez(t)),Qa(t),t}function Oc(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Qa(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const a=t[r];n.set(a,i),i+=a.length}return n}let _v=class{};function A0(t){const e=r=>t().update(Ja(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function ZIe(t){const e=(r,i)=>t(i).update(Ja(r)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}function Du(t=32){if(od&&typeof od.getRandomValues=="function")return od.getRandomValues(new Uint8Array(t));if(od&&typeof od.randomBytes=="function")return Uint8Array.from(od.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const KIe=BigInt(0),Hf=BigInt(1),GIe=BigInt(2),YIe=BigInt(7),JIe=BigInt(256),XIe=BigInt(113),tz=[],nz=[],rz=[];for(let t=0,e=Hf,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],tz.push(2*(5*r+n)),nz.push((t+1)*(t+2)/2%64);let i=KIe;for(let a=0;a<7;a++)e=(e<<Hf^(e>>YIe)*XIe)%JIe,e&GIe&&(i^=Hf<<(Hf<<BigInt(a))-Hf);rz.push(i)}const iz=Yq(rz,!0),QIe=iz[0],eTe=iz[1],z$=(t,e,n)=>n>32?UIe(t,e,n):DIe(t,e,n),Z$=(t,e,n)=>n>32?jIe(t,e,n):FIe(t,e,n);function tTe(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let s=0;s<10;s++)n[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const o=(s+8)%10,c=(s+2)%10,l=n[c],u=n[c+1],d=z$(l,u,1)^n[o],f=Z$(l,u,1)^n[o+1];for(let h=0;h<50;h+=10)t[s+h]^=d,t[s+h+1]^=f}let i=t[2],a=t[3];for(let s=0;s<24;s++){const o=nz[s],c=z$(i,a,o),l=Z$(i,a,o),u=tz[s];i=t[u],a=t[u+1],t[u]=c,t[u+1]=l}for(let s=0;s<50;s+=10){for(let o=0;o<10;o++)n[o]=t[s+o];for(let o=0;o<10;o++)t[s+o]^=~n[(o+2)%10]&n[(o+4)%10]}t[0]^=QIe[r],t[1]^=eTe[r]}Ca(n)}let nTe=class az extends _v{constructor(e,n,r,i=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=a,Ho(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Mp(this.state)}clone(){return this._cloneInto()}keccak(){Tc(this.state32),tTe(this.state32,this.rounds),Tc(this.state32),this.posOut=0,this.pos=0}update(e){il(this),e=Ja(e),Qa(e);const{blockLen:n,state:r}=this,i=e.length;for(let a=0;a<i;){const s=Math.min(n-this.pos,i-a);for(let o=0;o<s;o++)r[this.pos++]^=e[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,n&128&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){il(this,!1),Qa(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,a=e.length;i<a;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,a-i);e.set(n.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ho(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(xS(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Ca(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:s}=this;return e||(e=new az(n,r,i,s,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}};const rTe=(t,e,n)=>A0(()=>new nTe(e,t,n)),iTe=rTe(1,136,256/8);function aTe(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),s=Number(n>>i&a),o=Number(n&a),c=r?4:0,l=r?0:4;t.setUint32(e+c,s,r),t.setUint32(e+l,o,r)}function sTe(t,e,n){return t&e^~t&n}function oTe(t,e,n){return t&e^t&n^e&n}let sz=class extends _v{constructor(e,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=c4(this.buffer)}update(e){il(this),e=Ja(e),Qa(e);const{view:n,buffer:r,blockLen:i}=this,a=e.length;for(let s=0;s<a;){const o=Math.min(i-this.pos,a-s);if(o===i){const c=c4(e);for(;i<=a-s;s+=i)this.process(c,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){il(this),xS(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:a}=this;let{pos:s}=this;n[s++]=128,Ca(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;aTe(r,i-8,BigInt(this.length*8),a),this.process(r,0);const o=c4(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)o.setUint32(4*d,u[d],a)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:a,destroyed:s,pos:o}=this;return e.destroyed=s,e.finished=a,e.length=i,e.pos=o,i%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const fc=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),kr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),$r=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),cTe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),hc=new Uint32Array(64);class lTe extends sz{constructor(e=32){super(64,e,8,!1),this.A=fc[0]|0,this.B=fc[1]|0,this.C=fc[2]|0,this.D=fc[3]|0,this.E=fc[4]|0,this.F=fc[5]|0,this.G=fc[6]|0,this.H=fc[7]|0}get(){const{A:e,B:n,C:r,D:i,E:a,F:s,G:o,H:c}=this;return[e,n,r,i,a,s,o,c]}set(e,n,r,i,a,s,o,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=a|0,this.F=s|0,this.G=o|0,this.H=c|0}process(e,n){for(let d=0;d<16;d++,n+=4)hc[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const f=hc[d-15],h=hc[d-2],p=ls(f,7)^ls(f,18)^f>>>3,g=ls(h,17)^ls(h,19)^h>>>10;hc[d]=g+hc[d-7]+p+hc[d-16]|0}let{A:r,B:i,C:a,D:s,E:o,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=ls(o,6)^ls(o,11)^ls(o,25),h=u+f+sTe(o,c,l)+cTe[d]+hc[d]|0,p=(ls(r,2)^ls(r,13)^ls(r,22))+oTe(r,i,a)|0;u=l,l=c,c=o,o=s+h|0,s=a,a=i,i=r,r=h+p|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,a,s,o,c,l,u)}roundClean(){Ca(hc)}destroy(){this.set(0,0,0,0,0,0,0,0),Ca(this.buffer)}}const oz=Yq(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
935771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),uTe=oz[0],dTe=oz[1],pc=new Uint32Array(80),gc=new Uint32Array(80);let IS=class extends sz{constructor(e=64){super(128,e,16,!1),this.Ah=$r[0]|0,this.Al=$r[1]|0,this.Bh=$r[2]|0,this.Bl=$r[3]|0,this.Ch=$r[4]|0,this.Cl=$r[5]|0,this.Dh=$r[6]|0,this.Dl=$r[7]|0,this.Eh=$r[8]|0,this.El=$r[9]|0,this.Fh=$r[10]|0,this.Fl=$r[11]|0,this.Gh=$r[12]|0,this.Gl=$r[13]|0,this.Hh=$r[14]|0,this.Hl=$r[15]|0}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:a,Cl:s,Dh:o,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:p,Hh:g,Hl:y}=this;return[e,n,r,i,a,s,o,c,l,u,d,f,h,p,g,y]}set(e,n,r,i,a,s,o,c,l,u,d,f,h,p,g,y){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=a|0,this.Cl=s|0,this.Dh=o|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=h|0,this.Gl=p|0,this.Hh=g|0,this.Hl=y|0}process(e,n){for(let w=0;w<16;w++,n+=4)pc[w]=e.getUint32(n),gc[w]=e.getUint32(n+=4);for(let w=16;w<80;w++){const _=pc[w-15]|0,E=gc[w-15]|0,C=xc(_,E,1)^xc(_,E,8)^H$(_,E,7),x=Ic(_,E,1)^Ic(_,E,8)^W$(_,E,7),$=pc[w-2]|0,T=gc[w-2]|0,U=xc($,T,19)^fh($,T,61)^H$($,T,6),O=Ic($,T,19)^hh($,T,61)^W$($,T,6),F=BIe(x,O,gc[w-7],gc[w-16]),k=VIe(F,C,U,pc[w-7],pc[w-16]);pc[w]=k|0,gc[w]=F|0}let{Ah:r,Al:i,Bh:a,Bl:s,Ch:o,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:p,Gh:g,Gl:y,Hh:v,Hl:b}=this;for(let w=0;w<80;w++){const _=xc(d,f,14)^xc(d,f,18)^fh(d,f,41),E=Ic(d,f,14)^Ic(d,f,18)^hh(d,f,41),C=d&h^~d&g,x=f&p^~f&y,$=HIe(b,E,x,dTe[w],gc[w]),T=WIe($,v,_,C,uTe[w],pc[w]),U=$|0,O=xc(r,i,28)^fh(r,i,34)^fh(r,i,39),F=Ic(r,i,28)^hh(r,i,34)^hh(r,i,39),k=r&a^r&o^a&o,S=i&s^i&c^s&c;v=g|0,b=y|0,g=h|0,y=p|0,h=d|0,p=f|0,{h:d,l:f}=Ba(l|0,u|0,T|0,U|0),l=o|0,u=c|0,o=a|0,c=s|0,a=r|0,s=i|0;const I=SS(U,F,S);r=AS(I,T,O,k),i=I|0}({h:r,l:i}=Ba(this.Ah|0,this.Al|0,r|0,i|0)),{h:a,l:s}=Ba(this.Bh|0,this.Bl|0,a|0,s|0),{h:o,l:c}=Ba(this.Ch|0,this.Cl|0,o|0,c|0),{h:l,l:u}=Ba(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=Ba(this.Eh|0,this.El|0,d|0,f|0),{h,l:p}=Ba(this.Fh|0,this.Fl|0,h|0,p|0),{h:g,l:y}=Ba(this.Gh|0,this.Gl|0,g|0,y|0),{h:v,l:b}=Ba(this.Hh|0,this.Hl|0,v|0,b|0),this.set(r,i,a,s,o,c,l,u,d,f,h,p,g,y,v,b)}roundClean(){Ca(pc,gc)}destroy(){Ca(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};class fTe extends IS{constructor(){super(48),this.Ah=kr[0]|0,this.Al=kr[1]|0,this.Bh=kr[2]|0,this.Bl=kr[3]|0,this.Ch=kr[4]|0,this.Cl=kr[5]|0,this.Dh=kr[6]|0,this.Dl=kr[7]|0,this.Eh=kr[8]|0,this.El=kr[9]|0,this.Fh=kr[10]|0,this.Fl=kr[11]|0,this.Gh=kr[12]|0,this.Gl=kr[13]|0,this.Hh=kr[14]|0,this.Hl=kr[15]|0}}const Pr=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class hTe extends IS{constructor(){super(32),this.Ah=Pr[0]|0,this.Al=Pr[1]|0,this.Bh=Pr[2]|0,this.Bl=Pr[3]|0,this.Ch=Pr[4]|0,this.Cl=Pr[5]|0,this.Dh=Pr[6]|0,this.Dl=Pr[7]|0,this.Eh=Pr[8]|0,this.El=Pr[9]|0,this.Fh=Pr[10]|0,this.Fl=Pr[11]|0,this.Gh=Pr[12]|0,this.Gl=Pr[13]|0,this.Hh=Pr[14]|0,this.Hl=Pr[15]|0}}const Cv=A0(()=>new lTe),pTe=A0(()=>new IS),gTe=A0(()=>new fTe),yTe=A0(()=>new hTe),mTe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),zn=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),je=new Uint32Array(32);function yc(t,e,n,r,i,a){const s=i[a],o=i[a+1];let c=je[2*t],l=je[2*t+1],u=je[2*e],d=je[2*e+1],f=je[2*n],h=je[2*n+1],p=je[2*r],g=je[2*r+1],y=SS(c,u,s);l=AS(y,l,d,o),c=y|0,{Dh:g,Dl:p}={Dh:g^l,Dl:p^c},{Dh:g,Dl:p}={Dh:MIe(g,p),Dl:NIe(g)},{h,l:f}=Ba(h,f,g,p),{Bh:d,Bl:u}={Bh:d^h,Bl:u^f},{Bh:d,Bl:u}={Bh:xc(d,u,24),Bl:Ic(d,u,24)}
vendor: 62,065 bytes, lines 93-96
93,je[2*t]=c,je[2*t+1]=l,je[2*e]=u,je[2*e+1]=d,je[2*n]=f,je[2*n+1]=h,je[2*r]=p,je[2*r+1]=g}function mc(t,e,n,r,i,a){const s=i[a],o=i[a+1];let c=je[2*t],l=je[2*t+1],u=je[2*e],d=je[2*e+1],f=je[2*n],h=je[2*n+1],p=je[2*r],g=je[2*r+1],y=SS(c,u,s);l=AS(y,l,d,o),c=y|0,{Dh:g,Dl:p}={Dh:g^l,Dl:p^c},{Dh:g,Dl:p}={Dh:xc(g,p,16),Dl:Ic(g,p,16)},{h,l:f}=Ba(h,f,g,p),{Bh:d,Bl:u}={Bh:d^h,Bl:u^f},{Bh:d,Bl:u}={Bh:fh(d,u,63),Bl:hh(d,u,63)},je[2*t]=c,je[2*t+1]=l,je[2*e]=u,je[2*e+1]=d,je[2*n]=f,je[2*n+1]=h,je[2*r]=p,je[2*r+1]=g}function vTe(t,e={},n,r,i){if(Ho(n),t<0||t>n)throw new Error("outputLen bigger than keyLen");const{key:a,salt:s,personalization:o}=e;if(a!==void 0&&(a.length<1||a.length>n))throw new Error("key length must be undefined or 1.."+n);if(s!==void 0&&s.length!==r)throw new Error("salt must be undefined or "+r);if(o!==void 0&&o.length!==i)throw new Error("personalization must be undefined or "+i)}class wTe extends _v{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,Ho(e),Ho(n),this.blockLen=e,this.outputLen=n,this.buffer=new Uint8Array(e),this.buffer32=Mp(this.buffer)}update(e){il(this),e=Ja(e),Qa(e);const{blockLen:n,buffer:r,buffer32:i}=this,a=e.length,s=e.byteOffset,o=e.buffer;for(let c=0;c<a;){this.pos===n&&(Tc(i),this.compress(i,0,!1),Tc(i),this.pos=0);const l=Math.min(n-this.pos,a-c),u=s+c;if(l===n&&!(u%4)&&c+l<a){const d=new Uint32Array(o,u,Math.floor((a-c)/4));Tc(d);for(let f=0;c+n<a;f+=i.length,c+=n)this.length+=n,this.compress(d,f,!1);Tc(d);continue}r.set(e.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(e){il(this),xS(e,this);const{pos:n,buffer32:r}=this;this.finished=!0,Ca(this.buffer.subarray(n)),Tc(r),this.compress(r,0,!0),Tc(r);const i=Mp(e);this.get().forEach((a,s)=>i[s]=fo(a))}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){const{buffer:n,length:r,finished:i,destroyed:a,outputLen:s,pos:o}=this;return e||(e=new this.constructor({dkLen:s})),e.set(...this.get()),e.buffer.set(n),e.destroyed=a,e.finished=i,e.length=r,e.pos=o,e.outputLen=s,e}clone(){return this._cloneInto()}}class bTe extends wTe{constructor(e={}){const n=e.dkLen===void 0?64:e.dkLen;super(128,n),this.v0l=zn[0]|0,this.v0h=zn[1]|0,this.v1l=zn[2]|0,this.v1h=zn[3]|0,this.v2l=zn[4]|0,this.v2h=zn[5]|0,this.v3l=zn[6]|0,this.v3h=zn[7]|0,this.v4l=zn[8]|0,this.v4h=zn[9]|0,this.v5l=zn[10]|0,this.v5h=zn[11]|0,this.v6l=zn[12]|0,this.v6h=zn[13]|0,this.v7l=zn[14]|0,this.v7h=zn[15]|0,vTe(n,e,64,16,16);let{key:r,personalization:i,salt:a}=e,s=0;if(r!==void 0&&(r=Ja(r),s=r.length),this.v0l^=this.outputLen|s<<8|65536|1<<24,a!==void 0){a=Ja(a);const o=Mp(a);this.v4l^=fo(o[0]),this.v4h^=fo(o[1]),this.v5l^=fo(o[2]),this.v5h^=fo(o[3])}if(i!==void 0){i=Ja(i);const o=Mp(i);this.v6l^=fo(o[0]),this.v6h^=fo(o[1]),this.v7l^=fo(o[2]),this.v7h^=fo(o[3])}if(r!==void 0){const o=new Uint8Array(this.blockLen);o.set(r),this.update(o)}}get(){let{v0l:e,v0h:n,v1l:r,v1h:i,v2l:a,v2h:s,v3l:o,v3h:c,v4l:l,v4h:u,v5l:d,v5h:f,v6l:h,v6h:p,v7l:g,v7h:y}=this;return[e,n,r,i,a,s,o,c,l,u,d,f,h,p,g,y]}set(e,n,r,i,a,s,o,c,l,u,d,f,h,p,g,y){this.v0l=e|0,this.v0h=n|0,this.v1l=r|0,this.v1h=i|0,this.v2l=a|0,this.v2h=s|0,this.v3l=o|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=d|0,this.v5h=f|0,this.v6l=h|0,this.v6h=p|0,this.v7l=g|0,this.v7h=y|0}compress(e,n,r){this.get().forEach((c,l)=>je[l]=c),je.set(zn,16);let{h:i,l:a}=Gq(BigInt(this.length));je[24]=zn[8]^a,je[25]=zn[9]^i,r&&(je[28]=~je[28],je[29]=~je[29]);let s=0;const o=mTe;for(let c=0;c<12;c++)yc(0,4,8,12,e,n+2*o[s++]),mc(0,4,8,12,e,n+2*o[s++]),yc(1,5,9,13,e,n+2*o[s++]),mc(1,5,9,13,e,n+2*o[s++]),yc(2,6,10,14,e,n+2*o[s++]),mc(2,6,10,14,e,n+2*o[s++]),yc(3,7,11,15,e,n+2*o[s++]),mc(3,7,11,15,e,n+2*o[s++]),yc(0,5,10,15,e,n+2*o[s++]),mc(0,5,10,15,e,n+2*o[s++]),yc(1,6,11,12,e,n+2*o[s++]),mc(1,6,11,12,e,n+2*o[s++]),yc(2,7,8,13,e,n+2*o[s++]),mc(2,7,8,13,e,n+2*o[s++]),yc(3,4,9,14,e,n+2*o[s++]),mc(3,4,9,14,e,n+2*o[s++]);this.v0l^=je[0]^je[16],this.v0h^=je[1]^je[17],this.v1l^=je[2]^je[18],this.v1h^=je[3]^je[19],this.v2l^=je[4]^je[20],this.v2h^=je[5]^je[21],this.v3l^=je[6]^je[22],this.v3h^=je[7]^je[23],this.v4l^=je[8]^je[24],this.v4h^=je[9]^je[25],this.v5l^=je[10]^je[26],this.v5h^=je[11]^je[27],this.v6l^=je[12]^je[28],this.v6h^=je[13]^je[29],this.v7l^=je[14]^je[30],this.v7h^=je[15]^je[31],Ca(je)}destroy(){this.destroyed=!0,Ca(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const _Te=ZIe(t=>new bTe(t)),CTe="https://rpc.walletconnect.org/v1";function cz(t){const e=`�Ethereum Signed Message: 94${t.length}`,n=new TextEncoder().encode(e+t);return"0x"+De.from(iTe(n)).toString("hex")}async function ETe(t,e,n,r,i,a){switch(n.t){case"eip191":return await STe(t,e,n.s);case"eip1271":return await ATe(t,e,n.s,r,i,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${n.t}`)}}function STe(t,e,n){const r=x_e(n);return $_e({payload:cz(e),signature:r}).toLowerCase()===t.toLowerCase()}async function ATe(t,e,n,r,i,a){const s=Ro(r);if(!s.namespace||!s.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${r}`);try{const o="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l=n.substring(2),u=(l.length/2).toString(16).padStart(64,"0"),d=(e.startsWith("0x")?e:cz(e)).substring(2),f=o+d+c+u+l,h=await fetch(`${a||CTe}/?chainId=${r}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:xTe(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:f},"latest"]})}),{result:p}=await h.json();return p?p.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function xTe(){return Date.now()+Math.floor(Math.random()*1e3)}function ITe(t){const e=atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);const r=n[0];if(r===0)throw new Error("No signatures found");const i=1+r*64;if(n.length<i)throw new Error("Transaction data too short for claimed signature count");if(n.length<100)throw new Error("Transaction too short");const a=De.from(t,"base64").slice(1,65);return _0.encode(a)}function TTe(t){const e=new Uint8Array(De.from(t,"base64")),n=Array.from("TransactionData::").map(a=>a.charCodeAt(0)),r=new Uint8Array(n.length+e.length);r.set(n),r.set(e,n.length);const i=_Te(r,{dkLen:32});return _0.encode(i)}function K$(t){const e=new Uint8Array(Cv(LTe(t)));return _0.encode(e)}function LTe(t){if(t instanceof Uint8Array)return t;if(Array.isArray(t))return new Uint8Array(t);if(typeof t=="object"&&t!=null&&t.data)return new Uint8Array(Object.values(t.data));if(typeof t=="object"&&t)return new Uint8Array(Object.values(t));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function G$(t){const e=De.from(t,"base64"),n=yCe(e).txn;if(!n)throw new Error("Invalid signed transaction: missing 'txn' field");const r=oCe(n),i=De.from("TX"),a=De.concat([i,De.from(r)]),s=yTe(a);return cre.encode(s).replace(/=+$/,"")}function l4(t){const e=[];let n=BigInt(t);for(;n>=BigInt(128);)e.push(Number(n&BigInt(127)|BigInt(128))),n>>=BigInt(7);return e.push(Number(n)),De.from(e)}function kTe(t){const e=De.from(t.signed.bodyBytes,"base64"),n=De.from(t.signed.authInfoBytes,"base64"),r=De.from(t.signature.signature,"base64"),i=[];i.push(De.from([10])),i.push(l4(e.length)),i.push(e),i.push(De.from([18])),i.push(l4(n.length)),i.push(n),i.push(De.from([26])),i.push(l4(r.length)),i.push(r);const a=De.concat(i),s=Cv(a);return De.from(s).toString("hex").toUpperCase()}function $Te(t){var e,n;const r=[];try{if(typeof t=="string")return r.push(t),r;if(typeof t!="object")return r;t!=null&&t.id&&r.push(t.id);const i=(n=(e=t?.capabilities)==null?void 0:e.caip345)==null?void 0:n.transactionHashes;i&&r.push(...i)}catch(i){console.warn("getWalletSendCallsHashes failed: ",i)}return r}var PTe=Object.defineProperty,RTe=Object.defineProperties,OTe=Object.getOwnPropertyDescriptors,Y$=Object.getOwnPropertySymbols,MTe=Object.prototype.hasOwnProperty,NTe=Object.prototype.propertyIsEnumerable,J$=(t,e,n)=>e in t?PTe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,DTe=(t,e)=>{for(var n in e||(e={}))MTe.call(e,n)&&J$(t,n,e[n]);if(Y$)for(var n of Y$(e))NTe.call(e,n)&&J$(t,n,e[n]);return t},FTe=(t,e)=>RTe(t,OTe(e));const UTe="did:pkh:",TS=t=>t?.split(":"),jTe=t=>{const e=t&&TS(t);if(e)return t.includes(UTe)?e[3]:e[1]},q8=t=>{const e=t&&TS(t);if(e)return e[2]+":"+e[3]},Fy=t=>{const e=t&&TS(t);if(e)return e.pop()};async function X$(t){const{cacao:e,projectId:n}=t,{s:r,p:i}=e,a=lz(i,i.iss),s=Fy(i.iss);return await ETe(s,a,r,q8(i.iss),n)}const lz=(t,e)=>{const n=`${t.domain} wants you to sign in with your Ethereum account:`,r=Fy(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const a=`URI: ${t.aud||t.uri}`,s=`Version: ${t.version}`,o=`Chain ID: ${jTe(e)}`,c=`Nonce: ${t.nonce}`,l=`Issued At: ${t.iat}`,u=t.exp?`Expiration Time: ${t.exp}`:void 0,d=t.nbf?`Not Before: ${t.nbf}`:void 0,f=t.requestId?`Request ID: ${t.requestId}`:void 0,h=t.resources?`Resources:${t.resources.map(g=>` 95- ${g}`).join("")}`:void 0,p=X3(t.resources);if(p){const g=Np(p);i=GTe(i,g)}return[n,r,"",i,"",a,s,o,c,l,u,d,f,h].filter(g=>g!=null).join(` 96`)};function BTe(t){return De.from(JSON.stringify(t)).toString("base64")}function VTe(t){return JSON.parse(De.from(t,"base64").toString("utf-8"))}function Au(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(n=>{const r=t.att[n];if(Array.isArray(r))throw new Error(`Resource must be an object: ${n}`);if(typeof r!="object")throw new Error(`Resource must be an object: ${n}`);if(!Object.keys(r).length)throw new Error(`Resource object is empty: ${n}`);Object.keys(r).forEach(i=>{const a=r[i];if(!Array.isArray(a))throw new Error(`Ability limits ${i} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);a.forEach(s=>{if(typeof s!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${s}`)})})})}function HTe(t,e,n,r={}){return n?.sort((i,a)=>i.localeCompare(a)),{att:{[t]:WTe(e,n,r)}}}function WTe(t,e,n={}){e=e?.sort((i,a)=>i.localeCompare(a));const r=e.map(i=>({[`${t}/${i}`]:[n]}));return Object.assign({},...r)}function uz(t){return Au(t),`urn:recap:${BTe(t).replace(/=/g,"")}`}function Np(t){const e=VTe(t.replace("urn:recap:",""));return Au(e),e}function qTe(t,e,n){const r=HTe(t,e,n);return uz(r)}function zTe(t){return t&&t.includes("urn:recap:")}function ZTe(t,e){const n=Np(t),r=Np(e),i=KTe(n,r);return uz(i)}function KTe(t,e){Au(t),Au(e);const n=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,a)=>i.localeCompare(a)),r={att:{}};return n.forEach(i=>{var a,s;Object.keys(((a=t.att)==null?void 0:a[i])||{}).concat(Object.keys(((s=e.att)==null?void 0:s[i])||{})).sort((o,c)=>o.localeCompare(c)).forEach(o=>{var c,l;r.att[i]=FTe(DTe({},r.att[i]),{[o]:((c=t.att[i])==null?void 0:c[o])||((l=e.att[i])==null?void 0:l[o])})})}),r}function GTe(t="",e){Au(e);const n="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(n))return t;const r=[];let i=0;Object.keys(e.att).forEach(o=>{const c=Object.keys(e.att[o]).map(d=>({ability:d.split("/")[0],action:d.split("/")[1]}));c.sort((d,f)=>d.action.localeCompare(f.action));const l={};c.forEach(d=>{l[d.ability]||(l[d.ability]=[]),l[d.ability].push(d.action)});const u=Object.keys(l).map(d=>(i++,`(${i}) '${d}': '${l[d].join("', '")}' for '${o}'.`));r.push(u.join(", ").replace(".,","."))});const a=r.join(" "),s=`${n}${a}`;return`${t?t+" ":""}${s}`}function Q$(t){var e;const n=Np(t);Au(n);const r=(e=n.att)==null?void 0:e.eip155;return r?Object.keys(r).map(i=>i.split("/")[1]):[]}function eP(t){const e=Np(t);Au(e);const n=[];return Object.values(e.att).forEach(r=>{Object.values(r).forEach(i=>{var a;(a=i?.[0])!=null&&a.chains&&n.push(i[0].chains)})}),[...new Set(n.flat())]}function X3(t){if(!t)return;const e=t?.[t.length-1];return zTe(e)?e:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function dz(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function z8(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function u4(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function _i(t,...e){if(!dz(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function tP(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function YTe(t,e){_i(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Jc(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function _2(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function JTe(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const XTe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function QTe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Z8(t){if(typeof t=="string")t=QTe(t);else if(dz(t))t=K8(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function eLe(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function tLe(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return n===0}const nLe=(t,e)=>{function n(r,...i){if(_i(r),!XTe)throw new Error("Non little-endian hardware is not yet supported");if(t.nonceLength!==void 0){const l=i[0];if(!l)throw new Error("nonce / iv required");t.varSizeNonce?_i(l):_i(l,t.nonceLength)}const a=t.tagLength;a&&i[1]!==void 0&&_i(i[1]);const s=e(r,...i),o=(l,u)=>{if(u!==void 0){if(l!==2)throw new Error("cipher output not supported");_i(u)}};let c=!1;return{encrypt(l,u){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,_i(l),o(s.encrypt.length,u),s.encrypt(l,u)},decrypt(l,u){if(_i(l),a&&l.length<a)throw new Error("invalid ciphertext length: smaller than tagLength="+a);return o(s.decrypt.length,u),s.decrypt(l,u)}}}return Object.assign(n,t),n};function nP(t,e,n=!0){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(n&&!iLe(e))throw new Error("invalid output, must be aligned");return e}function rP(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),s=Number(n>>i&a),o=Number(n&a);t.setUint32(e+4,s,r),t.setUint32(e+0,o,r)}function rLe(t,e,n){z8(n);const r=new Uint8Array(16),i=JTe(r);return rP(i,0,BigInt(e),n),rP(i,8,BigInt(t),n),r}function iLe(t){return t.byteOffset%4===0}function K8(t){return Uint8Array.from(t)}const fz=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),aLe=fz("expand 16-byte k"),sLe=fz("expand 32-byte k"),oLe=Jc(aLe),cLe=Jc(sLe);function Pt(t,e){return t<<e|t>>>32-e}function G8(t){return t.byteOffset%4===0}const K1=64,lLe=16,hz=2**32-1,iP=new Uint32Array;function uLe(t,e,n,r,i,a,s,o){const c=i.length,l=new Uint8Array(K1),u=Jc(l),d=G8(i)&&G8(a),f=d?Jc(i):iP,h=d?Jc(a):iP;for(let p=0;p<c;s++){if(t(e,n,r,u,s,o),s>=hz)throw new Error("arx: counter overflow");const g=Math.min(K1,c-p);if(d&&g===K1){const y=p/4;if(p%4!==0)throw new Error("arx: invalid block position");for(let v=0,b;v<lLe;v++)b=y+v,h[b]=f[b]^u[v];p+=K1;continue}for(let y=0,v;y<g;y++)v=p+y,a[v]=i[v]^l[y];p+=g}}function dLe(t,e){const{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:a,rounds:s}=eLe({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return u4(i),u4(s),z8(a),z8(n),(o,c,l,u,d=0)=>{_i(o),_i(c),_i(l);const f=l.length;if(u===void 0&&(u=new Uint8Array(f)),_i(u),u4(d),d<0||d>=hz)throw new Error("arx: counter overflow");if(u.length<f)throw new Error(`arx: output (${u.length}) is shorter than data (${f})`);const h=[];let p=o.length,g,y;if(p===32)h.push(g=K8(o)),y=cLe;else if(p===16&&n)g=new Uint8Array(32),g.set(o),g.set(o,16),y=oLe,h.push(g);else throw new Error(`arx: invalid 32-byte key, got length=${p}`);G8(c)||h.push(c=K8(c));const v=Jc(g);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");r(y,v,Jc(c.subarray(0,16)),v),c=c.subarray(16)}const b=16-i;if(b!==c.length)throw new Error(`arx: nonce must be ${b} or 16 bytes`);if(b!==12){const _=new Uint8Array(12);_.set(c,a?0:12-c.length),c=_,h.push(c)}const w=Jc(c);return uLe(t,y,v,w,l,u,d,s),_2(...h),u}}const pr=(t,e)=>t[e++]&255|(t[e++]&255)<<8;class fLe{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Z8(e),_i(e,32);const n=pr(e,0),r=pr(e,2),i=pr(e,4),a=pr(e,6),s=pr(e,8),o=pr(e,10),c=pr(e,12),l=pr(e,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|i<<6)&7939,this.r[3]=(i>>>7|a<<9)&8191,this.r[4]=(a>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|o<<2)&8191,this.r[7]=(o>>>11|c<<5)&8065,this.r[8]=(c>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=pr(e,16+2*u)}process(e,n,r=!1){const i=r?0:2048,{h:a,r:s}=this,o=s[0],c=s[1],l=s[2],u=s[3],d=s[4],f=s[5],h=s[6],p=s[7],g=s[8],y=s[9],v=pr(e,n+0),b=pr(e,n+2),w=pr(e,n+4),_=pr(e,n+6),E=pr(e,n+8),C=pr(e,n+10),x=pr(e,n+12),$=pr(e,n+14);let T=a[0]+(v&8191),U=a[1]+((v>>>13|b<<3)&8191),O=a[2]+((b>>>10|w<<6)&8191),F=a[3]+((w>>>7|_<<9)&8191),k=a[4]+((_>>>4|E<<12)&8191),S=a[5]+(E>>>1&8191),I=a[6]+((E>>>14|C<<2)&8191),A=a[7]+((C>>>11|x<<5)&8191),R=a[8]+((x>>>8|$<<8)&8191),N=a[9]+($>>>5|i),P=0,j=P+T*o+U*(5*y)+O*(5*g)+F*(5*p)+k*(5*h);P=j>>>13,j&=8191,j+=S*(5*f)+I*(5*d)+A*(5*u)+R*(5*l)+N*(5*c),P+=j>>>13,j&=8191;let M=P+T*c+U*o+O*(5*y)+F*(5*g)+k*(5*p);P=M>>>13,M&=8191,M+=S*(5*h)+I*(5*f)+A*(5*d)+R*(5*u)+N*(5*l),P+=M>>>13,M&=8191;let V=P+T*l+U*c+O*o+F*(5*y)+k*(5*g);P=V>>>13,V&=8191,V+=S*(5*p)+I*(5*h)+A*(5*f)+R*(5*d)+N*(5*u),P+=V>>>13,V&=8191;let B=P+T*u+U*l+O*c+F*o+k*(5*y);P=B>>>13,B&=8191,B+=S*(5*g)+I*(5*p)+A*(5*h)+R*(5*f)+N*(5*d),P+=B>>>13,B&=8191;let G=P+T*d+U*u+O*l+F*c+k*o;P=G>>>13,G&=8191,G+=S*(5*y)+I*(5*g)+A*(5*p)+R*(5*h)+N*(5*f),P+=G>>>13,G&=8191;let Z=P+T*f+U*d+O*u+F*l+k*c;P=Z>>>13,Z&=8191,Z+=S*o+I*(5*y)+A*(5*g)+R*(5*p)+N*(5*h),P+=Z>>>13,Z&=8191;let ie=P+T*h+U*f+O*d+F*u+k*l;P=ie>>>13,ie&=8191,ie+=S*c+I*o+A*(5*y)+R*(5*g)+N*(5*p),P+=ie>>>13,ie&=8191;let oe=P+T*p+U*h+O*f+F*d+k*u;P=oe>>>13,oe&=8191,oe+=S*l+I*c+A*o+R*(5*y)+N*(5*g),P+=oe>>>13,oe&=8191;let z=P+T*g+U*p+O*h+F*f+k*d;P=z>>>13,z&=8191,z+=S*u+I*l+A*c+R*o+N*(5*y),P+=z>>>13,z&=8191;let J=P+T*y+U*g+O*p+F*h+k*f;P=J>>>13,J&=8191,J+=S*d+I*u+A*l+R*c+N*o,P+=J>>>13,J&=8191,P=(P<<2)+P|0,P=P+j|0,j=P&8191,P=P>>>13,M+=P,a[0]=j,a[1]=M,a[2]=V,a[3]=B,a[4]=G,a[5]=Z,a[6]=ie,a[7]=oe,a[8]=z,a[9]=J}finalize(){const{h:e,pad:n}=this,r=new Uint16Array(10);let i=e[1]>>>13;e[1]&=8191;for(let o=2;o<10;o++)e[o]+=i,i=e[o]>>>13,e[o]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,r[0]=e[0]+5,i=r[0]>>>13,r[0]&=8191;for(let o=1;o<10;o++)r[o]=e[o]+i,i=r[o]>>>13,r[o]&=8191;r[9]-=8192;let a=(i^1)-1;for(let o=0;o<10;o++)r[o]&=a;a=~a;for(let o=0;o<10;o++)e[o]=e[o]&a|r[o];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let s=e[0]+n[0];e[0]=s&65535;for(let o=1;o<8;o++)s=(e[o]+n[o]|0)+(s>>>16)|0,e[o]=s&65535;_2(r)}update(e){tP(this),e=Z8(e),_i(e);const{buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){const s=Math.min(r-this.pos,i-a);if(s===r){for(;r<=i-a;a+=r)this.process(e,a);continue}n.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===r&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){_2(this.h,this.r,this.buffer,this.pad)}digestInto(e){tP(this),YTe(e,this),this.finished=!0;const{buffer:n,h:r}=this;let{pos:i}=this;if(i){for(n[i++]=1;i<16;i++)n[i]=0;this.process(n,0,!0)}this.finalize();let a=0;for(let s=0;s<8;s++)e[a++]=r[s]>>>0,e[a++]=r[s]>>>8;return e}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}}function hLe(t){const e=(r,i)=>t(i).update(Z8(r)).digest(),n=t(new Uint8Array(32));return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=r=>t(r),e}const pLe=hLe(t=>new fLe(t));function gLe(t,e,n,r,i,a=20){let s=t[0],o=t[1],c=t[2],l=t[3],u=e[0],d=e[1],f=e[2],h=e[3],p=e[4],g=e[5],y=e[6],v=e[7],b=i,w=n[0],_=n[1],E=n[2],C=s,x=o,$=c,T=l,U=u,O=d,F=f,k=h,S=p,I=g,A=y,R=v,N=b,P=w,j=_,M=E;for(let B=0;B<a;B+=2)C=C+U|0,N=Pt(N^C,16),S=S+N|0,U=Pt(U^S,12),C=C+U|0,N=Pt(N^C,8),S=S+N|0,U=Pt(U^S,7),x=x+O|0,P=Pt(P^x,16),I=I+P|0,O=Pt(O^I,12),x=x+O|0,P=Pt(P^x,8),I=I+P|0,O=Pt(O^I,7),$=$+F|0,j=Pt(j^$,16),A=A+j|0,F=Pt(F^A,12),$=$+F|0,j=Pt(j^$,8),A=A+j|0,F=Pt(F^A,7),T=T+k|0,M=Pt(M^T,16),R=R+M|0,k=Pt(k^R,12),T=T+k|0,M=Pt(M^T,8),R=R+M|0,k=Pt(k^R,7),C=C+O|0,M=Pt(M^C,16),A=A+M|0,O=Pt(O^A,12),C=C+O|0,M=Pt(M^C,8),A=A+M|0,O=Pt(O^A,7),x=x+F|0,N=Pt(N^x,16),R=R+N|0,F=Pt(F^R,12),x=x+F|0,N=Pt(N^x,8),R=R+N|0,F=Pt(F^R,7),$=$+k|0,P=Pt(P^$,16),S=S+P|0,k=Pt(k^S,12),$=$+k|0,P=Pt(P^$,8),S=S+P|0,k=Pt(k^S,7),T=T+U|0,j=Pt(j^T,16),I=I+j|0,U=Pt(U^I,12),T=T+U|0,j=Pt(j^T,8),I=I+j|0,U=Pt(U^I,7);let V=0;r[V++]=s+C|0,r[V++]=o+x|0,r[V++]=c+$|0,r[V++]=l+T|0,r[V++]=u+U|0,r[V++]=d+O|0,r[V++]=f+F|0,r[V++]=h+k|0,r[V++]=p+S|0,r[V++]=g+I|0,r[V++]=y+A|0,r[V++]=v+R|0,r[V++]=b+N|0,r[V++]=w+P|0,r[V++]=_+j|0,r[V++]=E+M|0}const yLe=dLe(gLe,{counterRight:!1,counterLength:4,allowShortKeys:!1}),mLe=new Uint8Array(16),aP=(t,e)=>{t.update(e);const n=e.length%16;n&&t.update(mLe.subarray(n))},vLe=new Uint8Array(32);function sP(t,e,n,r,i){const a=t(e,n,vLe),s=pLe.create(a);i&&aP(s,i),aP(s,r);const o=rLe(r.length,i?i.length:0,!0);s.update(o);const c=s.digest();return _2(a,o),c}const wLe=t=>(e,n,r)=>({encrypt(i,a){const s=i.length;a=nP(s+16,a,!1),a.set(i);const o=a.subarray(0,-16);t(e,n,o,o,1);const c=sP(t,e,n,o,r);return a.set(c,s),_2(c),a},decrypt(i,a){a=nP(i.length-16,a,!1);const s=i.subarray(0,-16),o=i.subarray(-16),c=sP(t,e,n,s,r);if(!tLe(o,c))throw new Error("invalid tag");return a.set(i.subarray(0,-16)),t(e,n,a,a,1),_2(c),a}}),pz=nLe({blockSize:64,nonceLength:12,tagLength:16},wLe(yLe));let gz=class extends _v{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,bv(e);const r=Ja(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let s=0;s<a.length;s++)a[s]^=54;this.iHash.update(a),this.oHash=e.create();for(let s=0;s<a.length;s++)a[s]^=106;this.oHash.update(a),Ca(a)}update(e){return il(this),this.iHash.update(e),this}digestInto(e){il(this),Qa(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:a,blockLen:s,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=a,e.blockLen=s,e.outputLen=o,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const Ev=(t,e,n)=>new gz(t,e).update(n).digest();Ev.create=(t,e)=>new gz(t,e);function bLe(t,e,n){return bv(t),n===void 0&&(n=new Uint8Array(t.outputLen)),Ev(t,Ja(n),Ja(e))}const d4=Uint8Array.from([0]),oP=Uint8Array.of();function _Le(t,e,n,r=32){bv(t),Ho(r);const i=t.outputLen;if(r>255*i)throw new Error("Length should be <= 255*HashLen");const a=Math.ceil(r/i);n===void 0&&(n=oP);const s=new Uint8Array(a*i),o=Ev.create(t,e),c=o._cloneInto(),l=new Uint8Array(o.outputLen);for(let u=0;u<a;u++)d4[0]=u+1,c.update(u===0?oP:l).update(n).update(d4).digestInto(l),s.set(l,i*u),o._cloneInto(c);return o.destroy(),c.destroy(),Ca(l,d4),s.slice(0,r)}const CLe=(t,e,n,r,i)=>_Le(t,bLe(t,e,n),r,i),Sv=Cv,LS=BigInt(0),Y8=BigInt(1);function Uy(t,e=""){if(typeof t!="boolean"){const n=e&&`"${e}"`;throw new Error(n+"expected boolean, got type="+typeof t)}return t}function Xl(t,e,n=""){const r=wv(t),i=t?.length,a=e!==void 0;if(!r||a&&i!==e){const s=n&&`"${n}" `,o=a?` of length ${e}`:"",c=r?`length=${i}`:`type=${typeof t}`;throw new Error(s+"expected Uint8Array"+o+", got "+c)}return t}function G1(t){const e=t.toString(16);return e.length&1?"0"+e:e}function yz(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?LS:BigInt("0x"+t)}function Av(t){return yz(Kd(t))}function jy(t){return Qa(t),yz(Kd(Uint8Array.from(t).reverse()))}function kS(t,e){return Dy(t.toString(16).padStart(e*2,"0"))}function $S(t,e){return kS(t,e).reverse()}function Dr(t,e,n){let r;if(typeof e=="string")try{r=Dy(e)}catch(a){throw new Error(t+" must be hex string or Uint8Array, cause: "+a)}else if(wv(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}const f4=t=>typeof t=="bigint"&&LS<=t;function ELe(t,e,n){return f4(t)&&f4(e)&&f4(n)&&e<=t&&t<n}function J8(t,e,n,r){if(!ELe(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function mz(t){let e;for(e=0;t>LS;t>>=Y8,e+=1);return e}const x0=t=>(Y8<<BigInt(t))-Y8;function SLe(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=f=>new Uint8Array(f),i=f=>Uint8Array.of(f);let a=r(t),s=r(t),o=0;const c=()=>{a.fill(1),s.fill(0),o=0},l=(...f)=>n(s,a,...f),u=(f=r(0))=>{s=l(i(0),f),a=l(),f.length!==0&&(s=l(i(1),f),a=l())},d=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f<e;){a=l();const p=a.slice();h.push(p),f+=a.length}return Oc(...h)};return(f,h)=>{c(),u(f);let p;for(;!(p=h(d()));)u();return c(),p}}function xv(t,e,n={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function r(i,a,s){const o=t[i];if(s&&o===void 0)return;const c=typeof o;if(c!==a||o===null)throw new Error(`param "${i}" is invalid: expected ${a}, got ${c}`)}Object.entries(e).forEach(([i,a])=>r(i,a,!1)),Object.entries(n).forEach(([i,a])=>r(i,a,!0))}function cP(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const a=t(n,...r);return e.set(n,a),a}}const Ai=BigInt(0),ri=BigInt(1),Ql=BigInt(2),vz=BigInt(3),wz=BigInt(4),bz=BigInt(5),ALe=BigInt(7),_z=BigInt(8),xLe=BigInt(9),Cz=BigInt(16);function Zi(t,e){const n=t%e;return n>=Ai?n:e+n}function Fa(t,e,n){let r=t;for(;e-- >Ai;)r*=r,r%=n;return r}function lP(t,e){if(t===Ai)throw new Error("invert: expected non-zero number");if(e<=Ai)throw new Error("invert: expected positive modulus, got "+e);let n=Zi(t,e),r=e,i=Ai,a=ri;for(;n!==Ai;){const s=r/n,o=r%n,c=i-a*s;r=n,n=o,i=a,a=c}if(r!==ri)throw new Error("invert: does not exist");return Zi(i,e)}function PS(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function Ez(t,e){const n=(t.ORDER+ri)/wz,r=t.pow(e,n);return PS(t,r,e),r}function ILe(t,e){const n=(t.ORDER-bz)/_z,r=t.mul(e,Ql),i=t.pow(r,n),a=t.mul(e,i),s=t.mul(t.mul(a,Ql),i),o=t.mul(a,t.sub(s,t.ONE));return PS(t,o,e),o}function TLe(t){const e=yl(t),n=Sz(t),r=n(e,e.neg(e.ONE)),i=n(e,r),a=n(e,e.neg(r)),s=(t+ALe)/Cz;return(o,c)=>{let l=o.pow(c,s),u=o.mul(l,r);const d=o.mul(l,i),f=o.mul(l,a),h=o.eql(o.sqr(u),c),p=o.eql(o.sqr(d),c);l=o.cmov(l,u,h),u=o.cmov(f,d,p);const g=o.eql(o.sqr(u),c),y=o.cmov(l,u,g);return PS(o,y,c),y}}function Sz(t){if(t<vz)throw new Error("sqrt is not defined for small field");let e=t-ri,n=0;for(;e%Ql===Ai;)e/=Ql,n++;let r=Ql;const i=yl(t);for(;uP(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Ez;let a=i.pow(r,e);const s=(e+ri)/Ql;return function(o,c){if(o.is0(c))return c;if(uP(o,c)!==1)throw new Error("Cannot find square root");let l=n,u=o.mul(o.ONE,a),d=o.pow(c,e),f=o.pow(c,s);for(;!o.eql(d,o.ONE);){if(o.is0(d))return o.ZERO;let h=1,p=o.sqr(d);for(;!o.eql(p,o.ONE);)if(h++,p=o.sqr(p),h===l)throw new Error("Cannot find square root");const g=ri<<BigInt(l-h-1),y=o.pow(u,g);l=h,u=o.sqr(y),d=o.mul(d,u),f=o.mul(f,y)}return f}}function LLe(t){return t%wz===vz?Ez:t%_z===bz?ILe:t%Cz===xLe?TLe(t):Sz(t)}const kLe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function $Le(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=kLe.reduce((r,i)=>(r[i]="function",r),e);return xv(t,n),t}function PLe(t,e,n){if(n<Ai)throw new Error("invalid exponent, negatives unsupported");if(n===Ai)return t.ONE;if(n===ri)return e;let r=t.ONE,i=e;for(;n>Ai;)n&ri&&(r=t.mul(r,i)),i=t.sqr(i),n>>=ri;return r}function Az(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((s,o,c)=>t.is0(o)?s:(r[c]=s,t.mul(s,o)),t.ONE),a=t.inv(i);return e.reduceRight((s,o,c)=>t.is0(o)?s:(r[c]=t.mul(s,r[c]),t.mul(s,o)),a),r}function uP(t,e){const n=(t.ORDER-ri)/Ql,r=t.pow(e,n),i=t.eql(r,t.ONE),a=t.eql(r,t.ZERO),s=t.eql(r,t.neg(t.ONE));if(!i&&!a&&!s)throw new Error("invalid Legendre symbol result");return i?1:a?0:-1}function xz(t,e){e!==void 0&&Ho(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function yl(t,e,n=!1,r={}){if(t<=Ai)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,a,s=!1,o;if(typeof e=="object"&&e!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const f=e;f.BITS&&(i=f.BITS),f.sqrt&&(a=f.sqrt),typeof f.isLE=="boolean"&&(n=f.isLE),typeof f.modFromBytes=="boolean"&&(s=f.modFromBytes),o=f.allowedLengths}else typeof e=="number"&&(i=e),r.sqrt&&(a=r.sqrt);const{nBitLength:c,nByteLength:l}=xz(t,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:t,isLE:n,BITS:c,BYTES:l,MASK:x0(c),ZERO:Ai,ONE:ri,allowedLengths:o,create:f=>Zi(f,t),isValid:f=>{if(typeof f!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof f);return Ai<=f&&f<t},is0:f=>f===Ai,isValidNot0:f=>!d.is0(f)&&d.isValid(f),isOdd:f=>(f&ri)===ri,neg:f=>Zi(-f,t),eql:(f,h)=>f===h,sqr:f=>Zi(f*f,t),add:(f,h)=>Zi(f+h,t),sub:(f,h)=>Zi(f-h,t),mul:(f,h)=>Zi(f*h,t),pow:(f,h)=>PLe(d,f,h),div:(f,h)=>Zi(f*lP(h,t),t),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>lP(f,t),sqrt:a||(f=>(u||(u=LLe(t)),u(d,f))),toBytes:f=>n?$S(f,l):kS(f,l),fromBytes:(f,h=!0)=>{if(o){if(!o.includes(f.length)||f.length>l)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+f.length);const g=new Uint8Array(l);g.set(f,n?0:g.length-f.length),f=g}if(f.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+f.length);let p=n?jy(f):Av(f);if(s&&(p=Zi(p,t)),!h&&!d.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p},invertBatch:f=>Az(d,f),cmov:(f,h,p)=>p?h:f});return Object.freeze(d)}function Iz(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Tz(t){const e=Iz(t);return e+Math.ceil(e/2)}function RLe(t,e,n=!1){const r=t.length,i=Iz(e),a=Tz(e);if(r<16||r<a||r>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+r);const s=n?jy(t):Av(t),o=Zi(s,e-ri)+ri;return n?$S(o,i):kS(o,i)}const C2=BigInt(0),eu=BigInt(1);function By(t,e){const n=e.negate();return t?n:e}function h4(t,e){const n=Az(t.Fp,e.map(r=>r.Z));return e.map((r,i)=>t.fromAffine(r.toAffine(n[i])))}function Lz(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function p4(t,e){Lz(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,a=x0(t),s=BigInt(t);return{windows:n,windowSize:r,mask:a,maxNumber:i,shiftBy:s}}function dP(t,e,n){const{windowSize:r,mask:i,maxNumber:a,shiftBy:s}=n;let o=Number(t&i),c=t>>s;o>r&&(o-=a,c+=eu);const l=e*r,u=l+Math.abs(o)-1,d=o===0,f=o<0,h=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function OLe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function MLe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const g4=new WeakMap,kz=new WeakMap;function y4(t){return kz.get(t)||1}function fP(t){if(t!==C2)throw new Error("invalid wNAF")}class NLe{constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,r=this.ZERO){let i=e;for(;n>C2;)n&eu&&(r=r.add(i)),i=i.double(),n>>=eu;return r}precomputeWindow(e,n){const{windows:r,windowSize:i}=p4(n,this.bits),a=[];let s=e,o=s;for(let c=0;c<r;c++){o=s,a.push(o);for(let l=1;l<i;l++)o=o.add(s),a.push(o);s=o.double()}return a}wNAF(e,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let i=this.ZERO,a=this.BASE;const s=p4(e,this.bits);for(let o=0;o<s.windows;o++){const{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:f,offsetF:h}=dP(r,o,s);r=c,u?a=a.add(By(f,n[h])):i=i.add(By(d,n[l]))}return fP(r),{p:i,f:a}}wNAFUnsafe(e,n,r,i=this.ZERO){const a=p4(e,this.bits);for(let s=0;s<a.windows&&r!==C2;s++){const{nextN:o,offset:c,isZero:l,isNeg:u}=dP(r,s,a);if(r=o,!l){const d=n[c];i=i.add(u?d.negate():d)}}return fP(r),i}getPrecomputes(e,n,r){let i=g4.get(n);return i||(i=this.precomputeWindow(n,e),e!==1&&(typeof r=="function"&&(i=r(i)),g4.set(n,i))),i}cached(e,n,r){const i=y4(e);return this.wNAF(i,this.getPrecomputes(i,e,r),n)}unsafe(e,n,r,i){const a=y4(e);return a===1?this._unsafeLadder(e,n,i):this.wNAFUnsafe(a,this.getPrecomputes(a,e,r),n,i)}createCache(e,n){Lz(n,this.bits),kz.set(e,n),g4.delete(e)}hasCache(e){return y4(e)!==1}}function DLe(t,e,n,r){let i=e,a=t.ZERO,s=t.ZERO;for(;n>C2||r>C2;)n&eu&&(a=a.add(i)),r&eu&&(s=s.add(i)),i=i.double(),n>>=eu,r>>=eu;return{p1:a,p2:s}}function FLe(t,e,n,r){OLe(n,t),MLe(r,e);const i=n.length,a=r.length;if(i!==a)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,o=mz(BigInt(i));let c=1;o>12?c=o-3:o>4?c=o-2:o>0&&(c=2);const l=x0(c),u=new Array(Number(l)+1).fill(s),d=Math.floor((e.BITS-1)/c)*c;let f=s;for(let h=d;h>=0;h-=c){u.fill(s);for(let g=0;g<a;g++){const y=r[g],v=Number(y>>BigInt(h)&l);u[v]=u[v].add(n[g])}let p=s;for(let g=u.length-1,y=s;g>0;g--)y=y.add(u[g]),p=p.add(y);if(f=f.add(p),h!==0)for(let g=0;g<c;g++)f=f.double()}return f}function hP(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return $Le(e),e}else return yl(t,{isLE:n})}function ULe(t,e,n={},r){if(r===void 0&&(r=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const o of["p","n","h"]){const c=e[o];if(!(typeof c=="bigint"&&c>C2))throw new Error(`CURVE.${o} must be positive bigint`)}const i=hP(e.p,n.Fp,r),a=hP(e.n,n.Fn,r),s=["Gx","Gy","a","b"];for(const o of s)if(!i.isValid(e[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:a}}BigInt(0),BigInt(1),BigInt(2),BigInt(8),ez("HashToScalar-");const Wf=BigInt(0),cd=BigInt(1),Y1=BigInt(2);function jLe(t){return xv(t,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...t})}function BLe(t){const e=jLe(t),{P:n,type:r,adjustScalarBytes:i,powPminus2:a,randomBytes:s}=e,o=r==="x25519";if(!o&&r!=="x448")throw new Error("invalid type");const c=s||Du,l=o?255:448,u=o?32:56,d=BigInt(o?9:5),f=BigInt(o?121665:39081),h=o?Y1**BigInt(254):Y1**BigInt(447),p=o?BigInt(8)*Y1**BigInt(251)-cd:BigInt(4)*Y1**BigInt(445)-cd,g=h+p+cd,y=F=>Zi(F,n),v=b(d);function b(F){return $S(y(F),u)}function w(F){const k=Dr("u coordinate",F,u);return o&&(k[31]&=127),y(jy(k))}function _(F){return jy(i(Dr("scalar",F,u)))}function E(F,k){const S=$(w(k),_(F));if(S===Wf)throw new Error("invalid private or public key received");return b(S)}function C(F){return E(F,v)}function x(F,k,S){const I=y(F*(k-S));return k=y(k-I),S=y(S+I),{x_2:k,x_3:S}}function $(F,k){J8("u",F,Wf,n),J8("scalar",k,h,g);const S=k,I=F;let A=cd,R=Wf,N=F,P=cd,j=Wf;for(let V=BigInt(l-1);V>=Wf;V--){const B=S>>V&cd;j^=B,{x_2:A,x_3:N}=x(j,A,N),{x_2:R,x_3:P}=x(j,R,P),j=B;const G=A+R,Z=y(G*G),ie=A-R,oe=y(ie*ie),z=Z-oe,J=N+P,K=N-P,ne=y(K*G),ce=y(J*ie),xe=ne+ce,ke=ne-ce;N=y(xe*xe),P=y(I*y(ke*ke)),A=y(Z*oe),R=y(z*(Z+y(f*z)))}({x_2:A,x_3:N}=x(j,A,N)),{x_2:R,x_3:P}=x(j,R,P);const M=a(R);return y(A*M)}const T={secretKey:u,publicKey:u,seed:u},U=(F=c(u))=>(Qa(F,T.seed),F);function O(F){const k=U(F);return{secretKey:k,publicKey:C(k)}}return{keygen:O,getSharedSecret:(F,k)=>E(F,k),getPublicKey:F=>C(F),scalarMult:E,scalarMultBase:C,utils:{randomSecretKey:U,randomPrivateKey:U},GuBytes:v.slice(),lengths:T}}const VLe=BigInt(1),pP=BigInt(2),HLe=BigInt(3),WLe=BigInt(5),qLe=BigInt(8),$z=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),zLe={p:$z,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:qLe,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function ZLe(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=$z,s=t*t%a*t%a,o=Fa(s,pP,a)*s%a,c=Fa(o,VLe,a)*t%a,l=Fa(c,WLe,a)*c%a,u=Fa(l,e,a)*l%a,d=Fa(u,n,a)*u%a,f=Fa(d,r,a)*d%a,h=Fa(f,i,a)*f%a,p=Fa(h,i,a)*f%a,g=Fa(p,e,a)*l%a;return{pow_p_5_8:Fa(g,pP,a)*t%a,b2:s}}function KLe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const GLe=yl(zLe.p,{isLE:!0}),X8=(()=>{const t=GLe.ORDER;return BLe({P:t,type:"x25519",powPminus2:e=>{const{pow_p_5_8:n,b2:r}=ZLe(e);return Zi(Fa(n,HLe,t)*r,t)},adjustScalarBytes:KLe})})(),gP=(t,e)=>(t+(t>=0?e:-e)/Pz)/e;function YLe(t,e,n){const[[r,i],[a,s]]=e,o=gP(s*t,n),c=gP(-i*t,n);let l=t-o*r-c*a,u=-o*i-c*s;const d=l<ko,f=u<ko;d&&(l=-l),f&&(u=-u);const h=x0(Math.ceil(mz(n)/2))+Gd;if(l<ko||l>=h||u<ko||u>=h)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:d,k1:l,k2neg:f,k2:u}}function Q8(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function m4(t,e){const n={};for(let r of Object.keys(e))n[r]=t[r]===void 0?e[r]:t[r];return Uy(n.lowS,"lowS"),Uy(n.prehash,"prehash"),n.format!==void 0&&Q8(n.format),n}class JLe extends Error{constructor(e=""){super(e)}}const So={Err:JLe,_tlv:{encode:(t,e)=>{const{Err:n}=So;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=G1(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const a=r>127?G1(i.length/2|128):"";return G1(t)+a+i+e},decode(t,e){const{Err:n}=So;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],a=!!(i&128);let s=0;if(!a)s=i;else{const c=i&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const l=e.subarray(r,r+c);if(l.length!==c)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)s=s<<8|u;if(r+=c,s<128)throw new n("tlv.decode(long): not minimal encoding")}const o=e.subarray(r,r+s);if(o.length!==s)throw new n("tlv.decode: wrong value length");return{v:o,l:e.subarray(r+s)}}},_int:{encode(t){const{Err:e}=So;if(t<ko)throw new e("integer: negative integers are not allowed");let n=G1(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=So;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Av(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=So,i=Dr("signature",t),{v:a,l:s}=r.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:o,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(o),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=So,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),a=r+i;return e.encode(48,a)}},ko=BigInt(0),Gd=BigInt(1),Pz=BigInt(2),J1=BigInt(3),XLe=BigInt(4);function Td(t,e){const{BYTES:n}=t;let r;if(typeof e=="bigint")r=e;else{let i=Dr("private key",e);try{r=t.fromBytes(i)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function QLe(t,e={}){const n=ULe("weierstrass",t,e),{Fp:r,Fn:i}=n;let a=n.CURVE;const{h:s,n:o}=a;xv(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=e;if(c&&(!r.is0(a.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=Oz(r,i);function u(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(F,k,S){const{x:I,y:A}=k.toAffine(),R=r.toBytes(I);if(Uy(S,"isCompressed"),S){u();const N=!r.isOdd(A);return Oc(Rz(N),R)}else return Oc(Uint8Array.of(4),R,r.toBytes(A))}function f(F){Xl(F,void 0,"Point");const{publicKey:k,publicKeyUncompressed:S}=l,I=F.length,A=F[0],R=F.subarray(1);if(I===k&&(A===2||A===3)){const N=r.fromBytes(R);if(!r.isValid(N))throw new Error("bad point: is not on curve, wrong x");const P=g(N);let j;try{j=r.sqrt(P)}catch(V){const B=V instanceof Error?": "+V.message:"";throw new Error("bad point: is not on curve, sqrt error"+B)}u();const M=r.isOdd(j);return(A&1)===1!==M&&(j=r.neg(j)),{x:N,y:j}}else if(I===S&&A===4){const N=r.BYTES,P=r.fromBytes(R.subarray(0,N)),j=r.fromBytes(R.subarray(N,N*2));if(!y(P,j))throw new Error("bad point: is not on curve");return{x:P,y:j}}else throw new Error(`bad point: got length ${I}, expected compressed=${k} or uncompressed=${S}`)}const h=e.toBytes||d,p=e.fromBytes||f;function g(F){const k=r.sqr(F),S=r.mul(k,F);return r.add(r.add(S,r.mul(F,a.a)),a.b)}function y(F,k){const S=r.sqr(k),I=g(F);return r.eql(S,I)}if(!y(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const v=r.mul(r.pow(a.a,J1),XLe),b=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(v,b)))throw new Error("bad curve params: a or b");function w(F,k,S=!1){if(!r.isValid(k)||S&&r.is0(k))throw new Error(`bad point coordinate ${F}`);return k}function _(F){if(!(F instanceof T))throw new Error("ProjectivePoint expected")}function E(F){if(!c||!c.basises)throw new Error("no endo");return YLe(F,c.basises,i.ORDER)}const C=cP((F,k)=>{const{X:S,Y:I,Z:A}=F;if(r.eql(A,r.ONE))return{x:S,y:I};const R=F.is0();k==null&&(k=R?r.ONE:r.inv(A));const N=r.mul(S,k),P=r.mul(I,k),j=r.mul(A,k);if(R)return{x:r.ZERO,y:r.ZERO};if(!r.eql(j,r.ONE))throw new Error("invZ was invalid");return{x:N,y:P}}),x=cP(F=>{if(F.is0()){if(e.allowInfinityPoint&&!r.is0(F.Y))return;throw new Error("bad point: ZERO")}const{x:k,y:S}=F.toAffine();if(!r.isValid(k)||!r.isValid(S))throw new Error("bad point: x or y not field elements");if(!y(k,S))throw new Error("bad point: equation left != right");if(!F.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function $(F,k,S,I,A){return S=new T(r.mul(S.X,F),S.Y,S.Z),k=By(I,k),S=By(A,S),k.add(S)}class T{constructor(k,S,I){this.X=w("x",k),this.Y=w("y",S,!0),this.Z=w("z",I),Object.freeze(this)}static CURVE(){return a}static fromAffine(k){const{x:S,y:I}=k||{};if(!k||!r.isValid(S)||!r.isValid(I))throw new Error("invalid affine point");if(k instanceof T)throw new Error("projective point not allowed");return r.is0(S)&&r.is0(I)?T.ZERO:new T(S,I,r.ONE)}static fromBytes(k){const S=T.fromAffine(p(Xl(k,void 0,"point")));return S.assertValidity(),S}static fromHex(k){return T.fromBytes(Dr("pointHex",k))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(k=8,S=!0){return O.createCache(this,k),S||this.multiply(J1),this}assertValidity(){x(this)}hasEvenY(){const{y:k}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(k)}equals(k){_(k);const{X:S,Y:I,Z:A}=this,{X:R,Y:N,Z:P}=k,j=r.eql(r.mul(S,P),r.mul(R,A)),M=r.eql(r.mul(I,P),r.mul(N,A));return j&&M}negate(){return new T(this.X,r.neg(this.Y),this.Z)}double(){const{a:k,b:S}=a,I=r.mul(S,J1),{X:A,Y:R,Z:N}=this;let P=r.ZERO,j=r.ZERO,M=r.ZERO,V=r.mul(A,A),B=r.mul(R,R),G=r.mul(N,N),Z=r.mul(A,R);return Z=r.add(Z,Z),M=r.mul(A,N),M=r.add(M,M),P=r.mul(k,M),j=r.mul(I,G),j=r.add(P,j),P=r.sub(B,j),j=r.add(B,j),j=r.mul(P,j),P=r.mul(Z,P),M=r.mul(I,M),G=r.mul(k,G),Z=r.sub(V,G),Z=r.mul(k,Z),Z=r.add(Z,M),M=r.add(V,V),V=r.add(M,V),V=r.add(V,G),V=r.mul(V,Z),j=r.add(j,V),G=r.mul(R,N),G=r.add(G,G),V=r.mul(G,Z),P=r.sub(P,V),M=r.mul(G,B),M=r.add(M,M),M=r.add(M,M),new T(P,j,M)}add(k){_(k);const{X:S,Y:I,Z:A}=this,{X:R,Y:N,Z:P}=k;let j=r.ZERO,M=r.ZERO,V=r.ZERO;const B=a.a,G=r.mul(a.b,J1);let Z=r.mul(S,R),ie=r.mul(I,N),oe=r.mul(A,P),z=r.add(S,I),J=r.add(R,N);z=r.mul(z,J),J=r.add(Z,ie),z=r.sub(z,J),J=r.add(S,A);let K=r.add(R,P);return J=r.mul(J,K),K=r.add(Z,oe),J=r.sub(J,K),K=r.add(I,A),j=r.add(N,P),K=r.mul(K,j),j=r.add(ie,oe),K=r.sub(K,j),V=r.mul(B,J),j=r.mul(G,oe),V=r.add(j,V),j=r.sub(ie,V),V=r.add(ie,V),M=r.mul(j,V),ie=r.add(Z,Z),ie=r.add(ie,Z),oe=r.mul(B,oe),J=r.mul(G,J),ie=r.add(ie,oe),oe=r.sub(Z,oe),oe=r.mul(B,oe),J=r.add(J,oe),Z=r.mul(ie,J),M=r.add(M,Z),Z=r.mul(K,J),j=r.mul(z,j),j=r.sub(j,Z),Z=r.mul(z,ie),V=r.mul(K,V),V=r.add(V,Z),new T(j,M,V)}subtract(k){return this.add(k.negate())}is0(){return this.equals(T.ZERO)}multiply(k){const{endo:S}=e;if(!i.isValidNot0(k))throw new Error("invalid scalar: out of range");let I,A;const R=N=>O.cached(this,N,P=>h4(T,P));if(S){const{k1neg:N,k1:P,k2neg:j,k2:M}=E(k),{p:V,f:B}=R(P),{p:G,f:Z}=R(M);A=B.add(Z),I=$(S.beta,V,G,N,j)}else{const{p:N,f:P}=R(k);I=N,A=P}return h4(T,[I,A])[0]}multiplyUnsafe(k){const{endo:S}=e,I=this;if(!i.isValid(k))throw new Error("invalid scalar: out of range");if(k===ko||I.is0())return T.ZERO;if(k===Gd)return I;if(O.hasCache(this))return this.multiply(k);if(S){const{k1neg:A,k1:R,k2neg:N,k2:P}=E(k),{p1:j,p2:M}=DLe(T,I,R,P);return $(S.beta,j,M,A,N)}else return O.unsafe(I,k)}multiplyAndAddUnsafe(k,S,I){const A=this.multiplyUnsafe(S).add(k.multiplyUnsafe(I));return A.is0()?void 0:A}toAffine(k){return C(this,k)}isTorsionFree(){const{isTorsionFree:k}=e;return s===Gd?!0:k?k(T,this):O.unsafe(this,o).is0()}clearCofactor(){const{clearCofactor:k}=e;return s===Gd?this:k?k(T,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(k=!0){return Uy(k,"isCompressed"),this.assertValidity(),h(T,this,k)}toHex(k=!0){return Kd(this.toBytes(k))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(k=!0){return this.toBytes(k)}_setWindowSize(k){this.precompute(k)}static normalizeZ(k){return h4(T,k)}static msm(k,S){return FLe(T,i,k,S)}static fromPrivateKey(k){return T.BASE.multiply(Td(i,k))}}T.BASE=new T(a.Gx,a.Gy,r.ONE),T.ZERO=new T(r.ZERO,r.ONE,r.ZERO),T.Fp=r,T.Fn=i;const U=i.BITS,O=new NLe(T,e.endo?Math.ceil(U/2):U);return T.BASE.precompute(8),T}function Rz(t){return Uint8Array.of(t?2:3)}function Oz(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function eke(t,e={}){const{Fn:n}=t,r=e.randomBytes||Du,i=Object.assign(Oz(t.Fp,n),{seed:Tz(n.ORDER)});function a(f){try{return!!Td(n,f)}catch{return!1}}function s(f,h){const{publicKey:p,publicKeyUncompressed:g}=i;try{const y=f.length;return h===!0&&y!==p||h===!1&&y!==g?!1:!!t.fromBytes(f)}catch{return!1}}function o(f=r(i.seed)){return RLe(Xl(f,i.seed,"seed"),n.ORDER)}function c(f,h=!0){return t.BASE.multiply(Td(n,f)).toBytes(h)}function l(f){const h=o(f);return{secretKey:h,publicKey:c(h)}}function u(f){if(typeof f=="bigint")return!1;if(f instanceof t)return!0;const{secretKey:h,publicKey:p,publicKeyUncompressed:g}=i;if(n.allowedLengths||h===p)return;const y=Dr("key",f).length;return y===p||y===g}function d(f,h,p=!0){if(u(f)===!0)throw new Error("first arg must be private key");if(u(h)===!1)throw new Error("second arg must be public key");const g=Td(n,f);return t.fromHex(h).multiply(g).toBytes(p)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:t,utils:{isValidSecretKey:a,isValidPublicKey:s,randomSecretKey:o,isValidPrivateKey:a,randomPrivateKey:o,normPrivateKeyToScalar:f=>Td(n,f),precompute(f=8,h=t.BASE){return h.precompute(f,!1)}},lengths:i})}function tke(t,e,n={}){bv(e),xv(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||Du,i=n.hmac||((S,...I)=>Ev(e,S,Oc(...I))),{Fp:a,Fn:s}=t,{ORDER:o,BITS:c}=s,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h}=eke(t,n),p={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},g="compact";function y(S){const I=o>>Gd;return S>I}function v(S,I){if(!s.isValidNot0(I))throw new Error(`invalid signature ${S}: out of range 1..Point.Fn.ORDER`);return I}function b(S,I){Q8(I);const A=h.signature,R=I==="compact"?A:I==="recovered"?A+1:void 0;return Xl(S,R,`${I} signature`)}class w{constructor(I,A,R){this.r=v("r",I),this.s=v("s",A),R!=null&&(this.recovery=R),Object.freeze(this)}static fromBytes(I,A=g){b(I,A);let R;if(A==="der"){const{r:M,s:V}=So.toSig(Xl(I));return new w(M,V)}A==="recovered"&&(R=I[0],A="compact",I=I.subarray(1));const N=s.BYTES,P=I.subarray(0,N),j=I.subarray(N,N*2);return new w(s.fromBytes(P),s.fromBytes(j),R)}static fromHex(I,A){return this.fromBytes(Dy(I),A)}addRecoveryBit(I){return new w(this.r,this.s,I)}recoverPublicKey(I){const A=a.ORDER,{r:R,s:N,recovery:P}=this;if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");if(o*Pz<A&&P>1)throw new Error("recovery id is ambiguous for h>1 curve");const j=P===2||P===3?R+o:R;if(!a.isValid(j))throw new Error("recovery id 2 or 3 invalid");const M=a.toBytes(j),V=t.fromBytes(Oc(Rz((P&1)===0),M)),B=s.inv(j),G=E(Dr("msgHash",I)),Z=s.create(-G*B),ie=s.create(N*B),oe=t.BASE.multiplyUnsafe(Z).add(V.multiplyUnsafe(ie));if(oe.is0())throw new Error("point at infinify");return oe.assertValidity(),oe}hasHighS(){return y(this.s)}toBytes(I=g){if(Q8(I),I==="der")return Dy(So.hexFromSig(this));const A=s.toBytes(this.r),R=s.toBytes(this.s);if(I==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return Oc(Uint8Array.of(this.recovery),A,R)}return Oc(A,R)}toHex(I){return Kd(this.toBytes(I))}assertValidity(){}static fromCompact(I){return w.fromBytes(Dr("sig",I),"compact")}static fromDER(I){return w.fromBytes(Dr("sig",I),"der")}normalizeS(){return this.hasHighS()?new w(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Kd(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Kd(this.toBytes("compact"))}}const _=n.bits2int||function(S){if(S.length>8192)throw new Error("input is too large");const I=Av(S),A=S.length*8-c;return A>0?I>>BigInt(A):I},E=n.bits2int_modN||function(S){return s.create(_(S))},C=x0(c);function x(S){return J8("num < 2^"+c,S,ko,C),s.toBytes(S)}function $(S,I){return Xl(S,void 0,"message"),I?Xl(e(S),void 0,"prehashed message"):S}function T(S,I,A){if(["recovered","canonical"].some(ie=>ie in A))throw new Error("sign() legacy options not supported");const{lowS:R,prehash:N,extraEntropy:P}=m4(A,p);S=$(S,N);const j=E(S),M=Td(s,I),V=[x(M),x(j)];if(P!=null&&P!==!1){const ie=P===!0?r(h.secretKey):P;V.push(Dr("extraEntropy",ie))}const B=Oc(...V),G=j;function Z(ie){const oe=_(ie);if(!s.isValidNot0(oe))return;const z=s.inv(oe),J=t.BASE.multiply(oe).toAffine(),K=s.create(J.x);if(K===ko)return;const ne=s.create(z*s.create(G+K*M));if(ne===ko)return;let ce=(J.x===K?0:2)|Number(J.y&Gd),xe=ne;return R&&y(ne)&&(xe=s.neg(ne),ce^=1),new w(K,xe,ce)}return{seed:B,k2sig:Z}}function U(S,I,A={}){S=Dr("message",S);const{seed:R,k2sig:N}=T(S,I,A);return SLe(e.outputLen,s.BYTES,i)(R,N)}function O(S){let I;const A=typeof S=="string"||wv(S),R=!A&&S!==null&&typeof S=="object"&&typeof S.r=="bigint"&&typeof S.s=="bigint";if(!A&&!R)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(R)I=new w(S.r,S.s);else if(A){try{I=w.fromBytes(Dr("sig",S),"der")}catch(N){if(!(N instanceof So.Err))throw N}if(!I)try{I=w.fromBytes(Dr("sig",S),"compact")}catch{return!1}}return I||!1}function F(S,I,A,R={}){const{lowS:N,prehash:P,format:j}=m4(R,p);if(A=Dr("publicKey",A),I=$(Dr("message",I),P),"strict"in R)throw new Error("options.strict was renamed to lowS");const M=j===void 0?O(S):w.fromBytes(Dr("sig",S),j);if(M===!1)return!1;try{const V=t.fromBytes(A);if(N&&M.hasHighS())return!1;const{r:B,s:G}=M,Z=E(I),ie=s.inv(G),oe=s.create(Z*ie),z=s.create(B*ie),J=t.BASE.multiplyUnsafe(oe).add(V.multiplyUnsafe(z));return J.is0()?!1:s.create(J.x)===B}catch{return!1}}function k(S,I,A={}){const{prehash:R}=m4(A,p);return I=$(I,R),w.fromBytes(S,"recovered").recoverPublicKey(I).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h,Point:t,sign:U,verify:F,recoverPublicKey:k,Signature:w,hash:e})}function nke(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(s=>Math.ceil(s/2)))):void 0;const i=yl(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),a={Fp:n,Fn:i,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:a}}function rke(t){const{CURVE:e,curveOpts:n}=nke(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function ike(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,xz(n.Fn.ORDER,n.Fn.BITS))})}function ake(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:i}=rke(t),a=QLe(e,n),s=tke(a,r,i);return ike(t,s)}function eb(t,e){const n=r=>ake({...t,hash:r});return{...n(e),create:n}}const Mz={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},Nz={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},Dz={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},ske=yl(Mz.p),oke=yl(Nz.p),cke=yl(Dz.p),lke=eb({...Mz,Fp:ske,lowS:!1},Cv);eb({...Nz,Fp:oke,lowS:!1},gTe),eb({...Dz,Fp:cke,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},pTe);const uke=lke,Fz="base10",ii="base16",Ci="base64pad",Mc="base64url",I0="utf8",Uz=0,Oo=1,T0=2,dke=0,yP=1,Bh=12,RS=32;function fke(){const t=X8.utils.randomPrivateKey(),e=X8.getPublicKey(t);return{privateKey:xi(t,ii),publicKey:xi(e,ii)}}function tb(){const t=Du(RS);return xi(t,ii)}function hke(t,e){const n=X8.getSharedSecret(va(t,ii),va(e,ii)),r=CLe(Sv,n,void 0,void 0,RS);return xi(r,ii)}function Q3(t){const e=Sv(va(t,ii));return xi(e,ii)}function pa(t){const e=Sv(va(t,I0));return xi(e,ii)}function jz(t){return va(`${t}`,Fz)}function xu(t){return Number(xi(t,Fz))}function Bz(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Vz(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4;return e+"=".repeat(n)}function pke(t){const e=jz(typeof t.type<"u"?t.type:Uz);if(xu(e)===Oo&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof t.senderPublicKey<"u"?va(t.senderPublicKey,ii):void 0,r=typeof t.iv<"u"?va(t.iv,ii):Du(Bh),i=va(t.symKey,ii),a=pz(i,r).encrypt(va(t.message,I0)),s=Hz({type:e,sealed:a,iv:r,senderPublicKey:n});return t.encoding===Mc?Bz(s):s}function gke(t){const e=va(t.symKey,ii),{sealed:n,iv:r}=Dp({encoded:t.encoded,encoding:t.encoding}),i=pz(e,r).decrypt(n);if(i===null)throw new Error("Failed to decrypt");return xi(i,I0)}function yke(t,e){const n=jz(T0),r=Du(Bh),i=va(t,I0),a=Hz({type:n,sealed:i,iv:r});return e===Mc?Bz(a):a}function mke(t,e){const{sealed:n}=Dp({encoded:t,encoding:e});return xi(n,I0)}function Hz(t){if(xu(t.type)===T0)return xi(jh([t.type,t.sealed]),Ci);if(xu(t.type)===Oo){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return xi(jh([t.type,t.senderPublicKey,t.iv,t.sealed]),Ci)}return xi(jh([t.type,t.iv,t.sealed]),Ci)}function Dp(t){const e=(t.encoding||Ci)===Mc?Vz(t.encoded):t.encoded,n=va(e,Ci),r=n.slice(dke,yP),i=yP;if(xu(r)===Oo){const c=i+RS,l=c+Bh,u=n.slice(i,c),d=n.slice(c,l),f=n.slice(l);return{type:r,sealed:f,iv:d,senderPublicKey:u}}if(xu(r)===T0){const c=n.slice(i),l=Du(Bh);return{type:r,sealed:c,iv:l}}const a=i+Bh,s=n.slice(i,a),o=n.slice(a);return{type:r,sealed:o,iv:s}}function vke(t,e){const n=Dp({encoded:t,encoding:e?.encoding});return Wz({type:xu(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?xi(n.senderPublicKey,ii):void 0,receiverPublicKey:e?.receiverPublicKey})}function Wz(t){const e=t?.type||Uz;if(e===Oo){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function mP(t){return t.type===Oo&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function vP(t){return t.type===T0}function wke(t){const e=De.from(t.x,"base64"),n=De.from(t.y,"base64");return jh([new Uint8Array([4]),e,n])}function bke(t,e){const[n,r,i]=t.split("."),a=De.from(Vz(i),"base64");if(a.length!==64)throw new Error("Invalid signature length");const s=a.slice(0,32),o=a.slice(32,64),c=`${n}.${r}`,l=Sv(c),u=wke(e);if(!uke.verify(jh([s,o]),l,u))throw new Error("Invalid signature");return U8(t).payload}const _ke="irn";function Vy(t){return t?.relay||{protocol:_ke}}function Ld(t){const e=sxe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Cke=Object.defineProperty,Eke=Object.defineProperties,Ske=Object.getOwnPropertyDescriptors,wP=Object.getOwnPropertySymbols,Ake=Object.prototype.hasOwnProperty,xke=Object.prototype.propertyIsEnumerable,bP=(t,e,n)=>e in t?Cke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v4=(t,e)=>{for(var n in e||(e={}))Ake.call(e,n)&&bP(t,n,e[n]);if(wP)for(var n of wP(e))xke.call(e,n)&&bP(t,n,e[n]);return t},Ike=(t,e)=>Eke(t,Ske(e));function Tke(t,e="-"){const n={},r="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(r)){const a=i.replace(r,""),s=t[i];n[a]=s}}),n}function _P(t){if(!t.includes("wc:")){const l=Kq(t);l!=null&&l.includes("wc:")&&(t=l)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),n=t.indexOf("?")!==-1?t.indexOf("?"):void 0,r=t.substring(0,e),i=t.substring(e+1,n).split("@"),a=typeof n<"u"?t.substring(n):"",s=new URLSearchParams(a),o=Object.fromEntries(s.entries()),c=typeof o.methods=="str
96ing"?o.methods.split(","):void 0;return{protocol:r,topic:Lke(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Tke(o),methods:c,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function Lke(t){return t.startsWith("//")?t.substring(2):t}function kke(t,e="-"){const n="relay",r={};return Object.keys(t).forEach(i=>{const a=i,s=n+e+a;t[a]&&(r[s]=t[a])}),r}function CP(t){const e=new URLSearchParams,n=v4(v4(Ike(v4({},kke(t.relay)),{symKey:t.symKey}),t.expiryTimestamp&&{expiryTimestamp:t.expiryTimestamp.toString()}),t.methods&&{methods:t.methods.join(",")});return Object.entries(n).sort(([r],[i])=>r.localeCompare(i)).forEach(([r,i])=>{i!==void 0&&e.append(r,String(i))}),`${t.protocol}:${t.topic}@${t.version}?${e}`}function X1(t,e,n){return`${t}?wc_ev=${n}&topic=${e}`}var $ke=Object.defineProperty,Pke=Object.defineProperties,Rke=Object.getOwnPropertyDescriptors,EP=Object.getOwnPropertySymbols,Oke=Object.prototype.hasOwnProperty,Mke=Object.prototype.propertyIsEnumerable,SP=(t,e,n)=>e in t?$ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Nke=(t,e)=>{for(var n in e||(e={}))Oke.call(e,n)&&SP(t,n,e[n]);if(EP)for(var n of EP(e))Mke.call(e,n)&&SP(t,n,e[n]);return t},Dke=(t,e)=>Pke(t,Rke(e));function ef(t){const e=[];return t.forEach(n=>{const[r,i]=n.split(":");e.push(`${r}:${i}`)}),e}function Fke(t){const e=[];return Object.values(t).forEach(n=>{e.push(...ef(n.accounts))}),e}function Uke(t,e){const n=[];return Object.values(t).forEach(r=>{ef(r.accounts).includes(e)&&n.push(...r.methods)}),n}function jke(t,e){const n=[];return Object.values(t).forEach(r=>{ef(r.accounts).includes(e)&&n.push(...r.events)}),n}function Iv(t){return t.includes(":")}function kd(t){return Iv(t)?t.split(":")[0]:t}function AP(t){var e,n,r;const i={};if(!Ds(t))return i;for(const[a,s]of Object.entries(t)){const o=Iv(a)?[a]:s.chains,c=s.methods||[],l=s.events||[],u=kd(a);i[u]=Dke(Nke({},i[u]),{chains:Ns(o,(e=i[u])==null?void 0:e.chains),methods:Ns(c,(n=i[u])==null?void 0:n.methods),events:Ns(l,(r=i[u])==null?void 0:r.events)})}return i}function Bke(t){const e={};return t?.forEach(n=>{var r;const[i,a]=n.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[],methods:[]}),e[i].accounts.push(n),(r=e[i].chains)==null||r.push(`${i}:${a}`)}),e}function xP(t,e){e=e.map(r=>r.replace("did:pkh:",""));const n=Bke(e);for(const[r,i]of Object.entries(n))i.methods?i.methods=Ns(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return n}function Vke(t,e){var n,r,i,a,s,o;const c=AP(t),l=AP(e),u={},d=Object.keys(c).concat(Object.keys(l));for(const f of d)u[f]={chains:Ns((n=c[f])==null?void 0:n.chains,(r=l[f])==null?void 0:r.chains),methods:Ns((i=c[f])==null?void 0:i.methods,(a=l[f])==null?void 0:a.methods),events:Ns((s=c[f])==null?void 0:s.events,(o=l[f])==null?void 0:o.events)};return u}const Hke={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},Wke={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};
vendor: 98,325 bytes, lines 96-102
96function Re(t,e){const{message:n,code:r}=Wke[t];return{message:e?`${n} ${e}`:n,code:r}}function ln(t,e){const{message:n,code:r}=Hke[t];return{message:e?`${n} ${e}`:n,code:r}}function ba(t,e){return!!Array.isArray(t)}function Ds(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function cr(t){return typeof t>"u"}function Vn(t,e){return e&&cr(t)?!0:typeof t=="string"&&!!t.trim().length}function OS(t,e){return typeof t=="number"&&!isNaN(t)}function qke(t,e){const{requiredNamespaces:n}=e,r=Object.keys(t.namespaces),i=Object.keys(n);let a=!0;return Jl(i,r)?(r.forEach(s=>{const{accounts:o,methods:c,events:l}=t.namespaces[s],u=ef(o),d=n[s];(!Jl(Hq(s,d),u)||!Jl(d.methods,c)||!Jl(d.events,l))&&(a=!1)}),a):!1}function Hy(t){return Vn(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function zke(t){if(Vn(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const n=e[0]+":"+e[1];return!!e[2]&&Hy(n)}}return!1}function Zke(t){function e(n){try{return typeof new URL(n)<"u"}catch{return!1}}try{if(Vn(t,!1)){if(e(t))return!0;const n=Kq(t);return e(n)}}catch{}return!1}function Kke(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function Gke(t){return t?.topic}function Yke(t,e){let n=null;return Vn(t?.publicKey,!1)||(n=Re("MISSING_OR_INVALID",`${e} controller public key should be a string`)),n}function IP(t){let e=!0;return ba(t)?t.length&&(e=t.every(n=>Vn(n,!1))):e=!1,e}function Jke(t,e,n){let r=null;return ba(e)&&e.length?e.forEach(i=>{r||Hy(i)||(r=ln("UNSUPPORTED_CHAINS",`${n}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Hy(t)||(r=ln("UNSUPPORTED_CHAINS",`${n}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),r}function Xke(t,e,n){let r=null;return Object.entries(t).forEach(([i,a])=>{if(r)return;const s=Jke(i,Hq(i,a),`${e} ${n}`);s&&(r=s)}),r}function Qke(t,e){let n=null;return ba(t)?t.forEach(r=>{n||zke(r)||(n=ln("UNSUPPORTED_ACCOUNTS",`${e}, account ${r} should be a string and conform to "namespace:chainId:address" format`))}):n=ln("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function e$e(t,e){let n=null;return Object.values(t).forEach(r=>{if(n)return;const i=Qke(r?.accounts,`${e} namespace`);i&&(n=i)}),n}function t$e(t,e){let n=null;return IP(t?.methods)?IP(t?.events)||(n=ln("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):n=ln("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),n}function qz(t,e){let n=null;return Object.values(t).forEach(r=>{if(n)return;const i=t$e(r,`${e}, namespace`);i&&(n=i)}),n}function n$e(t,e,n){let r=null;if(t&&Ds(t)){const i=qz(t,e);i&&(r=i);const a=Xke(t,e,n);a&&(r=a)}else r=Re("MISSING_OR_INVALID",`${e}, ${n} should be an object with data`);return r}function w4(t,e){let n=null;if(t&&Ds(t)){const r=qz(t,e);r&&(n=r);const i=e$e(t,e);i&&(n=i)}else n=Re("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return n}function zz(t){return Vn(t.protocol,!0)}function r$e(t,e){let n=!1;return t?t&&ba(t)&&t.length&&t.forEach(r=>{n=zz(r)}):n=!0,n}function i$e(t){return typeof t=="number"}function vi(t){return typeof t<"u"&&typeof t!==null}function a$e(t){return!(!t||typeof t!="object"||!t.code||!OS(t.code)||!t.message||!Vn(t.message,!1))}function s$e(t){return!(cr(t)||!Vn(t.method,!1))}function o$e(t){return!(cr(t)||cr(t.result)&&cr(t.error)||!OS(t.id)||!Vn(t.jsonrpc,!1))}function c$e(t){return!(cr(t)||!Vn(t.name,!1))}function TP(t,e){return!(!Hy(e)||!Fke(t).includes(e))}function l$e(t,e,n){return Vn(n,!1)?Uke(t,e).includes(n):!1}function u$e(t,e,n){return Vn(n,!1)?jke(t,e).includes(n):!1}function LP(t,e,n){let r=null;const i=d$e(t),a=f$e(e),s=Object.keys(i),o=Object.keys(a),c=kP(Object.keys(t)),l=kP(Object.keys(e)),u=c.filter(d=>!l.includes(d));return u.length&&(r=Re("NON_CONFORMING_NAMESPACES",`${n} namespaces keys don't satisfy requiredNamespaces. 97 Required: ${u.toString()} 98 Received: ${Object.keys(e).toString()}`)),Jl(s,o)||(r=Re("NON_CONFORMING_NAMESPACES",`${n} namespaces chains don't satisfy required namespaces. 99 Required: ${s.toString()} 100 Approved: ${o.toString()}`)),Object.keys(e).forEach(d=>{if(!d.includes(":")||r)return;const f=ef(e[d].accounts);f.includes(d)||(r=Re("NON_CONFORMING_NAMESPACES",`${n} namespaces accounts don't satisfy namespace accounts for ${d} 101 Required: ${d} 102 Approved: ${f.toString()}`))}),s.forEach(d=>{r||(Jl(i[d].methods,a[d].methods)?Jl(i[d].events,a[d].events)||(r=Re("NON_CONFORMING_NAMESPACES",`${n} namespaces events don't satisfy namespace events for ${d}`)):r=Re("NON_CONFORMING_NAMESPACES",`${n} namespaces methods don't satisfy namespace methods for ${d}`))}),r}function d$e(t){const e={};return Object.keys(t).forEach(n=>{var r;n.includes(":")?e[n]=t[n]:(r=t[n].chains)==null||r.forEach(i=>{e[i]={methods:t[n].methods,events:t[n].events}})}),e}function kP(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function f$e(t){const e={};return Object.keys(t).forEach(n=>{n.includes(":")?e[n]=t[n]:ef(t[n].accounts)?.forEach(i=>{e[i]={accounts:t[n].accounts.filter(a=>a.includes(`${i}:`)),methods:t[n].methods,events:t[n].events}})}),e}function h$e(t,e){return OS(t)&&t<=e.max&&t>=e.min}function $P(){const t=S0();return new Promise(e=>{switch(t){case Ji.browser:e(p$e());break;case Ji.reactNative:e(g$e());break;case Ji.node:e(y$e());break;default:e(!0)}})}function p$e(){return Q2()&&navigator?.onLine}async function g$e(){return gl()&&typeof rt<"u"&&rt!=null&&rt.NetInfo?(await rt?.NetInfo.fetch())?.isConnected:!0}function y$e(){return!0}function m$e(t){switch(S0()){case Ji.browser:v$e(t);break;case Ji.reactNative:w$e(t);break}}function v$e(t){!gl()&&Q2()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function w$e(t){gl()&&typeof rt<"u"&&rt!=null&&rt.NetInfo&&rt?.NetInfo.addEventListener(e=>t(e?.isConnected))}function b$e(){var t;return Q2()&&Eu()?((t=Eu())==null?void 0:t.visibilityState)==="visible":!0}const b4={};class qf{static get(e){return b4[e]}static set(e,n){b4[e]=n}static delete(e){delete b4[e]}}function _$e(t){const e=_0.decode(t);if(e.length<33)throw new Error("Too short to contain a public key");return e.slice(1,33)}function C$e({publicKey:t,signature:e,payload:n}){var r;const i=nb(n.method),a=128|parseInt(((r=n.version)==null?void 0:r.toString())||"4"),s=A$e(n.address),o=n.era==="00"?new Uint8Array([0]):nb(n.era);if(o.length!==1&&o.length!==2)throw new Error("Invalid era length");const c=parseInt(n.nonce,16),l=new Uint8Array([c&255,c>>8&255]),u=BigInt(`0x${S$e(n.tip)}`),d=I$e(u),f=new Uint8Array([0,...t,s,...e,...o,...l,...d,...i]),h=x$e(f.length+1);return new Uint8Array([...h,a,...f])}function E$e(t){const e=nb(t),n=vxe.blake2b(e,void 0,32);return"0x"+De.from(n).toString("hex")}function nb(t){return new Uint8Array(t.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function S$e(t){return t.startsWith("0x")?t.slice(2):t}function A$e(t){const e=_0.decode(t)[0];return e===42?0:e===60?2:1}function x$e(t){if(t<64)return new Uint8Array([t<<2]);if(t<16384){const e=t<<2|1;return new Uint8Array([e&255,e>>8&255])}else if(t<1<<30){const e=t<<2|2;return new Uint8Array([e&255,e>>8&255,e>>16&255,e>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function I$e(t){if(t<BigInt(1)<<BigInt(6))return new Uint8Array([Number(t<<BigInt(2))]);if(t<BigInt(1)<<BigInt(14)){const e=t<<BigInt(2)|BigInt(1);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255))])}else if(t<BigInt(1)<<BigInt(30)){const e=t<<BigInt(2)|BigInt(2);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255)),Number(e>>BigInt(16)&BigInt(255)),Number(e>>BigInt(24)&BigInt(255))])}else throw new Error("BigInt compact encoding not supported > 2^30")}function T$e(t){const e=Uint8Array.from(De.from(t.signature,"hex")),n=_$e(t.transaction.address),r=C$e({publicKey:n,signature:e,payload:t.transaction}),i=De.from(r).toString("hex");return E$e(i)}function MS({logger:t,name:e}){const n=typeof t=="string"?Vq({opts:{level:t,name:e}}).logger:t;return n.level=typeof t=="string"?t:t.level,n}class Fu{}let L$e=class extends Fu{constructor(e){super()}};const PP=Oe.FIVE_SECONDS,Uu={pulse:"heartbeat_pulse"};let k$e=class Zz extends L$e{constructor(e){super(e),this.events=new Sa.EventEmitter,this.interval=PP,this.interval=e?.interval||PP}static async init(e){const n=new Zz(e);return await n.init(),n}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Oe.toMiliseconds(this.interval))}pulse(){this.events.emit(Uu.pulse)}};function $$e(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function nr(t,...e){try{return $$e(t(...e))}catch(n){return Promise.reject(n)}}function P$e(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function R$e(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function eg(t){if(P$e(t))return String(t);if(R$e(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return eg(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Kz(){if(typeof De>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const rb="base64:";function O$e(t){if(typeof t=="string")return t;Kz();const e=De.from(t).toString("base64");return rb+e}function M$e(t){return typeof t!="string"||!t.startsWith(rb)?t:(Kz(),De.from(t.slice(rb.length),"base64"))}function mi(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function N$e(...t){return mi(t.join(":"))}function Q1(t){return t=mi(t),t?t+":":""}const D$e="memory",F$e=()=>{const t=new Map;return{name:D$e,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,n){t.set(e,n)},setItemRaw(e,n){t.set(e,n)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function U$e(t={}){const e={mounts:{"":t.driver||F$e()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=l=>{for(const u of e.mountpoints)if(l.startsWith(u))return{base:u,relativeKey:l.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:l,driver:e.mounts[""]}},r=(l,u)=>e.mountpoints.filter(d=>d.startsWith(l)||u&&l.startsWith(d)).map(d=>({relativeBase:l.length>d.length?l.slice(d.length):void 0,mountpoint:d,driver:e.mounts[d]})),i=(l,u)=>{if(e.watching){u=mi(u);for(const d of e.watchListeners)d(l,u)}},a=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await RP(e.mounts[l],i,l)}},s=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},o=(l,u,d)=>{const f=new Map,h=p=>{let g=f.get(p.base);return g||(g={driver:p.driver,base:p.base,items:[]},f.set(p.base,g)),g};for(const p of l){const g=typeof p=="string",y=mi(g?p:p.key),v=g?void 0:p.value,b=g||!p.options?u:{...u,...p.options},w=n(y);h(w).items.push({key:y,value:v,relativeKey:w.relativeKey,options:b})}return Promise.all([...f.values()].map(p=>d(p))).then(p=>p.flat())},c={hasItem(l,u={}){l=mi(l);const{relativeKey:d,driver:f}=n(l);return nr(f.hasItem,d,u)},getItem(l,u={}){l=mi(l);const{relativeKey:d,driver:f}=n(l);return nr(f.getItem,d,u).then(h=>uh(h))},getItems(l,u){return o(l,u,d=>d.driver.getItems?nr(d.driver.getItems,d.items.map(f=>({key:f.relativeKey,options:f.options})),u).then(f=>f.map(h=>({key:N$e(d.base,h.key),value:uh(h.value)}))):Promise.all(d.items.map(f=>nr(d.driver.getItem,f.relativeKey,f.options).then(h=>({key:f.key,value:uh(h)})))))},getItemRaw(l,u={}){l=mi(l);const{relativeKey:d,driver:f}=n(l);return f.getItemRaw?nr(f.getItemRaw,d,u):nr(f.getItem,d,u).then(h=>M$e(h))},async setItem(l,u,d={}){if(u===void 0)return c.removeItem(l);l=mi(l);const{relativeKey:f,driver:h}=n(l);h.setItem&&(await nr(h.setItem,f,eg(u),d),h.watch||i("update",l))},async setItems(l,u){await o(l,u,async d=>{if(d.driver.setItems)return nr(d.driver.setItems,d.items.map(f=>({key:f.relativeKey,value:eg(f.value),options:f.options})),u);d.driver.setItem&&await Promise.all(d.items.map(f=>nr(d.driver.setItem,f.relativeKey,eg(f.value),f.options)))})},async setItemRaw(l,u,d={}){if(u===void 0)return c.removeItem(l,d);l=mi(l);const{relativeKey:f,driver:h}=n(l);if(h.setItemRaw)await nr(h.setItemRaw,f,u,d);else if(h.setItem)await nr(h.setItem,f,O$e(u),d);else return;h.watch||i("update",l)},async removeItem(l,u={}){typeof u=="boolean"&&(u={removeMeta:u}),l=mi(l);const{relativeKey:d,driver:f}=n(l);f.removeItem&&(await nr(f.removeItem,d,u),(u.removeMeta||u.removeMata)&&await nr(f.removeItem,d+"$",u),f.watch||i("remove",l))},async getMeta(l,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),l=mi(l);const{relativeKey:d,driver:f}=n(l),h=Object.create(null);if(f.getMeta&&Object.assign(h,await nr(f.getMeta,d,u)),!u.nativeOnly){const p=await nr(f.getItem,d+"$",u).then(g=>uh(g));p&&typeof p=="object"&&(typeof p.atime=="string"&&(p.atime=new Date(p.atime)),typeof p.mtime=="string"&&(p.mtime=new Date(p.mtime)),Object.assign(h,p))}return h},setMeta(l,u,d={}){return this.setItem(l+"$",u,d)},removeMeta(l,u={}){return this.removeItem(l+"$",u)},async getKeys(l,u={}){l=Q1(l);const d=r(l,!0);let f=[];const h=[];for(const p of d){const g=await nr(p.driver.getKeys,p.relativeBase,u);for(const y of g){const v=p.mountpoint+mi(y);f.some(b=>v.startsWith(b))||h.push(v)}f=[p.mountpoint,...f.filter(y=>!y.startsWith(p.mountpoint))]}return l?h.filter(p=>p.startsWith(l)&&p[p.length-1]!=="$"):h.filter(p=>p[p.length-1]!=="$")},async clear(l,u={}){l=Q1(l),await Promise.all(r(l,!1).map(async d=>{if(d.driver.clear)return nr(d.driver.clear,d.relativeBase,u);if(d.driver.removeItem){const f=await d.driver.getKeys(d.relativeBase||"",u);return Promise.all(f.map(h=>d.driver.removeItem(h,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>OP(l)))},async watch(l){return await a(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==l),e.watchListeners.length===0&&await s()}},async unwatch(){e.watchListeners=[],await s()},mount(l,u){if(l=Q1(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((d,f)=>f.length-d.length)),e.mounts[l]=u,e.watching&&Promise.resolve(RP(u,i,l)).then(d=>{e.unwatch[l]=d}).catch(console.error),c},async unmount(l,u=!0){l=Q1(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),u&&await OP(e.mounts[l]),e.mountpoints=e.mountpoints.filter(d=>d!==l),delete e.mounts[l])},getMount(l=""){l=mi(l)+":";const u=n(l);return{driver:u.driver,base:u.base}},getMounts(l="",u={}){return l=mi(l),r(l,u.parents).map(f=>({driver:f.driver,base:f.mountpoint}))},keys:(l,u={})=>c.getKeys(l,u),get:(l,u={})=>c.getItem(l,u),set:(l,u,d={})=>c.setItem(l,u,d),has:(l,u={})=>c.hasItem(l,u),del:(l,u={})=>c.removeItem(l,u),remove:(l,u={})=>c.removeItem(l,u)};return c}function RP(t,e,n){return t.watch?t.watch((r,i)=>e(r,n+i)):()=>{}}async function OP(t){typeof t.dispose=="function"&&await nr(t.dispose)}function ju(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Gz(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const r=ju(n);return(i,a)=>r.then(s=>a(s.transaction(e,i).objectStore(e)))}let _4;function L0(){return _4||(_4=Gz("keyval-store","keyval")),_4}function MP(t,e=L0()){return e("readonly",n=>ju(n.get(t)))}function j$e(t,e,n=L0()){return n("readwrite",r=>(r.put(e,t),ju(r.transaction)))}function B$e(t,e=L0()){return e("readwrite",n=>(n.delete(t),ju(n.transaction)))}function V$e(t=L0()){return t("readwrite",e=>(e.clear(),ju(e.transaction)))}function H$e(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},ju(t.transaction)}function W$e(t=L0()){return t("readonly",e=>{if(e.getAllKeys)return ju(e.getAllKeys());const n=[];return H$e(e,r=>n.push(r.key)).then(()=>n)})}const q$e="idb-keyval";var z$e=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",n=i=>e+i;let r;return t.dbName&&t.storeName&&(r=Gz(t.dbName,t.storeName)),{name:q$e,options:t,async hasItem(i){return!(typeof await MP(n(i),r)>"u")},async getItem(i){return await MP(n(i),r)??null},setItem(i,a){return j$e(n(i),a,r)},removeItem(i){return B$e(n(i),r)},getKeys(){return W$e(r)},clear(){return V$e(r)}}};const Z$e="WALLET_CONNECT_V2_INDEXED_DB",K$e="keyvaluestorage";let G$e=class{constructor(){this.indexedDb=U$e({driver:z$e({dbName:Z$e,storeName:K$e})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const n=await this.indexedDb.getItem(e);if(n!==null)return n}async setItem(e,n){await this.indexedDb.setItem(e,Bo(n))}async removeItem(e){await this.indexedDb.removeItem(e)}};var C4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof rt<"u"?rt:typeof self<"u"?self:{},tg={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},t.prototype.setItem=function(n,r){this[n]=String(r)},t.prototype.removeItem=function(n){delete this[n]},t.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(r){n[r]=void 0,delete n[r]})},t.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof C4<"u"&&C4.localStorage?tg.exports=C4.localStorage:typeof window<"u"&&window.localStorage?tg.exports=window.localStorage:tg.exports=new e})();function Y$e(t){var e;return[t[0],Su((e=t[1])!=null?e:"")]}let J$e=class{constructor(){this.localStorage=tg.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Y$e)}async getItem(e){const n=this.localStorage.getItem(e);if(n!==null)return Su(n)}async setItem(e,n){this.localStorage.setItem(e,Bo(n))}async removeItem(e){this.localStorage.removeItem(e)}};const X$e="wc_storage_version",NP=1,Q$e=async(t,e,n)=>{const r=X$e,i=await e.getItem(r);if(i&&i>=NP){n(e);return}const a=await t.getKeys();if(!a.length){n(e);return}const s=[];for(;a.length;){const o=a.shift();if(!o)continue;const c=o.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(o);await e.setItem(o,l),s.push(o)}}await e.setItem(r,NP),n(e),ePe(t,s)},ePe=async(t,e)=>{e.length&&e.forEach(async n=>{await t.removeItem(n)})};let tPe=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const e=new J$e;this.storage=e;try{const n=new G$e;Q$e(e,n,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,n){return await this.initialize(),this.storage.setItem(e,n)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),e())},20)})}};var nPe=Object.defineProperty,rPe=(t,e,n)=>e in t?nPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,DP=(t,e,n)=>rPe(t,typeof e!="symbol"?e+"":e,n);let iPe=class extends Fu{constructor(e){super(),this.opts=e,DP(this,"protocol","wc"),DP(this,"version",2)}};var aPe=Object.defineProperty,sPe=(t,e,n)=>e in t?aPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oPe=(t,e,n)=>sPe(t,e+"",n);let cPe=class extends Fu{constructor(e,n){super(),this.core=e,this.logger=n,oPe(this,"records",new Map)}},lPe=class{constructor(e,n){this.logger=e,this.core=n}},uPe=class extends Fu{constructor(e,n){super(),this.relayer=e,this.logger=n}},dPe=class extends Fu{constructor(e){super()}},fPe=class{constructor(e,n,r,i){this.core=e,this.logger=n,this.name=r}},hPe=class extends Fu{constructor(e,n){super(),this.relayer=e,this.logger=n}},pPe=class extends Fu{constructor(e,n){super(),this.core=e,this.logger=n}},gPe=class{constructor(e,n,r){this.core=e,this.logger=n,this.store=r}},yPe=class{constructor(e,n){this.projectId=e,this.logger=n}},mPe=class{constructor(e,n,r){this.core=e,this.logger=n,this.telemetryEnabled=r}};var vPe=Object.defineProperty,wPe=(t,e,n)=>e in t?vPe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,FP=(t,e,n)=>wPe(t,typeof e!="symbol"?e+"":e,n);let bPe=class{constructor(e){this.opts=e,FP(this,"protocol","wc"),FP(this,"version",2)}},_Pe=class{constructor(e){this.client=e}};const CPe="PARSE_ERROR",EPe="INVALID_REQUEST",SPe="METHOD_NOT_FOUND",APe="INVALID_PARAMS",Yz="INTERNAL_ERROR",NS="SERVER_ERROR",xPe=[-32700,-32600,-32601,-32602,-32603],Vh={[CPe]:{code:-32700,message:"Parse error"},[EPe]:{code:-32600,message:"Invalid Request"},[SPe]:{code:-32601,message:"Method not found"},[APe]:{code:-32602,message:"Invalid params"},[Yz]:{code:-32603,message:"Internal error"},[NS]:{code:-32e3,message:"Server error"}},Jz=NS;function IPe(t){return xPe.includes(t)}function UP(t){return Object.keys(Vh).includes(t)?Vh[t]:Vh[Jz]}function TPe(t){const e=Object.values(Vh).find(n=>n.code===t);return e||Vh[Jz]}function Xz(t,e,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${e}`):t}var Qz={},co={},jP;function LPe(){if(jP)return co;jP=1,Object.defineProperty(co,"__esModule",{value:!0}),co.isBrowserCryptoAvailable=co.getSubtleCrypto=co.getBrowerCrypto=void 0;function t(){return(_s===null||_s===void 0?void 0:_s.crypto)||(_s===null||_s===void 0?void 0:_s.msCrypto)||{}}co.getBrowerCrypto=t;function e(){const r=t();return r.subtle||r.webkitSubtle}co.getSubtleCrypto=e;function n(){return!!t()&&!!e()}return co.isBrowserCryptoAvailable=n,co}var lo={},BP;function kPe(){if(BP)return lo;BP=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.isBrowser=lo.isNode=lo.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}lo.isReactNative=t;function e(){return typeof ur<"u"&&typeof ur.versions<"u"&&typeof ur.versions.node<"u"}lo.isNode=e;function n(){return!t()&&!e()}return lo.isBrowser=n,lo}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=b0;e.__exportStar(LPe(),t),e.__exportStar(kPe(),t)})(Qz);function ws(t=3){const e=Date.now()*Math.pow(10,t),n=Math.floor(Math.random()*Math.pow(10,t));return e+n}function Zc(t=6){return BigInt(ws(t))}function Wa(t,e,n){return{id:n||ws(),jsonrpc:"2.0",method:t,params:e}}function Fp(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Tv(t,e,n){return{id:t,jsonrpc:"2.0",error:$Pe(e)}}function $Pe(t,e){return typeof t>"u"?UP(Yz):(typeof t=="string"&&(t=Object.assign(Object.assign({},UP(NS)),{message:t})),IPe(t.code)&&(t=TPe(t.code)),t)}let PPe=class{},RPe=class extends PPe{constructor(){super()}},OPe=class extends RPe{constructor(e){super()}};const MPe="^https?:",NPe="^wss?:";function DPe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function eZ(t,e){const n=DPe(t);return typeof n>"u"?!1:new RegExp(e).test(n)}function VP(t){return eZ(t,MPe)}function HP(t){return eZ(t,NPe)}function FPe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function tZ(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function DS(t){return tZ(t)&&"method"in t}function Lv(t){return tZ(t)&&(bs(t)||ga(t))}function bs(t){return"result"in t}function ga(t){return"error"in t}let FS=class extends OPe{constructor(e){super(e),this.events=new Sa.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async request(e,n){return this.requestStrict(Wa(e.method,e.params||[],e.id||Zc().toString()),n)}async requestStrict(e,n){return new Promise(async(r,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{ga(a)?i(a.error):r(a.result)});try{await this.connection.send(e,n)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Lv(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const UPe=()=>typeof WebSocket<"u"?WebSocket:typeof rt<"u"&&typeof rt.WebSocket<"u"?rt.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),jPe=()=>typeof WebSocket<"u"||typeof rt<"u"&&typeof rt.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",WP=t=>t.split("?")[0],qP=10,BPe=UPe();let VPe=class{constructor(e){if(this.url=e,this.events=new Sa.EventEmitter,this.registering=!1,!HP(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,n)=>{if(typeof this.socket>"u"){n(new Error("Connection already closed"));return}this.socket.onclose=r=>{this.onClose(r),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Bo(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!HP(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));r(this.socket)})})}return this.url=e,this.registering=!0,new Promise((n,r)=>{const i=Qz.isReactNative()?void 0:{rejectUnauthorized:!FPe(e)},a=new BPe(e,[],i);jPe()?a.onerror=s=>{const o=s;r(this.emitError(o.error))}:a.on("error",s=>{r(this.emitError(s))}),a.onopen=()=>{this.onOpen(a),n(a)}})}onOpen(e){e.onmessage=n=>this.onPayload(n),e.onclose=n=>this.onClose(n),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const n=typeof e.data=="string"?Su(e.data):e.data;this.events.emit("payload",n)}onError(e,n){const r=this.parseError(n),i=r.message||r.toString(),a=Tv(e,i);this.events.emit("payload",a)}parseError(e,n=this.url){return Xz(e,WP(n),"WS")}resetMaxListeners(){this.events.getMaxListeners()>qP&&this.events.setMaxListeners(qP)}emitError(e){const n=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${WP(this.url)}`));return this.events.emit("register_error",n),n}};var HPe={};const nZ="wc",rZ=2,Wy="core",qs=`${nZ}@2:${Wy}:`,WPe={name:Wy,logger:"error"},qPe={database:":memory:"},zPe="crypto",zP="client_ed25519_seed",ZPe=Oe.ONE_DAY,KPe="keychain",GPe="0.3",YPe="messages",JPe="0.3",XPe=Oe.SIX_HOURS,QPe="publisher",iZ="irn",eRe="error",aZ="wss://relay.walletconnect.org",tRe="relayer",$n={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},nRe="_subscription",oa={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},rRe=.1,ib="2.22.4",on={link_mode:"link_mode",relay:"relay"},ng={inbound:"inbound",outbound:"outbound"},iRe="0.3",aRe="WALLETCONNECT_CLIENT_ID",ZP="WALLETCONNECT_LINK_MODE_APPS",Hi={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},sRe="subscription",oRe="0.3",cRe="pairing",lRe="0.3",zf={wc_pairingDelete:{req:{ttl:Oe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Oe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Oe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Oe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Oe.ONE_DAY,prompt:!1,tag:0},res:{ttl:Oe.ONE_DAY,prompt:!1,tag:0}}},Vl={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Oa={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},uRe="history",dRe="0.3",fRe="expirer",da={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},hRe="0.3",pRe="verify-api",gRe="https://verify.walletconnect.com",sZ="https://verify.walletconnect.org",Hh=sZ,yRe=`${Hh}/v3`,mRe=[gRe,sZ],vRe="echo",wRe="https://echo.walletconnect.com",gs={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},ho={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Ma={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success",session_request_response_started:"session_request_response_started",session_request_response_validation_success:"session_request_response_validation_success",session_request_response_publish_started:"session_request_response_publish_started"},Il={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found",session_request_response_validation_failure:"session_request_response_validation_failure",session_request_response_publish_failure:"session_request_response_publish_failure"},Tl={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Zf={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},bRe=.1,_Re="event-client",CRe=86400,ERe="https://pulse.walletconnect.org/batch";function SRe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),s=a.charCodeAt(0);if(n[s]!==255)throw new TypeError(a+" is ambiguous");n[s]=i}var o=t.length,c=t.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var g=0,y=0,v=0,b=p.length;v!==b&&p[v]===0;)v++,g++;for(var w=(b-v)*u+1>>>0,_=new Uint8Array(w);v!==b;){for(var E=p[v],C=0,x=w-1;(E!==0||C<y)&&x!==-1;x--,C++)E+=256*_[x]>>>0,_[x]=E%o>>>0,E=E/o>>>0;if(E!==0)throw new Error("Non-zero carry");y=C,v++}for(var $=w-y;$!==w&&_[$]===0;)$++;for(var T=c.repeat(g);$<w;++$)T+=t.charAt(_[$]);return T}function f(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var g=0;if(p[g]!==" "){for(var y=0,v=0;p[g]===c;)y++,g++;for(var b=(p.length-g)*l+1>>>0,w=new Uint8Array(b);p[g];){var _=n[p.charCodeAt(g)];if(_===255)return;for(var E=0,C=b-1;(_!==0||E<v)&&C!==-1;C--,E++)_+=o*w[C]>>>0,w[C]=_%256>>>0,_=_/256>>>0;if(_!==0)throw new Error("Non-zero carry");v=E,g++}if(p[g]!==" "){for(var x=b-v;x!==b&&w[x]===0;)x++;for(var $=new Uint8Array(y+(b-x)),T=y;x!==b;)$[T++]=w[x++];return $}}}function h(p){var g=f(p);if(g)return g;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var ARe=SRe,xRe=ARe;const oZ=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},IRe=t=>new TextEncoder().encode(t),TRe=t=>new TextDecoder().decode(t);class LRe{constructor(e,n,r){this.name=e,this.prefix=n,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class kRe{constructor(e,n,r){if(this.name=e,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return cZ(this,e)}}class $Re{constructor(e){this.decoders=e}or(e){return cZ(this,e)}decode(e){const n=e[0],r=this.decoders[n];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const cZ=(t,e)=>new $Re({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class PRe{constructor(e,n,r,i){this.name=e,this.prefix=n,this.baseEncode=r,this.baseDecode=i,this.encoder=new LRe(e,n,r),this.decoder=new kRe(e,n,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const kv=({name:t,prefix:e,encode:n,decode:r})=>new PRe(t,e,n,r),k0=({prefix:t,name:e,alphabet:n})=>{const{encode:r,decode:i}=xRe(n,e);return kv({prefix:t,name:e,encode:r,decode:a=>oZ(i(a))})},RRe=(t,e,n,r)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let a=t.length;for(;t[a-1]==="=";)--a;const s=new Uint8Array(a*n/8|0);let o=0,c=0,l=0;for(let u=0;u<a;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${r} character`);c=c<<n|d,o+=n,o>=8&&(o-=8,s[l++]=255&c>>o)}if(o>=n||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return s},ORe=(t,e,n)=>{const r=e[e.length-1]==="=",i=(1<<n)-1;let a="",s=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],s+=8;s>n;)s-=n,a+=e[i&o>>s];if(s&&(a+=e[i&o<<n-s]),r)for(;a.length*n&7;)a+="=";return a},Ar=({name:t,prefix:e,bitsPerChar:n,alphabet:r})=>kv({prefix:e,name:t,encode(i){return ORe(i,r,n)},decode(i){return RRe(i,r,n,t)}}),MRe=kv({prefix:"\0",name:"identity",encode:t=>TRe(t),decode:t=>IRe(t)});var NRe=Object.freeze({__proto__:null,identity:MRe});const DRe=Ar({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var FRe=Object.freeze({__proto__:null,base2:DRe});const URe=Ar({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var jRe=Object.freeze({__proto__:null,base8:URe});const BRe=k0({prefix:"9",name:"base10",alphabet:"0123456789"});var VRe=Object.freeze({__proto__:null,base10:BRe});const HRe=Ar({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),WRe=Ar({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var qRe=Object.freeze({__proto__:null,base16:HRe,base16upper:WRe});const zRe=Ar({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ZRe=Ar({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),KRe=Ar({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),GRe=Ar({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),YRe=Ar({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),JRe=Ar({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),XRe=Ar({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),QRe=Ar({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),eOe=Ar({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var tOe=Object.freeze({__proto__:null,base32:zRe,base32upper:ZRe,base32pad:KRe,base32padupper:GRe,base32hex:YRe,base32hexupper:JRe,base32hexpad:XRe,base32hexpadupper:QRe,base32z:eOe});const nOe=k0({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rOe=k0({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var iOe=Object.freeze({__proto__:null,base36:nOe,base36upper:rOe});const aOe=k0({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sOe=k0({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var oOe=Object.freeze({__proto__:null,base58btc:aOe,base58flickr:sOe});const cOe=Ar({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),lOe=Ar({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),uOe=Ar({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),dOe=Ar({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var fOe=Object.freeze({__proto__:null,base64:cOe,base64pad:lOe,base64url:uOe,base64urlpad:dOe});const lZ=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð ððµðð¤²ð¤ ð¤§ððµð ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),hOe=lZ.reduce((t,e,n)=>(t[n]=e,t),[]),pOe=lZ.reduce((t,e,n)=>(t[e.codePointAt(0)]=n,t),[]);function gOe(t){return t.reduce((e,n)=>(e+=hOe[n],e),"")}function yOe(t){const e=[];for(const n of t){const r=pOe[n.codePointAt(0)];if(r===void 0)throw new Error(`Non-base256emoji character: ${n}`);e.push(r)}return new Uint8Array(e)}const mOe=kv({prefix:"ð",name:"base256emoji",encode:gOe,decode:yOe});var vOe=Object.freeze({__proto__:null,base256emoji:mOe}),wOe=uZ,KP=128,bOe=127,_Oe=~bOe,COe=Math.pow(2,31);function uZ(t,e,n){e=e||[],n=n||0;for(var r=n;t>=COe;)e[n++]=t&255|KP,t/=128;for(;t&_Oe;)e[n++]=t&255|KP,t>>>=7;return e[n]=t|0,uZ.bytes=n-r+1,e}var EOe=ab,SOe=128,GP=127;function ab(t,r){var n=0,r=r||0,i=0,a=r,s,o=t.length;do{if(a>=o)throw ab.bytes=0,new RangeError("Could not decode varint");s=t[a++],n+=i<28?(s&GP)<<i:(s&GP)*Math.pow(2,i),i+=7}while(s>=SOe);return ab.bytes=a-r,n}var AOe=Math.pow(2,7),xOe=Math.pow(2,14),IOe=Math.pow(2,21),TOe=Math.pow(2,28),LOe=Math.pow(2,35),kOe=Math.pow(2,42),$Oe=Math.pow(2,49),POe=Math.pow(2,56),ROe=Math.pow(2,63),OOe=function(t){return t<AOe?1:t<xOe?2:t<IOe?3:t<TOe?4:t<LOe?5:t<kOe?6:t<$Oe?7:t<POe?8:t<ROe?9:10},MOe={encode:wOe,decode:EOe,encodingLength:OOe},dZ=MOe;const YP=(t,e,n=0)=>(dZ.encode(t,e,n),e),JP=t=>dZ.encodingLength(t),sb=(t,e)=>{const n=e.byteLength,r=JP(t),i=r+JP(n),a=new Uint8Array(i+n);return YP(t,a,0),YP(n,a,r),a.set(e,i),new NOe(t,n,e,a)};let NOe=class{constructor(e,n,r,i){this.code=e,this.size=n,this.digest=r,this.bytes=i}};const fZ=({name:t,code:e,encode:n})=>new DOe(t,e,n);class DOe{constructor(e,n,r){this.name=e,this.code=n,this.encode=r}digest(e){if(e instanceof Uint8Array){const n=this.encode(e);return n instanceof Uint8Array?sb(this.code,n):n.then(r=>sb(this.code,r))}else throw Error("Unknown type, must be binary type")}}const hZ=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),FOe=fZ({name:"sha2-256",code:18,encode:hZ("SHA-256")}),UOe=fZ({name:"sha2-512",code:19,encode:hZ("SHA-512")});var jOe=Object.freeze({__proto__:null,sha256:FOe,sha512:UOe});const pZ=0,BOe="identity",gZ=oZ,VOe=t=>sb(pZ,gZ(t)),HOe={code:pZ,name:BOe,encode:gZ,digest:VOe};var WOe=Object.freeze({__proto__:null,identity:HOe});new TextEncoder,new TextDecoder;const XP={...NRe,...FRe,...jRe,...VRe,...qRe,...tOe,...iOe,...oOe,...fOe,...vOe};({...jOe,...WOe});function yZ(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function qOe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?yZ(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function mZ(t,e,n,r){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:n},decoder:{decode:r}}}const QP=mZ("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),E4=mZ("ascii","a",t=>{let e="a";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},t=>{t=t.substring(1);const e=qOe(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}),zOe={utf8:QP,"utf-8":QP,hex:XP.base16,latin1:E4,ascii:E4,binary:E4,...XP};function ZOe(t,e="utf8"){const n=zOe[e];if(!n)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?yZ(globalThis.Buffer.from(t,"utf-8")):n.decoder.decode(`${n.prefix}${t}`)}var KOe=Object.defineProperty,GOe=(t,e,n)=>e in t?KOe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,us=(t,e,n)=>GOe(t,typeof e!="symbol"?e+"":e,n);let YOe=class{constructor(e,n){this.core=e,this.logger=n,us(this,"keychain",new Map),us(this,"name",KPe),us(this,"version",GPe),us(this,"initialized",!1),us(this,"storagePrefix",qs),us(this,"init",async()=>{if(!this.initialized){const r=await this.getKeyChain();typeof r<"u"&&(this.keychain=r),this.initialized=!0}}),us(this,"has",r=>(this.isInitialized(),this.keychain.has(r))),us(this,"set",async(r,i)=>{this.isInitialized(),this.keychain.set(r,i),await this.persist()}),us(this,"get",r=>{this.isInitialized();const i=this.keychain.get(r);if(typeof i>"u"){const{message:a}=Re("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(a)}return i}),us(this,"del",async r=>{this.isInitialized(),this.keychain.delete(r),await this.persist()}),this.core=e,this.logger=ra(n,this.name)}get context(){return Ri(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,H8(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?W8(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}};var JOe=Object.defineProperty,XOe=(t,e,n)=>e in t?JOe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qn=(t,e,n)=>XOe(t,typeof e!="symbol"?e+"":e,n);let QOe=class{constructor(e,n,r){this.core=e,this.logger=n,Qn(this,"name",zPe),Qn(this,"keychain"),Qn(this,"randomSessionIdentifier",tb()),Qn(this,"initialized",!1),Qn(this,"clientId"),Qn(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),Qn(this,"hasKeys",i=>(this.isInitialized(),this.keychain.has(i))),Qn(this,"getClientId",async()=>{if(this.isInitialized(),this.clientId)return this.clientId;const i=await this.getClientSeed(),a=A$(i),s=wq(a.publicKey);return this.clientId=s,s}),Qn(this,"generateKeyPair",()=>{this.isInitialized();const i=fke();return this.setPrivateKey(i.publicKey,i.privateKey)}),Qn(this,"signJWT",async i=>{this.isInitialized();const a=await this.getClientSeed(),s=A$(a),o=this.randomSessionIdentifier;return await lAe(o,i,ZPe,s)}),Qn(this,"generateSharedKey",(i,a,s)=>{this.isInitialized();const o=this.getPrivateKey(i),c=hke(o,a);return this.setSymKey(c,s)}),Qn(this,"setSymKey",async(i,a)=>{this.isInitialized();const s=a||Q3(i);return await this.keychain.set(s,i),s}),Qn(this,"deleteKeyPair",async i=>{this.isInitialized(),await this.keychain.del(i)}),Qn(this,"deleteSymKey",async i=>{this.isInitialized(),await this.keychain.del(i)}),Qn(this,"encode",async(i,a,s)=>{this.isInitialized();const o=Wz(s),c=Bo(a);if(vP(o))return yke(c,s?.encoding);if(mP(o)){const f=o.senderPublicKey,h=o.receiverPublicKey;i=await this.generateSharedKey(f,h)}const l=this.getSymKey(i),{type:u,senderPublicKey:d}=o;return pke({type:u,symKey:l,message:c,senderPublicKey:d,encoding:s?.encoding})}),Qn(this,"decode",async(i,a,s)=>{this.isInitialized();const o=vke(a,s);if(vP(o)){const c=mke(a,s?.encoding);return Su(c)}if(mP(o)){const c=o.receiverPublicKey,l=o.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=gke({symKey:c,encoded:a,encoding:s?.encoding});return Su(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}}),Qn(this,"getPayloadType",(i,a=Ci)=>{const s=Dp({encoded:i,encoding:a});return xu(s.type)}),Qn(this,"getPayloadSenderPublicKey",(i,a=Ci)=>{const s=Dp({encoded:i,encoding:a});return s.senderPublicKey?xi(s.senderPublicKey,ii):void 0}),this.core=e,this.logger=ra(n,this.name),this.keychain=r||new YOe(this.core,this.logger)}get context(){return Ri(this.logger)}async setPrivateKey(e,n){return await this.keychain.set(e,n),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(zP)}catch{e=tb(),await this.keychain.set(zP,e)}return ZOe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}};var eMe=Object.defineProperty,tMe=Object.defineProperties,nMe=Object.getOwnPropertyDescriptors,eR=Object.getOwnPropertySymbols,rMe=Object.prototype.hasOwnProperty,iMe=Object.prototype.propertyIsEnumerable,ob=(t,e,n)=>e in t?eMe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,aMe=(t,e)=>{for(var n in e||(e={}))rMe.call(e,n)&&ob(t,n,e[n]);if(eR)for(var n of eR(e))iMe.call(e,n)&&ob(t,n,e[n]);return t},sMe=(t,e)=>tMe(t,nMe(e)),Mi=(t,e,n)=>ob(t,typeof e!="symbol"?e+"":e,n);let oMe=class extends lPe{constructor(e,n){super(e,n),this.logger=e,this.core=n,Mi(this,"messages",new Map),Mi(this,"messagesWithoutClientAck",new Map),Mi(this,"name",YPe),Mi(this,"version",JPe),Mi(this,"initialized",!1),Mi(this,"storagePrefix",qs),Mi(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const r=await this.getRelayerMessages();typeof r<"u"&&(this.messages=r);const i=await this.getRelayerMessagesWithoutClientAck();typeof i<"u"&&(this.messagesWithoutClientAck=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(r){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(r)}finally{this.initialized=!0}}}),Mi(this,"set",async(r,i,a)=>{this.isInitialized();const s=pa(i);let o=this.messages.get(r);if(typeof o>"u"&&(o={}),typeof o[s]<"u")return s;if(o[s]=i,this.messages.set(r,o),a===ng.inbound){const c=this.messagesWithoutClientAck.get(r)||{};this.messagesWithoutClientAck.set(r,sMe(aMe({},c),{[s]:i}))}return await this.persist(),s}),Mi(this,"get",r=>{this.isInitialized();let i=this.messages.get(r);return typeof i>"u"&&(i={}),i}),Mi(this,"getWithoutAck",r=>{this.isInitialized();const i={};for(const a of r){const s=this.messagesWithoutClientAck.get(a)||{};i[a]=Object.values(s)}return i}),Mi(this,"has",(r,i)=>{this.isInitialized();const a=this.get(r),s=pa(i);return typeof a[s]<"u"}),Mi(this,"ack",async(r,i)=>{this.isInitialized();const a=this.messagesWithoutClientAck.get(r);if(typeof a>"u")return;const s=pa(i);delete a[s],Object.keys(a).length===0?this.messagesWithoutClientAck.delete(r):this.messagesWithoutClientAck.set(r,a),await this.persist()}),Mi(this,"del",async r=>{this.isInitialized(),this.messages.delete(r),this.messagesWithoutClientAck.delete(r),await this.persist()}),this.logger=ra(e,this.name),this.core=n}get context(){return Ri(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,H8(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,H8(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?W8(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?W8(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}};var cMe=Object.defineProperty,lMe=Object.defineProperties,uMe=Object.getOwnPropertyDescriptors,tR=Object.getOwnPropertySymbols,dMe=Object.prototype.hasOwnProperty,fMe=Object.prototype.propertyIsEnumerable,cb=(t,e,n)=>e in t?cMe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ld=(t,e)=>{for(var n in e||(e={}))dMe.call(e,n)&&cb(t,n,e[n]);if(tR)for(var n of tR(e))fMe.call(e,n)&&cb(t,n,e[n]);return t},nR=(t,e)=>lMe(t,uMe(e)),ca=(t,e,n)=>cb(t,typeof e!="symbol"?e+"":e,n);let hMe=class extends uPe{constructor(e,n){super(e,n),this.relayer=e,this.logger=n,ca(this,"events",new Sa.EventEmitter),ca(this,"name",QPe),ca(this,"queue",new Map),ca(this,"publishTimeout",Oe.toMiliseconds(Oe.ONE_MINUTE)),ca(this,"initialPublishTimeout",Oe.toMiliseconds(Oe.ONE_SECOND*15)),ca(this,"needsTransportRestart",!1),ca(this,"publish",async(r,i,a)=>{var s,o,c,l,u;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:r,message:i,opts:a}});const d=a?.ttl||XPe,f=a?.prompt||!1,h=a?.tag||0,p=a?.id||Zc().toString(),g=Ld(Vy().protocol),y={id:p,method:a?.publishMethod||g.publish,params:ld({topic:r,message:i,ttl:d,prompt:f,tag:h,attestation:a?.attestation},a?.tvf)},v=`Failed to publish payload, please try again. id:${p} tag:${h}`;try{cr((s=y.params)==null?void 0:s.prompt)&&((o=y.params)==null||delete o.prompt),cr((c=y.params)==null?void 0:c.tag)&&((l=y.params)==null||delete l.tag);const b=new Promise(async w=>{const _=({id:C})=>{var x;((x=y.id)==null?void 0:x.toString())===C.toString()&&(this.removeRequestFromQueue(C),this.relayer.events.removeListener($n.publish,_),w())};this.relayer.events.on($n.publish,_);const E=$s(new Promise((C,x)=>{this.rpcPublish(y,a).then(C).catch($=>{this.logger.warn($,$?.message),x($)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${p} tag:${h}`);try{await E,this.events.removeListener($n.publish,_)}catch(C){this.queue.set(p,{request:y,opts:a,attempt:1}),this.logger.warn(C,C?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:p,topic:r,message:i,opts:a}}),await $s(b,this.publishTimeout,v)}catch(b){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(b),(u=a?.internal)!=null&&u.throwOnFailedPublish)throw b}finally{this.queue.delete(p)}}),ca(this,"publishCustom",async r=>{var i,a,s,o,c;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:r});const{payload:l,opts:u={}}=r,{attestation:d,tvf:f,publishMethod:h,prompt:p,tag:g,ttl:y=Oe.FIVE_MINUTES}=u,v=u.id||Zc().toString(),b=Ld(Vy().protocol),w=h||b.publish,_={id:v,method:w,params:ld(nR(ld({},l),{ttl:y,prompt:p,tag:g,attestation:d}),f)},E=`Failed to publish custom payload, please try again. id:${v} tag:${g}`;try{cr((i=_.params)==null?void 0:i.prompt)&&((a=_.params)==null||delete a.prompt),cr((s=_.params)==null?void 0:s.tag)&&((o=_.params)==null||delete o.tag);const C=new Promise(async x=>{const $=({id:U})=>{var O;((O=_.id)==null?void 0:O.toString())===U.toString()&&(this.removeRequestFromQueue(U),this.relayer.events.removeListener($n.publish,$),x())};this.relayer.events.on($n.publish,$);const T=$s(new Promise((U,O)=>{this.rpcPublish(_,u).then(U).catch(F=>{this.logger.warn(F,F?.message),O(F)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${w} id:${v} tag:${g}`);try{await T,this.events.removeListener($n.publish,$)}catch(U){this.queue.set(v,{request:_,opts:u,attempt:1}),this.logger.warn(U,U?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:v,payload:l,opts:u}}),await $s(C,this.publishTimeout,E)}catch(C){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(C),(c=u?.internal)!=null&&c.throwOnFailedPublish)throw C}finally{this.queue.delete(v)}}),ca(this,"on",(r,i)=>{this.events.on(r,i)}),ca(this,"once",(r,i)=>{this.events.once(r,i)}),ca(this,"off",(r,i)=>{this.events.off(r,i)}),ca(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.relayer=e,this.logger=ra(n,this.name),this.registerEventListeners()}get context(){return Ri(this.logger)}async rpcPublish(e,n){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});const r=await this.relayer.request(e);return this.relayer.events.emit($n.publish,ld(ld({},e),n)),this.logger.debug("Successfully Published Payload"),r}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,n)=>{var r;const i=e.attempt+1;this.queue.set(n,nR(ld({},e),{attempt:i})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${(r=e.request.params)==null?void 0:r.tag}, attempt: ${i}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Uu.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit($n.connection_stalled);return}this.checkQueue()}),this.relayer.on($n.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}};var pMe=Object.defineProperty,gMe=(t,e,n)=>e in t?pMe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ud=(t,e,n)=>gMe(t,typeof e!="symbol"?e+"":e,n);let yMe=class{constructor(){ud(this,"map",new Map),ud(this,"set",(e,n)=>{const r=this.get(e);this.exists(e,n)||this.map.set(e,[...r,n])}),ud(this,"get",e=>this.map.get(e)||[]),ud(this,"exists",(e,n)=>this.get(e).includes(n)),ud(this,"delete",(e,n)=>{if(typeof n>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const r=this.get(e);if(!this.exists(e,n))return;const i=r.filter(a=>a!==n);if(!i.length){this.map.delete(e);return}this.map.set(e,i)}),ud(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}};var mMe=Object.defineProperty,vMe=Object.defineProperties,wMe=Object.getOwnPropertyDescriptors,rR=Object.getOwnPropertySymbols,bMe=Object.prototype.hasOwnProperty,_Me=Object.prototype.propertyIsEnumerable,lb=(t,e,n)=>e in t?mMe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Kf=(t,e)=>{for(var n in e||(e={}))bMe.call(e,n)&&lb(t,n,e[n]);if(rR)for(var n of rR(e))_Me.call(e,n)&&lb(t,n,e[n]);return t},S4=(t,e)=>vMe(t,wMe(e)),zt=(t,e,n)=>lb(t,typeof e!="symbol"?e+"":e,n);let CMe=class extends hPe{constructor(e,n){super(e,n),this.relayer=e,this.logger=n,zt(this,"subscriptions",new Map),zt(this,"topicMap",new yMe),zt(this,"events",new Sa.EventEmitter),zt(this,"name",sRe),zt(this,"version",oRe),zt(this,"pending",new Map),zt(this,"cached",[]),zt(this,"initialized",!1),zt(this,"storagePrefix",qs),zt(this,"subscribeTimeout",Oe.toMiliseconds(Oe.ONE_MINUTE)),zt(this,"initialSubscribeTimeout",Oe.toMiliseconds(Oe.ONE_SECOND*15)),zt(this,"clientId"),zt(this,"batchSubscribeTopicsLimit",500),zt(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),zt(this,"subscribe",async(r,i)=>{var a;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}});try{const s=Vy(i),o={topic:r,relay:s,transportType:i?.transportType};(a=i?.internal)!=null&&a.skipSubscribe||this.pending.set(r,o);const c=await this.rpcSubscribe(r,s,i);return typeof c=="string"&&(this.onSubscribe(c,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:r,opts:i}})),c}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}}),zt(this,"unsubscribe",async(r,i)=>{this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(r,i.id,i):await this.unsubscribeByTopic(r,i)}),zt(this,"isSubscribed",r=>new Promise(i=>{i(this.topicMap.topics.includes(r))})),zt(this,"isKnownTopic",r=>new Promise(i=>{i(this.topicMap.topics.includes(r)||this.pending.has(r)||this.cached.some(a=>a.topic===r))})),zt(this,"on",(r,i)=>{this.events.on(r,i)}),zt(this,"once",(r,i)=>{this.events.once(r,i)}),zt(this,"off",(r,i)=>{this.events.off(r,i)}),zt(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),zt(this,"start",async()=>{await this.onConnect()}),zt(this,"stop",async()=>{await this.onDisconnect()}),zt(this,"restart",async()=>{await this.restore(),await this.onRestart()}),zt(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const r=[];this.pending.forEach(i=>{r.push(i)}),await this.batchSubscribe(r)}),zt(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(Uu.pulse,async()=>{await this.checkPending()}),this.events.on(Hi.created,async r=>{const i=Hi.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()}),this.events.on(Hi.deleted,async r=>{const i=Hi.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()})}),this.relayer=e,this.logger=ra(n,this.name),this.clientId=""}get context(){return Ri(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,n){let r=!1;try{r=this.getSubscription(e).topic===n}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,n){const r=this.topicMap.get(e);await Promise.all(r.map(async i=>await this.unsubscribeById(e,i,n)))}async unsubscribeById(e,n,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:n,opts:r}});try{const i=Vy(r);await this.restartToComplete({topic:e,id:n,relay:i}),await this.rpcUnsubscribe(e,n,i);const a=ln("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,n,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:n,opts:r}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,n,r){var i,a;const s=await this.getSubscriptionId(e);if((i=r?.internal)!=null&&i.skipSubscribe)return s;(!r||r?.transportType===on.relay)&&await this.restartToComplete({topic:e,id:e,relay:n});const o={method:Ld(n.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o});const c=(a=r?.internal)==null?void 0:a.throwOnFailedPublish;try{if(r?.transportType===on.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(o).catch(d=>this.logger.warn(d))},Oe.toMiliseconds(Oe.ONE_SECOND)),s;const l=new Promise(async d=>{const f=h=>{h.topic===e&&(this.events.removeListener(Hi.created,f),d(h.id))};this.events.on(Hi.created,f);try{const h=await $s(new Promise((p,g)=>{this.relayer.request(o).catch(y=>{this.logger.warn(y,y?.message),g(y)}).then(p)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(Hi.created,f),d(h)}catch{}}),u=await $s(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!u&&c)throw new Error(`Subscribing to ${e} failed, please try again`);return u?s:null}catch(l){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit($n.connection_stalled),c)throw l}return null}async rpcBatchSubscribe(e){if(!e.length)return;const n=e[0].relay,r={method:Ld(n.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{await await $s(new Promise(i=>{this.relayer.request(r).catch(a=>this.logger.warn(a)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit($n.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const n=e[0].relay,r={method:Ld(n.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});let i;try{i=await await $s(new Promise((a,s)=>{this.relayer.request(r).catch(o=>{this.logger.warn(o),s(o)}).then(a)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit($n.connection_stalled)}return i}rpcUnsubscribe(e,n,r){const i={method:Ld(r.protocol).unsubscribe,params:{topic:e,id:n}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,n){this.setSubscription(e,S4(Kf({},n),{id:e})),this.pending.delete(n.topic)}onBatchSubscribe(e){e.length&&e.forEach(n=>{this.setSubscription(n.id,Kf({},n)),this.pending.delete(n.topic)})}async onUnsubscribe(e,n,r){this.events.removeAllListeners(n),this.hasSubscription(n,e)&&this.deleteSubscription(n,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,n){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:n}),this.addSubscription(e,n)}addSubscription(e,n){this.subscriptions.set(e,Kf({},n)),this.topicMap.set(n.topic,e),this.events.emit(Hi.created,n)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const n=this.subscriptions.get(e);if(!n){const{message:r}=Re("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return n}deleteSubscription(e,n){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:n});const r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(Hi.deleted,S4(Kf({},r),{reason:n}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Hi.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],n=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<n;r++){const i=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(i)}}this.events.emit(Hi.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(n=>{var r;return n.topic===((r=this.subscriptions.get(n.id))==null?void 0:r.topic)})){const{message:n}=Re("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async n=>S4(Kf({},n),{id:await this.getSubscriptionId(n.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const n=await this.rpcBatchFetchMessages(e);n&&n.messages&&(await RIe(Oe.toMiliseconds(Oe.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(n.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return pa(e+await this.getClientId())}};var EMe=Object.defineProperty,iR=Object.getOwnPropertySymbols,SMe=Object.prototype.hasOwnProperty,AMe=Object.prototype.propertyIsEnumerable,ub=(t,e,n)=>e in t?EMe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,aR=(t,e)=>{for(var n in e||(e={}))SMe.call(e,n)&&ub(t,n,e[n]);if(iR)for(var n of iR(e))AMe.call(e,n)&&ub(t,n,e[n]);return t},Rt=(t,e,n)=>ub(t,typeof e!="symbol"?e+"":e,n);let xMe=class extends dPe{constructor(e){var n;super(e),Rt(this,"protocol","wc"),Rt(this,"version",2),Rt(this,"core"),Rt(this,"logger"),Rt(this,"events",new Sa.EventEmitter),Rt(this,"provider"),Rt(this,"messages"),Rt(this,"subscriber"),Rt(this,"publisher"),Rt(this,"name",tRe),Rt(this,"transportExplicitlyClosed",!1),Rt(this,"initialized",!1),Rt(this,"connectionAttemptInProgress",!1),Rt(this,"relayUrl"),Rt(this,"projectId"),Rt(this,"packageName"),Rt(this,"bundleId"),Rt(this,"hasExperiencedNetworkDisruption",!1),Rt(this,"pingTimeout"),Rt(this,"heartBeatTimeout",Oe.toMiliseconds(Oe.THIRTY_SECONDS+Oe.FIVE_SECONDS)),Rt(this,"reconnectTimeout"),Rt(this,"connectPromise"),Rt(this,"reconnectInProgress",!1),Rt(this,"requestsInFlight",[]),Rt(this,"connectTimeout",Oe.toMiliseconds(Oe.ONE_SECOND*15)),Rt(this,"request",async r=>{var i,a;this.logger.debug("Publishing Request Payload");const s=r.id||Zc().toString();await this.toEstablishConnection();try{this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - publishing...");const o=`${s}:${((a=r.params)==null?void 0:a.tag)||""}`;this.requestsInFlight.push(o);const c=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==o),c}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}}),Rt(this,"resetPingTimeout",()=>{Ny()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,i,a,s;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(s=(a=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null?void 0:a.terminate)==null||s.call(a)}catch(o){this.logger.warn(o,o?.message)}},this.heartBeatTimeout))}),Rt(this,"onPayloadHandler",r=>{this.onProviderPayload(r),this.resetPingTimeout()}),Rt(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected ð"),this.startPingTimeout(),this.events.emit($n.connect)}),Rt(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected ð"),this.requestsInFlight=[],this.onProviderDisconnect()}),Rt(this,"onProviderErrorHandler",r=>{this.logger.fatal(`Fatal socket error: ${r.message}`),this.events.emit($n.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),Rt(this,"registerProviderListeners",()=>{this.provider.on(oa.payload,this.onPayloadHandler),this.provider.on(oa.connect,this.onConnectHandler),this.provider.on(oa.disconnect,this.onDisconnectHandler),this.provider.on(oa.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger=MS({logger:(n=e.logger)!=null?n:eRe,name:this.name}),this.messages=new oMe(this.logger,e.core),this.subscriber=new CMe(this,this.logger),this.publisher=new hMe(this,this.logger),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||aZ,mIe()?this.packageName=U$():vIe()&&(this.bundleId=U$()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return Ri(this.logger)}get connected(){var e,n,r;return((r=(n=(e=this.provider)==null?void 0:e.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===1||!1}get connecting(){var e,n,r;return((r=(n=(e=this.provider)==null?void 0:e.connection)==null?void 0:n.socket)==null?void 0:r.readyState)===0||this.connectPromise!==void 0||!1}async publish(e,n,r){this.isInitialized(),await this.publisher.publish(e,n,r),await this.recordMessageEvent({topic:e,message:n,publishedAt:Date.now(),transportType:on.relay},ng.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,n){var r,i,a;this.isInitialized(),(!(n!=null&&n.transportType)||n?.transportType==="relay")&&await this.toEstablishConnection();const s=typeof((r=n?.internal)==null?void 0:r.throwOnFailedPublish)>"u"?!0:(i=n?.internal)==null?void 0:i.throwOnFailedPublish;let o=((a=this.subscriber.topicMap.get(e))==null?void 0:a[0])||"",c;const l=u=>{u.topic===e&&(this.subscriber.off(Hi.created,l),c())};return await Promise.all([new Promise(u=>{c=u,this.subscriber.on(Hi.created,l)}),new Promise(async(u,d)=>{o=await this.subscriber.subscribe(e,aR({internal:{throwOnFailedPublish:s}},n)).catch(f=>{s&&d(f)})||o,u()})]),o}async unsubscribe(e,n){this.isInitialized(),await this.subscriber.unsubscribe(e,n)}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await $s(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(n,r)=>{await this.connect(e).then(n).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await $P())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const n=e.sort((r,i)=>r.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${n.length} message events sorted`);for(const r of n)try{await this.onMessageEvent(r)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+i?.message)}this.logger.trace(`Batch of ${n.length} message events processed`)}async onLinkMessageEvent(e,n){const{topic:r}=e;if(!n.sessionExists){const i=Un(Oe.FIVE_MINUTES),a={topic:r,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,a)}this.events.emit($n.message,e),await this.recordMessageEvent(e,ng.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let n=1;for(;n<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${n}...`),await this.createProvider(),await new Promise(async(r,i)=>{const a=()=>{i(new Error("Connection interrupted while trying to connect"))};this.provider.once(oa.disconnect,a),await $s(new Promise((s,o)=>{this.provider.connect().then(s).catch(o)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{i(s)}).finally(()=>{this.provider.off(oa.disconnect,a),clearTimeout(this.reconnectTimeout)}),await new Promise(async(s,o)=>{const c=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(oa.disconnect,c),await this.subscriber.start().then(s).catch(o).finally(()=>{this.provider.off(oa.disconnect,c)})}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){await this.subscriber.stop();const i=r;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${n}`);break}await new Promise(r=>setTimeout(r,Oe.toMiliseconds(n*1))),n++}}startPingTimeout(){var e,n,r,i,a;if(Ny())try{(n=(e=this.provider)==null?void 0:e.connection)!=null&&n.socket&&((a=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null||a.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(s){this.logger.warn(s,s?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new FS(new VPe(EIe({sdkVersion:ib,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,n){const{topic:r,message:i}=e;await this.messages.set(r,i,n)}async shouldIgnoreMessageEvent(e){const{topic:n,message:r}=e;if(!r||r.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(n))return this.logger.warn(`Ignoring message for unknown topic ${n}`),!0;const i=this.messages.has(n,r);return i&&this.logger.warn(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),DS(e)){if(!e.method.endsWith(nRe))return;const n=e.params,{topic:r,message:i,publishedAt:a,attestation:s}=n.data,o={topic:r,message:i,publishedAt:a,transportType:on.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(aR({type:"event",event:n.id},o)),this.events.emit(n.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else Lv(e)&&this.events.emit($n.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,ng.inbound),this.events.emit($n.message,e))}async acknowledgePayload(e){const n=Fp(e.id,!0);await this.provider.connection.send(n)}unregisterProviderListeners(){this.provider.off(oa.payload,this.onPayloadHandler),this.provider.off(oa.connect,this.onConnectHandler),this.provider.off(oa.disconnect,this.onDisconnectHandler),this.provider.off(oa.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await $P();m$e(async n=>{e!==n&&(e=n,n?await this.transportOpen().catch(r=>this.logger.error(r,r?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Uu.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&b$e())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(n){this.logger.warn(n,n?.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit($n.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},Oe.toMiliseconds(rRe)))))}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}};function IMe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function sR(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function oR(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const TMe="[object RegExp]",LMe="[object String]",kMe="[object Number]",$Me="[object Boolean]",cR="[object Arguments]",PMe="[object Symbol]",RMe="[object Date]",OMe="[object Map]",MMe="[object Set]",NMe="[object Array]",DMe="[object Function]",FMe="[object ArrayBuffer]",A4="[object Object]",UMe="[object Error]",jMe="[object DataView]",BMe="[object Uint8Array]",VMe="[object Uint8ClampedArray]",HMe="[object Uint16Array]",WMe="[object Uint32Array]",qMe="[object BigUint64Array]",zMe="[object Int8Array]",ZMe="[object Int16Array]",KMe="[object Int32Array]",GMe="[object BigInt64Array]",YMe="[object Float32Array]",JMe="[object Float64Array]";function XMe(){}function lR(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function QMe(t,e,n){return ph(t,e,void 0,void 0,void 0,void 0,n)}function ph(t,e,n,r,i,a,s){const o=s(t,e,n,r,i,a);if(o!==void 0)return o;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return Wh(t,e,a,s)}return Wh(t,e,a,s)}function Wh(t,e,n,r){if(Object.is(t,e))return!0;let i=oR(t),a=oR(e);if(i===cR&&(i=A4),a===cR&&(a=A4),i!==a)return!1;switch(i){case LMe:return t.toString()===e.toString();case kMe:{const c=t.valueOf(),l=e.valueOf();return IMe(c,l)}case $Me:case RMe:case PMe:return Object.is(t.valueOf(),e.valueOf());case TMe:return t.source===e.source&&t.flags===e.flags;case DMe:return t===e}n=n??new Map;const s=n.get(t),o=n.get(e);if(s!=null&&o!=null)return s===e;n.set(t,e),n.set(e,t);try{switch(i){case OMe:{if(t.size!==e.size)return!1;for(const[c,l]of t.entries())if(!e.has(c)||!ph(l,e.get(c),c,t,e,n,r))return!1;return!0}case MMe:{if(t.size!==e.size)return!1;const c=Array.from(t.values()),l=Array.from(e.values());for(let u=0;u<c.length;u++){const d=c[u],f=l.findIndex(h=>ph(d,h,void 0,t,e,n,r));if(f===-1)return!1;l.splice(f,1)}return!0}case NMe:case BMe:case VMe:case HMe:case WMe:case qMe:case zMe:case ZMe:case KMe:case GMe:case YMe:case JMe:{if(typeof De<"u"&&De.isBuffer(t)!==De.isBuffer(e)||t.length!==e.length)return!1;for(let c=0;c<t.length;c++)if(!ph(t[c],e[c],c,t,e,n,r))return!1;return!0}case FMe:return t.byteLength!==e.byteLength?!1:Wh(new Uint8Array(t),new Uint8Array(e),n,r);case jMe:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Wh(new Uint8Array(t),new Uint8Array(e),n,r);case UMe:return t.name===e.name&&t.message===e.message;case A4:{if(!(Wh(t.constructor,e.constructor,n,r)||lR(t)&&lR(e)))return!1;const c=[...Object.keys(t),...sR(t)],l=[...Object.keys(e),...sR(e)];if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++){const d=c[u],f=t[d];if(!Object.hasOwn(e,d))return!1;const h=e[d];if(!ph(f,h,d,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function eNe(t,e){return QMe(t,e,XMe)}var tNe=Object.defineProperty,uR=Object.getOwnPropertySymbols,nNe=Object.prototype.hasOwnProperty,rNe=Object.prototype.propertyIsEnumerable,db=(t,e,n)=>e in t?tNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,dR=(t,e)=>{for(var n in e||(e={}))nNe.call(e,n)&&db(t,n,e[n]);if(uR)for(var n of uR(e))rNe.call(e,n)&&db(t,n,e[n]);return t},yi=(t,e,n)=>db(t,typeof e!="symbol"?e+"":e,n);let Bu=class extends fPe{constructor(e,n,r,i=qs,a=void 0){super(e,n,r,i),this.core=e,this.logger=n,this.name=r,yi(this,"map",new Map),yi(this,"version",iRe),yi(this,"cached",[]),yi(this,"initialized",!1),yi(this,"getKey"),yi(this,"storagePrefix",qs),yi(this,"recentlyDeleted",[]),yi(this,"recentlyDeletedLimit",200),yi(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{this.getKey&&s!==null&&!cr(s)?this.map.set(this.getKey(s),s):Kke(s)?this.map.set(s.id,s):Gke(s)&&this.map.set(s.topic,s)}),this.cached=[],this.initialized=!0)}),yi(this,"set",async(s,o)=>{this.isInitialized(),this.map.has(s)?await this.update(s,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:o}),this.map.set(s,o),await this.persist())}),yi(this,"get",s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s))),yi(this,"getAll",s=>(this.isInitialized(),s?this.values.filter(o=>Object.keys(s).every(c=>eNe(o[c],s[c]))):this.values)),yi(this,"update",async(s,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:o});const c=dR(dR({},this.getData(s)),o);this.map.set(s,c),await this.persist()}),yi(this,"delete",async(s,o)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:o}),this.map.delete(s),this.addToRecentlyDeleted(s),await this.persist())}),this.logger=ra(n,this.name),this.storagePrefix=i,this.getKey=a}get context(){return Ri(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const n=this.map.get(e);if(!n){if(this.recentlyDeleted.includes(e)){const{message:i}=Re("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:r}=Re("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(r),new Error(r)}return n}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:n}=Re("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}};var iNe=Object.defineProperty,aNe=(t,e,n)=>e in t?iNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,St=(t,e,n)=>aNe(t,typeof e!="symbol"?e+"":e,n);let sNe=class{constructor(e,n){this.core=e,this.logger=n,St(this,"name",cRe),St(this,"version",lRe),St(this,"events",new J_),St(this,"pairings"),St(this,"initialized",!1),St(this,"storagePrefix",qs),St(this,"ignoredPayloadTypes",[Oo]),St(this,"registeredMethods",[]),St(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),St(this,"register",({methods:r})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...r])]}),St(this,"create",async r=>{this.isInitialized();const i=tb(),a=await this.core.crypto.setSymKey(i),s=Un(Oe.FIVE_MINUTES),o={protocol:iZ},c={topic:a,expiry:s,relay:o,active:!1,methods:r?.methods},l=CP({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:i,relay:o,expiryTimestamp:s,methods:r?.methods});return this.events.emit(Vl.create,c),this.core.expirer.set(a,s),await this.pairings.set(a,c),await this.core.relayer.subscribe(a,{transportType:r?.transportType,internal:r?.internal}),{topic:a,uri:l}}),St(this,"pair",async r=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:r?.uri,trace:[gs.pairing_started]}});this.isValidPair(r,i);const{topic:a,symKey:s,relay:o,expiryTimestamp:c,methods:l}=_P(r.uri);i.props.properties.topic=a,i.addTrace(gs.pairing_uri_validation_success),i.addTrace(gs.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(a)){if(u=this.pairings.get(a),i.addTrace(gs.existing_pairing),u.active)throw i.setError(ho.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);i.addTrace(gs.pairing_not_expired)}const d=c||Un(Oe.FIVE_MINUTES),f={topic:a,relay:o,expiry:d,active:!1,methods:l};this.core.expirer.set(a,d),await this.pairings.set(a,f),i.addTrace(gs.store_new_pairing),r.activatePairing&&await this.activate({topic:a}),this.events.emit(Vl.create,f),i.addTrace(gs.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(s,a),i.addTrace(gs.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(ho.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:o})}catch(h){throw i.setError(ho.subscribe_pairing_topic_failure),h}return i.addTrace(gs.subscribe_pairing_topic_success),f}),St(this,"activate",async({topic:r})=>{this.isInitialized();const i=Un(Oe.FIVE_MINUTES);this.core.expirer.set(r,i),await this.pairings.update(r,{active:!0,expiry:i})}),St(this,"ping",async r=>{this.isInitialized(),await this.isValidPing(r),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:i}=r;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:o,reject:c}=Ol();this.events.once(Nt("pairing_ping",a),({error:l})=>{l?c(l):o()}),await s()}}),St(this,"updateExpiry",async({topic:r,expiry:i})=>{this.isInitialized(),await this.pairings.update(r,{expiry:i})}),St(this,"updateMetadata",async({topic:r,metadata:i})=>{this.isInitialized(),await this.pairings.update(r,{peerMetadata:i})}),St(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),St(this,"disconnect",async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:i}=r;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",ln("USER_DISCONNECTED")),await this.deletePairing(i))}),St(this,"formatUriFromPairing",r=>{this.isInitialized();const{topic:i,relay:a,expiry:s,methods:o}=r,c=this.core.crypto.keychain.get(i);return CP({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:a,expiryTimestamp:s,methods:o})}),St(this,"sendRequest",async(r,i,a)=>{const s=Wa(i,a),o=await this.core.crypto.encode(r,s),c=zf[i].req;return this.core.history.set(r,s),this.core.relayer.publish(r,o,c),s.id}),St(this,"sendResult",async(r,i,a)=>{const s=Fp(r,a),o=await this.core.crypto.encode(i,s),c=(await this.core.history.get(i,r)).request.method,l=zf[c].res;await this.core.relayer.publish(i,o,l),await this.core.history.resolve(s)}),St(this,"sendError",async(r,i,a)=>{const s=Tv(r,a),o=await this.core.crypto.encode(i,s),c=(await this.core.history.get(i,r)).request.method,l=zf[c]?zf[c].res:zf.unregistered_method.res;await this.core.relayer.publish(i,o,l),await this.core.history.resolve(s)}),St(this,"deletePairing",async(r,i)=>{await this.core.relayer.unsubscribe(r),await Promise.all([this.pairings.delete(r,ln("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(r),i?Promise.resolve():this.core.expirer.del(r)])}),St(this,"cleanup",async()=>{const r=this.pairings.getAll().filter(i=>Ss(i.expiry));await Promise.all(r.map(i=>this.deletePairing(i.topic)))}),St(this,"onRelayEventRequest",async r=>{const{topic:i,payload:a}=r;switch(a.method){case"wc_pairingPing":return await this.onPairingPingRequest(i,a);case"wc_pairingDelete":return await this.onPairingDeleteRequest(i,a);default:return await this.onUnknownRpcMethodRequest(i,a)}}),St(this,"onRelayEventResponse",async r=>{const{topic:i,payload:a}=r,s=(await this.core.history.get(i,a.id)).request.method;switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(s)}}),St(this,"onPairingPingRequest",async(r,i)=>{const{id:a}=i;try{this.isValidPing({topic:r}),await this.sendResult(a,r,!0),this.events.emit(Vl.ping,{id:a,topic:r})}catch(s){await this.sendError(a,r,s),this.logger.error(s)}}),St(this,"onPairingPingResponse",(r,i)=>{const{id:a}=i;setTimeout(()=>{bs(i)?this.events.emit(Nt("pairing_ping",a),{}):ga(i)&&this.events.emit(Nt("pairing_ping",a),{error:i.error})},500)}),St(this,"onPairingDeleteRequest",async(r,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:r}),await this.deletePairing(r),this.events.emit(Vl.delete,{id:a,topic:r})}catch(s){await this.sendError(a,r,s),this.logger.error(s)}}),St(this,"onUnknownRpcMethodRequest",async(r,i)=>{const{id:a,method:s}=i;try{if(this.registeredMethods.includes(s))return;const o=ln("WC_METHOD_UNSUPPORTED",s);await this.sendError(a,r,o),this.logger.error(o)}catch(o){await this.sendError(a,r,o),this.logger.error(o)}}),St(this,"onUnknownRpcMethodResponse",r=>{this.registeredMethods.includes(r)||this.logger.error(ln("WC_METHOD_UNSUPPORTED",r))}),St(this,"isValidPair",(r,i)=>{var a;if(!vi(r)){const{message:o}=Re("MISSING_OR_INVALID",`pair() params: ${r}`);throw i.setError(ho.malformed_pairing_uri),new Error(o)}if(!Zke(r.uri)){const{message:o}=Re("MISSING_OR_INVALID",`pair() uri: ${r.uri}`);throw i.setError(ho.malformed_pairing_uri),new Error(o)}const s=_P(r?.uri);if(!((a=s?.relay)!=null&&a.protocol)){const{message:o}=Re("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(ho.malformed_pairing_uri),new Error(o)}if(!(s!=null&&s.symKey)){const{message:o}=Re("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(ho.malformed_pairing_uri),new Error(o)}if(s!=null&&s.expiryTimestamp&&Oe.toMiliseconds(s?.expiryTimestamp)<Date.now()){i.setError(ho.pairing_expired);const{message:o}=Re("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(o)}}),St(this,"isValidPing",async r=>{if(!vi(r)){const{message:a}=Re("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(a)}const{topic:i}=r;await this.isValidPairingTopic(i)}),St(this,"isValidDisconnect",async r=>{if(!vi(r)){const{message:a}=Re("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(a)}const{topic:i}=r;await this.isValidPairingTopic(i)}),St(this,"isValidPairingTopic",async r=>{if(!Vn(r,!1)){const{message:i}=Re("MISSING_OR_INVALID",`pairing topic should be a string: ${r}`);throw new Error(i)}if(!this.pairings.keys.includes(r)){const{message:i}=Re("NO_MATCHING_KEY",`pairing topic doesn't exist: ${r}`);throw new Error(i)}if(Ss(this.pairings.get(r).expiry)){await this.deletePairing(r);const{message:i}=Re("EXPIRED",`pairing topic: ${r}`);throw new Error(i)}}),this.core=e,this.logger=ra(n,this.name),this.pairings=new Bu(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Ri(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on($n.message,async e=>{const{topic:n,message:r,transportType:i}=e;if(this.pairings.keys.includes(n)&&i!==on.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{const a=await this.core.crypto.decode(n,r);DS(a)?(this.core.history.set(n,a),await this.onRelayEventRequest({topic:n,payload:a})):Lv(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:n,payload:a}),this.core.history.delete(n,a.id)),await this.core.relayer.messages.ack(n,r)}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(da.expired,async e=>{const{topic:n}=Zq(e.target);n&&this.pairings.keys.includes(n)&&(await this.deletePairing(n,!0),this.events.emit(Vl.expire,{topic:n}))})}};var oNe=Object.defineProperty,cNe=(t,e,n)=>e in t?oNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,gr=(t,e,n)=>cNe(t,typeof e!="symbol"?e+"":e,n);let lNe=class extends cPe{constructor(e,n){super(e,n),this.core=e,this.logger=n,gr(this,"records",new Map),gr(this,"events",new Sa.EventEmitter),gr(this,"name",uRe),gr(this,"version",dRe),gr(this,"cac
102hed",[]),gr(this,"initialized",!1),gr(this,"storagePrefix",qs),gr(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.records.set(r.id,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),gr(this,"set",(r,i,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:r,request:i,chainId:a}),this.records.has(i.id))return;const s={id:i.id,topic:r,request:{method:i.method,params:i.params||null},chainId:a,expiry:Un(Oe.THIRTY_DAYS)};this.records.set(s.id,s),this.persist(),this.events.emit(Oa.created,s)}),gr(this,"resolve",async r=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:r}),!this.records.has(r.id))return;const i=await this.getRecord(r.id);typeof i.response>"u"&&(i.response=ga(r)?{error:r.error}:{result:r.result},this.records.set(i.id,i),this.persist(),this.events.emit(Oa.updated,i))}),gr(this,"get",async(r,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:r,id:i}),await this.getRecord(i))),gr(this,"delete",(r,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(a=>{if(a.topic===r){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(Oa.deleted,a)}}),this.persist()}),gr(this,"exists",async(r,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===r:!1)),gr(this,"on",(r,i)=>{this.events.on(r,i)}),gr(this,"once",(r,i)=>{this.events.once(r,i)}),gr(this,"off",(r,i)=>{this.events.off(r,i)}),gr(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=ra(n,this.name)}get context(){return Ri(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(n=>{if(typeof n.response<"u")return;const r={topic:n.topic,request:Wa(n.request.method,n.request.params,n.id),chainId:n.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const n=this.records.get(e);if(!n){const{message:r}=Re("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(r)}return n}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Oa.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:n}=Re("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Oa.created,e=>{const n=Oa.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.events.on(Oa.updated,e=>{const n=Oa.updated;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.events.on(Oa.deleted,e=>{const n=Oa.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,record:e})}),this.core.heartbeat.on(Uu.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(n=>{Oe.toMiliseconds(n.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${n.id}`),this.records.delete(n.id),this.events.emit(Oa.deleted,n,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}};var uNe=Object.defineProperty,dNe=(t,e,n)=>e in t?uNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rr=(t,e,n)=>dNe(t,typeof e!="symbol"?e+"":e,n);let fNe=class extends pPe{constructor(e,n){super(e,n),this.core=e,this.logger=n,Rr(this,"expirations",new Map),Rr(this,"events",new Sa.EventEmitter),Rr(this,"name",fRe),Rr(this,"version",hRe),Rr(this,"cac
102hed",[]),Rr(this,"initialized",!1),Rr(this,"storagePrefix",qs),Rr(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(r=>this.expirations.set(r.target,r)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Rr(this,"has",r=>{try{const i=this.formatTarget(r);return typeof this.getExpiration(i)<"u"}catch{return!1}}),Rr(this,"set",(r,i)=>{this.isInitialized();const a=this.formatTarget(r),s={target:a,expiry:i};this.expirations.set(a,s),this.checkExpiry(a,s),this.events.emit(da.created,{target:a,expiration:s})}),Rr(this,"get",r=>{this.isInitialized();const i=this.formatTarget(r);return this.getExpiration(i)}),Rr(this,"del",r=>{if(this.isInitialized(),this.has(r)){const i=this.formatTarget(r),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(da.deleted,{target:i,expiration:a})}}),Rr(this,"on",(r,i)=>{this.events.on(r,i)}),Rr(this,"once",(r,i)=>{this.events.once(r,i)}),Rr(this,"off",(r,i)=>{this.events.off(r,i)}),Rr(this,"removeListener",(r,i)=>{this.events.removeListener(r,i)}),this.logger=ra(n,this.name)}get context(){return Ri(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return SIe(e);if(typeof e=="number")return AIe(e);const{message:n}=Re("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(n)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(da.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:n}=Re("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(n),new Error(n)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const n=this.expirations.get(e);if(!n){const{message:r}=Re("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(r),new Error(r)}return n}checkExpiry(e,n){const{expiry:r}=n;Oe.toMiliseconds(r)-Date.now()<=0&&this.expire(e,n)}expire(e,n){this.expirations.delete(e),this.events.emit(da.expired,{target:e,expiration:n})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,n)=>this.checkExpiry(n,e))}registerEventListeners(){this.core.heartbeat.on(Uu.pulse,()=>this.checkExpirations()),this.events.on(da.created,e=>{const n=da.created;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()}),this.events.on(da.expired,e=>{const n=da.expired;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()}),this.events.on(da.deleted,e=>{const n=da.deleted;this.logger.info(`Emitting ${n}`),this.logger.debug({type:"event",event:n,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}};var hNe=Object.defineProperty,pNe=(t,e,n)=>e in t?hNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Dn=(t,e,n)=>pNe(t,typeof e!="symbol"?e+"":e,n);let gNe=class extends gPe{constructor(e,n,r){super(e,n,r),this.core=e,this.logger=n,this.store=r,Dn(this,"name",pRe),Dn(this,"abortController"),Dn(this,"isDevEnv"),Dn(this,"verifyUrlV3",y
vendor: 78,391 bytes, line 102
102Re),Dn(this,"storagePrefix",qs),Dn(this,"version",rZ),Dn(this,"publicKey"),Dn(this,"fetchPromise"),Dn(this,"init",async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Oe.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),Dn(this,"register",async i=>{if(!Q2()||this.isDevEnv)return;const a=window.location.origin,{id:s,decryptedId:o}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${s}&decryptedId=${o}`;try{const l=Eu(),u=this.startAbortTimer(Oe.ONE_SECOND*5),d=await new Promise((f,h)=>{const p=()=>{window.removeEventListener("message",y),l.body.removeChild(g),h("attestation aborted")};this.abortController.signal.addEventListener("abort",p);const g=l.createElement("iframe");g.src=c,g.style.display="none",g.addEventListener("error",p,{signal:this.abortController.signal});const y=v=>{if(v.data&&typeof v.data=="string")try{const b=JSON.parse(v.data);if(b.type==="verify_attestation"){if(U8(b.attestation).payload.id!==s)return;clearInterval(u),l.body.removeChild(g),this.abortController.signal.removeEventListener("abort",p),window.removeEventListener("message",y),f(b.attestation===null?"":b.attestation)}}catch(b){this.logger.warn(b)}};l.body.appendChild(g),window.addEventListener("message",y,{signal:this.abortController.signal})});return this.logger.debug(d,"jwt attestation"),d}catch(l){this.logger.warn(l)}return""}),Dn(this,"resolve",async i=>{if(this.isDevEnv)return"";const{attestationId:a,hash:s,encryptedId:o}=i;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(U8(a).payload.id!==o)return;const l=await this.isValidJwtAttestation(a);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!s)return;const c=this.getVerifyUrl(i?.verifyUrl);return this.fetchAttestation(s,c)}),Dn(this,"fetchAttestation",async(i,a)=>{this.logger.debug(`resolving attestation: ${i} from url: ${a}`);const s=this.startAbortTimer(Oe.ONE_SECOND*5),o=await fetch(`${a}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(s),o.status===200?await o.json():void 0}),Dn(this,"getVerifyUrl",i=>{let a=i||Hh;return mRe.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${Hh}`),a=Hh),a}),Dn(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(Oe.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await a.json()}catch(i){this.logger.warn(i)}}),Dn(this,"persistPublicKey",async i=>{this.logger.debug(i,"persisting public key to local storage"),await this.store.setItem(this.storeKey,i),this.publicKey=i}),Dn(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),Dn(this,"isValidJwtAttestation",async i=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(i,a)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}const s=await this.fetchAndPersistPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}}),Dn(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),Dn(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const s=await this.fetchPublicKey();s&&(await this.persistPublicKey(s),a(s))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i}),Dn(this,"validateAttestation",(i,a)=>{const s=bke(i,a.publicKey),o={hasExpired:Oe.toMiliseconds(s.exp)<Date.now(),payload:s};if(o.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:o.payload.origin,isScam:o.payload.isScam,isVerified:o.payload.isVerified}}),this.logger=ra(n,this.name),this.abortController=new AbortController,this.isDevEnv=ES(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return Ri(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Oe.toMiliseconds(e))}};var yNe=Object.defineProperty,mNe=(t,e,n)=>e in t?yNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fR=(t,e,n)=>mNe(t,typeof e!="symbol"?e+"":e,n);let vNe=class extends yPe{constructor(e,n){super(e,n),this.projectId=e,this.logger=n,fR(this,"context",vRe),fR(this,"registerDeviceToken",async r=>{const{clientId:i,token:a,notificationType:s,enableEncrypted:o=!1}=r,c=`${wRe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:s,token:a,always_raw:o})})}),this.logger=ra(n,this.context)}};var wNe=Object.defineProperty,hR=Object.getOwnPropertySymbols,bNe=Object.prototype.hasOwnProperty,_Ne=Object.prototype.propertyIsEnumerable,fb=(t,e,n)=>e in t?wNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gf=(t,e)=>{for(var n in e||(e={}))bNe.call(e,n)&&fb(t,n,e[n]);if(hR)for(var n of hR(e))_Ne.call(e,n)&&fb(t,n,e[n]);return t},er=(t,e,n)=>fb(t,typeof e!="symbol"?e+"":e,n);let CNe=class extends mPe{constructor(e,n,r=!0){super(e,n,r),this.core=e,this.logger=n,er(this,"context",_Re),er(this,"storagePrefix",qs),er(this,"storageVersion",bRe),er(this,"events",new Map),er(this,"shouldPersist",!1),er(this,"init",async()=>{if(!ES())try{const i={eventId:B$(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:qq(this.core.relayer.protocol,this.core.relayer.version,ib)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}}),er(this,"createEvent",i=>{const{event:a="ERROR",type:s="",properties:{topic:o,trace:c}}=i,l=B$(),u=this.core.projectId||"",d=Date.now(),f=Gf({eventId:l,timestamp:d,props:{event:a,type:s,properties:{topic:o,trace:c}},bundleId:u,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,f),this.shouldPersist=!0),f}),er(this,"getEvent",i=>{const{eventId:a,topic:s}=i;if(a)return this.events.get(a);const o=Array.from(this.events.values()).find(c=>c.props.properties.topic===s);if(o)return Gf(Gf({},o),this.setMethods(o.eventId))}),er(this,"deleteEvent",i=>{const{eventId:a}=i;this.events.delete(a),this.shouldPersist=!0}),er(this,"setEventListeners",()=>{this.core.heartbeat.on(Uu.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{Oe.fromMiliseconds(Date.now())-Oe.fromMiliseconds(i.timestamp)>CRe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})}),er(this,"setMethods",i=>({addTrace:a=>this.addTrace(i,a),setError:a=>this.setError(i,a)})),er(this,"addTrace",(i,a)=>{const s=this.events.get(i);s&&(s.props.properties.trace.push(a),this.events.set(i,s),this.shouldPersist=!0)}),er(this,"setError",(i,a)=>{const s=this.events.get(i);s&&(s.props.type=a,s.timestamp=Date.now(),this.events.set(i,s),this.shouldPersist=!0)}),er(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),er(this,"restore",async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(a=>{this.events.set(a.eventId,Gf(Gf({},a),this.setMethods(a.eventId)))})}catch(i){this.logger.warn(i)}}),er(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[a,s]of this.events)s.props.type&&i.push(s);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const a of i)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}}),er(this,"sendEvent",async i=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${ERe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${ib}${a}`,{method:"POST",body:JSON.stringify(i)})}),er(this,"getAppDomain",()=>Wq().url),this.logger=ra(n,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}};var ENe=Object.defineProperty,pR=Object.getOwnPropertySymbols,SNe=Object.prototype.hasOwnProperty,ANe=Object.prototype.propertyIsEnumerable,hb=(t,e,n)=>e in t?ENe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,gR=(t,e)=>{for(var n in e||(e={}))SNe.call(e,n)&&hb(t,n,e[n]);if(pR)for(var n of pR(e))ANe.call(e,n)&&hb(t,n,e[n]);return t},Jt=(t,e,n)=>hb(t,typeof e!="symbol"?e+"":e,n);let xNe=class vZ extends iPe{constructor(e){var n;super(e),Jt(this,"protocol",nZ),Jt(this,"version",rZ),Jt(this,"name",Wy),Jt(this,"relayUrl"),Jt(this,"projectId"),Jt(this,"customStoragePrefix"),Jt(this,"events",new Sa.EventEmitter),Jt(this,"logger"),Jt(this,"heartbeat"),Jt(this,"relayer"),Jt(this,"crypto"),Jt(this,"storage"),Jt(this,"history"),Jt(this,"expirer"),Jt(this,"pairing"),Jt(this,"verify"),Jt(this,"echoClient"),Jt(this,"linkModeSupportedApps"),Jt(this,"eventClient"),Jt(this,"initialized",!1),Jt(this,"logChunkController"),Jt(this,"on",(o,c)=>this.events.on(o,c)),Jt(this,"once",(o,c)=>this.events.once(o,c)),Jt(this,"off",(o,c)=>this.events.off(o,c)),Jt(this,"removeListener",(o,c)=>this.events.removeListener(o,c)),Jt(this,"dispatchEnvelope",({topic:o,message:c,sessionExists:l})=>{if(!o||!c)return;const u={topic:o,message:c,publishedAt:Date.now(),transportType:on.link_mode};this.relayer.onLinkMessageEvent(u,{sessionExists:l})});const r=this.getGlobalCore(e?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(o){console.warn("Failed to copy global core",o)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||aZ,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=nIe({level:typeof e?.logger=="string"&&e.logger?e.logger:WPe.logger,name:Wy}),{logger:a,chunkLoggerController:s}=Vq({opts:i,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=s,(n=this.logChunkController)!=null&&n.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,c;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=ra(a,this.name),this.heartbeat=new k$e,this.crypto=new QOe(this,this.logger,e?.keychain),this.history=new lNe(this,this.logger),this.expirer=new fNe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new tPe(gR(gR({},qPe),e?.storageOptions)),this.relayer=new xMe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new sNe(this,this.logger),this.verify=new gNe(this,this.logger,this.storage),this.echoClient=new vNe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new CNe(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const n=new vZ(e);await n.initialize();const r=await n.crypto.getClientId();return await n.storage.setItem(aRe,r),n}get context(){return Ri(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(ZP,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(ZP)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const n=`_walletConnectCore_${e}`,r=`${n}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[n]}catch(n){console.warn("Failed to get global WalletConnect core",n);return}}setGlobalCore(e){var n;try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${((n=e.opts)==null?void 0:n.customStoragePrefix)||""}`;globalThis[r]=e}catch(r){console.warn("Failed to set global WalletConnect core",r)}}isGlobalCoreDisabled(){try{return typeof ur<"u"&&HPe.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const INe=xNe,wZ="wc",bZ=2,_Z="client",US=`${wZ}@${bZ}:${_Z}:`,x4={name:_Z,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},yR="WALLETCONNECT_DEEPLINK_CHOICE",TNe="proposal",mR="Proposal expired",LNe="session",dd=Oe.SEVEN_DAYS,kNe="engine",yr={wc_sessionPropose:{req:{ttl:Oe.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Oe.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Oe.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Oe.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Oe.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Oe.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Oe.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Oe.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Oe.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Oe.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Oe.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Oe.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Oe.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Oe.FIVE_MINUTES,prompt:!1,tag:1119}}},I4={min:Oe.FIVE_MINUTES,max:Oe.SEVEN_DAYS},ds={idle:"IDLE",active:"ACTIVE"},$Ne={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},PNe="request",RNe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],ONe="wc",MNe="auth",NNe="authKeys",DNe="pairingTopics",FNe="requests",$v=`${ONe}@${1.5}:${MNe}:`,rg=`${$v}:PUB_KEY`;var UNe=Object.defineProperty,jNe=Object.defineProperties,BNe=Object.getOwnPropertyDescriptors,vR=Object.getOwnPropertySymbols,VNe=Object.prototype.hasOwnProperty,HNe=Object.prototype.propertyIsEnumerable,pb=(t,e,n)=>e in t?UNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ft=(t,e)=>{for(var n in e||(e={}))VNe.call(e,n)&&pb(t,n,e[n]);if(vR)for(var n of vR(e))HNe.call(e,n)&&pb(t,n,e[n]);return t},Or=(t,e)=>jNe(t,BNe(e)),be=(t,e,n)=>pb(t,typeof e!="symbol"?e+"":e,n);class WNe extends _Pe{constructor(e){super(e),be(this,"name",kNe),be(this,"events",new J_),be(this,"initialized",!1),be(this,"requestQueue",{state:ds.idle,queue:[]}),be(this,"sessionRequestQueue",{state:ds.idle,queue:[]}),be(this,"emittedSessionRequests",new OIe({limit:500})),be(this,"requestQueueDelay",Oe.ONE_SECOND),be(this,"expectedPairingMethodMap",new Map),be(this,"recentlyDeletedMap",new Map),be(this,"recentlyDeletedLimit",200),be(this,"relayMessageCache",[]),be(this,"pendingSessions",new Map),be(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(yr)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Oe.toMiliseconds(this.requestQueueDelay)))}),be(this,"connect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const r=Or(Ft({},n),{requiredNamespaces:n.requiredNamespaces||{},optionalNamespaces:n.optionalNamespaces||{}});await this.isValidConnect(r),r.optionalNamespaces=Vke(r.requiredNamespaces,r.optionalNamespaces),r.requiredNamespaces={};const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:s,sessionProperties:o,scopedProperties:c,relays:l}=r;let u=i,d,f=!1;try{if(u){const C=this.client.core.pairing.pairings.get(u);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),f=C.active}}catch(C){throw this.client.logger.error(`connect() -> pairing.get(${u}) failed`),C}if(!u||!f){const{topic:C,uri:x}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});u=C,d=x}if(!u){const{message:C}=Re("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(C)}const h=await this.client.core.crypto.generateKeyPair(),p=yr.wc_sessionPropose.req.ttl||Oe.FIVE_MINUTES,g=Un(p),y=Or(Ft(Ft({requiredNamespaces:a,optionalNamespaces:s,relays:l??[{protocol:iZ}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:g,pairingTopic:u},o&&{sessionProperties:o}),c&&{scopedProperties:c}),{id:ws()}),v=Nt("session_connect",y.id),{reject:b,resolve:w,done:_}=Ol(p,mR),E=({id:C})=>{C===y.id&&(this.client.events.off("proposal_expire",E),this.pendingSessions.delete(y.id),this.events.emit(v,{error:{message:mR,code:0}}))};return this.client.events.on("proposal_expire",E),this.events.once(v,({error:C,session:x})=>{this.client.events.off("proposal_expire",E),C?b(C):x&&w(x)}),await this.sendProposeSession({proposal:y,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:y.id}}}),await this.setProposal(y.id,y),{uri:d,approval:_}}),be(this,"pair",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(n)}catch(r){throw this.client.logger.error("pair() failed"),r}}),be(this,"approve",async n=>{var r,i,a;const s=this.client.core.eventClient.createEvent({properties:{topic:(r=n?.id)==null?void 0:r.toString(),trace:[Ma.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(T){throw s.setError(Il.no_internet_connection),T}try{await this.isValidProposalId(n?.id)}catch(T){throw this.client.logger.error(`approve() -> proposal.get(${n?.id}) failed`),s.setError(Il.proposal_not_found),T}try{await this.isValidApprove(n)}catch(T){throw this.client.logger.error("approve() -> isValidApprove() failed"),s.setError(Il.session_approve_namespace_validation_failure),T}const{id:o,relayProtocol:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:f}=n,h=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:s.eventId});const{pairingTopic:p,proposer:g,requiredNamespaces:y,optionalNamespaces:v}=h;let b=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:p});b||(b=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:Ma.session_approve_started,properties:{topic:p,trace:[Ma.session_approve_started,Ma.session_namespaces_validation_success]}}));const w=await this.client.core.crypto.generateKeyPair(),_=g.publicKey,E=await this.client.core.crypto.generateSharedKey(w,_),C=Ft(Ft(Ft({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:w,metadata:this.client.metadata},expiry:Un(dd)},u&&{sessionProperties:u}),d&&{scopedProperties:d}),f&&{sessionConfig:f}),x=on.relay;b.addTrace(Ma.subscribing_session_topic);try{await this.client.core.relayer.subscribe(E,{transportType:x,internal:{skipSubscribe:!0}})}catch(T){throw b.setError(Il.subscribe_session_topic_failure),T}b.addTrace(Ma.subscribe_session_topic_success);const $=Or(Ft({},C),{topic:E,requiredNamespaces:y,optionalNamespaces:v,pairingTopic:p,acknowledged:!1,self:C.controller,peer:{publicKey:g.publicKey,metadata:g.metadata},controller:w,transportType:on.relay});await this.client.session.set(E,$),b.addTrace(Ma.store_session);try{await this.sendApproveSession({sessionTopic:E,proposal:h,pairingProposalResponse:{relay:{protocol:c??"irn"},responderPublicKey:w},sessionSettleRequest:C,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:o}}}),b.addTrace(Ma.session_approve_publish_success)}catch(T){throw this.client.logger.error(T),this.client.session.delete(E,ln("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(E),T}return this.client.core.eventClient.deleteEvent({eventId:b.eventId}),await this.client.core.pairing.updateMetadata({topic:p,metadata:g.metadata}),await this.deleteProposal(o),await this.client.core.pairing.activate({topic:p}),await this.setExpiry(E,Un(dd)),{topic:E,acknowledged:()=>Promise.resolve(this.client.session.get(E))}}),be(this,"reject",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(n)}catch(s){throw this.client.logger.error("reject() -> isValidReject() failed"),s}const{id:r,reason:i}=n;let a;try{a=this.client.proposal.get(r).pairingTopic}catch(s){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),s}a&&await this.sendError({id:r,topic:a,error:i,rpcOpts:yr.wc_sessionPropose.reject}),await this.deleteProposal(r)}),be(this,"update",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(n)}catch(d){throw this.client.logger.error("update() -> isValidUpdate() failed"),d}const{topic:r,namespaces:i}=n,{done:a,resolve:s,reject:o}=Ol(),c=ws(),l=Zc().toString(),u=this.client.session.get(r).namespaces;return this.events.once(Nt("session_update",c),({error:d})=>{d?o(d):s()}),await this.client.session.update(r,{namespaces:i}),await this.sendRequest({topic:r,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(d=>{this.client.logger.error(d),this.client.session.update(r,{namespaces:u}),o(d)}),{acknowledged:a}}),be(this,"extend",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(n)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:r}=n,i=ws(),{done:a,resolve:s,reject:o}=Ol();return this.events.once(Nt("session_extend",i),({error:c})=>{c?o(c):s()}),await this.setExpiry(r,Un(dd)),this.sendRequest({topic:r,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{o(c)}),{acknowledged:a}}),be(this,"request",async n=>{this.isInitialized();try{await this.isValidRequest(n)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:r,request:i,topic:a,expiry:s=yr.wc_sessionRequest.req.ttl}=n,o=this.client.session.get(a);o?.transportType===on.relay&&await this.confirmOnlineStateOrThrow();const c=ws(),l=Zc().toString(),{done:u,resolve:d,reject:f}=Ol(s,"Request expired. Please try again.");this.events.once(Nt("session_request",c),({error:y,result:v})=>{y?f(y):d(v)});const h="wc_sessionRequest",p=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);if(p)return await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:a,method:h,params:{request:Or(Ft({},i),{expiryTimestamp:Un(s)}),chainId:r},expiry:s,throwOnFailedPublish:!0,appLink:p}).catch(y=>f(y)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:r,id:c}),await u();const g={request:Or(Ft({},i),{expiryTimestamp:Un(s)}),chainId:r};return await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:a,method:h,params:g,expiry:s,throwOnFailedPublish:!0,tvf:this.getTVFParams(c,g)}).catch(v=>f(v)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:r,id:c}),y()}),new Promise(async y=>{var v;if(!((v=o.sessionConfig)!=null&&v.disableDeepLink)){const b=await LIe(this.client.core.storage,yR);await xIe({id:c,topic:a,wcDeepLink:b})}y()}),u()]).then(y=>y[2])}),be(this,"respond",async n=>{var r,i;this.isInitialized();const a=this.client.core.eventClient.createEvent({properties:{topic:n?.topic||((i=(r=n?.response)==null?void 0:r.id)==null?void 0:i.toString()),trace:[Ma.session_request_response_started]}});try{await this.isValidRespond(n)}catch(d){throw a.addTrace(d?.message),a.setError(Il.session_request_response_validation_failure),d}a.addTrace(Ma.session_request_response_validation_success);const{topic:s,response:o}=n,{id:c}=o,l=this.client.session.get(s);l.transportType===on.relay&&await this.confirmOnlineStateOrThrow();const u=this.getAppLinkIfEnabled(l.peer.metadata,l.transportType);try{a.addTrace(Ma.session_request_response_publish_started),bs(o)?await this.sendResult({id:c,topic:s,result:o.result,throwOnFailedPublish:!0,appLink:u}):ga(o)&&await this.sendError({id:c,topic:s,error:o.error,appLink:u}),this.cleanupAfterResponse(n)}catch(d){throw a.addTrace(d?.message),a.setError(Il.session_request_response_publish_failure),d}}),be(this,"ping",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(n)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:r}=n;if(this.client.session.keys.includes(r)){const i=ws(),a=Zc().toString(),{done:s,resolve:o,reject:c}=Ol();this.events.once(Nt("session_ping",i),({error:l})=>{l?c(l):o()}),await Promise.all([this.sendRequest({topic:r,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:a}),s()])}else this.client.core.pairing.pairings.keys.includes(r)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:r}))}),be(this,"emit",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(n);const{topic:r,event:i,chainId:a}=n,s=Zc().toString(),o=ws();await this.sendRequest({topic:r,method:"wc_sessionEvent",params:{event:i,chainId:a},throwOnFailedPublish:!0,relayRpcId:s,clientRpcId:o})}),be(this,"disconnect",async n=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(n);const{topic:r}=n;if(this.client.session.keys.includes(r))await this.sendRequest({topic:r,method:"wc_sessionDelete",params:ln("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:r,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(r))await this.client.core.pairing.disconnect({topic:r});else{const{message:i}=Re("MISMATCHED_TOPIC",`Session or pairing topic not found: ${r}`);throw new Error(i)}}),be(this,"find",n=>(this.isInitialized(),this.client.session.getAll().filter(r=>qke(r,n)))),be(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),be(this,"authenticate",async(n,r)=>{var i;this.isInitialized(),this.isValidAuthenticate(n);const a=r&&this.client.core.linkModeSupportedApps.includes(r)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),s=a?on.link_mode:on.relay;s===on.relay&&await this.confirmOnlineStateOrThrow();const{chains:o,statement:c="",uri:l,domain:u,nonce:d,type:f,exp:h,nbf:p,methods:g=[],expiry:y}=n,v=[...n.resources||[]],{topic:b,uri:w}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});this.client.logger.info({message:"Generated new pairing",pairing:{topic:b,uri:w}});const _=await this.client.core.crypto.generateKeyPair(),E=Q3(_);if(await Promise.all([this.client.auth.authKeys.set(rg,{responseTopic:E,publicKey:_}),this.client.auth.pairingTopics.set(E,{topic:E,pairingTopic:b})]),await this.client.core.relayer.subscribe(E,{transportType:s}),this.client.logger.info(`sending request to new pairing topic: ${b}`),g.length>0){const{namespace:P}=Ro(o[0]);let j=qTe(P,"request",g);X3(v)&&(j=ZTe(j,v.pop())),v.push(j)}const C=y&&y>yr.wc_sessionAuthenticate.req.ttl?y:yr.wc_sessionAuthenticate.req.ttl,x={authPayload:{type:f??"caip122",chains:o,statement:c,aud:l,domain:u,version:"1",nonce:d,iat:new Date().toISOString(),exp:h,nbf:p,resources:v},requester:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Un(C)},$={eip155:{chains:o,methods:[...new Set(["personal_sign",...g])],events:["chainChanged","accountsChanged"]}},T={requiredNamespaces:{},optionalNamespaces:$,relays:[{protocol:"irn"}],pairingTopic:b,proposer:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Un(yr.wc_sessionPropose.req.ttl),id:ws()},{done:U,resolve:O,reject:F}=Ol(C,"Request expired"),k=ws(),S=Nt("session_connect",T.id),I=Nt("session_request",k),A=async({error:P,session:j})=>{this.events.off(I,R),P?F(P):j&&O({session:j})},R=async P=>{var j,M,V;if(await this.deletePendingAuthRequest(k,{message:"fulfilled",code:0}),P.error){const J=ln("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return P.error.code===J.code?void 0:(this.events.off(S,A),F(P.error.message))}await this.deleteProposal(T.id),this.events.off(S,A);const{cacaos:B,responder:G}=P.result,Z=[],ie=[];for(const J of B){await X$({cacao:J,projectId:this.client.core.projectId})||(this.client.logger.error(J,"Signature verification failed"),F(ln("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:K}=J,ne=X3(K.resources),ce=[q8(K.iss)],xe=Fy(K.iss);if(ne){const ke=Q$(ne),Me=eP(ne);Z.push(...ke),ce.push(...Me)}for(const ke of ce)ie.push(`${ke}:${xe}`)}const oe=await this.client.core.crypto.generateSharedKey(_,G.publicKey);let z;Z.length>0&&(z={topic:oe,acknowledged:!0,self:{publicKey:_,metadata:this.client.metadata},peer:G,controller:G.publicKey,expiry:Un(dd),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:b,namespaces:xP([...new Set(Z)],[...new Set(ie)]),transportType:s},await this.client.core.relayer.subscribe(oe,{transportType:s}),await this.client.session.set(oe,z),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:G.metadata}),z=this.client.session.get(oe)),(j=this.client.metadata.redirect)!=null&&j.linkMode&&(M=G.metadata.redirect)!=null&&M.linkMode&&(V=G.metadata.redirect)!=null&&V.universal&&r&&(this.client.core.addLinkModeSupportedApp(G.metadata.redirect.universal),this.client.session.update(oe,{transportType:on.link_mode})),O({auths:B,session:z})};this.events.once(S,A),this.events.once(I,R);let N;try{if(a){const P=Wa("wc_sessionAuthenticate",x,k);this.client.core.history.set(b,P);const j=await this.client.core.crypto.encode("",P,{type:T0,encoding:Mc});N=X1(r,b,j)}else await Promise.all([this.sendRequest({topic:b,method:"wc_sessionAuthenticate",params:x,expiry:n.expiry,throwOnFailedPublish:!0,clientRpcId:k}),this.sendRequest({topic:b,method:"wc_sessionPropose",params:T,expiry:yr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:T.id})])}catch(P){throw this.events.off(S,A),this.events.off(I,R),P}return await this.setProposal(T.id,T),await this.setAuthRequest(k,{request:Or(Ft({},x),{verifyContext:{}}),pairingTopic:b,transportType:s}),{uri:N??w,response:U}}),be(this,"approveSessionAuthenticate",async n=>{const{id:r,auths:i}=n,a=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[Tl.authenticated_session_approve_started]}});try{this.isInitialized()}catch(y){throw a.setError(Zf.no_internet_connection),y}const s=this.getPendingAuthRequest(r);if(!s)throw a.setError(Zf.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${r}`);const o=s.transportType||on.relay;o===on.relay&&await this.confirmOnlineStateOrThrow();const c=s.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),u=Q3(c),d={type:Oo,receiverPublicKey:c,senderPublicKey:l},f=[],h=[];for(const y of i){if(!await X$({cacao:y,projectId:this.client.core.projectId})){a.setError(Zf.invalid_cacao);const E=ln("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:u,error:E,encodeOpts:d}),new Error(E.message)}a.addTrace(Tl.cacaos_verified);const{p:v}=y,b=X3(v.resources),w=[q8(v.iss)],_=Fy(v.iss);if(b){const E=Q$(b),C=eP(b);f.push(...E),w.push(...C)}for(const E of w)h.push(`${E}:${_}`)}const p=await this.client.core.crypto.generateSharedKey(l,c);a.addTrace(Tl.create_authenticated_session_topic);let g;if(f?.length>0){g={topic:p,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:s.requester.metadata},controller:c,expiry:Un(dd),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:xP([...new Set(f)],[...new Set(h)]),transportType:o},a.addTrace(Tl.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(p,{transportType:o})}catch(y){throw a.setError(Zf.subscribe_authenticated_session_topic_failure),y}a.addTrace(Tl.subscribe_authenticated_session_topic_success),await this.client.session.set(p,g),a.addTrace(Tl.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}a.addTrace(Tl.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:r,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,o)})}catch(y){throw a.setError(Zf.authenticated_session_approve_publish_failure),y}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:g}}),be(this,"rejectSessionAuthenticate",async n=>{this.isInitialized();const{id:r,reason:i}=n,a=this.getPendingAuthRequest(r);if(!a)throw new Error(`Could not find pending auth request with id ${r}`);a.transportType===on.relay&&await this.confirmOnlineStateOrThrow();const s=a.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),c=Q3(s),l={type:Oo,receiverPublicKey:s,senderPublicKey:o};await this.sendError({id:r,topic:c,error:i,encodeOpts:l,rpcOpts:yr.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(r,{message:"rejected",code:0}),await this.deleteProposal(r)}),be(this,"formatAuthMessage",n=>{this.isInitialized();const{request:r,iss:i}=n;return lz(r,i)}),be(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const n=this.relayMessageCache.shift();n&&await this.onRelayMessage(n)}catch(n){this.client.logger.error(n)}},50)}),be(this,"cleanupDuplicatePairings",async n=>{if(n.pairingTopic)try{const r=this.client.core.pairing.pairings.get(n.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var s,o;return((s=a.peerMetadata)==null?void 0:s.url)&&((o=a.peerMetadata)==null?void 0:o.url)===n.peer.metadata.url&&a.topic&&a.topic!==r.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(r){this.client.logger.error(r)}}),be(this,"deleteSession",async n=>{var r;const{topic:i,expirerHasDeleted:a=!1,emitEvent:s=!0,id:o=0}=n,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,ln("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),a||this.client.core.expirer.del(i),this.client.core.storage.removeItem(yR).catch(l=>this.client.logger.warn(l)),this.getPendingSessionRequests().forEach(l=>{l.topic===i&&this.deletePendingSessionRequest(l.id,ln("USER_DISCONNECTED"))}),i===((r=this.sessionRequestQueue.queue[0])==null?void 0:r.topic)&&(this.sessionRequestQueue.state=ds.idle),s&&this.client.events.emit("session_delete",{id:o,topic:i})}),be(this,"deleteProposal",async(n,r)=>{if(r)try{const i=this.client.proposal.get(n);this.client.core.eventClient.getEvent({topic:i.pairingTopic})?.setError(Il.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(n,ln("USER_DISCONNECTED")),r?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"proposal")}),be(this,"deletePendingSessionRequest",async(n,r,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(n,r),i?Promise.resolve():this.client.core.expirer.del(n)]),this.addToRecentlyDeleted(n,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==n),i&&(this.sessionRequestQueue.state=ds.idle,this.client.events.emit("session_request_expire",{id:n}))}),be(this,"deletePendingAuthRequest",async(n,r,i=!1)=>{await Promise.all([this.client.auth.requests.delete(n,r),i?Promise.resolve():this.client.core.expirer.del(n)])}),be(this,"setExpiry",async(n,r)=>{this.client.session.keys.includes(n)&&(this.client.core.expirer.set(n,r),await this.client.session.update(n,{expiry:r}))}),be(this,"setProposal",async(n,r)=>{this.client.core.expirer.set(n,Un(yr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(n,r)}),be(this,"setAuthRequest",async(n,r)=>{const{request:i,pairingTopic:a,transportType:s=on.relay}=r;this.client.core.expirer.set(n,i.expiryTimestamp),await this.client.auth.requests.set(n,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:n,pairingTopic:a,verifyContext:i.verifyContext,transportType:s})}),be(this,"setPendingSessionRequest",async n=>{const{id:r,topic:i,params:a,verifyContext:s}=n,o=a.request.expiryTimestamp||Un(yr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(r,o),await this.client.pendingRequest.set(r,{id:r,topic:i,params:a,verifyContext:s})}),be(this,"sendRequest",async n=>{const{topic:r,method:i,params:a,expiry:s,relayRpcId:o,clientRpcId:c,throwOnFailedPublish:l,appLink:u,tvf:d,publishOpts:f={}}=n,h=Wa(i,a,c);let p;const g=!!u;try{const b=g?Mc:Ci;p=await this.client.core.crypto.encode(r,h,{encoding:b})}catch(b){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),b}let y;if(RNe.includes(i)){const b=pa(JSON.stringify(h)),w=pa(p);y=await this.client.core.verify.register({id:w,decryptedId:b})}const v=Ft(Ft({},yr[i].req),f);if(v.attestation=y,s&&(v.ttl=s),o&&(v.id=o),this.client.core.history.set(r,h),g){const b=X1(u,r,p);await rt.Linking.openURL(b,this.client.name)}else v.tvf=Or(Ft({},d),{correlationId:h.id}),l?(v.internal=Or(Ft({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,p,v)):this.client.core.relayer.publish(r,p,v).catch(b=>this.client.logger.error(b));return h.id}),be(this,"sendProposeSession",async n=>{const{proposal:r,publishOpts:i}=n,a=Wa("wc_sessionPropose",r,r.id);this.client.core.history.set(r.pairingTopic,a);const s=await this.client.core.crypto.encode(r.pairingTopic,a,{encoding:Ci}),o=pa(JSON.stringify(a)),c=pa(s),l=await this.client.core.verify.register({id:c,decryptedId:o});await this.client.core.relayer.publishCustom({payload:{pairingTopic:r.pairingTopic,sessionProposal:s},opts:Or(Ft({},i),{publishMethod:"wc_proposeSession",attestation:l})})}),be(this,"sendApproveSession",async n=>{const{sessionTopic:r,pairingProposalResponse:i,proposal:a,sessionSettleRequest:s,publishOpts:o}=n,c=Fp(a.id,i),l=await this.client.core.crypto.encode(a.pairingTopic,c,{encoding:Ci}),u=Wa("wc_sessionSettle",s,o?.id),d=await this.client.core.crypto.encode(r,u,{encoding:Ci});this.client.core.history.set(r,u),await this.client.core.relayer.publishCustom({payload:{sessionTopic:r,pairingTopic:a.pairingTopic,sessionProposalResponse:l,sessionSettlementRequest:d},opts:Or(Ft({},o),{publishMethod:"wc_approveSession"})})}),be(this,"sendResult",async n=>{const{id:r,topic:i,result:a,throwOnFailedPublish:s,encodeOpts:o,appLink:c}=n,l=Fp(r,a);let u;const d=c&&typeof rt?.Linking<"u";try{const p=d?Mc:Ci;u=await this.client.core.crypto.encode(i,l,Or(Ft({},o||{}),{encoding:p}))}catch(p){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),p}let f,h;try{f=await this.client.core.history.get(i,r);const p=f.request;try{h=this.getTVFParams(r,p.params,a)}catch(g){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${g?.message}`)}}catch(p){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${r}) failed`),p}if(d){const p=X1(c,i,u);await rt.Linking.openURL(p,this.client.name)}else{const p=f.request.method,g=yr[p].res;g.tvf=Or(Ft({},h),{correlationId:r}),s?(g.internal=Or(Ft({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,u,g)):this.client.core.relayer.publish(i,u,g).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)}),be(this,"sendError",async n=>{const{id:r,topic:i,error:a,encodeOpts:s,rpcOpts:o,appLink:c}=n,l=Tv(r,a);let u;const d=c&&typeof rt?.Linking<"u";try{const h=d?Mc:Ci;u=await this.client.core.crypto.encode(i,l,Or(Ft({},s||{}),{encoding:h}))}catch(h){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),h}let f;try{f=await this.client.core.history.get(i,r)}catch(h){throw this.client.logger.error(`sendError() -> history.get(${i}, ${r}) failed`),h}if(d){const h=X1(c,i,u);await rt.Linking.openURL(h,this.client.name)}else{const h=f.request.method,p=o||yr[h].res;this.client.core.relayer.publish(i,u,p)}await this.client.core.history.resolve(l)}),be(this,"cleanup",async()=>{const n=[],r=[];this.client.session.getAll().forEach(i=>{let a=!1;Ss(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&n.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{Ss(i.expiryTimestamp)&&r.push(i.id)}),await Promise.all([...n.map(i=>this.deleteSession({topic:i})),...r.map(i=>this.deleteProposal(i))])}),be(this,"onProviderMessageEvent",async n=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(n):await this.onRelayMessage(n)}),be(this,"onRelayEventRequest",async n=>{this.requestQueue.queue.push(n),await this.processRequestsQueue()}),be(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===ds.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ds.active;const n=this.requestQueue.queue.shift();if(n)try{await this.processRequest(n)}catch(r){this.client.logger.warn(r)}}this.requestQueue.state=ds.idle}),be(this,"processRequest",async n=>{const{topic:r,payload:i,attestation:a,transportType:s,encryptedId:o}=n,c=i.method;if(!this.shouldIgnorePairingRequest({topic:r,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:r,payload:i,attestation:a,encryptedId:o});case"wc_sessionSettle":return await this.onSessionSettleRequest(r,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(r,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(r,i);case"wc_sessionPing":return await this.onSessionPingRequest(r,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(r,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:r,payload:i,attestation:a,encryptedId:o,transportType:s});case"wc_sessionEvent":return await this.onSessionEventRequest(r,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:r,payload:i,attestation:a,encryptedId:o,transportType:s});default:return this.client.logger.info(`Unsupported request method ${c}`)}}),be(this,"onRelayEventResponse",async n=>{const{topic:r,payload:i,transportType:a}=n,s=(await this.client.core.history.get(r,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(r,i,a);case"wc_sessionSettle":return this.onSessionSettleResponse(r,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(r,i);case"wc_sessionExtend":return this.onSessionExtendResponse(r,i);case"wc_sessionPing":return this.onSessionPingResponse(r,i);case"wc_sessionRequest":return this.onSessionRequestResponse(r,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(r,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}}),be(this,"onRelayEventUnknownPayload",n=>{const{topic:r}=n,{message:i}=Re("MISSING_OR_INVALID",`Decoded payload on topic ${r} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)}),be(this,"shouldIgnorePairingRequest",n=>{const{topic:r,requestMethod:i}=n,a=this.expectedPairingMethodMap.get(r);return!a||a.includes(i)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),be(this,"onSessionProposeRequest",async n=>{const{topic:r,payload:i,attestation:a,encryptedId:s}=n,{params:o,id:c}=i;try{const l=this.client.core.eventClient.getEvent({topic:r});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l?.setError(ho.proposal_listener_not_found)),this.isValidConnect(Ft({},i.params));const u=o.expiryTimestamp||Un(yr.wc_sessionPropose.req.ttl),d=Ft({id:c,pairingTopic:r,expiryTimestamp:u,attestation:a,encryptedId:s},o);await this.setProposal(c,d);const f=await this.getVerifyContext({attestationId:a,hash:pa(JSON.stringify(i)),encryptedId:s,metadata:d.proposer.metadata});l?.addTrace(gs.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:d,verifyContext:f})}catch(l){await this.sendError({id:c,topic:r,error:l,rpcOpts:yr.wc_sessionPropose.autoReject}),this.client.logger.error(l)}}),be(this,"onSessionProposeResponse",async(n,r,i)=>{const{id:a}=r;if(bs(r)){const{result:s}=r;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const c=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const u=await this.client.core.crypto.generateSharedKey(c,l);this.pendingSessions.set(a,{sessionTopic:u,pairingTopic:n,proposalId:a,publicKey:c});const d=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:n})}else if(ga(r)){await this.deleteProposal(a);const s=Nt("session_connect",a);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners, 954`);this.events.emit(s,{error:r.error})}}),be(this,"onSessionSettleRequest",async(n,r)=>{const{id:i,params:a}=r;try{this.isValidSessionSettleRequest(a);const{relay:s,controller:o,expiry:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:f}=r.params,h=[...this.pendingSessions.values()].find(y=>y.sessionTopic===n);if(!h)return this.client.logger.error(`Pending session not found for topic ${n}`);const p=this.client.proposal.get(h.proposalId),g=Or(Ft(Ft(Ft({topic:n,relay:s,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:h.pairingTopic,requiredNamespaces:p.requiredNamespaces,optionalNamespaces:p.optionalNamespaces,controller:o.publicKey,self:{publicKey:h.publicKey,metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},u&&{sessionProperties:u}),d&&{scopedProperties:d}),f&&{sessionConfig:f}),{transportType:on.relay});await this.client.session.set(g.topic,g),await this.setExpiry(g.topic,g.expiry),await this.client.core.pairing.updateMetadata({topic:h.pairingTopic,metadata:g.peer.metadata}),this.client.events.emit("session_connect",{session:g}),this.events.emit(Nt("session_connect",h.proposalId),{session:g}),this.pendingSessions.delete(h.proposalId),this.deleteProposal(h.proposalId,!1),this.cleanupDuplicatePairings(g),await this.sendResult({id:r.id,topic:n,result:!0})}catch(s){await this.sendError({id:i,topic:n,error:s}),this.client.logger.error(s)}}),be(this,"onSessionSettleResponse",async(n,r)=>{const{id:i}=r;bs(r)?(await this.client.session.update(n,{acknowledged:!0}),this.events.emit(Nt("session_approve",i),{})):ga(r)&&(await this.client.session.delete(n,ln("USER_DISCONNECTED")),this.events.emit(Nt("session_approve",i),{error:r.error}))}),be(this,"onSessionUpdateRequest",async(n,r)=>{const{params:i,id:a}=r;try{const s=`${n}_session_update`,o=qf.get(s);if(o&&this.isRequestOutOfSync(o,a)){this.client.logger.warn(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:n,error:ln("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Ft({topic:n},i));try{qf.set(s,a),await this.client.session.update(n,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:n,result:!0})}catch(c){throw qf.delete(s),c}this.client.events.emit("session_update",{id:a,topic:n,params:i})}catch(s){await this.sendError({id:a,topic:n,error:s}),this.client.logger.error(s)}}),be(this,"isRequestOutOfSync",(n,r)=>r.toString().slice(0,-3)<n.toString().slice(0,-3)),be(this,"onSessionUpdateResponse",(n,r)=>{const{id:i}=r,a=Nt("session_update",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);bs(r)?this.events.emit(Nt("session_update",i),{}):ga(r)&&this.events.emit(Nt("session_update",i),{error:r.error})}),be(this,"onSessionExtendRequest",async(n,r)=>{const{id:i}=r;try{this.isValidExtend({topic:n}),await this.setExpiry(n,Un(dd)),await this.sendResult({id:i,topic:n,result:!0}),this.client.events.emit("session_extend",{id:i,topic:n})}catch(a){await this.sendError({id:i,topic:n,error:a}),this.client.logger.error(a)}}),be(this,"onSessionExtendResponse",(n,r)=>{const{id:i}=r,a=Nt("session_extend",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);bs(r)?this.events.emit(Nt("session_extend",i),{}):ga(r)&&this.events.emit(Nt("session_extend",i),{error:r.error})}),be(this,"onSessionPingRequest",async(n,r)=>{const{id:i}=r;try{this.isValidPing({topic:n}),await this.sendResult({id:i,topic:n,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:n})}catch(a){await this.sendError({id:i,topic:n,error:a}),this.client.logger.error(a)}}),be(this,"onSessionPingResponse",(n,r)=>{const{id:i}=r,a=Nt("session_ping",i);setTimeout(()=>{if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners 2176`);bs(r)?this.events.emit(Nt("session_ping",i),{}):ga(r)&&this.events.emit(Nt("session_ping",i),{error:r.error})},500)}),be(this,"onSessionDeleteRequest",async(n,r)=>{const{id:i}=r;try{this.isValidDisconnect({topic:n,reason:r.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once($n.publish,async()=>{a(await this.deleteSession({topic:n,id:i}))})}),this.sendResult({id:i,topic:n,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:n,error:ln("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}}),be(this,"onSessionRequest",async n=>{var r,i,a;const{topic:s,payload:o,attestation:c,encryptedId:l,transportType:u}=n,{id:d,params:f}=o;try{await this.isValidRequest(Ft({topic:s},f));const h=this.client.session.get(s),p=await this.getVerifyContext({attestationId:c,hash:pa(JSON.stringify(Wa("wc_sessionRequest",f,d))),encryptedId:l,metadata:h.peer.metadata,transportType:u}),g={id:d,topic:s,params:f,verifyContext:p};await this.setPendingSessionRequest(g),u===on.link_mode&&(r=h.peer.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp((i=h.peer.metadata.redirect)==null?void 0:i.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(g):(this.addSessionRequestToSessionRequestQueue(g),this.processSessionRequestQueue())}catch(h){await this.sendError({id:d,topic:s,error:h}),this.client.logger.error(h)}}),be(this,"onSessionRequestResponse",(n,r)=>{const{id:i}=r,a=Nt("session_request",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);bs(r)?this.events.emit(Nt("session_request",i),{result:r.result}):ga(r)&&this.events.emit(Nt("session_request",i),{error:r.error})}),be(this,"onSessionEventRequest",async(n,r)=>{const{id:i,params:a}=r;try{const s=`${n}_session_event_${a.event.name}`,o=qf.get(s);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Ft({topic:n},a)),this.client.events.emit("session_event",{id:i,topic:n,params:a}),qf.set(s,i)}catch(s){await this.sendError({id:i,topic:n,error:s}),this.client.logger.error(s)}}),be(this,"onSessionAuthenticateResponse",(n,r)=>{const{id:i}=r;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:n,payload:r}),bs(r)?this.events.emit(Nt("session_request",i),{result:r.result}):ga(r)&&this.events.emit(Nt("session_request",i),{error:r.error})}),be(this,"onSessionAuthenticateRequest",async n=>{var r;const{topic:i,payload:a,attestation:s,encryptedId:o,transportType:c}=n;try{const{requester:l,authPayload:u,expiryTimestamp:d}=a.params,f=await this.getVerifyContext({attestationId:s,hash:pa(JSON.stringify(a)),encryptedId:o,metadata:l.metadata,transportType:c}),h={requester:l,pairingTopic:i,id:a.id,authPayload:u,verifyContext:f,expiryTimestamp:d};await this.setAuthRequest(a.id,{request:h,pairingTopic:i,transportType:c}),c===on.link_mode&&(r=l.metadata.redirect)!=null&&r.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:a.params,id:a.id,verifyContext:f})}catch(l){this.client.logger.error(l);const u=a.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),f=this.getAppLinkIfEnabled(a.params.requester.metadata,c),h={type:Oo,receiverPublicKey:u,senderPublicKey:d};await this.sendError({id:a.id,topic:i,error:l,encodeOpts:h,rpcOpts:yr.wc_sessionAuthenticate.autoReject,appLink:f})}}),be(this,"addSessionRequestToSessionRequestQueue",n=>{this.sessionRequestQueue.queue.push(n)}),be(this,"cleanupAfterResponse",n=>{this.deletePendingSessionRequest(n.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ds.idle,this.processSessionRequestQueue()},Oe.toMiliseconds(this.requestQueueDelay))}),be(this,"cleanupPendingSentRequestsForTopic",({topic:n,error:r})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===n&&a.request.method==="wc_sessionRequest").forEach(a=>{const s=a.request.id,o=Nt("session_request",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);this.events.emit(Nt("session_request",a.request.id),{error:r})})}),be(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===ds.active){this.client.logger.info("session request queue is already active.");return}const n=this.sessionRequestQueue.queue[0];if(!n){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(n)}catch(r){this.client.logger.error(r)}}),be(this,"emitSessionRequest",n=>{if(this.emittedSessionRequests.has(n.id)){this.client.logger.warn({id:n.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${n.id}`);return}this.sessionRequestQueue.state=ds.active,this.emittedSessionRequests.add(n.id),this.client.events.emit("session_request",n)}),be(this,"onPairingCreated",n=>{if(n.methods&&this.expectedPairingMethodMap.set(n.topic,n.methods),n.active)return;const r=this.client.proposal.getAll().find(i=>i.pairingTopic===n.topic);r&&this.onSessionProposeRequest({topic:n.topic,payload:Wa("wc_sessionPropose",Or(Ft({},r),{requiredNamespaces:r.requiredNamespaces,optionalNamespaces:r.optionalNamespaces,relays:r.relays,proposer:r.proposer,sessionProperties:r.sessionProperties,scopedProperties:r.scopedProperties}),r.id),attestation:r.attestation,encryptedId:r.encryptedId})}),be(this,"isValidConnect",async n=>{if(!vi(n)){const{message:l}=Re("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(n)}`);throw new Error(l)}const{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:s,scopedProperties:o,relays:c}=n;if(cr(r)||await this.isValidPairingTopic(r),!r$e(c)){const{message:l}=Re("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(l)}if(i&&!cr(i)&&Ds(i)!==0){const l="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(l):this.client.logger.warn(l),this.validateNamespaces(i,"requiredNamespaces")}if(a&&!cr(a)&&Ds(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),s&&!cr(s)&&this.validateSessionProps(s,"sessionProperties"),o&&!cr(o)){this.validateSessionProps(o,"scopedProperties");const l=Object.keys(i||{}).concat(Object.keys(a||{}));if(!Object.keys(o).every(u=>l.includes(u.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(o)}, required/optional namespaces: ${JSON.stringify(l)}`)}}),be(this,"validateNamespaces",(n,r)=>{const i=n$e(n,"connect()",r);if(i)throw new Error(i.message)}),be(this,"isValidApprove",async n=>{if(!vi(n))throw new Error(Re("MISSING_OR_INVALID",`approve() params: ${n}`).message);const{id:r,namespaces:i,relayProtocol:a,sessionProperties:s,scopedProperties:o}=n;this.checkRecentlyDeleted(r),await this.isValidProposalId(r);const c=this.client.proposal.get(r),l=w4(i,"approve()");if(l)throw new Error(l.message);const u=LP(c.requiredNamespaces,i,"approve()");if(u)throw new Error(u.message);if(!Vn(a,!0)){const{message:d}=Re("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(d)}if(s&&!cr(s)&&this.validateSessionProps(s,"sessionProperties"),o&&!cr(o)){this.validateSessionProps(o,"scopedProperties");const d=new Set(Object.keys(i));if(!Object.keys(o).every(f=>d.has(f.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(o)}, approved namespaces: ${Array.from(d).join(", ")}`)}}),be(this,"isValidReject",async n=>{if(!vi(n)){const{message:a}=Re("MISSING_OR_INVALID",`reject() params: ${n}`);throw new Error(a)}const{id:r,reason:i}=n;if(this.checkRecentlyDeleted(r),await this.isValidProposalId(r),!a$e(i)){const{message:a}=Re("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}}),be(this,"isValidSessionSettleRequest",n=>{if(!vi(n)){const{message:l}=Re("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${n}`);throw new Error(l)}const{relay:r,controller:i,namespaces:a,expiry:s}=n;if(!zz(r)){const{message:l}=Re("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const o=Yke(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const c=w4(a,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(Ss(s)){const{message:l}=Re("EXPIRED","onSessionSettleRequest()");throw new Error(l)}}),be(this,"isValidUpdate",async n=>{if(!vi(n)){const{message:c}=Re("MISSING_OR_INVALID",`update() params: ${n}`);throw new Error(c)}const{topic:r,namespaces:i}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const a=this.client.session.get(r),s=w4(i,"update()");if(s)throw new Error(s.message);const o=LP(a.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)}),be(this,"isValidExtend",async n=>{if(!vi(n)){const{message:i}=Re("MISSING_OR_INVALID",`extend() params: ${n}`);throw new Error(i)}const{topic:r}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r)}),be(this,"isValidRequest",async n=>{if(!vi(n)){const{message:c}=Re("MISSING_OR_INVALID",`request() params: ${n}`);throw new Error(c)}const{topic:r,request:i,chainId:a,expiry:s}=n;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);const{namespaces:o}=this.client.session.get(r);if(!TP(o,a)){const{message:c}=Re("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(c)}if(!s$e(i)){const{message:c}=Re("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!l$e(o,a,i.method)){const{message:c}=Re("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(s&&!h$e(s,I4)){const{message:c}=Re("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${I4.min} and ${I4.max}`);throw new Error(c)}}),be(this,"isValidRespond",async n=>{var r;if(!vi(n)){const{message:o}=Re("MISSING_OR_INVALID",`respond() params: ${n}`);throw new Error(o)}const{topic:i,response:a}=n;try{await this.isValidSessionTopic(i)}catch(o){throw(r=n?.response)!=null&&r.id&&this.cleanupAfterResponse(n),o}if(!o$e(a)){const{message:o}=Re("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(o)}const s=this.client.pendingRequest.get(a.id);if(s.topic!==i){const{message:o}=Re("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${a.id}, expected topic: ${s.topic}, received topic: ${i}`);throw new Error(o)}}),be(this,"isValidPing",async n=>{if(!vi(n)){const{message:i}=Re("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(i)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),be(this,"isValidEmit",async n=>{if(!vi(n)){const{message:o}=Re("MISSING_OR_INVALID",`emit() params: ${n}`);throw new Error(o)}const{topic:r,event:i,chainId:a}=n;await this.isValidSessionTopic(r);const{namespaces:s}=this.client.session.get(r);if(!TP(s,a)){const{message:o}=Re("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(o)}if(!c$e(i)){const{message:o}=Re("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!u$e(s,a,i.name)){const{message:o}=Re("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}}),be(this,"isValidDisconnect",async n=>{if(!vi(n)){const{message:i}=Re("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(i)}const{topic:r}=n;await this.isValidSessionOrPairingTopic(r)}),be(this,"isValidAuthenticate",n=>{const{chains:r,uri:i,domain:a,nonce:s}=n;if(!Array.isArray(r)||r.length===0)throw new Error("chains is required and must be a non-empty array");if(!Vn(i,!1))throw new Error("uri is required parameter");if(!Vn(a,!1))throw new Error("domain is required parameter");if(!Vn(s,!1))throw new Error("nonce is required parameter");if([...new Set(r.map(c=>Ro(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:o}=Ro(r[0]);if(o!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),be(this,"getVerifyContext",async n=>{const{attestationId:r,hash:i,encryptedId:a,metadata:s,transportType:o}=n,c={verified:{verifyUrl:s.verifyUrl||Hh,validation:"UNKNOWN",origin:s.url||""}};try{if(o===on.link_mode){const u=this.getAppLinkIfEnabled(s,o);return c.verified.validation=u&&new URL(u).origin===new URL(s.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:r,hash:i,encryptedId:a,verifyUrl:s.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(s.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c}),be(this,"validateSessionProps",(n,r)=>{Object.values(n).forEach((i,a)=>{if(i==null){const{message:s}=Re("MISSING_OR_INVALID",`${r} must contain an existing value for each key. Received: ${i} for key ${Object.keys(n)[a]}`);throw new Error(s)}})}),be(this,"getPendingAuthRequest",n=>{const r=this.client.auth.requests.get(n);return typeof r=="object"?r:void 0}),be(this,"addToRecentlyDeleted",(n,r)=>{if(this.recentlyDeletedMap.set(n,r),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const a=this.recentlyDeletedLimit/2;for(const s of this.recentlyDeletedMap.keys()){if(i++>=a)break;this.recentlyDeletedMap.delete(s)}}}),be(this,"checkRecentlyDeleted",n=>{const r=this.recentlyDeletedMap.get(n);if(r){const{message:i}=Re("MISSING_OR_INVALID",`Record was recently deleted - ${r}: ${n}`);throw new Error(i)}}),be(this,"isLinkModeEnabled",(n,r)=>{var i,a,s,o,c,l,u,d,f;return!n||r!==on.link_mode?!1:((a=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:a.linkMode)===!0&&((o=(s=this.client.metadata)==null?void 0:s.redirect)==null?void 0:o.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((u=n?.redirect)==null?void 0:u.universal)!==void 0&&((d=n?.redirect)==null?void 0:d.universal)!==""&&((f=n?.redirect)==null?void 0:f.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(n.redirect.universal)&&typeof rt?.Linking<"u"}),be(this,"getAppLinkIfEnabled",(n,r)=>{var i;return this.isLinkModeEnabled(n,r)?(i=n?.redirect)==null?void 0:i.universal:void 0}),be(this,"handleLinkModeMessage",({url:n})=>{if(!n||!n.includes("wc_ev")||!n.includes("topic"))return;const r=j$(n,"topic")||"",i=decodeURIComponent(j$(n,"wc_ev")||""),a=this.client.session.keys.includes(r);a&&this.client.session.update(r,{transportType:on.link_mode}),this.client.core.dispatchEnvelope({topic:r,message:i,sessionExists:a})}),be(this,"registerLinkModeListeners",async()=>{var n;if(ES()||gl()&&(n=this.client.metadata.redirect)!=null&&n.linkMode){const r=rt?.Linking;if(typeof r<"u"){r.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await r.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}),be(this,"getTVFParams",(n,r,i)=>{var a,s,o;if(!((a=r.request)!=null&&a.method))return{};const c={correlationId:n,rpcMethods:[r.request.method],chainId:r.chainId};try{const l=this.extractTxHashesFromResult(r.request,i);c.txHashes=l,c.contractAddresses=this.isValidContractData(r.request.params)?[(o=(s=r.request.params)==null?void 0:s[0])==null?void 0:o.to]:[]}catch(l){this.client.logger.warn(l,"Error getting TVF params")}return c}),be(this,"isValidContractData",n=>{var r;if(!n)return!1;try{const i=n?.data||((r=n?.[0])==null?void 0:r.data);if(!i.startsWith("0x"))return!1;const a=i.slice(2);return/^[0-9a-fA-F]*$/.test(a)?a.length%2===0:!1}catch{}return!1}),be(this,"extractTxHashesFromResult",(n,r)=>{var i;try{if(!r)return[];const a=n.method,s=$Ne[a];if(a==="sui_signTransaction")return[TTe(r.transactionBytes)];if(a==="near_signTransaction")return[K$(r)];if(a==="near_signTransactions")return r.map(c=>K$(c));if(a==="xrpl_signTransactionFor"||a==="xrpl_signTransaction")return[(i=r.tx_json)==null?void 0:i.hash];if(a==="polkadot_signTransaction")return[T$e({transaction:n.params.transactionPayload,signature:r.signature})];if(a==="algo_signTxn")return ba(r)?r.map(c=>G$(c)):[G$(r)];if(a==="cosmos_signDirect")return[kTe(r)];if(a==="wallet_sendCalls")return $Te(r);if(typeof r=="string")return[r];const o=r[s.key];if(ba(o))return a==="solana_signAllTransactions"?o.map(c=>ITe(c)):o;if(typeof o=="string")return[o]}catch(a){this.client.logger.warn(a,"Error extracting tx hashes from result")}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,n=this.client.core.relayer.messages.getWithoutAck(e);for(const[r,i]of Object.entries(n))for(const a of i)try{await this.onProviderMessageEvent({topic:r,message:a,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${r}, message: ${a}`)}}catch(e){this.client.logger.warn(e,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){const{message:e}=Re("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on($n.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:n,message:r,attestation:i,transportType:a}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(rg)?this.client.auth.authKeys.get(rg):{responseTopic:void 0,publicKey:void 0};try{const o=await this.client.core.crypto.decode(n,r,{receiverPublicKey:s,encoding:a===on.link_mode?Mc:Ci});DS(o)?(this.client.core.history.set(n,o),await this.onRelayEventRequest({topic:n,payload:o,attestation:i,transportType:a,encryptedId:pa(r)})):Lv(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:n,payload:o,transportType:a}),this.client.core.history.delete(n,o.id)):await this.onRelayEventUnknownPayload({topic:n,payload:o,transportType:a}),await this.client.core.relayer.messages.ack(n,r)}catch(o){this.client.logger.error(o)}}registerExpirerEvents(){this.client.core.expirer.on(da.expired,async e=>{const{topic:n,id:r}=Zq(e.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,Re("EXPIRED"),!0);if(r&&this.client.auth.requests.keys.includes(r))return await this.deletePendingAuthRequest(r,Re("EXPIRED"),!0);n?this.client.session.keys.includes(n)&&(await this.deleteSession({topic:n,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:n})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))})}registerPairingEvents(){this.client.core.pairing.events.on(Vl.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Vl.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!Vn(e,!1)){const{message:n}=Re("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(n)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:n}=Re("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(n)}if(Ss(this.client.core.pairing.pairings.get(e).expiry)){const{message:n}=Re("EXPIRED",`pairing topic: ${e}`);throw new Error(n)}}async isValidSessionTopic(e){if(!Vn(e,!1)){const{message:n}=Re("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(n)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:n}=Re("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(n)}if(Ss(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:n}=Re("EXPIRED",`session topic: ${e}`);throw new Error(n)}if(!this.client.core.crypto.keychain.has(e)){const{message:n}=Re("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(n)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Vn(e,!1)){const{message:n}=Re("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(n)}else{const{message:n}=Re("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(n)}}async isValidProposalId(e){if(!i$e(e)){const{message:n}=Re("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(n)}if(!this.client.proposal.keys.includes(e)){const{message:n}=Re("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(n)}if(Ss(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:n}=Re("EXPIRED",`proposal id: ${e}`);throw new Error(n)}}}class qNe extends Bu{constructor(e,n){super(e,n,TNe,US),this.core=e,this.logger=n}}let zNe=class extends Bu{constructor(e,n){super(e,n,LNe,US),this.core=e,this.logger=n}};class ZNe extends Bu{constructor(e,n){super(e,n,PNe,US,r=>r.id),this.core=e,this.logger=n}}class KNe extends Bu{constructor(e,n){super(e,n,NNe,$v,()=>rg),this.core=e,this.logger=n}}class GNe extends Bu{constructor(e,n){super(e,n,DNe,$v),this.core=e,this.logger=n}}class YNe extends Bu{constructor(e,n){super(e,n,FNe,$v,r=>r.id),this.core=e,this.logger=n}}var JNe=Object.defineProperty,XNe=(t,e,n)=>e in t?JNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,T4=(t,e,n)=>XNe(t,typeof e!="symbol"?e+"":e,n);class QNe{constructor(e,n){this.core=e,this.logger=n,T4(this,"authKeys"),T4(this,"pairingTopics"),T4(this,"requests"),this.authKeys=new KNe(this.core,this.logger),this.pairingTopics=new GNe(this.core,this.logger),this.requests=new YNe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var eDe=Object.defineProperty,tDe=(t,e,n)=>e in t?eDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,At=(t,e,n)=>tDe(t,typeof e!="symbol"?e+"":e,n);let nDe=class CZ extends bPe{constructor(e){super(e),At(this,"protocol",wZ),At(this,"version",bZ),At(this,"name",x4.name),At(this,"metadata"),At(this,"core"),At(this,"logger"),At(this,"events",new Sa.EventEmitter),At(this,"engine"),At(this,"session"),At(this,"proposal"),At(this,"pendingRequest"),At(this,"auth"),At(this,"signConfig"),At(this,"on",(r,i)=>this.events.on(r,i)),At(this,"once",(r,i)=>this.events.once(r,i)),At(this,"off",(r,i)=>this.events.off(r,i)),At(this,"removeListener",(r,i)=>this.events.removeListener(r,i)),At(this,"removeAllListeners",r=>this.events.removeAllListeners(r)),At(this,"connect",async r=>{try{return await this.engine.connect(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"pair",async r=>{try{return await this.engine.pair(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"approve",async r=>{try{return await this.engine.approve(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"reject",async r=>{try{return await this.engine.reject(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"update",async r=>{try{return await this.engine.update(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"extend",async r=>{try{return await this.engine.extend(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"request",async r=>{try{return await this.engine.request(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"respond",async r=>{try{return await this.engine.respond(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"ping",async r=>{try{return await this.engine.ping(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"emit",async r=>{try{return await this.engine.emit(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"disconnect",async r=>{try{return await this.engine.disconnect(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"find",r=>{try{return this.engine.find(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(r){throw this.logger.error(r.message),r}}),At(this,"authenticate",async(r,i)=>{try{return await this.engine.authenticate(r,i)}catch(a){throw this.logger.error(a.message),a}}),At(this,"formatAuthMessage",r=>{try{return this.engine.formatAuthMessage(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"approveSessionAuthenticate",async r=>{try{return await this.engine.approveSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),At(this,"rejectSessionAuthenticate",async r=>{try{return await this.engine.rejectSessionAuthenticate(r)}catch(i){throw this.logger.error(i.message),i}}),this.name=e?.name||x4.name,this.metadata=bIe(e?.metadata),this.signConfig=e?.signConfig;const n=MS({logger:e?.logger||x4.logger,name:this.name});this.logger=n,this.core=e?.core||new INe(e),this.session=new zNe(this.core,this.logger),this.proposal=new qNe(this.core,this.logger),this.pendingRequest=new ZNe(this.core,this.logger),this.engine=new WNe(this),this.auth=new QNe(this.core,this.logger)}static async init(e){const n=new CZ(e);return await n.initialize(),n}get context(){return Ri(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};const rDe=nDe;var gb={exports:{}};(function(t,e){var n=typeof self<"u"?self:_s,r=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(s){var o={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(S){return S&&DataView.prototype.isPrototypeOf(S)}if(o.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
102]"],u=ArrayBuffer.isView||function(S){return S&&l.indexOf(Object.prototype.toString.call(S))>-1};function d(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(S))throw new TypeError("Invalid character in header field name");return S.toLowerCase()}function f(S){return typeof S!="string"&&(S=String(S)),S}function h(S){var I={next:function(){var A=S.shift();return{done:A===void 0,value:A}}};return o.iterable&&(I[Symbol.iterator]=function(){return I}),I}function p(S){this.map={},S instanceof p?S.forEach(function(I,A){this.append(A,I)},this):Array.isArray(S)?S.forEach(function(I){this.append(I[0],I[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(I){this.append(I,S[I])},this)}p.prototype.append=function(S,I){S=d(S),I=f(I);var A=this.map[S];this.map[S]=A?A+", "+I:I},p.prototype.delete=function(S){delete this.map[d(S)]},p.prototype.get=function(S){return S=d(S),this.has(S)?this.map[S]:null},p.prototype.has=function(S){return this.map.hasOwnProperty(d(S))},p.prototype.set=function(S,I){this.map[d(S)]=f(I)},p.prototype.forEach=function(S,I){for(var A in this.map)this.map.hasOwnProperty(A)&&S.call(I,this.map[A],A,this)},p.prototype.keys=function(){var S=[];return this.forEach(function(I,A){S.push(A)}),h(S)},p.prototype.values=function(){var S=[];return this.forEach(function(I){S.push(I)}),h(S)},p.prototype.entries=function(){var S=[];return this.forEach(function(I,A){S.push([A,I])}),h(S)},o.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function g(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function y(S){return new Promise(function(I,A){S.onload=function(){I(S.result)},S.onerror=function(){A(S.error)}})}function v(S){var I=new FileReader,A=y(I);return I.readAsArrayBuffer(S),A}function b(S){var I=new FileReader,A=y(I);return I.readAsText(S),A}function w(S){for(var I=new Uint8Array(S),A=new Array(I.length),R=0;R<I.length;R++)A[R]=String.fromCharCode(I[R]);return A.join("")}function _(S){if(S.slice)return S.slice(0);var I=new Uint8Array(S.byteLength);return I.set(new Uint8Array(S)),I.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(S){this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:o.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:o.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():o.arrayBuffer&&o.blob&&c(S)?(this._bodyArrayBuffer=_(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||u(S))?this._bodyArrayBuffer=_(S):this._bodyText=S=Object.prototype.toString.call(S):this._bodyText="",this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var S=g(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var S=g(this);if(S)return S;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(w(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(T)}),this.json=function(){return this.text().then(JSON.parse)},this}var C=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(S){var I=S.toUpperCase();return C.indexOf(I)>-1?I:S}function $(S,I){I=I||{};var A=I.body;if(S instanceof $){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,I.headers||(this.headers=new p(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!A&&S._bodyInit!=null&&(A=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=I.credentials||this.credentials||"same-origin",(I.headers||!this.headers)&&(this.headers=new p(I.headers)),this.method=x(I.method||this.method||"GET"),this.mode=I.mode||this.mode||null,this.signal=I.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&A)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(A)}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function T(S){var I=new FormData;return S.trim().split("&").forEach(function(A){if(A){var R=A.split("="),N=R.shift().replace(/\+/g," "),P=R.join("=").replace(/\+/g," ");I.append(decodeURIComponent(N),decodeURIComponent(P))}}),I}function U(S){var I=new p,A=S.replace(/\r?\n[\t ]+/g," ");
102return A.split(/\r?\n/).forEach(function(R){var N=R.split(":"),P=N.shift().trim();if(P){var j=N.join(":").trim();I.append(P,j)}}),I}E.call($.prototype);function O(S,I){I||(I={}),this.type="default",this.status=I.status===void 0?200:I.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in I?I.statusText:"OK",this.headers=new p(I.headers),this.url=I.url||"",this._initBody(S)}E.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},O.error=function(){var S=new O(null,{status:0,statusText:""});return S.type="error",S};var F=[301,302,303,307,308];O.redirect=function(S,I){if(F.indexOf(I)===-1)throw new RangeError("Invalid status code");return new O(null,{status:I,headers:{location:S}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function(I,A){this.message=I,this.name=A;var R=Error(I);this.stack=R.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function k(S,I){return new Promise(function(A,R){var N=new $(S,I);if(N.signal&&N.signal.aborted)return R(new s.DOMException("Aborted","AbortError"));var P=new XMLHttpRequest;function j(){P.abort()}P.onload=function(){var M={status:P.status,statusText:P.statusText,headers:U(P.getAllResponseHeaders()||"")};M.url="responseURL"in P?P.responseURL:M.headers.get("X-Request-URL");var V="response"in P?P.response:P.responseText;A(new O(V,M))},P.onerror=function(){R(new TypeError("Network request failed"))},P.ontimeout=function(){R(new TypeError("Network request failed"))},P.onabort=function(){R(new s.DOMException("Aborted","AbortError"))},P.open(N.method,N.url,!0),N.credentials==="include"?P.withCredentials=!0:N.credentials==="omit"&&(P.withCredentials=!1),"responseType"in P&&o.blob&&(P.responseType="blob"),N.headers.forEach(function(M,V){P.setRequestHeader(V,M)}),N.signal&&(N.signal.addEventListener("abort",j),P.onreadystatechange=function(){P.readyState===4&&N.signal.removeEventListener("abort",j)}),P.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}return k.polyfill=!0,a.fetch||(a.fetch=k,a.Headers=p,a.Request=$,a.Response=O),s.Headers=p,s.Request=$,s.Response=O,s.fetch=k,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(gb,gb.exports);var iDe=gb.exports;const wR=Zs(iDe);var aDe=Object.defineProperty,sDe=Object.defineProperties,oDe=Object.getOwnPropertyDescriptors,bR=Object.getOwnPropertySymbols,cDe=Object.prototype.hasOwnProperty,lDe=Object.prototype.propertyIsEnumerable,_R=(t,e,n)=>e in t?aDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,CR=(t,e)=>{for(var n in e||(e={}))cDe.call(e,n)&&_R(t,n,e[n]);if(bR)for(var n of bR(e))lDe.call(e,n)&&_R(t,n,e[n]);return t},ER=(t,e)=>sDe(t,oDe(e));const uDe={Accept:"application/json","Content-Type":"application/json"},dDe="POST",SR={headers:uDe,method:dDe},AR=10;let EZ=class{constructor(e,n=!1){if(this.url=e,this.disableProviderPing=n,this.events=new Sa.EventEmitter,this.isAvailable=!1,this.registering=!1,!VP(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=n}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}off(e,n){this.events.off(e,n)}removeListener(e,n){this.events.removeListener(e,n)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const n=Bo(e),r=await(await wR(this.url,ER(CR({},SR),{body:n}))).json();this.onPayload({data:r})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!VP(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const n=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),new Promise((r,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));r()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const n=Bo({id:1,jsonrpc:"2.0",method:"test",params:[]});await wR(e,ER(CR({},SR),{body:n}))}this.onOpen()}catch(n){const r=this.parseError(n);throw this.events.emit("register_error",r),this.onClose(),r}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;
vendor: 27,329 bytes, line 102
102const n=typeof e.data=="string"?Su(e.data):e.data;this.events.emit("payload",n)}onError(e,n){const r=this.parseError(n),i=r.message||r.toString(),a=Tv(e,i);this.events.emit("payload",a)}parseError(e,n=this.url){return Xz(e,n,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>AR&&this.events.setMaxListeners(AR)}};function jS(t){return t==null||typeof t!="object"&&typeof t!="function"}function SZ(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function AZ(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const fDe="[object RegExp]",xZ="[object String]",IZ="[object Number]",TZ="[object Boolean]",LZ="[object Arguments]",hDe="[object Symbol]",pDe="[object Date]",gDe="[object Map]",yDe="[object Set]",mDe="[object Array]",vDe="[object ArrayBuffer]",wDe="[object Object]",bDe="[object DataView]",_De="[object Uint8Array]",CDe="[object Uint8ClampedArray]",EDe="[object Uint16Array]",SDe="[object Uint32Array]",ADe="[object Int8Array]",xDe="[object Int16Array]",IDe="[object Int32Array]",TDe="[object Float32Array]",LDe="[object Float64Array]";function BS(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function kDe(t,e){return $d(t,void 0,t,new Map,e)}function $d(t,e,n,r=new Map,i=void 0){const a=i?.(t,e,n,r);if(a!=null)return a;if(jS(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){const s=new Array(t.length);r.set(t,s);for(let o=0;o<t.length;o++)s[o]=$d(t[o],o,n,r,i);return Object.hasOwn(t,"index")&&(s.index=t.index),Object.hasOwn(t,"input")&&(s.input=t.input),s}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const s=new RegExp(t.source,t.flags);return s.lastIndex=t.lastIndex,s}if(t instanceof Map){const s=new Map;r.set(t,s);for(const[o,c]of t)s.set(o,$d(c,o,n,r,i));return s}if(t instanceof Set){const s=new Set;r.set(t,s);for(const o of t)s.add($d(o,void 0,n,r,i));return s}if(typeof De<"u"&&De.isBuffer(t))return t.subarray();if(BS(t)){const s=new(Object.getPrototypeOf(t)).constructor(t.length);r.set(t,s);for(let o=0;o<t.length;o++)s[o]=$d(t[o],o,n,r,i);return s}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const s=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,s),Hl(s,t,n,r,i),s}if(typeof File<"u"&&t instanceof File){const s=new File([t],t.name,{type:t.type});return r.set(t,s),Hl(s,t,n,r,i),s}if(t instanceof Blob){const s=new Blob([t],{type:t.type});return r.set(t,s),Hl(s,t,n,r,i),s}if(t instanceof Error){const s=new t.constructor;return r.set(t,s),s.message=t.message,s.name=t.name,s.stack=t.stack,s.cause=t.cause,Hl(s,t,n,r,i),s}if(typeof t=="object"&&$De(t)){const s=Object.create(Object.getPrototypeOf(t));return r.set(t,s),Hl(s,t,n,r,i),s}return t}function Hl(t,e,n=t,r,i){const a=[...Object.keys(e),...SZ(e)];for(let s=0;s<a.length;s++){const o=a[s],c=Object.getOwnPropertyDescriptor(t,o);(c==null||c.writable)&&(t[o]=$d(e[o],o,n,r,i))}}function $De(t){switch(AZ(t)){case LZ:case mDe:case vDe:case bDe:case TZ:case pDe:case TDe:case LDe:case ADe:case xDe:case IDe:case gDe:case IZ:case wDe:case fDe:case yDe:case xZ:case hDe:case _De:case CDe:case EDe:case SDe:return!0;default:return!1}}function PDe(t,e){return kDe(t,(n,r,i,a)=>{if(typeof t=="object")switch(Object.prototype.toString.call(t)){case IZ:case xZ:case TZ:{const s=new t.constructor(t?.valueOf());return Hl(s,t),s}case LZ:{const s={};return Hl(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}})}function xR(t){return PDe(t)}function IR(t){return t!==null&&typeof t=="object"&&AZ(t)==="[object Arguments]"}function TR(t){return typeof t=="object"&&t!==null}function RDe(){}function ODe(t){return BS(t)}function MDe(t){if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function NDe(t){if(jS(t))return t;if(Array.isArray(t)||BS(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t),n=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new n(t);if(t instanceof RegExp){const r=new n(t);return r.lastIndex=t.lastIndex,r}if(t instanceof DataView)return new n(t.buffer.slice(0));if(t instanceof Error){const r=new n(t.message);return r.stack=t.stack,r.name=t.name,r.cause=t.cause,r}if(typeof File<"u"&&t instanceof File)return new n([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t=="object"){const r=Object.create(e);return Object.assign(r,t)}return t}function DDe(t,...e){const n=e.slice(0,-1),r=e[e.length-1];let i=t;for(let a=0;a<n.length;a++){const s=n[a];i=yb(i,s,r,new Map)}return i}function yb(t,e,n,r){if(jS(t)&&(t=Object(t)),e==null||typeof e!="object")return t;if(r.has(e))return NDe(r.get(e));if(r.set(e,t),Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]=e[a]??void 0}const i=[...Object.keys(e),...SZ(e)];for(let a=0;a<i.length;a++){const s=i[a];let o=e[s],c=t[s];if(IR(o)&&(o={...o}),IR(c)&&(c={...c}),typeof De<"u"&&De.isBuffer(o)&&(o=xR(o)),Array.isArray(o))if(typeof c=="object"&&c!=null){const u=[],d=Reflect.ownKeys(c);for(let f=0;f<d.length;f++){const h=d[f];u[h]=c[h]}c=u}else c=[];const l=n(c,o,s,t,e,r);l!=null?t[s]=l:Array.isArray(o)||TR(c)&&TR(o)?t[s]=yb(c,o,n,r):c==null&&MDe(o)?t[s]=yb({},o,n,r):c==null&&ODe(o)?t[s]=xR(o):(c===void 0||o!==void 0)&&(t[s]=o)}return t}function FDe(t,...e){return DDe(t,...e,RDe)}const LR="error",UDe="wss://relay.walletconnect.org",jDe="wc",kZ="universal_provider",e3=`${jDe}@2:${kZ}:`,$Z="https://rpc.walletconnect.org/v1/",PZ="generic",BDe=`${$Z}bundler`,Yd="call_status",VDe=86400,VS={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var HDe=Object.defineProperty,WDe=Object.defineProperties,qDe=Object.getOwnPropertyDescriptors,kR=Object.getOwnPropertySymbols,zDe=Object.prototype.hasOwnProperty,ZDe=Object.prototype.propertyIsEnumerable,$R=(t,e,n)=>e in t?HDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,t3=(t,e)=>{for(var n in e||(e={}))zDe.call(e,n)&&$R(t,n,e[n]);if(kR)for(var n of kR(e))ZDe.call(e,n)&&$R(t,n,e[n]);return t},KDe=(t,e)=>WDe(t,qDe(e));function RZ(t,e,n){var r;const i=Ro(t);return((r=e.rpcMap)==null?void 0:r[i.reference])||`${$Z}?chainId=${i.namespace}:${i.reference}&projectId=${n}`}function GDe(t){return t.includes(":")?t.split(":")[1]:t}function OZ(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function YDe(t,e){const n=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!n.length)return[];const r=[];return n.forEach(i=>{const a=e.namespaces[i].accounts;r.push(...a)}),r}function PR(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>{var r,i;return((r=n?.chains)==null?void 0:r.length)&&((i=n?.chains)==null?void 0:i.length)>0}))}function n3(t={},e={}){const n=PR(RR(t)),r=PR(RR(e));return FDe(n,r)}function RR(t){var e,n,r,i,a;const s={};if(!Ds(t))return s;for(const[o,c]of Object.entries(t)){const l=Iv(o)?[o]:c.chains,u=c.methods||[],d=c.events||[],f=c.rpcMap||{},h=kd(o);s[h]=KDe(t3(t3({},s[h]),c),{chains:Ns(l,(e=s[h])==null?void 0:e.chains),methods:Ns(u,(n=s[h])==null?void 0:n.methods),events:Ns(d,(r=s[h])==null?void 0:r.events)}),(Ds(f)||Ds(((i=s[h])==null?void 0:i.rpcMap)||{}))&&(s[h].rpcMap=t3(t3({},f),(a=s[h])==null?void 0:a.rpcMap))}return s}function OR(t){return t.includes(":")?t.split(":")[2]:t}function MR(t){const e={};for(const[n,r]of Object.entries(t)){const i=r.methods||[],a=r.events||[],s=r.accounts||[],o=Iv(n)?[n]:r.chains?r.chains:OZ(r.accounts);e[n]={chains:o,methods:i,events:a,accounts:s}}return e}function L4(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}function JDe(t){try{const e=JSON.parse(t);return typeof e=="object"&&e!==null&&!Array.isArray(e)}catch{return!1}}const MZ={},Jd=t=>MZ[t],k4=(t,e)=>{MZ[t]=e};var XDe=Object.defineProperty,NR=Object.getOwnPropertySymbols,QDe=Object.prototype.hasOwnProperty,eFe=Object.prototype.propertyIsEnumerable,DR=(t,e,n)=>e in t?XDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,FR=(t,e)=>{for(var n in e||(e={}))QDe.call(e,n)&&DR(t,n,e[n]);if(NR)for(var n of NR(e))eFe.call(e,n)&&DR(t,n,e[n]);return t};const UR="eip155",tFe=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],nFe=t=>t&&t.startsWith("0x")?BigInt(t).toString(10):t,$4=t=>t&&t.startsWith("0x")?t:`0x${BigInt(t).toString(16)}`,jR=t=>Object.keys(t).filter(e=>tFe.includes(e)).reduce((e,n)=>(e[n]=rFe(t[n]),e),{}),rFe=t=>typeof t=="string"&&JDe(t)?JSON.parse(t):t,iFe=(t,e,n)=>{const{sessionProperties:r={},scopedProperties:i={}}=t,a={};if(!Ds(i)&&!Ds(r))return;const s=jR(r);for(const o of n){const c=nFe(o);if(!c)continue;a[$4(c)]=s;const l=i?.[`${UR}:${c}`];if(l){const u=l?.[`${UR}:${c}:${e}`];a[$4(c)]=FR(FR({},a[$4(c)]),jR(u||l))}}for(const[o,c]of Object.entries(a))Object.keys(c).length===0&&delete a[o];return Object.keys(a).length>0?a:void 0};var aFe=Object.defineProperty,sFe=(t,e,n)=>e in t?aFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oFe=(t,e,n)=>sFe(t,e+"",n);let P4,cFe=class NZ{constructor(e){oFe(this,"storage"),this.storage=e}async getItem(e){return await this.storage.getItem(e)}async setItem(e,n){return await this.storage.setItem(e,n)}async removeItem(e){return await this.storage.removeItem(e)}static getStorage(e){return P4||(P4=new NZ(e)),P4}};var lFe=Object.defineProperty,uFe=Object.defineProperties,dFe=Object.getOwnPropertyDescriptors,BR=Object.getOwnPropertySymbols,fFe=Object.prototype.hasOwnProperty,hFe=Object.prototype.propertyIsEnumerable,VR=(t,e,n)=>e in t?lFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,pFe=(t,e)=>{for(var n in e||(e={}))fFe.call(e,n)&&VR(t,n,e[n]);if(BR)for(var n of BR(e))hFe.call(e,n)&&VR(t,n,e[n]);return t},gFe=(t,e)=>uFe(t,dFe(e));async function yFe(t,e){const n=Ro(t.result.capabilities.caip345.caip2),r=t.result.capabilities.caip345.transactionHashes,i=await Promise.allSettled(r.map(d=>mFe(n.reference,d,e))),a=i.filter(d=>d.status==="fulfilled").map(d=>d.value).filter(d=>d);i.filter(d=>d.status==="rejected").forEach(d=>console.warn("Failed to fetch transaction receipt:",d.reason));const s=!a.length||a.some(d=>!d),o=a.every(d=>d?.status==="0x1"),c=a.every(d=>d?.status==="0x0"),l=a.some(d=>d?.status==="0x0");let u;return s?u=100:o?u=200:c?u=500:l&&(u=600),{id:t.result.id,version:t.request.version,atomic:t.request.atomicRequired,chainId:t.request.chainId,capabilities:t.result.capabilities,receipts:a,status:u}}async function mFe(t,e,n){return await n(parseInt(t)).request(Wa("eth_getTransactionReceipt",[e]))}async function vFe({sendCalls:t,storage:e}){const n=await e.getItem(Yd);await e.setItem(Yd,gFe(pFe({},n),{[t.result.id]:{request:t.request,result:t.result,expiry:Un(VDe)}}))}async function wFe({resultId:t,storage:e}){const n=await e.getItem(Yd);if(n){delete n[t],await e.setItem(Yd,n);for(const r in n)Ss(n[r].expiry)&&delete n[r];await e.setItem(Yd,n)}}async function bFe({resultId:t,storage:e}){const n=await e.getItem(Yd),r=n?.[t];if(r&&!Ss(r.expiry))return r;await wFe({resultId:t,storage:e})}var _Fe=Object.defineProperty,CFe=Object.defineProperties,EFe=Object.getOwnPropertyDescriptors,HR=Object.getOwnPropertySymbols,SFe=Object.prototype.hasOwnProperty,AFe=Object.prototype.propertyIsEnumerable,mb=(t,e,n)=>e in t?_Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,R4=(t,e)=>{for(var n in e||(e={}))SFe.call(e,n)&&mb(t,n,e[n]);if(HR)for(var n of HR(e))AFe.call(e,n)&&mb(t,n,e[n]);return t},O4=(t,e)=>CFe(t,EFe(e)),Ll=(t,e,n)=>mb(t,typeof e!="symbol"?e+"":e,n);let xFe=class{constructor(e){Ll(this,"name","eip155"),Ll(this,"client"),Ll(this,"chainId"),Ll(this,"namespace"),Ll(this,"httpProviders"),Ll(this,"events"),Ll(this,"storage"),this.namespace=e.namespace,this.events=Jd("events"),this.client=Jd("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=cFe.getStorage(this.client.core.storage)}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e);case"wallet_sendCalls":return await this.sendCalls(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(parseInt(e),n);const r=this.chainId;this.chainId=parseInt(e),this.events.emit(VS.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,n){const r=n||RZ(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new FS(new EZ(r,Jd("disableProviderPing")))}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProviders(){const e={};return this.namespace.chains.forEach(n=>{var r;const i=parseInt(GDe(n));e[i]=this.createHttpProvider(i,(r=this.namespace.rpcMap)==null?void 0:r[n])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}getHttpProvider(e){const n=e||this.chainId;return this.httpProviders[n]||(this.httpProviders=O4(R4({},this.httpProviders),{[n]:this.createHttpProvider(n)}),this.httpProviders[n])}async handleSwitchChain(e){var n,r;let i=e.request.params?(n=e.request.params[0])==null?void 0:n.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(r=this.namespace.chains)==null?void 0:r[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var n,r,i,a,s;const o=(r=(n=e.request)==null?void 0:n.params)==null?void 0:r[0],c=((a=(i=e.request)==null?void 0:i.params)==null?void 0:a[1])||[];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const l=this.client.session.get(e.topic),u=((s=l?.sessionProperties)==null?void 0:s.capabilities)||{},d=`${o}${c.join(",")}`,f=u?.[d];if(f)return f;let h;try{h=iFe(l,o,c)}catch(g){console.warn("Failed to extract capabilities from session",g)}if(h)return h;const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:O4(R4({},l.sessionProperties||{}),{capabilities:O4(R4({},u||{}),{[d]:p})})})}catch(g){console.warn("Failed to update session with capabilities",g)}return p}async getCallStatus(e){var n,r,i;const a=this.client.session.get(e.topic),s=(n=a.sessionProperties)==null?void 0:n.bundler_name;if(s){const l=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(l,e)}catch(u){console.warn("Failed to fetch call status from bundler",u,l)}}const o=(r=a.sessionProperties)==null?void 0:r.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(l){console.warn("Failed to fetch call status from custom bundler",l,o)}const c=await bFe({resultId:(i=e.request.params)==null?void 0:i[0],storage:this.storage});if(c)try{return await yFe(c,this.getHttpProvider.bind(this))}catch(l){console.warn("Failed to fetch call status from stored send calls",l,c)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,n){var r;const i=new URL(e),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Wa("eth_getUserOperationReceipt",[(r=n.request.params)==null?void 0:r[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}getBundlerUrl(e,n){return`${BDe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${n}`}async sendCalls(e){var n,r,i;const a=await this.client.request(e),s=(n=e.request.params)==null?void 0:n[0],o=a?.id,c=a?.capabilities||{},l=(r=c?.caip345)==null?void 0:r.caip2,u=(i=c?.caip345)==null?void 0:i.transactionHashes;return!o||!l||!(u!=null&&u.length)||await vFe({sendCalls:{request:s,result:a},storage:this.storage}),a}};var IFe=Object.defineProperty,TFe=(t,e,n)=>e in t?IFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fd=(t,e,n)=>TFe(t,typeof e!="symbol"?e+"":e,n);let LFe=class{constructor(e){fd(this,"name",PZ),fd(this,"client"),fd(this,"httpProviders"),fd(this,"events"),fd(this,"namespace"),fd(this,"chainId"),this.namespace=e.namespace,this.events=Jd("events"),this.client=Jd("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,n){this.httpProviders[e]||this.setHttpProvider(e,n);const r=this.chainId;this.chainId=e,this.events.emit(VS.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${r}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return Ro(e).namespace}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(n=>n.split(":")[1]===this.chainId.toString()).map(n=>n.split(":")[2]))]:[]}createHttpProviders(){var e,n;const r={};return(n=(e=this.namespace)==null?void 0:e.accounts)==null||n.forEach(i=>{var a,s;const o=Ro(i),c=(s=(a=this.namespace)==null?void 0:a.rpcMap)==null?void 0:s[`${o.namespace}:${o.reference}`];r[o.reference]=this.createHttpProvider(i,c)}),r}getHttpProvider(e){const n=Ro(e).reference,r=this.httpProviders[n];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,n){const r=this.createHttpProvider(e,n);r&&(this.httpProviders[e]=r)}createHttpProvider(e,n){const r=n||RZ(e,this.namespace,this.client.core.projectId);if(!r)throw new Error(`No RPC url provided for chainId: ${e}`);return new FS(new EZ(r,Jd("disableProviderPing")))}};var kFe=Object.defineProperty,$Fe=Object.defineProperties,PFe=Object.getOwnPropertyDescriptors,WR=Object.getOwnPropertySymbols,RFe=Object.prototype.hasOwnProperty,OFe=Object.prototype.propertyIsEnumerable,vb=(t,e,n)=>e in t?kFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yf=(t,e)=>{for(var n in e||(e={}))RFe.call(e,n)&&vb(t,n,e[n]);if(WR)for(var n of WR(e))OFe.call(e,n)&&vb(t,n,e[n]);return t},r3=(t,e)=>$Fe(t,PFe(e)),la=(t,e,n)=>vb(t,typeof e!="symbol"?e+"":e,n);let MFe=class DZ{constructor(e){la(this,"client"),la(this,"namespaces"),la(this,"optionalNamespaces"),la(this,"sessionProperties"),la(this,"scopedProperties"),la(this,"events",new J_),la(this,"rpcProviders",{}),la(this,"session"),la(this,"providerOpts"),la(this,"logger"),la(this,"uri"),la(this,"disableProviderPing",!1);var n,r;this.providerOpts=e,this.logger=MS({logger:(n=e.logger)!=null?n:LR,name:(r=this.providerOpts.name)!=null?r:kZ}),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const n=new DZ(e);return await n.initialize(),n}async request(e,n,r){const[i,a]=this.validateChain(n);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Yf({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:r})}sendAsync(e,n,r,i){const a=new Date().getTime();this.request(e,r,i).then(s=>n(null,Fp(a,s))).catch(s=>n(s,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:ln("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,n){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(e,n);r&&(this.uri=r,this.events.emit("display_uri",r));const a=await i();if(this.session=a.session,this.session){const s=MR(this.session.namespaces);this.namespaces=n3(this.namespaces,s),await this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,n){this.events.on(e,n)}once(e,n){this.events.once(e,n)}removeListener(e,n){this.events.removeListener(e,n)}off(e,n){this.events.off(e,n)}get isWalletConnect(){return!0}async pair(e){const{uri:n,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});n&&(this.uri=n,this.events.emit("display_uri",n));const i=await r();this.session=i;const a=MR(i.namespaces);return this.namespaces=n3(this.namespaces,a),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,n){try{if(!this.session)return;const[r,i]=this.validateChain(e);this.getProvider(r).setDefaultChain(i,n)}catch(r){if(!/Please call connect/.test(r.message))throw r}}async cleanupPendingPairings(e={}){try{this.logger.info("Cleaning up inactive pairings...");const n=this.client.pairing.getAll();if(!ba(n))return;for(const r of n)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${n.length}`)}catch(n){this.logger.warn(n,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,n;if(this.client=this.providerOpts.client||await rDe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||LR,relayUrl:this.providerOpts.relayUrl||UDe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(r){throw this.logger.error(r,"Failed to get session"),new Error(`The provided session: ${(n=(e=this.providerOpts)==null?void 0:e.session)==null?void 0:n.topic} doesn't exist in the Sign client`)}else{const r=this.client.session.getAll();this.session=r[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(n=>kd(n)))];k4("client",this.client),k4("events",this.events),k4("disableProviderPing",this.disableProviderPing),e.forEach(n=>{if(!this.session)return;const r=YDe(n,this.session);if(r?.length===0)return;const i=OZ(r),a=n3(this.namespaces,this.optionalNamespaces),s=r3(Yf({},a[n]),{accounts:r,chains:i});switch(n){case"eip155":this.rpcProviders[n]=new xFe({namespace:s});break;default:this.rpcProviders[n]=new LFe({namespace:s})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var n;const{topic:r}=e;r===((n=this.session)==null?void 0:n.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var n;const{params:r,topic:i}=e;if(i!==((n=this.session)==null?void 0:n.topic))return;const{event:a}=r;if(a.name==="accountsChanged"){const s=a.data;s&&ba(s)&&this.events.emit("accountsChanged",s.map(OR))}else if(a.name==="chainChanged"){const s=r.chainId,o=r.event.data,c=kd(s),l=L4(s)!==L4(o)?`${c}:${L4(o)}`:s;this.onChainChanged({currentCaipChainId:l})}else this.events.emit(a.name,a.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:n})=>{var r,i;if(e!==((r=this.session)==null?void 0:r.topic))return;const{namespaces:a}=n,s=(i=this.client)==null?void 0:i.session.get(e);this.session=r3(Yf({},s),{namespaces:a}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:n})}),this.client.on("session_delete",async e=>{var n;e.topic===((n=this.session)==null?void 0:n.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",r3(Yf({},ln("USER_DISCONNECTED")),{data:e.topic})))}),this.on(VS.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(r3(Yf({},e),{internal:!0}))})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[PZ]}
102onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var n;this.getProvider(e).updateNamespace((n=this.session)==null?void 0:n.namespaces[e])})}setNamespaces(e){const{namespaces:n={},optionalNamespaces:r={},sessionProperties:i,scopedProperties:a}=e;this.optionalNamespaces=n3(n,r),this.sessionProperties=i,this.scopedProperties=a}validateChain(e){const[n,r]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[n,r];if(n&&!Object.keys(this.namespaces||{}).map(s=>kd(s)).includes(n))throw new Error(`Namespace '${n}' is not configured. Please call connect() first with namespace config.`);if(n&&r)return[n,r];const i=kd(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged({currentCaipChainId:e,previousCaipChainId:n,internal:r=!1}){if(!this.namespaces)return;const[i,a]=this.validateChain(e);a&&(this.updateNamespaceChain(i,a),r?(this.events.emit("chainChanged",a),this.emitAccountsChangedOnChainChange({namespace:i,currentCaipChainId:e,previousCaipChainId:n})):this.getProvider(i).setDefaultChain(a),await this.persist("namespaces",this.namespaces))}emitAccountsChangedOnChainChange({namespace:e,currentCaipChainId:n,previousCaipChainId:r}){var i,a;try{if(r===n)return;const s=(a=(i=this.session)==null?void 0:i.namespaces[e])==null?void 0:a.accounts;if(!s)return;const o=s.filter(c=>c.includes(`${n}:`)).map(OR);if(!ba(o))return;this.events.emit("accountsChanged",o)}catch(s){this.logger.warn(s,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(e,n){if(!this.namespaces)return;const r=this.namespaces[e]?e:`${e}:${n}`,i={chains:[],methods:[],events:[],defaultChain:n};this.namespaces[r]?this.namespaces[r]&&(this.namespaces[r].defaultChain=n):this.namespaces[r]=i}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,n){var r;const i=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.setItem(`${e3}/${e}${i}`,n)}async getFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";return await this.client.core.storage.getItem(`${e3}/${e}${r}`)}async deleteFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.removeItem(`${e3}/${e}${r}`)}async cleanupStorage(){var e;try{if(((e=this.client)==null?void 0:e.session.length)>0)return;const n=await this.client.core.storage.getKeys();for(const r of n)r.startsWith(e3)&&await this.client.core.storage.removeItem(r)}catch(n){this.logger.warn(n,"Failed to cleanup storage")}}};const NFe=MFe,DFe="wc",FFe="ethereum_provider",UFe=`${DFe}@2:${FFe}:`,jFe="https://rpc.walletconnect.org/v1/",wb=["eth_sendTransaction","personal_sign"],FZ=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],bb=["chainChanged","accountsChanged"],UZ=["chainChanged","accountsChanged","message","disconnect","connect"],BFe=async()=>{const{createAppKit:t}=await Ne(()=>import("./core-D1v2liPP.js").then(e=>e.Q),__vite__mapDeps([11,2,1,3,12,13]));return t};var VFe=Object.defineProperty,HFe=Object.defineProperties,WFe=Object.getOwnPropertyDescriptors,qR=Object.getOwnPropertySymbols,qFe=Object.prototype.hasOwnProperty,zFe=Object.prototype.propertyIsEnumerable,_b=(t,e,n)=>e in t?VFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ml=(t,e)=>{for(var n in e||(e={}))qFe.call(e,n)&&_b(t,n,e[n]);if(qR)for(var n of qR(e))zFe.call(e,n)&&_b(t,n,e[n]);return t},Jf=(t,e)=>HFe(t,WFe(e)),Ni=(t,e,n)=>_b(t,typeof e!="symbol"?e+"":e,n);function qy(t){return Number(t[0].split(":")[1])}function i3(t){return`0x${t.toString(16)}`}function ZFe(t){const{chains:e,optionalChains:n,methods:r,optionalMethods:i,events:a,optionalEvents:s,rpcMap:o}=t;if(!ba(e))throw new Error("Invalid chains");const c={chains:e,methods:r||wb,events:a||bb,rpcMap:Ml({},e.length?{[qy(e)]:o[qy(e)]}:{})},l=a?.filter(h=>!bb.includes(h)),u=r?.filter(h=>!wb.includes(h));if(!n&&!s&&!i&&!(l!=null&&l.length)&&!(u!=null&&u.length))return{required:e.length?c:void 0};const d=l?.length&&u?.length||!n,f={chains:[...new Set(d?c.chains.concat(n||[]):n)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:FZ))],events:[...new Set(c.events.concat(s!=null&&s.length?s:UZ))],rpcMap:o};return{required:e.length?c:void 0,optional:n.length?f:void 0}}let KFe=class jZ{constructor(){Ni(this,"events",new Sa.EventEmitter),Ni(this,"namespace","eip155"),Ni(this,"accounts",[]),Ni(this,"signer"),Ni(this,"chainId",1),Ni(this,"modal"),Ni(this,"rpc"),Ni(this,"STORAGE_KEY",UFe),Ni(this,"on",(e,n)=>(this.events.on(e,n),this)),Ni(this,"once",(e,n)=>(this.events.once(e,n),this)),Ni(this,"removeListener",(e,n)=>(this.events.removeListener(e,n),this)),Ni(this,"off",(e,n)=>(this.events.off(e,n),this)),Ni(this,"parseAccount",e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e),this.signer={},this.rpc={}}static async init(e){const n=new jZ;return await n.initialize(e),n}async request(e,n){return await this.signer.request(e,this.formatChainId(this.chainId),n)}sendAsync(e,n,r){this.signer.sendAsync(e,n,this.formatChainId(this.chainId),r)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){var n;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:i}=ZFe(this.rpc);try{const a=await new Promise(async(o,c)=>{var l,u;this.rpc.showQrModal&&((l=this.modal)==null||l.open(),(u=this.modal)==null||u.subscribeState(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),c(new Error("Connection request reset. Please try again.")))}));const d=e!=null&&e.scopedProperties?{[this.namespace]:e.scopedProperties}:void 0;await this.signer.connect(Jf(Ml({namespaces:Ml({},r&&{[this.namespace]:r})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e?.pairingTopic,scopedProperties:d})).then(f=>{o(f)}
102).catch(f=>{var h;(h=this.modal)==null||h.showErrorMessage("Unable to connect"),c(new Error(f.message))})});if(!a)return;const s=M$(a.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:i3(this.chainId)})}catch(a){throw this.signer.logger.error(a),a}finally{(n=this.modal)==null||n.close()}}async authenticate(e,n){var r;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{const i=await new Promise(async(s,o)=>{var c,l;this.rpc.showQrModal&&((c=this.modal)==null||c.open(),(l=this.modal)==null||l.subscribeState(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Jf(Ml({},e),{chains:this.rpc.chains}),n).then(u=>{s(u)}).catch(u=>{var d;(d=this.modal)==null||d.showErrorMessage("Unable to connect"),o(new Error(u.message))})}),a=i.session;if(a){const s=M$(a.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:i3(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{(r=this.modal)==null||r.close()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:n}=e,{event:r}=n;r.name==="accountsChanged"?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):r.name==="chainChanged"?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)}),this.signer.on("accountsChanged",e=>{this.accounts=this.parseAccounts(e),this.events.emit("accountsChanged",this.accounts)}),this.signer.on("chainChanged",e=>{const n=parseInt(e);this.chainId=n,this.events.emit("chainChanged",i3(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Jf(Ml({},ln("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const n=e.filter(r=>this.isCompatibleChainId(r)).map(r=>this.parseChainId(r));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",i3(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const n=this.parseChainId(e);this.chainId=n,this.switchEthereumChain(n)}}parseAccountId(e){const[n,r,i]=e.split(":");return{chainId:`${n}:${r}`,address:i}}setAccounts(e){this.accounts=e.filter(n=>this.parseChainId(this.parseAccountId(n).chainId)===this.chainId).map(n=>this.parseAccountId(n).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var n,r;const i=(n=e?.chains)!=null?n:[],a=(r=e?.optionalChains)!=null?r:[],s=i.concat(a);if(!s.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?e?.methods||wb:[],c=i.length?e?.events||bb:[],l=e?.optionalMethods||[],u=e?.optionalEvents||[],d=e?.rpcMap||this.buildRpcMap(s,e.projectId),f=e?.qrModalOptions||void 0;return{chains:i?.map(h=>this.formatChainId(h)),optionalChains:a.map(h=>this.formatChainId(h)),methods:o,events:c,optionalMethods:l,optionalEvents:u,rpcMap:d,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:f,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,n){const r={};return e.forEach(i=>{r[i]=this.getRpcUrl(i,n)}),r}async initialize(e){var n;if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?qy(this.rpc.chains):qy(this.rpc.optionalChains),this.signer=await NFe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storage:e.storage,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const i=await BFe(),{convertWCMToAppKitOptions:a}=await Promise.resolve().then(function(){return aUe}),s=a(Jf(Ml({},this.rpc.qrModalOptions),{chains:[...new Set([...this.rpc.chains,...this.rpc.optionalChains])],metadata:this.rpc.metadata,projectId:this.rpc.projectId}));if(!s.networks.length)throw new Error("No networks found for WalletConnect·");r=i(Jf(Ml({},s),{universalProvider:this.signer,manualWCControl:!0,enableMobileFullScreen:((n=this.rpc.qrModalOptions)==null?void 0:n.enableMobileFullScreen)===!0}))}catch(i){throw console.warn(i),new Error("To use QR modal, please install @reown/appkit package")}if(r)try{this.modal=r}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectMod
102al Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:n,optionalChains:r,rpcMap:i}=e;n&&ba(n)&&(this.rpc.chains=n.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)})),r&&ba(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map(a=>this.formatChainId(a)),r.forEach(a=>{this.rpc.rpcMap[a]=i?.[a]||this.getRpcUrl(a)}))}getRpcUrl(e,n){var r;return((r=this.rpc.rpcMap)==null?void 0:r[e])||`${jFe}?chainId=eip155:${e}&projectId=${n||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),n=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:n?.accounts),this.setAccounts(n?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(n=>this.signer.logger.warn(n))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(n=>this.parseAccount(n))}};const GFe=KFe;var YFe=Object.defineProperty,JFe=Object.defineProperties,XFe=Object.getOwnPropertyDescriptors,zR=Object.getOwnPropertySymbols,QFe=Object.prototype.hasOwnProperty,eUe=Object.prototype.propertyIsEnumerable,ZR=(t,e,n)=>e in t?YFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,BZ=(t,e)=>{for(var n in e||(e={}
102))QFe.call(e,n)&&ZR(t,n,e[n]);if(zR)for(var n of zR(e))eUe.call(e,n)&&ZR(t,n,e[n]);return t},tUe=(t,e)=>JFe(t,XFe(e));function nUe(t){if(t)return{"--w3m-font-family":t["--wcm-font-family"],"--w3m-accent":t["--wcm-accent-color"],"--w3m-color-mix":t["--wcm-background-color"],"--w3m-z-index":t["--wcm-z-index"]?Number(t["--wcm-z-index"]):void 0,"--w3m-qr-color":t["--wcm-accent-color"],"--w3m-font-size-master":t["--wcm-text-medium-regular-size"],"--w3m-border-radius-master":t["--wcm-container-border-radius"],"--w3m-color-mix-strength":0}}const rUe=t=>{const[e,n]=t.split(":");return VZ({id:n,caipNetworkId:t,chainNamespace:e,name:"",nativeCurrency:{name:"",symbol:"",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})};function iUe(t){var e,n,r,i,a,s,o;const c=(e=t.chains)==null?void 0:e.map(rUe).filter(Boolean);if(c.length===0)throw new Error("At least one chain must be specified");const l=c.find(d=>{var f;return d.id===((f=t.defaultChain)==null?void 0:f.id)}),u={projectId:t.projectId,networks:c,themeMode:t.themeMode,themeVariables:nUe(t.themeVariables),chainImages:t.chainImages,connectorImages:t.walletImages,defaultNetwork:l,metadata:tUe(BZ({},t.metadata),{name:((n=t.metadata)==null?void 0:n.name)||"WalletConnect",description:((r=t.metadata)==null?void 0:r.description)||"Connect to WalletConnect-compatible wallets",url:((i=t.metadata)==null?void 0:i.url)||"https://walletconnect.org",icons:((a=t.metadata)==null?void 0:a.icons)||["https://walletconnect.org/walletconnect-logo.png"]}),showWallets:!0,featuredWalletIds:t.explorerRecommendedWalletIds==="NONE"?[]:Array.isArray(t.explorerRecommendedWalletIds)?t.explorerRecommendedWalletIds:[],excludeWalletIds:t.explorerExcludedWalletIds==="ALL"?[]:Array.isArray(t.explorerExcludedWalletIds)?t.explorerExcludedWalletIds:[],enableEIP6963:!1,enableInjected:!1,enableCoinbase:!0,enableWalletConnect:!0,features:{email:!1,socials:!1}};if((s=t.mobileWallets)!=null&&s.length||(o=t.desktopWallets)!=null&&o.length){const d=[...(t.mobileWallets||[]).map(p=>({id:p.id,name:p.name,links:p.links})),...(t.desktopWallets||[]).map(p=>({id:p.id,name:p.name,links:{native:p.links.native,universal:p.links.universal}}))],f=[...u.featuredWalletIds||[],...u.excludeWalletIds||[]],h=d.filter(p=>!f.includes(p.id));h.length&&(u.customWallets=h)}return u}function VZ(t){return BZ({formatters:void 0,fees:void 0,serializers:void 0},t)}var aUe=Object.freeze({__proto__:null,convertWCMToAppKitOptions:iUe,defineChain:VZ});function HZ(t){return{name:t.metadata?.shortName||t.name||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function sUe(t,e){let n=HZ(e);if(Lp&&kH&&n.universalLink)return zy(n.universalLink,t);if(n.deepLink)return qZ(n.deepLink,t);if(n.universalLink)return zy(n.universalLink,t);throw new Q(`Unsupported wallet ${e.id}`)}function KR(t,e){let n=HZ(e);if(n.universalLink)return zy(n.universalLink,t)}let HS="WALLETCONNECT_DEEPLINK_CHOICE";function oUe(){try{localStorage.removeItem(HS)}catch{}}function cUe({href:t,name:e}){try{localStorage.setItem(HS,JSON.stringify({href:t,name:e}))}catch{}}function lUe(){try{localStorage.removeItem(HS)}catch{}}function WZ(t){return t.startsWith("http://")||t.startsWith("https://")}function qZ(t,e){if(WZ(t))return zy(t,e);let n=t;return n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(e)}`,href:n}}function zy(t,e){if(!WZ(t))return qZ(t,e);let n=t;return n.endsWith("/")||(n=`${n}/`),{redirect:`${n}wc?uri=${encodeURIComponent(e)}`,href:n}}function zZ(t,e){window.open(t,e,"noreferrer noopener")}function Cb(t){return crypto.getRandomValues(new Uint8Array(t))}function WS(){return mu(Cb(36))}function ZZ(){return WS()}async function KZ(t,e="S256"){if(e!="S256")return t;{let n=await async function(r){let i=new TextEncoder().encode(r);return new Uint8Array(await crypto.subtle.digest("SHA-256",i))}(t);return mu(n)}}function uUe(){let t=nt.get(ch);if(!t)throw new Q("Authentication error.");return t}const GZ="/api/v1/sessions",YZ="/api/v1/sessions/logout",dUe="/api/v1/siwe/init",fUe="/api/v1/siwe/authenticate",hUe="/api/v1/siwe/link",pUe="/api/v1/siwe/link_smart_wallet",gUe="/api/v1/siwe/unlink",yUe="/api/v1/siwe/transfer",mUe="/api/v1/siws/init",vUe="/api/v1/siws/authenticate",wUe="/api/v1/siws/link",bUe="/api/v1/siws/unlink",_Ue="/api/v1/siws/transfer",CUe="/api/v1/farcaster/init",EUe="/api/v1/farcaster/authenticate",SUe="/api/v1/farcaster/link",AUe="/api/v1/farcaster/status",xUe="/api/v1/farcaster/unlink",IUe="/api/v1/farcaster/transfer",TUe="/api/v1/passwordless/init",LUe="/api/v1/passwordless/authenticate",kUe="/api/v1/passwordless/link",$Ue="/api/v1/passwordless/unlink",PUe="/api/v1/passwordless/update",RUe="/api/v1/passwordless/transfer",OUe="/api/v1/passwordless_sms/init",MUe="/api/v1/passwordless_sms/link",NUe="/api/v1/passwordless_sms/unlink",DUe="/api/v1/passwordless_sms/authenticate",FUe="/api/v1/passwordless_sms/update",UUe="/api/v1/passwordless_sms/transfer",JZ="/api/v1/oauth/init",XZ="/api/v1/oauth/authenticate",QZ="/api/v1/oauth/link",jUe="/api/v1/oauth/unlink",BUe="/api/v1/oauth/transfer",uot="/api/v1/recovery/oauth/init",dot="/api/v1/recovery/oauth/init_icloud",fot="/api/v1/recovery/oauth/authenticate",VUe="/api/v1/passkeys/link/init",HUe="/api/v1/passkeys/authenticate/init",WUe="/api/v1/passkeys/register/init",qUe="/api/v1/passkeys/link",zUe="/api/v1/passkeys/authenticate",ZUe="/api/v1/passkeys/register",KUe="/api/v1/telegram/authenticate",GUe="/api/v1/telegram/link",YUe="/api/v1/telegram/unlink",JUe="/api/v1/telegram/transfer",XUe="/api/v1/mfa/passwordless_sms/init",QUe="/api/v1/mfa/passkeys/init",eje="/api/v1/users/me/accept_terms",eK="/api/v1/analytics_events",tje="/api/v1/custom_jwt_account/authenticate",nje="/api/v1/custom_jwt_account/link",rje="/api/v1/guest/authenticate",ije="/api/v1/plugins/moonpay_on_ramp/sign",aje="/api/v1/funding/coinbase_on_ramp/init",sje="/api/v1/funding/coinbase_on_ramp/status",oje="/api/v1/wallets/revoke",cje="/api/v1/users/me",lje="/api/v1/scan/transaction";let Eb=Pi(()=>({}));const uje=({children:t,configPlugins:e})=>(L.useEffect(()=>{if(e&&e.length!==0)return Eb.setState(Object.fromEntries(e.map(n=>[n.id,n]))),()=>{Eb.setState(Object.fromEntries(e.map(n=>[n.id,void 0])))}},[e]),m.jsx(m.Fragment,{children:t})),Pd=t=>Eb.getState()[t],dje=()=>L.useCallback(t=>Pd(t),[]);class Nc{static parse(e){try{return new Nc(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return Fw(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=Fw(e)}}class qS extends Nc{static parse(e){try{return new qS(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}}const hot=({style:t,...e})=>m.jsxs("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[m.jsx("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),fje="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",hje="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC";let hd,Xf;class pje extends Y2{async initialize(){await this.importPromise,await this.syncAccounts(),this.initialized=!0,this.emit
102("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:hje,id:"com.coinbase.wallet"}}async promptConnection(){Ce.debug("Prompting connection via Base Account",{wallet:this.walletClientType});try{await this.importPromise,Ce.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(Ce.rpcResponse("eth_requestAccounts",this.walletClientType),!e||e.length===0||!e[0])throw new dn("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Ce.connectionFailed(this.walletClientType,e,{method:"base_account"}),fl(e)}}constructor(e,n,r,i,a){super("base_account",e,n,r),this.connectorType="base_account",this.walletClientType="base_account",this.displayName="Base",this.setBaseAccountSdk=a,this.proxyProvider=new Mu(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.baseAccountConfig={...i,appChainIds:[n.id].concat(e.map(s=>s.id))},hd?(this.proxyProvider.setWalletProvider(hd.getProvider()),this.setBaseAccountSdk(hd)):this.importPromise=Ne(()=>import("./index-UcNF_JDy.js"),__vite__mapDeps([14,1,2,3,15,16,17,4,5,6,7])).then(({createBaseAccountSDK:s})=>{hd=s(this.baseAccountConfig),this.proxyProvider.setWalletProvider(hd.getProvider()),this.setBaseAccountSdk(hd)}).catch(console.error)}}let gje=[1,11155111,137,10,8453,84532,42161,7777777,43114,56];class yje extends Y2{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:fje,id:"com.coinbase.wallet"}}async promptConnection(){Ce.debug("Prompting connection via Coinbase Wallet",{wallet:this.walletClientType});try{Ce.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(Ce.rpcResponse("eth_requestAccounts",this.walletClientType),!e||e.length===0||!e[0])throw new dn("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Ce.connectionFailed(this.walletClientType,e,{method:"coinbase_wallet"}),fl(e)}}updateConnectionPreference(e){this.coinbaseWalletConfig={...this.coinbaseWalletConfig,preference:{...this.coinbaseWalletConfig.preference,options:e}},this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",Xf=jk({...this.coinbaseWalletConfig}),this.proxyProvider.setWalletProvider(Xf.getProvider())}constructor(e,n,r,i){if(super("coinbase_wallet",e,n,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Mu(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.coinbaseWalletConfig={...i,appChainIds:[n.id].concat(e.map(a=>a.id))},this.walletClientType=this.coinbaseWalletConfig.preference?.options==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Xf){let a=this.coinbaseWalletConfig.preference?.options!=="eoaOnly"?(this.coinbaseWalletConfig.appChainIds??[]).filter(s=>!gje.includes(s)):[];a.length>0&&!a.every(s=>vB.has(s))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${a.join(", ")}`),Xf=jk(this.coinbaseWalletConfig)}this.proxyProvider.setWalletProvider(Xf.getProvider())}}const mje=({style:t,...e}={})=>m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...t},...e,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),vje=({style:t,...e}={})=>m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...t},...e,children:[m.jsx("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});function M4(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw TypeError("attempted to use private field on non-instance");return t}var wje=0;async function tK(t,e){try{Ce.rpcRequest("eth_requestAccounts",e);let n=await t.request({method:"eth_requestAccounts"});return Ce.rpcResponse("eth_requestAccounts",e),n}catch(n){if(n.code===-32002&&n.message?.includes("Already processing")){Ce.debug("eth_requestAccounts already processing, retrying after delay",{wallet:e}),await new Promise(i=>setTimeout(i,500)),Ce.rpcRequest("eth_requestAccounts",e);let r=await t.request({method:"eth_requestAccounts"});return Ce.rpcResponse("eth_requestAccounts",e),r}throw n}}class nK extends Y2{async initialize(){Ce.debug("Initializing injected connector (EIP-6963)",{wallet:this.walletClientType}
102),await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){if(Ce.connectionStart(this.walletClientType,"injected",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection(),!await this.isConnected())return Ce.debug("Not connected after prompt",{wallet:this.walletClientType}),null;let n=await this.getConnectedWallet();return n&&Ce.connectionSuccess(this.walletClientType),n}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){Ce.debug("Prompting connection via eth_requestAccounts",{wallet:this.walletClientType});try{let e=await tK(this.proxyProvider,this.walletClientType);if(!e||e.length===0||!e[0])throw new dn("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ce.connectionFailed(this.walletClientType,e,{method:"injected"}),fl(e)}}constructor(e,n,r,i,a){super(a||"unknown",e,n,r),this.connectorType="injected",this.proxyProvider=new Mu(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let s=i.provider;this.proxyProvider.setWalletProvider(s)}}var kl="__private_"+wje+++"__walletBranding";class N4 extends Y2{async initialize(){Ce.debug("Initializing legacy injected connector",{wallet:this.walletClientType}),await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){if(Ce.connectionStart(this.walletClientType,"injected (legacy)",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection(),!await this.isConnected())return Ce.debug("Not connected after prompt",{wallet:this.walletClientType}),null;let n=await this.getConnectedWallet();return n&&Ce.connectionSuccess(this.walletClientType),n}get walletBranding(){return M4(this,kl)[kl]??{name:"Browser Extension",icon:mje,id:"extension"}}disconnect(){Ce.debug("Disconnect requested (not supported for legacy injected)",{wallet:this.walletClientType})}async promptConnection(){Ce.debug("Prompting connection via eth_requestAccounts (legacy)",{wallet:this.walletClientType});try{let e=await tK(this.proxyProvider,this.walletClientType);if(!e||e.length===0||!e[0])throw new dn("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ce.connectionFailed(this.walletClientType,e,{method:"injected (legacy)"}),fl(e)}}constructor(e,n,r,i,a){super(a??"unknown",e,n,r),Object.defineProperty(this,kl,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new Mu(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?M4(this,kl)[kl]={name:"MetaMask",icon:Qwe,id:"io.metamask"}:a==="phantom"&&(M4(this,kl)[kl]={name:"Phantom",icon:vje,id:"phantom"})}}class bje extends nK{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){Ce.debug("Prompting connection via MetaMask",{wallet:this.walletClientType});try{Lp||(Ce.rpcRequest("wallet_requestPermissions",this.walletClientType),await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),Ce.rpcResponse("wallet_requestPermissions",this.walletClientType)),Ce.rpcRequest("eth_requestAccounts",this.walletClientType);let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(Ce.rpcResponse("eth_requestAccounts",this.walletClientType),!e||e.length===0||!e[0])throw new dn("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ce.connectionFailed(this.walletClientType,e,{method:"metamask"}),fl(e)}}}class Sb extends Y2{async initialize(){Ce.debug("Initializing WalletConnect V2 connector",{wallet:this.walletClientType});let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){let n=this.walletProvider?.session?.peer.metadata;Ce.debug("Restoring existing WalletConnect session",{peerName:n?.name,accountsCount:this.walletProvider?.accounts?.length}),this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=N5(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown"),this.connected=!0,await this.syncAccounts()}
102this.initialized=!0,this.emit("initialized")}async connect(e){Ce.connectionStart(this.walletClientType,"wallet_connect_v2",{showPrompt:e.showPrompt}),e.showPrompt&&await this.promptConnection();let n=await this.getConnectedWallet();return n&&Ce.connectionSuccess(this.walletClientType),n}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){let e=this.walletProvider?.session?.peer.metadata.icons?.[0];return{name:_7e(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:typeof e=="string"?e:L7e,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){let n=this.walletClientType;Ce.debug("Resetting WalletConnect connection for new wallet",{previousWallet:n,newWallet:e}),this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,oUe(),this.onDisconnect())}async promptConnection(){if(this.provider)return Ce.debug("Prompting WalletConnect connection",{wallet:this.walletClientType}),new Promise((e,n)=>{(async()=>{Ce.debug("Enabling WalletConnect provider",{wallet:this.walletClientType,timeoutMs:this.proxyProvider.rpcTimeoutDuration});let r="",i=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout().then(()=>{})]);if(i?.length&&(r=i[0],Ce.debug("WalletConnect accounts received",{address:r,accountsCount:i.length})),!r||r==="")throw new dn("Unable to retrieve address");this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=N5(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown",Ce.debug("Identified wallet from session",{wallet:this.walletClientType}),this.proxyProvider.rpcTimeoutDuration=ZE(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(i),e()})().catch(r=>{Ce.connectionFailed(this.walletClientType,r,{method:"wallet_connect_v2"}),n(r?fl(r):new dn("Unknown error during connection"))})});Ce.warn("WalletConnect provider not initialized")}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect WalletConnect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){Ce.debug("Creating WalletConnect EthereumProvider",{chainsCount:this.chains.length,defaultChainId:this.defaultChain.id});let e={};for(let a of this.chains){let s=E7e(a.id,this.chains,this.rpcConfig,this.privyAppId);s&&(e[a.id]=s)}let n=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map(a=>a.id);Ce.debug("Initializing WalletConnect EthereumProvider",{requiredChains:n.join(", ")||"none",optionalChainsCount:r.length});let i=await GFe.init({projectId:this.walletConnectCloudProjectId,chains:n,optionalChains:r,optionalEvents:UZ,optionalMethods:FZ,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.origin,icons:[]}});return i.on("display_uri",a=>{if(Ce.debug("WalletConnect URI generated",{wallet:this.walletClientType,isMobile:Lp,hasWalletEntry:!!this.walletEntry}),Ce.debug("Aborting WalletConnect pairing attempt"),i.signer.abortPairingAttempt(),lUe(),!this.showPrivyQrModal)throw new dn("WalletConnect modal not available - Privy handles wallet connections through its own UI");if(Lp&&this.walletEntry){let{redirect:s,href:o}=sUe(a,this.walletEntry),c=s.startsWith("http");Ce.debug("Opening mobile wallet via deep link",{wallet:this.walletEntry.name,redirectType:c?"universal":"native"}),zZ(s,"_self"),cUe({href:o,name:this.walletEntry.metadata?.shortName||this.walletEntry.name});let l=KR(a,this.walletEntry);return this.redirectUri=s,this.fallbackUniversalRedirectUri=l?.redirect,this.showPrivyQrModal({native:s,universal:s})}if(Ce.debug("Displaying WalletConnect QR code",{wallet:this.walletEntry?.name||"generic"}),this.redirectUri=void 0,this.walletEntry){let s=KR(a,this.walletEntry);this.fallbackUniversalRedirectUri=s?.redirect}this.showPrivyQrModal({native:a,universal:void 0})}),i.on("connect",()=>{let a=i.session?.peer.metadata;Ce.debug("WalletConnect session established",{peerName:a?.name,peerIcon:a?.icons?.[0]?"present":"none"}),i.session?.peer.metadata.url&&(this.walletEntry=N5(i.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown")}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}setWalletEntry(e,n){this.walletEntry=e,this.showPrivyQrModal=n}constructor({walletConnectCloudProjectId:e,rpcConfig:n,chains:r,defaultChain:i,shouldEnforceDefaultChainOnConnect:a,privyAppId:s,privyAppName:o,walletClientType:c}){super(c||"unknown",r,i,n),this.connectorType="wallet_connect_v2",this.privyAppId=s,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=n,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Mu(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=Jwe(c),this.walletClientType=c)}}class _je extends ll{get wallets(){let e=new Set;return this.walletConnectors.flatMap(n=>n.wallets).sort((n,r)=>n.connectedAt&&r.connectedAt?r.connectedAt-n.connectedAt:0).filter(n=>{let r=`${n.address}${n.walletClientType}${n.connectorType}${n.meta.id}`;return!e.has(r)&&(e.add(r),!0)})}async initialize(e){if(Ce.info("Starting connector initialization",{reInit:e??!1}),this.initialized&&!e)return;if(e&&this.removeAllConnectors(),this.externalWalletConfig.disableAllExternalWallets)return void Ce.info("All external wallets disabled, skipping initialization");let n=C7e({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then(c=>{Ce.info("Detected injected providers",{count:c.length,wallets:c.map(l=>l.type).join(", ")}
102),c.forEach(({type:l,eip6963InjectedProvider:u,legacyInjectedProvider:d})=>{this.createEthereumWalletConnector({connectorType:"injected",walletClientType:l,providers:{eip6963InjectedProvider:u,legacyInjectedProvider:d}})})});for(let c of(this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector({connectorType:"coinbase_wallet",walletClientType:"coinbase_wallet"}),this.walletList.includes("base_account")&&this.createEthereumWalletConnector({connectorType:"base_account",walletClientType:"base_account"}),Object.values(RH)))!c.isInstalled&&this.walletList.includes(c.client)&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&c.chainTypes.includes("ethereum")&&this.createEthereumWalletConnector({connectorType:"null",walletClientType:c.client,walletConfig:c}),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&c.chainTypes.includes("solana")&&this.addSolanaWalletConnector(new t8e({id:c.client,name:c.name})));let r=this.walletList.includes("wallet_connect_qr_solana")||v8(this.walletList)&&this.walletChainType!=="ethereum-only",i=this.externalWalletConfig.walletConnect.enabled&&(this.walletList.includes("wallet_connect_qr")||v8(this.walletList))&&this.walletChainType!=="solana-only",a=this.externalWalletConfig.solana.connectors?.get()||[],s=async c=>{await c.initializeProvider({walletConnectCloudProjectId:this.walletConnectCloudProjectId,privyAppName:this.privyAppName});let l=await c.hideSolanaSessionsFromSignClient();try{this.ethereumWalletConnectInitPromise||(this.ethereumWalletConnectInitPromise=this.initEthereumWalletConnect()),await this.ethereumWalletConnectInitPromise}finally{await c.unhideSolanaSessionsInSignClient(l)}await c.restoreSession()},o=async c=>{let l=c.find(d=>d.walletBranding?.id==="walletconnect_solana"),u=l?.wallet??null;!i||r&&u?r&&!i&&u?await u.initialize({walletConnectCloudProjectId:this.walletConnectCloudProjectId,privyAppName:this.privyAppName}):r&&i&&u&&await s(u):this.ethereumWalletConnectInitPromise||(this.ethereumWalletConnectInitPromise=this.initEthereumWalletConnect())};o(a),a.filter(c=>r||c.walletBranding?.id!=="walletconnect_solana").forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.(c=>{o(c),c?.filter(l=>r||l.walletBranding?.id!=="walletconnect_solana").forEach(this.addSolanaWalletConnector)}),await n,this.initialized=!0}findWalletConnector(e,n,r){return e==="wallet_connect_v2"?this.walletConnectors.filter(D5).find(i=>i.connectorType===e&&(!r||i.wallets.some(a=>a.address===r)))??null:this.walletConnectors.filter(D5).find(i=>i.connectorType===e&&i.walletClientType===n&&(!r||i.wallets.some(a=>a.address===r)))??null}findSolanaWalletConnector(e){return this.walletConnectors.filter(n8e).find(n=>n.walletClientType==="unknown"?n.walletBranding.id===e:n.walletClientType===e)??null}onInitialized(e){Ce.connectorInit(e.connectorType,e.walletClientType,{walletsCount:e.wallets.length}),e.wallets.forEach(n=>{let r=this.storedConnections.find(i=>i.address===n.address&&i.connectorType===n.connectorType&&(n.type==="solana"&&i.walletClientType==="unknown"&&n.walletClientType==="unknown"?n.meta.id===i.id:i.walletClientType===n.walletClientType));r&&(n.connectedAt=r.connectedAt)}),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&this.emit("walletsUpdated")}initEthereumWalletConnect(){return this.createEthereumWalletConnector({connectorType:"wallet_connect_v2",walletClientType:"unknown"}).then(e=>{if(e)return new Promise(n=>{if(e.initialized)return void n();let r=setTimeout(()=>n(),5e3);e.once("initialized",()=>{clearTimeout(r),n()})})})}async createEthereumWalletConnector({connectorType:e,walletClientType:n,providers:r,walletConfig:i}){Ce.debug("Creating Ethereum wallet connector",{connector:e,wallet:n});let a=this.findWalletConnector(e,n);if(a&&D5(a))return Ce.debug("Found existing connector, reusing",{connector:e,wallet:n}),a instanceof Sb&&a.resetConnection(n),a;let s=e!=="injected"?e==="coinbase_wallet"?new yje(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.coinbaseWallet.config):e==="base_account"?new pje(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.baseAccount.config,this.setBaseAccountSdk):e!=="null"?new Sb({walletConnectCloudProjectId:this.walletConnectCloudProjectId,rpcConfig:this.rpcConfig,chains:this.chains,defaultChain:this.defaultChain,shouldEnforceDefaultChainOnConnect:this.shouldEnforceDefaultChainOnConnect,privyAppId:this.privyAppId,privyAppName:this.privyAppName,walletClientType:n}):i?new Xwe({id:i.client,name:i.name,defaultChain:this.defaultChain,walletClientType:i.client}):null:n==="metamask"&&r?.eip6963InjectedProvider?new bje(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):n==="metamask"&&r?.legacyInjectedProvider?new N4(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):n==="phantom"&&r?.legacyInjectedProvider?new N4(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&n==="unknown_browser_extension"?new N4(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new nK(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,n):void 0;return s?(Ce.connectorCreated(e,n),this.addWalletConnector(s)):Ce.debug("No connector created",{connector:e,wallet:n}),s||null}addWalletConnector(e){Ce.debug("Adding wallet connector",{connector:e.connectorType,wallet:e.walletClientType}),this.walletConnectors.push(e),e.on("initialized",()=>this.onInitialized(e)),e.on("walletsUpdated",()=>this.onWalletsUpdated(e)),e.initialize().catch(n=>{Ce.error("Failed to initialize connector",n,{connector:e.connectorType,wallet:e.walletClientType})})}setWalletList(e){this.walletList=e,this.initialized&&this.initialize(!0).catch(console.error)}removeAllConnectors(){for(let e of this.walletConnectors)e.removeAllListeners();this.walletConnectors=[]}constructor(e,n,r,i,a,s,o,c,l,u,d,f,h){super(),this.ethereumWalletConnectInitPromise=null,this.addSolanaWalletConnector=async p=>{let g=this.findSolanaWalletConnector(p.walletClientType);if(!g||g.connectorType==="null"){if(g?.connectorType==="null"){let y=this.walletConnectors.indexOf(g);this.walletConnectors.splice(y,1)}this.addWalletConnector(p)}},Ce.setEnabled(h??!1),Ce.info("ConnectorManager initializing",{walletChainType:f||void 0,walletList
102Count:o.length}),this.privyAppId=e,this.walletConnectCloudProjectId=n,this.rpcConfig=r,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=s,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=l,this.privyAppName=u,this.walletChainType=f||"ethereum-only",this.setBaseAccountSdk=d,this.storedConnections=HE()}}const Ab=Pi(()=>({identityToken:null}));function Cje(){let{identityToken:t}=Ab();return{identityToken:t}}let Eje=[GZ,YZ,eK];class Sje{async get(e,n){try{return await this.baseFetch(e,n)}catch(r){throw xt(r)}}async post(e,n,r){try{return await this.baseFetch(e,{method:"POST",...n?{body:n}:{},...r})}catch(i){throw xt(i)}}async delete(e,n){try{return await this.baseFetch(e,{method:"DELETE",...n})}catch(r){throw xt(r)}}constructor({appId:e,appClientId:n,client:r,defaults:i}){this.appId=e,this.appClientId=n,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=d4e,this.client=r,this.defaults=i,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=v7e.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:a,options:s})=>{let o=new Headers(s.headers);o.set("privy-app-id",this.appId),this.appClientId&&o.set("privy-client-id",this.appClientId),o.set("privy-ca-id",this.clientAnalyticsId||""),o.set("privy-client",`react-auth:${this.sdkVersion}`);let c=Eje.includes(a.toString());if(!o.has("authorization")){let l=await this.client.getAccessToken({disableAutoRefresh:c});l!==null&&o.set("authorization",`Bearer ${l}`)}s.headers=o,s.retryDelay&&typeof s.retryDelay=="number"&&(s.retryDelay=3*s.retryDelay)},onRequestError:({error:a})=>{if(a instanceof DOMException&&a.name==="AbortError")throw new w7e}})}}const Aje=t=>({rpId:t.rp_id,challenge:t.challenge,allowCredentials:t.allow_credentials?.map(e=>({id:e.id,type:e.type,transports:e.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}),xje=Symbol("cross-tab-user-sync-plugin");class rK{async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(tje,{token:this.meta.token})}catch(e){throw xt(e)}}async link(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(nje,{token:this.meta.token})}catch(e){throw xt(e)}}constructor(e){this.meta={token:e}}}function Up(t){return t?{"privy-ui":"t"}:void 0}class Rd{async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new Q("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(LUe,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw xt(e)}}async link(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new Q("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(kUe,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw xt(e)}}async sendCodeEmail({email:e,captchaToken:n,withPrivyUi:r}){if(!this.api)throw new Q("Auth flow has no API instance");if(e&&(this.meta.email=e),n&&(this.meta.captchaToken=n),!this.meta.email)throw new Q("Email must be set when initialzing authentication.");let i=Up(r);try{return await this.api.post(TUe,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(a){throw xt(a)}}constructor({email:e,captchaToken:n,disableSignup:r}){this.meta={email:e,captchaToken:n,disableSignup:r??!1}}}let Ije=class extends Rd{async link(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new Q("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(PUe,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw xt(e)}}constructor(e,n,r){super({email:n,captchaToken:r}),this.meta={email:n,captchaToken:r,oldAddress:e,disableSignup:!1}}},Tje=class{getOrCreateGuestCredential(e){let n=vV(e);if(h8()){if(nt.get(n))return nt.get(n);{let r=mu(Cb(32));return nt.put(n,r),r}}return mu(Cb(32))}async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(rje,{guest_credential:this.meta.guestCredential})}catch(e){throw xt(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}};function zS(){return typeof window<"u"&&window.location.protocol==="chrome-extension:"&&"chrome"in window}function iK(){return zS()?window.chrome?.runtime?.id:void 0}function xb(){return zS()?typeof window.chrome?.identity?.launchWebAuthFlow=="function":!1}
102async function GR(t){return new Promise((e,n)=>{xb()?window.chrome.identity.launchWebAuthFlow({url:t,interactive:!0},async r=>{try{let i=function(){return zS()?window.chrome?.runtime?.lastError?.message:void 0}();if(i||!r){let l=`WebAuthFlow failed: ${i||"Response URI missing"}`;throw Error(l)}let a=new URL(r),s=iK();if(!s)throw Error("Invalid extension context");if(a.protocol==="chrome-extension:"){if(a.hostname!==s)throw Error("Invalid responseUri origin")}else{if(a.protocol!=="https:")throw Error("Invalid responseUri protocol");{let l=a.hostname.split(".");if(l.length!==3||l[1]!=="chromiumapp"||l[2]!=="org"||l[0]!==s)throw Error("Invalid responseUri origin")}}let o=a.searchParams.get("privy_oauth_state"),c=a.searchParams.get("privy_oauth_code");if(!o||!c)throw Error("Invalid responseUri - missing required parameters");e({privyOAuthState:o,privyOAuthCode:c})}catch(i){n(i)}}):n(Error("Chrome identity API not available"))})}let Ed=class{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new Q("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new Q("User denied confirmation during OAuth flow");let e=uUe();try{let n=await this.api.post(XZ,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return nt.del(ch),nt.del(vy),nt.del($h),n}catch(n){let r=xt(n);throw r.privyErrorCode?new Q(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new Q("Invalid code during oauth flow.",void 0,fe.OAUTH_USER_DENIED):new Q("Invalid code during OAuth flow.",void 0,fe.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new Q("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new Q("User denied confirmation during OAuth flow");let e=nt.get(ch);if(!e)throw new Q("Authentication error.");try{let n=await this.api.post(QZ,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return nt.del(ch),n}catch(n){throw xt(n)}}async getAuthorizationUrl(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.provider)throw new Q("Provider must be set when initializing OAuth authentication.");let e=WS();nt.put(ch,e);let n=ZZ();nt.put(my,n);let r=await KZ(e);
102this.meta.withPrivyUi||nt.put(vy,!0),this.meta.disableSignup?nt.put($h,!0):nt.del($h);let i=Up(this.meta.withPrivyUi),a=window.location.href,s=function(){let o=iK();if(o)return`https://${o}.chromiumapp.org`}();s&&(a=s);try{return await this.api.post(JZ,{provider:this.meta.provider,redirect_to:this.meta.customOAuthRedirectUrl||a,token:this.meta.captchaToken,code_challenge:r,state_code:n},{headers:{...i}})}catch(o){throw xt(o)}}constructor(e){this.meta=e}},Ka=class{execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}};const Ib=({address:t,chainId:e,nonce:n})=>`${window.location.host} wants you to sign in with your Ethereum account: 103${t} 104 105By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees. 106 107URI: ${window.location.origin} 108Version: 1 109Chain ID: ${e} 110Nonce: ${n} 111Issued At: ${new Date().toISOString()} 112Resources: 113- https://privy.io`;let ig=class{get meta(){return{connectorType:this.wallet?.connectorType,walletClientType:this.wallet?.walletClientType,chainId:this.wallet?.chainId,address:this.wallet?.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new Q("SiweFlow has no client instance");try{if(this.preparedMessage&&this.signature)return await this.client.authenticateWithSiweInternal({message:this.preparedMessage,signature:this.signature,chainId:this.wallet?.chainId,walletClientType:this.walletClientType??this.wallet?.walletClientType,connectorType:this.connectorType??this.wallet?.connectorType,mode:this._meta.disableSignup?"no-signup":"login-or-sign-up"});if(!this.wallet)throw new Q("SiweFlow has no wallet instance");let{message:e,signature:n}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:n,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw xt(e)}}async link(){if(!this.client)throw new Q("SiweFlow has no client instance");try{if(!this.wallet)throw new Q("SiweFlow has no wallet instance");let{message:e,signature:n}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:n,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw xt(e)}}async sign(){if(!this.client)throw new Q("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Q("Could not prepare SIWE message");if(!this.wallet)throw new Q("SiweFlow has no wallet instance");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new Q("SiweFlow has no client instance");if(!this.wallet)throw new Q("UI SiweFlow has no wallet instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Q("SiweFlow has no client instance");if(!this.wallet)throw new Q("SiweFlow has no wallet instance");let e=this.wallet.address,n=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Ib({address:e,chainId:n,nonce:this.nonce}),this.preparedMessage}constructor(e,n,r,i=!1,a){this._meta={disableSignup:!1},this.getNonceOnce=new Ka(this._getNonceOnce.bind(this)),this.wallet=n,this.captchaToken=r,this.client=e,this._meta.disableSignup=i,this.preparedMessage=a?.message,this.signature=a?.signature,this.walletClientType=a?.walletClientType,this.connectorType=a?.connectorType}},Od=class{async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new Q("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(DUe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw xt(e)}}async link(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new Q("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(MUe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw xt(e)}}async sendSmsCode({phoneNumber:e,captchaToken:n,withPrivyUi:r}){if(!this.api)throw new Q("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),n&&(this.meta.captchaToken=n),!this.meta.phoneNumber)throw new Q("phone nNumber must be set when initialzing authentication.");let i=Up(r);try{return await this.api.post(OUe,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}
113catch(a){throw xt(a)}}constructor({phoneNumber:e,captchaToken:n,disableSignup:r}){this.meta={phoneNumber:e,captchaToken:n,disableSignup:r??!1}}},Lje=class extends Od{async link(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new Q("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(FUe,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw xt(e)}}constructor(e,n,r){super({phoneNumber:n,captchaToken:r}),this.meta={phoneNumber:n,captchaToken:r,oldPhoneNumber:e,disableSignup:!1}}};function D4(){return!(Ywe&&window.location.origin.startsWith("http://localhost"))}var F4,YR=((F4={}).PRIVY="privy_access_token",F4.CUSTOMER="customer_access_token",F4);let kje=class{get token(){return this.privyAccessToken||this.customerAccessToken}getToken(e){return e==="privy_access_token"?this.privyAccessToken:this.customerAccessToken}get customerAccessToken(){return this._getToken(oh)}get privyAccessToken(){return this._getToken(V3)}_getToken(e){try{let n=nt.get(e);return typeof n=="string"?Nc.throwIfNotWellFormedJwt(n):null}catch(n){return console.error(n),this.destroyLocalState(),null}}get refreshToken(){try{let e=nt.get(k5);return typeof e=="string"?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let n=nt.get(T1(e));if(typeof n!="string")return null;{let r=new Nc(n);return r.isExpired()?(nt.del(T1(e)),null):r.value}}catch(n){return console.error(n),null}}get mightHaveServerCookies(){try{let e=Qt.get($5);return e!==void 0&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(e="privy_access_token"){let n=typeof this.getToken(e)=="string",r=typeof this.refreshToken=="string"&&this.refreshToken!==p4e;return this.mightHaveServerCookies||n&&r}hasActiveAccessToken(e){let n=Nc.parse(this.getToken(e));return n!==null&&!n.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,n){typeof n=="string"?nt.put(T1(e),n):nt.del(T1(e))}updateIdentityToken(e){typeof e=="string"?this.storeIdentityToken(e):this.clearIdentityToken()}async _authenticate(e){try{let n=await e.authenticate(),{user:r,is_new_user:i,oauth_tokens:a}=n;this.handleTokenResponse(n);let s=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:a.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0;return this._trackAuthenticateEvents(e,i),{user:mr(r),isNewUser:i,oAuthTokens:s}}catch(n){throw console.warn("Error authenticating session"),pn(n)}}_trackAuthenticateEvents(e,n){let r=function(i){return i instanceof Rd?"email":i instanceof Od?"sms":i instanceof ig?"siwe":i instanceof Tje?"guest":i instanceof rK?"custom_auth":i instanceof Ed?i.meta.provider:null}(e);r&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:r,isNewUser:n}}),r==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}})}async _link(e){try{let n=await e.link(),r=n.oauth_tokens,i=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:mr(n),oAuthTokens:i}}catch(n){throw console.warn("Error linking account"),pn(n)}}async _refresh(){if(!this.api)throw new Q("Session has no API instance");if(!this.client)throw new Q("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,n=this.refreshToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let r;if(!(e&&n||this.mightHaveServerCookies))return null;{let i={};e&&(i.authorization=`Bearer ${e}`),r=await this.api.post(GZ,n?{refresh_token:n}:{},{headers:i})}return this.handleTokenResponse(r),mr(r.user)}catch(r){if(r instanceof by&&r.privyErrorCode===fe.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw pn(r)}}handleTokenResponse(e){e.session_update_action&&e.session_update_action!=="set"?e.session_update_action==="clear"?this.destroyLocalState():e.session_update_action==="ignore"&&(e.token&&(this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token)),e.identity_token&&this.storeIdentityToken(e.identity_token)):this._storeAllTokens(e)}_storeAllTokens(e){this.storeRefreshToken(e.refresh_token),this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),e.identity_token&&this.storeIdentityToken(e.identity_token)}async _destroy(){try{await this.api?.post(YZ,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}destroyLocalState(){this.storeRefreshToken(null),this.storeCustomerAccessToken(null),this.storePrivyAccessToken(null),this.clearIdentityToken()}storeCustomerAccessToken(e){if(typeof e=="string"){let n=nt.get(oh);if(nt.put(oh,e),!this.client?.useServerCookies){let r=Nc.parse(e)?.expiration;
113Qt.set(KL,e,{sameSite:"Strict",secure:D4(),expires:r?new Date(1e3*r):void 0})}n!==e&&this.client?.onStoreCustomerAccessToken?.(e)}else nt.del(oh),Qt.remove(KL),this.client?.onDeleteCustomerAccessToken?.()}storeRefreshToken(e){typeof e=="string"?(nt.put(k5,e),this.client?.useServerCookies||Qt.set($5,"t",{sameSite:"Strict",secure:D4(),expires:30})):(nt.del(k5),Qt.remove(f4e),Qt.remove($5))}storePrivyAccessToken(e){typeof e=="string"?nt.put(V3,e):nt.del(V3)}storeIdentityToken(e){if(Ab.setState({identityToken:e}),this.client?.useServerCookies)return;nt.put(GL,e);let n=Nc.parse(e)?.expiration;Qt.set(YL,e,{sameSite:"Strict",secure:D4(),expires:n?new Date(1e3*n):void 0})}clearIdentityToken(){nt.del(GL),Ab.setState({identityToken:null}),Qt.remove(YL)}constructor(){this.authenticateOnce=new Ka(async e=>this._authenticate(e)),this.linkOnce=new Ka(async e=>this._link(e)),this.refreshOnce=new Ka(this._refresh.bind(this)),this.destroyOnce=new Ka(this._destroy.bind(this))}},U4,Zy;var $je=0,j4="__private_"+$je+++"__getOrGenerateClientAnalyticsId";let Pje=class{getAppId(){return this.appId}initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:n,chains:r,defaultChain:i,store:a,walletList:s,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:c,appName:l,walletChainType:u,setBaseAccountSdk:d,connectorsDebugLogs:f}){this.connectors||(this.connectors=new _je(this.appId,e,n,r,i,a,s,o,c,l,d,u,f))}generateApi(){let e=new Sje({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new Q("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new Q("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,n){this.session.storeProviderAccessToken(e,n)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter(n=>n.type==="cross_app").forEach(n=>{this.storeProviderAccessToken(n.providerApp.id,null)})}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(XUe,{action:"verify"})}catch(e){throw xt(e)}}async initMfaPasskeyVerification(){try{let e=await this.api.post(QUe,{});return Aje(e.options)}catch(e){throw xt(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(n){console.error("Error fetching cross app provider details",n)}}async acceptTerms(){try{let e=await this.api.post(eje,{});return mr(e)}catch(e){throw pn(e)}}async unlinkEmail(e){try{let n=await this.api.post($Ue,{address:e});return await this.getAuthenticatedUser()??mr(n)}catch(n){throw pn(n)}}async unlinkPhone(e){try{let n=await this.api.post(NUe,{phoneNumber:e});return await this.getAuthenticatedUser()??mr(n)}catch(n){throw pn(n)}}async unlinkEthereumWallet(e){try{let n=await this.api.post(gUe,{address:e});return await this.getAuthenticatedUser()??mr(n)}catch(n){throw pn(n)}}async unlinkSolanaWallet(e){try{let n=await this.api.post(bUe,{address:e});return await this.getAuthenticatedUser()??mr(n)}catch(n){throw pn(n)}}async unlinkOAuth(e,n){try{let r=await this.api.post(jUe,{provider:e,subject:n});return await this.getAuthenticatedUser()??mr(r)}catch(r){throw pn(r)}}async unlinkFarcaster(e){try{let n=await this.api.post(xUe,{fid:e});return await this.getAuthenticatedUser()??mr(n)}catch(n){throw pn(n)}}async unlinkTelegram(e){try{let n=await this.api.post(YUe,{telegram_user_id:e});return await this.getAuthenticatedUser()??mr(n)}catch(n){throw pn(n)}}async revokeDelegatedWallet(){try{await this.api.post(oje,{})}catch(e){throw pn(e)}}async createAnalyticsEvent({eventName:e,payload:n,timestamp:r,options:i}){if(typeof window<"u")try{if(!this.clientAnalyticsId)return void console.warn("No client analytics id set, refusing to send analytics event");await this.api.post(eK,{event_name:e,client_id:this.clientAnalyticsId,payload:{...n||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}},{retry:-1,keepalive:i?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(e){try{return this.api.post(ije,e)}catch(n){throw pn(n)}}async initCoinbaseOnRamp(e){try{return this.api.post(aje,e)}catch(n){throw pn(n)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${sje}?partnerUserId=${e}`)}catch(n){throw pn(n)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(YR.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(YR.PRIVY,e)}async _getToken(e,n){if(this.session.getToken(e)){if(this.session.hasActiveAccessToken(e))return this.session.hasRefreshCredentials(e)?qS.parse(this.session.getToken(e))?.appId!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null);{if(n?.disableAutoRefresh||!this.session.hasRefreshCredentials(e))return null;let r=Pd(xje);if(r){let i=async()=>(await this.session.refresh(),this.session.getToken(e));return await r.withRefreshLock({onLeader:i,onFollowerReleased:async()=>this.session.hasActiveAccessToken(e)?this.session.getToken(e):i()})}return await this.session.refresh(),this.session.getToken(e)}}return!n?.disableAutoRefresh&&this.useServerCookies&&this.session.mightHaveServerCookies?(await this.session.refresh(),this.session.getToken(e)):null}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch{return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch{return void console.error("Unable to fetch token price for SOL")}}async getSplTokenMetadata({mintAddress:e,cluster:n}){try{return await this.api.get(`/api/v1/spl_token_info?mint_address=${e}
113&cluster=${n}`)}catch{return void console.error(`Unable to fetch token metadata for ${n}:${e}`)}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(n){throw console.error("Unable to fetch Farcaster signer status"),n}}async generateSiweNonce({address:e,captchaToken:n}){try{return(await this.api.post(dUe,{address:e,token:n})).nonce}catch(r){throw pn(r)}}async authenticateWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:a,mode:s}){return await this.api.post(fUe,{message:e,signature:n,chainId:r,walletClientType:i,connectorType:a,mode:s})}async linkWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:a}){return await this.api.post(hUe,{message:e,signature:n,chainId:r,walletClientType:i,connectorType:a})}async linkSmartWallet({message:e,signature:n,smartWalletType:r,smartWalletVersion:i}){try{let a=await this.api.post(pUe,{message:e,signature:n,smart_wallet_type:r,smart_wallet_version:i});return mr(a)}catch(a){throw pn(a)}}async linkWithSiwe({message:e,signature:n,chainId:r,walletClientType:i,connectorType:a}){try{let s=await this.linkWithSiweInternal({message:e,signature:n,chainId:r,walletClientType:i,connectorType:a});return mr(s)}catch(s){throw pn(s)}}async generateSiwsNonce({address:e,captchaToken:n}){try{return(await this.api.post(mUe,{address:e,token:n})).nonce}catch(r){throw pn(r)}}async authenticateWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,mode:a,messageType:s="plain"}){return await this.api.post(vUe,{message:e,signature:n,walletClientType:r,connectorType:i,mode:a,message_type:s})}async authenticateWithSiws({message:e,signature:n,walletClientType:r,connectorType:i,mode:a,messageType:s="plain"}){let o=await this.authenticateWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,mode:a,messageType:s});this.session.handleTokenResponse(o);let c=mr(o.user);if(!c)throw Error("Authentication failed - no user returned");return{user:c,isNewUser:o.is_new_user||!1}}async sendAccountTransferRequest({nonce:e,account:n,accountType:r,externalWalletMetadata:i,telegramAuthResult:a,telegramWebAppData:s,farcasterEmbeddedAddress:o,oAuthUserInfo:c}){try{let l,u;switch(r){case"email":l=RUe,u={nonce:e,email:n};break;case"sms":l=UUe,u={nonce:e,phoneNumber:n};break;case"siwe":if(l=yUe,!i)throw Error("Wallet parameters must be defined");u={nonce:e,address:n,...i};break;case"farcaster":l=IUe,u={nonce:e,farcaster_id:n,farcaster_embedded_address:o};break;case"telegram":l=JUe,u={nonce:e,telegram_auth_result:a,telegram_web_app_data:s};break;case"siws":l=_Ue,u={nonce:e,address:n,...i};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:l=BUe,u={nonce:e,userInfo:c}}let d=await this.api.post(l,u);return await this.getAuthenticatedUser()??mr(d)}catch(l){throw pn(l)}}async linkWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,messageType:a="plain"}){return await this.api.post(wUe,{message:e,signature:n,walletClientType:r,connectorType:i,message_type:a})}async linkWithSiws({message:e,signature:n,walletClientType:r,connectorType:i,messageType:a="plain"}){try{let s=await this.linkWithSiwsInternal({message:e,signature:n,walletClientType:r,connectorType:i,messageType:a});return mr(s)}catch(s){throw pn(s)}}async updateUserAndIdToken(){try{let e=await this.api.get(cje);return this.session.updateIdentityToken(e.identity_token),mr(e.user)}catch(e){throw pn(e)}}async scanTransaction(e){try{return await this.api.post(lje,e)}catch(n){throw pn(n)}}constructor({apiUrl:e=l8,appId:n,appClientId:r,timeout:i=u4e}){Object.defineProperty(this,j4,{value:Rje}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==l8&&e.startsWith("https://privy."),this.timeout=i,this.appId=n,this.appClientId=r,this.clientAnalyticsId=function(a,s){if(!Object.prototype.hasOwnProperty.call(a,s))throw TypeError("attempted to use private field on non-instance");return a}(this,j4)[j4](),U4||(U4=new kje),this.session=U4,this.api=this.generateApi(),this.session.client=this}};function Rje(){if(typeof window>"u")return null;try{let e=nt.get(u8);if(typeof e=="string"&&e.length>0)return e}catch{}let t=crypto.randomUUID();try{return nt.put(u8,t),t}catch{return t}}function aK(){if(!Zy)throw new Q("No global PrivyClient instance found. Please ensure you have initialized the PrivyProvider.");return Zy}function Oje(t){Zy||(Zy=new Pje({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}))}async function kn(){let t=aK();return t?t.getAccessToken():Promise.resolve(nt.get(V3)||nt.get(oh)||null)}async function JR(t,e,n,r){let i=Yg(t),{chain:a,authorizationList:s,...o}=await(async()=>r?await r():await e.prepareTransactionRequest({...i,account:{address:n,type:"json-rpc"}}))();return{...o,type:bB[o.type],authorizationList:t.authorizationList}}let Mje=["calls","feePayer","feePayerSignature","feeToken","keyAuthorization","nonceKey","signature","validBefore","validAfter"];const Nje=t=>{if(!t||typeof t!="object")return!1;if(t.type===Jm||typeof t.type=="string"&&t.type.toLowerCase()===_B)return!0;let e=t.account;return!!e?.keyType&&e.keyType!=="secp256k1"||e?.source==="accessKey"||Mje.some(n=>t[n]!==void 0)},Dje=t=>
113({type:Jm,from:t.from,chainId:t.chainId,nonce:t.nonce,gasLimit:t.gasLimit??t.gas,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,calls:Fje(t),feeToken:Uje(t.feeToken),nonceKey:jje(t.nonceKey),validBefore:t.validBefore,validAfter:t.validAfter,feePayerSignature:t.feePayerSignature??void 0,accessList:t.accessList});let Fje=t=>{let e=t.calls&&t.calls.length>0?t.calls:t.to?[{to:t.to,data:t.data,value:t.value}]:[];if(e.length===0)throw Error("Tempo transactions require at least one call");return e.map(n=>{if(!n.to)throw Error("Tempo transaction calls require a `to` address");return{to:n.to,data:n.data,value:n.value}})},Uje=t=>{if(t!==void 0)return typeof t=="string"?t:`0x20c0${t.toString(16).padStart(36,"0")}`},jje=t=>{if(t!=="expiring"&&t!=="random")return t};const Wo=Pi(()=>({user:null,authenticated:!1,hasResolvedInitialUser:!1})),Xt=t=>Wo.setState({user:t}),Bje=t=>Wo.setState({authenticated:t}),Vje=t=>Wo.setState({hasResolvedInitialUser:t}),Pv=(t,{chainType:e,walletIndex:n}={})=>t?.linkedAccounts.filter(r=>!(r.type!=="wallet"||r.walletClientType!=="privy"||n!==void 0&&r.walletIndex!==n||e!==void 0&&r.chainType!==e))??[],Xc=Pi(()=>({ethereumExternal:[],areExternalConnectorsReady:!1,ethereumEmbedded:[]})),XR=t=>Xc.setState({areExternalConnectorsReady:t}),ZS=L.createContext(!1),Hje=()=>{if(L.useContext(ZS))throw new Q("Multiple PrivyProvider instances found","Found multiple instances of PrivyProvider, ensure there is only one mounted in your application tree.")};function KS(){let t=L.useContext(ZS),e=Vt(),n=Xc(d=>d.ethereumEmbedded),r=Xc(d=>d.ethereumExternal),i=Xc(d=>d.areExternalConnectorsReady),a=Wo(d=>d.user),s=Wo(d=>d.hasResolvedInitialUser),o=L.useMemo(()=>[...n,...r].sort((d,f)=>f.connectedAt-d.connectedAt),[n,r]),c=Pv(a,{chainType:"ethereum"}).length>0,l=n.length>0,u=!!i&&!!s&&!!e.walletProxy&&(!c||l);return t?L.useMemo(()=>({wallets:o,ready:u}),[o,u]):(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1})}const Ky=t=>{if(t.chainType==="ethereum")return{entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"};if(t.chainType==="solana")return{entropyId:t.address,entropyIdVerifier:"solana-address-ver
113ifier"};throw Error("Failed to get account entropy details")},Dc=(t,e)=>{if(e?.imported)return Ky(e);let n=Tp(t);if(!n)throw Error("Failed to find primary wallet");return Ky(n)};function Wje({src:t,...e}){return m.jsx("img",{src:t,...e,style:{display:"none"}})}const sK=L.createContext({currentScreen:null,lastScreen:null,navigate:ue,navigateBack:ue,resetNavigation:ue,setModalData:ue,onUserCloseViaDialogOrKeybindRef:void 0}),qje=t=>{let e=zr(),[n,r]=L.useState(t.initialScreen),i=L.useRef(null);L.useEffect(()=>{t.open||(i.current=null)},[t.open]),L.useEffect(()=>{i.current=null},[t.initialScreen]);let a={data:t.data,setModalData:t.setModalData,currentScreen:t.initialScreen,lastScreen:n,navigate:(s,o=!0)=>{t.setInitialScreen(s),o&&r(t.initialScreen)},navigateBack:()=>{t.setInitialScreen(n)},resetNavigation:()=>{t.setInitialScreen(null),r(null)},onUserCloseViaDialogOrKeybindRef:i};return m.jsxs(sK.Provider,{value:a,children:[(typeof e.appearance.logo=="string"||e.appearance.logo?.type==="img")&&m.jsx(Wje,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},es=()=>L.useContext(sK),zje={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},connectOrCreateWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},oK=L.createContext(void 0);let cK=()=>L.useContext(oK);function La(t,e){if(!e)return;let n=cK().current[t];return L.useEffect(()=>{for(let[r,i]of Object.entries(e))Object.prototype.hasOwnProperty.call(n,r)||console.warn(`Invalid event type "${r}" for action "${t}"`),n[r]?.push(i);return()=>{for(let[r,i]of Object.entries(e))Object.prototype.hasOwnProperty.call(n,r)||console.warn(`Invalid event type "${r}" for action "${t}"`),n[r]=n[r]?.filter(a=>a!==i)}},[e])}function ve(t,e,n,...r){for(let i of t.current[e][n])i(...r)}function Vu(){let t=cK();return(e,n,...r)=>ve(t,e,n,...r)}function Rv(t){return["ethereum","solana"].includes(t.chainType)}function lK(t){let e=t.replace("eip155:","");if(e)return parseInt(e);throw Error("Chain ID not compatible with CAIP-2 format.")}const GS=t=>t.filter(e=>e.method==="wallets"||(e.method==="exchange"?e.provider==="coinbase":e.method==="card"||e.method==="payment-request"?e.provider==="coinbase"||e.provider==="moonpay":(e.method,!1))),QR={[Ks.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[CE.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[Ru.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[bE.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Gs.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[_E.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Jo.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[vE.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[Yo.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[mE.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Go.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[yE.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",[h3e.id]:"0xb88339CB7199b77E23DB6E890353E22632Ba630f",[Ou.id]:"0x754704Bc059F8C67012fEd69BC8A327a5aafb603"},eO=({address:t,appConfig:e,fundWalletConfig:n,methodScreen:r,chainIdOverride:i,comingFromSendTransactionScreen:a=!1,onComplete:s,onError:o})=>{let c,l;if(!e.fundingConfig)throw Error("Wallet funding is not enabled");let u=GS(e.fundingConfig.options);if(u.length<1)throw Error("Wallet funding is not enabled");c=i||(n?.chain?n.chain.id:lK(e.fundingConfig.defaultRecommendedCurrency.chain));let d=e.chains.find(v=>v.id===c);if(!d)throw new Q(`Funding chain ${c} is not in PrivyProvider chains list`);let f=n?.amount??e.fundingConfig.defaultRecommendedAmount,h=!1;function p(){if(!c)return;let v=QR[c];u.find(b=>b.method==="wallets")&&!v&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),l=v,h=!0}var g;n&&"asset"in n?n.asset==="USDC"?p():typeof n.asset!="string"&&"erc20"in n.asset&&(g=l=n.asset.erc20,h=g===QR[d.id]):e.fundingConfig.defaultRecommendedCurrency.asset==="USDC"&&p();let y=n?.defaultFundingMethod;return{chainType:"ethereum",address:t,amount:f,chain:d,erc20Address:l,erc20ContractInfo:h?{symbol:"USDC",decimals:6}:void 0,isUSDC:h,methodScreen:r,supportedOptions:u,comingFromSendTransactionScreen:a,defaultFundingMethod:y,usingDefaultFundingMethod:!!y,preferredCardProvider:n?.card?.preferredProvider,crossChainBridgingEnabled:e.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:n&&"uiConfig"in n?n.uiConfig:void 0,externalSolanaFundingScreen:null,onComplete:s??(()=>{}),onError:o??(()=>{})}};function Eot({address:t,fundWalletConfig:e,appConfig:n,comingFromSendTransactionScreen:r,externalSolanaFundingScreen:i,methodScreen:a}){if(!n.fundingConfig)throw Error("Wallet funding is not enabled");let s=GS(n.fundingConfig.options);if(s.length<1)throw Error("Wallet funding is not enabled");if(e?.asset==="USDC"&&e?.chain==="solana:testnet")throw Error("USDC funding is not supported on the Solana testnet");let o=e?.amount??n.fundingConfig.defaultRecommendedAmount,c=e?.defaultFundingMethod;return{chainType:"solana",address:t,supportedOptions:s,amount:o,isUSDC:e?.asset==="USDC",methodScreen:a,comingFromSendTransactionScreen:r,chain:e?.chain||"solana:mainnet",crossChainBridgingEnabled:n.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:c,preferredCardProvider:e?.card?.preferredProvider,usingDefaultFundingMethod:!!c,uiConfig:e?.uiConfig,externalSolanaFundingScreen:i,onComplete:()=>{},onError:()=>{}}}function Zje(){let{user:t,getAccessToken:e}
113=$i(),{walletProxy:n,openModal:r,client:i}=Vt(),{setModalData:a}=es(),s=zr();return L.useMemo(()=>({exportWallet:o=>new Promise(async(c,l)=>{if(!t)return void l(Error("User must be authenticated before exporting their Privy wallet"));o&&"target"in o&&o&&(o=void 0);let u=o?.address?_d(t,o.address):Yc(t);if(!u)return void l(new Q("User must have an embedded wallet."));let d=u.address,{entropyId:f,entropyIdVerifier:h}=Dc(t,u),p=Ki(u);if(!d)return void l(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));if(!t2(d))return void l(Error("Must provide a valid Ethereum address."));let g={recoveryMethod:u.recoveryMethod,connectingWalletAddress:u.address,isUnifiedWallet:p,entropyId:f,entropyIdVerifier:h,onCompleteNavigateTo:"EmbeddedWalletKeyExportScreen",onFailure:l,shouldForceMFA:!0};await e()&&n?Rv(u)?(a({keyExport:{appId:s.id,appClientId:s.appClientId,origin:i.apiUrl,address:u.address,entropyId:f,entropyIdVerifier:h,hdWalletIndex:u.walletIndex,chainType:u.chainType,walletId:u.id,isUnifiedWallet:p,imported:u.imported,onSuccess:c,onFailure:l,showBackButton:o?.showBackButton},connectWallet:g}),r("EmbeddedWalletConnectingScreen")):l(Error(`Export is not supported for ${u.chainType} wallets`)):l(Error("Must have valid access token."))})}),[t,e,n,r,i,a,s])}const Kje=()=>{let{authenticated:t,user:e}=$i(),{openModal:n,inProgressAuthFlowRef:r,inProgressLoginOrLinkMethodRef:i}=Vt(),a=Vu();return{update:L.useCallback(()=>{if(!t)throw a("linkAccount","onError",fe.MUST_BE_AUTHENTICATED,{linkMethod:"email"}),new Q("User must be authenticated before linking an account.");if(!e?.email)throw new Q("User does not have an email linked to their account.");r.current="update",i.current="email",n("UpdateEmailScreen")},[t,a,r,i,n,e])}},Gje=()=>{let{authenticated:t,user:e}=$i(),{openModal:n,inProgressAuthFlowRef:r,inProgressLoginOrLinkMethodRef:i}=Vt(),a=Vu();return{update:L.useCallback(()=>{if(!t)throw a("linkAccount","onError",fe.MUST_BE_AUTHENTICATED,{linkMethod:"sms"}),new Q("User must be authenticated before linking an account.");if(!e?.phone)throw new Q("User does not have a phone number linked to their account.");r.current="update",i.current="sms",n("UpdatePhoneScreen")},[t,a,r,i,n,e])}},Yje=()=>{let{client:t,setUser:e}=Vt();return{unlink:L.useCallback(async({address:n})=>{let r;return e(r=n.startsWith("0x")?await t.unlinkEthereumWallet(n):await t.unlinkSolanaWallet(n)),r},[t,e])}},Jje=({w:t,h:e})=>{let n=window.screenLeft===void 0?window.screenX:window.screenLeft,r=window.screenTop===void 0?window.screenY:window.screenTop,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,s=i/window.screen.availWidth,o=a/window.screen.availHeight;return`toolbar=0,location=0,menubar=0,height=${e},width=${t},popup=1,left=${(i-t)/2/s+n},top=${(a-e)/2/o+r}`},uK=t=>window.open(t?.location,void 0,Jje({w:440,h:680})),Xje=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: 114${t} 115 116${`You are proving you own ${t}.`} 117 118URI: ${window.location.origin} 119Version: 1 120Chain ID: mainnet 121Nonce: ${e} 122Issued At: ${new Date().toISOString()} 123Resources: 124- https://privy.io`;let Qje=class{async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(XZ,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw xt(e)}}async link(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(QZ,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw xt(e)}}constructor(e){this.meta=e}};async function dK({api:t,requesterAppId:e,providerAppId:n}){let r=(await t.get(`/api/v1/apps/${e}/cross-app/connections`)).connections.find(i=>i.provider_app_id===n);if(!r)throw new Q("Invalid connected app");return{name:r.provider_app_name,logoUrl:r.provider_app_icon_url||void 0,apiUrl:r.provider_app_custom_api_url,readOnly:r.read_only,customAuthAuthorizeUrl:r.provider_app_custom_auth_authorize_url,customAuthTransactUrl:r.provider_app_custom_auth_transact_url}}async function eBe({api:t,appId:e}){let n=WS(),r=ZZ(),i=await KZ(n);try{let{url:a}=await t.post(JZ,{provider:`privy:${e}`,redirect_to:window.location.href,code_challenge:i,state_code:r});return{url:a,stateCode:r,codeVerifier:n}}
124catch(a){throw xt(a)}}async function tBe({appId:t,stateCode:e,codeVerifier:n,authorizationCode:r,action:i,client:a,disableSignup:s}){if(!r||!e)throw new Q("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(r==="undefined")throw new Q("User denied confirmation during cross-app auth flow");try{let o=new Qje({authorizationCode:r,stateCode:e,codeVerifier:n,provider:`privy:${t}`,disableSignup:!!s});a.startAuthFlow(o);let c=i==="link"?await a.link():await a.authenticate(),l=c.oAuthTokens?.accessToken;return console.debug(),l}catch(o){let c=xt(o);throw c.privyErrorCode===fe.ACCOUNT_TRANSFER_REQUIRED?c:c.privyErrorCode?new Q(c.message||"Invalid code during cross-app auth flow.",void 0,c.privyErrorCode):c.message==="User denied confirmation during cross-app auth flow"?new Q("Invalid code during cross-app auth flow.",void 0,fe.OAUTH_USER_DENIED):new Q("Invalid code during cross-app auth flow.",void 0,fe.UNKNOWN_AUTH_ERROR)}}const nBe=Symbol("solana-funding-plugin"),rBe=Symbol("solana-ledger-plugin"),fK=async({user:t,accessToken:e,proxy:n,refreshSessionAndUser:r,privy:i,appConfig:a,recoverEmbeddedWallet:s,setUser:o,walletIndex:c,chainType:l,recoveryMethod:u,recoveryPassword:d,recoveryAccessToken:f,idempotencyKey:h,additionalSigners:p})=>{if(c===0)if(a.embeddedWallets.mode==="user-controlled-server-wallets-only")await s8(i,{request:{chain_type:l,additional_signers:p?ik(p):void 0},headers:h?{"privy-idempotency-key":h}:void 0});else if(l==="ethereum"){let v=gy(t);v&&await s({address:v.address}),await n.create({accessToken:e,solanaAddress:v?.address,recoveryMethod:u,recoveryPassword:d,recoveryAccessToken:f})}else{if(l!=="solana")throw Error("Invalid input to create wallet");{let v=Yc(t);v&&await s({address:v.address}),await n.createSolana({accessToken:e,ethereumAddress:v?.address,recoveryMethod:u,recoveryPassword:d,recoveryAccessToken:f})}}else if(a.embeddedWallets.mode==="user-controlled-server-wallets-only")await s8(i,{request:{chain_type:l,additional_signers:p?ik(p):void 0}});else{let{entropyId:v,entropyIdVerifier:b}=Dc(t);await s(),await n.addWallet({accessToken:e,entropyId:v,entropyIdVerifier:b,chainType:l,hdWalletIndex:c})}let g=await r(),y=Pv(g,{chainType:l,walletIndex:c})[0];return o(g),{user:g,account:y}},a3=async({user:t,address:e,client:n,request:r,requesterAppId:i,reconnect:a})=>{n.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:e,method:r.method}});let s=t?.linkedAccounts.find(d=>d.type==="cross_app"&&(d.embeddedWallets.some(f=>f.address===e)||d.smartWallets.some(f=>f.address===e)));if(!t||!s)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:e}}),new Q("Cannot request a signature with this wallet address");let o=n.getProviderAccessToken(s.providerApp.id),c=await dK({api:n.api,requesterAppId:i,providerAppId:s.providerApp.id});if(!o){if(c.readOnly)throw console.error("cannot transact against a read-only provider app"),new Q("Cannot transact against a read-only provider app");await a({appId:s.providerApp.id,action:"link"})&&(o=n.getProviderAccessToken(s.providerApp.id))}if(!o)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:e}}),new Q("Transactions require a valid token");let l=new URL(c.customAuthTransactUrl||`${c.apiUrl}/oauth/transact`);l.searchParams.set("token",o||""),l.searchParams.set("request",iBe(r));let u=uK({location:l.href});if(!u)throw n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:e}}),new Q("Failed to initialize signature request");return new Promise((d,f)=>{let h=setTimeout(()=>{y(),f(new Q("Request timeout")),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:e}})},12e4),p=setInterval(()=>{u.closed&&(y(),f(new Q("User rejected request")),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:e}}))},300),g=v=>{v.data&&(v.data.token?.action==="set"&&v.data.token?.value!==void 0?n.storeProviderAccessToken(s.providerApp.id,v.data.token.value):v.data.token?.action==="clear"&&n.storeProviderAccessToken(s.providerApp.id,null),v.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&v.data.result&&(y(),d(v.data.result),n.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:e,method:r.method}})),v.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&v.data.error&&(y(),f(v.data.error),n.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:v.data.error,address:e}})))};window.addEventListener("message",g);let y=()=>{u.close(),clearInterval(p),clearTimeout(h),window.removeEventListener("message",g)}})};let iBe=t=>JSON.stringify({content:{request:{request:Tb(t,An)}},timestamp:Date.now(),callbackUrl:window.origin});const Tb=(t,e)=>typeof t=="bigint"?e(t):Array.isArray(t)?t.map(n=>Tb(n,e)):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([n,r])=>[n,Tb(r,e)])):t,aBe=()=>{let{user:t,getAccessToken:e}=$i(),{client:n,setUser:r,openModal:i,inProgressAuthFlowRef:a,inProgressLoginOrLinkMethodRef:s}=Vt(),o=zr(),c=Vu(),{setModalData:l}=es(),u=L.useCallback(v=>t?.linkedAccounts.some(b=>b.type==="cross_app"&&b.smartWallets.some(w=>w.address===v))??!1,[t]),d=L.useCallback(async({appId:v,action:b,disableSignup:w})=>{let _=await e();if(b==="link"&&!_)throw c("linkAccount","onError",fe.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${v}`}),new Q("User must be authenticated before linking an account.");if(b==="login"&&_)throw c("login","onError",fe.UNKNOWN_AUTH_ERROR),new Q("Attempted to log in, but user is already logged in. Use a `link` helper instead.");s.current=`privy:${v}`,a.current=b;let E=uK();return n.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:v}}),new Promise(async(C,x)=>{let{name:$,logoUrl:T}=await dK({api:n.api,providerAppId:v,requesterAppId:o.id});l({crossAppAuth:{appId:v,name:$,logoUrl:T,action:b,popup:E,disableSignup:w,onSuccess:C,onError:x}}),i("CrossAppAuthScreen")}
124)},[e,c,s,a,n,o.id,l,i]),f=L.useCallback(async({subject:v})=>{let b=t?.linkedAccounts.find(_=>_.type==="cross_app"&&_.subject===v)?.providerApp;if(!b)throw new Q("Invalid subject");n.storeProviderAccessToken(b.id,null);let w=await n.unlinkOAuth(`privy:${b.id}`,v);return r(w),w},[t,n,r]),h=L.useCallback((v,{address:b,chainId:w})=>a3({user:t,client:n,address:b,requesterAppId:o.id,request:{method:u(b)?"privy_signSmartWalletMessage":"personal_sign",params:[v,b],chainId:w},reconnect:d}),[t,n,o.id,u,d]),p=L.useCallback((v,{address:b,chainId:w})=>{let _=Ey(v);return a3({user:t,client:n,address:b,requesterAppId:o.id,request:{method:u(b)?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[b,_],chainId:w},reconnect:d})},[t,n,o.id,u,d]),g=L.useCallback((v,{address:b})=>a3({user:t,client:n,address:b,requesterAppId:o.id,request:{method:u(b)?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[v],chainId:v.chainId},reconnect:d}),[t,n,o.id,u,d]),y=L.useCallback((v,{address:b})=>a3({user:t,client:n,address:b,requesterAppId:o.id,request:{method:u(b)?"privy_signSmartWalletTx":"eth_signTransaction",params:[v],chainId:v.chainId},reconnect:d}),[t,n,o.id,u,d]);return L.useMemo(()=>({startCrossAppAuthFlow:d,unlinkCrossAppAccount:f,signMessageWithCrossAppWallet:h,signTypedDataWithCrossAppWallet:p,sendTransactionWithCrossAppWallet:g,signTransactionWithCrossAppWallet:y}),[d,f,h,p,g,y])},sBe=()=>{let{client:t,setUser:e}=Vt();return{unlink:L.useCallback(async({address:n})=>{let r=await t.unlinkEmail(n);return e(r),r},[t,e])}},oBe=()=>{let{client:t,setUser:e}=Vt();return{unlink:L.useCallback(async({fid:n})=>{let r=await t.unlinkFarcaster(n);return e(r),r},[t,e])}},cBe=()=>{let{client:t,setUser:e}=Vt();return{unlink:L.useCallback(async({provider:n,subject:r})=>{let i=await t.unlinkOAuth(n,r);return e(i),i},[t,e])}},lBe=()=>{let{client:t,setUser:e,walletProxy:n}=Vt(),{getAccessToken:r}=$i(),i=zr(),a=i?.passkeys?.shouldUnenrollMfaOnUnlink??!1;return{unlink:L.useCallback(async({credentialId:s})=>{let o=await r();if(!o)throw Error("Must have valid access token to enroll in MFA");if(!n)throw Error("Wallet proxy not initialized.");await n.unlinkPasskeyAccount({credentialId:s,accessToken:o,removeAsMfa:a});let c=await t.getAuthenticatedUser();return e(c),c},[a,t,r,e,n])}},uBe=()=>{let{client:t,setUser:e}=Vt();return{unlink:L.useCallback(async({phoneNumber:n})=>{let r=await t.unlinkPhone(n);return e(r),r},[t,e])}},dBe=()=>{let{client:t,setUser:e}=Vt();return{unlink:L.useCallback(async({telegramUserId:n})=>{let r=await t.unlinkTelegram(n);return e(r),r},[t,e])}},fBe=t=>t.reduce((e,n)=>!e||e.walletIndex<n.walletIndex?n:e,null),hBe=async({appConfig:t,getAccessToken:e,initializeWalletProxy:n,user:r,privy:i,emitPrivyEvent:a,recoverEmbeddedWallet:s,setModalData:o,openModal:c,setUser:l,options:u,timeoutDuration:d,refreshSessionAndUser:f,chainType:h,idempotencyKey:p,additionalSigners:g})=>{let[y,v]=await Promise.all([n(d),e()]);if(!v||!r)throw a("createWallet","onError",fe.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!y&&t.customAuth?.enabled)throw a("createWallet","onError",fe.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(g&&t.embeddedWallets.mode!=="user-controlled-server-wallets-only")throw new Q("Specifying additionalSigners is only supported for TEE execution and this app uses on-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");if(u&&"walletIndex"in u&&typeof u.walletIndex=="number"){if(t.embeddedWallets.mode==="user-controlled-server-wallets-only")throw a("createWallet","onError",fe.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return tO({accessToken:v,appConfig:t,privy:i,emitPrivyEvent:a,openModal:c,proxy:y,refreshSessionAndUser:f,recoverEmbeddedWallet:s,setModalData:o,user:r,walletIndex:u.walletIndex,chainType:h,setUser:l,additionalSigners:g})}let b=u&&"createAdditional"in u&&u.createAdditional,w=Pv(r,{chainType:h});if(w[0]&&!b)throw a("createWallet","onError",fe.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return tO({accessToken:v,appConfig:t,privy:i,emitPrivyEvent:a,openModal:c,proxy:y,recoverEmbeddedWallet:s,setModalData:o,user:r,walletIndex:(fBe(w)?.walletIndex??-1)+1,chainType:h,refreshSessionAndUser:f,setUser:l,idempotencyKey:p,additionalSigners:g})};let tO=async({accessToken:t,appConfig:e,privy:n,emitPrivyEvent:r,proxy:i,refreshSessionAndUser:a,recoverEmbeddedWallet:s,user:o,walletIndex:c,setModalData:l,openModal:u,chainType:d,setUser:f,idempotencyKey:h,additionalSigners:p})=>{if(c<0)throw r("createWallet","onError",fe.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${c}
124) is invalid.`);let g=Tp(o);if(c>0&&!g)throw r("createWallet","onError",fe.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(e.embeddedWallets.requireUserOwnedRecoveryOnCreate&&e.embeddedWallets.mode==="user-controlled-server-wallets-only")throw r("createWallet","onError",fe.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!g&&e.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await nO({emitPrivyEvent:r,setModalData:l,openModal:u,chainType:d});let y=Pv(o,{chainType:d,walletIndex:c})[0];if(y)return{user:o,account:y};if(c===0&&!i)return nO({emitPrivyEvent:r,setModalData:l,openModal:u,chainType:d});if(!i)throw r("createWallet","onError",fe.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return fK({appConfig:e,walletIndex:c,chainType:d,user:o,accessToken:t,proxy:i,refreshSessionAndUser:a,privy:n,recoverEmbeddedWallet:s,setUser:f,idempotencyKey:h,additionalSigners:p})},nO=async({emitPrivyEvent:t,setModalData:e,openModal:n,chainType:r})=>new Promise((i,a)=>{e({createWallet:{onSuccess:({user:s,account:o})=>{t("createWallet","onSuccess",{wallet:o}),i({user:s,account:o})},onFailure:s=>{t("createWallet","onError",fe.UNKNOWN_EMBEDDED_WALLET_ERROR),a(s)},callAuthOnSuccessOnClose:!1,shouldCreateEth:r==="ethereum",shouldCreateSol:r==="solana"}}),n("EmbeddedWalletOnAccountCreateScreen")});const pBe=()=>{let t=zr(),e=Vu(),{setModalData:n}=es(),{initializeWalletProxy:r,recoverEmbeddedWallet:i,setUser:a,openModal:s,refreshSessionAndUser:o,privy:c,client:l}=Vt();return{create:async({chainType:u,options:d,latestUser:f,idempotencyKey:h})=>{let p=f;if(p||(p=await o()),!p)throw e("createWallet","onError",fe.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await hBe({appConfig:t,privy:c,getAccessToken:()=>l.getAccessToken(),refreshSessionAndUser:o,initializeWalletProxy:r,user:p,emitPrivyEvent:e,recoverEmbeddedWallet:i,setModalData:n,openModal:s,setUser:a,options:d,timeoutDuration:h4e,chainType:u,idempotencyKey:h,additionalSigners:d?.signers})}}};function hK(t){let{create:e}=pBe();return La("createWallet",t),{createWallet:async n=>{n&&"target"in n&&n&&(n=void 0);let{account:r}=await e({chainType:"ethereum",options:n});return r}}}const gBe=async({emitPrivyEvent:t,getAccessToken:e,initializeWalletProxy:n,refreshSessionAndUser:r,user:i,appConfig:a},{privateKey:s,chainType:o,additionalSigners:c})=>{if(!i)throw t("linkAccount","onError",fe.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new Q("User must be authenticated before linking an account.");let l=a.embeddedWallets.mode==="user-controlled-server-wallets-only"?"tee":"on-device";if(c&&l==="on-device")throw new Q("Specifying additionalSigners is only supported for TEE execution and this app uses on-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[u,d]=await Promise.all([e(),n(15e3)]);if(!d||!u)throw t("linkAccount","onError",fe.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new Q("User must be authenticated before linking an account.");let{address:f}=await d.importWallet({privateKey:s,accessToken:u,chainType:o,mode:l,additionalSigners:c}),h=await r(),p=o==="solana"?jE(h):UE(h),g=p?.find(y=>y.address===f);if(!g)throw t("createWallet","onError",fe.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return t("createWallet","onSuccess",{wallet:g}),g},yBe=()=>{let{user:t}=$i(),{client:e,refreshSessionAndUser:n,initializeWalletProxy:r}=Vt(),i=Vu(),a=zr();return{importWallet:L.useCallback(({privateKey:s,additionalSigners:o})=>gBe({getAccessToken:()=>e.getAccessToken(),user:t,initializeWalletProxy:r,refreshSessionAndUser:n,emitPrivyEvent:i,appConfig:a},{privateKey:s,chainType:"ethereum",additionalSigners:o}),[t,e,n,r,i,a])}},YS=()=>{let t=L.useContext(Ia),{importWallet:e}=yBe(),{exportWallet:n}=Zje(),{createWallet:r}=hK(),{unlinkCrossAppAccount:i}=aBe(),{unlink:a}=Yje(),{unlink:s}=sBe(),{unlink:o}=uBe(),{unlink:c}=oBe(),{unlink:l}=dBe(),{unlink:u}=lBe(),{unlink:d}=cBe(),f=L.useCallback(A=>a({address:A}),[a]),h=L.useCallback(A=>s({address:A}),[s]),p=L.useCallback(A=>o({phoneNumber:A}),[o]),g=L.useCallback(A=>c({fid:A}),[c]),y=L.useCallback(A=>l({telegramUserId:A}),[l]),v=L.useCallback(A=>u({credentialId:A}),[u]),b=L.useCallback(A=>d(A),[d]),w=L.useCallback(A=>d({provider:"google",subject:A}),[d]),_=L.useCallback(A=>d({provider:"twitter",subject:A}),[d]),E=L.useCallback(A=>d({provider:"twitch",subject:A}),[d]),C=L.useCallback(A=>d({provider:"discord",subject:A}),[d]),x=L.useCallback(A=>d({provider:"github",subject:A}),[d]),$=L.useCallback(A=>d({provider:"spotify",subject:A}),[d]),T=L.useCallback(A=>d({provider:"instagram",subject:A}),[d]),U=L.useCallback(A=>d({provider:"tiktok",subject:A}),[d]),O=L.useCallback(A=>d({provider:"line",subject:A}),[d]),F=L.useCallback(A=>d({provider:"linkedin",subject:A}),[d]),k=L.useCallback(A=>d({provider:"apple",subject:A}),[d]),{update:S}
vendor: 4,265 bytes, line 124
124=Kje(),{update:I}=Gje();return{...t,importWallet:e,createWallet:r,exportWallet:n,unlinkCrossAppAccount:i,unlinkWallet:f,unlinkEmail:h,unlinkPhone:p,unlinkGoogle:w,unlinkTwitter:_,unlinkTwitch:E,unlinkDiscord:C,unlinkGithub:x,unlinkSpotify:$,unlinkInstagram:T,unlinkTiktok:U,unlinkLine:O,unlinkLinkedIn:F,unlinkApple:k,unlinkFarcaster:g,unlinkTelegram:y,unlinkPasskey:v,unlinkOAuth:b,updateEmail:S,updatePhone:I}};var Br=function(){return Br=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Br.apply(this,arguments)};function E2(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}var sn="-ms-",qh="-moz-",Mt="-webkit-",pK="comm",Ov="rule",JS="decl",mBe="@import",gK="@keyframes",vBe="@layer",yK=Math.abs,XS=String.fromCharCode,Lb=Object.assign;function wBe(t,e){return sr(t,0)^45?(((e<<2^sr(t,0))<<2^sr(t,1))<<2^sr(t,2))<<2^sr(t,3):0}function mK(t){return t.trim()}function vo(t,e){return(t=e.exec(t))?t[0]:t}function vt(t,e,n){return t.replace(e,n)}function ag(t,e,n){return t.indexOf(e,n)}function sr(t,e){return t.charCodeAt(e)|0}function S2(t,e,n){return t.slice(e,n)}function As(t){return t.length}function vK(t){return t.length}function gh(t,e){return e.push(t),t}function bBe(t,e){return t.map(e).join("")}function rO(t,e){return t.filter(function(n){return!vo(n,e)})}var Mv=1,A2=1,wK=0,Ea=0,Hn=0,tf="";function Nv(t,e,n,r,i,a,s,o){return{value:t,root:e,parent:n,type:r,props:i,children:a,line:Mv,column:A2,length:s,return:"",siblings:o}}function bc(t,e){return Lb(Nv("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function pd(t){for(;t.root;)t=bc(t.root,{children:[t]});gh(t,t.siblings)}function _Be(){return Hn}function CBe(){return Hn=Ea>0?sr(tf,--Ea):0,A2--,Hn===10&&(A2=1,Mv--),Hn}function Xa(){return Hn=Ea<wK?sr(tf,Ea++):0,A2++,Hn===10&&(A2=1,Mv++),Hn}function fu(){return sr(tf,Ea)}function sg(){return Ea}function Dv(t,e){return S2(tf,t,e)}function kb(t){switch(t){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 EBe(t){return Mv=A2=1,wK=As(tf=t),Ea=0,[]}function SBe(t){return tf="",t}function B4(t){return mK(Dv(Ea-1,$b(t===91?t+2:t===40?t+1:t)))}function ABe(t){for(;(Hn=fu())&&Hn<33;)Xa();return kb(t)>2||kb(Hn)>3?"":" "}function xBe(t,e){for(;--e&&Xa()&&!(Hn<48||Hn>102||Hn>57&&Hn<65||Hn>70&&Hn<97););return Dv(t,sg()+(e<6&&fu()==32&&Xa()==32))}function $b(t){for(;Xa();)switch(Hn){case t:return Ea;case 34:case 39:t!==34&&t!==39&&$b(Hn);break;case 40:t===41&&$b(t);break;case 92:Xa();break}return Ea}function IBe(t,e){for(;Xa()&&t+Hn!==57;)if(t+Hn===84&&fu()===47)break;return"/*"+Dv(e,Ea-1)+"*"+XS(t===47?t:Xa())}function TBe(t){for(;!kb(fu());)Xa();return Dv(t,Ea)}function LBe(t){return SBe(og("",null,null,null,[""],t=EBe(t),0,[0],t))}function og(t,e,n,r,i,a,s,o,c){for(var l=0,u=0,d=s,f=0,h=0,p=0,g=1,y=1,v=1,b=0,w="",_=i,E=a,C=r,x=w;y;)switch(p=b,b=Xa()){case 40:if(p!=108&&sr(x,d-1)==58){ag(x+=vt(B4(b),"&","&\f"),"&\f",yK(l?o[l-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:x+=B4(b);break;case 9:case 10:case 13:case 32:x+=ABe(p);break;case 92:x+=xBe(sg()-1,7);continue;case 47:switch(fu()){case 42:case 47:gh(kBe(IBe(Xa(),sg()),e,n,c),c);break;default:x+="/"}break;case 123*g:o[l++]=As(x)*v;case 125*g:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+u:v==-1&&(x=vt(x,/\f/g,"")),h>0&&As(x)-d&&gh(h>32?aO(x+";",r,n,d-1,c):aO(vt(x," ","")+";",r,n,d-2,c),c);break;case 59:x+=";";default:if(gh(C=iO(x,e,n,l,u,i,o,w,_=[],E=[],d,a),a),b===123)if(u===0)og(x,e,C,C,_,a,d,o,E);else switch(f===99&&sr(x,3)===110?100:f){case 100:case 108:case 109:case 115:og(t,C,C,r&&gh(iO(t,C,C,0,0,i,o,w,i,_=[],d,E),E),i,E,d,o,r?_:E);break;default:og(x,C,C,C,[""],E,0,o,E)}}l=u=h=0,g=v=1,w=x="",d=s;break;case 58:d=1+As(x),h=p;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&CBe()==125)continue}switch(x+=XS(b),b*g){case 38:v=u>0?1:(x+="\f",-1);break;case 44:o[l++]=(As(x)-1)*v,v=1;break;
vendor: 1,495 bytes, line 124
124case 64:fu()===45&&(x+=B4(Xa())),f=fu(),u=d=As(w=x+=TBe(sg())),b++;break;case 45:p===45&&As(x)==2&&(g=0)}}return a}function iO(t,e,n,r,i,a,s,o,c,l,u,d){for(var f=i-1,h=i===0?a:[""],p=vK(h),g=0,y=0,v=0;g<r;++g)for(var b=0,w=S2(t,f+1,f=yK(y=s[g])),_=t;b<p;++b)(_=mK(y>0?h[b]+" "+w:vt(w,/&\f/g,h[b])))&&(c[v++]=_);return Nv(t,e,n,i===0?Ov:o,c,l,u,d)}function kBe(t,e,n,r){return Nv(t,e,n,pK,XS(_Be()),S2(t,2,-2),0,r)}function aO(t,e,n,r,i){return Nv(t,e,n,JS,S2(t,0,r),S2(t,r+1,-1),r,i)}function bK(t,e,n){switch(wBe(t,e)){case 5103:return Mt+"print-"+t+t;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 Mt+t+t;case 4789:return qh+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Mt+t+qh+t+sn+t+t;case 5936:switch(sr(t,e+11)){case 114:return Mt+t+sn+vt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Mt+t+sn+vt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Mt+t+sn+vt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Mt+t+sn+t+t;case 6165:return Mt+t+sn+"flex-"+t+t;case 5187:return Mt+t+vt(t,/(\w+).+(:[^]+)/,Mt+"box-$1$2"+sn+"flex-$1$2")+t;case 5443:return Mt+t+sn+"flex-item-"+vt(t,/flex-|-self/g,"")+(vo(t,/flex-|baseline/)?"":sn+"grid-row-"+vt(t,/flex-|-self/g,""))+t;case 4675:return Mt+t+sn+"flex-line-pack"+vt(t,/align-content|flex-|-self/g,"")+t;
vendor: 21,027 bytes, lines 124-125
124case 5548:return Mt+t+sn+vt(t,"shrink","negative")+t;case 5292:return Mt+t+sn+vt(t,"basis","preferred-size")+t;case 6060:return Mt+"box-"+vt(t,"-grow","")+Mt+t+sn+vt(t,"grow","positive")+t;case 4554:return Mt+vt(t,/([^-])(transform)/g,"$1"+Mt+"$2")+t;case 6187:return vt(vt(vt(t,/(zoom-|grab)/,Mt+"$1"),/(image-set)/,Mt+"$1"),t,"")+t;case 5495:case 3959:return vt(t,/(image-set\([^]*)/,Mt+"$1$`$1");case 4968:return vt(vt(t,/(.+:)(flex-)?(.*)/,Mt+"box-pack:$3"+sn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Mt+t+t;case 4200:if(!vo(t,/flex-|baseline/))return sn+"grid-column-align"+S2(t,e)+t;break;case 2592:case 3360:return sn+vt(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(r,i){return e=i,vo(r.props,/grid-\w+-end/)})?~ag(t+(n=n[e].value),"span",0)?t:sn+vt(t,"-start","")+t+sn+"grid-row-span:"+(~ag(n,"span",0)?vo(n,/\d+/):+vo(n,/\d+/)-+vo(t,/\d+/))+";":sn+vt(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(r){return vo(r.props,/grid-\w+-start/)})?t:sn+vt(vt(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return vt(t,/(.+)-inline(.+)/,Mt+"$1$2")+t;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(As(t)-1-e>6)switch(sr(t,e+1)){case 109:if(sr(t,e+4)!==45)break;case 102:return vt(t,/(.+:)(.+)-([^]+)/,"$1"+Mt+"$2-$3$1"+qh+(sr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~ag(t,"stretch",0)?bK(vt(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return vt(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,a,s,o,c,l){return sn+i+":"+a+l+(s?sn+i+"-span:"+(o?c:+c-+a)+l:"")+t});case 4949:if(sr(t,e+6)===121)return vt(t,":",":"+Mt)+t;break;case 6444:switch(sr(t,sr(t,14)===45?18:11)){case 120:return vt(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Mt+(sr(t,14)===45?"inline-":"")+"box$3$1"+Mt+"$2$3$1"+sn+"$2box$3")+t;case 100:return vt(t,":",":"+sn)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return vt(t,"scroll-","scroll-snap-")+t}return t}function Gy(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function $Be(t,e,n,r){switch(t.type){case vBe:if(t.children.length)break;case mBe:case JS:return t.return=t.return||t.value;case pK:return"";case gK:return t.return=t.value+"{"+Gy(t.children,r)+"}";case Ov:if(!As(t.value=t.props.join(",")))return""}return As(n=Gy(t.children,r))?t.return=t.value+"{"+n+"}":""}function PBe(t){var e=vK(t);return function(n,r,i,a){for(var s="",o=0;o<e;o++)s+=t[o](n,r,i,a)||"";return s}}function RBe(t){return function(e){e.root||(e=e.return)&&t(e)}}function OBe(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case JS:t.return=bK(t.value,t.length,n);return;case gK:return Gy([bc(t,{value:vt(t.value,"@","@"+Mt)})],r);case Ov:if(t.length)return bBe(n=t.props,function(i){switch(vo(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":pd(bc(t,{props:[vt(i,/:(read-\w+)/,":"+qh+"$1")]})),pd(bc(t,{props:[i]})),Lb(t,{props:rO(n,r)});break;case"::placeholder":pd(bc(t,{props:[vt(i,/:(plac\w+)/,":"+Mt+"input-$1")]})),pd(bc(t,{props:[vt(i,/:(plac\w+)/,":"+qh+"$1")]})),pd(bc(t,{props:[vt(i,/:(plac\w+)/,sn+"input-$1")]})),pd(bc(t,{props:[i]})),Lb(t,{props:rO(n,r)});break}return""})}}var MBe={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,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},Wi={},x2=typeof ur<"u"&&Wi!==void 0&&(Wi.REACT_APP_SC_ATTR||Wi.SC_ATTR)||"data-styled",_K="active",CK="data-styled-version",Fv="6.1.17",QS=`/*!sc*/ 125`,Yy=typeof window<"u"&&"HTMLElement"in window,NBe=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof ur<"u"&&Wi!==void 0&&Wi.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Wi.REACT_APP_SC_DISABLE_SPEEDY!==""?Wi.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Wi.REACT_APP_SC_DISABLE_SPEEDY:typeof ur<"u"&&Wi!==void 0&&Wi.SC_DISABLE_SPEEDY!==void 0&&Wi.SC_DISABLE_SPEEDY!==""&&Wi.SC_DISABLE_SPEEDY!=="false"&&Wi.SC_DISABLE_SPEEDY),DBe={},Uv=Object.freeze([]),I2=Object.freeze({});function EK(t,e,n){return n===void 0&&(n=I2),t.theme!==n.theme&&t.theme||e||n.theme}var SK=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),FBe=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,UBe=/(^-|-$)/g;function sO(t){return t.replace(FBe,"-").replace(UBe,"")}var jBe=/(a)(d)/gi,s3=52,oO=function(t){return String.fromCharCode(t+(t>25?39:97))};function Pb(t){var e,n="";for(e=Math.abs(t);e>s3;e=e/s3|0)n=oO(e%s3)+n;return(oO(e%s3)+n).replace(jBe,"$1-$2")}var V4,AK=5381,Md=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},xK=function(t){return Md(AK,t)};function eA(t){return Pb(xK(t)>>>0)}function BBe(t){return t.displayName||t.name||"Component"}function H4(t){return typeof t=="string"&&!0}var IK=typeof Symbol=="function"&&Symbol.for,TK=IK?Symbol.for("react.memo"):60115,VBe=IK?Symbol.for("react.forward_ref"):60112,HBe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},WBe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},LK={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},qBe=((V4={})[VBe]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},V4[TK]=LK,V4);function cO(t){return("type"in(e=t)&&e.type.$$typeof)===TK?LK:"$$typeof"in t?qBe[t.$$typeof]:HBe;var e}var zBe=Object.defineProperty,ZBe=Object.getOwnPropertyNames,lO=Object.getOwnPropertySymbols,KBe=Object.getOwnPropertyDescriptor,GBe=Object.getPrototypeOf,uO=Object.prototype;function kK(t,e,n){if(typeof e!="string"){if(uO){var r=GBe(e);r&&r!==uO&&kK(t,r,n)}var i=ZBe(e);lO&&(i=i.concat(lO(e)));for(var a=cO(t),s=cO(e),o=0;o<i.length;++o){var c=i[o];if(!(c in WBe||n&&n[c]||s&&c in s||a&&c in a)){var l=KBe(e,c);try{zBe(t,c,l)}catch{}}}}return t}function T2(t){return typeof t=="function"}function tA(t){return typeof t=="object"&&"styledComponentId"in t}function tu(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function Jy(t,e){if(t.length===0)return"";for(var n=t[0],r=1;r<t.length;r++)n+=t[r];return n}function jp(t){return t!==null&&typeof t=="object"&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function Rb(t,e,n){if(n===void 0&&(n=!1),!n&&!jp(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)t[r]=Rb(t[r],e[r]);else if(jp(e))for(var r in e)t[r]=Rb(t[r],e[r]);return t}function nA(t,e){Object.defineProperty(t,"toString",{value:e})}function $0(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var YBe=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var n=0,r=0;r<e;r++)n+=this.groupSizes[r];return n},t.prototype.insertRules=function(e,n){if(e>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,a=i;e>=a;)if((a<<=1)<0)throw $0(16,"".concat(e));this.groupSizes=new Uint32Array(a),this.groupSizes.set(r),this.length=a;for(var s=i;s<a;s++)this.groupSizes[s]=0}for(var o=this.indexOfGroup(e+1),c=(s=0,n.length);s<c;s++)this.tag.insertRule(o,n[s])&&(this.groupSizes[e]++,o++)},t.prototype.clearGroup=function(e){if(e<this.length){var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n;this.groupSizes[e]=0;for(var a=r;a<i;a++)this.tag.deleteRule(r)}},t.prototype.getGroup=function(e){var n="";if(e>=this.length||this.groupSizes[e]===0)return n;for(var r=this.groupSizes[e],i=this.indexOfGroup(e),a=i+r,s=i;s<a;s++)n+="".concat(this.tag.getRule(s)).concat(QS);return n},t}(),cg=new Map,Xy=new Map,lg=1,o3=function(t){if(cg.has(t))return cg.get(t);for(;Xy.has(lg);)lg++;var e=lg++;return cg.set(t,e),Xy.set(e,t),e},JBe=function(t,e){lg=e+1,cg.set(t,e),Xy.set(e,t)},XBe="style[".concat(x2,"][").concat(CK,'="').concat(Fv,'"]'),QBe=new RegExp("^".concat(x2,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),eVe=function(t,e,n){for(var r,i=n.split(","),a=0,s=i.length;a<s;a++)(r=i[a])&&t.registerName(e,r)},tVe=function(t,e){for(var n,r=((n=e.textContent)!==null&&n!==void 0?n:"").split(QS),i=[],a=0,s=r.length;a<s;a++){var o=r[a].trim();if(o){var c=o.match(QBe);if(c){var l=0|parseInt(c[1],10),u=c[2];l!==0&&(JBe(u,l),eVe(t,u,c[3]),t.getTag().insertRules(l,i)),i.length=0}else i.push(o)}}},dO=function(t){for(var e=document.querySelectorAll(XBe),n=0,r=e.length;n<r;n++){var i=e[n];i&&i.getAttribute(x2)!==_K&&(tVe(t,i),i.parentNode&&i.parentNode.removeChild(i))}};function nVe(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var $K=function(t){var e=document.head,n=t||e,r=document.createElement("style"),i=function(o){var c=Array.from(o.querySelectorAll("style[".concat(x2,"]")));return c[c.length-1]}(n),a=i!==void 0?i.nextSibling:null;r.setAttribute(x2,_K),r.setAttribute(CK,Fv);var s=nVe();return s&&r.setAttribute("nonce",s),n.insertBefore(r,a),r},rVe=function(){function t(e){this.element=$K(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,i=0,a=r.length;i<a;i++){var s=r[i];if(s.ownerNode===n)return s}throw $0(17)}(this.element),this.length=0}return t.prototype.insertRule=function(e,n){try{return this.sheet.insertRule(n,e),this.length++,!0}catch{return!1}},t.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.prototype.getRule=function(e){var n=this.sheet.cssRules[e];return n&&n.cssText?n.cssText:""},t}(),iVe=function(){function t(e){this.element=$K(e),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(e,n){if(e<=this.length&&e>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},t}(),aVe=function(){function t(e){this.rules=[],this.length=0}return t.prototype.insertRule=function(e,n){return e<=this.length&&(this.rules.splice(e,0,n),this.length++,!0)},t.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},t}(),fO=Yy,sVe={isServer:!Yy,useCSSOMInjection:!NBe},Qy=function(){function t(e,n,r){e===void 0&&(e=I2),n===void 0&&(n={});var i=this;this.options=Br(Br({},sVe),e),this.gs=n,this.names=new Map(r),this.server=!!e.isServer,!this.server&&Yy&&fO&&(fO=!1,dO(this)),nA(this,function(){return function(a){for(var s=a.getTag(),o=s.length,c="",l=function(d){var f=function(v){return Xy.get(v)}(d);if(f===void 0)return"continue";var h=a.names.get(f),p=s.getGroup(d);if(h===void 0||!h.size||p.length===0)return"continue";var g="".concat(x2,".g").concat(d,'[id="').concat(f,'"]'),y="";h!==void 0&&h.forEach(function(v){v.length>0&&(y+="".concat(v,","))}),c+="".concat(p).concat(g,'{content:"').concat(y,'"}').concat(QS)},u=0;u<o;u++)l(u);return c}(i)})}return t.registerId=function(e){return o3(e)},t.prototype.rehydrate=function(){!this.server&&Yy&&dO(this)},t.prototype.reconstructWithOptions=function(e,n){return n===void 0&&(n=!0),new t(Br(Br({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(e=function(n){var r=n.useCSSOMInjection,i=n.target;return n.isServer?new aVe(i):r?new rVe(i):new iVe(i)}(this.options),new YBe(e)));var e},t.prototype.hasNameForId=function(e,n){return this.names.has(e)&&this.names.get(e).has(n)},t.prototype.registerName=function(e,n){if(o3(e),this.names.has(e))this.names.get(e).add(n);else{var r=new Set;r.add(n),this.names.set(e,r)}},t.prototype.insertRules=function(e,n,r){this.registerName(e,n),this.getTag().insertRules(o3(e),r)},t.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.prototype.clearRules=function(e){this.getTag().clearGroup(o3(e)),this.clearNames(e)},t.prototype.clearTag=function(){this.tag=void 0},t}(),oVe=/&/g,cVe=/^\s*\/\/.*$/gm;function PK(t,e){return t.map(function(n){return n.type==="rule"&&(n.value="".concat(e," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(e," ")),n.props=n.props.map(function(r){return"".concat(e," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=PK(n.children,e)),n})}function lVe(t){var e,n,r,i=I2,a=i.options,s=a===void 0?I2:a,o=i.plugins,c=o===void 0?Uv:o,l=function(f,h,p){return p.startsWith(n)&&p.endsWith(n)&&p.replaceAll(n,"").length>0?".".concat(e):f},u=c.slice();u.push(function(f){f.type===Ov&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(oVe,n).replace(r,l))}),s.prefix&&u.push(OBe),u.push($Be);var d=function(f,h,p,g){h===void 0&&(h=""),p===void 0&&(p=""),g===void 0&&(g="&"),e=g,n=h,r=new RegExp("\\".concat(n,"\\b"),"g");var y=f.replace(cVe,""),v=LBe(p||h?"".concat(p," ").concat(h," { ").concat(y," }"):y);s.namespace&&(v=PK(v,s.namespace));var b=[];return Gy(v,PBe(u.concat(RBe(function(w){return b.push(w)})))),b};return d.hash=c.length?c.reduce(function(f,h){return h.name||$0(15),Md(f,h.name)},AK).toString():"",d}var uVe=new Qy,Ob=lVe(),RK=tt.createContext({shouldForwardProp:void 0,styleSheet:uVe,stylis:Ob});RK.Consumer;tt.createContext(void 0);function Mb(){return L.useContext(RK)}var OK=function(){function t(e,n){var r=this;this.inject=function(i,a){a===void 0&&(a=Ob);var s=r.name+a.hash;i.hasNameForId(r.id,s)||i.insertRules(r.id,s,a(r.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=n,nA(this,function(){throw $0(12,String(r.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=Ob),this.name+e.hash},t}(),dVe=function(t){return t>="A"&&t<="Z"};function hO(t){for(var e="",n=0;n<t.length;n++){var r=t[n];if(n===1&&r==="-"&&t[0]==="-")return t;dVe(r)?e+="-"+r.toLowerCase():e+=r}return e.startsWith("ms-")?"-"+e:e}var MK=function(t){return t==null||t===!1||t===""},NK=function(t){var e,n,r=[];for(var i in t){var a=t[i];t.hasOwnProperty(i)&&!MK(a)&&(Array.isArray(a)&&a.isCss||T2(a)?r.push("".concat(hO(i),":"),a,";"):jp(a)?r.push.apply(r,E2(E2(["".concat(i," {")],NK(a),!1),["}"],!1)):r.push("".concat(hO(i),": ").concat((e=i,(n=a)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||e in MBe||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Qc(t,e,n,r){if(MK(t))return[];if(tA(t))return[".".concat(t.styledComponentId)];if(T2(t)){if(!T2(a=t)||a.prototype&&a.prototype.isReactComponent||!e)return[t];var i=t(e);return Qc(i,e,n,r)}var a;return t instanceof OK?n?(t.inject(n,r),[t.getName(r)]):[t]:jp(t)?NK(t):Array.isArray(t)?Array.prototype.concat.apply(Uv,t.map(function(s){return Qc(s,e,n,r)})):[t.toString()]}function DK(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(T2(n)&&!tA(n))return!1}return!0}var fVe=xK(Fv),hVe=function(){function t(e,n,r){this.rules=e,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&DK(e),this.componentId=n,this.baseHash=Md(fVe,n),this.baseStyle=r,Qy.registerId(n)}return t.prototype.generateAndInjectStyles=function(e,n,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))i=tu(i,this.staticRulesId);else{var a=Jy(Qc(this.rules,e,n,r)),s=Pb(Md(this.baseHash,a)>>>0);if(!n.hasNameForId(this.componentId,s)){var o=r(a,".".concat(s),void 0,this.componentId);n.insertRules(this.componentId,s,o)}i=tu(i,s),this.staticRulesId=s}else{for(var c=Md(this.baseHash,r.hash),l="",u=0;u<this.rules.length;u++){var d=this.rules[u];if(typeof d=="string")l+=d;else if(d){var f=Jy(Qc(d,e,n,r));c=Md(c,f+u),l+=f}}if(l){var h=Pb(c>>>0);n.hasNameForId(this.componentId,h)||n.insertRules(this.componentId,h,r(l,".".concat(h),void 0,this.componentId)),i=tu(i,h)}}return i},t}(),rA=tt.createContext(void 0);rA.Consumer;var W4={};function pVe(t,e,n){var r=tA(t),i=t,a=!H4(t),s=e.attrs,o=s===void 0?Uv:s,c=e.componentId,l=c===void 0?function(_,E){var C=typeof _!="string"?"sc":sO(_);W4[C]=(W4[C]||0)+1;var x="".concat(C,"-").concat(eA(Fv+C+W4[C]));return E?"".concat(E,"-").concat(x):x}(e.displayName,e.parentComponentId):c,u=e.displayName,d=u===void 0?function(_){return H4(_)?"styled.".concat(_):"Styled(".concat(BBe(_),")")}(t):u,f=e.displayName&&e.componentId?"".concat(sO(e.displayName),"-").concat(e.componentId):e.componentId||l,h=r&&i.attrs?i.attrs.concat(o).filter(Boolean):o,p=e.shouldForwardProp;if(r&&i.shouldForwardProp){var g=i.shouldForwardProp;if(e.shouldForwardProp){var y=e.shouldForwardProp;p=function(_,E){return g(_,E)&&y(_,E)}}else p=g}var v=new hVe(n,f,r?i.componentStyle:void 0);function b(_,E){return function(C,x,$){var T=C.attrs,U=C.componentStyle,O=C.defaultProps,F=C.foldedComponentIds,k=C.styledComponentId,S=C.target,I=tt.useContext(rA),A=Mb(),R=C.shouldForwardProp||A.shouldForwardProp,N=EK(x,I,O)||I2,P=function(Z,ie,oe){for(var z,J=Br(Br({},ie),{className:void 0,theme:oe}),K=0;K<Z.length;K+=1){var ne=T2(z=Z[K])?z(J):z;for(var ce in ne)J[ce]=ce==="className"?tu(J[ce],ne[ce]):ce==="style"?Br(Br({},J[ce]),ne[ce]):ne[ce]}return ie.className&&(J.className=tu(J.className,ie.className)),J}(T,x,N),j=P.as||S,M={};for(var V in P)P[V]===void 0||V[0]==="$"||V==="as"||V==="theme"&&P.theme===N||(V==="forwardedAs"?M.as=P.forwardedAs:R&&!R(V,j)||(M[V]=P[V]));var B=function(Z,ie){var oe=Mb(),z=Z.generateAndInjectStyles(ie,oe.styleSheet,oe.stylis);return z}(U,P),G=tu(F,k);return B&&(G+=" "+B),P.className&&(G+=" "+P.className),M[H4(j)&&!SK.has(j)?"class":"className"]=G,$&&(M.ref=$),L.createElement(j,M)}(w,_,E)}b.displayName=d;var w=tt.forwardRef(b);return w.attrs=h,w.componentStyle=v,w.displayName=d,w.shouldForwardProp=p,w.foldedComponentIds=r?tu(i.foldedComponentIds,i.styledComponentId):"",w.styledComponentId=f,w.target=r?i.target:t,Object.defineProperty(w,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(_){this._foldedDefaultProps=r?function(E){for(var C=[],x=1;x<arguments.length;x++)C[x-1]=arguments[x];for(var $=0,T=C;$<T.length;$++)Rb(E,T[$],!0);return E}({},i.defaultProps,_):_}}),nA(w,function(){return".".concat(w.styledComponentId)}),a&&kK(w,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),w}function pO(t,e){for(var n=[t[0]],r=0,i=e.length;r<i;r+=1)n.push(e[r],t[r+1]);return n}var gO=function(t){return Object.assign(t,{isCss:!0})};function P0(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(T2(t)||jp(t))return gO(Qc(pO(Uv,E2([t],e,!0))));var r=t;return e.length===0&&r.length===1&&typeof r[0]=="string"?Qc(r):gO(Qc(pO(r,e)))}function Nb(t,e,n){if(n===void 0&&(n=I2),!e)throw $0(1,e);var r=function(i){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];return t(e,n,P0.apply(void 0,E2([i],a,!1)))};return r.attrs=function(i){return Nb(t,e,Br(Br({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return Nb(t,e,Br(Br({},n),i))},r}var FK=function(t){return Nb(pVe,t)},rn=FK;SK.forEach(function(t){rn[t]=FK(t)});var gVe=function(){function t(e,n){this.rules=e,this.componentId=n,this.isStatic=DK(e),Qy.registerId(this.componentId+1)}return t.prototype.createStyles=function(e,n,r,i){var a=i(Jy(Qc(this.rules,n,r,i)),""),s=this.componentId+e;r.insertRules(s,s,a)}
125,t.prototype.removeStyles=function(e,n){n.clearRules(this.componentId+e)},t.prototype.renderStyles=function(e,n,r,i){e>2&&Qy.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,n,r,i)},t}();function yVe(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=P0.apply(void 0,E2([t],e,!1)),i="sc-global-".concat(eA(JSON.stringify(r))),a=new gVe(r,i),s=function(c){var l=Mb(),u=tt.useContext(rA),d=tt.useRef(l.styleSheet.allocateGSInstance(i)).current;return l.styleSheet.server&&o(d,c,l.styleSheet,u,l.stylis),tt.useLayoutEffect(function(){if(!l.styleSheet.server)return o(d,c,l.styleSheet,u,l.stylis),function(){return a.removeStyles(d,l.styleSheet)}},[d,c,l.styleSheet,u,l.stylis]),null};function o(c,l,u,d,f){if(a.isStatic)a.renderStyles(c,DBe,u,f);else{var h=Br(Br({},l),{theme:EK(l,d,s.defaultProps)});a.renderStyles(c,h,u,f)}}return tt.memo(s)}function Aot(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Jy(P0.apply(void 0,E2([t],e,!1))),i=eA(r);return new OK(i,r)}const mVe=t=>{let[e,n]=L.useState("auto");return L.useEffect(()=>{let r=new ResizeObserver(i=>{n(i[0]?.contentRect.height??"auto")});return t.current&&r.observe(t.current),()=>{t.current&&r.unobserve(t.current)}},[t.current]),e},xot=rn.div` 126 text-align: left; 127 flex-grow: 1; 128`,Iot=rn.div` 129 display: flex; 130 flex-direction: column; 131 justify-content: flex-end; 132 flex-grow: 1; 133`,vVe=rn.div` 134 display: flex; 135 flex-direction: column; 136 gap: 8px; 137 138 /* for Internet Explorer, Edge */ 139 -ms-overflow-style: none; 140 141 /* for Firefox */ 142 scrollbar-width: none; 143 144 /* for Chrome, Safari, and Opera */ 145 &::-webkit-scrollbar {
146 display: none; 147 } 148`,Tot=rn(vVe)` 149 ${t=>t.$colorScheme==="light"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":t.$colorScheme==="dark"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0} 150 151 background-repeat: no-repeat; 152 background-size: 153 100% 32px, 154 100% 16px; 155 background-attachment: local, scroll; 156 max-height: 400px; 157 overflow-y: auto; 158 scrollbar-width: none; 159 padding: 3px; 160`;let UK=P0` 161 && { 162 width: 100%; 163 font-size: 16px; 164 line-height: 24px; 165 min-height: 56px; 166 167 /* Tablet and Up */ 168 @media (min-width: 440px) { 169 font-size: 14px; 170 } 171 172 display: flex; 173 gap: 12px; 174 align-items: center; 175 color: var(--privy-color-foreground); 176 177 padding: 10px 12px; 178 border: 1px solid var(--privy-color-foreground-4) !important; 179 border-radius: var(--privy-border-radius-md); 180 transition: background-color 200ms ease; 181 182 cursor: pointer; 183 184 &:hover { 185 background-color: var(--privy-color-background-2); 186 } 187 188 &:disabled { 189 cursor: pointer; 190 background-color: var(--privy-color-background-2); 191 } 192 } 193`;const Lot=rn.div` 194 text-align: center; 195 font-size: 14px; 196 margin-bottom: 24px; 197`,kot=rn.button.attrs({className:"login-method-button"})` 198 ${UK} 199`;rn.a` 200 ${UK} 201`;const $ot=rn.div` 202 width: 32px; 203 height: 32px; 204 border-radius: ${t=>t.$fullSize?"0":"4px"}; 205 background: ${t=>t.$fullSize?"transparent":"var(--privy-color-background-2)"}; 206 display: flex; 207 align-items: center; 208 justify-content: center; 209 flex-shrink: 0; 210 211 svg { 212 width: ${t=>t.$fullSize?"32px":"18px"}; 213 height: ${t=>t.$fullSize?"32px":"18px"}; 214 color: ${t=>t.$fullSize?"inherit":"var(--privy-color-icon-muted)"}; 215 } 216`,jK=rn.div` 217 width: 100%; 218 height: 100%; 219 min-height: inherit; 220 display: flex; 221 flex-direction: column; 222 ${t=>t.$if?"display: none;":""} 223`,Pot=rn.div` 224 width: 100%; 225 height: 100%; 226 padding: ${t=>t.$withPadding?"64px 0px":"0px"}; 227`,Rot=rn.div` 228 display: flex; 229 flex-direction: column; 230 align-items: center; 231 justify-content: center; 232 margin-bottom: 32px; 233 gap: 12px; 234 & h3 { 235 font-size: 18px; 236 font-style: normal; 237 font-weight: 600; 238 line-height: 24px; 239 } 240 & p { 241 max-width: 300px; 242 font-size: 14px; 243 font-style: normal; 244 font-weight: 400; 245 line-height: 20px; 246 } 247`,Oot=({success:t,fail:e})=>m.jsxs(wVe,{children:[m.jsx(yO,{children:m.jsx(bVe,{className:t?"success":e?"fail":""})}),m.jsx(yO,{children:m.jsx(jv,{className:t?"success":e?"fail":""})})]});let yO=rn.span` 248 && { 249 position: absolute; 250 top: 0; 251 left: 0; 252 z-index: 2; 253 } 254`,wVe=rn.span` 255 position: relative; 256 width: 82px; 257 height: 82px; 258 display: inline-block; 259`;const jv=rn.span` 260 && { 261 width: 82px; 262 height: 82px; 263 border-width: 4px; 264 border-style: solid; 265 border-color: ${t=>t.color??"var(--privy-color-icon-subtle)"}; 266 border-bottom-color: transparent; 267 border-radius: 50%; 268 display: inline-block; 269 box-sizing: border-box; 270 animation: rotation 1.2s linear infinite; 271 transition: border-color 800ms; 272 } 273 274 @keyframes rotation { 275 0% { 276 transform: rotate(0deg); 277 } 278 100% { 279 transform: rotate(360deg); 280 } 281 } 282 283 &&&.success { 284 border-color: var(--privy-color-icon-success); 285 border-bottom-color: var(--privy-color-icon-success); 286 } 287 288 &&&.fail { 289 border-color: var(--privy-color-icon-error); 290 border-bottom-color: var(--privy-color-icon-error); 291 } 292`,bVe=rn(jv)` 293 && { 294 border-bottom-color: ${t=>t.color??"var(--privy-color-border-default)"}; 295 border-color: ${t=>t.color??"var(--privy-color-border-default)"}; 296 animation: none; 297 opacity: 0.5; 298 } 299`,Mot=t=>m.jsx(_Ve,{color:t.color||"var(--privy-color-foreground-3)"});let _Ve=rn(jv)` 300 && { 301 height: 1rem; 302 width: 1rem; 303 margin: 2px 0; 304 border-width: 1.5px; 305 306 /* Override default Loader to match button transitions */ 307 transition: border-color 200ms ease; 308 } 309`;async function CVe(t,e,n){if(!e.shouldEnforceDefaultChainOnConnect)return;let r=Number(t.chainId.replace("eip155:",""));if(!e.chains.find(i=>i.id===r)&&(t.connectorType!=="wallet_connect_v2"||t.walletClientType!=="metamask")){n?.();try{await t.switchChain(e.defaultChain.id),t.chainId=Ph(An(e.defaultChain.id))}catch{Ce.warn("Unable to switch to default chain after connect",{chainId:e.defaultChain.id})}}}let BK=L.createContext({});const EVe=({children:t})=>{let e=zr(),[n,r]=L.useState({});return La("login",{onComplete:({loginAccount:i})=>{i&&i.type!=="passkey"&&i.type!=="cross_app"&&(i.type!=="wallet"||i.walletClientType!=="privy")&&(nt.put(mO(e.id),i.type),i.type==="wallet"?(nt.put(q4(e.id),i.walletClientType),nt.put(z4(e.id),i.chainType),r({accountType:i.type,walletClientType:i.walletClientType,chainType:i.chainType})):(nt.del(q4(e.id)),nt.del(z4(e.id)),r({accountType:i.type})))}}),L.useEffect(()=>{if(!e.id)return;let i=nt.get(mO(e.id)),a=nt.get(q4(e.id)),s=nt.get(z4(e.id));i&&r(i==="wallet"?{accountType:i,walletClientType:a,chainType:s}:{accountType:i})},[e.id]),m.jsx(BK.Provider,{value:n,children:t})};let mO=t=>`privy:${t}:recent-login-method`,q4=t=>`privy:${t}:recent-login-wallet-client`,z4=t=>`privy:${t}:recent-login-chain-type`;const Not=()=>L.useContext(BK),SVe=t=>{La("fundWallet",t);let{fundWallet:e}=Vt();return{fundWallet:({address:n,options:r})=>e(n,r)}};function AVe(t){let{login:e}=L.useContext(Ia);return La("login",t),{login:e}}function Dot(t){let{logout:e}=L.useContext(Ia);return La("logout",t),{logout:e}}function xVe(t){let{connectWallet:e}=L.useContext(Ia);return La("connectWallet",t),{connectWallet:e}}const IVe=Pi(()=>({isModalOpen:!1,resolvers:null}));Pi(()=>({}));const Fot=({address:t,client:e,appId:n})=>{let r=`${e}:${t}`;n&&nt.put(TVe(n),r),IVe.setState({wallet:r})},TVe=t=>`privy:${t}:active-wallet-connection`;var LVe=Object.defineProperty,kVe=(t,e,n)=>e in t?LVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Z4=(t,e,n)=>(kVe(t,typeof e!="symbol"?e+"":e,n),n);let $Ve=class{constructor(){Z4(this,"current",this.detect()),Z4(this,"handoffState","pending"),Z4(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>
vendor: 8,777 bytes, lines 309-312
309"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hu=new $Ve;function R0(t){var e,n;return hu.isServer?null:t?"ownerDocument"in t?t.ownerDocument:"current"in t?(n=(e=t.current)==null?void 0:e.ownerDocument)!=null?n:document:null:document}function Bv(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Xo(){let t=[],e={addEventListener(n,r,i,a){return n.addEventListener(r,i,a),e.add(()=>n.removeEventListener(r,i,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return e.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return e.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Bv(()=>{r.current&&n[0]()}),e.add(()=>{r.current=!1})},style(n,r,i){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=Xo();return n(r),this.add(()=>r.dispose())},add(n){return t.includes(n)||t.push(n),()=>{let r=t.indexOf(n);if(r>=0)for(let i of t.splice(r,1))i()}},dispose(){for(let n of t.splice(0))n()}};return e}function iA(){let[t]=L.useState(Xo);return L.useEffect(()=>()=>t.dispose(),[t]),t}let ai=(t,e)=>{hu.isServer?L.useEffect(t,e):L.useLayoutEffect(t,e)};function Hu(t){let e=L.useRef(t);return ai(()=>{e.current=t},[t]),e}let wn=function(t){let e=Hu(t);return tt.useCallback((...n)=>e.current(...n),[e])},PVe=L.createContext(void 0);function RVe(){return L.useContext(PVe)}function Db(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function al(t,e,...n){if(t in e){let i=e[t];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,al),r}var em=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(em||{}),Kc=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(Kc||{});function ka(){let t=MVe();return L.useCallback(e=>OVe({mergeRefs:t,...e}),[t])}function OVe({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:a=!0,name:s,mergeRefs:o}){o=o??NVe;let c=VK(e,t);if(a)return c3(c,n,r,s,o);let l=i??0;if(l&2){let{static:u=!1,...d}=c;if(u)return c3(d,n,r,s,o)}if(l&1){let{unmount:u=!0,...d}=c;return al(u?0:1,{0(){return null},1(){return c3({...d,hidden:!0,style:{display:"none"}},n,r,s,o)}})}return c3(c,n,r,s,o)}function c3(t,e={},n,r,i){let{as:a=n,children:s,refName:o="ref",...c}=K4(t,["unmount","static"]),l=t.ref!==void 0?{[o]:t.ref}:{},u=typeof s=="function"?s(e):s;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(e)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let d={};if(e){let f=!1,h=[];for(let[p,g]of Object.entries(e))typeof g=="boolean"&&(f=!0),g===!0&&h.push(p.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(f){d["data-headlessui-state"]=h.join(" ");for(let p of h)d[`data-${p}`]=""}}if(a===L.Fragment&&(Object.keys(Nl(c)).length>0||Object.keys(Nl(d)).length>0))if(!L.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(Nl(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Nl(c)).concat(Object.keys(Nl(d))).map(f=>` - ${f}`).join(` 310`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(f=>` - ${f}`).join(` 311`)].join(` 312`))}else{let f=u.props,h=f?.className,p=typeof h=="function"?(...v)=>Db(h(...v),c.className):Db(h,c.className),g=p?{className:p}:{},y=VK(u.props,Nl(K4(c,["ref"])));for(let v in d)v in y&&delete d[v];return L.cloneElement(u,Object.assign({},y,d,l,{ref:i(DVe(u),l.ref)},g))}return L.createElement(a,Object.assign({},K4(c,["ref"]),a!==L.Fragment&&l,a!==L.Fragment&&d),u)}function MVe(){let t=L.useRef([]),e=L.useCallback(n=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return t.current=n,e}}function NVe(...t){return t.every(e=>e==null)?void 0:e=>{for(let n of t)n!=null&&(typeof n=="function"?n(e):n.current=e)}}function VK(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):e[i]=r[i];if(e.disabled||e["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[i=>{var a;return(a=i?.preventDefault)==null?void 0:a.call(i)}]);for(let r in n)Object.assign(e,{[r](i,...a){let s=n[r];for(let o of s){if((i instanceof Event||i?.nativeEvent instanceof Event)&&i.defaultPrevented)return;o(i,...a)}}});return e}function jot(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):e[i]=r[i];for(let r in n)Object.assign(e,{[r](...i){let a=n[r];for(let s of a)s?.(...i)}});return e}function Oi(t){var e;return Object.assign(L.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function Nl(t){let e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function K4(t,e=[]){let n=Object.assign({},t);for(let r of e)r in n&&delete n[r];return n}function DVe(t){return tt.version.split(".")[0]>="19"?t.props.ref:t.ref}let FVe="span";var tm=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(tm||{});function UVe(t,e){var n;let{features:r=1,...i}=t,a={ref:e,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return ka()({ourProps:a,theirProps:i,slot:{},defaultTag:FVe,name:"Hidden"})}let Fb=Oi(UVe),HK=Symbol();function jVe(t,e=!0){return Object.assign(t,{[HK]:e})}function Js(...t){let e=L.useRef(t);L.useEffect(()=>{e.current=t},[t]);let n=wn(r=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return t.every(r=>r==null||r?.[HK])?void 0:n}let aA=L.createContext(null);aA.displayName="DescriptionContext";function WK(){let t=L.useContext(aA);if(t===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,WK),e}return t}function BVe(){let[t,e]=L.useState([]);return[t.length>0?t.join(" "):void 0,L.useMemo(()=>function(n){let r=wn(a=>(e(s=>[...s,a]),()=>e(s=>{let o=s.slice(),c=o.indexOf(a);return c!==-1&&o.splice(c,1),o}))),i=L.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return tt.createElement(aA.Provider,{value:i},n.children)},[e])]}let VVe="p";function HVe(t,e){let n=L.useId(),r=RVe(),{id:i=`headlessui-description-${n}`,...a}=t,s=WK(),o=Js(e);ai(()=>s.register(i),[i,s.register]);let c=r||!1,l=L.useMemo(()=>({...s.slot,disabled:c}),[s.slot,c]),u={ref:o,...s.props,id:i};return ka()({ourProps:u,theirProps:a,slot:l,defaultTag:VVe,name:s.name||"Description"})}let WVe=Oi(HVe),qVe=Object.assign(WVe,{});var qK=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(qK||{});let zVe=L.createContext(()=>{});function ZVe({value:t,children:e}){return tt.createElement(zVe.Provider,{value:t},e)}let KVe=class extends Map{constructor(e){super(),this.factory=e}get(e){let n=super.get(e);return n===void 0&&(n=this.factory(e),this.set(e,n)),n}};function zK(t,e){let n=t(),r=new Set;return{getSnapshot(){return n},subscribe(i){return r.add(i),()=>r.delete(i)},dispatch(i,...a){let s=e[i].call(n,...a);s&&(n=s,r.forEach(o=>o()))}}}function ZK(t){return L.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)}let GVe=new KVe(()=>zK(()=>[],{ADD(t){return this.includes(t)?this:[...this,t]},REMOVE(t){let e=this.indexOf(t);if(e===-1)return this;let n=this.slice();return n.splice(e,1),n}}));function nf(t,e){let n=GVe.get(e),r=L.useId(),i=ZK(n);if(ai(()=>
312{if(t)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,t]),!t)return!1;let a=i.indexOf(r),s=i.length;return a===-1&&(a=s,s+=1),a===s-1}let Ub=new Map,zh=new Map;function vO(t){var e;let n=(e=zh.get(t))!=null?e:0;return zh.set(t,n+1),n!==0?()=>wO(t):(Ub.set(t,{"aria-hidden":t.getAttribute("aria-hidden"),inert:t.inert}),t.setAttribute("aria-hidden","true"),t.inert=!0,()=>wO(t))}function wO(t){var e;let n=(e=zh.get(t))!=null?e:1;if(n===1?zh.delete(t):zh.set(t,n-1),n!==1)return;let r=Ub.get(t);r&&(r["aria-hidden"]===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r["aria-hidden"]),t.inert=r.inert,Ub.delete(t))}function YVe(t,{allowed:e,disallowed:n}={}){let r=nf(t,"inert-others");ai(()=>{var i,a;if(!r)return;let s=Xo();for(let c of(i=n?.())!=null?i:[])c&&s.add(vO(c));let o=(a=e?.())!=null?a:[];for(let c of o){if(!c)continue;let l=R0(c);if(!l)continue;let u=c.parentElement;for(;u&&u!==l.body;){for(let d of u.children)o.some(f=>d.contains(f))||s.add(vO(d));u=u.parentElement}}return s.dispose},[r,e,n])}function JVe(t,e,n){let r=Hu(i=>{let a=i.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&n()});L.useEffect(()=>{if(!t)return;let i=e===null?null:e instanceof HTMLElement?e:e.current;if(!i)return;let a=Xo();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(i));s.observe(i),a.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(i));s.observe(i),a.add(()=>s.disconnect())}return()=>a.dispose()},[e,r,t])}let nm=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(","),XVe=["[data-autofocus]"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var Ao=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t[t.AutoFocus=64]="AutoFocus",t))(Ao||{}),jb=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(jb||{}),QVe=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(QVe||{});function KK(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(nm)).sort((e,n)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function eHe(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(XVe)).sort((e,n)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var GK=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(GK||{});function YK(t,e=0){var n;return t===((n=R0(t))==null?void 0:n.body)?!1:al(e,{0(){return t.matches(nm)},1(){let r=t;for(;r!==null;){if(r.matches(nm))return!0;r=r.parentElement}return!1}})}function Vot(t){let e=R0(t);Xo().nextFrame(()=>{e&&!YK(e.activeElement,0)&&Fs(t)})}var tHe=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(tHe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Fs(t){t?.focus({preventScroll:!0})}let nHe=["textarea","input"].join(",");function rHe(t){var e,n;return(n=(e=t?.matches)==null?void 0:e.call(t,nHe))!=null?n:!1}function iHe(t,e=n=>n){return t.slice().sort((n,r)=>{let i=e(n),a=e(r);if(i===null||a===null)return 0;let s=i.compareDocumentPosition(a);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Hot(t,e){return Xd(KK(),e,{relativeTo:t})}function Xd(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?iHe(t):t:e&64?eHe(t):KK(t);i.length>0&&s.length>1&&(s=s.filter(h=>!i.some(p=>p!=null&&"current"in p?p?.current===h:p===h))),r=r??a.activeElement;let o=(()=>
vendor: 4,783 bytes, line 312
312{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,s.indexOf(r))-1;if(e&4)return Math.max(0,s.indexOf(r))+1;if(e&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=e&32?{preventScroll:!0}:{},u=0,d=s.length,f;do{if(u>=d||u+d<=0)return 0;let h=c+u;if(e&16)h=(h+d)%d;else{if(h<0)return 3;if(h>=d)return 1}f=s[h],f?.focus(l),u+=o}while(f!==a.activeElement);return e&6&&rHe(f)&&f.select(),2}function JK(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function aHe(){return/Android/gi.test(window.navigator.userAgent)}function sHe(){return JK()||aHe()}function Qf(t,e,n,r){let i=Hu(n);L.useEffect(()=>{if(!t)return;function a(s){i.current(s)}return document.addEventListener(e,a,r),()=>document.removeEventListener(e,a,r)},[t,e,r])}function XK(t,e,n,r){let i=Hu(n);L.useEffect(()=>{if(!t)return;function a(s){i.current(s)}return window.addEventListener(e,a,r),()=>window.removeEventListener(e,a,r)},[t,e,r])}const bO=30;function oHe(t,e,n){let r=nf(t,"outside-click"),i=Hu(n),a=L.useCallback(function(c,l){if(c.defaultPrevented)return;let u=l(c);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function f(h){return typeof h=="function"?f(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let f of d)if(f!==null&&(f.contains(u)||c.composed&&c.composedPath().includes(f)))return;return!YK(u,GK.Loose)&&u.tabIndex!==-1&&c.preventDefault(),i.current(c,u)},[i,e]),s=L.useRef(null);Qf(r,"pointerdown",c=>{var l,u;s.current=((u=(l=c.composedPath)==null?void 0:l.call(c))==null?void 0:u[0])||c.target},!0),Qf(r,"mousedown",c=>{var l,u;s.current=((u=(l=c.composedPath)==null?void 0:l.call(c))==null?void 0:u[0])||c.target},!0),Qf(r,"click",c=>{sHe()||s.current&&(a(c,()=>s.current),s.current=null)},!0);let o=L.useRef({x:0,y:0});Qf(r,"touchstart",c=>{o.current.x=c.touches[0].clientX,o.current.y=c.touches[0].clientY},!0),Qf(r,"touchend",c=>{let l={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(l.x-o.current.x)>=bO||Math.abs(l.y-o.current.y)>=bO))return a(c,()=>c.target instanceof HTMLElement?c.target:null)},!0),XK(r,"blur",c=>a(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Vv(...t){return L.useMemo(()=>R0(...t),[...t])}function QK(t,e,n,r){let i=Hu(n);L.useEffect(()=>{t=t??window;function a(s){i.current(s)}return t.addEventListener(e,a,r),()=>t.removeEventListener(e,a,r)},[t,e,r])}function cHe(){let t;return{before({doc:e}){var n;let r=e.documentElement,i=(n=e.defaultView)!=null?n:window;t=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:e,d:n}){let r=e.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,t-i);n.style(r,"paddingRight",`${a}px`)}}}function lHe(){return JK()?{before({doc:t,d:e,meta:n}){function r(i){return n.containers.flatMap(a=>a()).some(a=>a.contains(i))}e.microTask(()=>{var i;if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let o=Xo();o.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>o.dispose()))}let a=(i=window.scrollY)!=null?i:window.pageYOffset,s=null;e.addEventListener(t,"click",o=>{if(o.target instanceof HTMLElement)try{let c=o.target.closest("a");if(!c)return;let{hash:l}=new URL(c.href),u=t.querySelector(l);u&&!r(u)&&(s=u)}catch{}},!0),e.addEventListener(t,"touchstart",o=>{if(o.target instanceof HTMLElement)if(r(o.target)){let c=o.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;e.style(c,"overscrollBehavior","contain")}else e.style(o.target,"touchAction","none")}),e.addEventListener(t,"touchmove",o=>{if(o.target instanceof HTMLElement){if(o.target.tagName==="INPUT")return;if(r(o.target)){let c=o.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&o.preventDefault()}else o.preventDefault()}},{passive:!1}),e.add(()=>{var o;let c=(o=window.scrollY)!=null?o:window.pageYOffset;a!==c&&window.scrollTo(0,a),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function uHe(){return{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}}function dHe(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let nu=zK(()=>new Map,{PUSH(t,e){var n;let r=(n=this.get(t))!=null?n:{doc:t,count:0,d:Xo(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:dHe(n)},i=[lHe(),cHe(),uHe()];
vendor: 3,212 bytes, lines 312-313
312i.forEach(({before:a})=>a?.(r)),i.forEach(({after:a})=>a?.(r))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});nu.subscribe(()=>{let t=nu.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let r=e.get(n.doc)==="hidden",i=n.count!==0;(i&&!r||!i&&r)&&nu.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&nu.dispatch("TEARDOWN",n)}});function fHe(t,e,n=()=>({containers:[]})){let r=ZK(nu),i=e?r.get(e):void 0,a=i?i.count>0:!1;return ai(()=>{if(!(!e||!t))return nu.dispatch("PUSH",e,n),()=>nu.dispatch("POP",e,n)},[t,e]),a}function hHe(t,e,n=()=>[document.body]){let r=nf(t,"scroll-lock");fHe(r,e,i=>{var a;return{containers:[...(a=i.containers)!=null?a:[],n]}})}function pHe(t=0){let[e,n]=L.useState(t),r=L.useCallback(c=>n(c),[e]),i=L.useCallback(c=>n(l=>l|c),[e]),a=L.useCallback(c=>(e&c)===c,[e]),s=L.useCallback(c=>n(l=>l&~c),[n]),o=L.useCallback(c=>n(l=>l^c),[n]);return{flags:e,setFlag:r,addFlag:i,hasFlag:a,removeFlag:s,toggleFlag:o}}var gHe={},_O,CO;typeof ur<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((_O=ur==null?void 0:gHe)==null?void 0:_O.NODE_ENV)==="test"&&typeof((CO=Element?.prototype)==null?void 0:CO.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(` 313`)),[]});var yHe=(t=>(t[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t))(yHe||{});function mHe(t){let e={};for(let n in t)t[n]===!0&&(e[`data-${n}`]="");return e}function vHe(t,e,n,r){let[i,a]=L.useState(n),{hasFlag:s,addFlag:o,removeFlag:c}=pHe(t&&i?3:0),l=L.useRef(!1),u=L.useRef(!1),d=iA();return ai(()=>{var f;if(t){if(n&&a(!0),!e){n&&o(3);return}return(f=r?.start)==null||f.call(r,n),wHe(e,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(o(3),c(4)):(o(4),c(2)))},run(){u.current?n?(c(3),o(4)):(c(4),o(3)):n?c(1):o(1)},done(){var h;u.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(l.current=!1,c(7),n||a(!1),(h=r?.end)==null||h.call(r,n))}})}},[t,n,e,d]),t?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function wHe(t,{prepare:e,run:n,done:r,inFlight:i}){let a=Xo();return _He(t,{prepare:e,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(bHe(t,r))})}),a.dispose}function bHe(t,e){var n,r;let i=Xo();if(!t)return i.dispose;let a=!1;i.add(()=>{a=!0});let s=(r=(n=t.getAnimations)==null?void 0:n.call(t).filter(o=>o instanceof CSSTransition))!=null?r:[];return s.length===0?(e(),i.dispose):(Promise.allSettled(s.map(o=>o.finished)).then(()=>{a||e()}),i.dispose)}function _He(t,{inFlight:e,prepare:n}){if(e!=null&&e.current){n();return}let r=t.style.transition;t.style.transition="none",n(),t.offsetHeight,t.style.transition=r}function sA(t,e){let n=L.useRef([]),r=wn(t);L.useEffect(()=>{let i=[...n.current];
313for(let[a,s]of e.entries())if(n.current[a]!==s){let o=r(e,i);return n.current=e,o}},[r,...e])}let Hv=L.createContext(null);Hv.displayName="OpenClosedContext";var Ga=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(Ga||{});function Wv(){return L.useContext(Hv)}function CHe({value:t,children:e}){return tt.createElement(Hv.Provider,{value:t},e)}function EHe({children:t}){return tt.createElement(Hv.Provider,{value:null},t)}function SHe(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let Fc=[];SHe(()=>{function t(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||Fc[0]===e.target)return;let n=e.target;n=n.closest(nm),Fc.unshift(n??e.target),Fc=Fc.filter(r=>r!=null&&r.isConnected),Fc.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});function eG(t){let e=wn(t),n=L.useRef(!1);L.useEffect(()=>(n.current=!1,()=>{n.current=!0,Bv(()=>{n.current&&e()})}),[e])}function AHe(){let t=typeof document>"u";return"useSyncExternalStore"in QA?(e=>e.useSyncExternalStore)(QA)(()=>()=>{},()=>!1,()=>!t):!1}function O0(){let t=AHe(),[e,n]=L.useState(hu.isHandoffComplete);return e&&hu.isHandoffComplete===!1&&n(!1),L.useEffect(()=>{e!==!0&&n(!0)},[e]),L.useEffect(()=>hu.handoff(),[]),t?!1:e}let tG=L.createContext(!1);function xHe(){return L.useContext(tG)}function EO(t){return tt.createElement(tG.Provider,{value:t.force},t.children)}function IHe(t){let e=xHe(),n=L.useContext(rG),[r,i]=L.useState(()=>{var a;if(!e&&n!==null)return(a=n.current)!=null?a:null;if(hu.isServer)return null;let s=t?.getElementById("headlessui-portal-root");if(s)return s;if(t===null)return null;let o=t.createElement("div");return o.setAttribute("id","headlessui-portal-root"),t.body.appendChild(o)});return L.useEffect(()=>{r!==null&&(t!=null&&t.body.contains(r)||t==null||t.body.appendChild(r))},[r,t]),L.useEffect(()=>{e||n!==null&&i(n.current)},[n,i,e]),r}let nG=L.Fragment,THe=Oi(function(t,e){let{ownerDocument:n=null,...r}=t,i=L.useRef(null),a=Js(jVe(h=>{i.current=h}),e),s=Vv(i),o=n??s,c=IHe(o),[l]=L.useState(()=>{var h;return hu.isServer?null:(h=o?.createElement("div"))!=null?h:null}),u=L.useContext(Bb),d=O0();ai(()=>{!c||!l||c.contains(l)||(l.setAttribute("data-headlessui-portal",""),c.appendChild(l))},[c,l]),ai(()=>{if(l&&u)return u.register(l)},[u,l]),eG(()=>{var h;!c||!l||(l instanceof Node&&c.contains(l)&&c.removeChild(l),c.childNodes.length<=0&&((h=c.parentElement)==null||h.removeChild(c)))});let f=ka();return d?!c||!l?null:vQ.createPortal(f({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:nG,name:"Portal"}),l):null});function LHe(t,e){let n=Js(e),{enabled:r=!0,ownerDocument:i,...a}=t,s=ka();return r?tt.createElement(THe,{...a,ownerDocument:i,ref:n}):s({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:nG,name:"Portal"})}let kHe=L.Fragment,rG=L.createContext(null);function $He(t,e){let{target:n,...r}=t,i={ref:Js(e)},a=ka();return tt.createElement(rG.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:kHe,name:"Popover.Group"}))}let Bb=L.createContext(null);function PHe(){let t=L.useContext(Bb),e=L.useRef([]),n=wn(a=>(e.current.push(a),t&&t.register(a),()=>r(a))),r=wn(a=>{let s=e.current.indexOf(a);s!==-1&&e.current.splice(s,1),t&&t.unregister(a)}),i=L.useMemo(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,L.useMemo(()=>function({children:a}){return tt.createElement(Bb.Provider,{value:i},a)},[i])]}let RHe=Oi(LHe),iG=Oi($He),OHe=Object.assign(RHe,{Group:iG});function MHe(t,e=typeof document<"u"?document.defaultView:null,n){let r=nf(t,"escape");QK(e,"keydown",i=>{r&&(i.defaultPrevented||i.key===qK.Escape&&n(i))})}function NHe(){var t;let[e]=L.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=L.useState((t=e?.matches)!=null?t:!1);return ai(()=>
vendor: 4,383 bytes, line 313
313{if(!e)return;function i(a){r(a.matches)}return e.addEventListener("change",i),()=>e.removeEventListener("change",i)},[e]),n}function DHe({defaultContainers:t=[],portals:e,mainTreeNode:n}={}){let r=Vv(n),i=wn(()=>{var a,s;let o=[];for(let c of t)c!==null&&(c instanceof HTMLElement?o.push(c):"current"in c&&c.current instanceof HTMLElement&&o.push(c.current));if(e!=null&&e.current)for(let c of e.current)o.push(c);for(let c of(a=r?.querySelectorAll("html > *, body > *"))!=null?a:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(n&&(c.contains(n)||c.contains((s=n?.getRootNode())==null?void 0:s.host))||o.some(l=>c.contains(l))||o.push(c));return o});return{resolveContainers:i,contains:wn(a=>i().some(s=>s.contains(a)))}}let aG=L.createContext(null);function SO({children:t,node:e}){let[n,r]=L.useState(null),i=sG(e??n);return tt.createElement(aG.Provider,{value:i},t,i===null&&tt.createElement(Fb,{features:tm.Hidden,ref:a=>{var s,o;if(a){for(let c of(o=(s=R0(a))==null?void 0:s.querySelectorAll("html > *, body > *"))!=null?o:[])if(c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c!=null&&c.contains(a)){r(c);break}}}}))}function sG(t=null){var e;return(e=L.useContext(aG))!=null?e:t}function oA(){let t=L.useRef(!1);return ai(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var yh=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(yh||{});function FHe(){let t=L.useRef(0);return XK(!0,"keydown",e=>{e.key==="Tab"&&(t.current=e.shiftKey?1:0)},!0),t}function oG(t){if(!t)return new Set;if(typeof t=="function")return new Set(t());let e=new Set;for(let n of t.current)n.current instanceof HTMLElement&&e.add(n.current);return e}let UHe="div";var Wl=(t=>(t[t.None=0]="None",t[t.InitialFocus=1]="InitialFocus",t[t.TabLock=2]="TabLock",t[t.FocusLock=4]="FocusLock",t[t.RestoreFocus=8]="RestoreFocus",t[t.AutoFocus=16]="AutoFocus",t))(Wl||{});function jHe(t,e){let n=L.useRef(null),r=Js(n,e),{initialFocus:i,initialFocusFallback:a,containers:s,features:o=15,...c}=t;O0()||(o=0);let l=Vv(n);WHe(o,{ownerDocument:l});let u=qHe(o,{ownerDocument:l,container:n,initialFocus:i,initialFocusFallback:a});zHe(o,{ownerDocument:l,container:n,containers:s,previousActiveElement:u});let d=FHe(),f=wn(b=>{let w=n.current;w&&(_=>_())(()=>{al(d.current,{[yh.Forwards]:()=>{Xd(w,Ao.First,{skipElements:[b.relatedTarget,a]})},[yh.Backwards]:()=>{Xd(w,Ao.Last,{skipElements:[b.relatedTarget,a]})}})})}),h=nf(!!(o&2),"focus-trap#tab-lock"),p=iA(),g=L.useRef(!1),y={ref:r,onKeyDown(b){b.key=="Tab"&&(g.current=!0,p.requestAnimationFrame(()=>{g.current=!1}))},onBlur(b){if(!(o&4))return;let w=oG(s);n.current instanceof HTMLElement&&w.add(n.current);let _=b.relatedTarget;_ instanceof HTMLElement&&_.dataset.headlessuiFocusGuard!=="true"&&(cG(w,_)||(g.current?Xd(n.current,al(d.current,{[yh.Forwards]:()=>Ao.Next,[yh.Backwards]:()=>Ao.Previous})|Ao.WrapAround,{relativeTo:b.target}):b.target instanceof HTMLElement&&Fs(b.target)))}},v=ka();return tt.createElement(tt.Fragment,null,h&&tt.createElement(Fb,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:tm.Focusable}),v({ourProps:y,theirProps:c,defaultTag:UHe,name:"FocusTrap"}),h&&tt.createElement(Fb,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:tm.Focusable}))}let BHe=Oi(jHe),VHe=Object.assign(BHe,{features:Wl});function HHe(t=!0){let e=L.useRef(Fc.slice());return sA(([n],[r])=>{r===!0&&n===!1&&Bv(()=>{e.current.splice(0)}),r===!1&&n===!0&&(e.current=Fc.slice())},[t,Fc,e]),wn(()=>{var n;return(n=e.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function WHe(t,{ownerDocument:e}){let n=!!(t&8),r=HHe(n);sA(()=>{n||e?.activeElement===e?.body&&Fs(r())},[n]),eG(()=>{n&&Fs(r())})}function qHe(t,{ownerDocument:e,container:n,initialFocus:r,initialFocusFallback:i}){let a=L.useRef(null),s=nf(!!(t&1),"focus-trap#initial-focus"),o=oA();return sA(()=>{if(t===0)return;if(!s){i!=null&&i.current&&Fs(i.current);return}let c=n.current;c&&Bv(()=>{if(!o.current)return;let l=e?.activeElement;if(r!=null&&r.current){if(r?.current===l){a.current=l;return}}else if(c.contains(l)){a.current=l;return}if(r!=null&&r.current)Fs(r.current);else{if(t&16){if(Xd(c,Ao.First|Ao.AutoFocus)!==jb.Error)return}else if(Xd(c,Ao.First)!==jb.Error)return;if(i!=null&&i.current&&(Fs(i.current),e?.activeElement===i.current))return;
vendor: 3,187 bytes, line 313
313console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=e?.activeElement})},[i,s,t]),a}function zHe(t,{ownerDocument:e,container:n,containers:r,previousActiveElement:i}){let a=oA(),s=!!(t&4);QK(e?.defaultView,"focus",o=>{if(!s||!a.current)return;let c=oG(r);n.current instanceof HTMLElement&&c.add(n.current);let l=i.current;if(!l)return;let u=o.target;u&&u instanceof HTMLElement?cG(c,u)?(i.current=u,Fs(u)):(o.preventDefault(),o.stopPropagation(),Fs(l)):Fs(i.current)},!0)}function cG(t,e){for(let n of t)if(n.contains(e))return!0;return!1}function lG(t){var e;return!!(t.enter||t.enterFrom||t.enterTo||t.leave||t.leaveFrom||t.leaveTo)||((e=t.as)!=null?e:dG)!==L.Fragment||tt.Children.count(t.children)===1}let qv=L.createContext(null);qv.displayName="TransitionContext";var ZHe=(t=>(t.Visible="visible",t.Hidden="hidden",t))(ZHe||{});function KHe(){let t=L.useContext(qv);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function GHe(){let t=L.useContext(zv);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}let zv=L.createContext(null);zv.displayName="NestingContext";function Zv(t){return"children"in t?Zv(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function uG(t,e){let n=Hu(t),r=L.useRef([]),i=oA(),a=iA(),s=wn((h,p=Kc.Hidden)=>{let g=r.current.findIndex(({el:y})=>y===h);g!==-1&&(al(p,{[Kc.Unmount](){r.current.splice(g,1)},[Kc.Hidden](){r.current[g].state="hidden"}}),a.microTask(()=>{var y;!Zv(r)&&i.current&&((y=n.current)==null||y.call(n))}))}),o=wn(h=>{let p=r.current.find(({el:g})=>g===h);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:h,state:"visible"}),()=>s(h,Kc.Unmount)}),c=L.useRef([]),l=L.useRef(Promise.resolve()),u=L.useRef({enter:[],leave:[]}),d=wn((h,p,g)=>{c.current.splice(0),e&&(e.chains.current[p]=e.chains.current[p].filter(([y])=>y!==h)),e?.chains.current[p].push([h,new Promise(y=>{c.current.push(y)})]),e?.chains.current[p].push([h,new Promise(y=>{Promise.all(u.current[p].map(([v,b])=>b)).then(()=>y())})]),p==="enter"?l.current=l.current.then(()=>e?.wait.current).then(()=>g(p)):g(p)}),f=wn((h,p,g)=>{Promise.all(u.current[p].splice(0).map(([y,v])=>v)).then(()=>{var y;(y=c.current.shift())==null||y()}).then(()=>g(p))});return L.useMemo(()=>({children:r,register:o,unregister:s,onStart:d,onStop:f,wait:l,chains:u}),[o,s,r,d,f,u,l])}let dG=L.Fragment,fG=em.RenderStrategy;function YHe(t,e){var n,r;let{transition:i=!0,beforeEnter:a,afterEnter:s,beforeLeave:o,afterLeave:c,enter:l,enterFrom:u,enterTo:d,entered:f,leave:h,leaveFrom:p,leaveTo:g,...y}=t,[v,b]=L.useState(null),w=L.useRef(null),_=lG(t),E=Js(..._?[w,e,b]:e===null?[]:[e]),C=(n=y.unmount)==null||n?Kc.Unmount:Kc.Hidden,{show:x,appear:$,initial:T}=KHe(),[U,O]=L.useState(x?"visible":"hidden"),F=GHe(),{register:k,unregister:S}=F;ai(()=>k(w),[k,w]),ai(()=>{if(C===Kc.Hidden&&w.current){if(x&&U!=="visible"){O("visible");return}return al(U,{hidden:()=>S(w),visible:()=>k(w)})}},[U,w,k,S,x,C]);let I=O0();ai(()=>
vendor: 7,653 bytes, line 313
313{if(_&&I&&U==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,U,I,_]);let A=T&&!$,R=$&&x&&T,N=L.useRef(!1),P=uG(()=>{N.current||(O("hidden"),S(w))},F),j=wn(oe=>{N.current=!0;let z=oe?"enter":"leave";P.onStart(w,z,J=>{J==="enter"?a?.():J==="leave"&&o?.()})}),M=wn(oe=>{let z=oe?"enter":"leave";N.current=!1,P.onStop(w,z,J=>{J==="enter"?s?.():J==="leave"&&c?.()}),z==="leave"&&!Zv(P)&&(O("hidden"),S(w))});L.useEffect(()=>{_&&i||(j(x),M(x))},[x,_,i]);let V=!(!i||!_||!I||A),[,B]=vHe(V,v,x,{start:j,end:M}),G=Nl({ref:E,className:((r=Db(y.className,R&&l,R&&u,B.enter&&l,B.enter&&B.closed&&u,B.enter&&!B.closed&&d,B.leave&&h,B.leave&&!B.closed&&p,B.leave&&B.closed&&g,!B.transition&&x&&f))==null?void 0:r.trim())||void 0,...mHe(B)}),Z=0;U==="visible"&&(Z|=Ga.Open),U==="hidden"&&(Z|=Ga.Closed),x&&U==="hidden"&&(Z|=Ga.Opening),!x&&U==="visible"&&(Z|=Ga.Closing);let ie=ka();return tt.createElement(zv.Provider,{value:P},tt.createElement(CHe,{value:Z},ie({ourProps:G,theirProps:y,defaultTag:dG,features:fG,visible:U==="visible",name:"Transition.Child"})))}function JHe(t,e){let{show:n,appear:r=!1,unmount:i=!0,...a}=t,s=L.useRef(null),o=lG(t),c=Js(...o?[s,e]:e===null?[]:[e]);O0();let l=Wv();if(n===void 0&&l!==null&&(n=(l&Ga.Open)===Ga.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=L.useState(n?"visible":"hidden"),f=uG(()=>{n||d("hidden")}),[h,p]=L.useState(!0),g=L.useRef([n]);ai(()=>{h!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),p(!1))},[g,n]);let y=L.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);ai(()=>{n?d("visible"):!Zv(f)&&s.current!==null&&d("hidden")},[n,f]);let v={unmount:i},b=wn(()=>{var E;h&&p(!1),(E=t.beforeEnter)==null||E.call(t)}),w=wn(()=>{var E;h&&p(!1),(E=t.beforeLeave)==null||E.call(t)}),_=ka();return tt.createElement(zv.Provider,{value:f},tt.createElement(qv.Provider,{value:y},_({ourProps:{...v,as:L.Fragment,children:tt.createElement(hG,{ref:c,...v,...a,beforeEnter:b,beforeLeave:w})},theirProps:{},defaultTag:L.Fragment,features:fG,visible:u==="visible",name:"Transition"})))}function XHe(t,e){let n=L.useContext(qv)!==null,r=Wv()!==null;return tt.createElement(tt.Fragment,null,!n&&r?tt.createElement(Vb,{ref:e,...t}):tt.createElement(hG,{ref:e,...t}))}let Vb=Oi(JHe),hG=Oi(YHe),Bp=Oi(XHe),pG=Object.assign(Vb,{Child:Bp,Root:Vb});var QHe=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(QHe||{}),eWe=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(eWe||{});let tWe={0(t,e){return t.titleId===e.id?t:{...t,titleId:e.id}}},cA=L.createContext(null);cA.displayName="DialogContext";function Kv(t){let e=L.useContext(cA);if(e===null){let n=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Kv),n}return e}function nWe(t,e){return al(e.type,tWe,t,e)}let AO=Oi(function(t,e){let n=L.useId(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:s,role:o="dialog",autoFocus:c=!0,__demoMode:l=!1,unmount:u=!1,...d}=t,f=L.useRef(!1);o=function(){return o==="dialog"||o==="alertdialog"?o:(f.current||(f.current=!0,console.warn(`Invalid role [${o}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let h=Wv();i===void 0&&h!==null&&(i=(h&Ga.Open)===Ga.Open);let p=L.useRef(null),g=Js(p,e),y=Vv(p),v=i?0:1,[b,w]=L.useReducer(nWe,{titleId:null,descriptionId:null,panelRef:L.createRef()}),_=wn(()=>a(!1)),E=wn(M=>w({type:0,id:M})),C=O0()?v===0:!1,[x,$]=PHe(),T={get current(){var M;return(M=b.panelRef.current)!=null?M:p.current}},U=sG(),{resolveContainers:O}=DHe({mainTreeNode:U,portals:x,defaultContainers:[T]}),F=h!==null?(h&Ga.Closing)===Ga.Closing:!1;YVe(l||F?!1:C,{allowed:wn(()=>{var M,V;return[(V=(M=p.current)==null?void 0:M.closest("[data-headlessui-portal]"))!=null?V:null]}),disallowed:wn(()=>{var M;return[(M=U?.closest("body > *:not(#headlessui-portal-root)"))!=null?M:null]})}),oHe(C,O,M=>{M.preventDefault(),_()}),MHe(C,y?.defaultView,M=>{M.preventDefault(),M.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),_()}),hHe(l||F?!1:C,y,O),JVe(C,p,_);let[k,S]=BVe(),I=L.useMemo(()=>[{dialogState:v,close:_,setTitleId:E,unmount:u},b],[v,b,_,E,u]),A=L.useMemo(()=>({open:v===0}),[v]),R={ref:g,id:r,role:o,tabIndex:-1,"aria-modal":l?void 0:v===0?!0:void 0,"aria-labelledby":b.titleId,"aria-describedby":k,unmount:u},N=!NHe(),P=Wl.None;C&&!l&&(P|=Wl.RestoreFocus,P|=Wl.TabLock,c&&(P|=Wl.AutoFocus),N&&(P|=Wl.InitialFocus));let j=ka();return tt.createElement(EHe,null,tt.createElement(EO,{force:!0},tt.createElement(OHe,null,tt.createElement(cA.Provider,{value:I},tt.createElement(iG,{target:p},tt.createElement(EO,{force:!1},tt.createElement(S,{slot:A},tt.createElement($,null,tt.createElement(VHe,{initialFocus:s,initialFocusFallback:p,containers:O,features:P},tt.createElement(ZVe,{value:_},j({ourProps:R,theirProps:d,slot:A,defaultTag:rWe,features:iWe,visible:v===0,name:"Dialog"})))))))))))}),rWe="div",iWe=em.RenderStrategy|em.Static;function aWe(t,e){let{transition:n=!1,open:r,...i}=t,a=Wv(),s=t.hasOwnProperty("open")||a!==null,o=t.hasOwnProperty("onClose");if(!s&&!o)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!s)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!o)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof t.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`);if(typeof t.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`);return(r!==void 0||n)&&!i.static?tt.createElement(SO,null,tt.createElement(pG,{show:r,transition:n,unmount:i.unmount},tt.createElement(AO,{ref:e,...i}))):tt.createElement(SO,null,tt.createElement(AO,{ref:e,open:r,...i}))}let sWe="div";function oWe(t,e){let n=L.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=t,[{dialogState:s,unmount:o},c]=Kv("Dialog.Panel"),l=Js(e,c.panelRef),u=L.useMemo(()=>({open:s===0}),[s]),d=wn(y=>{y.stopPropagation()}),f={ref:l,id:r,onClick:d},h=i?Bp:L.Fragment,p=i?{unmount:o}:{},g=ka();return tt.createElement(h,{...p},g({ourProps:f,theirProps:a,slot:u,defaultTag:sWe,name:"Dialog.Panel"}))}let cWe="div";function lWe(t,e){let{transition:n=!1,...r}=t,[{dialogState:i,unmount:a}]=Kv("Dialog.Backdrop"),s=L.useMemo(()=>({open:i===0}),[i]),o={ref:e,"aria-hidden":!0},c=n?Bp:L.Fragment,l=n?{unmount:a}:{},u=ka();return tt.createElement(c,{...l},u({ourProps:o,theirProps:r,slot:s,defaultTag:cWe,name:"Dialog.Backdrop"}))}let uWe="h2";function dWe(t,e){let n=L.useId(),{id:r=`headlessui-dialog-title-${n}`,...i}=t,[{dialogState:a,setTitleId:s}]=Kv("Dialog.Title"),o=Js(e);L.useEffect(()=>(s(r),()=>s(null)),[r,s]);let c=L.useMemo(()=>({open:a===0}),[a]),l={ref:o,id:r};return ka()({ourProps:l,theirProps:i,slot:c,defaultTag:uWe,name:"Dialog.Title"})}let fWe=Oi(aWe),gG=Oi(oWe);Oi(lWe);let hWe=Oi(dWe),pWe=Object.assign(fWe,{Panel:gG,Title:hWe,Description:qVe});const gWe=({origin:t,path:e,query:n={},hash:r={}})=>{let i=t.endsWith("/")?t:`${t}/`,a=new URL(e,i);for(let[o,c]of Object.entries(n))c!==void 0&&a.searchParams.set(o,c);let s=Object.entries(r);if(s.length>0){let o=new URLSearchParams;for(let[c,l]of s)l!==void 0&&o.append(c,l);a.hash=o.toString()}return a.href},xO=Symbol("data-suffix-plugin");
313let lA=class extends Error{constructor(){super("Back navigation"),this.name="BackNavigationError"}};const Iu=Pi(()=>null),Zh=t=>{Iu.getState()!==null&&Iu.setState(t)},G4=()=>Iu.setState(null);async function yG(t,e){let n=await t.fetchPrivyRoute(pB,{}),r={config:{status:"ready",data:{currencies:n.currencies,chains:n.chains}}};e?.aborted||Zh(r)}function yWe(){let t=Iu(),{closePrivyModal:e,createAnalyticsEvent:n,privy:r}=Vt(),i=t?.params??null,a=t?.config??{status:"loading"},s=L.useCallback(l=>{let u=Iu.getState();u&&(Zh({modalState:l}),u.modalState.step!==l.step&&n({eventName:"sdk_deposit_address_step_viewed",payload:{entrySource:u.entrySource,step:l.step,...l.step==="error"?{errorCode:l.code}:{}}}))},[n]),o=L.useCallback(async()=>{let l=t?.controller;if(i&&l&&!l.signal.aborted){Zh({config:{status:"loading"}});try{await yG(r,l.signal)}catch(u){if(l.signal.aborted)return;throw Zh({config:{status:"error",error:u instanceof Error?u:Error("Failed to load deposit config")}}),u}}},[i,r,t?.controller]),c=L.useCallback(()=>{if(!t)return;let{modalState:l}=t;n({eventName:"sdk_deposit_address_exited",payload:{entrySource:t.entrySource,step:l.step,...l.step==="error"?{errorCode:l.code}:{}}}),l.step==="complete"?t.onComplete():l.step==="failed"?t.onError(Error("DEPOSIT_FAILED")):l.step==="error"?t.onError(Error(l.code)):l.step==="refunded"?t.onError(Error("DEPOSIT_REFUNDED")):t.onError(Error("USER_EXITED")),e({shouldCallAuthOnSuccess:!1})},[t,e,n]);return{modalState:t?.modalState??{step:"intro"},setModalState:s,config:a,retryConfig:o,params:i,entrySource:t?.entrySource??"direct",close:c,onBack:t?.onBack}}function qot(t){let{modalState:e,config:n,params:r,...i}=yWe();if(function(a,s){if(a.step!==s)throw Error("UNEXPECTED_STATE")}(e,t),!r||n.status!=="ready")throw Error("UNEXPECTED_STATE");return{state:e,configData:n.data,params:r,...i}}const mWe=()=>{let{openModal:t,privy:e,createAnalyticsEvent:n}=Vt(),{navigate:r}=es();return L.useMemo(()=>({createDepositAddress:async i=>{let{resolve:a,reject:s,promise:o}=Promise.withResolvers();if(!Wo.getState().user)throw Error("User must be authenticated to create a deposit address");if(!i.destinationChain)throw Error("Invalid input: expected destinationChain");
313if(!i.destinationCurrency)throw Error("Invalid input: expected destinationCurrency");if(!i.destinationAddress)throw Error("Invalid input: expected destinationAddress");if(Iu.getState())return s(Error("Existing deposit address flow in progress")),await o;let c=i.entrySource??"direct",l=new AbortController;Iu.setState({controller:l,entrySource:c,onComplete:()=>{G4(),a()},onError:u=>{G4(),s(u)},onBack:i.showBackButton?()=>{n({eventName:"sdk_deposit_address_exited",payload:{step:"intro",entrySource:c}}),l.abort(),G4(),s(new lA)}:void 0,params:{destinationChain:i.destinationChain,destinationCurrency:i.destinationCurrency,destinationAddress:i.destinationAddress,refundAddress:i.refundAddress,slippageBps:i.slippageBps},config:{status:"loading"},modalState:{step:"intro"}}),n({eventName:"sdk_deposit_address_started",payload:{destinationChain:i.destinationChain,destinationCurrency:i.destinationCurrency,backNavigationEnabled:!!i.showBackButton,entrySource:c}}),n({eventName:"sdk_deposit_address_step_viewed",payload:{entrySource:c,step:"intro"}}),i.showBackButton?r("DepositAddressScreen"):t("DepositAddressScreen");try{await yG(e,l.signal)}catch(u){if(l.signal.aborted)return await o;Zh({config:{status:"error",error:u instanceof Error?u:Error("Failed to load deposit config")},modalState:{step:"error",code:"ROUTE_UNAVAILABLE"}})}return await o}}),[t,r,e,n])};var vWe=Object.defineProperty,uA=(t,e)=>{for(var n in e)vWe(t,n,{get:e[n],enumerable:!0})},wWe={84532:{usdcAddress:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",usdcName:"USDC"},8453:{usdcAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",usdcName:"USD Coin"},43113:{usdcAddress:"0x5425890298aed601595a70AB815c96711a31Bc65",usdcName:"USD Coin"},43114:{usdcAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",usdcName:"USD Coin"},4689:{usdcAddress:"0xcdf79194c6c285077a58da47641d4dbe51f63542",usdcName:"Bridged USDC"},103:{usdcAddress:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",usdcName:"USDC"},101:{usdcAddress:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",usdcName:"USDC"},1328:{usdcAddress:"0x4fcf1784b31630811181f670aea7a7bef803eaed",usdcName:"USDC"},1329:{usdcAddress:"0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392",usdcName:"USDC"},137:{usdcAddress:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",usdcName:"USD Coin"},80002:{usdcAddress:"0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",usdcName:"USDC"},3338:{usdcAddress:"0xbbA60da06c2c5424f03f7434542280FCAd453d10",usdcName:"USDC"},2741:{usdcAddress:"0x84a71ccd554cc1b02749b35d22f684cc8ec987e1",usdcName:"Bridged USDC"},11124:{usdcAddress:"0xe4C7fBB0a626ed208021ccabA6Be1566905E2dFc",usdcName:"Bridged USDC"},1514:{usdcAddress:"0xF1815bd50389c46847f0Bda824eC8da914045D14",usdcName:"Bridged USDC"},41923:{usdcAddress:"0x12a272A581feE5577A5dFa371afEB4b2F3a8C2F8",usdcName:"Bridged USDC (Stargate)"},324705682:{usdcAddress:"0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",usdcName:"Bridged USDC (SKALE Bridge)"}},bWe=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationUsed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"Blacklisted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newBlacklister",type:"address"}],name:"BlacklisterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"burner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newMasterMinter",type:"address"}],name:"MasterMinterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!1,internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"MinterConfigured",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldMinter",type:"address"}],name:"MinterRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousOwner",type:"address"},{indexed:!1,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"Pause",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newAddress",type:"address"}],name:"PauserChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newRescuer",type:"address"}],name:"RescuerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"UnBlacklisted",type:"event"},{anonymous:!1,inputs:[],name:"Unpause",type:"event"},{inputs:[],name:"CANCEL_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"RECEIVE_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"authorizationState",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}
313],name:"blacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"blacklister",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"},{internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"configureMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"currency",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"decrement",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"increment",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"tokenName",type:"string"},{internalType:"string",name:"tokenSymbol",type:"string"},{internalType:"string",name:"tokenCurrency",type:"string"},{internalType:"uint8",name:"tokenDecimals",type:"uint8"},{internalType:"address",name:"newMasterMinter",type:"address"},{internalType:"address",name:"newPauser",type:"address"},{internalType:"address",name:"newBlacklister",type:"address"},{internalType:"address",name:"newOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"newName",type:"string"}],name:"initializeV2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"lostAndFound",type:"address"}],name:"initializeV2_1",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"accountsToBlacklist",type:"address[]"},{internalType:"string",name:"newSymbol",type:"string"}],name:"initializeV2_2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"isBlacklisted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"isMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"masterMinter",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"minterAllowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pauser",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"removeMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"tokenContract",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"rescueERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rescuer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"unBlacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newBlacklister",type:"address"}],name:"updateBlacklister",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newMasterMinter",type:"address"}],name:"updateMasterMinter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newPauser",type:"address"}],name:"updatePauser",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRescuer",type:"address"}],name:"updateRescuer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"}],_We=10,CWe=-32700,EWe=-32603,SWe=-32602,AWe=-32601,xWe=-32600,IWe=-32015,TWe=-32014,LWe=-32012,kWe=-32010,$We=-32009,PWe=-32007,RWe=-32006,OWe=-32004,IO=-32002,MWe=-32001,NWe=28e5,DWe=2800001,FWe=2800003,UWe=2800006,jWe=2800007,mG=2800008,BWe=2800009,zot=32300001,Zot=3230004,VWe=361e4,HWe=3610001,WWe=3610003,qWe=3610005,zWe=3610006,ZWe=3610007,KWe=3611e3,GWe=3704e3,YWe=3704001,JWe=3704004,XWe=4615e3,QWe=4615026,eqe=5663e3,TO=5663001,tqe=5663004,nqe=5663005,rqe=5663006,iqe=5663007,aqe=5663008,sqe=5663015,oqe=5663016,cqe=5663017,vG=5663021,lqe=705e4,uqe=7050030,dqe=7050031,fqe=7050035,hqe=8078e3,pqe=8078001,gqe=8078004,yqe=8078005,mqe=8078006,vqe=8078007,wqe=8078011,rm=8078012,bqe=8078013,_qe=8078014,Cqe=8078017,wG=81e5,Eqe=8100002,Sqe=8100003,Aqe=819e4,xqe=8190001,Iqe=8190002,Hb=8190003,Tqe=8190004,Lqe=99e5,kqe=9900001,$qe=9900004;function bG(t){return Array.isArray(t)?"%5B"+t.map(bG).join("%2C%20")+"%5D":typeof t=="bigint"?`${t}n`:encodeURIComponent(String(t!=null&&Object.getPrototypeOf(t)===null?{...t}:t))}function Pqe([t,e]){return`${t}=${bG(e)}`}function Rqe(t){const e=Object.entries(t).map(Pqe).join("&");return btoa(e)}function Oqe(t,e={}){{let n=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(n+=` '${Rqe(e)}'`),`${n}\``}}function _G(t,e){return t instanceof Error&&t.name==="SolanaError"?e!==void 0?t.context.__code===e:!0:!1}
313var Ge=class extends Error{cause=this.cause;context;constructor(...[t,e]){let n,r;e&&Object.entries(Object.getOwnPropertyDescriptors(e)).forEach(([a,s])=>{a==="cause"?r={cause:s.value}:(n===void 0&&(n={__code:t}),Object.defineProperty(n,a,s))});const i=Oqe(t,n);super(i,r),this.context=Object.freeze(n===void 0?{__code:t}:n),this.name="SolanaError"}};function Gv(...t){"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...t)}function CG({errorCodeBaseOffset:t,getErrorContext:e,orderedErrorNames:n,rpcEnumError:r},i){let a,s;typeof r=="string"?a=r:(a=Object.keys(r)[0],s=r[a]);const o=n.indexOf(a),c=t+o,l=e(c,a,s),u=new Ge(c,l);return Gv(u,i),u}var Mqe=["GenericError","InvalidArgument","InvalidInstructionData","InvalidAccountData","AccountDataTooSmall","InsufficientFunds","IncorrectProgramId","MissingRequiredSignature","AccountAlreadyInitialized","UninitializedAccount","UnbalancedInstruction","ModifiedProgramId","ExternalAccountLamportSpend","ExternalAccountDataModified","ReadonlyLamportChange","ReadonlyDataModified","DuplicateAccountIndex","ExecutableModified","RentEpochModified","NotEnoughAccountKeys","AccountDataSizeChanged","AccountNotExecutable","AccountBorrowFailed","AccountBorrowOutstanding","DuplicateAccountOutOfSync","Custom","InvalidError","ExecutableDataModified","ExecutableLamportChange","ExecutableAccountNotRentExempt","UnsupportedProgramId","CallDepth","MissingAccount","ReentrancyNotAllowed","MaxSeedLengthExceeded","InvalidSeeds","InvalidRealloc","ComputationalBudgetExceeded","PrivilegeEscalation","ProgramEnvironmentSetupFailure","ProgramFailedToComplete","ProgramFailedToCompile","Immutable","IncorrectAuthority","BorshIoError","AccountNotRentExempt","InvalidAccountOwner","ArithmeticOverflow","UnsupportedSysvar","IllegalOwner","MaxAccountsDataAllocationsExceeded","MaxAccountsExceeded","MaxInstructionTraceLengthExceeded","BuiltinProgramsMustConsumeComputeUnits"];function EG(t,e){const n=Number(t);return CG({errorCodeBaseOffset:4615001,getErrorContext(r,i,a){return r===XWe?{errorName:i,index:n,...a!==void 0?{instructionErrorContext:a}:null}:r===QWe?{code:Number(a),index:n}:{index:n}},orderedErrorNames:Mqe,rpcEnumError:e},EG)}var Nqe=["AccountInUse","AccountLoadedTwice","AccountNotFound","ProgramAccountNotFound","InsufficientFundsForFee","InvalidAccountForFee","AlreadyProcessed","BlockhashNotFound","CallChainTooDeep","MissingSignatureForFee","InvalidAccountIndex","SignatureFailure","InvalidProgramForExecution","SanitizeFailure","ClusterMaintenance","AccountBorrowOutstanding","WouldExceedMaxBlockCostLimit","UnsupportedVersion","InvalidWritableAccount","WouldExceedMaxAccountCostLimit","WouldExceedAccountDataBlockLimit","TooManyAccountLocks","AddressLookupTableNotFound","InvalidAddressLookupTableOwner","InvalidAddressLookupTableData","InvalidAddressLookupTableIndex","InvalidRentPayingAccount","WouldExceedMaxVoteCostLimit","WouldExceedAccountDataTotalLimit","DuplicateInstruction","InsufficientFundsForRent","MaxLoadedAccountsDataSizeExceeded","InvalidLoadedAccountsDataSizeLimit","ResanitizationNeeded","ProgramExecutionTemporarilyRestricted","UnbalancedTransaction"];function SG(t){return typeof t=="object"&&"InstructionError"in t?EG(...t.InstructionError):CG({errorCodeBaseOffset:7050001,getErrorContext(e,n,r){if(e===lqe)return{errorName:n,...r!==void 0?{transactionErrorContext:r}:null};if(e===uqe)return{index:Number(r)};if(e===dqe||e===fqe)return{accountIndex:Number(r.account_index)}},orderedErrorNames:Nqe,rpcEnumError:t},SG)}function im(t){let e;if(Dqe(t)){const{code:n,data:r,message:i}=t,a=Number(n);if(a===IO){const{err:s,...o}=r,c=s?{cause:SG(s)}:null;e=new Ge(IO,{...o,...c})}else{let s;switch(a){case EWe:case SWe:case xWe:case AWe:case CWe:case LWe:case MWe:case OWe:case TWe:case kWe:case $We:case PWe:case RWe:case IWe:s={__serverMessage:i};break;default:typeof r=="object"&&!Array.isArray(r)&&(s=r)}e=new Ge(a,s)}}else{const n=typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"?t.message:"Malformed JSON-RPC error with no message attribute";e=new Ge(_We,{error:t,message:n})}return Gv(e,im),e}function Dqe(t){return typeof t=="object"&&t!==null&&"code"in t&&"message"in t&&(typeof t.code=="number"||typeof t.code=="bigint")&&typeof t.message=="string"}function Fqe(t,e){if(t.length>=e)return t;const n=new Uint8Array(e).fill(0);return n.set(t),n}var Uqe=(t,e)=>Fqe(t.length<=e?t:t.slice(0,e),e);
313function jqe(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function Tu(t,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(t)}function Cr(t){return Object.freeze({...t,encode:e=>{const n=new Uint8Array(Tu(e,t));return t.write(e,n,0),n}})}function Hr(t){return Object.freeze({...t,decode:(e,n=0)=>t.read(e,n)[0]})}function On(t){return"fixedSize"in t&&typeof t.fixedSize=="number"}function Bqe(t){return!On(t)}function Vqe(t,e){if(On(t)!==On(e))throw new Ge(gqe);if(On(t)&&On(e)&&t.fixedSize!==e.fixedSize)throw new Ge(yqe,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!On(t)&&!On(e)&&t.maxSize!==e.maxSize)throw new Ge(mqe,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}}function Hqe(t,e,n=0){if(e.length-n<=0)throw new Ge(hqe,{codecDescription:t})}function dA(t,e,n,r=0){const i=n.length-r;if(i<e)throw new Ge(pqe,{bytesLength:i,codecDescription:t,expected:e})}function LO(t,e,n){if(e<0||e>n)throw new Ge(_qe,{bytesLength:n,codecDescription:t,offset:e})}function Wqe(t,e){const n=(s,o,c)=>{const l=t.encode(s);return c=e.write(l.length,o,c),o.set(l,c),c+l.length};if(On(e)&&On(t))return Cr({...t,fixedSize:e.fixedSize+t.fixedSize,write:n});const r=On(e)?e.fixedSize:e.maxSize??null,i=On(t)?t.fixedSize:t.maxSize??null,a=r!==null&&i!==null?r+i:null;return Cr({...t,...a!==null?{maxSize:a}:{}
313,getSizeFromValue:s=>{const o=Tu(s,t);return Tu(o,e)+o},write:n})}function qqe(t,e){const n=(s,o)=>{const[c,l]=e.read(s,o),u=Number(c);return o=l,(o>0||s.length>u)&&(s=s.slice(o,o+u)),dA("addDecoderSizePrefix",u,s),[t.decode(s),o+u]};if(On(e)&&On(t))return Hr({...t,fixedSize:e.fixedSize+t.fixedSize,read:n});const r=On(e)?e.fixedSize:e.maxSize??null,i=On(t)?t.fixedSize:t.maxSize??null,a=r!==null&&i!==null?r+i:null;return Hr({...t,...a!==null?{maxSize:a}:{},read:n})}function am(t,e,n){const r=t.byteOffset+(e??0),i=n??t.byteLength;let a;return typeof SharedArrayBuffer>"u"?a=t.buffer:t.buffer instanceof SharedArrayBuffer?(a=new ArrayBuffer(t.length),new Uint8Array(a).set(new Uint8Array(t))):a=t.buffer,(r===0||r===-t.byteLength)&&i===t.byteLength?a:a.slice(r,r+i)}function fA(t,e){return Cr({fixedSize:e,write:(n,r,i)=>{const a=t.encode(n),s=a.length>e?a.slice(0,e):a;return r.set(s,i),i+e}})}function hA(t,e){return Hr({fixedSize:e,read:(n,r)=>{dA("fixCodecSize",e,n,r),(r>0||n.length>e)&&(n=n.slice(r,r+e)),On(t)&&(n=Uqe(n,t.fixedSize));const[i]=t.read(n,0);return[i,r+e]}})}function zqe(t,e){return Hr({...t,read:(n,r)=>{const i=l=>Zqe(l,n.length),a=e.preOffset?e.preOffset({bytes:n,preOffset:r,wrapBytes:i}):r;LO("offsetDecoder",a,n.length);const[s,o]=t.read(n,a),c=e.postOffset?e.postOffset({bytes:n,newPreOffset:a,postOffset:o,preOffset:r,wrapBytes:i}):o;return LO("offsetDecoder",c,n.length),[s,c]}})}function Zqe(t,e){return e===0?0:(t%e+e)%e}function Kqe(t,e){if(On(t)){const n=e(t.fixedSize);if(n<0)throw new Ge(bqe,{bytesLength:n,codecDescription:"resizeDecoder"});return Hr({...t,fixedSize:n})}return t}function Gqe(t,e){return zqe(Kqe(t,n=>n+e),{postOffset:({postOffset:n})=>n+e})}function rf(t,e){return Cr({...Bqe(t)?{...t,getSizeFromValue:n=>t.getSizeFromValue(e(n))}:t,write:(n,r,i)=>t.write(e(n),r,i)})}function pA(t,e){return Hr({...t,read:(n,r)=>{const[i,a]=t.read(n,r);return[e(i,n,r),a]}})}function Yqe(t,e,n=e){if(!e.match(new RegExp(`^[${t}]*$`)))throw new Ge(rm,{alphabet:t,base:t.length,value:n})}var Jqe=t=>Cr({getSizeFromValue:e=>{const[n,r]=kO(e,t[0]);if(!r)return e.length;const i=$O(r,t);return n.length+Math.ceil(i.toString(16).length/2)},write(e,n,r){if(Yqe(t,e),e==="")return r;const[i,a]=kO(e,t[0]);if(!a)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let s=$O(a,t);const o=[];for(;s>0n;)o.unshift(Number(s%256n)),s/=256n;const c=[...Array(i.length).fill(0),...o];return n.set(c,r),r+c.length}}),Xqe=t=>Hr({read(e,n){const r=n===0?e:e.slice(n);if(r.length===0)return["",0];let i=r.findIndex(c=>c!==0);i=i===-1?r.length:i;const a=t[0].repeat(i);if(i===r.length)return[a,e.length];const s=r.slice(i).reduce((c,l)=>c*256n+BigInt(l),0n),o=Qqe(s,t);return[a+o,e.length]}});function kO(t,e){const[n,r]=t.split(new RegExp(`((?!${e}).*)`));return[n,r]}function $O(t,e){const n=BigInt(e.length);let r=0n;for(const i of t)r*=n,r+=BigInt(e.indexOf(i));return r}function Qqe(t,e){const n=BigInt(e.length),r=[];for(;t>0n;)r.unshift(e[Number(t%n)]),t/=n;return r.join("")}var AG="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",eze=()=>Jqe(AG),tze=()=>Xqe(AG),PO="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nze=()=>Cr({getSizeFromValue:t=>{try{return atob(t).length}catch{throw new Ge(rm,{alphabet:PO,base:64,value:t})}},write(t,e,n){try{const r=atob(t).split("").map(i=>i.charCodeAt(0));return e.set(r,n),r.length+n}catch{throw new Ge(rm,{alphabet:PO,base:64,value:t})}}}),rze=()=>Hr({read(t,e=0){const n=t.slice(e);return[btoa(String.fromCharCode(...n)),t.length]}});function ize(){if(typeof globalThis.crypto>"u"||typeof globalThis.crypto.getRandomValues!="function")throw new Ge(KWe)}function Yv(){if(!globalThis.isSecureContext)throw new Ge(VWe)}function aze(){if(Yv(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.digest!="function")throw new Ge(HWe)}function xG(){if(Yv(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.exportKey!="function")throw new Ge(WWe)}function sze(){if(Yv(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.sign!="function")throw new Ge(qWe)}function oze(){if(Yv(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.verify!="function")throw new Ge(zWe)}var Y4,J4;function gA(){return Y4||(Y4=eze()),Y4}function cze(){return J4||(J4=tze()),J4}function lze(t){if(t.length<32||t.length>44)return!1;const e=gA();try{return e.encode(t).byteLength===32}catch{return!1}}function Wb(t){if(t.length<32||t.length>44)throw new Ge(DWe,{actualLength:t.length});const r=gA().encode(t).byteLength;if(r!==32)throw new Ge(NWe,{actualLength:r})}function uze(t){return Wb(t),t}function Qd(){return rf(fA(gA(),32),t=>uze(t))}function M0(){return hA(cze(),32)}function dze(){return Vqe(Qd(),M0())}function yA(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}var fze=37095705934669439343138083508754565189542113879843219016388785533085940283555n,Xr=57896044618658097711785492504343953926634992332820282019728792003956564819949n,RO=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function fa(t){const e=t%Xr;return e>=0n?e:Xr+e}function fs(t,e){let n=t;for(;e-- >0n;)n*=n,n%=Xr;return n}function hze(t){const n=t*t%Xr*t%Xr,r=fs(n,2n)*n%Xr,i=fs(r,1n)*t%Xr,a=fs(i,5n)*i%Xr,s=fs(a,10n)*a%Xr,o=fs(s,20n)*s%Xr,c=fs(o,40n)*o%Xr,l=fs(c,80n)*c%Xr,u=fs(l,80n)*c%Xr,d=fs(u,10n)*a%Xr;return fs(d,2n)*t%Xr}function pze(t,e){const n=fa(e*e*e),r=fa(n*n*e),i=hze(t*r);let a=fa(t*n*i);const s=fa(e*a*a),o=a,c=fa(a*RO),l=s===t,u=s===fa(-t),d=s===fa(-t*RO);return l&&(a=o),(u||d)&&(a=c),(fa(a)&1n)===1n&&(a=fa(-a)),!l&&!u?null:a}function gze(t,e){const n=fa(t*t),r=fa(n-1n),i=fa(fze*n+1n),a=pze(r,i);if(a===null)return!1;const s=(e&128)!==0;return!(a===0n&&s)}function yze(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function mze(t){const n=`0x${t.reduce((r,i,a)=>`${yze(a===31?i&-129:i)}${r}`,"")}`;return BigInt(n)}function vze(t){if(t.byteLength!==32)return!1;const e=mze(t);return gze(e,t[31])}var OO=32,MO=16,wze=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,
313100,114,101,115,115];async function bze({programAddress:t,seeds:e}){if(aze(),e.length>MO)throw new Ge(UWe,{actual:e.length,maxSeeds:MO});let n;const r=e.reduce((c,l,u)=>{const d=typeof l=="string"?(n||=new TextEncoder).encode(l):l;if(d.byteLength>OO)throw new Ge(jWe,{actual:d.byteLength,index:u,maxSeedLength:OO});return c.push(...d),c},[]),i=dze(),a=i.encode(t),s=await crypto.subtle.digest("SHA-256",new Uint8Array([...r,...a,...wze])),o=new Uint8Array(s);if(vze(o))throw new Ge(mG);return i.decode(o)}async function _ze({programAddress:t,seeds:e}){let n=255;for(;n>0;)try{return[await bze({programAddress:t,seeds:[...e,new Uint8Array([n])]}),n]}catch(r){if(_G(r,mG))n--;else throw r}throw new Ge(BWe)}async function IG(t){if(xG(),t.type!=="public"||t.algorithm.name!=="Ed25519")throw new Ge(FWe);const e=await crypto.subtle.exportKey("raw",t);return M0().decode(new Uint8Array(e))}function TG(t,e,n,r){if(r<e||r>n)throw new Ge(wqe,{codecDescription:t,max:n,min:e,value:r})}function LG(t){return t?.endian!==1}function mA(t){return Cr({fixedSize:t.size,write(e,n,r){t.range&&TG(t.name,t.range[0],t.range[1],e);const i=new ArrayBuffer(t.size);return t.set(new DataView(i),e,LG(t.config)),n.set(new Uint8Array(i),r),r+t.size}})}function kG(t){return Hr({fixedSize:t.size,read(e,n=0){Hqe(t.name,e,n),dA(t.name,t.size,e,n);const r=new DataView(am(e,n,t.size));return[t.get(r,LG(t.config)),n+t.size]}})}var Lu=()=>Cr({getSizeFromValue:t=>t<=127?1:t<=16383?2:3,maxSize:3,write:(t,e,n)=>{TG("shortU16",0,65535,t);const r=[0];for(let i=0;;i+=1){const a=Number(t)>>i*7;if(a===0)break;const s=127&a;r[i]=s,i>0&&(r[i-1]|=128)}return e.set(r,n),n+r.length}}),sl=()=>Hr({maxSize:3,read:(t,e)=>{let n=0,r=0;for(;++r;){const i=r-1,a=t[e+i],s=127&a;if(n|=s<<i*7,!(a&128))break}return[n,e+r]}}),Cze=(t={})=>mA({config:t,name:"u32",range:[0,+"0xffffffff"],set:(e,n,r)=>e.setUint32(0,Number(n),r),size:4}),Eze=(t={})=>kG({config:t,get:(e,n)=>e.getUint32(0,n),name:"u32",size:4}),Sze=(t={})=>mA({config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,n,r)=>e.setBigUint64(0,BigInt(n),r),size:8}),L2=()=>mA({name:"u8",range:[0,+"0xff"],set:(t,e)=>t.setUint8(0,Number(e)),size:1}),Vp=()=>kG({get:t=>t.getUint8(0),name:"u8",size:1});function Aze(t,e,n){if(e!==n)throw new Ge(vqe,{actual:n,codecDescription:t,expected:e})}function xze(t){return t.reduce((e,n)=>e===null||n===null?null:Math.max(e,n),0)}function k2(t){return t.reduce((e,n)=>e===null||n===null?null:e+n,0)}function N0(t){return On(t)?t.fixedSize:null}function af(t){return On(t)?t.fixedSize:t.maxSize??null}function $2(t,e={}){const n=e.size??Cze(),r=sm(n,N0(t)),i=sm(n,af(t))??void 0;return Cr({...r!==null?{fixedSize:r}:{getSizeFromValue:a=>(typeof n=="object"?Tu(a.length,n):0)+[...a].reduce((o,c)=>o+Tu(c,t),0),maxSize:i},write:(a,s,o)=>(typeof n=="number"&&Aze("array",n,a.length),typeof n=="object"&&(o=n.write(a.length,s,o)),a.forEach(c=>{o=t.write(c,s,o)}),o)})}function ku(t,e={}){const n=e.size??Eze(),r=N0(t),i=sm(n,r),a=sm(n,af(t))??void 0;return Hr({...i!==null?{fixedSize:i}:{maxSize:a},read:(s,o)=>{const c=[];if(typeof n=="object"&&s.slice(o).length===0)return[c,o];if(n==="remainder"){for(;o<s.length;){const[d,f]=t.read(s,o);o=f,c.push(d)}return[c,o]}const[l,u]=typeof n=="number"?[n,o]:n.read(s,o);o=u;for(let d=0;d<l;d+=1){const[f,h]=t.read(s,o);o=h,c.push(f)}return[c,o]}})}function sm(t,e){return typeof t!="number"?null:t===0?0:e===null?null:e*t}function vA(){return Cr({getSizeFromValue:t=>t.length,write:(t,e,n)=>(e.set(t,n),n+t.length)})}function qb(){return Hr({read:(t,e)=>{const n=t.slice(e);return[n,e+n.length]}})}function Ize(t){return Cr({fixedSize:t.length,write:(e,n,r)=>(n.set(t,r),r+t.length)})}function Tze(t){const e=k2(t.map(N0)),n=k2(t.map(af))??void 0;return Hr({...e===null?{maxSize:n}:{fixedSize:e},read:(r,i)=>{const a=[];return t.forEach(s=>{const[o,c]=s.read(r,i);a.push(o),i=c}),[a,i]}})}function Lze(t,e){const n=kze(t),r=(a,s,o)=>{const c=e(a);return NO(t,c),t[c].write(a,s,o)};if(n!==null)return Cr({fixedSize:n,write:r});const i=$ze(t);return Cr({...i!==null?{maxSize:i}:{},getSizeFromValue:a=>{const s=e(a);return NO(t,s),Tu(a,t[s])},write:r})}function NO(t,e){if(typeof t[e]>"u")throw new Ge(Cqe,{maxRange:t.length-1,minRange:0,variant:e})}function kze(t){if(t.length===0)return 0;if(!On(t[0]))return null;const e=t[0].fixedSize;return t.every(r=>On(r)&&r.fixedSize===e)?e:null}function $ze(t){return xze(t.map(e=>af(e)))}function ml(t){const e=t.map(([,i])=>i),n=k2(e.map(N0)),r=k2(e.map(af))??void 0;
313return Cr({...n===null?{getSizeFromValue:i=>t.map(([a,s])=>Tu(i[a],s)).reduce((a,s)=>a+s,0),maxSize:r}:{fixedSize:n},write:(i,a,s)=>(t.forEach(([o,c])=>{s=c.write(i[o],a,s)}),s)})}function D0(t){const e=t.map(([,i])=>i),n=k2(e.map(N0)),r=k2(e.map(af))??void 0;return Hr({...n===null?{maxSize:r}:{fixedSize:n},read:(i,a)=>{const s={};return t.forEach(([o,c])=>{const[l,u]=c.read(i,a);a=u,s[o]=l}),[s,a]}})}function Wu(t,...e){return e.reduce((n,r)=>r(n),t)}var Wn=(t=>(t[t.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",t[t.READONLY_SIGNER=2]="READONLY_SIGNER",t[t.WRITABLE=1]="WRITABLE",t[t.READONLY=0]="READONLY",t))(Wn||{}),Pze=2,Rze=1;function P2(t){return t>=2}function Hp(t){return(t&Rze)!==0}function DO(t,e){return t|e}function Oze(t){return t|Pze}function Mze(t){return lze(t)}function Nze(t){return"lifetimeConstraint"in t&&typeof t.lifetimeConstraint.blockhash=="string"&&typeof t.lifetimeConstraint.lastValidBlockHeight=="bigint"&&Mze(t.lifetimeConstraint.blockhash)}function Dze(t,e){return"lifetimeConstraint"in e&&e.lifetimeConstraint&&"blockhash"in e.lifetimeConstraint&&e.lifetimeConstraint.blockhash===t.blockhash&&e.lifetimeConstraint.lastValidBlockHeight===t.lastValidBlockHeight?e:Object.freeze({...e,lifetimeConstraint:Object.freeze(t)})}function Fze(t,e,n=e){if(!e.match(new RegExp(`^[${t}]*$`)))throw new Ge(rm,{alphabet:t,base:t.length,value:n})}var Uze=t=>Cr({getSizeFromValue:e=>{const[n,r]=FO(e,t[0]);if(!r)return e.length;const i=UO(r,t);return n.length+Math.ceil(i.toString(16).length/2)},write(e,n,r){if(Fze(t,e),e==="")return r;const[i,a]=FO(e,t[0]);if(!a)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let s=UO(a,t);const o=[];for(;s>0n;)o.unshift(Number(s%256n)),s/=256n;const c=[...Array(i.length).fill(0),...o];return n.set(c,r),r+c.length}}),jze=t=>Hr({read(e,n){const r=n===0?e:e.slice(n);if(r.length===0)return["",0];let i=r.findIndex(c=>c!==0);i=i===-1?r.length:i;const a=t[0].repeat(i);if(i===r.length)return[a,e.length];const s=r.slice(i).reduce((c,l)=>c*256n+BigInt(l),0n),o=Bze(s,t);return[a+o,e.length]}});function FO(t,e){const[n,r]=t.split(new RegExp(`((?!${e}).*)`));return[n,r]}function UO(t,e){const n=BigInt(e.length);let r=0n;for(const i of t)r*=n,r+=BigInt(e.indexOf(i));return r}function Bze(t,e){const n=BigInt(e.length),r=[];for(;t>0n;)r.unshift(e[Number(t%n)]),t/=n;return r.join("")}var $G="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Vze=()=>Uze($G),Hze=()=>jze($G),X4;function Wze(){if(!X4){const t=$2(L2(),{size:Lu()});X4=ml([["lookupTableAddress",Qd()],["writableIndexes",t],["readonlyIndexes",t]])}return X4}var Q4;function qze(){if(!Q4){const t=ku(Vp(),{size:sl()});Q4=D0([["lookupTableAddress",M0()],["writableIndexes",t],["readonlyIndexes",t]])}return Q4}var e7;function t7(){return e7||(e7=L2()),e7}var n7;function r7(){return n7||(n7=Vp()),n7}function zze(){return ml([["numSignerAccounts",t7()],["numReadonlySignerAccounts",t7()],["numReadonlyNonSignerAccounts",t7()]])}function Zze(){return D0([["numSignerAccounts",r7()],["numReadonlySignerAccounts",r7()],["numReadonlyNonSignerAccounts",r7()]])}var i7;function Kze(){return i7||(i7=rf(ml([["programAddressIndex",L2()],["accountIndices",$2(L2(),{size:Lu()})],["data",Wqe(vA(),Lu())]]),t=>t.accountIndices!==void 0&&t.data!==void 0?t:{...t,accountIndices:t.accountIndices??[],data:t.data??new Uint8Array(0)})),i7}var a7;function Gze(){return a7||(a7=pA(D0([["programAddressIndex",Vp()],["accountIndices",ku(Vp(),{size:sl()})],["data",qqe(qb(),sl())]]),t=>{if(t.accountIndices.length&&t.data.byteLength)return t;const{accountIndices:e,data:n,...r}=t;return{...r,...e.length?{accountIndices:e}:null,...n.byteLength?{data:n}:null}})),a7}var PG=0,zb=128;function Yze(){return Cr({getSizeFromValue:t=>t==="legacy"?0:1,maxSize:1,write:(t,e,n)=>{if(t==="legacy")return n;if(t<0||t>127)throw new Ge(tqe,{actualVersion:t});if(t>PG)throw new Ge(vG,{unsupportedVersion:t});return e.set([t|zb],n),n+1}})}function RG(){return Hr({maxSize:1,read:(t,e)=>{const n=t[e];if(n&zb){const r=n^zb;if(r>PG)throw new Ge(vG,{unsupportedVersion:r});return[r,e+1]}else return["legacy",e]}})}function jO(){return ml(OG())}function BO(){return rf(ml([...OG(),["addressTableLookups",Xze()]]),t=>t.version==="legacy"?t:{...t,addressTableLookups:t.addressTableLookups??[]})}function OG(){const t=Lze([Ize(new Uint8Array(32)),fA(Vze(),32)],e=>e===void 0?0:1);
313return[["version",Yze()],["header",zze()],["staticAccounts",$2(Qd(),{size:Lu()})],["lifetimeToken",t],["instructions",$2(Kze(),{size:Lu()})]]}function Jze(){return[["version",RG()],["header",Zze()],["staticAccounts",ku(M0(),{size:sl()})],["lifetimeToken",hA(Hze(),32)],["instructions",ku(Gze(),{size:sl()})],["addressTableLookups",Qze()]]}function Xze(){return $2(Wze(),{size:Lu()})}function Qze(){return ku(qze(),{size:sl()})}function eZe(){return Cr({getSizeFromValue:t=>t.version==="legacy"?jO().getSizeFromValue(t):BO().getSizeFromValue(t),write:(t,e,n)=>t.version==="legacy"?jO().write(t,e,n):BO().write(t,e,n)})}function tZe(){return pA(D0(Jze()),({addressTableLookups:t,...e})=>e.version==="legacy"||!t?.length?e:{...e,addressTableLookups:t})}function VO(t,e,n){t[e]=n(t[e]??{role:Wn.READONLY})}var jn=Symbol("AddressMapTypeProperty");function nZe(t,e){const n={[t]:{[jn]:0,role:Wn.WRITABLE_SIGNER}},r=new Set;for(const i of e){VO(n,i.programAddress,s=>{if(r.add(i.programAddress),jn in s){if(Hp(s.role))switch(s[jn]){case 0:throw new Ge(eqe,{programAddress:i.programAddress});default:throw new Ge(TO,{programAddress:i.programAddress})}if(s[jn]===2)return s}return{[jn]:2,role:Wn.READONLY}});let a;if(i.accounts)for(const s of i.accounts)VO(n,s.address,o=>{const{address:c,...l}=s;if(jn in o)switch(o[jn]){case 0:return o;case 1:{const u=DO(o.role,l.role);if("lookupTableAddress"in l){if(o.lookupTableAddress!==l.lookupTableAddress&&(a||=yA())(l.lookupTableAddress,o.lookupTableAddress)<0)return{[jn]:1,...l,role:u}}else if(P2(l.role))return{[jn]:2,role:u};return o.role!==u?{...o,role:u}:o}case 2:{const u=DO(o.role,l.role);if(r.has(s.address)){if(Hp(l.role))throw new Ge(TO,{programAddress:s.address});return o.role!==u?{...o,role:u}:o}else return"lookupTableAddress"in l&&!P2(o.role)?{...l,[jn]:1,role:u}:o.role!==u?{...o,role:u}:o}}return"lookupTableAddress"in l?{...l,[jn]:1}:{...l,[jn]:2}})}return n}function rZe(t){let e;return Object.entries(t).sort(([r,i],[a,s])=>{if(i[jn]!==s[jn]){if(i[jn]===0)return-1;if(s[jn]===0)return 1;if(i[jn]===2)return-1;if(s[jn]===2)return 1}const o=P2(i.role);if(o!==P2(s.role))return o?-1:1;const c=Hp(i.role);return c!==Hp(s.role)?c?-1:1:(e||=yA(),i[jn]===1&&s[jn]===1&&i.lookupTableAddress!==s.lookupTableAddress?e(i.lookupTableAddress,s.lookupTableAddress):e(r,a))}).map(([r,i])=>({address:r,...i}))}function iZe(t){const e={};for(const n of t){if(!("lookupTableAddress"in n))continue;const r=e[n.lookupTableAddress]||={readonlyIndexes:[],writableIndexes:[]};n.role===Wn.WRITABLE?r.writableIndexes.push(n.addressIndex):r.readonlyIndexes.push(n.addressIndex)}return Object.keys(e).sort(yA()).map(n=>({lookupTableAddress:n,...e[n]}))}function aZe(t){let e=0,n=0,r=0;for(const i of t){if("lookupTableAddress"in i)break;const a=Hp(i.role);P2(i.role)?(r++,a||n++):a||e++}return{numReadonlyNonSignerAccounts:e,numReadonlySignerAccounts:n,numSignerAccounts:r}}function sZe(t){const e={};for(const[n,r]of t.entries())e[r.address]=n;return e}function oZe(t,e){const n=sZe(e);return t.map(({accounts:r,data:i,programAddress:a})=>({programAddressIndex:n[a],...r?{accountIndices:r.map(({address:s})=>n[s])}:null,...i?{data:i}:null}))}function cZe(t){return"nonce"in t?t.nonce:t.blockhash}function lZe(t){const e=t.findIndex(r=>"lookupTableAddress"in r);return(e===-1?t:t.slice(0,e)).map(({address:r})=>r)}function uZe(t){const e=nZe(t.feePayer.address,t.instructions),n=rZe(e),r=t.lifetimeConstraint;return{...t.version!=="legacy"?{addressTableLookups:iZe(n)}:null,...r?{lifetimeToken:cZe(r)}:null,header:aZe(n),instructions:oZe(t.instructions,n),staticAccounts:lZe(n),version:t.version}}function dZe(t){return Object.freeze({instructions:Object.freeze([]),version:t.version})}var MG="SysvarRecentB1ockHashes11111111111111111111",NG="11111111111111111111111111111111";function HO(t,e){return{accounts:[{address:t,role:Wn.WRITABLE},{address:MG,role:Wn.READONLY},{address:e,role:Wn.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:NG}}function wA(t){return t.programAddress===NG&&t.data!=null&&fZe(t.data)&&t.accounts?.length===3&&t.accounts[0].address!=null&&t.accounts[0].role===Wn.WRITABLE&&t.accounts[1].address===MG&&t.accounts[1].role===Wn.READONLY&&t.accounts[2].address!=null&&P2(t.accounts[2].role)}function fZe(t){return t.byteLength===4&&t[0]===4&&t[1]===0&&t[2]===0&&t[3]===0}function DG(t){return"lifetimeConstraint"in t&&typeof t.lifetimeConstraint.nonce=="string"&&t.instructions[0]!=null&&wA(t.instructions[0])}function hZe(t,e,n){return t.accounts[0].address===e&&t.accounts[2].address===n}function pZe({nonce:t,nonceAccountAddress:e,nonceAuthorityAddress:n},r){let i;const a=r.instructions[0];if(a&&wA(a))if(hZe(a,e,n)){if(DG(r)&&r.lifetimeConstraint.nonce===t)return r;i=[a,...r.instructions.slice(1)]}
313else i=[Object.freeze(HO(e,n)),...r.instructions.slice(1)];else i=[Object.freeze(HO(e,n)),...r.instructions];return Object.freeze({...r,instructions:Object.freeze(i),lifetimeConstraint:Object.freeze({nonce:t})})}function gZe(t,e){if("feePayer"in e&&t===e.feePayer?.address&&yZe(e.feePayer))return e;const n={...e,feePayer:Object.freeze({address:t})};return Object.freeze(n),n}function yZe(t){return!!t&&"address"in t&&typeof t.address=="string"&&Object.keys(t).length===1}function mZe(t,e){return vZe([t],e)}function vZe(t,e){return Object.freeze({...e,instructions:Object.freeze([...e.instructions,...t])})}function wZe(t){const{header:e}=t,n=e.numSignerAccounts-e.numReadonlySignerAccounts,r=t.staticAccounts.length-e.numSignerAccounts-e.numReadonlyNonSignerAccounts,i=[];let a=0;for(let s=0;s<n;s++)i.push({address:t.staticAccounts[a],role:Wn.WRITABLE_SIGNER}),a++;for(let s=0;s<e.numReadonlySignerAccounts;s++)i.push({address:t.staticAccounts[a],role:Wn.READONLY_SIGNER}),a++;for(let s=0;s<r;s++)i.push({address:t.staticAccounts[a],role:Wn.WRITABLE}),a++;for(let s=0;s<e.numReadonlyNonSignerAccounts;s++)i.push({address:t.staticAccounts[a],role:Wn.READONLY}),a++;return i}function bZe(t,e){const r=t.map(s=>s.lookupTableAddress).filter(s=>e[s]===void 0);if(r.length>0)throw new Ge(nqe,{lookupTableAddresses:r});const i=[],a=[];for(const s of t){const o=e[s.lookupTableAddress],c=s.readonlyIndexes,l=s.writableIndexes,u=Math.max(...c,...l);if(u>=o.length)throw new Ge(rqe,{highestKnownIndex:o.length-1,highestRequestedIndex:u,lookupTableAddress:s.lookupTableAddress});const d=c.map(h=>({address:o[h],addressIndex:h,lookupTableAddress:s.lookupTableAddress,role:Wn.READONLY}));i.push(...d);const f=l.map(h=>({address:o[h],addressIndex:h,lookupTableAddress:s.lookupTableAddress,role:Wn.WRITABLE}));a.push(...f)}return[...a,...i]}function _Ze(t,e){const n=e[t.programAddressIndex]?.address;if(!n)throw new Ge(iqe,{index:t.programAddressIndex});const r=t.accountIndices?.map(a=>e[a]),{data:i}=t;return Object.freeze({programAddress:n,...r&&r.length?{accounts:Object.freeze(r)}:{},...i&&i.length?{data:i}:{}})}function CZe(t,e,n){if(!e||!wA(e))return{blockhash:t,lastValidBlockHeight:2n**64n-1n};{const r=e.accounts[0].address;Wb(r);const i=e.accounts[2].address;return Wb(i),{nonce:t,nonceAccountAddress:r,nonceAuthorityAddress:i}}}function Kot(t,e){const n=t.staticAccounts[0];if(!n)throw new Ge(aqe);const r=wZe(t),i="addressTableLookups"in t&&t.addressTableLookups!==void 0&&t.addressTableLookups.length>0?bZe(t.addressTableLookups,{}):[],a=[...r,...i],s=t.instructions.map(l=>_Ze(l,a)),o=s[0],c=CZe(t.lifetimeToken,o);return Wu(dZe({version:t.version}),l=>gZe(n,l),l=>s.reduce((u,d)=>mZe(d,u),l),l=>"blockhash"in c?Dze(c,l):pZe(c,l))}var Jv=Object.freeze({name:"Ed25519"});function EZe(t){return new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32,...t])}async function Zb(t,e=!1){const n=t.byteLength;if(n!==32)throw new Ge(YWe,{actualLength:n});const r=EZe(t);return await crypto.subtle.importKey("pkcs8",r,Jv,e,["sign"])}async function SZe(t,e=!1){if(xG(),t.extractable===!1)throw new Ge(ZWe,{key:t});const n=await crypto.subtle.exportKey("jwk",t);return await crypto.subtle.importKey("jwk",{crv:"Ed25519",ext:e,key_ops:["verify"],kty:"OKP",x:n.x},"Ed25519",e,["verify"])}async function bA(t,e){sze();const n=await crypto.subtle.sign(Jv,t,am(e));return new Uint8Array(n)}async function AZe(t,e,n){return oze(),await crypto.subtle.verify(Jv,t,am(e),am(n))}async function xZe(t,e=!1){if(ize(),t.byteLength!==64)throw new Ge(GWe,{byteLength:t.byteLength});const[n,r]=await Promise.all([crypto.subtle.importKey("raw",t.slice(32),Jv,!0,["verify"]),Zb(t.slice(0,32),e)]),i=new Uint8Array(32);crypto.getRandomValues(i);const a=await bA(r,i);if(!await AZe(n,a,i))throw new Ge(JWe);return{privateKey:r,publicKey:n}}async function IZe(t,e=!1){const n=Zb(t,e),[r,i]=await Promise.all([(e?n:Zb(t,!0)).then(async a=>await SZe(a,!0)),n]);return{privateKey:i,publicKey:r}}function TZe(t){const e=Object.values(t);if(e.length===0)throw new Ge(oqe);return e.map(n=>n||new Uint8Array(64).fill(0))}function LZe(){return rf($2(fA(vA(),64),{size:Lu()}),TZe)}function kZe(){return ml([["signatures",LZe()],["messageBytes",vA()]])}function $Ze(){return pA(D0([["signatures",ku(hA(qb(),64),{size:sl()})],["messageBytes",qb()]]),PZe)}function PZe(t){const{messageBytes:e,signatures:n}=t,r=Tze([RG(),Gqe(Vp(),2),ku(M0(),{size:sl()})]),[i,a,s]=r.decode(e),o=s.slice(0,a);if(o.length!==n.length)throw new Ge(cqe,{numRequiredSignatures:a,signaturesLength:n.length,signerAddresses:o});const c={};return o.forEach((l,u)=>{const d=n[u];d.every(f=>f===0)?c[l]=null:c[l]=d}),{messageBytes:e,signatures:Object.freeze(c)}}function Got(t){const e=uZe(t),n=eZe().encode(e),r=e.staticAccounts.slice(0,e.header.numSignerAccounts),i={};for(const s of r)i[s]=null;let a;return Nze(t)?a={blockhash:t.lifetimeConstraint.blockhash,lastValidBlockHeight:t.lifetimeConstraint.lastValidBlockHeight}:DG(t)&&(a={nonce:t.lifetimeConstraint.nonce,nonceAccountAddress:t.instructions[0].accounts[0].address}),Object.freeze({...a?{lifetimeConstraint:a}:void 0,messageBytes:n,signatures:Object.freeze(i)})}async function RZe(t,e){let n,r;if(await Promise.all(t.map(async i=>{const a=await IG(i.publicKey),s=e.signatures[a];if(s===void 0){r||=new Set,r.add(a);return}if(r)return;const o=await bA(i.privateKey,e.messageBytes);s!==null&&jqe(o,s)||(n||={},n[a]=o)})),r&&r.size>0){const i=Object.keys(e.signatures);throw new Ge(sqe,{expectedAddresses:i,unexpectedAddresses:[...r]})}return n?Object.freeze({...e,signatures:Object.freeze({...e.signatures,...n})}):e}function OZe(t){const e=kZe().encode(t);return rze().decode(e)}function WO(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function MZe(t){const e=new Set,n={deferreds:e,settled:!1};return Promise.resolve(t).then(r=>{for(const{resolve:i}of e)i(r);e.clear(),n.settled=!0},r=>{for(const{reject:i}of e)i(r);e.clear(),n.settled=!0}),n}var s7=new WeakMap;async function NZe(t){let e;return await new Promise((r,i)=>{e={reject:i,resolve:r};for(const a of t){if(!WO(a)){Promise.resolve(a).then(r,i);continue}let s=s7.get(a);s===void 0?(s=MZe(a),s.deferreds.add(e),s7.set(a,s)):s.settled?Promise.resolve(a).then(r,i):s.deferreds.add(e)}}).finally(()=>{for(const r of t)WO(r)&&s7.get(r).deferreds.delete(e)})}function FG(t){return JSON.parse(DZe(t),(e,n)=>BZe(n)?jZe(n):n)}function DZe(t){const e=[];let n=!1;for(let r=0;r<t.length;r++){let i=!1;if(t[r]==="\\"&&(e.push(t[r++]),i=!i),t[r]==='"'){e.push(t[r]),i||(n=!n);continue}if(!n){const a=FZe(t,r);
313if(a?.length){r+=a.length-1,a.match(/\.|[eE]-/)?e.push(a):e.push(UZe(a));continue}}e.push(t[r])}return e.join("")}function FZe(t,e){const n=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/;if(!t[e]?.match(/[-\d]/))return null;const r=t.slice(e).match(n);return r?r[0]:null}function UZe(t){return`{"$n":"${t}"}`}function jZe({$n:t}){if(t.match(/[eE]/)){const[e,n]=t.split(/[eE]/);return BigInt(e)*BigInt(10)**BigInt(n)}return BigInt(t)}function BZe(t){return!!t&&typeof t=="object"&&"$n"in t&&typeof t.$n=="string"}var qO=0n;function VZe(){const t=qO;return qO++,t.toString()}function Kb(t){return{id:VZe(),jsonrpc:"2.0",method:t.methodName,params:t.params}}function UG(t,e){return WZe(JSON.stringify(t,(n,r)=>typeof r=="bigint"?HZe(r):r,e))}function HZe(t){return{$n:`${t}`}}function WZe(t){return t.replace(/\{\s*"\$n"\s*:\s*"(-?\d+)"\s*\}/g,"$1")}function qZe(t){return zZe(t)}function zZe(t){return new Proxy(t.api,{defineProperty(){return!1},deleteProperty(){return!1},get(e,n,r){if(n!=="then")return function(...i){const a=n.toString(),s=Reflect.get(e,a,r);if(!s)throw new Ge(Sqe,{method:a,params:i});const o=s(...i);return ZZe(t,o)}}})}function ZZe({transport:t},e){return{async send(n){return await e.execute({signal:n?.abortSignal,transport:t})}}}function KZe(t){return new Proxy({},{defineProperty(){return!1},deleteProperty(){return!1},get(...e){const[n,r]=e,i=r.toString();return function(...a){const s=Object.freeze({methodName:i,params:a}),o=t?.requestTransformer?t?.requestTransformer(s):s;return Object.freeze({execute:async({signal:c,transport:l})=>{const u=Kb(o),d=await l({payload:u,signal:c});return t?.responseTransformer?t.responseTransformer(d,o):d}})}}})}function jG(t){return t==null||typeof t!="object"||Array.isArray(t)?!1:"jsonrpc"in t&&t.jsonrpc==="2.0"&&"method"in t&&typeof t.method=="string"&&"params"in t}function GZe(t){return typeof t=="bigint"?Number(t):t}var Te={};function BG(t){return function e(n,r){if(Array.isArray(n))return n.map((i,a)=>{const s={...r,keyPath:[...r.keyPath,a]};return e(i,s)});if(typeof n=="object"&&n!==null){const i={};for(const a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;const s={...r,keyPath:[...r.keyPath,a]};i[a]=e(n[a],s)}return i}else return t.reduce((i,a)=>a(i,r),n)}}function VG(t,e){return n=>{const r=BG(t);return Object.freeze({...n,params:r(n.params,e)})}}function HG(t,e){return n=>BG(t)(n,e)}function YZe(){return VG([GZe],{keyPath:[]})}function JZe({commitmentPropertyName:t,params:e,optionsObjectPositionInParams:n,overrideCommitment:r}){const i=e[n];if(i===void 0||i&&typeof i=="object"&&!Array.isArray(i)){if(i&&t in i){if(!i[t]||i[t]==="finalized"){const a=[...e],{[t]:s,...o}=i;return Object.keys(o).length>0?a[n]=o:n===a.length-1?a.length--:a[n]=void 0,a}}else if(r!=="finalized"){const a=[...e];return a[n]={...i,[t]:r},a}}return e}function XZe({defaultCommitment:t,optionsObjectPositionByMethod:e}){return n=>{const{params:r,methodName:i}=n;if(!Array.isArray(r))return n;const a=e[i];return a==null?n:Object.freeze({methodName:i,params:JZe({commitmentPropertyName:i==="sendTransaction"?"preflightCommitment":"commitment",optionsObjectPositionInParams:a,overrideCommitment:t,params:r})})}}function QZe(t){return(e,{keyPath:n})=>(typeof e=="bigint"&&t&&(e>Number.MAX_SAFE_INTEGER||e<-Number.MAX_SAFE_INTEGER)&&t(n,e),e)}function eKe(t){return e=>VG([QZe((...r)=>t(e,...r))],{keyPath:[]})(e)}var tKe={accountNotifications:1,blockNotifications:1,getAccountInfo:1,getBalance:1,getBlock:1,getBlockHeight:0,getBlockProduction:0,getBlocks:2,getBlocksWithLimit:2,getEpochInfo:0,getFeeForMessage:1,getInflationGovernor:0,getInflationReward:1,getLargestAccounts:0,getLatestBlockhash:0,getLeaderSchedule:1,getMinimumBalanceForRentExemption:1,getMultipleAccounts:1,getProgramAccounts:1,getSignaturesForAddress:1,getSlot:0,getSlotLeader:0,getStakeMinimumDelegation:0,getSupply:0,getTokenAccountBalance:1,getTokenAccountsByDelegate:2,getTokenAccountsByOwner:2,getTokenLargestAccounts:1,getTokenSupply:1,getTransaction:1,getTransactionCount:0,getVoteAccounts:0,isBlockhashValid:1,logsNotifications:1,programNotifications:1,requestAirdrop:2,sendTransaction:1,signatureNotifications:1,simulateTransaction:1};function WG(t){const e=t?.onIntegerOverflow;return n=>Wu(n,e?eKe(e):r=>r,YZe(),XZe({defaultCommitment:t?.defaultCommitment,optionsObjectPositionByMethod:tKe}))}function qG(t){return function(n,{keyPath:r}){return typeof n=="number"&&Number.isInteger(n)||typeof n=="bigint"?nKe(r,t)?Number(n):BigInt(n):n}}function nKe(t,e){return e.some(n=>{if(n.length!==t.length)return!1;for(let r=t.length-1;r>=0;r--){const i=t[r],a=n[r];if(a!==i&&(a!==Te||typeof i!="number"))return!1}return!0})}function zG(t){return HG([qG(t)],{keyPath:[]})}function rKe(){return t=>t.result}var Gb=[["data","parsed","info","tokenAmount","decimals"],["data","parsed","info","tokenAmount","uiAmount"],["data","parsed","info","rentExemptReserve","decimals"],["data","parsed","info","rentExemptReserve","uiAmount"],["data","parsed","info","delegatedAmount","decimals"],["data","parsed","info","delegatedAmount","uiAmount"],["data","parsed","info","extensions",Te,"state","olderTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",Te,"state","newerTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",Te,"state","preUpdateAverageRate"],["data","parsed","info","extensions",Te,"state","currentRate"]],ru=[...Gb,["data","parsed","info","lastExtendedSlotStartIndex"],["data","parsed","info","slashPenalty"],["data","parsed","info","warmupCooldownRate"],["data","parsed","info","decimals"],["data","parsed","info","numRequiredSigners"],["data","parsed","info","numValidSigners"],["data","parsed","info","stake","delegation","warmupCooldownRate"],["data","parsed","info","exemptionThreshold"],["data","parsed","info","burnPercent"],["data","parsed","info","commission"],["data","parsed","info","votes",Te,"confirmationCount"]],ug=[["index"],["
313instructions",Te,"accounts",Te],["instructions",Te,"programIdIndex"],["instructions",Te,"stackHeight"]],zO=[["addressTableLookups",Te,"writableIndexes",Te],["addressTableLookups",Te,"readonlyIndexes",Te],["header","numReadonlySignedAccounts"],["header","numReadonlyUnsignedAccounts"],["header","numRequiredSignatures"],["instructions",Te,"accounts",Te],["instructions",Te,"programIdIndex"],["instructions",Te,"stackHeight"]];function iKe(){return[["loadedAccountsDataSize"],...ru.map(t=>["accounts",Te,...t]),...ug.map(t=>["innerInstructions",Te,...t])]}function aKe(){return(t,e)=>{const n=t;if("error"in n){const{error:r}=n;if(r&&typeof r=="object"&&"code"in r&&(r.code===-32002||r.code===-32002n)&&"data"in r&&r.data){const s=HG([qG(iKe())],{keyPath:[]})(r.data,e),o={...r,data:s};throw im(o)}throw im(n.error)}return n}}function sKe(t){return(e,n)=>{const r=n.methodName,i=t?.allowedNumericKeyPaths&&r?t.allowedNumericKeyPaths[r]:void 0;return Wu(e,a=>aKe()(a,n),a=>rKe()(a,n),a=>zG(i??[])(a,n))}}function oKe(t){return(e,n)=>{const r=n.methodName,i=t?.allowedNumericKeyPaths&&r?t.allowedNumericKeyPaths[r]:void 0;return Wu(e,a=>zG(i??[])(a,n))}}function cKe(t){return KZe({requestTransformer:WG(t),responseTransformer:sKe({allowedNumericKeyPaths:lKe()})})}var o7;function lKe(){return o7||(o7={getAccountInfo:ru.map(t=>["value",...t]),getBlock:[["transactions",Te,"meta","preTokenBalances",Te,"accountIndex"],["transactions",Te,"meta","preTokenBalances",Te,"uiTokenAmount","decimals"],["transactions",Te,"meta","postTokenBalances",Te,"accountIndex"],["transactions",Te,"meta","postTokenBalances",Te,"uiTokenAmount","decimals"],["transactions",Te,"meta","rewards",Te,"commission"],...ug.map(t=>["transactions",Te,"meta","innerInstructions",Te,...t]),...zO.map(t=>["transactions",Te,"transaction","message",...t]),["rewards",Te,"commission"]],getClusterNodes:[[Te,"featureSet"],[Te,"shredVersion"]],getInflationGovernor:[["initial"],["foundation"],["foundationTerm"],["taper"],["terminal"]],getInflationRate:[["foundation"],["total"],["validator"]],getInflationReward:[[Te,"commission"]],getMultipleAccounts:ru.map(t=>["value",Te,...t]),getProgramAccounts:ru.flatMap(t=>[["value",Te,"account",...t],[Te,"account",...t]]),getRecentPerformanceSamples:[[Te,"samplePeriodSecs"]],getTokenAccountBalance:[["value","decimals"],["value","uiAmount"]],getTokenAccountsByDelegate:Gb.map(t=>["value",Te,"account",...t]),getTokenAccountsByOwner:Gb.map(t=>["value",Te,"account",...t]),getTokenLargestAccounts:[["value",Te,"decimals"],["value",Te,"uiAmount"]],getTokenSupply:[["value","decimals"],["value","uiAmount"]],getTransaction:[["meta","preTokenBalances",Te,"accountIndex"],["meta","preTokenBalances",Te,"uiTokenAmount","decimals"],["meta","postTokenBalances",Te,"accountIndex"],["meta","postTokenBalances",Te,"uiTokenAmount","decimals"],["meta","rewards",Te,"commission"],...ug.map(t=>["meta","innerInstructions",Te,...t]),...zO.map(t=>["transaction","message",...t])],getVersion:[["feature-set"]],getVoteAccounts:[["current",Te,"commission"],["delinquent",Te,"commission"]],simulateTransaction:[["value","loadedAccountsDataSize"],...ru.map(t=>["value","accounts",Te,...t]),...ug.map(t=>["value","innerInstructions",Te,...t])]}),o7}function uKe(t){const e={};for(const n in t)e[n.toLowerCase()]=t[n];return e}function dKe(t){const{fromJson:e,headers:n,toJson:r,url:i}=t;let a;const s=n&&uKe(n);return async function({payload:c,signal:l}){const u=r?r(c):JSON.stringify(c),d={...a,body:u,headers:{...s,accept:"application/json","content-length":u.length.toString(),"content-type":"application/json; charset=utf-8"},method:"POST",signal:l},f=await fetch(i,d);if(!f.ok)throw new Ge(Eqe,{headers:f.headers,message:f.statusText,statusCode:f.status});return e?e(await f.text(),c):await f.json()}}var fKe=["getAccountInfo","getBalance","getBlock","getBlockCommitment","getBlockHeight","getBlockProduction","getBlocks","getBlocksWithLimit","getBlockTime","getClusterNodes","getEpochInfo","getEpochSchedule","getFeeForMessage","getFirstAvailableBlock","getGenesisHash","getHealth","getHighestSnapshotSlot","getIdentity","getInflationGovernor","getInflationRate","getInflationReward","getLargestAccounts","getLatestBlockhash","getLeaderSchedule","getMaxRetransmitSlot","getMaxShredInsertSlot","getMinimumBalanceForRentExemption","getMultipleAccounts","getProgramAccounts","getRecentPerformanceSamples","getRecentPrioritizationFees","getSignaturesForAddress","getSignatureStatuses","getSlot","getSlotLeader","getSlotLeaders","getStakeMinimumDelegation","getSupply","getTokenAccountBalance","getTokenAccountsByDelegate","getTokenAccountsByOwner","getTokenLargestAccounts","getTokenSupply","getTransaction","getTransactionCount","getVersion","getVoteAccounts","index","isBlockhashValid","minimumLedgerSlot","requestAirdrop","sendTransaction","simulateTransaction"];function ZO(t){return jG(t)&&fKe.includes(t.method)}function hKe(t){return dKe({...t,fromJson:(e,n)=>ZO(n)?FG(e):JSON.parse(e),toJson:e=>ZO(e)?UG(e):JSON.stringify(e)})}var pKe=Object.prototype.toString,gKe=Object.keys||function(t){const e=[];for(const n in t)e.push(n);return e};function mh(t,e){let n,r,i,a,s,o,c;if(t===!0)return"true";if(t===!1)return"false";switch(typeof t){case"object":if(t===null)return null;if("toJSON"in t&&typeof t.toJSON=="function")return mh(t.toJSON(),e);if(c=pKe.call(t),c==="[object Array]"){for(i="[",r=t.length-1,n=0;n<r;n++)i+=mh(t[n],!0)+",";return r>-1&&(i+=mh(t[n],!0)),i+"]"}else if(c==="[object Object]"){for(a=gKe(t).sort(),r=a.length,i="",n=0;n<r;)s=a[n],o=mh(t[s],!1),o!==void 0&&(i&&(i+=","),i+=JSON.stringify(s)+":"+o),n++;return"{"+i+"}"}else return JSON.stringify(t);case"function":case"undefined":return e?null:void 0;case"bigint":return`${t.toString()}n`;case"string":return JSON.stringify(t);default:return isFinite(t)?t:null}}function ZG(t){const e=mh(t,!1);if(e!==void 0)return""+e}function KG(t,e,n){let r="";if(typeof e[0]=="number"){const s=e[0]+1,o=s%10,c=s%100;o==1&&c!=11?r=s+"st":o==2&&c!=12?r=s+"nd":o==3&&c!=13?r=s+"rd":r=s+"th"}else r=`\`${e[0].toString()}\``;const i=e.length>1?e.slice(1).map(s=>typeof s=="number"?`[${s}]`:s).join("."):void 0,a=new Ge(wG,{argumentLabel:r,keyPath:e,methodName:t,optionalPathLabel:i?` at path \`${i}\``:"",value:n,...i!==void 0?{path:i}:void 0});return Gv(a,KG),a}var yKe={defaultCommitment:"confirmed",onIntegerOverflow(t,e,n){throw KG(t.methodName,e,n)}}
313,mKe=globalThis.AbortController,KO;function GO(){return{}}function vKe(t,e){let n;return async function(i){const{payload:a,signal:s}=i,o=e(a);if(o===void 0)return await t(i);if(n||(queueMicrotask(()=>{n=void 0}),n={}),n[o]==null){const l=new mKe,u=(async()=>{try{return await t({...i,signal:l.signal})}catch(d){if(d===(KO||=GO()))return;throw d}})();n[o]={abortController:l,numConsumers:0,responsePromise:u}}const c=n[o];if(c.numConsumers++,s){const l=c.responsePromise;return await new Promise((u,d)=>{const f=h=>{s.removeEventListener("abort",f),c.numConsumers-=1,queueMicrotask(()=>{c.numConsumers===0&&c.abortController.abort(KO||=GO())}),d(h.target.reason)};s.addEventListener("abort",f),l.then(u).catch(d).finally(()=>{s.removeEventListener("abort",f)})})}else return await c.responsePromise}}function wKe(t){return jG(t)?ZG([t.method,t.params]):void 0}function bKe(t){const e={};for(const n in t)e[n.toLowerCase()]=t[n];return e}function _Ke(t){return Wu(hKe({...t,headers:{...t.headers?bKe(t.headers):void 0,"solana-client":"js/5.5.1"}}),e=>vKe(e,wKe))}function GG(t,e){return CKe(_Ke({url:t,...e}))}function CKe(t){return qZe({api:cKe(yKe),transport:t})}var EKe=globalThis.AbortController,SKe=globalThis.EventTarget,YO;function JO(){return Symbol(void 0)}var c7=Symbol();function AKe({abortSignal:t,dataChannelName:e,dataPublisher:n,errorChannelName:r}){const i=new Map;function a(l){for(const[u,d]of i.entries())d.__hasPolled?(i.delete(u),d.onError(l)):d.publishQueue.push({__type:1,err:l})}const s=new EKe;t.addEventListener("abort",()=>{s.abort(),a(YO||=JO())});const o={signal:s.signal};let c=c7;return n.on(r,l=>{c===c7&&(c=l,s.abort(),a(l))},o),n.on(e,l=>{i.forEach((u,d)=>{if(u.__hasPolled){const{onData:f}=u;i.set(d,{__hasPolled:!1,publishQueue:[]}),f(l)}else u.publishQueue.push({__type:0,data:l})})},o),{async*[Symbol.asyncIterator](){if(t.aborted)return;if(c!==c7)throw c;const l=Symbol();i.set(l,{__hasPolled:!1,publishQueue:[]});try{for(;;){const u=i.get(l);if(!u)throw new Ge(Lqe);if(u.__hasPolled)throw new Ge(kqe);const d=u.publishQueue;try{if(d.length){u.publishQueue=[];for(const f of d)if(f.__type===0)yield f.data;else throw f.err}else yield await new Promise((f,h)=>{i.set(l,{__hasPolled:!0,onData:f,onError:h})})}catch(f){if(f===(YO||=JO()))return;throw f}}}finally{i.delete(l)}}}}function YG(t){return{on(e,n,r){function i(a){if(a instanceof CustomEvent){const s=a.detail;n(s)}else n()}return t.addEventListener(e,i,r),()=>{t.removeEventListener(e,i)}}}}function xKe(t,e,n){let r;const i=new SKe,a=YG(i);return{...a,on(s,o,c){r||(r={dispose:t.on(e,h=>{const p=n(h);if(!p)return;const[g,y]=p;i.dispatchEvent(new CustomEvent(g,{detail:y}))}),numSubscribers:0}),r.numSubscribers++;const l=a.on(s,o,c);let u=!0;function d(){u&&(u=!1,c?.signal.removeEventListener("abort",d),r.numSubscribers--,r.numSubscribers===0&&(r.dispose(),r=void 0),l())}return c?.signal.addEventListener("abort",d),d}}}function IKe(t){return new Proxy(t.api,{defineProperty(){return!1},deleteProperty(){return!1},get(e,n,r){if(n!=="then")return function(...i){const a=n.toString(),s=Reflect.get(e,a,r);if(!s)throw new Ge(Aqe,{notificationName:a});const o=s(...i);return TKe(t.transport,o)}}})}function TKe(t,e){return{async subscribe({abortSignal:n}){const r=await t({signal:n,...e});return AKe({abortSignal:n,dataChannelName:"notification",dataPublisher:r,errorChannelName:"error"})}}}function LKe(t){return new Proxy({},{defineProperty(){return!1},deleteProperty(){return!1},get(...e){const[n,r]=e,i=r.toString();return function(...a){const s={methodName:i,params:a},o=t.requestTransformer?t.requestTransformer(s):s;return{execute(c){return t.planExecutor({...c,request:o})},request:o}}}})}function kKe(t,e){return Object.freeze({...t,on(n,r,i){return n!=="message"?t.on(n,r,i):t.on("message",a=>r(e(a)),i)}})}function $Ke(t,e){return Object.freeze({...t,send:n=>t.send(e(n))})}var PKe=globalThis.AbortController,Yb=new WeakMap;function RKe(t,e){return JG(-1,t,e)}function OKe(t,e){JG(1,t,e)}function MKe(t){let e=Yb.get(t);return e||Yb.set(t,e={}),e}function JG(t,e,n){if(n===void 0)return;const r=MKe(e);!r[n]&&t>0&&(r[n]=0);const i=t+r[n];return i<=0?delete r[n]:r[n]=i,i}var XO=new WeakMap;function NKe(t,e,n){let r=XO.get(t);r||XO.set(t,r=new WeakMap);const i=n??t;let a=r.get(i);return a||r.set(i,a=xKe(t,"message",s=>{const o=s;if(!("method"in o))return;const c=n?n(o.params.result,e):o.params.result;return[`notification:${o.params.subscription}`,c]})),a}async function DKe({channel:t,responseTransformer:e,signal:n,subscribeRequest:r,unsubscribeMethodName:i}){let a;t.on("error",()=>{a=void 0,Yb.delete(t)},{signal:n});const s=new Promise((d,f)=>{function h(){if(RKe(t,a)===0){const p=Kb({methodName:i,params:[a]});a=void 0,t.send(p).catch(()=>{})}f(this.reason)}n.aborted?h.call(n):n.addEventListener("abort",h)}),o=Kb(r);await t.send(o);const c=new Promise((d,f)=>{const h=new PKe;n.addEventListener("abort",h.abort.bind(h));const p={signal:h.signal};t.on("error",g=>{h.abort(),f(g)},p),t.on("message",g=>{g&&typeof g=="object"&&"id"in g&&g.id===o.id&&(h.abort(),"error"in g?f(im(g.error)):d(g.result))},p)});if(a=await NZe([s,c]),a==null)throw new Ge(xqe);OKe(t,a);const l=NKe(t,r,e),u=`notification:${a}`;return{on(d,f,h){switch(d){case"notification":return l.on(u,f,h);case"error":return t.on("error",f,h);default:throw new Ge($qe,{channelName:d,supportedChannelNames:["notification","error"]})}}}}function FKe(t){const e=WG(t),n=oKe({allowedNumericKeyPaths:jKe()});return LKe({planExecutor({request:r,...i}){return DKe({...i,responseTransformer:n,subscribeRequest:{...r,methodName:r.methodName.replace(/Notifications$/,"Subscribe")},unsubscribeMethodName:r.methodName.replace(/Notifications$/,"Unsubscribe")})},requestTransformer:e})}function UKe(t){return FKe(t)}var l7;function jKe(){return l7||(l7={accountNotifications:ru.map(t=>["value",...t]),blockNotifications:[["value","block","transactions",Te,"meta","preTokenBalances",Te,"accountIndex"],["value","block","transactions",Te,"meta","preTokenBalances",Te,"uiTokenAmount","decimals"],["value","block","transactions",Te,"meta","postTokenBalances",Te,"accountIndex"],["value","block","transactions",Te,"meta","postTokenBalances",Te,"uiTokenAmount","decimals"],["value","block","transactions",Te,"meta","rewards",Te,"commission"],["value","block","transactions",Te,"meta","innerInstructions",Te,"index"],["value","block","transactions",Te,"meta","innerInstructions",Te,"instructions",Te,"programIdIndex"],["value","block","transactions",Te,"meta","innerInstructions",Te,"instructions",Te,"accounts",Te],["value","block","transactions",Te,"transaction","message","addressTableLookups",Te,"writableIndexes",Te],["value","block","transactions",Te,"transaction","message","addressTableLookups",Te,"readonlyIndexes",Te],["value","block","transactions",Te,"transaction","message","instructions",Te,"programIdIndex"],["value","block","transactions",Te,"transaction","message","instructions",Te,"accounts",Te],["value","block","transactions",Te,"transaction","message","header","numReadonlySignedAccounts"],["value","block","transactions",Te,"transaction","message","header","numReadonlyUnsignedAccounts"],["value","block","transactions",Te,"transaction","message","header","numRequiredSignatures"],["value","block","rewards",Te,"commission"]],programNotifications:ru.flatMap(t=>[["value",Te,"account",...t],[Te,"account",...t]])}),l7}var BKe=globalThis.EventTarget,eh=globalThis.WebSocket,QO=1e3;function VKe({sendBufferHighWatermark:t,signal:e,url:n}){if(e.aborted)return Promise.reject(e.reason);let r,i=!1;const a=new Set;function s(){a.forEach(v=>{v()}),a.clear()}function o(){s(),i||g(e.reason),p.readyState!==eh.CLOSED&&p.readyState!==eh.CLOSING&&p.close(QO)}function c(v){s(),r?.onCancel(),e.removeEventListener("abort",o),p.removeEventListener("close",c),p.removeEventListener("error",l),p.removeEventListener("message",u),p.removeEventListener("open",h),!e.aborted&&!(v.wasClean&&v.code===QO)&&d.dispatchEvent(new CustomEvent("error",{detail:new Ge(Hb,{cause:v})}))}function l(v){if(!e.aborted&&!i){const b=new Ge(Tqe,{errorEvent:v});g(b),d.dispatchEvent(new CustomEvent("error",{detail:b}))}}function u(v){e.aborted||d.dispatchEvent(new CustomEvent("message",{detail:v.data}))}const d=new BKe,f=YG(d);function h(){i=!0,y({...f,async send(v){if(p.readyState!==eh.OPEN)throw new Ge(Hb);if(!r&&p.bufferedAmount>t){let b;const w=new Promise((_,E)=>{const C=setInterval(()=>{(p.readyState!==eh.OPEN||!(p.bufferedAmount>t))&&(clearInterval(C),r=void 0,_())},16);b=()=>{r=void 0,clearInterval(C),E(new Ge(Iqe))}});r={onCancel:b,promise:w}}if(r){if(ArrayBuffer.isView(v)&&!(v instanceof DataView)){const b=v.constructor;v=new b(v)}await r.promise}p.send(v)}})}const p=new eh(n);e.addEventListener("abort",o),p.addEventListener("close",c),p.addEventListener("error",l),p.addEventListener("message",u),p.addEventListener("open",h);let g,y;return new Promise((v,b)=>{g=b,y=v})}
313function XG(t,e,n){let r="";if(typeof e[0]=="number"){const s=e[0]+1,o=s%10,c=s%100;o==1&&c!=11?r=s+"st":o==2&&c!=12?r=s+"nd":o==3&&c!=13?r=s+"rd":r=s+"th"}else r=`\`${e[0].toString()}\``;const i=e.length>1?e.slice(1).map(s=>typeof s=="number"?`[${s}]`:s).join("."):void 0,a=new Ge(wG,{argumentLabel:r,keyPath:e,methodName:t,optionalPathLabel:i?` at path \`${i}\``:"",value:n,...i!==void 0?{path:i}:void 0});return Gv(a,XG),a}var HKe={defaultCommitment:"confirmed",onIntegerOverflow(t,e,n){throw XG(t.methodName,e,n)}},_A=globalThis.AbortController,WKe={jsonrpc:"2.0",method:"ping"};function qKe({abortSignal:t,channel:e,intervalMs:n}){let r;function i(){e.send(WKe).catch(o=>{_G(o,Hb)&&s.abort()})}function a(){clearInterval(r),r=setInterval(i,n)}const s=new _A;return s.signal.addEventListener("abort",()=>{clearInterval(r)}),t.addEventListener("abort",()=>{s.abort()}),e.on("error",()=>{s.abort()},{signal:s.signal}),e.on("message",a,{signal:s.signal}),globalThis.navigator.onLine&&a(),globalThis.addEventListener("offline",function(){clearInterval(r)},{signal:s.signal}),globalThis.addEventListener("online",function(){i(),a()},{signal:s.signal}),{...e,send(...o){return s.signal.aborted||a(),e.send(...o)}}}function zKe(){return{entries:[],freeChannelIndex:-1}}function ZKe(t,{maxSubscriptionsPerChannel:e,minChannels:n}){const r=zKe();function i(){if(r.entries.length<n){r.freeChannelIndex=-1;return}let a;for(let s=0;s<r.entries.length;s++){const o=(r.freeChannelIndex+s+2)%r.entries.length,c=r.entries[o];c.subscriptionCount<e&&(!a||a.subscriptionCount>=c.subscriptionCount)&&(a={poolIndex:o,subscriptionCount:c.subscriptionCount})}r.freeChannelIndex=a?.poolIndex??-1}return function({abortSignal:s}){let o;function c(){const l=r.entries.findIndex(u=>u===o);r.entries.splice(l,1),o.dispose(),i()}if(r.freeChannelIndex===-1){const l=new _A,u=t({abortSignal:l.signal});u.then(d=>{d.on("error",c,{signal:l.signal})}).catch(c),o={channel:u,dispose(){l.abort()},subscriptionCount:0},r.entries.push(o)}else o=r.entries[r.freeChannelIndex];return o.subscriptionCount++,s.addEventListener("abort",function(){o.subscriptionCount--,o.subscriptionCount===0?c():r.freeChannelIndex!==-1&&(r.freeChannelIndex--,i())}),i(),o.channel}}function KKe(t){return Wu(t,e=>kKe(e,FG),e=>$Ke(e,UG))}function GKe(t){return YKe({...t,jsonSerializer:KKe})}function YKe(t){if(/^wss?:/i.test(t.url)===!1){const i=t.url.match(/^([^:]+):/);throw new DOMException(i?`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${i[1]}:' is not allowed.`:`Failed to construct 'WebSocket': The URL '${t.url}' is invalid.`)}const{intervalMs:e,...n}=t;return ZKe(({abortSignal:i})=>VKe({...n,sendBufferHighWatermark:t.sendBufferHighWatermark??131072,signal:i}).then(t.jsonSerializer).then(a=>qKe({abortSignal:i,channel:a,intervalMs:e??5e3})),{maxSubscriptionsPerChannel:t.maxSubscriptionsPerChannel??100,minChannels:t.minChannels??1})}function JKe(t){const e=new Map;return function(r){const{request:i,signal:a}=r,s=ZG([i.methodName,i.params]);let o=e.get(s);if(!o){const c=new _A,l=t({...r,signal:c.signal});l.then(u=>{u.on("error",()=>{e.delete(s),c.abort()},{signal:c.signal})}).catch(()=>{}),e.set(s,o={abortController:c,dataPublisherPromise:l,numSubscribers:0})}return o.numSubscribers++,a.addEventListener("abort",()=>{o.numSubscribers--,o.numSubscribers===0&&queueMicrotask(()=>{o.numSubscribers===0&&(e.delete(s),o.abortController.abort())})},{signal:o.abortController.signal}),o.dataPublisherPromise}}function XKe({createChannel:t}){return Wu(QKe(t),e=>JKe(e))}function QKe(t){return async({execute:e,signal:n})=>{const r=await t({abortSignal:n});return await e({channel:r,signal:n})}}function eGe(t,e){const n=XKe({createChannel:GKe({...e,url:t})});return tGe(n)}function eM(t,e){return eGe(t,e)}function tGe(t){return IKe({api:UKe(HKe),transport:t})}function QG(t){return"modifyAndSignTransactions"in t&&typeof t.modifyAndSignTransactions=="function"}function eY(t){return"signTransactions"in t&&typeof t.signTransactions=="function"}function nGe(t){return"signAndSendTransactions"in t&&typeof t.signAndSendTransactions=="function"}function tY(t){return eY(t)||QG(t)||nGe(t)}function Yot(t,e){Object.freeze(t);const n={...e,feePayer:t};return Object.freeze(n),n}async function nY(t){const e=await IG(t.publicKey);return Object.freeze({address:e,keyPair:t,signMessages:r=>Promise.all(r.map(async i=>Object.freeze({[e]:await bA(t.privateKey,i.content)}))),signTransactions:r=>Promise.all(r.map(async i=>{const a=await RZe([t],i);return Object.freeze({[e]:a.signatures[e]})}))})}async function rGe(t,e){return await nY(await xZe(t,e))}async function iGe(t,e){return await nY(await IZe(t,e))}var aGe="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",rY="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";function sGe(t){if(!t)throw new Error("Expected a Address.");return typeof t=="object"&&"address"in t?t.address:Array.isArray(t)?t[0]:t}function iY(t,e){return n=>{if(!n.value)return Object.freeze({address:t,role:Wn.READONLY});const r=n.isWritable?Wn.WRITABLE:Wn.READONLY;return Object.freeze({address:sGe(n.value),role:tM(n.value)?Oze(r):r,...tM(n.value)?{signer:n.value}:{}})}}function tM(t){return!!t&&typeof t=="object"&&"address"in t&&tY(t)}async function Jot(t,e={}){const{programAddress:n="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"}=e;return await _ze({programAddress:n,seeds:[Qd().encode(t.owner),Qd().encode(t.tokenProgram),Qd().encode(t.mint)]})}var oGe=1;function cGe(){return rf(ml([["discriminator",L2()]]),t=>({...t,discriminator:oGe}))}function Xot(t,e){const n=aGe,i={payer:{value:t.payer??null,isWritable:!0},ata:{value:t.ata??null,isWritable:!0},owner:{value:t.owner??null,isWritable:!1},mint:{value:t.mint??null,isWritable:!1},systemProgram:{value:t.systemProgram??null,isWritable:!1},tokenProgram:{value:t.tokenProgram??null,isWritable:!1}};i.tokenProgram.value||(i.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),i.systemProgram.value||(i.systemProgram.value="11111111111111111111111111111111");const a=iY(n);return Object.freeze({accounts:[a(i.payer),a(i.ata),a(i.owner),a(i.mint),a(i.systemProgram),a(i.tokenProgram)],data:cGe().encode({}),programAddress:n})}var lGe=3;function uGe(){return rf(ml([["discriminator",L2()],["amount",Sze()]]),t=>({...t,discriminator:lGe}))}function Qot(t,e){const n=rY,i={source:{value:t.source??null,isWritable:!0},destination:{value:t.destination??null,isWritable:!0},authority:{value:t.authority??null,isWritable:!1}},a={...t},s=(a.multiSigners??[]).map(c=>({address:c.address,role:Wn.READONLY_SIGNER,signer:c})),o=iY(n);return Object.freeze({accounts:[o(i.source),o(i.destination),o(i.authority),...s],data:uGe().encode(a),programAddress:n})}var dGe="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";LB([jt().transform(t=>
313t.replace(/[^0-9.-]+/g,"")),ma()]).pipe(ige.number().min(1e-4).max(999999999));var Xv=Ys(["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","solana-devnet","solana","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia"]),fGe=["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia"],hGe=new Map([["abstract",2741],["abstract-testnet",11124],["base-sepolia",84532],["base",8453],["avalanche-fuji",43113],["avalanche",43114],["iotex",4689],["sei",1329],["sei-testnet",1328],["polygon",137],["polygon-amoy",80002],["peaq",3338],["story",1514],["educhain",41923],["skale-base-sepolia",324705682]]),aY=["solana-devnet","solana"];Object.fromEntries([...fGe,...aY].map(t=>[hGe.get(t),t]));var pGe={id:324705682,name:"SKALE Base Sepolia",nativeCurrency:{name:"Credits",symbol:"CREDITS",decimals:18},rpcUrls:{default:{http:["https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia-testnet-explorer.skalenodes.com",apiUrl:"https://base-sepolia-testnet-explorer.skalenodes.com/api"}}};function CA(t){const e=SA(t);return ti({chain:e,transport:Ii()}).extend(T7)}function gGe(){return CA("base-sepolia")}function yGe(){return CA("avalanche-fuji")}function EA(t,e){const n=SA(t),r=Sm({chain:n,transport:Ii(),account:G7(e)});return sY(n)?r.extend(T7).extend(wQ()):r.extend(T7)}function mGe(t){return EA("base-sepolia",t)}function vGe(t){return EA("avalanche-fuji",t)}function wGe(t){return typeof t=="object"&&t!==null&&"chain"in t&&"transport"in t}function bGe(t){const e=t;return typeof t=="object"&&t!==null&&typeof e.address=="string"&&typeof e.type=="string"&&typeof e.sign=="function"&&typeof e.signMessage=="function"&&typeof e.signTypedData=="function"&&typeof e.signTransaction=="function"}function SA(t){if(!t)throw new Error("NETWORK environment variable is not set");switch(t){case"abstract":return np;case"abstract-testnet":return _g;case"base":return _Q;case"base-sepolia":return bQ;case"avalanche":return Oee;case"avalanche-fuji":return Mee;case"sei":return Vee;case"sei-testnet":return Hee;case"polygon":return jee;case"polygon-amoy":return Bee;case"peaq":return Uee;case"story":return Wee;case"educhain":return Nee;case"iotex":return Dee;case"iotex-testnet":return Fee;case"skale-base-sepolia":return pGe;default:throw new Error(`Unsupported network: ${t}`)}}var _Ge=new Set([2741,11124]);function sY(t){return _Ge.has(t.id)}var CGe="https://api.devnet.solana.com",EGe="https://api.mainnet-beta.solana.com",SGe="wss://api.devnet.solana.com",AGe="wss://api.mainnet-beta.solana.com";function oY(t){return GG(t||CGe)}function cY(t){return GG(t||EGe)}function lY(t,e){if(t==="solana-devnet")return oY(e);if(t==="solana")return cY(e);throw new Error("Invalid network")}function xGe(t,e){if(t==="solana-devnet")return eM(e?nM(e):SGe);if(t==="solana")return eM(e?nM(e):AGe);throw new Error("Invalid network")}function nM(t){return t.startsWith("http")?t.replace("http","ws"):t}function IGe(t){if(!aY.find(e=>e===t))throw new Error(`Unsupported SVM network: ${t}`);return lY(t)}async function TGe(t){const e=PD.decode(t);if(e.length===64)return await rGe(e);
313if(e.length===32)return await iGe(e);throw new Error(`Unexpected key length: ${e.length}. Expected 32 or 64 bytes.`)}function LGe(t){return typeof t=="object"&&t!==null&&tY(t)}var kGe={};uA(kGe,{authorizationPrimaryType:()=>PGe,authorizationTypes:()=>$Ge,config:()=>wWe,createClientAvalancheFuji:()=>yGe,createClientSepolia:()=>gGe,createConnectedClient:()=>CA,createSigner:()=>EA,createSignerAvalancheFuji:()=>vGe,createSignerSepolia:()=>mGe,getChainFromNetwork:()=>SA,isAccount:()=>bGe,isSignerWallet:()=>wGe,isZkStackChain:()=>sY,usdcABI:()=>bWe});var $Ge={TransferWithAuthorization:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"validAfter",type:"uint256"},{name:"validBefore",type:"uint256"},{name:"nonce",type:"bytes32"}]},PGe="TransferWithAuthorization",RGe={};uA(RGe,{SvmAddressRegex:()=>AA});var AA=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/,OGe=/^[A-Za-z0-9+/]*={0,2}$/,MGe=18,Jb=/^0x[0-9a-fA-F]{40}$/,xA=/^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$/,NGe=/^0x[0-9a-fA-F]{64}$/,DGe=/^0x[0-9a-fA-F]+$/,IA=["exact"],F0=[1],TA=["insufficient_funds","invalid_exact_evm_payload_authorization_valid_after","invalid_exact_evm_payload_authorization_valid_before","invalid_exact_evm_payload_authorization_value","invalid_exact_evm_payload_signature","invalid_exact_evm_payload_undeployed_smart_wallet","invalid_exact_evm_payload_recipient_mismatch","invalid_exact_svm_payload_transaction","invalid_exact_svm_payload_transaction_amount_mismatch","invalid_exact_svm_payload_transaction_create_ata_instruction","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset","invalid_exact_svm_payload_transaction_instructions","invalid_exact_svm_payload_transaction_instructions_length","invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high","invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked","invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked","invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts","invalid_exact_svm_payload_transaction_fee_payer_transferring_funds","invalid_exact_svm_payload_transaction_not_a_transfer_instruction","invalid_exact_svm_payload_transaction_receiver_ata_not_found","invalid_exact_svm_payload_transaction_sender_ata_not_found","invalid_exact_svm_payload_transaction_simulation_failed","invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata","invalid_network","invalid_payload","invalid_payment_requirements","invalid_scheme","invalid_payment","payment_expired","unsupported_scheme","invalid_x402_version","invalid_transaction_state","invalid_x402_version","settle_exact_svm_block_height_exceeded","settle_exact_svm_transaction_confirmation_timed_out","unsupported_scheme","unexpected_settle_error","unexpected_verify_error"],dg=t=>Number.isInteger(Number(t))&&Number(t)>=0,FGe=t=>e=>e.length<=t,LA=jt().regex(Jb).or(jt().regex(AA)),UGe=jt().regex(xA).or(jt().regex(AA)),U0=Xn({scheme:Ys(IA),network:Xv,maxAmountRequired:jt().refine(dg),resource:jt().url(),description:jt(),mimeType:jt(),outputSc
313hema:uu(v2()).optional(),payTo:LA,maxTimeoutSeconds:ma().int(),asset:UGe,extra:uu(v2()).optional()}),jGe=Xn({from:jt().regex(Jb),to:jt().regex(Jb),value:jt().refine(dg).refine(FGe(MGe)),validAfter:jt().refine(dg),validBefore:jt().refine(dg),nonce:jt().regex(NGe)}),BGe=Xn({signature:jt().regex(DGe),authorization:jGe}),VGe=Xn({transaction:jt().regex(OGe)}),uY=Xn({x402Version:ma().refine(t=>F0.includes(t)),scheme:Ys(IA),network:Xv,payload:LB([BGe,VGe])});Xn({x402Version:ma().refine(t=>F0.includes(t)),error:Ys(TA).optional(),accepts:Xm(U0).optional(),payer:jt().regex(xA).optional()});var HGe=Ys(["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD"]),WGe=Xn({type:nge("http"),method:HGe,queryParams:uu(jt(),jt()).optional(),bodyType:Ys(["json","form-data","multipart-form-data","text","binary"]).optional(),bodyFields:uu(jt(),v2()).optional(),headerFields:uu(jt(),v2()).optional()});tge("type",[WGe]);var qGe=Xn({resource:jt(),type:Ys(["http"]),x402Version:ma().refine(t=>F0.includes(t)),accepts:Xm(U0),lastUpdated:ege(),metadata:uu(v2()).optional()});Xn({paymentPayload:uY,paymentRequirements:U0});Xn({paymentPayload:uY,paymentRequirements:U0});Xn({isValid:TB(),invalidReason:Ys(TA).optional(),payer:LA.optional()});Xn({success:TB(),errorReason:Ys(TA).optional(),payer:LA.optional(),transaction:jt().regex(xA),network:Xv});Xn({type:jt().optional(),limit:ma().optional(),offset:ma().optional()});Xn({x402Version:ma().refine(t=>F0.includes(t)),items:Xm(qGe),pagination:Xn({limit:ma(),offset:ma(),total:ma()})});var zGe=Xn({x402Version:ma().refine(t=>F0.includes(t)),scheme:Ys(IA),network:Xv,extra:uu(v2()).optional()});Xn({kinds:Xm(zGe)});var ZGe={};uA(ZGe,{createDevnetRpcClient:()=>oY,createMainnetRpcClient:()=>cY,createSignerFromBase58:()=>TGe,createSvmConnectedClient:()=>IGe,decodeTransactionFromPayload:()=>KGe,getRpcClient:()=>lY,getRpcSubscriptions:()=>xGe,getTokenPayerFromTransaction:()=>GGe,isSignerWallet:()=>LGe,signAndSimulateTransaction:()=>YGe,signTransactionWithSigner:()=>dY});function KGe(t){try{const n=nze().encode(t.transaction);return $Ze().decode(n)}catch(e){throw console.error("error",e),new Error("invalid_exact_svm_payload_transaction")}}function GGe(t){const e=tZe().decode(t.messageBytes),n=e.staticAccounts??[],r=e.instructions??[];for(const i of r){const a=i.programAddressIndex,s=n[a].toString();if(s===rY.toString()||s===dGe.toString()){const o=i.accountIndices??[];if(o.length>=4){const c=o[3],l=n[c].toString();if(l)return l}}}return""}async function YGe(t,e,n){const r=await dY(t,e),i=OZe(r),a={sigVerify:!0,replaceRecentBlockhash:!1,commitment:"confirmed",encoding:"base64",accounts:void 0,innerInstructions:void 0,minContextSlot:void 0};return await n.simulateTransaction(i,a).send()}async function dY(t,e){if(QG(t)){const[n]=await t.modifyAndSignTransactions([e]);if(!n)throw new Error("transaction_signer_failed_to_return_transaction");return n}if(eY(t)){const[n]=await t.signTransactions([e]);if(!n)throw new Error("transaction_signer_failed_to_return_signatures");return JGe(e,n)}throw new Error("transaction_signer_must_support_offline_signing")}function JGe(t,e){return Object.freeze({...t,signatures:Object.freeze({...t.signatures,...e})})}Xn({paymentHeader:jt(),paymentRequirements:U0});function Xb(){let t=new URLSearchParams(window.location.search),e=t.get("privy_oauth_code"),n=t.get("privy_oauth_state"),r=t.get("privy_oauth_provider");if(!e||!n||!r)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:e,stateCode:n,provider:r,withPrivyUi:!nt.get(vy),popupFlow:window.opener!==null&&i,disableSignup:!!nt.get($h)}}function XGe(){let t=new URL(window.location.href);t.searchParams.delete("privy_oauth_code"),t.searchParams.delete("privy_oauth_provider"),t.searchParams.delete("privy_oauth_state"),nt.del(my),window.history.replaceState({},"",t)}class rM{get meta(){return this._meta}async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.channelToken)throw new Q("Auth flow must be initialized first");try{let e=await this.api.post(EUe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new Q("No response from authentication");return e}catch(e){throw xt(e)}}async link(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(SUe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw xt(e)}}async _startChannelOnce(){if(!this.api)throw new Q("Auth flow has no API instance");let e=await this.api.post(CUe,{token:this.captchaToken});Lp&&!Gwe&&e.connect_uri&&zZ(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new Q("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new Q("Auth flow has no API instance");if(!this.meta.channelToken)throw new Q("Auth flow must be initialized first");let e=await this.api.get(AUe,{headers:{"farcaster-channel-token":this.meta.channelToken}});return e.state==="completed"&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,n=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new Ka(this._startChannelOnce.bind(this)),this.pollForReady=new Ka(this._pollForReady.bind(this)),this._meta.disableSignup=n}}class gd{async initRegisterFlow(e){if(!this.api)throw new Q("Auth flow has no API instance");this.authenticateForRegistration=!0,this.meta.initRegisterResponse=await this.initRegisterOnce.execute(e)}async initAuthenticationFlow(e){if(!this.api)throw new Q("Auth flow has no API instance");this.authenticateForRegistration=!1,this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new Q("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async register(){let e=await Ne(()=>import("./index-DgTijNFR.js"),__vite__mapDeps([18,19]));if(!this.api)throw new Q("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new Q("WebAuthn is not supported in this browser");this.meta.initRegisterResponse||(this.meta.initRegisterResponse=await this.initRegisterOnce.execute());try{let n=this.meta.initRegisterResponse.options,r=await e.startRegistration({optionsJSON:this._transformInitLinkOptionsToCamelCase(n)});return this.meta.setPasskeyAuthState?.({status:"submitting-response"}),await this.api.post(ZUe,{relying_party:this.meta.initRegisterResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(r)})}catch(n){throw n.name==="NotAllowedError"?new Q("Passkey request timed out or rejected by user.",void 0,fe.PASSKEY_NOT_ALLOWED):xt(n)}}async authenticate(){if(this.authenticateForRegistration)return this.register();let e=await Ne(()=>import("./index-DgTijNFR.js"),__vite__mapDeps([18,19]));if(!this.api)throw new Q("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new Q("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());let n=this.meta.allowedCredentialsIds?.map(r=>({type:"public-key",id:r}))??this.meta.initAuthenticateResponse.options.allow_credentials;try{let r=await e.startAuthentication({optionsJSON:this._transformInitAuthenticateOptionsToCamelCase({...this.meta.initAuthenticateResponse.options,allow_credentials:n})});return this.meta.setPasskeyAuthState?.({status:"submitting-response"}),await this.api.post(zUe,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)})}catch(r){throw r.name==="NotAllowedError"?new Q("Passkey request timed out or rejected by user.",void 0,fe.PASSKEY_NOT_ALLOWED):xt(r)}}async link(){let e=await Ne(()=>import("./index-DgTijNFR.js"),__vite__mapDeps([18,19]));if(!this.api)throw new Q("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new Q("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let n=this.meta.initLinkResponse.options,r=await e.startRegistration({optionsJSON:this._transformInitLinkOptionsToCamelCase(n)});return this.meta.setPasskeyAuthState?.({status:"submitting-response"}),await this.api.post(qUe,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(r)})}catch(n){throw n.name==="NotAllowedError"?new Q("Passkey request timed out or rejected by user.",void 0,fe.PASSKEY_NOT_ALLOWED):xt(n)}}async _initRegisterOnce(e){if(!this.api)throw new Q("Auth flow has no API instance");let n=Up(e);return await this.api.post(WUe,{token:this.meta.captchaToken},{headers:{...n}})}async _initAuthenticateOnce(e){if(!this.api)throw new Q("Auth flow has no API instance");let n=Up(e);return await this.api.post(HUe,{token:this.meta.captchaToken},{headers:{...n}})}async _initLinkOnce(){if(!this.api)throw new Q("Auth flow has no API instance");return await this.api.post(VUe,{})}_transformInitLinkOptionsToCamelCase(e){let n=this.meta.name?.trim()||void 0;return{rp:e.rp,user:{id:e.user.id,name:n??e.user.name,displayName:n??e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:e.timeout,excludeCredentials:e.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:e.authenticator_selection?.authenticator_attachment,requireResidentKey:e.authenticator_selection?.require_resident_key,residentKey:e.authenticator_selection?.resident_key,userVerification:e.authenticator_selection?.user_verification},attestation:e.attestation,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props?.rk,hmacCreateSecret:e.extensions?.hmac_create_secret},hints:this.meta.hints}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_i
313d:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:e.allow_credentials?.map(n=>({id:n.id,type:n.type,transports:n.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:n,hints:r}){this.authenticateForRegistration=!1,this.initRegisterOnce=new Ka(this._initRegisterOnce.bind(this)),this.initAuthenticateOnce=new Ka(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ka(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:n,hints:r}}}class iM{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup,messageType:this._meta.messageType,address:this.wallet?.address}}set messageType(e){this._meta.messageType=e}async authenticate(){if(!this.client)throw new Q("SiwsFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:n,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up",messageType:this.meta.messageType})}catch(e){throw xt(e)}}async link(){if(!this.client)throw new Q("SiwsFlow has no client instance");try{let{message:e,signature:n}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:n,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,messageType:this.meta.messageType})}catch(e){throw xt(e)}}async sign(){let e,n;if(!this.client)throw new Q("SiwsFlow has no client instance");await this.buildMessage();let r=this.meta.messageType==="transaction",i=this.meta.messageType==="offchain-message";if(!this.preparedMessage)throw new Q("Could not prepare SIWS message");if(!r&&!this.wallet.provider.signMessage||r&&!this.wallet.provider.signTransaction)throw new Q("Wallet does not support the necessary signing methods");if(i){let a=d5e({message:this.preparedMessage,signerPublicKey:PD.decode(this.wallet.address),domain:window.location.origin}),s=await this.wallet.provider.signMessage({message:a});e=this.preparedMessage,n=Bc.encode(s.signature)}else if(r&&this._plugin){let a=await this.wallet.provider.signTransaction({transaction:Bc.decode(this.preparedMessage)});e=Bc.encode(a.signedTransaction),n=this._plugin.getSignatureFromTransaction(a.signedTransaction,this.wallet.address)}else{e=this.preparedMessage;let a=await this.wallet.provider.signMessage({message:new TextEncoder().encode(this.preparedMessage)});n=Bc.encode(a.signature)}return{message:e,signature:n}}async _getNonceOnce(){if(!this.client)throw new Q("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Q("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.meta.messageType==="transaction"&&this._plugin?this.preparedMessage=this._plugin.createSiwsMemoTransaction({address:e,nonce:this.nonce}):this.preparedMessage=Xje({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,n,r,i=!1,a="plain",s){this._meta={disableSignup:!1,messageType:"plain"}
313,this.getNonceOnce=new Ka(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=n,this._meta.disableSignup=i,this._meta.messageType=a,this._plugin=s}}const fY=L.createContext({enabled:!1,siteKey:"",provider:void 0,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:ue,setError:ue,setExecuting:ue,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:hV,reset:ue,execute:ue});class Wp extends dl{constructor(e,n,r){super(e||"Captcha failed"),this.type="Captcha",n instanceof Error&&(this.cause=n),this.privyErrorCode=r}}const QGe=({children:t,appId:e,captchaSiteKey:n,enabledCaptchaProvider:r})=>{let i=L.useRef(null),a=L.useRef(null),[s,o]=L.useState(),[c,l]=L.useState(),[u,d]=L.useState(!1),f=L.useMemo(()=>r?u||s||c?!u||s||c?s&&!c?{status:"success",token:s}:c?{status:"error",error:c}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[r,s,c,u]),h=L.useMemo(()=>r?r==="turnstile"?{remove:()=>{i.current?.remove(),d(!1),l(void 0),o(void 0)},reset:()=>{i.current?.reset(),d(!1),l(void 0),o(void 0)},execute:()=>{d(!0),i.current?.execute()},waitForResult:async()=>{try{return await rk(()=>i.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Wp("Captcha failed",null,fe.CAPTCHA_TIMEOUT)}}}:{remove:()=>{a.current?.removeCaptcha(),d(!1),l(void 0),o(void 0)},reset:()=>{a.current?.resetCaptcha(),d(!1),l(void 0),o(void 0)},execute:()=>{d(!0),a.current?.execute()},waitForResult:async()=>{try{return await rk(()=>{let g=a.current?.getResponse();if(g)return g},{interval:200,timeout:2e4})}catch{throw new Wp("Captcha failed",null,fe.CAPTCHA_TIMEOUT)}}}:null,[r]),p=L.useMemo(()=>{if(!r||!h)return{...f,enabled:!1,siteKey:"",appId:e,setToken:ue,setError:ue,setExecuting:ue,waitForResult:()=>Promise.resolve(void 0),remove:hV,reset:ue,execute:ue,provider:void 0,ref:{current:null}};let g={...f,enabled:!0,appId:e,setToken:o,setError:l,setExecuting:d};return r==="turnstile"?{...g,provider:"turnstile",ref:i,siteKey:n.split("t:")[1]??"",...h}:{...g,provider:"hcaptcha",ref:a,siteKey:n.split("h:")[1]??"",...h}},[f,r,h,e,n]);return m.jsx(fY.Provider,{value:p,children:t})},Qv=()=>L.useContext(fY);async function eYe(t){if(t.enabled){if(t.status==="error")throw new Wp(t.error,null,fe.CAPTCHA_FAILURE);return t.status==="success"?t.token:(t.execute(),await t.waitForResult())}}class yd{async authenticate(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(KUe,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw xt(e)}}async link(){if(!this.api)throw new Q("Auth flow has no API instance");try{return await this.api.post(GUe,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw xt(e)}}constructor(e,n=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=n}}function ect(t){let e={detail:"",retryable:!1};return t?.privyErrorCode===fe.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),t?.privyErrorCode===fe.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),t?.privyErrorCode===fe.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),t?.privyErrorCode===fe.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),t?.privyErrorCode===fe.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),t?.privyErrorCode===fe.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),t?.privyErrorCode===fe.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof Wp&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function aM(t){return Object.fromEntries(decodeURIComponent(t).split("&").map(e=>e.split("=").map(decodeURIComponent)))}function sM(){let t=new URL(window.location.href);t.searchParams.delete("id"),t.searchParams.delete("hash"),t.searchParams.delete("auth_date"),t.searchParams.delete("first_name"),t.searchParams.delete("last_name"),t.searchParams.delete("username"),t.searchParams.delete("photo_url"),t.hash="",window.history.replaceState({},"",t)}let tYe=L.lazy(()=>Ne(()=>import("./TurnstileWrapper-D0ULIRQd-CUZGiUSo.js"),__vite__mapDeps([20,2,4,1,3,5,6,7]))),nYe=L.lazy(()=>Ne(()=>import("./HCaptchaWrapper-CUi9LJsp-BPg1ZzBq.js"),__vite__mapDeps([21,2,22])));const rYe=t=>{let e=Qv();return L.useEffect(()=>e.remove,[e.remove]),e.enabled&&e.provider?m.jsx(L.Suspense,{fallback:null,children:m.jsxs("div",{className:"hidden h-0 w-0",children:[e.provider==="turnstile"&&m.jsx(tYe,{...t,captchaContext:e}),e.provider==="hcaptcha"&&m.jsx(nYe,{...t,captchaContext:e})]})}):null};var e6=Object.freeze({__proto__:null,AccountNotFoundScreen:()=>Ne(()=>import("./AccountNotFoundScreen-D_g_37og-BVYmDI-2.js"),__vite__mapDeps([23,2,24,25,26,27,28,4,1,3,5,6,7])),AddFundsSelectionScreen:()=>Ne(()=>import("./AddFundsSelectionScreen-CN9oRQgJ-B9w7cb_c.js"),__vite__mapDeps([29,2,30,31,28,24,25,26,27,32,4,1,3,5,6,7])),AffirmativeConsentScreen:()=>Ne(()=>import("./AffirmativeConsentScreen-wOWvmEm9-B5yhn2Uj.js"),__vite__mapDeps([33,2,25,34,24,26,27,28,35,4,1,3,5,6,7])),AllowlistRejectionScreen:()=>Ne(()=>import("./AllowlistRejectionScreen-DLOb1IbL-mNg83ozg.js"),__vite__mapDeps([36,2,37,24,25,26,27,38,28,4,1,3,5,6,7])),AuthenticateWithWalletScreen:()=>Ne(()=>import("./AuthenticateWithWalletScreen-CxmVXCpq-BzuPboux.js"),__vite__mapDeps([39,2,40,25,41,42,28,43,44,45,46,47,48,49,50,51,30,26,27,4,1,3,5,6,7])),AwaitingEvmToSolBridgingScreen:()=>Ne(()=>import("./AwaitingEvmToSolBridgingScreen-C0EGoPz7-BmxaQu6G.js"),__vite__mapDeps([52,2,53,54,25,55,56,27,57,58,59,60,61,62,63,64,65,66,67,49,68,69,70,71,72,73,74,42,28,43,75,76,77,78,79,80,81,82,83,24,26,84,85,4,1,3,5,6,7,86])),AwaitingExter
313nalEthereumTransferScreen:()=>Ne(()=>import("./AwaitingExternalEthereumTransferScreen-eMz3y86s-Dyr15jKQ.js"),__vite__mapDeps([87,2,53,54,25,55,56,27,57,58,88,78,79,59,60,64,65,66,67,49,68,69,70,61,71,72,73,74,42,28,43,75,76,77,80,81,82,83,24,26,84,85,4,1,3,5,6,7,86])),AwaitingPasswordlessCodeScreen:()=>Ne(()=>import("./AwaitingPasswordlessCodeScreen-BVDX5cd4-DguVCUvE.js"),__vite__mapDeps([89,2,90,91,54,44,34,24,25,26,27,4,1,3,5,6,7])),AwaitingSolToEvmBridgingScreen:()=>Ne(()=>import("./AwaitingSolToEvmBridgingScreen-Cy6IPwXH-CkTlMXGk.js"),__vite__mapDeps([92,2,53,54,25,55,56,27,59,60,72,73,70,66,67,74,42,28,43,75,4,1,3,5,6,7])),CaptchaScreen:()=>Ne(()=>import("./CaptchaScreen-CF3tpDFb-DIwIUsVK.js"),__vite__mapDeps([93,2,24,25,26,27,84,28,94,4,1,3,5,6,7])),CoinbaseOnrampStatusScreen:()=>Ne(()=>import("./CoinbaseOnrampStatusScreen-bKnFMDb2-zYozmDgm.js"),__vite__mapDeps([95,2,96,97,25,54,59,4,1,3,5,6,7])),ConnectLedgerScreen:()=>Ne(()=>import("./ConnectLedgerScreen-BGC0DzYt-u_WQqQhf.js"),__vite__mapDeps([98,2,24,25,26,27,4,1,3,5,6,7])),ConnectOnlyLandingScreen:()=>Ne(()=>import("./ConnectOnlyLandingScreen-WzTDnspN-C0isOXZM.js"),__vite__mapDeps([99,2,40,25,41,42,28,43,44,45,46,47,48,49,50,51,30,26,27,4,1,3,5,6,7])),ConnectOnlyStatusScreen:()=>Ne(()=>import("./ConnectOnlyStatusScreen-BAuJPlKk-BILUMvyf.js"),__vite__mapDeps([100,2,24,25,26,27,101,44,50,34,4,1,3,5,6,7])),ConnectOrCreateScreen:()=>Ne(()=>import("./ConnectOrCreateScreen-32lhgmi8-DM-N2EU1.js"),__vite__mapDeps([102,2,103,25,40,41,42,28,43,44,45,46,47,48,49,50,51,30,26,27,104,71,67,105,106,107,108,109,110,111,112,24,113,4,1,3,5,6,7])),ConnectionStatusScreen:()=>Ne(()=>import("./ConnectionStatusScreen-BLO0eB_B-kn1rOHAE.js"),__vite__mapDeps([101,2,44,50,34,24,25,26,27,4,1,3,5,6,7])),CrossAppAuthScreen:()=>Ne(()=>import("./CrossAppAuthScreen-YjAcLBV2-D9PBN8cT.js"),__vite__mapDeps([114,2,34,24,25,26,27,4,1,3,5,6,7])),DelegatedActionsConsentScreen:()=>Ne(()=>import("./DelegatedActionsConsentScreen-DPBY1dWo-CKid6tvW.js"),__vite__mapDeps([115,2,116,25,49,117,74,42,28,43,76,24,26,27,118,84,4,1,3,5,6,7])),DelegatedActionsRevokeScreen:()=>Ne(()=>import("./DelegatedActionsRevokeScreen-D1iywhe4-Db1QjDHU.js"),__vite__mapDeps([119,2,24,25,26,27,118,28,84,4,1,3,5,6,7])),DepositAddressScreen:()=>Ne(()=>import("./DepositAddressScreen-CI4eYwCb-DkVSTJgH.js"),__vite__mapDeps([120,2,31,28,24,25,26,27,30,45,46,47,86,1,3,41,42,43,121,122,123,4,5,6,7])),EmbeddedWalletConnectingScreen:()=>Ne(()=>import("./EmbeddedWalletConnectingScreen-CluhExWV-BuAL-YDx.js"),__vite__mapDeps([124,2,24,25,26,27,94,28,4,1,3,5,6,7])),EmbeddedWalletCreatedScreen:()=>Ne(()=>import("./EmbeddedWalletCreatedScreen-wlqUDU6d-EQ7OXFVU.js"),__vite__mapDeps([125,2,24,25,26,27,84,28,4,1,3,5,6,7])),EmbeddedWalletKeyExportScreen:()=>Ne(()=>import("./EmbeddedWalletKeyExportScreen-k5tP_eze-DrP8wII4.js"),__vite__mapDeps([126,2,127,128,116,25,49,117,74,42,28,43,76,24,26,27,4,1,3,5,6,7])),EmbeddedWalletOnAccountCreateScreen:()=>Ne(()=>import("./EmbeddedWalletOnAccountCreateScreen-BK8tw3Mj-CzMNQ6Is.js"),__vite__mapDeps([129,2,24,25,26,27,94,28,4,1,3,5,6,7])),EmbeddedWalletPasswordCreateScreen:()=>Ne(()=>import("./RecoveryPasswordCreateScreen-BPddw-Ex-D5eWmCKc.js"),__vite__mapDeps([130,2,131,128,54,25,132,133,97,55,4,1,3,5,6,7])),EmbeddedWalletPasswordUpdateScreen:()=>Ne(()=>import("./EmbeddedWalletPasswordUpdateScreen-D1jshO-6-D_Zux6WN.js"),__vite__mapDeps([134,2,131,128,54,25,132,133,97,55,4,1,3,5,6,7])),EmbeddedWalletPasswordUpdateSplashScreen:()=>Ne(()=>import("./EmbeddedWalletPasswordUpdateSplashScreen-BuriarnO-87vdts6i.js"),__vite__mapDeps([135,2,24,25,26,27,38,28,4,1,3,5,6,7])),ErrorScreen:()=>Ne(()=>import("./ErrorScreen-76JNrXJI-Op_velT8.js"),__vite__mapDeps([136,2,60,37,24,25,26,27,121,28,38,4,1,3,5,6,7])),FarcasterConnectStatusScreen:()=>Ne(()=>import("./FarcasterConnectStatusScreen-BPIu1e7P-PFdv0BvL.js"),__vite__mapDeps([137,2,138,45,46,47,25,117,34,24,26,27,106,42,28,43,4,1,3,5,6,7])),FarcasterSignerStatusScreen:()=>Ne(()=>import("./FarcasterSignerStatusScreen-D2iryUpj-BdH7I0Vk.js"),__vite__mapDeps([139,2,140,138,45,46,47,24,25,26,27,106,4,1,3,5,6,7])),FiatOnrampScreen:()=>Ne(()=>import("./FiatOnrampScreen-B9Pz4dX6-viSrTgkm.js"),__vite__mapDeps([141,2,142,24,25,26,27,123,28,108,71,67,41,42,43,127,128,143,144,94,32,83,38,113,112,1,3,145,4,5,6,7])),FundSolWalletWithExternalSolanaWallet:()=>Ne(()=>import("./FundSolWalletWithExternalSolanaWallet-DZFgn3SS-DicDR89j.js"),__vite__mapDeps([146,2,53,25,54,55,56,73,70,27,66,67,147,1,3,57,58,59,63,148,61,4,5,6,7])),FundWithBankDepositScreen:()=>Ne(()=>import("./FundWithBankDepositScreen-EpAb2AKB-gjqhc6Ms.js"),__vite__mapDeps([149,2,41,42,28,43,24,25,26,27,143,142,123,94,122,4,1,3,5,6,7])),FundingAmountEditScreen:()=>Ne(()=>import("./FundingEditAmountScreen-wjiqcj9O-NpMgdoHd.js"),__vite__mapDeps([150,2,25,54,56,27,69,57,58,79,80,81,82,83,28,42,24,26,84,85,4,1,3,5,6,7])),FundingMethodSelectionScreen:()=>Ne(()=>import("./FundingMethodSelectionScreen-F_73hpQK-DgFrNKwD.js"),__vite__mapDeps([151,2,96,25,56,152,153,143,144,51,154,155,59,80,81,82,83,28,42,24,26,27,84,85,4,1,3,5,6,7])),InAppBrowserLoginNotPossible:()=>Ne(()=>import("./InAppBrowserLoginNotPossible-B0hwYzXz-CEpC27QG.js"),__vite__mapDeps([156,2,24,25,26,27,35,28,4,1,3,5,6,7])),InstallWalletScreen:()=>Ne(()=>import("./InstallWalletScreen-DYqE-pP8-cddslAeL.js"),__vite__mapDeps([157,2,44,82,83,28,42,24,25,26,27,4,1,3,5,6,7])),LandingScreen:()=>Ne(()=>import("./LandingScreen-rp9tgEMx-C2dSIerm.js"),__vite__mapDeps([158,2,103,25,40,41,42,28,43,44,45,46,47,48,49,50,51,30,26,27,104,71,67,105,106,107,108,109,110,111,112,24,113,4,1,3,5,6,7])),LinkConflictScreen:()=>Ne(()=>import("./LinkConflictScreen-Cs5NA-I0-B5cEpde4.js"),__vite__mapDeps([159,2,128,70,25,160,74,42,28,43,161,153,4,1,3,5,6,7])),LinkEmailScreen:()=>Ne(()=>import("./LinkEmailScreen-CtlhwdAH-XHH1tqoU.js"),__vite__mapDeps([162,2,90,104,25,71,67,48,49,105,28,54,24,26,27,4,1,3,5,6,7])),LinkPasskeyScreen:()=>Ne(()=>import("./LinkPasskeyScreen-CHBFSg9m-CGbWzJc1.js"),__vite__mapDeps([81,2,82,83,28,42,24,25,26,27,84,85,4,1,3,5,6,7])),LinkPhoneScreen:()=>Ne(()=>import("./LinkPhoneScreen-dj3rzgJQ-5cI2Omen.js"),__vite__mapDeps([163,2,91,108,25,71,67,24,26,27,4,1,3,5,6,7])),LoginFailedScreen:()=>Ne(()=>import("./LoginFailedScreen-87LgCVCV-CqqtixLa.js"),__vite__mapDeps([164,2,24,25,26,27,94,28,4,1,3,5,6,7])),ManualTransferScreen:()=>Ne(()=>import("./ManualTransferScreen-BRXiBgiZ-DoeRaifV.js"),__vite__mapDeps([165,2,25,54,45,46,47,56,143,68,69,116,49,117,74,42,28,43,76,166,59,61,148,63,62,65,4,1,3,5,6,7])),MfaAuthEnrollmentFlowScreen:()=>Ne(()=>import("./MfaAuthEnrollmentFlowScreen-qXwJGe2E-8qISCKit.js"),__vite__mapDeps([167,2,25,168,169,170,107,91,71,67,136,60,37,24,26,27,121,28,38,4,1,3,5,6,7,81,82,83,42,84,85,140,54,117,68,69,76,45,46,47])),MfaAuthVerifyFlowScreen:()=>Ne(()=>import("./MfaAuthVerifyFlowScreen-DXEKzBAu-DJUjdInG.js"),__vite__mapDeps([171,2,172,170,107,91,168,25,24,26,27,128,160,57,58,173,174,79,63,62,54,77,4,1,3,5,6,7])),MfaEnrollmentFlowScreen:()=>Ne(()=>import("./MfaEnrollmentFlowScreen-HeKSb33a-CR3adrtC.js"),__vite__mapDeps([175,2,25,168,169,170,107,91,71,67,136,60,37,24,26,27,121,28,38,4,1,3,5,6,7,81,82,83,42,84,85,140,54,117,68,69,76,45,46,47,53,108])),MoonpayStatusScreen:()=>Ne(()=>import("./MoonpayStatusScreen-l-qyxBqo-atQFbC9a.js"),__vite__mapDeps([176,2,96,97,25,54,155,59,4,1,3,5,6,7])),OAuthStatusScreen:()=>Ne(()=>import("./OAuthStatusScreen-DEaj1Cx0-CWU06oli.js"),__vite__mapDeps([177,2,109,75,110,34,24,25,26,27,161,4,1,3,5,6,7])),PasskeySelectSignupOrLogin:()=>Ne(()=>import("./PasskeySelectSignupOrLogin-BkByGRw--QXu_mFGa.js"),__vite__mapDeps([178,2,24,25,26,27,85,28,4,1,3,5,6,7])),PasskeyStatusScreen:()=>Ne(()=>import("./PasskeyStatusScreen-D-V-K3Z9-Q4c7iXUK.js"),__vite__mapDeps([179,2,34,24,25,26,27,85,28,4,1,3,5,6,7])),PasswordRecoveryScreen:()=>Ne(()=>import("./PasswordRecoveryScreen-CCu4ttfr-DEI86kgW.js"),__vite__mapDeps([180,2,168,25,54,132,26,27,4,1,3,5,6,7])),RecoveryOAuthScreen:()=>Ne(()=>import("./RecoveryOAuthStatusScreen-CFujlL9L-BDIglmC3.js"),__vite__mapDeps([181,2,25,55,182,4,1,3,5,6,7])),RecoverySelectionScreen:()=>Ne(()=>import("./RecoverySelectionScreen-F_wQ_CWq-nQ4j4B54.js"),__vite__mapDeps([183,2,184,25,55,182,4,1,3,5,6,7])),SendTransactionScreen:()=>Ne(()=>import("./index-BWsACtDt-BrJYR5yH.js"),__vite__mapDeps([185,2,74,25,42,28,43,57,58,166,154,78,79,136,60,37,24,26,27,121,38,4,1,3,5,6,7,186,187,66,67,49,117,68,69,116,76,133,152,153,127,128,77,54,55,173,174,63,62,88])),SetAutomaticRecoveryScreen:()=>Ne(()=>import("./SetAutomaticRecoveryScreen-C7A71DnN-CVOxMFUd.js"),__vite__mapDeps([188,2,128,184,25,68,69,4,1,3,5,6,7])),SignRequestScreen:()=>Ne(()=>import("./SignRequestScreen-CZ5BTKSq-DR7r2HNx.js"),__vite__mapDeps([189,2,140,54,186,24,25,26,27,28,4,1,3,5,6,7])),StandardSignAndSendTransactionScreen:()=>Ne(()=>import("./StandardSignAndSendTransactionScreen-C26odE6I-BrgPhxbx.js"),__vite__mapDeps([190,2,58,136,60,37,24,25,26,27,121,28,38,4,1,3,5,6,7,53,54,55,66,67,174,79,63,62,160,187,49,117,68,69,74,42,43,116,76,133,152,153,127,128,77,147])),TelegramAuthScreen:()=>Ne(()=>import("./TelegramAuthScreen-BNOwzXOU-CwsQDc1B.js"),__vite__mapDeps([191,2,34,24,25,26,27,110,4,1,3,5,6,7])),TransferFromWalletScreen:()=>Ne(()=>import("./TransferFromWalletScreen-a7BSg9U2-DGILfPNG.js"),__vite__mapDeps([192,2,25,55,56,73,70,71,67,68,111,112,28,80,81,82,83,42,24,26,27,84,85,4,1,3,5,6,7])),UpdateEmailScreen:()=>Ne(()=>import("./UpdateEmailScreen-n_K4amJc-BCuz2ljH.js"),__vite__mapDeps([193,2,90,54,25,48,49,24,26,27,105,28,4,1,3,5,6,7])),UpdatePhoneScreen:()=>Ne(()=>import("./UpdatePhoneScreen-Cw26b--T-DwMk5ges.js"),__vite__mapDeps([194,2,91,108,25,71,67,24,26,27,4,1,3,5,6,7])),UserLimitReachedScreen:()=>Ne(()=>import("./UserLimitReachedScreen-B3Dl2q5_-CdcGa5q3.js"),__vite__mapDeps([195,2,24,25,26,27,4,1,3,5,6,7])),WalletInterstitialScreen:()=>Ne(()=>import("./WalletInterstitialScreen-Cy2YhOXL-CxEFCtty.js"),__vite__mapDeps([196,2,24,25,26,27,4,1,3,5,6,7]))});function iYe(t){La("configureMfa",t)}const qp=Pi(()=>({inProgressMfaFlow:void 0})),aYe=yVe` 314 :root { 315 ${t=>sYe(t.palette)} 316 }; 317`,sYe=t=>{let e=function(n){return{"--privy-color-background":n.background,"--privy-color-background-2":n.background2,"--privy-color-background-3":n.background3,"--privy-color-foreground":n.foreground,"--privy-color-foreground-2":n.foreground2,"--privy-color-foreground-3":n.foreground3,"--privy-color-foreground-4":n.foreground4,"--privy-color-foreground-accent":n.foregroundAccent,"--privy-color-accent":n.accent,"--privy-color-accent-light":n.accentLight,"--privy-color-accent-hover":n.accentHover,"--privy-color-accent-dark":n.accentDark,"--privy-color-accent-darkest":n.accentDarkest,"--privy-color-success":n.success,"--privy-color-success-dark":n.successDark,"--privy-color-success-light":n.successLight,"--privy-color-success-bg":n.successBg,"--privy-color-error":n.error,"--privy-color-error-light":n.errorLight,"--privy-color-error-bg":n.errorBg,"--privy-color-error-bg-hover":n.errorBgHover,"--privy-color-warn":n.warn,"--privy-color-warn-light":n.warnLight,"--privy-color-warn-bg":n.warnBg,"--privy-color-warning-dark":n.warningDark,"--privy-color-error-dark":n.errorDark,"--privy-color-info-bg":n.infoBg,"--privy-color-info-bg-hover":n.infoBgHover,"--privy-color-border-default":n.borderDefault,"--privy-color-border-hover":n.borderHover,"--privy-color-border-focus":n.borderFocus,"--privy-color-border-error":n.borderError,"--privy-color-border-success":n.borderSuccess,"--privy-color-border-warning":n.borderWarning,"--privy-color-border-info":n.borderInfo,"
317--privy-color-border-interactive":n.borderInteractive,"--privy-color-border-interactive-hover":n.borderInteractiveHover,"--privy-color-background-hover":n.backgroundHover,"--privy-color-background-clicked":n.backgroundClicked,"--privy-color-background-disabled":n.backgroundDisabled,"--privy-color-background-interactive":n.backgroundInteractive,"--privy-color-background-interactive-hover":n.backgroundInteractiveHover,"--privy-color-background-interactive-clicked":n.backgroundInteractiveClicked,"--privy-color-background-interactive-disabled":n.backgroundInteractiveDisabled,"--privy-color-foreground-hover":n.foregroundHover,"--privy-color-foreground-clicked":n.foregroundClicked,"--privy-color-foreground-disabled":n.foregroundDisabled,"--privy-color-foreground-interactive":n.foregroundInteractive,"--privy-color-foreground-interactive-hover":n.foregroundInteractiveHover,"--privy-link-navigation-color":n.linkNavigationColor,"--privy-link-navigation-decoration":n.linkNavigationDecoration,"--privy-accent-has-good-contrast":n.accentHasGoodContrast,"--privy-color-icon-default":n.iconDefault,"--privy-color-icon-muted":n.iconMuted,"--privy-color-icon-subtle":n.iconSubtle,"--privy-color-icon-inverse":n.iconInverse,"--privy-color-icon-success":n.iconSuccess,"--privy-color-icon-warning":n.iconWarning,"--privy-color-icon-error":n.iconError,"--privy-color-icon-interactive":n.iconInteractive,"--privy-color-icon-default-hover":n.iconDefaultHover,"--privy-color-icon-muted-hover":n.iconMutedHover,"--privy-color-icon-subtle-hover":n.iconSubtleHover,"--privy-color-icon-default-clicked":n.iconDefaultClicked,"--privy-color-icon-muted-clicked":n.iconMutedClicked,"--privy-color-icon-subtle-clicked":n.iconSubtleClicked,"--privy-color-icon-default-disabled":n.iconDefaultDisabled,"--privy-color-icon-muted-disabled":n.iconMutedDisabled,"--privy-color-icon-subtle-disabled":n.iconSubtleDisabled,"--privy-color-icon-error-hover":n.iconErrorHover,"--privy-color-icon-interactive-hover":n.iconInteractiveHover,"--privy-color-icon-error-clicked":n.iconErrorClicked,"--privy-color-icon-interactive-clicked":n.iconInteractiveClicked,"--privy-color-icon-muted-disabled-alt":n.iconMutedDisabledAlt,"--privy-color-icon-subtle-disabled-alt":n.iconSubtleDisabledAlt,"--privy-border-radius-xs":"6px","--privy-border-radius-sm":"8px","--privy-border-radius-md":"12px","--privy-border-radius-mdlg":"16px","--privy-border-radius-lg":"24px","--privy-border-radius-full":"9999px","--privy-height-modal-full":"620px","--privy-height-modal-compact":"480px"}}(t);return P0` 318 ${Object.entries(e).map(([n,r])=>`${n}: ${r};`).join(` 319`)} 320 `},oM=rn.div` 321 // css normalize only the privy application to avoid conflicts 322 // with consuming application 323 ${` 324 *, 325 ::before, 326 ::after { 327 box-sizing: border-box; 328 border-width: 0; 329 border-style: solid; 330 } 331 332 line-height: 1.15; 333 -webkit-text-size-adjust: 100%; 334 -moz-tab-size: 4; 335 tab-size: 4; 336 font-feature-settings: normal; 337 338 margin: 0; 339 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 340 'Apple Color Emoji', 'Segoe UI Emoji'; 341 342 hr { 343 height: 0; 344 color: inherit; 345 border-top-width: 1px; 346 } 347 348 abbr:where([title]) { 349 text-decoration: underline dotted; 350 } 351 352 h1, 353 h2, 354 h3, 355 h4, 356 h5, 357 h6 { 358 font-size: inherit; 359 font-weight: inherit; 360 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 361 'Apple Color Emoji', 'Segoe UI Emoji'; 362 display: inline; 363 } 364 365 a { 366 color: inherit; 367 text-decoration: inherit; 368 } 369 370 b, 371 strong { 372 font-weight: bolder; 373 } 374 375 code, 376 kbd, 377 samp, 378 pre { 379 font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; 380 font-size: 1em; 381 } 382 383 small { 384 font-size: 80%; 385 } 386 387 sub, 388 sup { 389 font-size: 75%; 390 line-height: 0; 391 position: relative; 392 vertical-align: baseline; 393 } 394 395 sub { 396 bottom: -0.25em; 397 } 398 399 sup { 400 top: -0.5em; 401 } 402 403 table { 404 text-indent: 0; 405 border-color: inherit; 406 border-collapse: collapse; 407 } 408 409 button, 410 input, 411 optgroup, 412 select, 413 textarea { 414 font-family: inherit; 415 font-size: 100%; 416 font-weight: inherit; 417 line-height: inherit; 418 color: inherit; 419 margin: 0; 420 padding: 0; 421 } 422 423 button, 424 select { 425 text-transform: none; 426 } 427 428 button, 429 [type='button'], 430 [type='reset'], 431 [type='submit'] { 432 -webkit-appearance: button; 433 background-color: transparent; 434 background-image: none; 435 } 436 437 ::-moz-focus-inner { 438 border-style: none; 439 padding: 0; 440 } 441 442 :-moz-focusring { 443 outline: 1px dotted ButtonText; 444 } 445 446 :-moz-ui-invalid { 447 box-shadow: none; 448 } 449 450 legend { 451 padding: 0; 452 } 453 454 progress { 455 vertical-align: baseline; 456 } 457 458 ::-webkit-inner-spin-button, 459 ::-webkit-outer-spin-button { 460 height: auto; 461 } 462 463 [type='search'] { 464 -webkit-appearance: textfield; 465 outline-offset: -2px; 466 } 467 468 ::-webkit-search-decoration { 469 -webkit-appearance: none; 470 } 471 472 ::-webkit-file-upload-button { 473 -webkit-appearance: button; 474 font: inherit; 475 } 476 477 summary { 478 display: list-item; 479 } 480 481 blockquote, 482 dl, 483 dd, 484 h1, 485 h2, 486 h3, 487 h4, 488 h5, 489 h6, 490 hr, 491 figure, 492 p, 493 pre { 494 margin: 0; 495 } 496 497 fieldset { 498 margin: 0; 499 padding: 0; 500 } 501 502 legend { 503 padding: 0; 504 } 505 506 ol, 507 ul, 508 menu { 509 list-style: none; 510 margin: 0; 511 padding: 0; 512 } 513 514 textarea { 515 resize: vertical; 516 } 517 518 input::placeholder, 519 textarea::placeholder { 520 opacity: 1; 521 color: #9ca3af; 522 } 523 524 button, 525 [role='button'] { 526 cursor: pointer; 527 } 528 529 :disabled { 530 cursor: default; 531 } 532 533 img, 534 svg, 535 video, 536 canvas, 537 audio, 538 iframe, 539 embed, 540 object { 541 display: block; 542 } 543 544 img, 545 video { 546 max-width: 100%; 547 height: auto; 548 } 549 550 [hidden] { 551 display: none; 552 } 553`} 554 555 // Privy styles 556 color: var(--privy-color-foreground-2); 557 558 h3 { 559 font-size: 16px; 560 line-height: 24px; 561 font-weight: 500; 562 color: var(--privy-color-foreground-2); 563 } 564 565 h4 { 566 font-size: 14px; 567 line-height: 20px; 568 font-weight: 500; 569 color: var(--privy-color-foreground); 570 } 571 572 p { 573 font-size: 13px; 574 line-height: 20px; 575 color: var(--privy-color-foreground-2); 576 } 577 578 button:focus, 579 input:focus, 580 optgroup:focus, 581 select:focus, 582 textarea:focus { 583 outline: none; 584 border-color: var(--privy-color-accent-light); 585 box-shadow: 0 0 0 3px var(--privy-color-border-focus); 586 } 587 588 .mobile-only { 589 @media (min-width: 441px) { 590 display: none; 591 } 592 } 593 594 /* Animations */ 595 596 @keyframes fadein { 597 0% { 598 opacity: 0; 599 } 600 100% { 601 opacity: 1; 602 } 603 } 604`,oYe=({children:t,open:e,onClick:n,...r})=>m.jsx(pG,{show:e,as:tt.Fragment,children:m.jsxs(pWe,{onClose:n,...r,as:lYe,children:[m.jsx(Bp,{as:tt.Fragment,enterFrom:"entering",leaveTo:"leaving",children:m.jsx(cYe,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),m.jsx(uYe,{children:m.jsx(Bp,{as:tt.Fragment,enterFrom:"entering",leaveTo:"leaving",children:m.jsx(gG,{as:dYe,children:t})})})]})});let cYe=rn.div` 605 position: fixed; 606 inset: 0; 607 608 transition: backdrop-filter 100ms ease; 609 backdrop-filter: blur(3px); 610 -webkit-backdrop-filter: blur(3px); 611 612 &.entering, 613 &.leaving { 614 backdrop-filter: unset; 615 -webkit-backdrop-filter: unset; 616 } 617`,lYe=rn.div` 618 position: relative; 619 z-index: 999999; 620`,uYe=rn.div` 621 position: fixed; 622 inset: 0; 623 display: flex; 624 align-items: center; 625 justify-content: center; 626 width: 100vw; 627 min-height: 100dvh; 628 /* overflow-y: auto allows the browser to scroll the focused input into view 629 when the mobile keyboard opens, preventing the keyboard from covering inputs */ 630 overflow-y: auto; 631 632 @media (max-width: 440px) {
633 align-items: flex-end; 634 } 635`;const dYe=rn.div` 636 // reset some default dialog styles 637 padding: 0; 638 background: transparent; 639 border: none; 640 width: 100%; 641 pointer-events: auto; 642 643 outline: none; 644 display: block; 645 646 /* 647 * Normally it is bad to mix media queries like this We are doing 648 * this here specifically for animations to avoid weird jank. 649 */ 650 /* Mobile animation is a bottom drawer */ 651 @media (max-width: 440px) { 652 opacity: 1; 653 transform: translate3d(0, 0, 0); 654 transition: transform 200ms ease-in; 655 position: sticky; 656 bottom: 0; 657 658 &.entering, 659 &.leaving { 660 opacity: 0; 661 transform: translate3d(0, 100%, 0); 662 transition: 663 transform 150ms ease-in 0ms, 664 opacity 0ms ease 150ms; 665 } 666 } 667 668 /* Tablet/Desktop animation is a fade in */ 669 @media (min-width: 441px) { 670 opacity: 1; 671 transition: opacity 100ms ease-in; 672 673 &.entering, 674 &.leaving { 675 opacity: 0; 676 transition-delay: 5ms; 677 } 678 679 margin: auto; 680 width: 360px; 681 box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15); 682 border-radius: var(--privy-border-radius-lg); 683 } 684`;rn.div` 685 display: flex; 686 flex-direction: column; 687 align-items: center; 688 justify-content: center; 689 height: 100%; 690`;const fYe=()=>{let{ready:t}=$i(),{currentScreen:e}=es(),[n,r]=L.useState(null),[i,a]=L.useState(!1),s=function(o){let[c,l]=L.useState(!1),u=L.useRef(null),d=L.useRef(null),f=L.useRef(null);return L.useEffect(()=>{if(u.current&&(clearTimeout(u.current),u.current=null),d.current&&(clearTimeout(d.current),d.current=null),o)f.current=Date.now(),u.current=setTimeout(()=>{l(!0)},150);else if(f.current!==null){let h=Date.now()-f.current;if(h>=150){let p=Math.max(0,400-(h-150));d.current=setTimeout(()=>{l(!1),f.current=null},p)}else u.current&&(clearTimeout(u.current),u.current=null),l(!1),f.current=null}return()=>{u.current&&clearTimeout(u.current),d.current&&clearTimeout(d.current)}},[o]),c}(i);return L.useEffect(()=>{if(!e)return r(null),void a(!1);a(!0),e6[e]().then(o=>{(!e||t||o.default.isShownBeforeReady)&&(r(()=>o.default.component),a(!1))}).catch(()=>{r(null),a(!1)})},[e,t]),{component:n,isLoading:s}};let cM=L.lazy(()=>Ne(()=>import("./MfaVerifyFlowScreen-tffdYhQu-BmtdhhT2.js"),__vite__mapDeps([197,2,172,170,107,91,168,25,24,26,27,128,160,57,58,173,174,79,63,62,54,77,4,1,3,5,6,7]))),hYe=L.lazy(()=>(t=>e6[t]().then(e=>({default:e.default.component})))("MfaAuthVerifyFlowScreen")),pYe=()=>m.jsx(vYe,{children:m.jsx(jv,{})}),hY=()=>{let{currentScreen:t}=es(),e=qp(a=>a.inProgressMfaFlow),n=()=>qp.setState({inProgressMfaFlow:void 0}),{component:r,isLoading:i}=fYe();return function(){let{isModalOpen:a}=$i(),{headless:s}=zr(),{currentScreen:o}=es(),{status:c,execute:l,reset:u,enabled:d}=Qv(),[f,h]=L.useState(!1);L.useEffect(()=>{!a&&d&&u()},[a,d,u]),L.useEffect(()=>{o?e6[o]().then(p=>{h(!!p.default.isCaptchaRequired)}).catch(()=>{h(!1)}):h(!1)},[o]),L.useEffect(()=>{a&&f&&!s&&c==="ready"&&d&&l()},[a,f,s,c,d,l])}(),t||e!=="txn"?i?m.jsx(pYe,{}):r?m.jsxs(m.Fragment,{children:[m.jsx(jK,{$if:!!e,children:m.jsx(L.Suspense,{children:m.jsx(r,{})})}),m.jsxs(L.Suspense,{children:[e==="txn"&&m.jsx(cM,{onClose:n}),e==="auth"&&m.jsx(hYe,{})]})]}):null:m.jsx(L.Suspense,{children:m.jsx(cM,{onClose:n})})},gYe=()=>{let t=L.useRef(null);return m.jsx(mYe,{style:{height:mVe(t)},id:"privy-modal-content",children:m.jsx("div",{ref:t,children:m.jsx(hY,{})})})};const yYe=({open:t})=>{let e=zr(),{gracefulClosePrivyModal:n}=(()=>{let{closePrivyModal:i}=Vt(),{onUserCloseViaDialogOrKeybindRef:a}=es();return{gracefulClosePrivyModal:L.useCallback(()=>{if(!a?.current)return i({shouldCallAuthOnSuccess:!1});a.current()},[i,a])}})(),r=qp(i=>i.inProgressMfaFlow);return iYe({onMfaRequired:()=>{e.mfa.noPromptOnMfaRequired||qp.setState({inProgressMfaFlow:"txn"})}}),e.render.standalone?m.jsx(oM,{children:m.jsx(pY,{id:"privy-modal-content",children:m.jsx(hY,{})})}):m.jsx(oYe,{open:!(!t&&!r),id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>n(),children:m.jsx(oM,{children:m.jsx(gYe,{})})})};let pY=rn.div` 691 display: flex; 692 flex-direction: column; 693 text-align: center; 694 font-size: 14px; 695 line-height: 20px; 696 width: 100%; 697 background: var(--privy-color-background); 698 padding: 0 16px; 699`,mYe=rn(pY)` 700 transition: height 150ms ease-out; 701 overflow-x: hidden; 702 overflow-y: auto; 703 scrollbar-width: none; 704 705 // Ensure the modal gets pinned to the top if it ever gets too tall 706 max-height: calc(100svh - 32px); 707 708 border-radius: var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0; 709 box-shadow: 0px 0px 36px rgba(55, 65, 81, 0.15); 710 711 @media (min-width: 441px) { 712 box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15); 713 border-radius: var(--privy-border-radius-lg); 714 } 715`,vYe=rn.div` 716 display: flex; 717 align-items: center; 718 justify-content: center; 719 min-height: 300px; 720 padding: 2rem; 721`;function wYe(t){let e=L.useRef(null),n=L.useRef(null);return L.useEffect(()=>{n.current?.remove(),n.current=function({botUsername:r,scriptHost:i}){let a=document.createElement("script"),{origin:s}=new URL(i);return a.async=!0,a.src=`${s}/js/telegram-login.js`,a.setAttribute("data-telegram-login",r),a.setAttribute("data-request-access","write"),a.setAttribute("data-lang","en"),a}(t),e.current?.after(n.current)},[t]),m.jsx("div",{ref:e,hidden:!0})}const bYe=()=>{let{ready:t,wallets:e}=KS();return L.useEffect(()=>{if(!t)return;let n=e.map(r=>({address:r.address,connectorType:r.connectorType,walletClientType:r.walletClientType,connectedAt:r.connectedAt,id:r.meta.id}));nt.put(wV,n)},[t,e]),null}
721,_Ye=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class En extends Error{constructor(e,n){super(n),this.type=e}}function sf(t){let e=t.type;return typeof e=="string"&&_Ye.includes(e)}function om(t){return sf(t)&&t.type==="wallet_not_on_device"}function tct(t){return sf(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function nct(t){return!!sf(t)&&t.type==="mfa_timeout"}function rct(t){return!!sf(t)&&t.type==="missing_or_invalid_mfa"}function ict(t){return!!sf(t)&&t.type==="mfa_verification_max_attempts_reached"}function act(t){return!(!sf(t)||!t.message.includes("code 429"))}function sct(t){return!!function(e){let n=e.type;return typeof n=="string"&&n==="client_error"}(t)&&t.message==="MFA canceled"}async function Di(t,e,n,r,i,a=!1){let s=a,o=async l=>{if(s&&e&&e.length>0){l===(a?0:1)?i("configureMfa","onMfaRequired",{mfaMethods:e}):r.current?.reject(new En("missing_or_invalid_mfa","MFA verification failed, retry."));let u=await new Promise((d,f)=>{n.current={resolve:d,reject:f},setTimeout(()=>{let h=new En("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(h),f(h)},3e5)});return await t(u)}return await t()},c=null;for(let l=0;l<4;l++)try{c=await o(l),r.current?.resolve(void 0);break}catch(u){if(u.type!=="missing_or_invalid_mfa")throw r.current?.resolve(void 0),u;s=!0}if(c===null){let l=new En("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(l),l}return c}var lM;let CYe=(lM=0,()=>"id-"+lM++);function Zn(t){return t.error!==void 0}let Fn=new class{enqueue(t,e){this.callbacks[t]=e}dequeue(t,e){let n=this.callbacks[e];if(!n)throw Error(`cannot dequeue ${t} event: no event found for id ${e}`);switch(delete this.callbacks[e],t){case"privy:iframe:ready":case"privy:user-signer:sign":case"privy:wallets:add":case"privy:wallets:import":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:auth:unlink-passkey":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:delegated-actions:consent":return n;default:throw Error(`invalid wallet event type ${t}`)}}constructor(){this.callbacks={}}},u7=new Map,EYe=(t,e)=>typeof e=="bigint"?e.toString():e;function Kn(t,e,n,r){let i=n.contentWindow;if(!i)throw Error("iframe not initialized");let a=((o,c)=>`${o}${JSON.stringify(c,EYe)}`)(t,e);if(t==="privy:wallet:create"||t==="privy:wallets:add"||t==="privy:solana-wallet:create"){let o=u7.get(a);if(o)return o}let s=new Promise((o,c)=>{let l=CYe();Fn.enqueue(l,{resolve:o,reject:c}),i.postMessage({id:l,event:t,data:e},r)}).finally(()=>{u7.delete(a)});return u7.set(a,s),s}function SYe(t){let e=BE(),n=L.useRef(null),r=L.useRef(t.mfaMethods),i=Vu(),[a,s]=L.useState(!1);return r.current=t.mfaMethods,L.useEffect(()=>{if(!a)return;let o=n.current;if(!o)return;function c(d){var f;d&&d.origin===t.origin&&typeof(f=d.data).event=="string"&&/^privy:.+/.test(f.event)&&function(h){switch(h.event){case"privy:iframe:ready":let p=Fn.dequeue(h.event,h.id);return Zn(h)?p.reject(new En(h.error.type,h.error.message)):p.resolve(h.data);case"privy:user-signer:sign":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:wallets:add":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:wallets:set-recovery":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:wallets:connect":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:wallets:recover":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:wallets:rpc":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:wallet:create":let g=Fn.dequeue(h.event,h.id);return Zn(h)?g.reject(new En(h.error.type,h.error.message)):g.resolve(h.data);case"privy:wallets:import":let y=Fn.dequeue(h.event,h.id);return Zn(h)?y.reject(new En(h.error.type,h.error.message)):y.resolve(h.data);case"privy:mfa:verify":let v=Fn.dequeue(h.event,h.id);return Zn(h)?v.reject(new En(h.error.type,h.error.message)):v.resolve(h.data);case"privy:mfa:init-enrollment":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:mfa:submit-enrollment":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:mfa:unenroll":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:mfa:clear":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:auth:unlink-passkey":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:solana-wallet:create":let b=Fn.dequeue(h.event,h.id);return Zn(h)?b.reject(new En(h.error.type,h.error.message)):b.resolve(h.data);case"privy:farcaster:init-signer":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:farcaster:sign":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}case"privy:delegated-actions:consent":{let w=Fn.dequeue(h.event,h.id);return Zn(h)?w.reject(new En(h.error.type,h.error.message)):w.resolve(h.data)}default:console.warn("Unsupported wallet proxy method:",h)}}(d.data)}let l={signWithUserSigner:d=>Di(f=>Kn("privy:user-signer:sign",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),addWallet:d=>Di(f=>Kn("privy:wallets:add",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),setRecovery:d=>Di(f=>Kn("privy:wallets:set-recovery",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),connect:d=>Di(f=>Kn("privy:wallets:connect",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),recover:d=>Di(f=>Kn("privy:wallets:recover",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i,!d.recoveryAccessToken&&!d.recoveryPassword&&!d.recoverySecretOverride),rpc:d=>Di(f=>Kn("privy:wallets:rpc",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),create:d=>Kn("privy:wallet:create",d,o,t.origin),importWallet:d=>Kn("privy:wallets:import",d,o,t.origin),createSolana:d=>Di(f=>Kn("privy:solana-wallet:create",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),createDelegatedAction:d=>Di(f=>Kn("privy:delegated-actions:consent",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),verifyMfa:d=>Di(f=>Kn("privy:mfa:verify",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i,!0),initEnrollMfa:d=>Di(f=>Kn("privy:mfa:init-enrollment",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),submitEnrollMfa:d=>Di(f=>Kn("privy:mfa:submit-enrollment",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),unenrollMfa:d=>Di(f=>Kn("privy:mfa:unenroll",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),clearMfa:d=>Kn("privy:mfa:clear",d,o,t.origin),unlinkPasskeyAccount:d=>Di(f=>Kn("privy:auth:unlink-passkey",{...d,...f},o,t.origin),r.current,t.mfaPromise,t.mfaSubmitPromise,i),initFarcasterSigner:d=>Kn("privy:farcaster:init-signer",d,o,t.origin),signFarcasterMessage:d=>Kn("privy:farcaster:sign",d,o,t.origin)};window.addEventListener("message",c);let u=new AbortController;return f8(()=>Kn("privy:iframe:ready",{}
721,o,t.origin),{abortSignal:u.signal}).then(()=>t.onLoad(l),(...d)=>{console.warn("Privy iframe failed to load: ",...d),t.onLoadFailed()}),()=>{window.removeEventListener("message",c),u.abort()}},[a]),e?m.jsx("iframe",{ref:n,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>s(!0),src:gWe({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets`,query:{caid:t.clientAnalyticsId,client_id:t.appClientId}})}):null}const AYe=({address:t,user:e})=>{let n=e.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===t);if(!n)throw new Q("Address to delegate is not associated with current user.");if(!Rv(n))throw new Q(`useDelegatedActions is not supported for ${n.chainType} wallets. Use the useSessionSigners hook to provision server side access on behalf of your users.`);return{address:n.address,chainType:n.chainType,walletIndex:n.walletIndex??0}},xYe=({address:t,user:e})=>{let n=e.linkedAccounts.find(i=>i.type==="wallet"&&i.walletClientType==="privy"&&i.address===t);if(!n)throw new Q("Address to delegate is not associated with current user.");let r=n.imported?n:Tp(e);if(!r)throw new Q("Unable to determine root address for delegated address.");if(!Rv(r))throw new Q(`useDelegatedActions is not supported for ${r.chainType} wallets. Use the useSessionSigners hook to provision server side access on behalf of your users.`);return{address:r.address,chainType:r.chainType,imported:r.imported}},uM=t=>t.linkedAccounts.filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.delegated),dM="popup-privy-oauth",fM="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";function IYe({isCreatingWallet:t,skipSplashScreen:e}){return t?"EmbeddedWalletPasswordCreateScreen":e?"EmbeddedWalletPasswordUpdateScreen":"EmbeddedWalletPasswordUpdateSplashScreen"}function TYe({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:n,isResettingPassword:r,showAutomaticRecovery:i}){return i?"SetAutomaticRecoveryScreen":n||e.length===1?IYe({isCreatingWallet:t==="create",skipSplashScreen:r}):"RecoverySelectionScreen"}function LYe(t){switch(t){case"user-passcode":return"PasswordRecoveryScreen";case"google-drive":case"icloud":return"RecoveryOAuthScreen";default:throw Error("Recovery method not supported")}}let kYe=["warpcast.com","farcaster.xyz"],$Ye=["farcaster","fid"];async function PYe(){if(globalThis.window!==void 0&&function(){if(globalThis.window===void 0)return!1;try{if(globalThis.document===void 0)return!1;let t=globalThis.window,e=globalThis.document,n=!1;if(e.referrer){let s=e.referrer.toLowerCase();n=kYe.some(o=>s.includes(o))}let r=!!t.farcaster,i=new URLSearchParams(t.location.search),a=$Ye.some(s=>i.has(s));return n||r||a}catch{return!1}}())try{await Ne(()=>import("./react-auth-FmFgRqLi.js"),[]),console.debug("[Privy] Farcaster Solana wallet registered")}catch(t){console.debug("[Privy] Farcaster Solana wallet not available (package may not be installed)"),function(){try{return typeof ur<"u"&&!1}catch{return!1}}()&&t&&console.debug("[Privy] Farcaster Solana init error:",t)}}function hM(t,e){if(t.onComplete)switch(e){case"external":t.fundingResult?t.onComplete({...t.fundingResult,fundingMethod:e}):t.onComplete({status:"cancelled",address:t.address,fundingMethod:e,amount:t.amount});break;case null:t.onComplete({status:"cancelled",address:t.address,fundingMethod:void 0,amount:t.amount});break;default:t.onComplete({status:"completed",address:t.address,fundingMethod:e,amount:t.amount})}}function oct(t,e,n,r,i,a,s){return{...t,funding:t?.funding?{...t.funding,fundingResult:{status:e,address:t.funding.address,fundingMethod:void 0,transactionHash:n,amount:t.funding.amount,assetType:i?a?.symbol||"ETH":s.nativeCurrency.symbol||"ETH",metadata:{walletClientType:r}}}:void 0,solanaFundingData:t?.solanaFundingData,sendTransaction:t?.sendTransaction}}const d7=new Map([["FundingMethodSelectionScreen",null],["TransferFromWalletScreen","external"],["FundingAmountEditScreen","external"],["ConnectOnlyLandingScreen","external"],["ConnectOnlyStatusScreen","external"],["AwaitingExternalEthereumTransferScreen","external"],["AwaitingEvmToSolBridgingScreen","external"],["AwaitingSolToEvmBridgingScreen","external"],["ManualTransferScreen","manual"],["MoonpayStatusScreen","moonpay"],["CoinbaseOnrampStatusScreen","coinbase-onramp"]]);function pM(t){let e=t.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>e.includes(n))}async function RYe({rpc:t,address:e}){return(await t.getBalance(e,{commitment:"confirmed"}).send()).value??0n}function OYe(){return function(){if(typeof window<"u")return window.Telegram}()?.WebApp?.initData||void 0}let MYe={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",line_oauth:"line",twitch_oauth:"twitch",twitter_oauth:"twitter",wallet:"siwe",smart_wallet:"siwe",cross_app:"privy:"};const NYe=t=>{if(rv(t))return{displayName:t.replace("custom:",""),loginMethod:"custom"};let e=MYe[t];return t==="wallet"||t==="phone"?{displayName:t,loginMethod:e}:{displayName:e,loginMethod:e}},DYe=()=>{let t=zr(),{user:e}=$i(),{client:n,refreshSessionAndUser:r,walletProxy:i}=Vt();return{migrate:L.useCallback(async()=>
721{if(t.embeddedWallets.mode==="legacy-embedded-wallets-only")return{success:!0,migrated:!1};if(!e)throw new Q("User must be authenticated before migrating wallets",fe.MUST_BE_AUTHENTICATED);if(!i)throw new Q("Cannot connect to wallet proxy");let a=await n.getAccessToken();if(!a)throw new Q("User must be authenticated before migrating wallets",fe.MUST_BE_AUTHENTICATED);let s=e.linkedAccounts.filter(l=>l.type==="wallet"&&l.walletClientType==="privy"&&Rv(l)&&!Ki(l));if(s.length===0)return{success:!0,migrated:!1};let o=s.filter(l=>l.imported),c=s.filter(l=>!l.imported);if(c.length>0){let l=c.find(f=>f.chainType==="ethereum"&&f.walletIndex===0)??c.find(f=>f.chainType==="solana"&&f.walletIndex===0)??null;if(!l)throw new Q("Primary wallet not found");let{entropyId:u,entropyIdVerifier:d}=Ky(l);try{await i.connect({accessToken:a,entropyId:u,entropyIdVerifier:d})}catch(f){if(!om(f)||l.recoveryMethod!=="privy")throw f;await i.recover({accessToken:a,entropyId:u,entropyIdVerifier:d})}await i.createDelegatedAction({accessToken:a,rootWallet:{address:l.address,chainType:l.chainType,imported:!1},delegatedWallets:c.map(f=>({address:f.address,chainType:f.chainType,walletIndex:f.walletIndex??0}))})}for(let l of o){let{entropyId:u,entropyIdVerifier:d}=Ky(l);try{await i.connect({accessToken:a,entropyId:u,entropyIdVerifier:d})}catch(f){if(!om(f)||l.recoveryMethod!=="privy")throw f;await i.recover({accessToken:a,entropyId:u,entropyIdVerifier:d})}await i.createDelegatedAction({accessToken:a,rootWallet:{address:l.address,chainType:l.chainType,imported:!0},delegatedWallets:[{address:l.address,chainType:l.chainType,walletIndex:l.walletIndex??0}]})}return await r(),{success:!0,migrated:!0}},[t.embeddedWallets.mode,e,i,n,r])}},FYe=({disabled:t})=>{let{migrate:e}=DYe(),{user:n}=$i(),{walletProxy:r}=Vt(),i=L.useRef(!1),a=L.useRef(0);return L.useEffect(()=>{t||a.current>2||i.current||!n||!r||(i.current=!0,a.current++,e().catch(s=>{console.debug("Unable to migrate wallets: ",s)}).finally(()=>{i.current=!1}))},[n,r,t,e]),null},UYe=t=>({id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}),th=()=>{let{ethereumEmbedded:t,ethereumExternal:e}=Xc.getState();return[...t,...e]},jYe=(t,e,n)=>!(Yc(t)||UE(t).length>0||n===!1||e!=="all-users"&&(e!=="users-without-wallets"||BYe(t).length));let BYe=t=>t.linkedAccounts.filter(e=>e.type==="wallet"&&e.chainType==="ethereum");const VYe=(t,e,n)=>!(gy(t)||jE(t).length>0||n===!1||e!=="all-users"&&(e!=="users-without-wallets"||HYe(t).length));let HYe=t=>t.linkedAccounts.filter(e=>e.type==="wallet"&&e.chainType==="solana");const WYe=Symbol("wallet-creation-on-login-plugin"),qYe=()=>{let{walletProxy:t,recoverEmbeddedWallet:e,setUser:n,refreshSessionAndUser:r,privy:i,client:a}=Vt(),s=zr();return{create:async({walletIndex:o,chainType:c,latestUser:l,recoveryMethod:u,recoveryPassword:d,recoveryAccessToken:f,idempotencyKey:h})=>{let p=l;p||(p=await r());let g=await a.getAccessToken();if(!p||!g||!t)throw Error("User must be authenticated before creating a Privy wallet");return await fK({appConfig:s,user:p,refreshSessionAndUser:r,privy:i,accessToken:g,proxy:t,recoverEmbeddedWallet:e,setUser:n,walletIndex:o,chainType:c,recoveryMethod:u,recoveryPassword:d,recoveryAccessToken:f,idempotencyKey:h})}}};function zYe({subscribe:t,getExternalJwt:e,enabled:n=!0,onAuthenticated:r,onUnauthenticated:i,onError:a}){let{client:s,setAuthenticated:o,setUser:c,setIsNewUser:l}=Vt(),{logout:u,authenticated:d,ready:f}=YS(),h=dje(),{create:p}=qYe(),g=zr();if(!s)throw new Q("`useSyncJwtBasedAuthState` must be used within a `PrivyProvider`");let[y,v]=L.useState({status:"initial"}),b=L.useRef(void 0),w=L.useRef(!1),_=L.useRef(e);L.useEffect(()=>{_.current=e},[e]);let E=L.useRef(r);L.useEffect(()=>{E.current=r},[r]);let C=L.useRef(i);L.useEffect(()=>{C.current=i},[i]);let x=L.useRef(a);L.useEffect(()=>{x.current=a},[a]);let $=L.useRef(p);L.useEffect(()=>{$.current=p},[p]);let T=L.useRef(g.embeddedWallets.ethereum.createOnLogin);L.useEffect(()=>{T.current=g.embeddedWallets.ethereum.createOnLogin},[g.embeddedWallets.ethereum.createOnLogin]);let U=L.useRef(g.embeddedWallets.solana.createOnLogin);L.useEffect(()=>{U.current=g.embeddedWallets.solana.createOnLogin},[g.embeddedWallets.solana.createOnLogin]);let O=L.useRef(c);L.useEffect(()=>{O.current=c},[c]);let F=L.useRef(l);L.useEffect(()=>{F.current=l},[l]);let k=L.useRef(o);return L.useEffect(()=>{k.current=o},[o]),L.useEffect(()=>{if(!n||!f)return;let S=async()=>
721{if(!w.current){w.current=!0;try{v({status:"loading"});let I=await _.current();if(b.current!==void 0&&b.current===I)return void v({status:"done"});if(!I)return d&&(await u(),C.current?.()),b.current=I,void v({status:"done"});s.startAuthFlow(new rK(I));let{user:A,isNewUser:R=!1}=await s.authenticate();if(!A)throw new Q("Failed to sync with custom auth provider");E.current?.({user:A,isNewUser:R}),O.current(A),F.current(R),k.current(!0);let N=h(WYe)?.shouldCreateWallet({user:A}),P=jYe(A,T.current,N),j=VYe(A,U.current,N);if(P&&j){let M=await $.current({chainType:"ethereum",walletIndex:0,latestUser:A});await $.current({chainType:"solana",walletIndex:0,latestUser:M.user})}else j?await $.current({chainType:"solana",walletIndex:0,latestUser:A}):P&&await $.current({chainType:"ethereum",walletIndex:0,latestUser:A});b.current=I,v({status:"done"})}catch(I){if(console.warn(I),await u().catch(()=>{}),C.current?.(),I instanceof by&&I.privyErrorCode===fe.LINKED_TO_ANOTHER_USER)return v({status:"initial"}),void setTimeout(()=>{S()},0);x.current?.(I),v({status:"error",error:I})}finally{w.current=!1}}};return S(),t(S)},[t,s,d,u,n,f,h]),n?{state:y}:{state:{status:"not-enabled"}}}let ZYe=Pi(()=>({jwtAuthFlowState:{status:"not-enabled"}}));function KYe({customAuth:t}){let{jwtAuthFlowState:e}=function({customAuth:n}){let r=Vu(),i=L.useRef(void 0),a=L.useCallback(c=>(i.current=c,()=>{i.current=void 0}),[]),s=n?.getCustomAccessToken??(()=>Promise.resolve(void 0)),{state:o}=zYe({enabled:n?.enabled===!0,subscribe:a,getExternalJwt:s,onAuthenticated:({user:c,isNewUser:l})=>{r("login","onComplete",{user:c,isNewUser:l,wasAlreadyAuthenticated:!1,loginMethod:"custom",loginAccount:null}),r("customAuth","onAuthenticated",{user:c})},onUnauthenticated:()=>{r("customAuth","onUnauthenticated")},onError:c=>{r("login","onError",c.privyErrorCode||fe.UNKNOWN_AUTH_ERROR)}});return L.useEffect(()=>{(async()=>n&&!n.isLoading&&i.current?.())()},[n?.enabled,n?.getCustomAccessToken,n?.isLoading]),{jwtAuthFlowState:o}}({customAuth:t});return L.useEffect(()=>{ZYe.setState({jwtAuthFlowState:e})},[e]),null}const GYe=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"];class tr extends Error{constructor(e,n,r){super(e),this.code=n,this.data=r}}class YYe extends ll{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new tr(`Invalid params for ${e.method}`,4200);let n=e.params[0];if(Vd(n))throw new tr("Tempo (type 118) transactions are not supported via the EIP-1193 provider. Use useSendTransaction from @privy-io/react-auth/tempo instead.",4200);if(!await kn()||!this.address)throw new tr("Disconnected",4900);let r={...n,chainId:n.chainId??$1(this.chainId)},{hash:i}=await aJe(r,{address:this.address});return i}async handleSignTransaction(e){if(!e.params||!Array.isArray(e.params))throw new tr(`Invalid params for ${e.method}`,4200);let n=e.params[0];if(Nje(n))return this.handleSignTempoTransaction(n);if(!await kn()||!this.address)throw new tr("Disconnected",4900);let r={...n,chainId:n.chainId??$1(this.chainId)},{signature:i}=await iJe(r,{address:this.address});return i}async handleSignTempoTransaction(e){let n,r=await kn();if(!r||!this.address)throw new tr("Disconnected",4900);let i=this.walletAccount;if(!i||!Ki(i))throw new tr("Tempo (type 118) transactions are only supported on Unified embedded wallets",4200);let a=this.privyClient;if(!a)throw new tr("Disconnected",4900);try{n=JB(Dje(e))}catch(o){throw new tr(o instanceof Error?o.message:"Invalid Tempo transaction",4200)}let s=await ya(a,async({message:o})=>this.walletProxy.signWithUserSigner({accessToken:r,message:o}),{chain_type:"ethereum",method:"eth_signTransaction",wallet_id:i.id,params:{transaction:n}});if(s.method!=="eth_signTransaction"||!("signed_transaction"in s.data))throw new tr("Unable to sign transaction",4200);return s.data.signed_transaction}handleSwitchEthereumChain(e){let n;if(!e.params||!Array.isArray(e.params))throw new tr(`Invalid params for ${e.method}`,4200);if(typeof e.params[0]=="string")n=e.params[0];else{if(!("chainId"in e.params[0])||typeof e.params[0].chainId!="string")throw new tr(`Invalid params for ${e.method}`,4200);n=e.params[0].chainId}this.chainId=Number(n),this.publicClient=_y(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}
721),this.emit("chainChanged",n)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let n=e.params[0],r=e.params[1],{signature:i}=await nJe({message:n},{address:r});return i}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let n=e.params[0],r=typeof e.params[1]=="string"?JSON.parse(e.params[1]):e.params[1],i=e.params[2],{signature:a}=await rJe(Ey(r),{address:n,signatureOptions:i?.signatureOptions,caip2:i?.caip2});return a}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");if(delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas,Vd(e.params[0]))throw new tr("Tempo (type 118) transactions are not supported via the EIP-1193 provider. Use useSendTransaction from @privy-io/react-auth/tempo instead.",4200);let n={...e.params[0],chainId:$1(this.chainId)};return await this.publicClient.estimateGas({account:n.from??this.address,...Yg(n)})}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return $1(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"eth_signTransaction":return this.handleSignTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!(n=>GYe.includes(n))(e.method))return this.publicClient.request({method:e.method,params:e.params});{let n=await kn();if(await sJe({address:this.address}),!n||!this.address)throw new tr("Disconnected",4900);try{let r={method:e.method,params:e.params},i=this.walletAccount;return i&&Ki(i)?this.handleWalletApiRequest(r,i,n):(await this.walletProxy.rpc({accessToken:n,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:r})).response.data}catch(r){throw console.error(r),new tr("Disconnected",4900)}}}async handleWalletApiRequest(e,n,r){let i=this.privyClient;if(!i)throw new tr("Disconnected",4900);if(e.method==="secp256k1_sign"){let a=await ya(i,async({message:s})=>this.walletProxy.signWithUserSigner({accessToken:r,message:s}),{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:n.id,params:{hash:e.params[0]}});if(a.method!=="secp256k1_sign")throw new tr(`Invalid params for ${e.method}`,4200);return a.data.signature}throw new tr(`Method not supported: ${e.method}`,4200)}constructor({walletProxy:e,address:n,entropyId:r,entropyIdVerifier:i,rpcConfig:a,chains:s,appId:o,chainId:c=1,walletIndex:l,privyClient:u,walletAccount:d}){super(),this.walletProxy=e,this.address=n,this.entropyId=r,this.entropyIdVerifier=i,this.chainId=c,this.rpcConfig=a,this.chains=s,this.publicClient=_y(c,this.chains,a,{appId:o}),this.rpcTimeoutDuration=ZE(a,"privy"),this.appId=o,this.walletIndex=l,this.privyClient=u,this.walletAccount=d}}const JYe=({...t}={})=>m.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});let XYe=[],QYe={};const eJe=()=>((()=>{let t=zr(),{user:e}=$i(),{walletProxy:n,privy:r}=Vt(),{fundWallet:i}=SVe(),[a,s]=L.useState(QYe),o=L.useRef(i);L.useEffect(()=>{o.current=i},[i]);let c=L.useMemo(()=>e&&n?e.linkedAccounts.filter(l=>l.type==="wallet"&&l.chainType==="ethereum"&&l.walletIndex!==null&&l.walletClientType==="privy"):XYe,[e,n]);L.useEffect(()=>{if(c.length<1)return void Xc.setState({ethereumEmbedded:[]});let l=HE(),u=c.map(d=>{let f=a[d.address]??t.defaultChain.id,h=()=>
721{if(!e||!n)throw new Q("User not ready");let{entropyId:g,entropyIdVerifier:y}=Dc(e,d);return new YYe({walletProxy:n,address:d.address,entropyId:g,entropyIdVerifier:y,rpcConfig:t.rpcConfig,chains:t.chains,appId:t.id,chainId:f,walletIndex:d.walletIndex,privyClient:r,walletAccount:d})},p=l.find(g=>g.address===d.address&&g.connectorType===d.connectorType&&g.walletClientType===d.walletClientType)?.connectedAt??d.firstVerifiedAt?.getTime()??Date.now();return{fund:async g=>{await o.current({address:d.address,options:g})},type:"ethereum",chainId:`eip155:${f}`,switchChain:async g=>{s(y=>({...y,[d.address]:Number(g)}))},getEthereumProvider:async()=>h(),sign:async g=>await h().request({method:"personal_sign",params:[An(g),d.address]}),address:d.address,connectedAt:p,walletClientType:"privy",connectorType:d.imported?"embedded_imported":"embedded",imported:d.imported,meta:{name:"Privy Wallet",icon:JYe,id:"io.privy.wallet"},isConnected:async()=>!0,disconnect:()=>{},linked:!0,loginOrLink:async()=>{throw new Q("Cannot link or login with embedded wallet")},unlink:async()=>{throw new Q("Cannot unlink with embedded wallet")},walletIndex:d.walletIndex}});Xc.setState(d=>d.ethereumEmbedded.length===u.length&&d.ethereumEmbedded.every((f,h)=>{let p=u[h];return f.address===p.address&&f.chainId===p.chainId&&f.connectorType===p.connectorType&&f.connectedAt===p.connectedAt})?{}:{ethereumEmbedded:u})},[c,t.chains,t.defaultChain.id,t.id,t.rpcConfig,a,r,e,n])})(),null);let gY,yY,mY,vY,wY;const tJe=t=>{let e=t.client,n=t.privy,r=zr();$H(v8(r?.appearance.walletList??[]));let[i,a]=L.useState(!1),s=qp(D=>D.inProgressMfaFlow),[o,c]=L.useState(!1),l=Wo(D=>D.user),[u,d]=L.useState(void 0),[f,h]=L.useState(!1),[p,g]=L.useState(null),[y,v]=L.useState(!1),[b,w]=L.useState({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:ue}),[_,E]=L.useState({status:"initial"}),[C,x]=L.useState({status:"initial"}),[$,T]=L.useState({status:"initial"}),[U,O]=L.useState({status:"initial"}),[F,k]=L.useState({status:"initial"}),[S,I]=L.useState({status:"initial"}),[A,R]=L.useState(null),N=BE(),{initializationError:P,setInitializationError:j}=A4e(),[M,V]=L.useState({}),[B,G]=L.useState(null),Z=L.useRef(null),ie=L.useRef(null),oe=L.useRef(null),z=L.useRef(zje),J=Wo(D=>D.authenticated),K=L.useCallback(D=>{Bje(D),!D&&p&&e6[p]().then(W=>{W.default.isUnauthenticatedScreem&&g(null)})},[p]);e.onStoreCustomerAccessToken=D=>{D&&ve(z,"accessToken","onAccessTokenGranted",{accessToken:D})},e.onDeleteCustomerAccessToken=()=>{Xt(null),K(!1),ve(z,"accessToken","onAccessTokenRemoved")};let ne=L.useRef(null),ce=L.useRef(null),xe=L.useRef(!1),ke=({showWalletUIs:D})=>xe.current?xe.current:D!==void 0?!D:!r.embeddedWallets.showWalletUIs,Me=D=>{g(D),setTimeout(()=>{a(!!D)},15)};L.useEffect(()=>{A&&Z.current?.(A)},[A]),L.useEffect(()=>{if(r.externalWallets.solana.connectors)return r.externalWallets.solana.connectors.onMount(),()=>r.externalWallets.solana.connectors?.onUnmount()},[r.externalWallets.solana.connectors]),L.useEffect(()=>{PYe()},[]),L.useEffect(()=>{!o&&N&&async function(){let D,W=$t(),X=H(),Y=DD();e.initializeConnectorManager({walletConnectCloudProjectId:r.walletConnectCloudProjectId,rpcConfig:r.rpcConfig,chains:r.chains,defaultChain:r.defaultChain,store:Y,walletList:r.appearance.walletList,shouldEnforceDefaultChainOnConnect:r.shouldEnforceDefaultChainOnConnect,externalWalletConfig:r.externalWallets,appName:r.name??"Privy",walletChainType:r.appearance.walletChainType,setBaseAccountSdk:d,connectorsDebugLogs:r.connectorsDebugLogs}),e.connectors?.on("connectorInitialized",()=>{D&&clearTimeout(D);let me=e.connectors.walletConnectors.length,Ee=e.connectors.walletConnectors.reduce((ot,wt)=>ot+(wt.initialized?1:0),0);Ee===me?XR(!0):D=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:Ee,expected:me}),XR(!0)},1500)}),e.connectors?.initialize().then(()=>{ye()});let ae=await e.getAuthenticatedUser();if(Vje(!0),X&&ae){let me,Ee=e.authFlow;if(Ee.meta.telegramWebAppData?.user)try{me=String(JSON.parse(Ee.meta.telegramWebAppData.user).id)}catch{}let ot=ae.telegram?.telegramUserId;me&&ot!==me&&(await e.logout(),e.startAuthFlow(Ee),ae=null)}let le=!!ae;return r.legal.requireUsersAcceptTerms&&ae&&!ae.hasAcceptedTerms?(await e.logout(),st.setReadyToTrue(!0),void ve(z,"logout","onSuccess")):(r.customAuth?.enabled||(K(!!ae),ae&&ve(z,"login","onComplete",{user:ae,isNewUser:!1,wasAlreadyAuthenticated:!0,loginMethod:null,loginAccount:null}),Xt(ae)),W?void(ce.current=le?"link":"login"):X&&!le||q(!!ae)&&!le?(ce.current="login",ne.current="telegram",V({telegramAuthModalData:{seamlessAuth:!0}}),void Me("TelegramAuthScreen")):void st.setReadyToTrue(!!ae))}().catch(D=>{let W=D instanceof Error?D:Error(String(D));j(W),console.warn("Error initializing Privy provider: ",W)})},[e,B,o,N,j]),L.useEffect(()=>{e.connectors?.setWalletList(r.appearance.walletList)},[r.appearance.walletList.join()]);let $t=()=>{let D=Xb();return D.inProgress&&D.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):D.authorizationCode==="error"?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:D.stateCode,authorizationCode:D.authorizationCode}):(D.inProgress&&D.provider.startsWith("privy:")&&!D.popupFlow&&(new BroadcastChannel(dM).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:D.stateCode,authorizationCode:D.authorizationCode}),window.close()),!!D.inProgress&&!!D.withPrivyUi&&(e.startAuthFlow(new Ed({...D,customOAuthRedirectUrl:r.customOAuthRedirectUrl})),Me("OAuthStatusScreen"),!0))},H=()=>
721{if(!r.loginConfig.telegramHasHmacCredentials)return;let D=function(){let X;return(X=function(){let Y=new URLSearchParams(window.location.search),ae=Number(Y.get("id")||""),le=Y.get("hash"),me=Number(Y.get("auth_date")||""),Ee=Y.get("first_name");if(ae&&Ee&&me&&le)return Object.fromEntries(Y.entries())}())?(sM(),{flowType:"login-url",authData:X}):(X=function(){let Y=window.location.hash;if(!Y||!Y.startsWith("#tgWebAppData"))return;let ae=aM(Y.replace("#tgWebAppData=","")),{user:le,auth_date:me,hash:Ee}=ae;return le&&me&&Ee?ae:void 0}())?(sM(),{flowType:"web-app",authData:X}):void 0}();if(!D||!r.loginMethods.telegram||!r.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let W=new yd;return e.startAuthFlow(W),D.flowType==="login-url"&&(W.meta.telegramWebAppData=void 0,W.meta.telegramAuthResult=D.authData),D.flowType==="web-app"&&(W.meta.telegramAuthResult=void 0,W.meta.telegramWebAppData=D.authData),!0},q=D=>{if(!r.loginMethods.telegram||r.loginConfig.telegramHasHmacCredentials||!r.loginConfig.telegramSeamlessAuthEnabled||D)return!1;let W=OYe();if(!W)return!1;let X=function(ae){try{let le=ae.split("&").filter(Ee=>Ee.length>0).map(Ee=>{let ot=Ee.indexOf("=");return ot===-1?[decodeURIComponent(Ee),""]:[decodeURIComponent(Ee.slice(0,ot)),decodeURIComponent(Ee.slice(ot+1))]}),me=Object.fromEntries(le);return me.signature?me:null}catch{return null}}(W);if(!X)return!1;let Y=new yd;return e.startAuthFlow(Y),Y.meta.telegramAuthResult=void 0,Y.meta.telegramWebAppData=X,!0},se=async(D,W,X,Y)=>{if(D!=="solana_adapter")de(await e.connectors?.createEthereumWalletConnector({connectorType:D,walletClientType:W})||null,W,X,Y);else{let ae=e.connectors?.findSolanaWalletConnector(W);if(!ae)return;de(ae,W,X,Y)}};async function de(D,W,X,Y){if(!D)return w({status:"disconnected",connectedWallet:null,connectError:new dn("Unable to connect to wallet."),connector:null,connectRetry:ue}),Y?.(null,X);w({status:"disconnected",connectedWallet:null,connectError:null,connector:D,connectRetry:ue}),D instanceof Sb&&W&&await D.resetConnection(W),w({connector:D,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>de(D,W,X,Y)});try{let ae=await D.connect({showPrompt:!0});return ae&&Sc(ae)&&await CVe(ae,r,()=>{w(le=>({...le,connector:D,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:ue}))}),w(le=>({...le,status:"connected",connectedWallet:ae,connectError:null,connectRetry:ue})),ae&&ve(z,"connectWallet","onSuccess",{wallet:ae}),Y?.(ae,X)}catch(ae){return ae instanceof dl?(console.warn(ae.cause?ae.cause:ae.message),ve(z,"connectWallet","onError",ae.privyErrorCode||fe.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(ae),ve(z,"connectWallet","onError",fe.UNKNOWN_CONNECT_WALLET_ERROR)),w(le=>({...le,status:"disconnected",connectedWallet:null,connectError:ae})),Y?.(null,X)}}let he=async(D,W,X)=>{if(D===null||!Sc(D))return;let Y=new ig(e,D,W,X);e.startAuthFlow(Y)},pe=async(D,W,X,Y="plain")=>{let ae=Pd(rBe);
721if(Y==="transaction"&&!ae)throw new Q("useSolanaLedger plugin hook must be mounted");if(D===null||!r8e(D))return;let le=new iM(D,e,W,X,Y,ae);e.startAuthFlow(le)},ye=async()=>{let D=new URLSearchParams(window.location.search),W=D.get("privy_connector"),X=D.get("privy_wallet_client"),Y=D.get("privy_connect_only")==="true";if(!W||!X)return;Ce.debug("Mobile wallet return detected",{connectorType:W,wallet:X,connectOnly:Y});let ae=e8e({connectorType:W,walletClientType:X});if(!ae||!ae.isInstalled)return Ce.warn("Wallet not installed on mobile return",{wallet:X,hasConfig:!!ae,isInstalled:ae?.isInstalled}),Me("LoginFailedScreen");if(!e.connectors)throw new Q("Connector not initialized");await Me(Y?"ConnectOnlyStatusScreen":"ConnectionStatusScreen");let le=new URL(window.location.href);le.searchParams.delete("privy_connector"),le.searchParams.delete("privy_wallet_client"),le.searchParams.delete("privy_connect_only"),window.history.pushState({},"",le),Ce.debug("Launching connection flow from mobile return",{wallet:X,connectorType:W,connectOnly:Y}),se(W,X,void 0,Y?void 0:W==="solana_adapter"?pe:he)};L.useEffect(()=>{o&&J&&l===null&&e.getAuthenticatedUser().then(Xt)},[o,J,l,e]);let ge=D=>{if(!J)throw ve(z,"linkAccount","onError",fe.MUST_BE_AUTHENTICATED,{linkMethod:D}),new Q("User must be authenticated before linking an account.")},Pe=D=>{if(!J||!l)return!1;if(D.walletClientType==="privy")return!0;for(let W of l.linkedAccounts)if(W.type==="wallet"&&W.address===D.address&&W.walletClientType!=="privy")return!0;return!1},_e=()=>{Xc.setState(D=>{let W=e.connectors?.wallets.filter(Sc).map(X=>({...X,linked:Pe(X),loginOrLink:async()=>{if(!await X.isConnected())throw new Q("Wallet is not connected");if(X.connectorType==="embedded"&&X.walletClientType==="privy")throw new Q("Cannot link or login with embedded wallet");(async Y=>{let ae;if(!e.connectors)throw new Q("Connector not initialized");ae=Y.type==="ethereum"?e.connectors.findWalletConnector(Y.connectorType,Y.walletClientType)||null:e.connectors.findSolanaWalletConnector(Y.walletClientType)||null,w(le=>({...le,connector:ae,status:"connected",connectedWallet:Y,connectError:null,connectRetry:ue})),r.captcha.enabledProvider&&!J?(V({captchaModalData:{callback:le=>Sc(Y)?he(Y,le):pe(Y,le),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),await Me("CaptchaScreen")):(Sc(Y)?await he(Y):await pe(Y),await Me("ConnectionStatusScreen"))})(X)},fund:async Y=>{await st.fundWallet(X.address,Y)},unlink:async()=>{if(!J)throw new Q("User is not authenticated.");if(X.connectorType==="embedded"&&X.walletClientType==="privy")throw new Q("Cannot unlink an embedded wallet");Xt(await e.unlinkEthereumWallet(X.address))}}))||[];return PH(D.ethereumExternal,W)?{}:{ethereumExternal:W}})};L.useEffect(()=>{_e()},[l?.linkedAccounts,J,o]),L.useEffect(()=>{if(o){if(!e.connectors)throw new Q("Connector not initialized");_e(),e.connectors.on("walletsUpdated",_e)}},[o]),L.useEffect(()=>{[...r.loginMethodsAndOrder?.primary??[],...r.loginMethodsAndOrder?.overflow??[]].filter(D=>D.startsWith("privy:")).forEach(D=>e.getCrossAppProviderDetails(D.replace("privy:","")))},[!!e]);let Ie=({transaction:D,sponsor:W,uiOptions:X,fundWalletConfig:Y,address:ae,signOnly:le})=>new Promise(async(me,Ee)=>{let{requesterAppId:ot}=X||{},wt=le?"signTransaction":"sendTransaction",an=ae?_d(l,ae):Yc(l);if(!an&&ae){let It=I1(th(),ae);if(It){if(W)return Ee(new Q("Cannot sponsor transactions for externally connected wallet.")),void ve(z,wt,"onError",fe.TRANSACTION_FAILURE);try{let _n=await It.getEthereumProvider(),ht=D.data,Nn=Pd(xO);Nn&&(ht=Nn.appendDataSuffix({data:ht}));let Cn={...D,from:ae,chainId:D.chainId||Number(It.chainId.replace("eip155:","")),value:D.value!==void 0?An(D.value):void 0,data:ht},we=await _n.request({method:wt==="sendTransaction"?"eth_sendTransaction":"eth_signTransaction",params:[Cn]});return ve(z,wt,"onSuccess",{hash:we}),void me({hash:we})}catch(_n){return ve(z,wt,"onError",fe.TRANSACTION_FAILURE),void Ee(_n??new ps("Unable to "+wt+_n))}}}if(!an)return ve(z,wt,"onError",fe.EMBEDDED_WALLET_NOT_FOUND),void Ee(new Q("No embedded or connected wallet found for address."));if(!J||!l)return ve(z,wt,"onError",fe.MUST_BE_AUTHENTICATED),void Ee(Error("User must be authenticated before signing with a Privy wallet"));let Gt=an.address,bn=an.walletIndex??0,{entropyId:ct,entropyIdVerifier:Yt}=Dc(l,an),Mn=I1(th(),Gt);if(!Mn)return ve(z,wt,"onError",fe.EMBEDDED_WALLET_NOT_FOUND),void Ee(Error("Mu
721st have a Privy wallet before signing"));let xr=await Mn.getEthereumProvider(),$a=await xr.request({method:"eth_chainId"}),fi=D.chainId?Number(D.chainId):lK($a);(It=>{if(!r.chains.map(_n=>_n.id).includes(It))throw new dn(`Chain ID ${It} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,fe.UNSUPPORTED_CHAIN_ID)})(fi);let Kr=Pd(xO),Qs=D.data;Kr&&!W&&(Qs=Kr.appendDataSuffix({data:Qs}));let hi={...D,from:D.from??Gt,chainId:fi,data:Qs},Gr=await kn();if(!Gr||!A)return ve(z,wt,"onError",fe.EMBEDDED_WALLET_NOT_FOUND),void Ee(Error("Must have valid access token and Privy wallet to send transaction"));let gf=_y(hi.chainId,r.chains,r.rpcConfig,{appId:t.appId}),yf=Ki(an),X0=async({transactionRequest:It})=>{try{let _n;if(!await st.recoverEmbeddedWallet({address:Gt}))throw ve(z,wt,"onError",fe.UNKNOWN_CONNECT_WALLET_ERROR),Ee(Error("Unable to connect to wallet")),Error("Unable to connect to wallet");if(W){let ht=await(async({transactionRequest:Nn})=>{if(!yf)throw new Q("Sponsoring is only supported for wallets on the TEE stack");if(le)throw new Q("Cannot sponsor a sign transaction request");let Cn=ec=>ec==null?void 0:An(ec),we=await ya(n,async({message:ec})=>await A.signWithUserSigner({accessToken:Gr,requesterAppId:ot,message:ec}),{chain_type:"ethereum",method:"eth_sendTransaction",caip2:Ph(An(Nn.chainId)),sponsor:!0,...Kr?{experimental_data_suffix:Kr.suffix}:{},params:{transaction:{from:Nn.from,to:Nn.to,chain_id:Cn(Nn.chainId),data:xo(Nn.data)?Nn.data?Nn.data:An(Uint8Array.from(Nn.data)):void 0,value:Cn(Nn.value)}},wallet_id:an.id});if(we.data&&"hash"in we.data)return we.data.hash;throw new ps("Unable to sign transaction")})({transactionRequest:It});return ve(z,"sendTransaction","onSuccess",{hash:ht}),ht}if(yf){let ht=Cn=>{if(Cn!=null)return xo(Cn)?Cn:An(Cn)},Nn=await ya(n,async({message:Cn})=>await A.signWithUserSigner({accessToken:Gr,requesterAppId:ot,message:Cn}),{chain_type:"ethereum",method:"eth_signTransaction",params:{transaction:{from:It.from,to:It.to,nonce:ht(It.nonce),chain_id:ht(It.chainId),data:xo(It.data)?It.data?It.data:An(Uint8Array.from(It.data)):void 0,value:ht(It.value),type:It.type,gas_limit:ht(It.gasLimit??It.gas),gas_price:ht(It.gasPrice??It.gas),max_fee_per_gas:ht(It.maxFeePerGas),max_priority_fee_per_gas:ht(It.maxPriorityFeePerGas)}},wallet_id:an.id});if(!Nn.data||!("signed_transaction"in Nn.data))throw new ps("Unable to sign transaction");_n=Nn.data.signed_transaction}else _n=await async function({accessToken:ht,entropyId:Nn,entropyIdVerifier:Cn,transactingWalletIndex:we,walletProxy:ec,transactionRequest:u6,requesterAppId:ss}){return(await ec.rpc({entropyId:Nn,entropyIdVerifier:Cn,hdWalletIndex:we??0,chainType:"ethereum",accessToken:ht,requesterAppId:ss,request:{method:"eth_signTransaction",params:[u6]}})).response.data}({accessToken:Gr,entropyId:ct,entropyIdVerifier:Yt,transactingWalletIndex:bn,walletProxy:A,transactionRequest:It,requesterAppId:ot});if(le)return ve(z,"signTransaction","onSuccess",{signature:_n}),_n;{let ht=await gf.sendRawTransaction({serializedTransaction:_n});return ve(z,"sendTransaction","onSuccess",{hash:ht}),ht}}catch(_n){throw ve(z,wt,"onError",fe.TRANSACTION_FAILURE),_n}};if(ke({showWalletUIs:X?.showWalletUIs}))try{let It=le||W?hi:await JR(hi,gf,hi.from),_n=await X0({transactionRequest:It});le?ve(z,"signTransaction","onSuccess",{signature:_n}):ve(z,"sendTransaction","onSuccess",{hash:_n}),me({hash:_n})}catch(It){ve(z,wt,"onError",fe.TRANSACTION_FAILURE),Ee(It)}else{let It={connectingWalletAddress:Gt,recoveryMethod:an.recoveryMethod,entropyId:ct,entropyIdVerifier:Yt,onCompleteNavigateTo:"SendTransactionScreen",isUnifiedWallet:yf,onFailure:ht=>{ve(z,wt,"onError",fe.UNKNOWN_CONNECT_WALLET_ERROR),Ee(ht)}},_n=(ht=>!!ht.fundingConfig&&GS(ht.fundingConfig.options).length>=1)(r)?eO({address:Gt,appConfig:r,fundWalletConfig:Y,methodScreen:"FundingMethodSelectionScreen",chainIdOverride:hi.chainId,comingFromSendTransactionScreen:!0}):void 0;V({connectWallet:It,sendTransaction:{transactionRequest:hi,transactingWalletIndex:bn,transactingWalletAddress:Gt,entro
721pyId:ct,entropyIdVerifier:Yt,signOnly:le,scanTransaction:async()=>{let ht=await JR(hi,gf,hi.from);return await e.scanTransaction({metadata:{domain:r.embeddedWallets.transactionScanning.domain},chain_id:ht.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:ht.from,to:ht.to,value:ht.value?.toString(),gas:ht.gas?.toString(),gasPrice:ht.gasPrice?.toString(),nonce:ht.nonce?.toString(),data:ht.data}]}})},getIsSponsored:async()=>!!W,onConfirm:({transactionRequest:ht})=>X0({transactionRequest:ht}),onSuccess:ht=>{le?ve(z,"signTransaction","onSuccess",{signature:ht.hash}):ve(z,"sendTransaction","onSuccess",{hash:ht.hash}),me(ht)},onFailure:ht=>{ve(z,wt,"onError",fe.TRANSACTION_FAILURE),Ee(ht)},uiOptions:X||{},fundWalletConfig:Y,requesterAppId:ot},funding:_n}),Me("EmbeddedWalletConnectingScreen")}});function qe(){return new Promise(async(D,W)=>{if(!l||l.mfaMethods.length===0)return D();let X=await kn();if(!X||!A)throw Error("Must have valid access token to enroll in MFA");try{await A.verifyMfa({accessToken:X}),D()}catch(Y){W(Y)}})}let Fe=D=>D?.linkedAccounts.filter(W=>W.latestVerifiedAt!==null&&!(W.type==="wallet"&&W.walletClientType==="privy")).sort((W,X)=>X.latestVerifiedAt.getTime()-W.latestVerifiedAt.getTime())[0],pt=D=>{let W=l?.linkedAccounts.filter(ae=>ae.type===D).length??0,{displayName:X,loginMethod:Y}=NYe(D);if(D==="passkey"&&W>=5||D!=="passkey"&&W>=1)throw ve(z,"linkAccount","onError",fe.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:Y}),new Q(`User already has an account of type ${X} linked.`)};async function ze({showAutomaticRecovery:D=!1,legacySetWalletPasswordFlow:W=!1}){g(null);let X=W?"setWalletPassword":"setWalletRecovery";if(!J||!l)throw ve(z,X,"onError",fe.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let Y=Tp(l);if(!Y||!A)throw ve(z,X,"onError",fe.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");let ae=Ki(Y);if(ae)throw ve(z,X,"onError",fe.UNSUPPORTED_WALLET_TYPE),new Q("User owned wallet recovery is only supported for on-device execution and this app uses TEE execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");try{await qe()}catch(le){throw ve(z,X,"onError",fe.MISSING_MFA_CREDENTIALS),le}return new Promise((le,me)=>{let Ee=Y.recoveryMethod==="user-passcode",ot=TYe({walletAction:"update",availableRecoveryMethods:r.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:W,isResettingPassword:Ee,showAutomaticRecovery:D}),{entropyId:wt,entropyIdVerifier:an}=Dc(l),Gt={recoveryMethod:Y.recoveryMethod,connectingWalletAddress:Y.address,onCompleteNavigateTo:ot,shouldForceMFA:!1,entropyId:wt,isUnifiedWallet:
721ae,entropyIdVerifier:an,onFailure:bn=>{ve(z,X,"onError",fe.UNKNOWN_CONNECT_WALLET_ERROR),me(bn)}};V({setWalletPassword:{onSuccess:bn=>{ve(z,X,"onSuccess",{method:"user-passcode",wallet:bn}),le(bn)},onFailure:bn=>{ve(z,X,"onError",fe.USER_EXITED_SET_PASSWORD_FLOW),me(bn)},callAuthOnSuccessOnClose:!1},recoverWallet:{entropyId:wt,entropyIdVerifier:an,onFailure:me},connectWallet:Gt,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Ee,shouldCreateEth:!1,shouldCreateSol:!1}}),Me("EmbeddedWalletConnectingScreen")})}let Ue={ready:o,authenticated:J,user:l,error:P,walletConnectors:e.connectors||null,connectWallet:D=>{D&&"target"in D&&D&&(D=void 0),V({externalConnectWallet:{walletList:D?.walletList&&D?.walletList.length>0?D.walletList:void 0,walletChainType:D?.walletChainType,description:D?.description,hideHeader:D?.hideHeader}}),Me("ConnectOnlyLandingScreen")},linkWallet:D=>(D&&"target"in D&&D&&(D=void 0),ge("siwe"),ne.current="siwe",ce.current="link",V({...M,externalConnectWallet:{...M.externalConnectWallet,walletList:D?.walletList,walletChainType:D?.walletChainType,description:D?.description||`Link a wallet to your ${r?.name} account`}}),Me("AuthenticateWithWalletScreen")),linkEmail:()=>{ge("email"),pt("email"),ne.current="email",ce.current="link",Me("LinkEmailScreen")},linkPhone:()=>{ge("sms"),pt("phone"),ne.current="sms",ce.current="link",Me("LinkPhoneScreen")},linkGoogle:async()=>{ge("google"),pt("google_oauth"),ce.current="link",await st.initLoginWithOAuth("google")},linkTwitter:async()=>{ge("twitter"),pt("twitter_oauth"),ce.current="link",await st.initLoginWithOAuth("twitter")},linkTwitch:async()=>{ge("twitch"),pt("twitch_oauth"),ce.current="link",await st.initLoginWithOAuth("twitch")},linkDiscord:async()=>{ge("discord"),pt("discord_oauth"),ce.current="link",await st.initLoginWithOAuth("discord")},linkGithub:async()=>{ge("github"),pt("github_oauth"),ce.current="link",await st.initLoginWithOAuth("github")},linkSpotify:async()=>{ge("spotify"),pt("spotify_oauth"),ce.current="link",await st.initLoginWithOAuth("spotify")},linkInstagram:async()=>{ge("instagram"),pt("instagram_oauth"),ce.current="link",await st.initLoginWithOAuth("instagram")},linkTiktok:async()=>{ge("tiktok"),pt("tiktok_oauth"),ce.current="link",await st.initLoginWithOAuth("tiktok")},linkLine:async()=>{ge("line"),pt("line_oauth"),ce.current="link",await st.initLoginWithOAuth("line")},linkLinkedIn:async()=>{ge("linkedin"),pt("linkedin_oauth"),ce.current="link",await st.initLoginWithOAuth("linkedin")},linkApple:async()=>{ge("apple"),pt("apple_oauth"),ce.current="link",await st.initLoginWithOAuth("apple")},linkOAuth:async({provider:D})=>{ge(D),pt(rv(D)?D:`${D}_oauth`),ce.current="link",await st.initLoginWithOAuth(D)},linkPasskey:async D=>{ge("passkey"),pt("passkey"),await st.initLinkWithPasskey(),V({passkeyAuthModalData:{passkeySignupFlow:!1,name:D?.name}}),Me("LinkPasskeyScreen")},linkTelegram:async D=>{if(ge("telegram"),pt("telegram"),!r.loginConfig.telegramHasHmacCredentials)throw new Q('linkTelegram requires HMAC bot credentials. Use linkWithOAuth("telegram") for OIDC-configured apps.');if(ce.current="link",ne.current="telegram",D?.launchParams)if(D.launchParams.initDataRaw){let W=new yd;e.startAuthFlow(W),W.meta.telegramAuthResult=void 0,W.meta.telegramWebAppData=aM(D.launchParams.initDataRaw),V({telegramAuthModalData:{seamlessAuth:!0}}),Me("TelegramAuthScreen")}else ve(z,"linkAccount","onError",fe.INVALID_DATA,{linkMethod:"telegram"});else await st.initLoginWithTelegram();Me("TelegramAuthScreen")},linkFarcaster:async()=>{ge("farcaster"),pt("farcaster"),await st.initLoginWithFarcaster(),ce.current="link",ne.current="farcaster",Me("FarcasterConnectStatusScreen")},login:async D=>{D&&"target"in D&&D&&(D=void 0);let W="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!o){let X=await new Promise(Y=>{G(ae=>Y.bind(ae))});if(G(null),X)return void console.warn(W)}!l||l.isGuest?(ce.current="login",V({login:D}),Me("LandingScreen")):console.warn(W)},connectOrCreateWallet:async()=>{o||(await new Promise(D=>{G(()=>D)}),G(null)),J?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(ce.current="connect-or-create",Me("ConnectOrCreateScreen"))},logout:async()=>
721{if(ce.current=null,ne.current=null,l&&e.clearProviderAcccessTokens(l),g(null),await e.logout(),l&&A)try{await A.clearMfa({userId:l.id})}catch{}Xt(null),K(!1),h(!1),x({status:"initial"}),T({status:"initial"}),E({status:"initial"}),O({status:"initial"}),k({status:"initial"}),I({status:"initial"}),ve(z,"logout","onSuccess"),a(!1),nt.del(u8),nt.del(vV(r.id))},getAccessToken:L.useCallback(async()=>{let D=await e.getCustomerAccessToken();return D&&!J&&K(!0),D},[e,J]),setWalletRecovery:async D=>ze({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:D?.showAutomaticRecovery??!1}),setWalletPassword:async()=>ze({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(D,W)=>new Promise(async(X,Y)=>{let{requesterAppId:ae}=W?.uiOptions||{},le=D.message,me=W?.address?_d(l,W.address):Yc(l);if(!me&&W?.address!==void 0){let ct=I1(th(),W.address);if(ct)try{let Yt=await ct.getEthereumProvider(),Mn=await Yt.request({method:"personal_sign",params:[le,ct.address]});return ve(z,"signMessage","onSuccess",{signature:Mn}),void X({signature:Mn})}catch(Yt){return ve(z,"signMessage","onError",fe.UNABLE_TO_SIGN),void Y(Yt??new ps("Unable to sign message"))}}if(!me)throw new Q("No embedded or connected wallet found for address.");if(!J||!l)return ve(z,"signMessage","onError",fe.MUST_BE_AUTHENTICATED),void Y(Error("User must be authenticated before signing with a Privy wallet"));let Ee=me.address,ot=me.walletIndex??0,{entropyId:wt,entropyIdVerifier:an}=Dc(l,me),Gt=Ki(me);if(typeof le!="string"||le.length<1)return ve(z,"signMessage","onError",fe.INVALID_MESSAGE),void Y(Error("Message must be a non-empty string"));let bn=async()=>{let ct;if(!J)throw Error("User must be authenticated before signing with a Privy wallet");let Yt=await kn();if(!A||!Yt||!await st.recoverEmbeddedWallet({address:Ee}))throw Error("Unable to connect to wallet");if(e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:Ee,requesterAppId:ae}}
721),Gt){let Mn=xo(D.message,{strict:!0}),xr=await ya(n,async({message:$a})=>await A.signWithUserSigner({accessToken:Yt,requesterAppId:ae,message:$a}),{chain_type:"ethereum",method:"personal_sign",params:Mn?{message:le.slice(2),encoding:"hex"}:{message:le,encoding:"utf-8"},wallet_id:me.id});if(!xr.data||!("signature"in xr.data))throw new ps("Unable to sign message");ct=xr.data.signature}else{let{response:Mn}=await A.rpc({accessToken:Yt,entropyId:wt,entropyIdVerifier:an,chainType:"ethereum",hdWalletIndex:ot,requesterAppId:ae,request:{method:"personal_sign",params:[le,Ee]}});ct=Mn.data}return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:Ee,requesterAppId:ae}}),ct};if(ke({showWalletUIs:W?.uiOptions?.showWalletUIs}))try{let ct=await bn();ve(z,"signMessage","onSuccess",{signature:ct}),X({signature:ct})}catch(ct){ve(z,"signMessage","onError",fe.UNABLE_TO_SIGN),Y(ct??new ps("Unable to sign message"))}else V({signMessage:{method:"personal_sign",data:le,confirmAndSign:bn,onSuccess:ct=>{ve(z,"signMessage","onSuccess",{signature:ct}),X({signature:ct})},onFailure:ct=>{ve(z,"signMessage","onError",fe.UNABLE_TO_SIGN),Y(ct)},uiOptions:W?.uiOptions||{}},connectWallet:{recoveryMethod:me.recoveryMethod,connectingWalletAddress:Ee,entropyId:wt,entropyIdVerifier:an,onCompleteNavigateTo:"SignRequestScreen",isUnifiedWallet:Gt,onFailure:ct=>{ve(z,"signMessage","onError",fe.UNKNOWN_CONNECT_WALLET_ERROR),Y(ct)}}}),Me("EmbeddedWalletConnectingScreen")}),signTypedData:(D,W)=>new Promise(async(X,Y)=>{let{requesterAppId:ae}=W?.uiOptions||{},le=W?.address?_d(l,W.address):Yc(l);if(!le&&W?.address){let ct=I1(th(),W.address);if(ct)try{let Yt=await ct.getEthereumProvider(),Mn=Ey(D),xr=await Yt.request({method:"eth_signTypedData_v4",params:[ct.address,JSON.stringify(Mn,($a,fi)=>typeof fi=="bigint"?fi.toString():fi)]});return ve(z,"signTypedData","onSuccess",{signature:xr}),void X({signature:xr})}catch(Yt){return ve(z,"signTypedData","onError",fe.UNABLE_TO_SIGN),void Y(Yt??new ps("Unable to sign typed data "+Yt))}}if(!le)throw new Q("No embedded or connected wallet found for address.");if(!J||!l)return ve(z,"signTypedData","onError",fe.MUST_BE_AUTHENTICATED),void Y(Error("User must be authenticated before signing with a Privy wallet"));let me=le.address,Ee=le.walletIndex??0,{entropyId:ot,entropyIdVerifier:wt}=Dc(l,le),an=Ki(le),Gt=Ey(D),bn=async()=>{let ct;if(!J)throw Error("User must be authenticated before signing with a Privy wallet");let Yt=await kn();if(!A||!Yt||!await st.recoverEmbeddedWallet({address:me}))throw Error("Unable to connect to wallet");if(e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:me,requesterAppId:ae}}),an){let{domain:Mn,types:xr,primaryType:$a,message:fi}=Gt,Kr=await ya(n,async({message:Qs})=>await A.signWithUserSigner({accessToken:Yt,requesterAppId:ae,message:Qs}),{chain_type:"ethereum",method:"eth_signTypedData_v4",params:{typed_data:{domain:Mn,types:xr,primary_type:$a,message:fi}},wallet_id:le.id,...W?.signatureOptions?{signature_options:W.signatureOptions}:{},...W?.caip2?{caip2:W.caip2}:{}});if(!Kr.data||!("signature"in Kr.data))throw new ps("Unable to sign message");ct=Kr.data.signature}else{let{response:Mn}=await A.rpc({accessToken:Yt,entropyId:ot,entropyIdVerifier:wt,chainType:"ethereum",hdWalletIndex:Ee,requesterAppId:ae,request:{method:"eth_signTypedData_v4",params:[me,Gt]}});ct=Mn.data}return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:me,requesterAppId:ae}}),ct};if(ke({showWalletUIs:W?.uiOptions?.showWalletUIs}))try{let ct=await bn();ve(z,"signTypedData","onSuccess",{signature:ct}),X({signature:ct})}catch(ct){ve(z,"signTypedData","onError",fe.UNABLE_TO_SIGN),Y(ct??new ps("Unable to sign message"))}else V({signMessage:{method:"eth_signTypedData_v4",data:Gt,confirmAndSign:bn,onSuccess:ct=>{ve(z,"signTypedData","onSuccess",{signature:ct}),X({signature:ct})},onFailure:ct=>{ve(z,"signTypedData","onError",fe.UNABLE_TO_SIGN),Y(ct)},uiOptions:W?.uiOptions||{}},connectWallet:{recoveryMethod:le.recoveryMethod,connectingWalletAddress:le.address,entropyId:ot,isUnifiedWallet:
721an,entropyIdVerifier:wt,onCompleteNavigateTo:"SignRequestScreen",onFailure:ct=>{ve(z,"signMessage","onError",fe.UNKNOWN_CONNECT_WALLET_ERROR),Y(ct)}}}),Me("EmbeddedWalletConnectingScreen")}),sendTransaction:async(D,W)=>await Ie({transaction:D,sponsor:W?.sponsor,uiOptions:W?.uiOptions,fundWalletConfig:W?.fundWalletConfig,address:W?.address,signOnly:!1}),signTransaction:async(D,W)=>({signature:(await Ie({transaction:D,uiOptions:W?.uiOptions,address:W?.address,signOnly:!0})).hash}),promptMfa:qe,async init(D){switch(D){case"sms":return void await e.initMfaSmsVerification();case"passkey":return await e.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${D}`)}},async submit(D,W){switch(D){case"totp":case"sms":if(typeof W!="string")throw new Q("Invalid MFA code");ie.current?.resolve({mfaMethod:D,mfaCode:W,relyingParty:window.origin}),await new Promise((ae,le)=>{oe.current={resolve:ae,reject:le}});break;case"passkey":if(typeof W=="string")throw new Q("Invalid authenticator response");let X=await Ne(()=>import("./index-DgTijNFR.js"),__vite__mapDeps([18,19])),Y=UYe(await X.startAuthentication({optionsJSON:W}));ie.current?.resolve({mfaMethod:D,mfaCode:Y,relyingParty:window.origin}),await new Promise((ae,le)=>{oe.current={resolve:ae,reject:le}});break;default:throw ie.current?.reject(new Q("Unsupported MFA method")),new Q(`Unsupported MFA method: ${D}`)}},cancel(){ie.current?.reject(new Q("MFA canceled"))},async clear(){if(!l||!A)throw Error("Must be authenticated to clear MFA");await A.clearMfa({userId:l.id})},async initEnrollmentWithSms(D){let W=await kn();if(!W||!A)throw Error("Must have valid access token to enroll in MFA");await A.initEnrollMfa({method:"sms",accessToken:W,phoneNumber:D.phoneNumber})},enrollInMfa:D=>new Promise((W,X)=>{if(!D)return st.closePrivyModal(),void W();r.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),V({mfaEnrollmentFlow:{mfaMethods:r.mfa.methods,shouldUnlinkOnUnenrollMfa:r.passkeys.shouldUnlinkOnUnenrollMfa,onSuccess:W,onFailure:X}}),Me("MfaEnrollmentFlowScreen")}),async initEnrollmentWithTotp(){let D=await kn();if(!D||!A)throw Error("Must have valid access token to enroll in MFA");let W=await A.initEnrollMfa({method:"totp",accessToken:D});return{secret:W.secret,authUrl:W.authUrl}},async submitEnrollmentWithSms(D){let W=await kn();if(!W||!A)throw Error("Must have valid access token to enroll in MFA");await A.submitEnrollMfa({method:"sms",accessToken:W,phoneNumber:D.phoneNumber,code:D.mfaCode}),Xt(await e.getAuthenticatedUser())},async submitEnrollmentWithTotp(D){let W=await kn();if(!W||!A)throw Error("Must have valid access token to enroll in MFA");await A.submitEnrollMfa({method:"totp",accessToken:W,code:D.mfaCode}),Xt(await e.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:D},W={}){let X=await kn();if(!X||!A)throw Error("Must have valid access token to enroll in MFA");await A.submitEnrollMfa({method:"passkey",accessToken:X,credentialIds:D,removeForLogin:W.removeForLogin}),Xt(await e.getAuthenticatedUser())},async unenroll(D,W={}){let X=await kn();if(!X||!A)throw Error("Must have valid access token to remove MFA");D==="passkey"?await A.submitEnrollMfa({method:"passkey",accessToken:X,credentialIds:[],removeForLogin:W.removeForLogin}):await A.unenrollMfa({method:D,accessToken:X});let Y=await e.getAuthenticatedUser();if(Xt(Y),Y&&Y.mfaMethods.length===0)try{await A.clearMfa({userId:Y.id})}catch{}},isModalOpen:i||!!s,mfaMethods:r.mfa.methods};gY=Ue.signMessage,yY=Ue.signTypedData,vY=async(D,W)=>await Ie({transaction:D,...W,signOnly:!1}),mY=async(D,W)=>({signature:(await Ie({transaction:D,...W,signOnly:!0})).hash});let Ve=async D=>{let W,X,Y;v(!0),k({status:"loading"}),e.startAuthFlow(new Ed({...D,customOAuthRedirectUrl:r.customOAuthRedirectUrl}));let ae=nt.get(my),le=D.stateCode;if(ae!==le)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:D.provider,storedStateCode:ae??"",returnedStateCode:le??""}}),v(!1),new Q("Unexpected auth flow. This may be a phishing attempt.",void 0,fe.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{({user:W,oAuthTokens:Y}=await e.link()),ne.current=D.provider;let me=Fe(W);W&&me&&ve(z,"linkAccount","onSuccess",{user:W,linkMethod:ne.current,linkedAccount:me})}
721catch(me){throw v(!1),ve(z,"linkAccount","onError",me.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:D.provider}),me}else try{({user:W,isNewUser:X,oAuthTokens:Y}=await e.authenticate()),ne.current=D.provider;let me=Fe(W);W&&me&&X!==void 0&&ve(z,"login","onComplete",{user:W,isNewUser:X,wasAlreadyAuthenticated:!1,loginMethod:ne.current,loginAccount:me})}catch(me){throw v(!1),k({status:"error",error:me}),ve(z,"login","onError",me.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),me}return Xt(W),h(X||!1),K(!0),v(!1),k({status:"done"}),Y&&W&&ve(z,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:Y,user:W}),W??void 0},st={privy:n,setAuthenticated:K,setUser:Xt,setIsNewUser:h,isNewUserThisSession:f,pendingTransaction:null,walletConnectionStatus:b,setWalletConnectionStatus:w,connectors:e.connectors?.walletConnectors??[],rpcConfig:r.rpcConfig,chains:r.chains,appId:t.appId,showFiatPrices:r.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:e.clientAnalyticsId,hideWalletUIs:xe,isHeadlessSigning:L.useCallback(ke,[r.embeddedWallets.showWalletUIs]),emailOtpState:C,setEmailOtpState:x,smsOtpState:$,setSmsOtpState:T,oAuthState:F,setOAuthState:k,telegramAuthState:S,setTelegramAuthState:I,siweState:U,setSiweState:O,isHeadlessOAuthLoading:y,baseAccountSdk:u,setBaseAccountSdk:d,nativeTokenSymbolForChainId:D=>r.chains.find(W=>W.id===Number(D))?.nativeCurrency.symbol,initializeWalletProxy:async D=>{if(A)return A;let W=new Promise(ae=>{Z.current=ae}),X=new Promise(ae=>setTimeout(()=>ae(null),D)),Y=await Promise.race([W,X]);return Z.current=null,Y},getAuthFlow:()=>e.authFlow,getAuthMeta:()=>e.authFlow?.meta,client:e,closePrivyModal:async(D={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let W,X=o&&J&&l;if(X&&ne.current&&(W=Fe(l)),ce.current==="login")D.shouldCallAuthOnSuccess&&X&&ne.current?ve(z,"login","onComplete",{user:l,isNewUser:f,wasAlreadyAuthenticated:!1,loginMethod:ne.current,loginAccount:W??null}):ve(z,"login","onError",fe.USER_EXITED_AUTH_FLOW);else if(ce.current==="link"&&W)D.isSuccess&&X&&ne.current?ve(z,"linkAccount","onSuccess",{user:l,linkMethod:ne.current,linkedAccount:W}):ne.current&&ve(z,"linkAccount","onError",fe.USER_EXITED_LINK_FLOW,{linkMethod:ne.current});else if(ce.current==="update"&&W)D.isSuccess&&X&&ne.current?ve(z,"update","onSuccess",{user:l,updateMethod:ne.current,updatedAccount:W}):ne.current&&ve(z,"update","onError",fe.USER_EXITED_UPDATE_FLOW,{linkMethod:ne.current});else if(ce.current==="connect-or-create"){let le=th();le[0]?ve(z,"connectOrCreateWallet","onSuccess",{wallet:le[0]}):ve(z,"connectOrCreateWallet","onError",fe.USER_EXITED_AUTH_FLOW)}let Y=p&&d7.has(p),ae=p==="ErrorScreen"&&M.errorModalData&&d7.has(M.errorModalData.previousScreen);if((Y||ae)&&M.funding){let le,me=d7.get(p)??null;
721if(ae&&M.funding?.onError){let Ee=M.errorModalData?.error,ot=Ee?.privyErrorCode||fe.UNKNOWN_FUNDING_ERROR,wt=new Q(Ee?.message||"Funding failed",Ee,ot);M.funding?.onError?.(wt)}if(M.funding.chainType==="solana"){let Ee=r.solanaRpcs[M.funding.chain];if(!Ee)return console.warn("Unable to load solana rpc, skipping balance"),ve(z,"fundSolanaWallet","onUserExited",{address:M.funding.address,fundingMethod:me,chain:M.funding.chain,balance:le}),a(!1),void hM(M.funding,me);if(Pd(nBe))try{le=await RYe({rpc:Ee.rpc,address:M.funding.address})}catch{console.error("Unable to pull wallet balance")}else console.warn("Unable to load solana plugin, skipping balance");ve(z,"fundSolanaWallet","onUserExited",{address:M.funding.address,fundingMethod:me,chain:M.funding.chain,balance:le})}else{let Ee=_y(M.funding.chain.id,r.chains,r.rpcConfig,{appId:t.appId});try{le=await Ee.getBalance({address:M.funding.address})}catch{console.error("Unable to pull wallet balance")}ve(z,"fundWallet","onUserExited",{address:M.funding.address,chain:M.funding.chain,fundingMethod:me,balance:le}),hM(M.funding,me)}}V(le=>({...le,externalConnectWallet:{}})),ce.current=null,ne.current=null,h(!1),a(!1),w({status:"disconnected",connectedWallet:null,connector:null,connectError:null,connectRetry:()=>{}}),setTimeout(()=>{e.authFlow=void 0},200)},openPrivyModal:Me,connectWallet:de,initLoginWithWallet:async(D,W,X,Y)=>{Sc(D)?(ne.current="siwe",he(D,W,X)):(ne.current="siws",pe(D,W,X,Y))},loginWithWallet:async()=>{let D,W,X;if(!o)throw new El;if(e.authFlow instanceof ig?D="siwe":e.authFlow instanceof iM&&(D="siws"),!D)throw new Q("Must initialize SIWE/SIWS flow first.");if(await e.getAccessToken()!==null)try{({user:W}=await e.link()),ne.current=D}catch(Y){throw ve(z,"linkAccount","onError",Y.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:D}),Y}else try{({user:W,isNewUser:X}=await e.authenticate()),ne.current=D}catch(Y){throw ve(z,"login","onError",Y.privyErrorCode||fe.GENERIC_CONNECT_WALLET_ERROR),Y}Xt(W||l||null),h(X||!1),K(!0)},delegateWallet:async({address:D,chainType:W,showDelegationUIs:X})=>new Promise(async(Y,ae)=>{let le=await kn();if(!J||!l||!le)throw new Q("User must be authenticated and have an embedded wallet to delegate actions.");if(W!=="solana"&&W!=="ethereum")throw new Q("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let me=st.walletProxy??await st.initializeWalletProxy(15e3);if(!me)throw new Q("Wallet proxy not initialized.");if((({address:Gt,user:bn})=>!!uM(bn).find(ct=>ct.address===Gt))({address:D,user:l}))return Y();let Ee=_d(l,D);if(!Ee)throw new Q("Address to delegate is not associated with current user.");if(Ki(Ee))throw new Q("useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");let ot=AYe({address:D,user:l}),wt=xYe({address:D,user:l}),an=async()=>{await me.createDelegatedAction({accessToken:le,rootWallet:wt,delegatedWallets:[ot]}),await st.refreshSessionAndUser()};if(await st.recoverEmbeddedWallet({address:D}),X)V({delegatedActions:{consent:{address:D,onDelegate:an,onSuccess:async()=>{Y()},onError:async Gt=>{ae(Gt)}}}}),Me("DelegatedActionsConsentScreen");else try{await an(),Y()}catch(Gt){ae(Gt)}}),revokeDelegatedWallets:async({showDelegationUIs:D})=>new Promise(async(W,X)=>{if(!J||!l)throw new Q("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");let Y=uM(l);
721if(Y.length===0)throw new Q("User has no delegated wallets to revoke.");if(Y.some(Ki))throw new Q("useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");let ae=async()=>{await e.revokeDelegatedWallet(),await st.refreshSessionAndUser()};if(D)V({delegatedActions:{revoke:{onRevoke:ae,onSuccess:async()=>{W()},onError:async le=>{X(le)}}}}),Me("DelegatedActionsRevokeScreen");else try{await ae(),W()}catch(le){X(le)}}),initLoginWithFarcaster:async(D,W)=>{let X=new rM(D,W);e.startAuthFlow(X);try{ne.current="farcaster",await X.initializeFarcasterConnect()}catch(Y){throw ce.current==="login"?ve(z,"login","onError",Y.privyErrorCode||fe.UNKNOWN_AUTH_ERROR):ce.current==="link"&&ve(z,"linkAccount","onError",Y.privyErrorCode||fe.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),Y}},loginWithFarcaster:async()=>{let D,W;if(!o)throw new El;if(!(e.authFlow instanceof rM))throw new Q("Must initialize Farcaster flow first.");if(await e.getAccessToken()!==null)try{({user:D}=await e.link()),ne.current="farcaster"}catch(X){throw ve(z,"linkAccount","onError",X.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),X}else try{({user:D,isNewUser:W}=await e.authenticate()),ne.current="farcaster"}catch(X){throw ve(z,"login","onError",X.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),X}Xt(D||null),h(W||!1),K(!0)},async crossAppAuthFlow({appId:D,popup:W,action:X,disableSignup:Y}){let ae=`privy:${D}`;ne.current=ae;let{url:le,stateCode:me,codeVerifier:Ee}=await eBe({api:e.api,appId:D});if(!le)throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:D}}),new Q("No authorization URL returned for cross-app auth.");try{let ot=await async function({url:ct,popup:Yt}){return Yt.location=ct,new Promise((Mn,xr)=>{let $a,fi=setTimeout(()=>{xr(new Q("Authorization request timed out after 2 minutes.")),Kr()},12e4);function Kr(){Yt?.close(),window.removeEventListener("message",hi)}let Qs=setInterval(()=>{Yt?.closed&&!$a&&(Kr(),clearInterval(Qs),clearTimeout(fi),xr(new Q("User rejected request")))},300);function hi(Gr){Gr.data&&(Gr.data.type==="PRIVY_OAUTH_RESPONSE"&&Gr.data.stateCode&&Gr.data.authorizationCode&&(clearTimeout(fi),Mn(Gr.data),Kr()),Gr.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(fi),xr(new Q(Gr.data.error)),Kr()),Gr.data.type===fM&&(($a=new BroadcastChannel(dM)).onmessage=hi))}window.addEventListener("message",hi)})}({url:le,popup:W,provider:ae}),wt=ot.stateCode,an=ot.authorizationCode;if(wt!==me)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:ae,storedStateCode:me??"",returnedStateCode:wt??""}}),new Q("Unexpected auth flow. This may be a phishing attempt.",void 0,fe.OAUTH_UNEXPECTED);let Gt=await tBe({appId:D,codeVerifier:Ee,stateCode:wt,authorizationCode:an,action:X,client:e,disableSignup:Y});Gt&&e.storeProviderAccessToken(D,Gt);let bn=await st.refreshSessionAndUser();if(!bn)throw new Q("Unable to update user");return e.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:D}}),bn}catch(ot){throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:ot.toString(),provider:ae}}),ot}},async initLoginWithOAuth(D,W,X){if(ne.current=D,!h8()||D==="google"&&!r.allowOAuthInEmbeddedBrowsers&&pM(window.navigator.userAgent))return void Me("InAppBrowserLoginNotPossible");D==="twitter"&&window.opener&&window.opener.postMessage({type:fM},"*"),nt.del(vy),nt.del($h);let Y=new Ed({provider:D,disableSignup:!!X,withPrivyUi:!0,customOAuthRedirectUrl:r.customOAuthRedirectUrl});W&&Y.addCaptchaToken(W),e.startAuthFlow(Y);let ae=await e.authFlow.getAuthorizationUrl();if(ae&&ae.url)if(D==="twitter"&&kH&&(ae.url=ae.url.replace("x.com","twitter.com")),window.location.protocol==="chrome-extension:"&&xb())try{let{privyOAuthCode:le,privyOAuthState:me}=await GR(ae.url);Me("OAuthStatusScreen"),Y.meta.stateCode=me,Y.meta.authorizationCode=le}catch(le){throw console.error("OAuth in chrome extension flow failed:",le),le}else window.location.assign(ae.url)},async initLoginWithTelegram(D,W){if(!o)throw new El;ne.current="telegram";let X=new yd(D,W);e.startAuthFlow(X),I({status:"loading"}),X.meta.telegramWebAppData=void 0,X.meta.telegramAuthResult=await new Promise((Y,ae)=>r.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:r.loginConfig.telegramAuthConfiguration.botId,request_access:!0},le=>le?Y(le):(ce.current==="link"?ve(z,"linkAccount","onError",fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}):ce.current==="login"?ve(z,"login","onError",fe.INVALID_CREDENTIALS):ce.current==="update"&&ve(z,"login","onError",fe.FAILED_TO_UPDATE_ACCOUNT),ae(new Q("Telegram auth failed or was canceled by the client")))):ae(new Q("Telegram was not initialized")):ae(new Q("Telegram Auth configuration is not loaded")))},async loginWithTelegram(D){let W,X;if(!(e.authFlow instanceof yd))throw new Q("Must initialize Telegram flow before calling loginWithTelegram");e.authFlow.meta.captchaToken||=D?.captchaToken;let Y=await kn(),ae=D?.intent||ce.current;if(ae==="login")try{let me=await e.authenticate();W=me.user,X=me.isNewUser,ne.current="telegram"}catch(me){throw ve(z,"login","onError",me.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),me}else{if(ae!=="link")throw new Q("Unknown auth intent");try{W=(await e.link()).user,ne.current="telegram"}catch(me){throw ve(z,"linkAccount","onError",me.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),me}}Xt(W),h(X||!1),K(!0),I({status:"done"});let le=W?.linkedAccounts.find(({type:me})=>me==="telegram")||null;return{user:W,isNewUser:X||!1,wasAlreadyAuthenticated:!!Y,loginAccount:le}},async loginWithOAuth(D){let W,X,Y;if(!(e.authFlow instanceof Ed))throw new Q("Must initialize OAuth flow before calling loginWithOAuth");let ae=nt.get(my),le=e.authFlow.meta.stateCode;if(ae!==le)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:D,storedStateCode:ae??"",returnedStateCode:le??""}}),new Q("Unexpected auth flow. This may be a phishing attempt.",void 0,fe.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{let me=await e.link();W=me.user,X=!1,Y=me.oAuthTokens,ne.current=D}catch(me){throw ve(z,"linkAccount","onError",me.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:D}),me}else try{let me=await e.authenticate();W=me.user,X=me.isNewUser,Y=me.oAuthTokens,ne.current=D}catch(me){throw ce.current==="login"?ve(z,"login","onError",me.privyErrorCode||fe.UNKNOWN_AUTH_ERROR):ce.current==="link"&&ve(z,"linkAccount","onError",me.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:D}),me}return Xt(W),h(X||!1),K(!0),Y&&W&&ve(z,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:Y,user:W}),Y}
721,passkeyAuthState:_,setPasskeyAuthState:E,async initSignupWithPasskey({captchaToken:D,withPrivyUi:W}){let X=new gd({captchaToken:D,setPasskeyAuthState:E,hints:r.passkeys.registration?.hints});e.startAuthFlow(X),ce.current="login";try{ne.current="passkey",E({status:"generating-challenge"}),await X.initRegisterFlow(W),E({status:"awaiting-passkey"})}catch(Y){throw E({status:"error",error:Y}),ve(z,"login","onError",Y.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),Y}},async signupWithPasskey(){let D,W;if(!o)throw new El;if(!(e.authFlow instanceof gd))throw new Q("Must initialize Passkey flow first.");if(ne.current!=="passkey"){let ae=new Q("Must init login with Passkey flow first.");throw E({status:"error",error:ae}),ae}let X=await kn();try{ne.current="passkey",E({status:"awaiting-passkey"}),{user:D,isNewUser:W}=await e.authenticate()}catch(ae){throw E({status:"error",error:ae}),ve(z,"login","onError",ae.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),ae}Xt(D),h(W||!1),K(!0),E({status:"done"});let Y=D?.linkedAccounts.find(({type:ae})=>ae==="passkey")||null;return{user:D,isNewUser:W||!1,wasAlreadyAuthenticated:!!X,loginAccount:Y}},async initLoginWithPasskey({captchaToken:D,withPrivyUi:W}){let X=new gd({captchaToken:D,setPasskeyAuthState:E,hints:void 0});e.startAuthFlow(X),ce.current="login";try{ne.current="passkey",E({status:"generating-challenge"}),await X.initAuthenticationFlow(W),E({status:"awaiting-passkey"})}catch(Y){throw E({status:"error",error:Y}),ve(z,"login","onError",Y.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),Y}},async loginWithPasskey(D){let W,X;if(!o)throw new El;if(!(e.authFlow instanceof gd))throw new Q("Must initialize Passkey flow first.");if(D?.credentialIds&&(e.authFlow.meta.allowedCredentialsIds=D.credentialIds),ne.current!=="passkey"){let le=new Q("Must init login with Passkey flow first.");throw E({status:"error",error:le}),le}let Y=await kn();try{ne.current="passkey",E({status:"awaiting-passkey"}),{user:W,isNewUser:X}=await e.authenticate()}catch(le){throw E({status:"error",error:le}),ve(z,"login","onError",le.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),le}Xt(W),h(X||!1),K(!0),E({status:"done"});let ae=W?.linkedAccounts.find(({type:le})=>le==="passkey")||null;return{user:W,isNewUser:X||!1,wasAlreadyAuthenticated:!!Y,loginAccount:ae}},async initLinkWithPasskey(D){let W=new gd({captchaToken:D,hints:r.passkeys.registration?.hints});e.startAuthFlow(W),ce.current="link",ne.current="passkey",E({status:"generating-challenge"});try{await W.initLinkFlow(),E({status:"awaiting-passkey"})}catch(X){throw ve(z,"linkAccount","onError",X.privyErrorCode||fe.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),E({status:"error",error:X}),X}},async linkWithPasskey(D){let W;if(!o)throw new El;if(!(e.authFlow instanceof gd))throw new Q("Must initialize Passkey flow first.");if(ne.current!=="passkey")throw new Q("Must init login with Passkey flow first.");try{ne.current="passkey",e.authFlow.meta.name=D?.name,{user:W}=await e.link()}catch(X){throw ve(z,"linkAccount","onError",X.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),X}return Xt(W||l||null),E({status:"done"}),W},async initLoginWithHeadlessOAuth(D,W,X){if(!h8()||D==="google"&&!r.allowOAuthInEmbeddedBrowsers&&pM(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let Y=new Ed({provider:D,withPrivyUi:!1,disableSignup:X??!1,customOAuthRedirectUrl:r.customOAuthRedirectUrl});W&&Y.addCaptchaToken(W),k({status:"loading"});let ae=await e.startAuthFlow(Y).getAuthorizationUrl();if(ae?.url)if(window.location.protocol==="chrome-extension:"&&xb())try{let{privyOAuthCode:le,privyOAuthState:me}=await GR(ae.url);Y.meta.stateCode=me,Y.meta.authorizationCode=le,await Ve(Y.meta)}catch(le){throw k({status:"error",error:le}),le}else window.location.assign(ae.url)},loginWithHeadlessOAuth:Ve,initLoginWithEmail:async({email:D,captchaToken:W,disableSignup:X,withPrivyUi:Y})=>{let ae=new Rd({email:D,captchaToken:W,disableSignup:X});e.startAuthFlow(ae);try{ne.current="email",x({status:"sending-code"});let le=await ae.sendCodeEmail({withPrivyUi:Y});if(le?.ssoRedirectUrl)return window.location.href=le.ssoRedirectUrl,void await Cy(1e4);x({status:"awaiting-code-input"})}catch(le){throw x({status:"error",error:le}),ce.current==="login"?ve(z,"login","onError",le.privyErrorCode||fe.UNKNOWN_AUTH_ERROR):ce.current==="link"&&ve(z,"linkAccount","onError",le.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),le}},initUpdateEmail:async({oldAddress:D,newAddress:W,captchaToken:X})=>{let Y=new Ije(D,W,X);e.startAuthFlow(Y);try{await Y.sendCodeEmail({withPrivyUi:!0})}catch(ae){throw ve(z,"update","onError",ae.privyErrorCode||fe.UNKNOWN_AUTH_ERROR,{linkMethod:ne.current}),ae}},initUpdatePhone:async(D,W,X)=>{let Y=new Lje(D,W,X);e.startAuthFlow(Y);try{await Y.sendSmsCode({withPrivyUi:!0})}catch(ae){ve(z,"update","onError",ae.privyErrorCode||fe.UNKNOWN_AUTH_ERROR,{linkMethod:ne.current})}},initLoginWithSms:async({phoneNumber:D,captchaToken:W,disableSignup:X,withPrivyUi:Y})=>{T({status:"sending-code"});let ae=new Od({phoneNumber:D,captchaToken:W,disableSignup:X});e.startAuthFlow(ae);try{ne.current="sms",await ae.sendSmsCode({withPrivyUi:Y}),T({status:"awaiting-code-input"})}catch(le){throw T({status:"error",error:le}),ce.current==="login"?ve(z,"login","onError",le.privyErrorCode||fe.UNKNOWN_AUTH_ERROR):ce.current==="link"&&ve(z,"linkAccount","onError",le.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),le}},resendEmailCode:async()=>{await e.authFlow?.sendCodeEmail({withPrivyUi:!0})},resendSmsCode:async()=>{await e.authFlow?.sendSmsCode({withPrivyUi:!0})},loginWithCode:async D=>{let W,X;function Y(Ee){e.authFlow instanceof Rd?x(Ee):e.authFlow instanceof Od&&T(Ee)}if(Y({status:"submitting-code"}),!o){let Ee=new El;throw Y({status:"error",error:Ee}),Ee}if(e.authFlow instanceof Rd)e.authFlow.meta.emailCode=D.trim();else{if(!(e.authFlow instanceof Od)){let Ee=new Q("Must initialize a passwordless code flow first");throw Y({status:"error",error:Ee}),Ee}e.authFlow.meta.smsCode=D.trim()}let ae=await kn();if(ce.current==="link")try{({user:W}=await e.link())}catch(Ee){throw Y({status:"error",error:Ee}),ve(z,"linkAccount","onError",Ee.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:ne.current}),Ee}else if(ce.current==="update")try{({user:W}=await e.link())}catch(Ee){throw Y({status:"error",error:Ee}),ve(z,"update","onError",Ee.privyErrorCode||fe.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:ne.current}),Ee}else try{({user:W,isNewUser:X}=await e.authenticate())}catch(Ee){throw Y({status:"error",error:Ee}),ve(z,"login","onError",Ee.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),Ee}let le=W||l;Xt(le||null),h(X||!1),K(!0),Y({status:"done"});let me=null;return e.authFlow instanceof Rd?me=le?.linkedAccounts.find(({type:Ee})=>Ee==="email")||null:e.authFlow instanceof Od&&(me=le?.linkedAccounts.find(({type:Ee})=>Ee==="phone")||null),{user:le,isNewUser:X||!1,wasAlreadyAuthenticated:!!ae,linkedAccount:me}},generateSiweMessage:async({address:D,chainId:W,captchaToken:X})=>{ce.current=J?"link":"login",ne.current="siwe",O({status:"generating-message"});let Y=await e.generateSiweNonce({address:D,captchaToken:X});return O({status:"awaiting-signature"}),Ib({address:D,chainId:W.replace("eip155:",""),nonce:Y})},generateSiweMessageForSmartWallet:async({address:D,chainId:W})=>{let X=await e.generateSiweNonce({address:D});return Ib({address:D,chainId:W.replace("eip155:",""),nonce:X})},linkSmartWallet:async({message:D,signature:W,smartWalletType:X,smartWalletVersion:Y})=>{let ae;ae=await e.linkSmartWallet({message:D,signature:W,smartWalletType:X,smartWalletVersion:Y}),Xt((ae=await st.refreshSessionAndUser()??ae)||l||null)},loginWithSiwe:async({message:D,signature:W,captchaToken:X,disableSignup:Y,walletClientType:ae,connectorType:le})=>{let me,Ee=null;try{if(l)throw Error("User already authenticated");let ot=new ig(e,void 0,X,Y,{message:D,signature:W,walletClientType:ae,connectorType:le});if(e.startAuthFlow(ot),ne.current="siwe",ce.current="login",O({status:"submitting-signature"}),{user:Ee,isNewUser:me}=await e.authenticate(),!Ee)throw Error("Authentication failed - no user returned")}catch(ot){throw ve(z,"login","onError",ot.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),O({status:"error",error:ot}),ot}return Xt(Ee),h(me||!1),K(!0),O({status:"done"}),ce.current=null,ne.current=null,{user:Ee,isNewUser:me||!1}},linkWithSiwe:async({message:D,signature:W,chainId:X,walletClientType:Y,connectorType:ae})=>{let le;ge("siwe");let me=null;try{O({status:"submitting-signature"}),le=await e.linkWithSiwe({message:D,signature:W,chainId:X,walletClientType:Y,connectorType:ae}),le=await st.refreshSessionAndUser()??le,O({status:"done"}),(me=Fe(le)||null)&&ve(z,"linkAccount","onSuccess",{user:le,linkMethod:"siwe",linkedAccount:me})}catch(ot){throw ve(z,"linkAccount","onError",ot.privyErrorCode||fe.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),ce.current=null,ne.current=null,O({status:"error",error:ot}),ot}let Ee=le||l;return Xt(Ee||null),ce.current=null,ne.current=null,{user:Ee,linkedAccount:me}},refreshSessionAndUser:async()=>{let D=await e.getAuthenticatedUser();return K(!!D),Xt(D),D},walletProxy:A,createAnalyticsEvent:({eventName:D,payload:W,timestamp:X})=>e.createAnalyticsEvent({eventName:D,payload:W,timestamp:X}),acceptTerms:async()=>{let D=await e.acceptTerms();return Xt(D),D},getUsdTokenPrice:D=>e.getUsdTokenPrice(D),getUsdPriceForSol:()=>e.getUsdPriceForSol(),getSplTokenMetadata:D=>
721e.getSplTokenMetadata(D),recoverEmbeddedWallet:async D=>new Promise(async(W,X)=>{if(!l)return void W(!0);let Y=D?.address?_d(l,D.address):Tp(l)||UE(l).at(0)||jE(l).at(0);if(!Y||Ki(Y))return void W(!0);let ae=await kn();if(!ae||!A||!Y)return void X(Error("Must have valid access token and Privy wallet to recover wallet"));let{entropyId:le,entropyIdVerifier:me}=Dc(l,Y);try{await A.connect({accessToken:ae,entropyId:le,entropyIdVerifier:me}),W(!0)}catch(Ee){if(om(Ee)&&Y.recoveryMethod==="privy"){let ot;e.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:Y.address}});try{ot=await A.recover({entropyId:le,entropyIdVerifier:me,accessToken:ae})}catch(wt){return void X(wt)}ot.entropyId||X(Error("Unable to recover wallet")),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:Y.address}}),W(!0)}else om(Ee)&&Y.recoveryMethod!=="privy"&&Y.recoveryMethod!=="privy-v2"?(V(ot=>({...ot,recoverWallet:{entropyId:le,entropyIdVerifier:me,onFailure:X,onSuccess:()=>{W(!0)},onCompleteNavigateTo:ot.createWallet?"EmbeddedWalletOnAccountCreateScreen":void 0},recoveryOAuthStatus:{provider:Y.recoveryMethod,action:"recover",shouldCreateEth:!1,shouldCreateSol:!1,isInAccountCreateFlow:!!ot.createWallet}})),Me(LYe(Y.recoveryMethod))):X(Ee)}}),setReadyToTrue:D=>{c(!0),B?.(D)},updateWallets:()=>_e(),fundWallet:async(D,W)=>{let X="FundingMethodSelectionScreen";return new Promise((Y,ae)=>{V({funding:{...eO({address:D,appConfig:r,fundWalletConfig:W,methodScreen:X,onComplete:Y,onError:ae})}}),Me(X)})},openModal:Me,requestFarcasterSignerStatus:async D=>{let W=await kn(),X=l?.linkedAccounts.find(ae=>ae.type==="wallet"&&ae.walletClientType==="privy");if(!W)throw Error("Must have valid access token to connect with Farcaster");if(!A||!X)throw Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let Y=await e.requestFarcasterSignerStatus(D);return Y.status==="approved"&&Xt(await e.getAuthenticatedUser()||l||null),Y},connectCoinbaseSmartWallet:async()=>{r.externalWallets.coinbaseWallet.config.preference={...r.externalWallets.coinbaseWallet.config.preference,options:"smartWalletOnly"};let D=e.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||e.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(D)return D.updateConnectionPreference("smartWalletOnly"),de(D);await se("coinbase_wallet","coinbase_smart_wallet")},connectBaseAccount:async()=>{let D=e.connectors?.findWalletConnector("base_account","base_account");if(D)return de(D);await se("base_account","base_account")},initiateAccountTransfer:async({nonce:D,account:W,accountType:X,externalWalletMetadata:Y,telegramAuthResult:ae,telegramWebAppData:le,farcasterEmbeddedAddress:me,oAuthUserInfo:Ee})=>{let ot=await e.sendAccountTransferRequest({nonce:D,account:W,accountType:X,externalWalletMetadata:Y,telegramAuthResult:ae,telegramWebAppData:le,farcasterEmbeddedAddress:me,oAuthUserInfo:Ee});return Xt(ot),ot},inProgressAuthFlowRef:ce,inProgressLoginOrLinkMethodRef:ne};wY=st.recoverEmbeddedWallet,st.recoverEmbeddedWallet;let as=e.authFlow instanceof yd,{siteKey:Ku,enabledProvider:pf}=r.captcha,l6=!r.headless&&pf&&!J&&(o||as);return m.jsx(ZS.Provider,{value:!0,children:m.jsx(Ia.Provider,{value:Ue,children:m.jsx(oK.Provider,{value:z,children:m.jsx(QGe,{appId:r.id,captchaSiteKey:Ku,enabledCaptchaProvider:pf,children:m.jsxs(pV.Provider,{value:st,children:[m.jsx(EVe,{children:m.jsxs(qje,{data:M,setModalData:V,setInitialScreen:g,initialScreen:p,authenticated:J,open:i,children:[t.children,m.jsx(KYe,{customAuth:r.customAuth}),l6&&m.jsx(rYe,{delayedExecution:!1}),m.jsx(bYe,{}),m.jsx(eJe,{}),m.jsx(FYe,{disabled:r.embeddedWallets.disableAutomaticMigration}),m.jsx(aYe,{palette:r.appearance.palette||{}}),!r.render.standalone&&m.jsx(yYe,{open:i})]})}),m.jsx(SYe,{appId:t.appId,appClientId:t.clientId,clientAnalyticsId:e.clientAnalyticsId,origin:e.apiUrl,mfaMethods:l?.mfaMethods,mfaPromise:ie,mfaSubmitPromise:oe,onLoad:R,onLoadFailed:()=>null}),r.loginConfig.telegramHasHmacCredentials&&r.loginConfig.telegramAuthConfiguration&&m.jsx(jK,{$if:!0,
721children:m.jsx(wYe,{scriptHost:t.apiUrl||l8,botUsername:r.loginConfig.telegramAuthConfiguration.botName})})]})})})})})},nJe=(t,e)=>gY(t,e),rJe=(t,e)=>yY(t,e),iJe=(t,e)=>mY(t,e),aJe=(t,e)=>vY(t,e),sJe=t=>wY(t),oJe=({config:t,...e})=>{Hje(),function(){if(typeof window>"u")return;let a=["localhost","127.0.0.1"].includes(window.location.hostname),s=window.location.protocol==="https:"||window.location.protocol==="chrome-extension:";if(!a&&!s)throw new Q("Embedded wallet is only available over HTTPS")}(),function(a){if(typeof a!="string"||a.length!==25)throw new Q("Cannot initialize the Privy provider with an invalid Privy app ID")}(e.appId),Oje(e);let n=L.useMemo(()=>new M5e({appId:e.appId,clientId:e.clientId,storage:nt,baseUrl:e.apiUrl,sdkVersion:"react-auth:3.37.1"}),[]),r=aK(),i=Object.assign({},t);return m.jsx(S4e,{client:n,legacyClient:r,appClientId:e.clientId,clientConfig:i,children:m.jsx(uje,{configPlugins:t?.plugins,children:m.jsx(tJe,{...e,client:r,privy:n})})})};function cct(){let{promptMfa:t,init:e,submit:n,cancel:r,clear:i,mfaMethods:a}=L.useContext(Ia);return{promptMfa:t,init:e,submit:n,cancel:r,clear:i,mfaMethods:a}}function lct(){let{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:a,unenroll:s,enrollInMfa:o}=L.useContext(Ia);return{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:a,unenrollWithSms:()=>s("sms"),unenrollWithTotp:()=>s("totp"),unenrollWithPasskey:c=>s("passkey",c),showMfaEnrollmentModal:()=>o(!0),closeMfaEnrollmentModal:()=>o(!1)}}const cJe=t=>{La("login",t);let e=Qv(),n=BE(),{ready:r,user:i}=$i(),{initLoginWithHeadlessOAuth:a,loginWithHeadlessOAuth:s,oAuthState:o,setOAuthState:c,isHeadlessOAuthLoading:l}=Vt(),u=L.useCallback(async f=>{try{if(e.enabled&&e.status!=="success")throw new Wp(e.error,null,fe.CAPTCHA_FAILURE);return await a(f.provider,e.token,f.disableSignup)}catch(h){throw c({status:"error",error:h}),h}},[a,e]),d=L.useCallback(async()=>{let f=Xb();try{if(!f.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");let h=f.provider;if(rv(h)){if(i&&i.linkedAccounts.some(p=>p.type===h))return console.warn("User is already logged in with this OAuth provider"),i}else if(i&&h in i&&i[h])return console.warn("User is already logged in with this OAuth provider"),i;if(f.popupFlow)return}catch(h){throw c({status:"error",error:h}),h}try{return await s(f)}catch(h){throw c({status:"error",error:h}),h}finally{XGe()}},[s]);return L.useEffect(()=>{let f=Xb();r&&n&&f.inProgress&&!f.withPrivyUi&&!f.popupFlow&&d().catch(()=>{})},[r,n]),{initOAuth:u,loading:l,state:o}},lJe=t=>{let e=Qv(),{emailOtpState:n,setEmailOtpState:r,initLoginWithEmail:i,loginWithCode:a}=Vt();return{sendCode:L.useCallback(async({email:s,disableSignup:o})=>{try{if(!s)throw Error("Email required to send OTP code");let c=await eYe(e);return await i({email:s,captchaToken:c,disableSignup:o,withPrivyUi:!1})}catch(c){throw r({status:"error",error:c}),t?.onError?.(c.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),c}},[i,e]),loginWithCode:L.useCallback(async({code:s})=>{try{let{user:o,isNewUser:c,wasAlreadyAuthenticated:l,linkedAccount:u}=await a(s);t?.onComplete?.({user:o,isNewUser:c,wasAlreadyAuthenticated:l,loginMethod:"email",loginAccount:u})}catch(o){throw r({status:"error",error:o}),t?.onError?.(o.privyErrorCode||fe.UNKNOWN_AUTH_ERROR),o}},[a]),state:n}},uJe=t=>{let{connectOrCreateWallet:e}=$i();return La("connectOrCreateWallet",t),{connectOrCreateWallet:e}};function dJe(){let{signTransaction:t}=L.useContext(Ia);return{signTransaction:t}}const fJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_aed)",children:[m.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"#00732F"}),m.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"white"}),m.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#000001"}),m.jsx("path",{d:"M0 0H180V512H0V0Z",fill:"#FF0000"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_aed",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),hJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_ars)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#74ACDF"}),m.jsx("path",{d:"M0 170.7H512V341.4H0V170.7Z",fill:"white"}),m.jsx("path",{d:"M256 284.4C271.685 284.4 284.4 271.684 284.4 256C284.4 240.315 271.685 227.6 256 227.6C240.315 227.6 227.6 240.315 227.6 256C227.6 271.684 240.315 284.4 256 284.4Z",fill:"#F6B40E"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_ars",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),pJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_aud)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#00008B"}),m.jsx("path",{d:"M256 0V32L161 128L256 221.5V256H222.5L127 162L34 256H0V222L93 128.5L0 37V0H31L127 94L220 0H256Z",fill:"white"}),m.jsx("path",{d:"M0 104V152H256V104H0ZM104 0V256H152V0H104Z",fill:"#FF0000"}),m.jsx("path",{d:"M202 402.8L156.2 408.2L160.8 454.1L128 421.7L95.0001 453.9L99.9001 408L54.1001 402.2L93.0001 377.4L69.0001 338L112.6 353L128.4 309.6L143.9 353.1L187.6 338.4L163.3 377.6L202.1 402.7L202 402.8Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_aud",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),gJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_bdt)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#006A4E"}
721),m.jsx("path",{d:"M230 426.7C324.275 426.7 400.7 350.275 400.7 256C400.7 161.725 324.275 85.2998 230 85.2998C135.725 85.2998 59.2998 161.725 59.2998 256C59.2998 350.275 135.725 426.7 230 426.7Z",fill:"#F42A41"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_bdt",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),yJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_bgn)",children:[m.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"white"}),m.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"#00966E"}),m.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#D62612"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_bgn",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),mJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_4989_138102)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#229E45"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M261.4 405.4L491.2 256.2L260 106.6L29.2998 256.6L261.4 405.4Z",fill:"#F8E509"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M361.5 256C361.904 269.02 359.687 28
7211.989 354.98 294.136C350.273 306.283 343.173 317.359 334.1 326.708C325.028 336.056 314.17 343.486 302.17 348.555C290.17 353.624 277.273 356.229 264.246 356.216C251.22 356.202 238.329 353.57 226.339 348.477C214.349 343.383 203.506 335.931 194.453 326.564C185.4 317.197 178.323 306.106 173.641 293.949C168.959 281.793 166.769 268.82 167.2 255.8C168.035 230.574 178.649 206.662 196.798 189.122C214.947 171.582 239.207 161.79 264.447 161.816C289.686 161.842 313.926 171.684 332.039 189.262C350.151 206.839 360.717 230.773 361.5 256Z",fill:"#2B49A3"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M232.3 314.2L229.3 312.4L226.2 314L226.9 310.5L224.5 308L227.9 307.6L229.5 304.4L231 307.7L234.4 308.3L231.8 310.7M297.5 330.7L294.5 328.9L291.3 330.5L292 327L289.6 324.5L293.1 324.1L294.7 320.9L296.1 324.2L299.5 324.8L297 327.2M269.4 304.3L266.8 302.8L264.1 304.1L264.7 301.1L262.7 298.9L265.6 298.6L267 295.9L268.2 298.7L271.2 299.2L269 301.2M335.2 294.8L332.6 293.3L330 294.6L330.6 291.7L328.6 289.6L331.5 289.2L332.8 286.6L334.1 289.3L337 289.8L334.8 291.8M268.2 275.1L265.2 273.3L262.1 274.9L262.8 271.4L260.4 268.9L263.8 268.5L265.4 265.4L266.9 268.6L270.3 269.2L267.7 271.6M188 245L185 243.2L182 244.8L182.6 241.3L180.2 238.8L183.7 238.4L185.3 235.2L186.7 238.5L190.1 239.1L187.6 241.5M197.7 285L194.7 283.3L191.6 284.8L192.3 281.4L189.9 278.8L193.3 278.4L194.9 275.4L196.4 278.5L199.8 279.2L197.2 281.5M297.8 230.2L295.2 228.7L292.4 230L293 227L291 224.7L294 224.4L295.4 221.6L296.7 224.5L299.7 225L297.4 227.1M292.4 256.3L290 255L287.9 256L288.3 253.6L286.7 251.9L289.1 251.6L290.2 249.4L291.2 251.7L293.6 252.1L291.8 253.7M183.4 292.2L181.4 291L179.3 292L179.7 289.7L178.1 288L180.5 287.8L181.5 285.8L182.5 287.8L184.8 288.3L183.1 289.9M335.7 301.4L334 300.6L332.3 301.3L332.7 299.6L331.4 298.3L333.3 298.1L334.2 296.6L334.9 298.2L336.8 298.5L335.4 299.7",fill:"#FFFFEF"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M183.5 292.3L181.5 291.1L179.4 292.1L179.9 289.8L178.2 288.1L180.5 287.9L181.6 285.9L182.6 287.9L184.9 288.4L183.2 290",fill:"#FFFFEF"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M183.5 292.3L181.5 291.1L179.4 292.1L179.9 289.8L178.2 288.1L180.5 287.9L181.6 285.9L182.6 287.9L184.9 288.4L183.2 290M215.4 292.3L213.4 291.1L211.4 292.1L211.8 289.8L210.2 288.1L212.5 287.9L213.5 285.8L214.5 287.9L216.8 288.4L215.1 290M211.4 303L209.4 301.8L207.4 302.8L207.8 300.5L206.2 298.8L208.5 298.5L209.5 296.5L210.5 298.5L212.8 299L211.1 300.6M277.8 283.6L275.8 282.4L273.7 283.4L274.1 281.1L272.5 279.4L274.8 279.2L275.9 277.1L276.9 279.2L279.1 279.6L277.4 281.2M258.3 283.6L256.3 282.4L254.2 283.4L254.7 281.1L253.1 279.4L255.4 279.2L256.4 277.1L257.4 279.2L259.7 279.6L258 281.2M205.5 276.8L204.3 276.1L203 276.7L203.2 275.2L202.2 274.2L203.7 274L204.4 272.7L204.9 274.1L206.4 274.3L205.4 275.3M333.2 310L331.2 308.9L329.1 309.9L329.6 307.6L328 305.9L330.3 305.6L331.3 303.6L332.3 305.6L334.6 306.1L332.9 307.7M316.9 312.1L315.3 311.1L313.6 312.1L314 310.1L312.6 308.7L314.6 308.5L315.4 306.8L316.2 308.5L318.2 308.9L316.7 310.2M324.7 312L323.1 311L321.5 311.9L321.8 310.1L320.6 308.8L322.4 308.6L323.2 307L323.9 308.6L325.7 308.9L324.4 310.2M346.6 292.8L345.1 291.9L343.5 292.7L343.9 291L342.7 289.7L344.4 289.5L345.2 288L345.9 289.6L347.6 289.9L346.3 291.1M317 322.9L315 321.8L313 322.8L313.5 320.6L311.9 319.1L314.1 318.8L315.2 316.9L316.2 318.9L318.3 319.3L316.7 320.7M317.1 331.6L315.3 330.6L313.5 331.5L313.9 329.3L312.5 327.8L314.5 327.5L315.5 325.6L316.3 327.6L318.3 328L316.8 329.4M302.3 312L300.8 311.1L299.2 311.9L299.6 310.1L298.4 308.9L300.1 308.7L300.9 307.1L301.6 308.7L303.3 309L302 310.2M288.5 312L287 311.1L285.4 311.9L285.8 310.1L284.6 308.9L286.3 308.7L287.1 307.1L287.8 308.7L289.5 309L288.3 310.2M265 291.4L263.5 290.5L261.9 291.3L262.3 289.6L261.1 288.3L262.8 288.1L263.6 286.6L264.3 288.2L266 288.5L264.7 289.6M267.6 333.1L266.3 332.4L265 333.1L265.3 331.6L264.3 330.6L265.7 330.3L266.4 329L267 330.4L268.5 330.6L267.4 331.6M232.2 265.6L229.2 263.9L226.1 265.4L226.8 262L224.4 259.4L227.8 259L229.4 255.9L230.9 259.1L234.3 259.7L231.7 262.1",fill:"#FFFFEF"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M355.1 291C356.981 286.097 358.453 281.046 359.5 275.9C307.9 230.5 250.3 207.2 177.5 212C174.892 217.096 172.75 222.418 171.1 227.9C204.497 224.527 238.23 228.41 269.987 239.284C301.745 250.157 330.778 267.765 355.1 290.9V291Z",fill:"white"}),m.jsx("path",{d:"M331.9 265.4L333.7 266.4C333.45 266.965 333.38 267.594 333.5 268.2C333.633 268.667 333.967 269.067 334.5 269.4C335.033 269.733 335.567 269.933 336.1 270C336.5 270 336.833 269.8 337.1 269.4C337.233 269.2 337.267 268.967 337.2 268.7L336.9 267.9L335.7 266.6C335.065 265.949 334.586 265.163 334.3 264.3C334.164 263.65 334.248 262.974 334.537 262.377C334.827 261.78 335.306 261.296 335.9 261C336.435 260.77 337.026 260.7 337.6 260.8C338.325 260.948 339.008 261.256 339.6 261.7C340.467 262.309 341.157 263.137 341.6 264.1C341.721 264.543 341.739 265.007 341.652 265.458C341.566 265.909 341.377 266.334 341.1 266.7L339.3 265.6C339.5 265.067 339.567 264.6 339.5 264.2C339.367 263.867 339.033 263.533 338.5 263.2C337.967 262.867 337.5 262.7 337.1 262.7L336.5 263L336.4 263.7C336.4 264.1 336.8 264.667 337.6 265.4L339.1 267.4C339.373 267.898 339.499 268.463 339.463 269.029C339.428 269.595 339.233 270.14 338.9 270.6C338.555 271.1 338.067 271.483 337.5 271.7C336.905 271.972 336.238 272.042 335.6 271.9C334.841 271.707 334.128 271.367 333.5 270.9C332.577 270.308 331.875 269.43 331.5 268.4C331.167 267.533 331.3 266.533 331.9 265.4ZM323.1 259.7L325.1 260.7C324.889 261.205 324.819 261.758 324.9 262.3C325.033 262.833 325.367 263.267 325.9 263.6C326.433 263.933 326.967 264.067 327.5 264C327.9 264 328.233 263.8 328.5 263.4L328.6 262.8C328.6 262.533 328.467 262.267 328.2 262L327 260.7C326.342 260.088 325.829 259.336 325.5 258.5C325.381 258.101 325.346 257.682 325.397 257.268C325.449 256.855 325.586 256.457 325.8 256.1C326.105 255.667 326.519 255.322 327 255.1C327.535 254.87 328.126 254.8 328.7 254.9C329.3 254.9 329.967 255.167 330.7 255.7C331.767 256.367 332.433 257.133 332.7 258C332.85 258.428 332.9 258.884 332.848 259.334C332.797 259.785 332.643 260.217 332.4 260.6L330.5 259.5C330.767 258.967 330.833 258.533 330.7 258.2C330.567 257.867 330.233 257.533 329.7 257.2C329.497 257.019 329.259 256.881 329.001 256.796C328.744 256.71 328.471 256.677 328.2 256.7L327.6 257.1V257.8C327.6 258.133 328 258.7 328.8 259.5C329.6 260.3 330.133 260.9 330.4 261.3C330.708 261.8 330.863 262.378 330.845 262.965C330.827 263.552 330.638 264.12 330.3 264.6C329.98 265.138 329.499 265.563 328.925 265.814C328.351 266.065 327.713 266.13 327.1 266C326.314 265.85 325.566 265.544 324.9 265.1C323.957 264.551 323.219 263.708 322.8 262.7C322.505 261.699 322.613 260.623 323.1 259.7ZM312.3 256.7L317.9 247.7L324.6 251.7L323.6 253.3L318.8 250.3L317.5 252.3L322.1 255.1L321.1 256.7L316.6 253.9L315.1 256.4L320.1 259.4L319.2 261L312.3 256.7ZM296.5 243.8L297.4 242.2L301.4 244.4L299.5 248.1C297.88 248.477 296.178 248.264 294.7 247.5C293.81 247.028 293.054 246.341 292.5 245.5C291.998 244.724 291.721 243.824 291.7 242.9C291.7 241.9 291.967 240.967 292.5 240.1C292.958 239.174 293.646 238.382 294.5 237.8C295.233 237.2 296.133 236.9 297.2 236.9C297.933 236.9 298.767 237.133 299.7 237.6C300.686 238.063 301.493 238.836 302 239.8C302.4 240.6 302.5 241.5 302.3 242.5L300.2 241.9C300.332 241.393 300.261 240.855 300 240.4C299.709 239.93 299.294 239.549 298.8 239.3C298.443 239.086 298.045 238.949 297.632 238.897C297.218 238.846 296.799 238.881 296.4 239C295.733 239.333 295.067 240 294.4 241C293.926 241.924 293.751 242.972 293.9 244C294.1 244.8 294.633 245.4 295.5 245.8L296.8 246.2H298.1L298.7 245L296.5 243.8ZM227.7 226.8L229.3 216.2L232.5 216.7L233.3 224.2L236.3 217.2L239.4 217.7L237.9 228.3L235.9 228L237.1 219.7L233.8 227.7L231.8 227.4L230.9 218.7L229.7 227.1L227.7 226.8ZM217 225.5L218 214.9L225.8 215.6L225.7 217.4L219.9 216.9L219.7 219.2L225 219.7L224.9 221.5L219.6 221L219.3 224L225.2 224.5L225 226.3L217 225.5Z",fill:"#309E3A"}),m.jsx("path",{d:"M181.4 218.8C181.4 217.733 181.567 216.833 181.9 216.1L182.9 214.7L184.4 213.7C185.14 213.451 185.921 213.349 186.7 213.4C187.394 213.395 188.082 213.535 188.719 213.811C189.356 214.086 189.928 214.491 190.4 215C191.333 216 191.767 217.333 191.7 219C191.7 220.8 191.2 222.133 190.2 223C189.699 223.48
7216 189.103 223.861 188.448 224.102C187.794 224.343 187.096 224.445 186.4 224.4C185.713 224.418 185.031 224.293 184.394 224.035C183.757 223.777 183.181 223.391 182.7 222.9C182.206 222.368 181.834 221.734 181.609 221.043C181.385 220.353 181.313 219.621 181.4 218.9V218.8Z",fill:"#309E3A"}),m.jsx("path",{d:"M183.6 218.8C183.6 220 183.867 220.933 184.4 221.6C184.933 222.267 185.6 222.6 186.4 222.6C186.809 222.608 187.215 222.532 187.593 222.377C187.971 222.222 188.314 221.992 188.6 221.7C189.133 221.1 189.433 220.2 189.5 219C189.5 217.667 189.233 216.733 188.7 216.2C188.187 215.621 187.471 215.263 186.7 215.2C185.7 215.2 184.967 215.5 184.5 216.1C183.9 216.7 183.567 217.6 183.5 218.8H183.6Z",fill:"#F7FFFF"}),m.jsx("path",{d:"M194 224.4L194.1 213.7H198.6C199.8 213.7 200.633 213.833 201.1 214.1C201.767 214.367 202.167 214.7 202.3 215.1C202.567 215.633 202.733 216.2 202.8 216.8C202.8 217.6 202.567 218.267 202.1 218.8C201.633 219.267 200.9 219.6 199.9 219.8C200.433 220 200.833 220.267 201.1 220.6L202.3 222.4L203.6 224.4H201L199.5 222.1L198.3 220.5L197.7 220.1L196.7 219.9H196.2V224.4H194Z",fill:"#309E3A"}),m.jsx("path",{d:"M196.2 218.2H199.8L200.3 217.7C200.5 217.5 200.6 217.233 200.6 216.9C200.6 216.567 200.5 216.267 200.3 216L199.5 215.6H196.3L196.2 218.2Z",fill:"white"}),m.jsx("path",{d:"M206.2 214.2L210.1 214.4L212.1 214.7C212.669 214.915 213.182 215.257 213.6 215.7C214.067 216.253 214.408 216.902 214.6 217.6C214.8 218.267 214.866 219.1 214.8 220.1C214.851 220.868 214.724 221.638 214.429 222.349C214.135 223.06 213.679 223.694 213.1 224.2C212.7 224.533 212.2 224.8 211.6 225H209.6L205.6 224.9L206.2 214.2Z",fill:"#309E3A"}),m.jsx("path",{d:"M208.199 216.1L207.899 223.1L209.499 223.3H210.799L211.699 222.8C211.966 222.6 212.166 222.267 212.299 221.8L212.599 219.8L212.499 218C212.366 217.533 212.166 217.2 211.899 217L210.899 216.4L209.199 216.2L208.199 216.1Z",fill:"white"}),m.jsx("path",{d:"M258.5 233.3L261 222.9L264.3 223.7C265.633 224.033 266.467 224.3 266.8 224.5C267.333 224.767 267.733 225.2 268 225.8C268.267 226.4 268.3 227.133 268.1 228C268.011 228.516 267.789 228.999 267.456 229.403C267.123 229.806 266.69 230.116 266.2 230.3L265.1 230.6L262.9 230.2L261.5 229.9L260.5 233.8L258.5 233.3Z",fill:"#309E3A"}),m.jsx("path",{d:"M262.6 225.2L261.9 228.2L263.1 228.4C263.9 228.6 264.467 228.667 264.8 228.6C265.077 228.572 265.339 228.461 265.553 228.283C265.767 228.105 265.922 227.867 266 227.6L265.9 226.5L265.1 225.8L263.6 225.4L262.6 225.2Z",fill:"white"}),m.jsx("path",{d:"M268.4 236.3L271.9 226.2L276.2 227.7L278.4 228.7C278.8 229.1 279.1 229.6 279.3 230.2C279.6 231.1 279.3 231.3 279.1 231.9C278.9 232.7 278.467 233.233 277.8 233.5C277.456 233.7 277.075 233.83 276.681 233.881C276.286 233.933 275.884 233.905 275.5 233.8L276.3 235L276.9 237L277.4 239.4L275 238.6L274.3 235.9L273.7 234L273.3 233.4L272.3 232.9L271.9 232.8L270.4 237L268.4 236.3Z",fill:"#309E3A"}),m.jsx("path",{d:"M272.4 231.2L273.9 231.7L275.8 232.2C276.067 232.2 276.3 232.133 276.5 232L277 231.3V230.3L276.4 229.7L274.9 229.2L273.3 228.6L272.4 231.2Z",fill:"white"}),m.jsx("path",{d:"M280.9 235.9C281.159 234.987 281.601 234.137 282.2 233.4C282.533 232.933 282.966 232.567 283.5 232.3L285.1 231.8C285.766 231.8 286.533 231.9 287.4 232.1C288.078 232.27 288.714 232.58 289.265 233.011C289.816 233.441 290.271 233.983 290.6 234.6C291.266 235.867 291.3 237.3 290.7 238.9C290.328 240.336 289.437 241.582 288.2 242.4C287.583 242.707 286.909 242.884 286.221 242.918C285.532 242.952 284.844 242.844 284.2 242.6C283.521 242.43 282.886 242.12 282.334 241.69C281.783 241.259 281.329 240.717 281 240.1C280.461 238.758 280.426 237.266 280.9 235.9Z",fill:"#309E3A"}),m.jsx("path",{d:"M283 236.5C282.667 237.567 282.667 238.5 283 239.3C283.333 240.1 283.933 240.633 284.8 240.9C285.6 241.1 286.333 241 287 240.6C287.667 240.2 288.233 239.4 288.7 238.2C288.967 237.067 288.967 236.1 288.7 235.3C288.516 234.942 288.262 234.625 287.952 234.367C287.643 234.109 287.285 233.917 286.9 233.8C286.516 233.695 286.115 233.667 285.72 233.719C285.325 233.77 284.944 233.9 284.6 234.1C283.933 234.5 283.4 235.3 283 236.5Z",fill:"white"}),m.jsx("path",{d:"M301.7 250.8L306.6 241.3L310.6 243.3C311.6 243.9 312.267 244.367 312.6 244.7C313 245.167 313.234 245.667 313.3 246.2C313.434 246.867 313.3 247.433 312.9 247.9C312.634 248.567 312.134 249.067 3
72111.4 249.4C310.734 249.6 309.967 249.567 309.1 249.3C309.367 249.7 309.567 250.133 309.7 250.6L310 252.7L310.2 255.2L307.9 254L307.6 251.2L307.3 249.2L306.9 248.6L306 248L305.6 247.8L303.6 251.8L301.7 250.8Z",fill:"#309E3A"}),m.jsx("path",{d:"M306.4 246.3L307.8 247L309.6 247.8C309.867 247.8 310.1 247.733 310.3 247.6C310.536 247.424 310.729 247.199 310.868 246.939C311.006 246.68 311.085 246.393 311.1 246.1L310.5 245.4L309.2 244.6L307.7 243.9L306.4 246.3Z",fill:"white"}),m.jsx("path",{d:"M341.2 270.3C341.733 269.367 342.4 268.7 343.2 268.3L344.8 267.6H346.4C347.133 267.667 347.867 268 348.6 268.6C349.191 268.961 349.7 269.44 350.096 270.008C350.492 270.577 350.766 271.221 350.9 271.9C351.045 273.355 350.654 274.813 349.8 276C349.001 277.275 347.751 278.203 346.3 278.6C345.623 278.727 344.927 278.712 344.256 278.557C343.585 278.402 342.953 278.111 342.4 277.7C341.809 277.339 341.299 276.86 340.903 276.291C340.507 275.723 340.234 275.079 340.1 274.4C339.926 272.957 340.281 271.5 341.1 270.3H341.2Z",fill:"#309E3A"}),m.jsx("path",{d:"M343 271.4C342.334 272.467 342.067 273.4 342.2 274.2C342.269 274.605 342.419 274.991 342.643 275.335C342.867 275.679 343.158 275.973 343.5 276.2C344.155 276.612 344.943 276.755 345.7 276.6C346.5 276.4 347.267 275.767 348 274.7C348.734 273.633 349 272.733 348.8 272C348.8 271.267 348.4 270.6 347.6 270C346.4 269.1 346.1 269.4 345.3 269.6C344.5 269.8 343.767 270.4 343.1 271.4H343Z",fill:"white"}),m.jsx("path",{d:"M246.4 229L248.1 221.4L253.7 222.7L253.4 224L249.4 223L249 224.7L252.7 225.6L252.4 226.9L248.7 225.9L248.2 228L252.4 229L252.1 230.3L246.4 229Z",fill:"#309E3A"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_4989_138102",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),vJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_cad)",children:[m.jsx("path",{d:"M81.1001 0H443.4V512H81.1001V0Z",fill:"white"}),m.jsx("path",{d:"M-100 0H81.1V512H-100V0ZM443.4 0H624.5V512H443.4V0Z",fill:"#D52B1E"}),m.jsx("path",{d:"M135.3 247.4L121.3 252.2L186.7 309.7C191.7 324.5 185 328.8 180.7 336.6L251.7 327.6L249.9 399.1L264.7 398.6L261.4 327.7L332.6 336.1C328.2 326.8 324.3 321.9 328.3 307.1L393.7 252.6L382.3 248.5L257.4 101.4L135.3 247.5V247.4Z",fill:"#D52B1E"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_cad",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),wJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_chf)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#FF0000"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M96 208H416V304H96V208Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M208 96H304V416H208V96Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_chf",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),bJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_clp)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.805 0H767.486V255.805H255.805V0Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H255.805V255.805H0V0Z",fill:"#0039A6"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M167.721 191.547L128.011 161.872L88.6616 191.835L103.318 143.1L63.9692 112.993L112.632 112.56L127.794 63.9692L143.173 112.488H191.908L152.631 142.956L167.721 191.547Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 255.805H767.486V511.682H0V255.805Z",fill:"#D52B1E"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_clp",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),_Je=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_cny)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#EE1C25"}),m.jsx("path",{d:"M204.8 104.96L74.2402 189.44L128 51.2002L174.08
721189.44L51.2002 104.96H204.8Z",fill:"#FFFF00"}),m.jsx("path",{d:"M236.577 33.0493L283.098 55.8344L234.403 64.2012L265.969 27.3271L262.929 76.9066L236.577 33.0493Z",fill:"#FFFF00"}),m.jsx("path",{d:"M295.87 78.2082L329.881 117.326L281.736 106.078L325.192 84.3783L303.084 128.897L295.87 78.2082Z",fill:"#FFFF00"}),m.jsx("path",{d:"M306.574 152.531L321.655 202.153L282.279 172.21L330.834 170.145L292.454 201.774L306.574 152.531Z",fill:"#FFFF00"}),m.jsx("path",{d:"M266.01 205.632L260.775 257.178L236.032 214.4L281.575 231.219L234.01 245.568L266.01 205.632Z",fill:"#FFFF00"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_cny",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),CJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_cop)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#FFE800"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 256H512V512H0V256Z",fill:"#00148E"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 384H512V512H0V384Z",fill:"#DA0010"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_cop",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),EJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_czk)",children:[m.jsx("path",{d:"M0 0H512V256H0V0Z",fill:"white"}),m.jsx("path",{d:"M0 256H512V512H0V256Z",fill:"#D7141A"}),m.jsx("path",{d:"M300 256L0 56V456L300 256Z",fill:"#11457E"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_czk",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),SJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_dkk)",children:[m.jsx("path",{d:"M0 0H512.1V512H0V0Z",fill:"#C8102E"}),m.jsx("path",{d:"M144 0H217.1V512H144V0Z",fill:"white"}),m.jsx("path",{d:"M0 219.4H512.1V292.6H0V219.4Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_dkk",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),AJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_egp)",children:[m.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#000001"}),m.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"white"}),m.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"#CE1126"}),m.jsx("path",{d:"M256.681 258.047L315.134 312.319L310.953 213.759C310.355 198.826 297.385 202.239 287.913 207.615C278.441 213.759 267.433 213.759 255.998 209.749C244.478 213.759 233.555 213.759 224.084 207.615C214.697 202.239 201.641 198.826 201.044 213.759L196.862 312.319L256.681 258.047Z",fill:"white",stroke:"#C09300",strokeWidth:"1.10933",strokeLinejoin:"round"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_egp",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),xJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_etb)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-237.908 3.54639H799.515V501.338H-238.013L-237.908 3.54639Z",fill:"#FFC621"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-240 342.346H798.887V511.798H-240V342.346Z",fill:"#EF2118"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-237.908 -0.0102539H799.514V179.902H-237.908V-0.0102539Z",fill:"#298C08"}),m.jsx("path",{d:"M261.885 371.676C321.297 371.676 369.461 323.512 369.461 264.099C369.461 204.687 321.297 156.523 261.885 156.523C202.472 156.523 154.308 204.687 154.308 264.099C154.308 323.512 202.472 371.676 261.885 371.676Z",fill:"#006BC6"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_etb",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),IJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_4989_138368)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#003399"}
721),m.jsx("path",{d:"M255.999 81.4124L248.414 106.696L261.056 109.225L255.999 81.4124Z",fill:"#FFCC00"}),m.jsx("path",{d:"M255.999 81.4124L263.584 106.696L250.942 109.225L255.999 81.4124Z",fill:"#FFCC00"}),m.jsx("path",{d:"M280.046 98.8831L253.656 99.4824L255.158 112.287L280.046 98.8831Z",fill:"#FFCC00"}),m.jsx("path",{d:"M280.046 98.8831L258.343 113.91L252.032 102.668L280.046 98.8831Z",fill:"#FFCC00"}),m.jsx("path",{d:"M270.861 127.151L262.136 102.238L250.422 107.623L270.861 127.151Z",fill:"#FFCC00"}),m.jsx("path",{d:"M270.86 127.151L249.862 111.155L258.604 101.678L270.86 127.151Z",fill:"#FFCC00"}),m.jsx("path",{d:"M231.953 98.8831L258.343 99.4824L256.841 112.287L231.953 98.8831Z",fill:"#FFCC00"}),m.jsx("path",{d:"M231.953 98.8831L253.655 113.91L259.967 102.668L231.953 98.8831Z",fill:"#FFCC00"}),m.jsx("path",{d:"M241.138 127.151L249.863 102.238L261.576 107.623L241.138 127.151Z",fill:"#FFCC00"}),m.jsx("path",{d:"M241.138 127.151L262.136 111.155L253.395 101.678L241.138 127.151Z",fill:"#FFCC00"}),m.jsx("path",{d:"M255.999 384.82L248.414 410.104L261.056 412.632L255.999 384.82Z",fill:"#FFCC00"}),m.jsx("path",{d:"M255.999 384.82L263.584 410.104L250.942 412.632L255.999 384.82Z",fill:"#FFCC00"}),m.jsx("path",{d:"M280.046 402.291L253.656 402.89L255.158 415.694L280.046 402.291Z",fill:"#FFCC00"}),m.jsx("path",{d:"M280.046 402.291L258.343 417.318L252.032 406.076L280.046 402.291Z",fill:"#FFCC00"}),m.jsx("path",{d:"M270.862 430.559L262.137 405.645L250.423 411.031L270.862 430.559Z",fill:"#FFCC00"}),m.jsx("path",{d:"M270.861 430.559L249.863 414.562L258.604 405.086L270.861 430.559Z",fill:"#FFCC00"}),m.jsx("path",{d:"M231.953 402.291L258.343 402.89L256.841 415.694L231.953 402.291Z",fill:"#FFCC00"}),m.jsx("path",{d:"M231.953 402.291L253.655 417.318L259.967 406.076L231.953 402.291Z",fill:"#FFCC00"}),m.jsx("path",{d:"M241.138 430.559L249.863 405.645L261.576 411.031L241.138 430.559Z",fill:"#FFCC00"}),m.jsx("path",{d:"M241.138 430.559L262.136 414.562L253.395 405.086L241.138 430.559Z",fill:"#FFCC00"}),m.jsx("path",{d:"M104.296 233.116L96.7109 258.4L109.353 260.928L104.296 233.116Z",fill:"#FFCC00"}),m.jsx("path",{d:"M104.296 233.116L111.881 258.4L99.2394 260.928L104.296 233.116Z",fill:"#FFCC00"}),m.jsx("path",{d:"M128.342 250.587L101.952 251.186L103.454 263.991L128.342 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M128.343 250.587L106.64 265.614L100.329 254.372L128.343 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M119.157 278.855L110.432 253.942L98.7187 259.327L119.157 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M119.158 278.855L98.1595 262.858L106.901 253.382L119.158 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M80.2498 250.587L106.64 251.186L105.138 263.991L80.2498 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M80.2497 250.587L101.952 265.614L108.263 254.372L80.2497 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M89.4349 278.855L98.1599 253.942L109.874 259.327L89.4349 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M89.4347 278.855L110.433 262.858L101.691 253.382L89.4347 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M167.148 148.621L188.146 132.625L179.404 123.149L167.148 148.621Z",fill:"#FFCC00"}),m.jsx("path",{d:"M167.148 148.622L175.873 123.708L187.586 129.093L167.148 148.622Z",fill:"#FFCC00"}),m.jsx("path",{d:"M157.963 120.353L179.665 135.38L185.976 124.138L157.963 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M157.963 120.353L184.353 120.952L182.851 133.757L157.963 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M182.009 102.882L174.424 128.166L187.066 130.695L182.009 102.882Z",fill:"#FFCC00"}),m.jsx("path",{d:"M182.009 102.882L189.594 128.166L176.952 130.695L182.009 102.882Z",fill:"#FFCC00"}),m.jsx("path",{d:"M196.871 148.621L175.873 132.625L184.614 123.149L196.871 148.621Z",fill:"#FFCC00"}),m.jsx("path",{d:"M196.871 148.622L188.146 123.708L176.432 129.093L196.871 148.622Z",fill:"#FFCC00"}),m.jsx("path",{d:"M206.056 120.353L184.353 135.38L178.042 124.138L206.056 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M206.056 120.353L179.665 120.952L181.167 133.757L206.056 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M140.628 204.864L131.903 179.951L120.189 185.336L140.628 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M140.628 204.864L119.63 188.868L128.371 179.391L140.628 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M110.904 204.864L131.903 188.868L123.161 179.391L110.904 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M110.905 204.864L119.63 179.951L131.343 185.336L110.905 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M101.719 176.596L123.422 191.623L129.733 180.381L101.719 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M101.72 176.596L128.11 177.195L126.608 190L101.72 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M149.813 176.596L128.11 191.623L121.799 180.381L149.813 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M149.813 176.596L123.422 177.195L124.924 190L149.813 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M125.766 159.125L133.352 184.409L120.71 186.938L125.766 159.125Z",fill:"#FFCC00"}),m.jsx("path",{d:"M125.766 159.125L118.181 184.409L130.823 186.938L125.766 159.125Z",fill:"#FFCC00"}),m.jsx("path",{d:"M149.841 328.664L123.45 329.263L124.952 342.067L149.841 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M149.841 328.664L128.138 343.691L121.827 332.449L149.841 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M140.656 356.932L131.931 332.018L120.217 337.403L140.656 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M140.656 356.932L119.658 340.935L128.399 331.459L140.656 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M110.933 356.932L131.931 340.935L123.189 331.459L110.933 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M110.933 356.932L119.658 332.018L131.372 337.404L110.933 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M125.794 311.193L133.379 336.477L120.737 339.005L125.794 311.193Z",fill:"#FFCC00"}),m.jsx("path",{d:"M125.794 311.193L118.209 336.477L130.851 339.005L125.794 311.193Z",fill:"#FFCC00"}),m.jsx("path",{d:"M101.748 328.664L128.138 329.263L126.636 342.067L101.748 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M101.748 328.664L123.45 343.691L129.762 332.449L101.748 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M204.716 379.555L178.325 380.154L179.827 392.958L204.716 379.555Z",fill:"#FFCC00"}),m.jsx("path",{d:"M204.716 379.554L183.013 394.582L176.702 383.34L204.716 379.554Z",fill:"#FFCC00"}),m.jsx("path",{d:"M195.531 407.823L186.806 382.909L175.092 388.294L195.531 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M195.531 407.823L174.533 391.826L183.274 382.35L195.531 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M165.808 407.823L186.806 391.826L178.064 382.35L165.808 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M165.808 407.823L174.533 382.909L186.247 388.294L165.808 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M180.669 362.084L188.254 387.368L175.612 389.896L180.669 362.084Z",fill:"#FFCC00"}),m.jsx("path",{d:"M180.669 362.084L173.084 387.368L185.726 389.896L180.669 362.084Z",fill:"#FFCC00"}),m.jsx("path",{d:"M156.623 379.555L183.013 380.154L181.511 392.958L156.623 379.555Z",fill:"#FFCC00"}),m.jsx("path",{d:"M156.623 379.554L178.325 394.582L184.637 383.34L156.623 379.554Z",fill:"#FFCC00"}),m.jsx("path",{d:"M407.703 233.116L415.288 258.4L402.646 260.928L407.703 233.116Z",fill:"#FFCC00"}),m.jsx("path",{d:"M407.703 233.116L400.118 258.4L412.76 260.928L407.703 233.116Z",fill:"#FFCC00"}),m.jsx("path",{d:"M383.656 250.587L410.046 251.186L408.545 263.991L383.656 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M383.656 250.587L405.359 265.614L411.67 254.372L383.656 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M392.841 278.855L401.566 253.941L413.279 259.327L392.841 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M392.841 278.855L413.839 262.858L405.098 253.382L392.841 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M431.749 250.587L405.359 251.186L406.861 263.991L431.749 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M431.749 250.587L410.046 265.614L403.735 254.372L431.749 250.587Z",fill:"#FFCC00"}),m.jsx("path",{d:"M422.565 278.855L413.84 253.941L402.126 259.327L422.565 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M422.564 278.855L401.566 262.858L410.308 253.382L422.564 278.855Z",fill:"#FFCC00"}),m.jsx("path",{d:"M344.852 148.621L323.854 132.625L332.596 123.149L344.852 148.621Z",fill:"#FFCC00"}),m.jsx("path",{d:"M344.852 148.622L336.127 123.708L324.413 129.093L344.852 148.622Z",fill:"#FFCC00"}),m.jsx("path",{d:"M354.037 120.353L332.334 135.38L326.023 124.138L354.037 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M354.036 120.353L327.646 120.952L329.148 133.757L354.036 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M329.99 102.882L337.575 128.166L324.933 130.695L329.99 102.882Z",fill:"#FFCC00"}),m.jsx("path",{d:"M329.99 102.882L322.405 128.166L335.047 130.695L329.99 102.882Z",fill:"#FFCC00"}),m.jsx("path",{d:"M315.129 148.621L336.127 132.625L327.386 123.148L315.129 148.621Z",fill:"#FFCC00"}),m.jsx("path",{d:"M315.13 148.621L323.855 123.708L335.568 129.093L315.13
721148.621Z",fill:"#FFCC00"}),m.jsx("path",{d:"M305.945 120.353L327.647 135.38L333.958 124.138L305.945 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M305.945 120.353L332.336 120.952L330.834 133.757L305.945 120.353Z",fill:"#FFCC00"}),m.jsx("path",{d:"M371.372 204.864L380.097 179.951L391.811 185.336L371.372 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M371.372 204.864L392.37 188.868L383.629 179.391L371.372 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M401.096 204.864L380.097 188.867L388.839 179.391L401.096 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M401.095 204.864L392.37 179.951L380.656 185.336L401.095 204.864Z",fill:"#FFCC00"}),m.jsx("path",{d:"M410.28 176.596L388.578 191.623L382.266 180.381L410.28 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M410.279 176.596L383.889 177.195L385.391 190L410.279 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M362.187 176.596L383.889 191.623L390.2 180.381L362.187 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M362.187 176.596L388.578 177.195L387.076 190L362.187 176.596Z",fill:"#FFCC00"}),m.jsx("path",{d:"M386.234 159.125L378.648 184.409L391.29 186.938L386.234 159.125Z",fill:"#FFCC00"}),m.jsx("path",{d:"M386.233 159.125L393.818 184.409L381.176 186.938L386.233 159.125Z",fill:"#FFCC00"}),m.jsx("path",{d:"M362.159 328.664L388.549 329.263L387.047 342.067L362.159 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M362.159 328.664L383.862 343.691L390.173 332.449L362.159 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M371.344 356.932L380.069 332.018L391.782 337.404L371.344 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M371.344 356.932L392.342 340.935L383.601 331.459L371.344 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M401.066 356.932L380.068 340.935L388.81 331.459L401.066 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M401.066 356.932L392.341 332.018L380.627 337.403L401.066 356.932Z",fill:"#FFCC00"}),m.jsx("path",{d:"M386.205 311.193L378.62 336.477L391.262 339.005L386.205 311.193Z",fill:"#FFCC00"}),m.jsx("path",{d:"M386.205 311.193L393.79 336.477L381.148 339.005L386.205 311.193Z",fill:"#FFCC00"}),m.jsx("path",{d:"M410.252 328.664L383.862 329.263L385.364 342.068L410.252 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M410.252 328.664L388.549 343.691L382.238 332.449L410.252 328.664Z",fill:"#FFCC00"}),m.jsx("path",{d:"M307.284 379.555L333.674 380.154L332.172 392.958L307.284 379.555Z",fill:"#FFCC00"}),m.jsx("path",{d:"M307.284 379.554L328.987 394.582L335.298 383.34L307.284 379.554Z",fill:"#FFCC00"}),m.jsx("path",{d:"M316.469 407.823L325.194 382.909L336.907 388.294L316.469 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M316.469 407.823L337.467 391.826L328.726 382.35L316.469 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M346.191 407.823L325.193 391.826L333.935 382.35L346.191 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M346.191 407.823L337.466 382.909L325.752 388.294L346.191 407.823Z",fill:"#FFCC00"}),m.jsx("path",{d:"M331.33 362.084L323.745 387.368L336.387 389.896L331.33 362.084Z",fill:"#FFCC00"}),m.jsx("path",{d:"M331.33 362.084L338.915 387.368L326.273 389.896L331.33 362.084Z",fill:"#FFCC00"}),m.jsx("path",{d:"M355.377 379.555L328.987 380.154L330.489 392.958L355.377 379.555Z",fill:"#FFCC00"}),m.jsx("path",{d:"M355.377 379.554L333.674 394.582L327.363 383.34L355.377 379.554Z",fill:"#FFCC00"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_4989_138368",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),TJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_4989_138137)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#012169"}),m.jsx("path",{d:"M512 0V64L322 256L512 443V512H445L254 324L68 512H0V444L186 257L0 74V0H62L254 188L440 0H512Z",fill:"white"}),m.jsx("path",{d:"M184 324L195 358L42 512H0V509L184 324ZM308 312L362 320L512 467V512L308 312ZM512 0L320 196L316 152L466 0H512ZM0 1L193 190L134 182L0 49V1Z",fill:"#C8102E"}),m.jsx("path",{d:"M176 0V512H336V0H176ZM0 176V336H512V176H0Z",fill:"white"}),m.jsx("path",{d:"M0 208V304H512V208H0ZM208 0V512H304V0H208Z",fill:"#C8102E"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_4989_138137",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),LJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_hkd)",children:[m.jsx("path",{d:"M0 0H512V512H0",fill:"#EC1B2E"}),m.jsx("path",{d:"M282.3 119.2C203 114 166.6 218 241.6 256.4C215.6 234 221 201 231.5 184L233.4 185C219.6 208.6 222.2 237.8 244.4 256C231.8 243.8 235 217 256.6 207.2C278.2 197.4 280.2 167.9 273 158.1C263.2 141.033 266.3 128.033 282.3 119.1V119.2Z",fill:"white"}),m.jsx("path",{d:"M392.378 248.29C372.818 171.265 262.66 168.784 249.316 251.98C262.585 220.33 295.639 215.268 315.052 220.001L314.688 222.117C287.978 216.285 261.011 227.781 250.562 254.519C258.271 238.766 284.748 233.527 300.743 251.042C316.738 268.556 345.413 261.342 352.508 251.466C365.711 236.872 379.033 235.803 392.473 248.259L392.378 248.29Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_hkd",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),kJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_huf)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V0H512V512Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V341.3H512V512Z",fill:"#388D00"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 170.8H0V0.100098H512V170.8Z",fill:"#D43516"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_huf",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),$Je=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_idr)",children:[m.jsx("path",{d:"M0 0H512V256H0V0Z",fill:"#E70011"}),m.jsx("path",{d:"M0 256H512V512H0V256Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_idr",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),PJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_ils)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M619.4 512H-112V0H619.4V512Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M619.4 115.2H-112V48H619.4V115.2ZM619.4 465.7H-112V398.5H619.4V465.7ZM136.4 190.7L246.5 382.3L359 191.6L136.4 190.7Z",fill:"#0038B8"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M136 320.6L246.2 129L358.6 319.8L136 320.6Z",fill:"#0038B8"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_ils",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),RJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_inr)",children:[m.jsx("path",{d:"M0 0H512V170.7H0V0Z",fill:"#FF9933"}),m.jsx("path",{d:"M0 170.7H512V341.3H0V170.7Z",fill:"white"}),m.jsx("path",{d:"M0 341.3H512V512H0V341.3Z",fill:"#128807"}),m.jsx("path",{d:"M256 324.267C293.703 324.267 324.267 293.703 324.267 256C324.267 218.297 293.703 187.733 256 187.733C218.297 187.733 187.733 218.297 187.733 256C187.733 293.703 218.297 324.267 256 324.267Z",fill:"#000088"}),m.jsx("path",{d:"M255.999 267.947C262.597 267.947 267.946 262.598 267.946 256C267.946 249.402 262.597 244.053 255.999 244.053C249.401 244.053 244.053 249.402 244.053 256C244.053 262.598 249.401 267.947 255.999 267.947Z",fill:"#000088"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_inr",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),OJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_jpy)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-128 0H640.007V512.029H-128V0Z",fill:"white"}),m.jsx("path",{d:"M256.009 415.199C343.904 415.199 415.156 343.947 415.156 256.052C415.156 168.157 343.904 96.9048 256.009 96.9048
721C168.114 96.9048 96.8618 168.157 96.8618 256.052C96.8618 343.947 168.114 415.199 256.009 415.199Z",fill:"#BC002D"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_jpy",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),MJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_kes)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"white"}),m.jsx("path",{d:"M0 0H512V153.6H0V0Z",fill:"#000001"}),m.jsx("path",{d:"M0 358.4H512V512H0V358.4Z",fill:"#006600"}),m.jsx("path",{d:"M255.8 102.4C236.6 102.4 204.6 153.6 195 179.2H0V332.8H195C204.7 358.4 236.7 409.6 255.9 409.6C275.1 409.6 307.1 358.4 316.7 332.8H512V179.2H316.6C307 153.6 275 102.4 255.8 102.4Z",fill:"#BB0000"}),m.jsx("path",{d:"M255.8 275.2C262.869 275.2 268.6 266.604 268.6 256C268.6 245.396 262.869 236.8 255.8 236.8C248.731 236.8 243 245.396 243 256C243 266.604 248.731 275.2 255.8 275.2Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_kes",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),NJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_krw)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9756 167.546L84.3956 73.9515L99.9947 84.3549L37.5747 177.95L21.9756 167.546ZM45.3743 183.151L107.794 89.5565L123.393 99.9599L60.9734 193.555L45.3743 183.151ZM68.773 198.756L131.193 105.162L146.792 115.565L84.3721 209.16L68.773
721198.756Z",fill:"#000001"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M365.156 396.42L427.576 302.825L443.175 313.228L380.755 406.823L365.156 396.42ZM388.555 412.025L450.975 318.43L466.574 328.833L404.154 422.428L388.555 412.025ZM411.954 427.63L474.374 334.035L489.973 344.438L427.553 438.033L411.954 427.63Z",fill:"#000001"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M388.567 344.42L466.563 396.437Z",fill:"black"}),m.jsx("path",{d:"M388.567 344.42L466.563 396.437",stroke:"white",strokeWidth:"9.375"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.38 193.572C178.935 168.749 204.672 151.52 233.931 145.673C263.189 139.827 293.572 145.843 318.395 162.397C343.218 178.952 360.447 204.69 366.294 233.948C372.14 263.207 366.124 293.589 349.57 318.412L162.38 193.572Z",fill:"#CD2E3A"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M162.38 193.572C145.825 218.395 139.809 248.778 145.656 278.036C151.502 307.295 168.732 333.032 193.555 349.587C218.378 366.142 248.76 372.158 278.019 366.311C307.277 360.465 333.015 343.235 349.57 318.412C357.847 306.001 360.855 290.809 357.932 276.18C355.009 261.551 346.394 248.682 333.982 240.405C321.571 232.127 306.379 229.119 291.75 232.043C277.121 234.966 264.252 243.581 255.975 255.992L162.38 193.572Z",fill:"#0047A0"}),m.jsx("path",{d:"M255.975 255.992C273.212 230.147 266.233 195.222 240.387 177.985C214.542 160.748 179.617 167.727 162.38 193.572C145.143 219.418 152.122 254.343 177.967 271.58C203.813 288.816 238.738 281.838 255.975 255.992Z",fill:"#CD2E3A"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M84.4473 438.033L22.0273 344.438L37.6264 334.035L100.046 427.63L84.4473 438.033ZM107.846 422.428L45.426 328.833L61.0251 318.43L123.445 412.025L107.846 422.428ZM131.245 406.823L68.8247 313.228L84.4238 302.825L146.844 396.42L131.245 406.823Z",fill:"#000001"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M427.628 209.16L365.208 115.565L380.807 105.162L443.227 198.757L427.628 209.16ZM451.027 193.555L388.607 99.9601L404.206 89.5567L466.626 183.152L451.027 193.555ZM474.425 177.95L412.005 84.3551L427.604 73.9517L490.024 167.547L474.425 177.95Z",fill:"#000001"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M72.7363 378.231L96.135 362.626ZM388.619 167.564L415.917 149.358ZM439.316 133.753L462.715 118.148Z",fill:"black"}),m.jsx("path",{d:"M72.7363 378.231L96.135 362.626M388.619 167.564L415.917 149.358M439.316 133.753L462.715 118.148",stroke:"white",strokeWidth:"9.375"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_krw",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),DJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_kwd)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 170.606H1023.95V341.316H0V170.606Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 341.315H1023.95V512.025H0V341.315Z",fill:"#F31830"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H1023.95V170.709H0V0Z",fill:"#00D941"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0V511.922L255.445 341.315L255.961 170.503L0 0Z",fill:"#000001"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_kwd",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),FJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_kzt)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#00ABC2"}),m.jsx("path",{d:"M276.699 283.915C314.76 283.915 345.615 253.061 345.615 215C345.615 176.939 314.76 146.085 276.699 146.085C238.639 146.085 207.784 176.939 207.784 215C207.784 253.061 238.639 283.915 276.699 283.915Z",fill:"#FFEC2D"}),m.jsx("path",{d:"M274.309 335.36C272.517 338.585 271.442 342.323 269.189 345.241C262.226 338.944 252.191 339.097 243.385 338.739C236.114 338.329 228.229 337.664 222.597 332.493C216.709 327.629 211.845 321.382 205.292 317.44C199.132 316.117 193.343 313.441 188.345 309.606C178.002 301.158 172.063 288.614 161.925 279.91C160.031 278.067 157.727 276.582 155.577 274.995Z",fill:"#FFEC2D"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_kzt",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),UJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_mad)",children:[m.jsx("path",{d:"M512 0H0V512H512V0Z",fill:"#C1272D"}),m.jsx("path",{d:"M256 191.4L218 308.2L317.4 236H194.6L293.9 308.2L256 191.4Z",stroke:"#006233",strokeWidth:"12.5"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_mad",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),jJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_4989_137735)",children:[m.jsx("path",{d:"M341.3 0H512V512H341.3V0Z",fill:"#CE1126"}),m.jsx("path",{d:"M170.7 0H341.3V512H170.7V0Z",fill:"white"}),m.jsx("path",{d:"M0 0H170.7V512H0V0Z",fill:"#006847"}),m.jsx("path",{d:"M284.6 295.6L284.8 299.1L286.2 298.2L285.2 295.2L284.6 295.6Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}
721),m.jsx("path",{d:"M284.5 295.7C285.108 295.7 285.6 295.208 285.6 294.6C285.6 293.992 285.108 293.5 284.5 293.5C283.893 293.5 283.4 293.992 283.4 294.6C283.4 295.208 283.893 295.7 284.5 295.7Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M289 301.1L286.3 298.6L285.1 299.6L288.7 301.6L289 301.1Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M288.7 302.6C288.3 301.933 288.4 301.367 289 300.9C289.6 300.433 290.133 300.5 290.6 301.1C290.933 301.7 290.833 302.233 290.3 302.7C289.7 303.1 289.167 303.033 288.7 302.5V302.6ZM309 263.7L311.7 266.3L312.1 265L309.6 263.3L309 263.7Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M308.7 264.1C309.307 264.1 309.8 263.608 309.8 263C309.8 262.393 309.307 261.9 308.7 261.9C308.092 261.9 307.6 262.393 307.6 263C307.6 263.608 308.092 264.1 308.7 264.1Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M316.1 265.3L312.1 266.4L312.4 265.1L315.9 264.7L316.1 265.3Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M316.8 265.8C317.408 265.8 317.9 265.307 317.9 264.7C317.9 264.092 317.408 263.6 316.8 263.6C316.193 263.6 315.7 264.092 315.7 264.7C315.7 265.307 316.193 265.8 316.8 265.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M302.3 285.5L299.8 281.5L300.2 281.4L303.1 284.7L302.3 285.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M299.6 281.9C300.263 281.9 300.8 281.363 300.8 280.7C300.8 280.037 300.263 279.5 299.6 279.5C298.938 279.5 298.4 280.037 298.4 280.7C298.4 281.363 298.938 281.9 299.6 281.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M302.5 285.6L305.7 286.2L305.8 285.7L303.1 284.7L302.5 285.6Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M306.6 287.3C307.208 287.3 307.7 286.807 307.7 286.2C307.7 285.592 307.208 285.1 306.6 285.1C305.992 285.1 305.5 285.592 305.5 286.2C305.5 286.807 305.992 287.3 306.6 287.3Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M227.7 294.4C227.633 295.067 227.366 295.4 226.9 295.4C226.233 295.333 225.966 295 226.1 294.4C226.3 293.6 226.566 293.267 226.9 293.4C227.433 293.6 227.7 293.933 227.7 294.4ZM227.7 296.2L228.4 300.2L227.4 299.9L227.1 296.4L227.7 296.2Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M228.6 294.9C229 295.5 228.3 296.4 227.4 296.6C226.6 296.9 225.5 296.5 225.5 295.7C225.5 294.9 226.8 295.3 227.1 295.2C227.6 295 228.1 294.2 228.6 294.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M221.6 301.9C222.318 301.9 222.9 301.497 222.9 301C222.9 300.503 222.318 300.1 221.6 300.1C220.882 300.1 220.3 300.503 220.3 301C220.3 301.497 220.882 301.9 221.6 301.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M223.7 300.8L227.6 300.6L226.9 299.8L223.7 300.2V300.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M224 300.4C224.4 301.4 224.4 302.7 223.3 302.5C222.2 302.3 222.4 301.4 222.3 301C222.2 300.3 221.5 299.7 222.2 299C222.8 298.4 223.7 299.4 224 300.4Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M211.5 280.5C211.942 280.5 212.3 280.008 212.3 279.4C212.3 278.793 211.942 278.3 211.5 278.3C211.058 278.3 210.7 278.793 210.7 279.4C210.7 280.008 211.058 280.5 211.5 280.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M211.5 281.9L211.6 285.6L210.6 284.7L210.7 281.7L211.5 281.9Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M213 280.8C213.2 281.6 211.9 282.1 211 281.9C210.067 281.767 209.633 281.3 209.7 280.5C209.7 279.8 210.9 279.9 211.2 280.1C211.6 280.4 212.7 279.5 213 280.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M204.9 285.8C205.618 285.8 206.2 285.531 206.2 285.2C206.2 284.869 205.618 284.6 204.9 284.6C204.182 284.6 203.6 284.869 203.6 285.2C203.6 285.531 204.182 285.8 204.9 285.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M207.3 285.2L210.2 285L211.4 286L207.2 285.8L207.3 285.2Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M206.2 283.6C207 283.6 207.5 284.5 207.4 285.4C207.4 286.4 206.6 287.1 205.9 287C205.1 286.9 205.2 286.2 205.2 286L205.7 285.2C205.7 284.9 205.5 284.2 205.6 284C205.6 283.733 205.8 283.6 206.2 283.6ZM203.8 260.9C203.5 261.5 202.8 261.9 202.6 261.6C202.333 261.267 202.366 260.8 202.7 260.2C203.033 259.6 203.433 259.4 203.9 259.6C204.166 259.867 204.166 260.3 203.9 260.9H203.8ZM200.6 266.8L202.2 262.9L202 262.7L200.1 265.4L200.6 266.8Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M202 263C201.2 262.333 200.933 261.7 201.2 261.1C201.5 260.6 202.1 260.9 202.1 260.9L202.8 261.6C203 261.7 203.5 261.5 203.8 262C204.066 262.6 204.066 262.933 203.8 263C203.508 263.158 203.181 263.24 202.85 263.24C202.518 263.24 202.192 263.158 201.9 263H202ZM195.1 262.4C195.766 262.867 196 263.3 195.8 263.7C195.6 264.1 195.133 264.1 194.4 263.7C193.4 263.1 193.5 262.9 193.7 262.5C194.033 262.1 194.5 262.1 195.1 262.5V262.4ZM196.8 264.1L199.8 265.9V267.4L196.5 264.6L196.8 264.1Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M196.8 264.5C196.134 265.167 195.534 265.333 195 265C194.4 264.7 194.9 264.1 194.9 264.1L195.5 263.5C195.7 263.2 195.5 262.7 196.1 262.5C196.7 262.233 197.034 262.3 197.1 262.7C197.2 263 197.4 263.9 196.8 264.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}
721),m.jsx("path",{d:"M285.3 295.8L284.9 296.2L284.7 296.9V295.8L285.1 295.5L285.3 295.8Z",fill:"#AA8C30"}),m.jsx("path",{d:"M285.4 295C285.4 295 285.2 295.5 284.5 295.5C283.833 295.5 283.5 295.267 283.5 294.8L283.6 293.9L283.3 294.3V295L283.8 295.6H284.2L284.6 295.7L285.1 295.5L285.4 295.3V295.1V295ZM288.8 301H288.2L285.5 299.6L288.5 301.6L288.8 301ZM290.7 301.8C290.7 301.8 290.7 302.4 290.1 302.6C289.5 302.867 289.1 302.867 288.9 302.6C288.763 302.477 288.662 302.319 288.609 302.142C288.556 301.966 288.553 301.778 288.6 301.6L288.5 302.1L288.8 302.7L289.4 303H289.9L290.2 302.8L290.6 302.4L290.8 302L290.7 301.8ZM310.1 263.8V264.6L309.4 263.9L309.7 263.5L310.1 263.8ZM309.8 262.8C309.8 263.3 309 264.1 308.5 263.8C307.833 263.533 307.6 263.067 307.8 262.4L307.6 262.7L307.7 263.5L308.3 264H308.9L309.5 263.8L309.8 263.2V262.8ZM317.8 264.2C317.8 264.7 317.3 265.6 316.7 265.5C316.033 265.367 315.733 265 315.8 264.4V265.2L316.1 265.5L316.6 265.8H317.1L317.7 265.4L317.9 264.9V264.6L317.8 264.2Z",fill:"#AA8C30"}),m.jsx("path",{d:"M315 264.9C315 264.9 315 265.1 314.7 265.3L313.7 265.9L315.9 265.3L315.7 264.7L315 264.9ZM301.4 282.8L301.2 283.2V283.8L300 281.8L300.4 281.6L301.4 282.8ZM300.7 280.8C300.4 281.4 299.5 281.8 299.1 281.5C298.7 281.2 298.3 280.3 298.8 279.9L298.5 280.1L298.4 280.7L298.6 281.2L299 281.7L299.4 281.9L300.1 281.7L300.6 281.4C300.6 281.4 300.9 280.4 300.6 280.9L300.7 280.8ZM305.1 285.5C305.1 285.5 305.1 285.7 304.7 285.7H303.5L305.5 286.1L305.7 285.7L305.1 285.5Z",fill:"#AA8C30"}),m.jsx("path",{d:"M307.7 286C307.9 286.7 307.3 287.4 306.5 287.1C305.7 286.8 305.5 286.1 305.7 285.6L305.5 286.2L305.7 286.8L306.2 287.2L306.7 287.4L307.2 287.2L307.7 286.7L307.8 286.1V286H307.7ZM228.5 294.9C228.7 295.1 228.4 296.1 227.5 296.4C226.6 296.7 226.1 296.4 225.9 296.1L225.7 295.5L225.5 295.7L225.7 296.1L226.1 296.5L226.9 296.7L227.5 296.6L228.1 296.3L228.4 296L228.7 295.6V295.1L228.6 294.9H228.5Z",fill:"#AA8C30"}),m.jsx("path",{d:"M227.7 296.9L227.4 297.2L227.2 297.8V296.8L227.6 296.5L227.7 296.9ZM224.7 300.1C224.7 300.1 224.6 300.3 224.8 300.5L225.6 300.7H224.2L224 300.2L224.7 300.1ZM224.2 301.1L224.1 301.6C223.966 302.067 223.7 302.3 223.3 302.3C223.087 302.257 222.893 302.146 222.749 301.984C222.605 301.822 222.517 301.617 222.5 301.4L222.3 300.9V301.4L222.6 302.2L223.2 302.5H223.6L224 302.3L224.2 301.8V301V301.1ZM220.4 300.9C220.4 300.9 220.6 301.6 221.4 301.6L222.4 301.4V301.7L222.1 301.8L221.5 301.9L220.9 301.8L220.6 301.6L220.4 301.2V300.9ZM212.9 280.6V280.9C212.8 281.2 212.3 281.8 211.4 281.8C210.6 281.8 210.133 281.6 210 281.2C209.733 280.8 209.633 280.567 209.7 280.5V281L210 281.5L210.9 281.9H211.7L212.5 281.7L212.9 281.3V280.6ZM211.5 282.4L211 282.6L210.7 282.9V281.9H211.5V282.5V282.4ZM207.7 285.2L208.1 285.5C208.5 285.7 210.6 285.9 210.6 285.9L207.3 285.8L207.5 285.2H207.7ZM207.4 285.2L207.2 285.7C207 286 206.6 286.9 205.9 286.8C205.2 286.7 205.3 286.2 205.3 286.1V285.9L205.2 286.4L205.4 286.7L205.6 286.9H206.2L206.6 286.8L207 286.4L207.2 286L207.4 285.5V285.2ZM205.6 285.3C205.6 285.3 205.6 285.5 205 285.5L203.7 285.3L204 285.6L204.4 285.7H205.4L205.6 285.3ZM203.9 262.3C203.9 262.3 204 262.6 203.7 262.8C203.3 263.067 202.833 263.1 202.3 262.9C201.9 262.7 201.1 261.9 201.1 261.9L201.5 262.5L202 263L202.8 263.2H203.6L203.9 262.8L204 262.6L203.9 262.3Z",fill:"#AA8C30"}),m.jsx("path",{d:"M201.6 263.3V263.7L201.5 264.7L202.1 263.1L201.9 262.9L201.6 263.3ZM197.3 264.5L197.4 264.8C197.6 265.3 199.4 266.9 199.4 266.9L196.6 264.7L196.9 264.2L197.3 264.5ZM196.4 264.7L195.7 265C195.5 265 194.9 265 194.9 264.6V264.1L194.7 264.6L194.8 264.9L195.2 265.1H195.8L196.3 264.9L196.4 264.8V264.7ZM195.4 263.6H194.8C194.3 263.6 193.8 263 193.8 263L194.1 263.6L195 264L195.4 263.6Z",fill:"#AA8C30"}),m.jsx("path",{d:"M319.9 256.1C319.6 259.1 316.6 260.8 315 261.9C314.072 262.609 313.291 263.492 312.7 264.5L312.1 266.3L311.9 267.4V267.8L312.1 269.5L312 272.9L314.1 271.4L315.7 270.8H316.1C316.1 270.8 314.4 272.4 313.8 274.2C313.1 276.1 311.8 280 309.5 281.2C307.2 282.4 305.7 282 304.9 282.7L304.1 283.6L303.1 284.9L302.3 285.9L301.6 286.5L301.1 286.8L300.9 288.2L300.4 290.1L301.4 289.7H302.5L301.9 290.7C301.8 291.2 302 294.4 299 296.3C296 298.2 288.3 297.9 288.3 297.9L286.9 298.5L285.5 299.5L284.3 300.9L284.2 301.2C284.2 301.2 283.2 302.4 282.5 302.8L280.3 304.3L282.1 304.4L284.9 305.6C284.9 305.6 283.1 305.6 281.9 306C280.7 306.4 275.4 309.5 272.9 309.4C270.2 309.4 266.5 305.6 266.5 305.6L264.9 304.4L262.1 303.8L258.6 303.6V303.2L258.7 302.6L261.7 302.7C263.4 302.9 263.9 303.5 265.3 303.7C266.244 303.824 267.204 303.721 268.1 303.4L272.8 299.6L277.5 298L279.3 298.2L280.1 298.4L280.8 298.6L280 299.6L278.8 300.3L279.4 300.8L282.4 300.3L283.4 300.6L283.6 300.7L284 299.7C284.4 299.2 286 297.9 286.8 297.4C287.467 297 287.8 296.733 287.8 296.6C288.1 296.4 289.1 293.9 289.1 293.9L289.2 292.6L292.5 289.5L294.7 287.1L295.7 284.4L295.6 283.9C295.6 283.9 296.3 284.7 296.2 28
7216.4C296 288 295.833 288.733 295.7 288.6C295.5 288.4 297.9 287.1 299.1 286.6C300.1 286.2 300.767 286.067 301.1 286.2C301.738 285.825 302.284 285.312 302.7 284.7C303.4 283.7 303.5 283.5 303.5 283.1L303.6 280.9L303.4 275.2L305.4 271L308.2 268.5L308.7 268.2L308.4 269.2V270.2C308.4 270.2 309.8 268.4 310.5 268L311 267.8L311.6 266.2C311.8 265.2 311.8 263.7 311.8 263.7V261.4L311.4 259.6L310.1 256.1V251.5L309.1 250.2C309.1 250.2 310 250.1 311.1 251.7C311.857 252.922 312.366 254.281 312.6 255.7L315.3 247.6C315.3 247.6 316 248.6 316.5 250.1L317.2 252.8L318.2 250.6L318.3 251.4C318.5 252.1 320.1 253.1 319.9 256.1ZM266.1 308.1C266.1 308.1 265.5 306.9 263 305.6C261.569 304.914 260.057 304.41 258.5 304.1V305.1L262.5 306.8L264.5 308.4L266.1 308.1Z",fill:"#9CA168"}),m.jsx("path",{d:"M284.3 300.5C285.352 299.432 286.527 298.492 287.8 297.7C288.621 297.321 289.5 297.085 290.4 297C291.9 296.7 292.1 297 295.6 295C299.1 293 299.9 290.9 300.6 290.3C301.3 289.8 302.5 289.6 302.5 289.6L299.8 292.8C298.5 294.2 297.1 295.1 295.1 296.4C293.1 297.7 289.1 297.8 289.1 297.8C287.848 298.004 286.693 298.599 285.8 299.5C284.8 300.3 284.2 301.2 284.2 301.2C284.2 301.2 284 300.8 284.2 300.5H284.3ZM294 290.3C290.7 293.3 289.7 296.1 289.7 296.1L294 292.1C295.5 290.7 297.6 290.1 298.5 289.1C299.5 288.3 299.5 287.6 300.1 287.1L301.1 286.2C301.1 286.2 299.7 285.2 294 290.3ZM287.1 297.2C287.1 297.2 288.5 296.6 289.1 295.3C289.4 294.4 289.2 294.2 289.8 293.1C289.8 293.1 293.2 289.9 294.4 288.5C296.5 286 295.6 283.9 295.6 283.9C295.6 283.9 295.8 284.9 294.9 286.1C294 287.1 289.7 290.1 289.1 291.9C288.5 293.7 288.9 293.6 288.7 294.6C288.1 296.6 287.
7211 297.2 287.1 297.2ZM284.9 305.6C284.9 305.6 283.2 304.5 281.3 304.6C277.4 304.9 274.1 307.2 271.6 307.3C269 307.3 268 306.1 266 304.7C263.9 303.3 258.7 303.5 258.7 303.5V303.6L258.6 303.8C258.6 303.8 262.2 303.8 263.7 304.2C266.7 305.1 268.2 308.2 271.6 307.9C275.9 307.7 279.4 305 281.2 305C284.2 305 284.9 305.6 284.9 305.6ZM265.6 303.6C265.6 303.6 268.6 304.2 271 302.5C273.3 300.8 276.1 298.5 277.6 298.4C279.2 298.3 280.8 298.7 280.8 298.7C280.8 298.7 278.8 297.7 277.3 297.8C275.696 297.75 274.108 298.13 272.7 298.9C271.2 299.8 270.5 301.4 268.9 302.4C267.3 303.4 265.6 303.7 265.6 303.7V303.6ZM265.1 307.7L264.1 307.9C263.9 307.9 263.1 306.9 261.7 306.3C260.3 305.7 258.5 305.2 258.5 305.2C258.5 305.2 258.3 305.2 258.7 305.4L261.7 306.5C262.549 306.943 263.298 307.556 263.9 308.3C263.9 308.4 264.3 308.9 265.1 308.9C265.767 308.767 266.1 308.533 266.1 308.2C265.9 307.867 265.567 307.7 265.1 307.7ZM267.2 304.7C267.2 304.7 268.4 305.5 270.4 305.4C274.6 305.4 277.2 302.4 280 301.4C282.8 300.4 284.2 301.2 284.2 301.2V301C283.279 300.387 282.206 300.041 281.1 300C276.5 300.1 272.1 303 270.2 303.8C268.267 304.533 267.267 304.867 267.2 304.8V304.7ZM312 273C310.5 274.5 308.4 279.2 307.5 280.4C306.5 281.7 305.4 282.1 304.9 282.6L302.4 285.9C302 286.5 301.9 286.3 301.6 286.5C301.267 286.767 301.267 286.833 301.6 286.7C302.1 286.6 302.2 286.3 302.9 285.5C303.6 284.7 303.6 284.3 304.7 283.3C305.8 282.3 307.8 281.2 308.8 280C309.8 278.7 311.8 274 313 272.8C314.1 271.6 316.1 270.8 316.1 270.8C316.1 270.8 314.5 270.4 312 273ZM304.8 281.9C304.8 281.9 304.8 281 305.8 279.8C306.8 278.6 307.2 278.8 308 276.9L309.9 271.4C310.5 269.4 311.7 267.6 311.7 267.6C311.7 267.6 310.6 267.6 309.5 269.2C307.906 271.34 306.627 273.697 305.7 276.2C304.7 278.8 304.7 281.9 304.7 281.9H304.8ZM303.4 283.7C303.4 283.7 303.8 283.4 303.9 281.1C304 278.8 303.8 275.5 304.4 273.8C305.1 272.2 308.7 268.3 308.7 268.3C308.7 268.3 307.2 268.6 305.1 270.3C303.1 272.1 302.167 273.867 302.3 275.6C302.3 277.2 303.3 279 303.3 280.6L303.4 283.6V283.7ZM311.9 267.5L313.1 263.5C313.5 262.8 313.5 262.3 315.3 260.3C316.3 259.2 317.3 258.4 317.8 256.8C318.3 255.2 318.2 250.7 318.2 250.7C318.2 250.7 317.7 251.1 317.4 251.9C317.1 252.7 317.3 255.6 316.6 256.9C315.9 258.3 314.4 261.5 313.6 262.2C313.6 262.2 313.5 259.9 313.7 257.6C313.9 255.3 314.7 254.6 315.1 253.1C315.5 251.6 315.3 247.7 315.3 247.7C315.3 247.7 314 248.9 313.4 250.4C312.8 251.9 312.4 254.4 312.4 256.4C312.4 258.4 312.9 260 313 261.1C313.1 262.2 313.1 262.8 312.7 264L312.2 265.6L311.6 267.6L311.9 267.5ZM309.1 250.3C309.1 250.3 310.1 251.6 310 253.2C309.8 254.7 309.2 256.8 309.8 258.4C310.4 260 311.3 260.1 311.6 261.1C311.8 262 311.8 263.8 311.8 263.8C311.8 263.8 312.3 260.4 312 259.4C311.6 258.4 311.5 258.9 311 257.9C310.5 256.9 311 254.2 310.6 252.6C310.387 251.68 309.856 250.866 309.1 250.3Z",fill:"#717732"}),m.jsx("path",{d:"M245.4 307.9C245.4 307.9 245.7 306.9 247.9 305.9C250.1 304.9 253.3 303.4 253.6 303.6C254 303.8 253.5 304.9 253.5 304.9L251.4 305.6L249.7 306.6L247.7 307.9H245.4Z",fill:"#9CA168"}),m.jsx("path",{d:"M251 302.1C248.1 302.2 246.6 302.9 246 303.1H245.1C244.5 302.9 243.9 302 243.9 302L243.3 301.5L243.2 303.5L239.2 299.9L238.7 302.3L238.2 303.3L234.2 299.5L234.3 302.5H233.3L230.3 300.5L229.5 300.9L230.5 302.6L226.8 302.9L226 303.5L225.3 304.4V304.7H226.7C227 304.5 227.2 304 227.3 304.2C227.4 304.4 227.5 305.2 228 305.2C228.5 305 230.2 303.8 231.4 304.3C232.7 305 229.6 305.9 230 306.8C230.3 307.8 232.5 307.4 233 307.1C233.5 306.8 235.3 304.7 236 305.5C237 306.5 234 307.5 234.5 308.5C235.1 309.6 236.7 309.4 237.5 308.9C238.3 308.4 240.2 305.6 240.6 306.2C241.3 307.2 239 308.3 239.6 309.2C240.2 310.1 241.5 309.2 242.3 308.5C243.1 307.8 243.5 306.5 244.7 305.8C245.8 305.2 245.7 305.5 246.1 305.4C246.4 305.4 247.3 304.5 247.3 304.5L250 303.4H251.4L252.1 303.8L253.5 304L253.6 302.8C253.6 302.8 252 302.1 250.9 302.1H251ZM229 302.1L229.5 301.1L229.2 300.6C229.2 300.6 228.2 300.1 227.3 299.2L225.7 297.9L224 296.8L223.4 294.5L223 293.9L222 294.3L220.6 289.4L220.3 288.5H219.7L218.6 291.5L217.3 289.6L217 285.6L216.2 286.5L215.2 287.5L213.4 283.8C213.4 283.8 213.2 283.8 213.1 284.1C213 284.4 212.9 285.5 213.1 286.2L210.6 284.4C208.933 282.8 208.166 282 208.3 282L207.5 280L208.3 278.3L208.7 276.3L206.9 277L206.6 272.4L206.3 271L204.2 274L203.4 272.8V269.8L202.8 269.7L201.9 271.3C201.9 271.3 201.1 269.6 200.7 269.3C200.8 268.6 200.9 267 200.5 265.7C200 264.1 199.5 263.2 199.6 261.9C199.8 260.5 200.4 260.4 200.3 259.9C200.3 259.2 199.3 260.2 199.7 259.4C200 258.7 202.7 256.9 202.2 256C201.6 255 198.9 257.4 199.5 255.8C200.2 254.2 202.7 254.2 202.9 251.9C202.9 250.6 200.4 252.9 200.2 252.1C200 251.4 201.8 250 201.8 249.1C201.8 248.1 202.1 248.1 201.6 247.6C201.1 247.1 199.6 249.5 199.6 249.5L197.9 248.9L197.3 251.3L196.8 253.3L194.7 252.1L195.2 254.6L195.7 257L193.6 256.4L194.7 258.5L196.2 260L197.2 261.3L197.8 261.6L198.8 262.6L199 263.8L199.5 265.3L199.6 266.8V269.1L199.5 269.9C199.1 269.9 198.5 269.3 198.2 269.7C197.9 270.2 199.4 271.3 199.2 271.7C198.9 271.9 196.6 271.2 196.5 271.9C196.4 272.6 196.7 273.6 198 273.9C199.3 274.2 202.2 274.9 201.7 275.5C201.2 276.1 198 273.7 198.2 275.5C198.225 276.098 198.43 276.675 198.786 277.156C199.143 277.637 199.635 278.001 200.2 278.2C201.1 278.5 204.3 278.2 204.2 278.9C203.9 279.6 201.5 278.6 201.2 279.7C200.9 280.8 203 281 203.4 281C203.8 281 205.1 281 205.7 281.4L209.1 284.6C210.1 285.5 212.2 286.9 212.8 287.3C212.2 287.3 210.9 287.1 210.7 287.6C210.5 288.1 215.6 290 214.1 290.6C212.6 291.2 211.
7211 289 210.6 290.3C210.1 291.6 211.6 292.7 212.4 293.3C213.2 293.7 217.7 293.3 216.9 294.3C215.9 295.3 212.7 293.6 212.6 294.9C212.5 296.2 214.8 298 216 297.9C217.1 297.9 218.4 296.1 218.9 297.1C219.4 298.1 218 298.5 219.1 298.7C220.2 298.9 221 297.7 222.3 297.9C223.5 298.1 225.5 298.9 226.7 299.9L228.9 302.2L229 302.1Z",fill:"#9CA168"}),m.jsx("path",{d:"M246.7 307.3C247.366 307.433 247.7 307.567 247.7 307.7C247.7 307.7 249.1 306.6 250.4 305.9C251.6 305.2 253.4 304.9 253.4 304.9H253.6C253.6 304.9 251.3 305.6 250.3 306.3L247.8 308C247.733 308.267 247.266 308.433 246.4 308.5C245.733 308.433 245.4 308.233 245.4 307.9C245.4 307.567 245.833 307.367 246.7 307.3ZM253.5 303.9C253.5 303.9 252.8 303.9 252.5 303.6C251.869 303.209 251.142 303.001 250.4 303C249.199 303.067 248.063 303.564 247.2 304.4C247.2 304.4 247 304.9 246.1 305.4C246.433 305.4 246.933 305.133 247.6 304.6C248.482 303.969 249.519 303.589 250.6 303.5C251.4 303.5 251.966 303.7 252.3 304.1C252.7 304.4 253.5 304.3 253.5 304.3V303.9ZM213.1 287.4V286.8C213.1 286.8 212.5 286.6 211.4 285.8C210.1 285.1 207.3 282.9 207.3 282.9L209.6 285L212.8 287.3L213.1 287.4ZM241.6 307.6L242.8 305.8C243.666 304.667 244.166 304.1 244.3 304.1C244.3 303.9 244.133 303.5 243.8 302.9L243.6 301.9C243.6 301.9 243.9 302.7 244.4 303.1L245.4 303.8C245.4 303.8 246.4 303.7 246.4 303.5C246.4 303.3 246.333 303.133 246.2 303H245.3C244.3 302.5 243.9 301 243.3 301C242.7 300.9 243.1 302.6 242.8 302.6C241.8 302.6 241.2 299.1 238.8 299C237.3 298.9 237 299.2 236.9 299.6C236.8 300 238.9 302 238.2 302.3C237.5 302.6 235.4 299 233.8 299C232.2 299 232.1 299.5 232.2 299.9C232.3 300.2 234 300.5 233.6 301.6C233.2 302.7 231.6 299.9 230.2 300.1C228.8 300.3 228.6 300.4 228.5 300.8C228.4 301.2 229 301.8 228.8 301.9C228.6 302 227.8 302 227 302.5C226.3 303 225.3 304.4 225.3 304.4C225.3 304.4 226.2 303 227.5 302.9H231.9L231 302.2C230.5 301.8 230.1 300.9 230.1 300.9L231.5 302.2L233 303.2C233 303.2 234.4 303.2 234.5 303.4C234.633 303.6 234.433 303.967 233.9 304.5L232.5 305.8L234.1 304.6L235.3 303.6C235.3 303.6 236.3 303.8 236.4 303.7C236.533 303.767 236.333 303.333 235.8 302.4L234.5 300.4C234.5 300.4 235.3 301.1 236.1 302.2C237 303.2 236.8 303.8 237.1 303.8L238.3 304C238.633 304 238.533 304.433 238 305.3L237 307.3L238.3 305.7C238.9 305.1 239.3 304.3 239.5 304.3H240.7L240 303C239.6 302 239.5 300.8 239.5 300.8C239.5 300.8 239.9 302 240.5 302.8L241.6 304.4H242.9C242.966 304.667 242.8 305.133 242.4 305.8L241.6 307.6ZM224.4 297.6L225.7 297.9C225.7 297.9 224.4 297.1 224 295.9C223.7 294.9 224 292.5 223.4 292.5C222.8 292.5 222.5 294.3 222 293.9C221.4 293.6 222.2 290.4 221.5 289.1C220.9 287.7 219.5 286.8 219.1 287.3C218.7 287.8 218.9 290.7 218 290.1C217.1 289.5 218 286.9 217.8 285.8C217.6 284.7 216.8 283.8 216.3 284.1C215.8 284.4 216.5 286.5 215.7 286.6C214.8 286.6 215 285.1 214.7 284.9C214.4 284.7 214.1 285.2 214 284.9C213.8 284.6 213.9 283.6 213.4 283.7C213 283.7 213.1 284.7 213.2 285.1L213.8 286.5C213.9 286.8 214.6 287.2 214.5 287.5C214.433 287.767 214.166 287.9 213.7 287.9H212.3L213.7 288.2C214.1 288.2 214.9 288.1 215.1 288.4L216.2 290.1C216.2 290.1 216.5 289.4 216.6 288.2V286.1C216.6 286.1 216.9 287.4 216.9 288.2L216.6 290.6C216.6 290.6 217.5 291.3 217.2 291.6H214.9C213.9 291.6 212.3 291.3 212.3 291.3C212.3 291.3 213.7 291.9 214.7 292.1C215.7 292.3 217.7 292.3 217.7 292.3L219.1 293.9C219.1 293.9 219.8 292.8 219.9 291.6V289L220.3 291.2C220.287 292.22 220.118 293.231 219.8 294.2L218.3 295C217.3 295.3 215.4 295.5 215.4 295.5C215.4 295.5 217.2 295.8 218.4 295.5C219.7 295.2 219.8 294.8 220.2 295L220.9 295.6L221.9 296.4L221.1 296.9L219.9 297.5L221.7 296.9L222.6 296.6L223 296.8L222.9 295.8L222.6 294.4C222.6 294.4 223.1 295 223.2 295.7L223.3 296.9C223.3 296.9 223.4 297.1 224.3 297.5L224.4 297.6ZM199.5 269C199.5 269 199.8 267.6 199.8 266C199.8 264.5 198.8 262.1 198.5 261.9L198.3 261.4L199 260.4L198 261.1L197 260.7L196.4 260L197.4 260.5L197.9 260.6L197.6 259.1L196 258.3C195 257.7 194 256.8 194 256.8L196.2 258L197.5 258.3C197.5 258.3 198.4 258.1 198.8 257.8L200.1 256.9C200.1 256.9 199.3 257.4 198.7 257.5L197.5 257.7L197.2 255.8L196.3 254.9C195.6 253.9 195.1 252.7 195.1 252.7C195.1 252.7 195.8 253.6 196.4 254C197 254.4 197.5 255.2 197.5 255.2L198.8 254.4L201.1 252.8L198.9 253.8L197.6 254.4V253.2L198.2 251.9C198.1 251.5 197.8 251.7 197.7 251.4L198.1 249.3V250.3C198.1 250.7 198.233 250.933 198.5 251C198.9 251.1 201.1 248.9 201.3 248.5C201.6 248.1 202 247 200.9 247.5C199.8 248 200 248.8 199.1 248.8C198.8 248.8 198.5 247.6 198.1 247.8C197.8 248.1 197.1 248.8 196.9 249.8C196.7 250.6 197.1 251.8 196.6 252.2C196.1 252.6 195.6 250.8 194.8 251C193.8 251.3 193.6 252.6 193.8 253C193.9 253.6 195.9 256 195.3 256.2C194.7 256.4 193.1 254.2 192.3 255.8C191.3 257.3 194.9 258.9 195.3 259.3C195.8 259.7 195.3 259.8 196 260.6C196.7 261.4 197.5 261.6 197.9 262.1C198.3 262.6 199.6 265.1 199.6 266.7V269H199.5ZM208.9 282.6C208.9 282.6 208 281.6 208.3 280C208.6 278.4 209.8 275.4 209.3 275C209 274.6 207.7 276.8 207.4 276.3C207.1 275.8 208.1 272.9 207.6 271.7C207.1 270.5 207 269.7 206 269.8C205 269.9 204.5 273.3 204 272.8C203.5 272.1 204.3 270.6 204 269.8C203.733 269 203.4 268.667 203 268.8C202.4 268.9 202.2 270.5 201.8 270.5C201.4 270.5 200.8 268.5 200.1 268.9C199.4 269.1 201.9 272.4 201.9 272.4C201.9 272.4 202.4 272 202.6 271.4L203.1 270.3C203.1 270.3 203.3 271.3 203.1 271.8L202.8 273.2C202.733 273.267 202.166 273.267 201.1 273.2C200.1 273.1 199.2 272.7 199.2 272.7C199.2 272.7 199.9 273.1 201 273.4L203.2 274L203.9 275L204.8 276.1L205.4 274.5L206.4 271.7C206.4 271.7 206.2 273.7 205.9 274.7L205.4 277.2C205.4 277.2 204.4 277.2 203.3 276.9L200.3 276.3L203.3 277.3L205.6 277.9L206.6 279.3L207.4 278.2C207.9 277.5 208.2 276.7 208.2 276.7C208.2 276.7 208 277.8 207.7 278.5L207.1 279.6L205.7 279.8H203.7C204.869 280.17 206.077 280.405 207.3 280.5C207.3 280.5 207.3 280.9 207.8 281.6L208.9 282.6Z",fill:"#717732"}
721),m.jsx("path",{d:"M251.6 312.7C251.6 312.7 251.1 312.1 250.4 311.7L249.4 311.5H249.1L249.8 309.9L254.2 305.6L254.9 301.3H257.6V307.2L258.4 307.5L263.4 310.5V311.8L262.6 312.1L262 312.4L260.2 312.6L256.9 310.2L255.5 308.8L253.1 311.9L251.5 312.7H251.6Z",fill:"white"}),m.jsx("path",{d:"M255 301.3V302.3C255 302.9 255 306.3 254.8 306.8C254.7 307.3 252.3 308.2 250.8 309.4C249.5 310.6 249.5 311.5 249.5 311.5L248.2 311.9C247.334 312.3 246.9 312.567 246.9 312.7C246.9 312.9 247.4 310.5 249.7 308.6C251.9 306.6 253 306.4 253.2 306.1C253.4 305.8 253.2 302 253.2 301.7C253.334 301.433 253.534 301.333 253.8 301.4H255.1L255 301.3ZM260.7 313.9L261.3 313L262 312.4L261 311.8C259.7 311.3 259 311.4 258.2 310.8L256.5 309.1L255.3 310.1L256.7 311.8C257.3 312.4 258.8 312.6 259.5 313L260.7 314V313.9Z",fill:"#016848"}),m.jsx("path",{d:"M257.2 301.3L258.7 301.4L258.9 301.9C258.9 302 258.9 305.1 258.7 306.1C258.56 306.998 258.218 307.853 257.7 308.6C257.3 308.9 255.3 310.6 254.4 311.6C253.4 312.5 252.5 313.8 252.5 313.8L251.9 313L251.3 312.3C251.956 311.159 252.883 310.197 254 309.5C255.5 308.5 256.9 307.3 257.1 305.6C257.3 303.9 257.2 301.3 257.2 301.3Z",fill:"#CD202A"}),m.jsx("path",{d:"M266 312C266 312 265.7 311.7 264.6 311.6C263.4 311.6 263.4 311.8 263.4 311.8C263.4 311.8 262.7 311 261.8 310.4C260.8 309.7 260 309.8 259 309.1C258 308.4 257.4 307.4 257.4 307.4L258.2 305.8C258.2 305.8 259.1 307.1 260 307.8C260.9 308.5 263 309.1 263.7 309.8C264.4 310.3 266 312 266 312Z",fill:"#CD202A"}),m.jsx("path",{d:"M276 293C276 293 273 292 273.3 291C273.6 290 279.9 288.3 279.9 288.3L280 286.6C280 286.6 279 286.6 277.5 287.1C275.243 287.86 272.881 288.265 270.5 288.3C268.966 288.3 267.966 288.2 267.5 288L244.3 286.6H243.1C240.1 286.3 238.2 281.8 238.2 281.8L236.8 282C236.8 282 237.2 284.3 236.5 284.5C235 284.9 225.4 279.7 225.4 279.7L224.8 281.8C224.8 281.8 230.8 285 230.6 286.1C230.4 287.3 228.6 287.2 228.6 287.2L229.4 288.6C229.7 288.6 239.1 289.1 239.3 291.9C239.3 293.1 237 293.8 237 293.8L237.8 294.8V295.2C237.8 295.2 243 295.2 244.5 296.1C245.9 296.9 246.7 298.1 248.5 299.1C253.697 299.917 258.984 299.984 264.2 299.3C266.3 298.7 267.6 296.3 271.1 295.3C274.6 294.2 275.7 294.1 275.7 294.1L276 293Z",fill:"#30C2DC",stroke:"#0872A7",strokeWidth:"0.4"}),m.jsx("path",{d:"M227.6 290.3C228.539 290.3 229.3 289.539 229.3 288.6C229.3 287.661 228.539 286.9 227.6 286.9C226.662 286.9 225.9 287.661 225.9 288.6C225.9 289.539 226.662 290.3 227.6 290.3Z",fill:"white",stroke:"#0872A7",strokeWidth:"0.8"}),m.jsx("path",{d:"M237.2 282.5C238.139 282.5 238.9 281.739 238.9 280.8C238.9 279.861 238.139 279.1 237.2 279.1C236.261 279.1 235.5 279.861 235.5 280.8C235.5 281.739 236.261 282.5 237.2 282.5Z",fill:"white",stroke:"#0872A7",strokeWidth:"0.8"}),m.jsx("path",{d:"M277.2 294.9C278.139 294.9 278.9 294.139 278.9 293.2C278.9 292.261 278.139 291.5 277.2 291.5C276.261 291.5 275.5 292.261 275.5 293.2C275.5 294.139 276.261 294.9 277.2 294.9Z",fill:"white",stroke:"#0872A7",strokeWidth:"0.8"}),m.jsx("path",{d:"M220.1 278.3C219.6 279.5 221.7 281.9 223.2 282.2C224.733 282.4 225.6 282.1 225.8 281.3C226 280.5 225.9 279.833 225.5 279.3C224.5 278 220.7 277 220.1 278.3Z",fill:"#F8C83C"}),m.jsx("path",{d:"M224.8 280.2C224.8 279.4 223.5 278.7 222.8 278.7C222.1 278.7 221.1 278.7 221.3 279.1C221.5 279.5 223.5 280.1 223.5 280.3C223.5 280.5 222.9 280.8 223.2 281.1C223.6 281.3 223.967 281.267 224.3 281C224.7 280.8 224.867 280.533 224.8 280.2Z",fill:"white"}),m.jsx("path",{d:"M238.2 294.6C238.5 295.7 237.6 296.3 236.5 296.8C235.4 297.3 233.1 297 232.5 296.1C232.1 295.1 233.5 293.7 234.8 293.4C236.2 293.1 237.8 293.6 238.2 294.6Z",fill:"#F8C83C"}),m.jsx("path",{d:"M235.8 295.3C236.3 295.2 236.3 295.9 236.7 295.9C237.1 295.9 237.4 295.2 237.3 294.8C237.1 294.2 236.6 293.867 235.8 293.8C235.2 293.8 233.4 295.4 233.6 295.8C233.8 296.2 234.134 296.267 234.6 296C234.9 295.9 235.4 295.3 235.8 295.3Z",fill:"white"}),m.jsx("path",{d:"M279.4 288.8C280.4 290.2 282.2 288.9 282.7 288.4C283.2 287.9 284.7 287 284.1 286.2C283.5 285.2 282.4 285.3 281.7 285.4C281 285.5 279.7 286.4 279.4 286.9C279 287.433 279 288.1 279.4 288.9V288.8Z",fill:"#F8C83C"}),m.jsx("path",{d:"M279.7 288C279.7 288 279.8 286.5 281.2 286.4C281.9 286.4 282 286.6 282.6 287C283.2 287.4 283.4 286.5 283.4 286.5C283.4 286.5 283.4 287.5 282.4 287.6C281.5 287.6 281.9 287.2 280.9 287C280.1 287 279.7 288 279.7 288Z",fill:"white"}),m.jsx("path",{d:"M257.5 285.1L256.8 284.7H251.8L254.5 292.7L257.8 297.3L259 297.7L261.5 297.6L262 296.3L261 288.7L257.5 285.1Z",fill:"#F9AA51",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M248.5 285.6L248.6 284.7L250.1 284.6L251.8 284.7C251.9 284.7 253.8 287 254.3 288.5C254.9 289.9 255.7 292.3 256.5 293.8L259 297.8H255.8L254.3 297.3L249.7 290.1L248.5 285.6Z",fill:"#F9AA51",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M246.6 284.6L248.6 284.7C248.8 284.8 250.9 286.7 251.7 288.9C252.5 291.1 252.1 291.5 253.2 293.9C254.2 296.2 255.8 297.9 255.8 297.9C255.8 297.9 252.6 297.9 250.8 297.7C249 297.5 248.5 297.4 248.1 296.9L246.7 295.9H244.9L245.4 293.4L244.9 287.9V285L246.6 284.6ZM265.3 286.1L262.3 284.9L256.8 284.6L257.2 287.4C257.4 288.8 258.4 292 259.2 293.6C260.2 295.2 261.1 297.1 261.6 297.6C262.1 298.1 265.2 296.7 265.2 296.7L267.3 296.4L267 294.1L266.7 293.4L267.2 287L266.8 286L265.3 286.1Z",fill:"#F9AA51",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M245.7 286.1C245.7 286.8 246.4 286.9 246.7 286.8C246.8 286.8 247.5 286.5 247.5 285.6C247.5 284.7 246.9 283.9 245.7 283.8C244.6 283.8 243.7 285.2 243.7 286.2C243.7 287.2 244.7 287.7 244.7 288.1C244.7 288.1 243.7 289 243.7 290.6C243.7 292.2 245.1 293.4 245.1 293.4C245.1 293.4 243.7 294.5 243.7 295.6C243.7 296.7 244.7 297.5 245.7 297.5C246.7 297.5 248 296.8 248 296C248 295.2 247.2 294.6 246.6 294.6C246 294.667 245.7 294.9 245.7 295.3M266.2 286.6C266.134 287.2 265.867 287.433 265.4 287.3C264.7 287.1 264.5 287.1 264.5 286.2C264.5 285.3 265.6 284.9 266.4 284.9C267.2 284.9 268.4 285.9 268.4 287.1C268.4 288.3 267.4 289.1 267.4 289.1C267.4 289.1 268 289.4 268 290.9C268 292.4 267 293.5 267 293.5C267 293.5 268.3 294 268.3 295.6C268.3 297.2 267.3 297.7 266.5 297.7C265.7 297.7 264.4 297.2 264.4 296.2C264.4 295.2 265.1 294.7 265.6 294.7C266.1 294.7 266.6 295.3 266.6 295.9",fill:"#F9AA51"}),m.jsx("path",{d:"M245.7 286.1C245.7 286.8 246.4 286.9 246.7 286.8C246.8 286.8 247.5 286.5 247.5 285.6C247.5 284.7 246.9 283.9 245.7 283.8C244.6 283.8 243.7 285.2 243.7 286.2C243.7 287.2 244.7 287.7 244.7 288.1C244.7 288.1 243.7 289 243.7 290.6C243.7 292.2 245.1 293.4 245.1 293.4C245.1 293.4 243.7 294.5 243.7 295.6C243.7 296.7 244.7 297.5 245.7 297.5C246.7 297.5 248 296.8 248 296C248 295.2 247.2 294.6 246.6 294.6C246 294.667 245.7 294.9 245.7 295.3M266.2 286.6C266.134 287.2 265.867 287.433 265.4 287.3C264.7 287.1 264.5 287.1 264.5 286.2C264.5 285.3 265.6 284.9 266.4 284.9C267.2 284.9 268.4 285.9 268.4 287.1C268.4 288.3 267.4 289.1 267.4 289.1C267.4 289.1 268 289.4 268 290.9C268 292.4 267 293.5 267 293.5C267 293.5 268.3 294 268.3 295.6C268.3 297.2 267.3 297.7 266.5 297.7C265.7 297.7 264.4 297.2 264.4 296.2C264.4 295.2 265.1 294.7 265.6 294.7C266.1 294.7 266.6 295.3 266.6 295.9",stroke:"#953220",strokeWidth:"0.4",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M247.6 295L247.9 295.4C248.033 295.8 248.233 296.133 248.5 296.4C249.2 297.1 254.3 297.3 255.9 297.3C257.5 297.3 262.1 297.5 263 297C264 296.4 264 295.6 264.5 295.2L265.2 294.8L264.6 295.4V296.4L264.9 297.1C264.9 297.1 264.9 297.4 264.3 297.7C263.833 298.033 263.233 298.233 262.5 298.3C261.7 298.3 251.9 298.3 250.3 298.1C248.7 297.9 248.8 297.8 248.3 297.5L247.6 296.8L247.9 296.1L247.6 295ZM263.6 285.5L264.4 285.9C264.4 285.9 263.7 286.1 263.1 287.7C262.5 289.2 263.1 289.7 262.6 289.9H258L257.3 288.1L263.6 285.5Z",fill:"#953220"}),m.jsx("path",{d:"M277.1 284.9C277.1 284.9 276.4 284.6 276.1 283.9C275.7 283.4 275.4 282.6 275.7 282.5C276.1 282.433 276.367 282.7 276.5 283.3C276.767 284.3 276.967 284.833 277.1 284.9ZM285.5 282.6L286.2 283.6L287.2 284.1C287.2 284.1 286 284.1 285.6 283.8L284.8 282.6H285.5
721Z",fill:"#231F20"}),m.jsx("path",{d:"M288 283.3C288 283.3 287.3 283.7 286.7 283.5C286.033 283.233 285.733 282.967 285.8 282.7C286 282.433 286.233 282.5 286.5 282.9C286.9 283.2 288 283.3 288 283.3ZM292.2 279.7C292.2 279.7 291.6 280.3 291.2 280.3C290.8 280.3 290 280.1 290 279.9C290 279.7 291 279.6 291.2 279.6L292.2 279.7ZM285.9 271.4C285.9 271.4 284.9 271.6 284.6 272.1C284.333 272.7 284.4 273.033 284.8 273.1C285.4 273.2 285.3 272.5 285.3 272.4C285.3 272.2 285.9 271.4 285.9 271.4ZM281.7 273.7C281.7 273.7 281 274.1 280.8 274.5C280.6 274.9 280.5 275.7 280.8 275.8C281.3 275.8 281.4 275.1 281.5 274.8L281.7 273.7Z",fill:"#231F20"}),m.jsx("path",{d:"M274.2 278.7L271.9 281.1C271.9 281.1 277.2 284.1 281.3 283.9C285.3 283.9 289.9 280.6 290.3 279.9C290.5 279.3 290.3 276.5 289.8 275.6C289.3 274.7 286.4 272.6 285.4 272.6C284.4 272.7 282.4 274.2 280.7 275.8C279 277.4 279.1 279 276.7 278.8L274.2 278.7Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),m.jsx("path",{d:"M273.6 279.7C273.6 279.7 279.3 280.5 280.9 279.1C282.5 277.6 284.3 274.8 285.4 274.1C286.6 273.567 287.167 273.367 287.1 273.5L288.3 274.5L289.8 275.6L290.2 278.3V279.8L288.5 281.2L285.2 282.7L282.2 283.7L279.5 283.6L274.2 282L272.8 281.1L272.5 280.8L273.6 279.7Z",fill:"#0C8489"}),m.jsx("path",{d:"M282.2 276.4C282.267 276 282.533 275.867 283 276C283.7 276.2 283.9 276 283.9 276.5C283.9 277 283.4 277.7 282.9 277.7C282.6 277.7 282.2 276.9 282.2 276.4ZM284.5 277.8C284.5 277.4 284.767 277.2 285.3 277.2C285.9 277.2 286.3 277.8 286.3 278.2C286.3 278.6 285.9 279 285.4 279C284.9 279 284.5 278.3 284.5 277.8ZM283.7 281.2C283.7 280.733 284 280.533 284.6 280.6C285.5 280.7 285.4 280.8 285.4 281.3C285.4 281.8 285 282.3 284.4 282.3C284 282.233 283.767 281.9 283.7 281.3V281.2ZM280.7 280.2C280.7 279.6 281.3 279.4 281.7 279.4C282.233 279.467 282.533 279.8 282.6 280.4C282.533 281.067 282.267 281.433 281.8 281.5C281.2 281.367 280.867 280.933 280.8 280.2H280.7ZM276 280.8C276 280.495 276.121 280.202 276.337 279.987C276.552 279.771 276.845 279.65 277.15 279.65C277.455 279.65 277.747 279.771 277.963 279.987C278.179 280.202 278.3 280.495 278.3 280.8C278.3 281.105 278.179 281.397 277.963 281.613C277.747 281.829 277.455 281.95 277.15 281.95C276.845 281.95 276.552 281.829 276.337 281.613C276.121 281.397 276 281.105 276 280.8Z",fill:"#04534E"}),m.jsx("path",{d:"M284.5 277.8C284.633 277.4 284.9 277.2 285.3 277.2C285.7 277.2 285.9 277.433 285.9 277.9C285.9 278.367 285.733 278.6 285.4 278.6C284.933 278.533 284.633 278.267 284.5 277.8ZM283.7 281.1C283.767 280.633 284.1 280.4 284.7 280.4C285.167 280.4 285.433 280.633 285.5 281.1C285.5 281.767 285.2 282.033 284.6 281.9C283.7 281.7 283.7 281.5 283.7 281.1ZM280.7 280.1C280.7 279.6 281.6 279.4 281.9 279.4C282.167 279.4 282.267 279.667 282.2 280.2C282.067 280.867 281.867 281.167 281.6 281.1C281.133 281.033 280.867 280.7 280.8 280.1H280.7ZM282.2 276.4C282.2 276 282.4 275.833 282.8 275.9C283.4 276 283.3 276 283.3 276.5C283.3 276.967 283.133 277.233 282.8 277.3C282.333 277.3 282.133 276.967 282.2 276.3V276.4ZM276 280.4C276.067 279.8 276.433 279.467 277.1 279.4C277.9 279.4 278.367 279.633 278.5 280.1C278.5 280.7 277.7 281.6 277 281.6C276.3 281.6 276 280.9 276 280.4Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M278.2 279.5C278.2 279.5 277.4 279.6 277 280C276.6 280.467 276.533 280.8 276.8 281C277.066 281 277.233 280.833 277.3 280.5L278.2 279.5ZM281.9 278.7C281.9 278.7 281.2 279.2 281.1 279.7C281.1 280.3 281.166 280.567 281.3 280.5C281.5 280.3 281.6 279.967 281.6 279.5C281.5 279.3 281.9 278.7 281.9 278.7Z",fill:"#231F20"}),m.jsx("path",{d:"M282.5 279.5C282.5 279.5 282.1 279.5 281.7 279.8C281.3 280.2 281.167 280.433 281.3 280.5C281.567 280.5 281.767 280.4 281.9 280.2C281.9 280 282.5 279.5 282.5 279.5ZM283.3 275.1L282.8 275.6C282.467 275.933 282.4 276.233 282.6 276.5C282.8 276.5 283 276.333 283.2 276C283.4 275.533 283.467 275.233 283.4 275.1H283.3ZM286.2 276.9C286.2 276.9 285.5 277 285.2 277.4C284.933 277.733 284.933 277.933 285.2 278C285.467 278.067 285.633 277.933 285.7 277.6C285.7 277.3 286.2 276.9 286.2 276.9ZM285.7 280.3C285.7 280.3 285.6 280.8 285.1 281C284.767 281.4 284.533 281.467 284.4 281.2C284.267 280.867 284.367 280.667 284.7 280.6L285.7 280.3Z",fill:"#231F20"}),m.jsx("path",{d:"M290.3 278C290.3 278 290.6 279.6 289.3 280.3C287.9 281.1 284.1 283.8 280.5 283.5C276.9 283.1 272.8 281.1 272.8 281.1L272.3 281.4L273.2 281.8L276 282.9L279.1 283.9H281.1L282.8 283.8L286 282.7L288.7 281.3L290.1 280.3L290.4 279.8V278.2L290.3 278Z",fill:"#04534E"}),m.jsx("path",{d:"M219.9 257.8C219.9 257.8 220.7 258.5 220.7 259.1C220.567 259.7 220.367 259.933 220.1 259.8C219.9 259.8 219.9 259.1 219.9 258.8V257.8ZM226.1 263.5C226.1 263.5 225.8 264.5 225.4 264.6C224.934 264.6 224.7 264.433 224.7 264.1C224.8 263.9 225.2 264.1 225.4 263.9L226.1 263.5ZM212.7 264.3C212.7 264.3 213 264.9 213.5 265C214.1 265 214.334 264.833 214.2 264.5H213.6L212.7 264.3ZM215.1 269C215.1 269 215.6 269.6 216.2 269.6C216.424 269.64 216.656 269.603 216.856 269.494C217.056 269.385 217.213 269.21 217.3 269C217.3 268.9 216.5 268.9 216.3 269.1C216 269.3 215.1 269 215.1 269ZM219.3 272.6C219.3 272.6 220.3 272.4 220.6 272.1C220.867 271.7 220.934 271.367 220.8 271.1C220.6 270.7 220.4 271.4 220.3 271.7L219.3 272.6Z",fill:"#231F20"}),m.jsx("path",{d:"M226.1 269.7C226.1 269.7 226.8 264.8 222.9 261.4C219 258 216.4 258.8 215 260.1C213.7 261.3 212.5 265.5 216.7 269.1C220.9 272.7 226 271.6 226 271.6L226.1 269.7Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),m.jsx("path",{d:"M214 264.6C214 264.6 214 261.9 215.3 261.1C215.948 260.756 216.659 260.545 217.389 260.479C218.12 260.414 218.857 260.496 219.556 260.719C220.255 260.943 220.902 261.304 221.459 261.782C222.016 262.259 222.472 262.843 222.8 263.5C224.8 267.5 224.8 269.5 224.3 271.5H222.1L218.7 270.1L215.9 268L214 264.6Z",fill:"#0C8489"}),m.jsx("path",{d:"M225.6 270.4C225.6 270.4 224.9 271.2 223.5 271.1C222 271.1 215.5 269.3 213.8 263.4V264.7L213.9 265.1L214.4 266.3L215.8 268.3L217.5 269.8L219.7 271L221.3 271.4L223.3 271.8H224.5L225.5 270.4H225.6Z",fill:"#04534E"}),m.jsx("path",{d:"M222.1 268.7C222.1 268.3 222.333 268.133 222.8 268.2C223.2 268.2 223.6 268 223.6 268.5C223.6 269 223.3 269.8 222.9 269.8C222.4 269.8 222.1 269.2 222.1 268.8V268.7ZM222.4 265.6C222.4 265.2 222.666 264.967 223.2 264.9C224 264.8 223.9 265.2 223.9 265.6C223.9 265.933 223.666 266.133 223.2 266.2C222.533 266.2 222.266 266 222.4 265.6ZM219.4 269C219.4 268.667 219.7 268.5 220.3 268.5C220.766 268.5 221.033 268.667 221.1 269C221.2 269.5 220.3 269.7 219.8 269.7C219.3 269.7 219.4 269.3 219.4 269ZM219.1 265.3C219.1 264.967 219.333 264.867 219.8 265C220.266 265 220.566 265.2 220.7 265.6C220.9 266.2 220.2 266.7 219.7 266.7C219.4 266.7 219.1 265.8 219.1 265.3ZM216.4 266C216.4 265.6 216.6 265 217.1 265C217.6 265 218.1 265.6 218.1 266C218.1 266.4 217.8 266.633 217.2 266.7C216.3 266.8 216.3 266.3 216.3 266H216.4ZM216.9 262.7C216.9 262.367 217.133 262.233 217.6 262.3C218.266 262.3 218.6 262.5 218.6 262.9C218.466 263.433 218.1 263.767 217.5 263.9C216.9 263.9 216.9 263.1 216.9 262.7ZM219.9 262.4C219.9 262.133 220.166 262.033 220.7 262.1C221.366 262.167 221.633 262.4 221.5 262.8C221.5 263.2 220.9 263.6 220.5 263.6C220.1 263.6 219.9 262.8 219.9 262.4Z",fill:"#04534E"}),m.jsx("path",{d:"M216.9 262.6C216.9 262.267 217.1 262.1 217.5 262.1C218.033 262.033 218.266 262.2 218.2 262.6C218.2 263 217.966 263.233 217.5 263.3C217.033 263.367 216.833 263.133 216.9 262.6ZM216.3 265.8C216.3 265.333 216.5 265.067 216.9 265C217.3 264.933 217.533 265.1 217.6 265.5C217.6 266.1 217.366 266.367 216.9 266.3C216.5 266.367 216.3 266.2 216.3 265.8ZM219.8 262.4C219.8 262.133 220.033 262.033 220.5 262.1C220.9 262.033 221.133 262.167 221.2 262.5C221.133 262.833 220.9 263 220.5 263C220.1 263 219.9 262.8 219.9 262.4H219.8ZM219.2 265.5C219.2 265.967 219.433 266.233 219.9 266.3C220.366 266.233 220.633 265.967 220.7 265.5C220.8 264.8 220.2 264.7 219.9 264.7C219.433 264.767 219.2 265.033 219.2 265.5ZM222.5 265C222.566 265.467 222.833 265.733 223.3 265.8C223.966 265.8 224.233 265.533 224.1 265C224.033 264.6 223.766 264.3
72167 223.3 264.3C222.6 264.2 222.5 264.7 222.5 265ZM219.3 269C219.3 268.6 219.533 268.367 220 268.3C220.466 268.233 220.7 268.433 220.7 268.9C220.566 269.3 220.233 269.567 219.7 269.7C219.433 269.633 219.3 269.4 219.3 269ZM222.2 268.5C222.2 268.167 222.433 268 222.9 268C223.5 267.933 223.733 268.1 223.6 268.5C223.466 269.1 223.2 269.367 222.8 269.3C222.4 269.233 222.166 268.967 222.1 268.5H222.2Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M223 263.6C223 263.6 223.4 264.1 223.5 264.6L223.4 265.5C223.2 265.5 223.033 265.267 222.9 264.8V263.5L223 263.6ZM220.4 260.9C220.4 260.9 220.7 261.3 220.7 261.7C220.7 262.1 220.7 262.5 220.4 262.5C220.266 262.433 220.2 262.2 220.2 261.8L220.4 260.9ZM217.4 261.3C217.4 261.3 217.7 261.7 217.7 262.1C217.7 262.5 217.7 262.9 217.5 262.9C217.3 262.9 217.3 262.5 217.3 262.2L217.4 261.3Z",fill:"#231F20"}),m.jsx("path",{d:"M216.4 261.8L217.1 262.2C217.5 262.533 217.634 262.767 217.5 262.9C217.234 263.033 217.067 262.967 217 262.7L216.4 261.8ZM218.7 264.9C218.7 264.9 219.2 264.9 219.6 265.2C219.934 265.533 220.034 265.8 219.9 266C219.7 266.067 219.434 265.933 219.1 265.6L218.7 264.9ZM215.9 264.9L216.7 265.1C216.967 265.367 217.034 265.6 216.9 265.8C216.767 265.8 216.6 265.7 216.4 265.5L215.9 264.9ZM222.6 266.9L222.7 267.9C222.767 268.5 222.734 268.833 222.6 268.9C222.4 269 222.3 268.3 222.3 267.9L222.6 266.9Z",fill:"#231F20"}),m.jsx("path",{d:"M221.8 268L222.5 268.3C222.7 268.567 222.7 268.733 222.5 268.8L222.2 268.4L221.8 268ZM218.8 268.1L219.6 268.3C219.8 268.633 219.866 268.967 219.8 269.3C219.666 269.367 219.5 269.233 219.3 268.9L218.8 268.1Z",fill:"#231F20"}),m.jsx("path",{d:"M217.7 259C217.7 259 215.1 259.6 214.7 261.3C214.1 263 214.1 264.9 214.1 264.9L213.7 262.7L214.3 261.4L215 260.1L216.2 259.4L217.2 259H217.7ZM225.9 269C225.9 269 226.1 268.4 225.4 266.4C224.6 264.3 223 261.6 223 261.6L224.2 263L225.2 264.6L225.7 266L226.1 267.3V268.6L225.9 269Z",fill:"#04534E"}),m.jsx("path",{d:"M228.5 265.7C228.5 265.7 229.5 266.3 229.5 266.7V267.2C229.1 267.133 228.834 266.967 228.7 266.7L228.5 265.7ZM224.7 276C224.7 276 225.1 275.2 225.7 275C226.367 274.667 226.734 274.6 226.8 274.8C227 275 226.5 275.5 226.1 275.6L224.7 276ZM231.1 278.5C231.1 278.5 231.8 278.2 232.1 277.7C232.5 277.3 232.634 277 232.5 276.8C232.234 276.733 231.9 276.9 231.5 277.3L231.1 278.5ZM230.4 277.9C230.4 277.9 230.6 277.1 230.9 276.8C231.1 276.533 231.334 276.433 231.6 276.5C231.8 276.7 231.8 276.933 231.6 277.2L230.4 277.9Z",fill:"#231F20"}),m.jsx("path",{d:"M241.2 273C241.2 273 237.2 267.2 230.9 266.9C225.9 266.6 224.4 271.1 224.6 272.4C224.7 273.8 226.6 276.7 233.3 277.1C240 277.5 241 274.1 241.3 273.8C241.5 273.7 241.2 273 241.2 273Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),m.jsx("path",{d:"M236.5 269C236.5 269 238.1 270.3 238.8 271.3C239.5 272.3 239.7 273 239.3 273.1C238.9 273.2 235.3 269.9 232.3 269.2C229.3 268.5 226.8 269.2 226.2 270.6C225.6 272 225.8 274.1 227.2 275C228.6 275.9 234.9 277 234.9 277L237.9 276.5L239.7 275.5L240.1 274.5L240.5 273.1L240.7 272.6L239.2 270.9L236.5 269Z",fill:"#0C8489"}),m.jsx("path",{d:"M231.4 269.8C231.333 270.2 231.067 270.4 230.6 270.4C230 270.4 229.767 270.2 229.9 269.8C229.9 269.4 230.133 269.167 230.6 269.1C231.067 269.033 231.333 269.267 231.4 269.8ZM227.7 271.1C227.7 270.833 228 270.733 228.6 270.8C229.5 270.9 229.3 271.1 229.3 271.4C229.3 271.8 228.6 272.4 228.3 272.2C227.833 271.867 227.633 271.533 227.7 271.2V271.1ZM231.7 273.3C231.7 272.767 231.967 272.467 232.5 272.4C233.233 272.4 233.567 272.7 233.5 273.3C233.3 274.1 232.9 274.433 232.3 274.3C231.4 274.1 231.6 273.8 231.6 273.3H231.7Z",fill:"#04534E"}),m.jsx("path",{d:"M228.7 274.2C228.767 273.8 229.034 273.633 229.5 273.7C229.9 273.767 230.167 274.033 230.3 274.5C230.5 275.2 229.8 275.2 229.5 275.2C229.034 275.067 228.767 274.733 228.7 274.2Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M234 275.6C234 275.267 234.167 275.067 234.5 275C234.967 275 235.233 275.167 235.3 275.5C235.3 275.967 235.067 276.2 234.6 276.2L234 275.6ZM236.4 273.8C236.4 273.467 236.6 273.333 237 273.4C237.533 273.4 237.833 273.633 237.9 274.1C237.833 274.5 237.5 274.7 236.9 274.7C236.5 274.633 236.333 274.3 236.4 273.7V273.8Z",fill:"#04534E"}),m.jsx("path",{d:"M231.1 269.5C231.1 269.833 230.967 270 230.7 270C230.234 270 229.967 269.833 229.9 269.5C229.9 269.167 230.067 269 230.4 269C230.867 269 231.1 269.167 231.1 269.5ZM229.2 271C229.134 271.4 228.834 271.6 228.3 271.6C227.5 271.6 227.8 271.4 227.8 271C227.8 270.733 228 270.6 228.4 270.6C228.8 270.533 229.067 270.667 229.2 271ZM230.1 274.1C230.1 274.433 229.934 274.633 229.6 274.7C229.067 274.7 228.767 274.5 228.7 274.1C228.6 273.5 228.9 273.6 229.2 273.6C229.734 273.6 230.034 273.767 230.1 274.1ZM233.2 273.1C233.067 273.5 232.734 273.733 232.2 273.8C231.4 273.9 231.7 273.2 231.7 272.8C231.7 272.467 231.934 272.267 232.4 272.2C232.8 272.267 233.067 272.567 233.2 273.1Z
721M237.9 274.1C237.767 274.367 237.434 274.467 236.9 274.4C236.634 274.333 236.467 274.067 236.4 273.6C236.4 273.3 236.4 273 237.3 273.1C237.634 273.233 237.834 273.567 237.9 274.1ZM235.1 275.4C235.1 275.8 234.9 276.033 234.5 276.1L233.9 275.5C233.9 275.1 234.1 274.933 234.5 275C234.9 275.067 235.1 275.233 235.1 275.5V275.4Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M235.6 273.5C235.6 273.5 236.2 273.3 236.6 273.4C237.066 273.4 237.266 273.5 237.2 273.7L236.6 273.9L235.6 273.5ZM232.9 275.8L233.8 275.4C234.266 275.4 234.466 275.5 234.4 275.7C234.4 275.967 234.233 276.067 233.9 276L232.9 275.8ZM231.1 271.8C231.1 271.8 232.2 272.3 232.5 272.8C232.766 273.133 232.766 273.333 232.5 273.4C232.3 273.533 232.1 273.433 231.9 273.1L231.1 271.8Z",fill:"#231F20"}),m.jsx("path",{d:"M230.8 273.3L232.1 273C232.5 273 232.666 273.067 232.6 273.2C232.533 273.333 232.4 273.433 232.2 273.5L230.8 273.2V273.3ZM228.1 273.3C228.1 273.3 229.1 273.4 229.3 273.7C229.5 273.9 229.533 274.1 229.4 274.3C229.2 274.367 228.966 274.333 228.7 274.2C228.3 274 228.1 273.3 228.1 273.3Z",fill:"#231F20"}),m.jsx("path",{d:"M228 274.6C228 274.6 228.3 274.1 228.7 274H229.5C229.5 274.333 229.3 274.533 228.9 274.6H228ZM227.3 270.6L228.2 270.8C228.534 271.067 228.634 271.267 228.5 271.4H227.8C227.4 271 227.2 270.733 227.2 270.6H227.3ZM229.3 268.2C229.3 268.2 230.3 268.5 230.5 268.9C230.767 269.3 230.834 269.567 230.7 269.7L229.9 269.3L229.3 268.2Z",fill:"#231F20"}),m.jsx("path",{d:"M240 275C240 275 238.1 276.6 233.8 276.5C229.5 276.4 225.5 274.5 224.6 272.5L225 273.5L226 274.7L229 276.3L232.4 277L235.1 277.2L237.6 276.8L239.6 275.8L239.9 275.3L240.1 275H240ZM240.6 273L238.9 271L233.9 267.6L237.1 269L239.2 270.8L240.7 272.4L240.6 273Z",fill:"#04534E"}),m.jsx("path",{d:"M240.8 269C240.8 269 241.9 269.5 242.1 269.8L242.5 270.3C242.5 270.3 242.2 271 242 270.7L241.4 270L240.8 269ZM244.1 267.3C244.1 267.3 245.1 267.8 245.4 268.3C245.733 268.833 245.8 269.167 245.6 269.3C245.4 269.3 244.7 268.7 244.6 268.5L244.1 267.3Z",fill:"#231F20"}),m.jsx("path",{d:"M245 267.1C245 267.1 246 267.8 246.2 268.1C246.534 268.5 246.6 268.833 246.4 269.1C246 268.967 245.667 268.7 245.4 268.3L245 267.1ZM250.6 268.4C250.6 268.4 251.3 268.7 251.4 269.4V270.4L250.8 269.8V269.3L250.6 268.4ZM252 268.9C252 268.9 252.6 269.5 252.7 269.9C252.767 270.3 252.7 270.533 252.5 270.6C252.167 270.6 252 270.4 252 270V269V268.9ZM242.2 280.9C242.2 280.9 242.7 281.1 243.1 280.9C243.634 280.7 243.867 280.433 243.8 280.1C243.8 279.767 243.6 279.733 243.2 280L242.8 280.6L242.2 280.9ZM247.6 282.4C247.6 282.4 248.3 282.3 248.8 281.7C249.334 281.167 249.467 280.833 249.2 280.7C248.8 280.567 248.5 280.7 248.3 281.1L247.6 282.4ZM252 282.5L253 281.8C253.467 281.467 253.6 281.133 253.4 280.8C253.134 280.667 252.9 280.7 252.7 280.9L252.6 281.5L252 282.5Z",fill:"#231F20"}),m.jsx("path",{d:"M253.4 282.5C253.4 282.5 254 281.8 254.1 281.4C254.234 280.867 254.234 280.6 254.1 280.6C253.767 280.667 253.534 280.867 253.4 281.2V282.5Z",fill:"#231F20"}),m.jsx("path",{d:"M239.9 275.3C239.9 273.3 242.7 268.8 245.9 268.9C247.2 268.9 249.9 269.6 251.9 270.6C253.7 271.4 254.3 272.2 255.4 272.6C256.6 272.8 258.4 272.6 258.4 272.6L262.4 272.1L259.2 276.7L258.2 277.7C258.2 277.7 257.2 279.7 254.2 280.7C251.5 281.8 246.7 281 244.5 280.5C242.3 280 239.8 277.9 239.9 275.3Z",fill:"#8CBEBF",stroke:"#04534E",strokeWidth:"0.4"}),m.jsx("path",{d:"M239.9 275.3H240.1C240.1 274.9 240.267 274.333 240.6 273.6C241.11 272.479 241.822 271.462 242.7 270.6C243.7 269.667 244.734 269.167 245.8 269.1C247.861 269.371 249.878 269.909 251.8 270.7L253.8 271.9C254.72 272.592 255.85 272.945 257 272.9L258.4 272.8L261.9 272.4L259.1 276.6L257.9 277.6C257.055 279.002 255.746 280.063 254.2 280.6C253.2 280.933 252.034 281.1 250.7 281.1C248.4 281.1 245.9 280.6 244.6 280.3C243.474 279.992 242.443 279.408 241.6 278.6C240.727 277.751 240.194 276.614 240.1 275.4V275.3H239.7C239.709 275.977 239.856 276.645 240.131 277.264C240.406 277.883 240.804 278.439 241.3 278.9C242.188 279.774 243.292 280.395 244.5 280.7C245.9 281 248.3 281.5 250.7 281.5C251.959 281.513 253.21 281.31 254.4 280.9C257.3 279.8 258.3 277.9 258.3 277.8L258.1 277.7L258.2 277.9L259.4 276.9L262.8 271.9L258.3 272.4H257L255.5 272.3C254.967 272.167 254.467 271.933 254 271.6C253.6 271.2 252.934 270.8 252 270.4L248.7 269.2C247.567 268.867 246.634 268.7 245.9 268.7C244.967 268.7 244.134 268.967 243.4 269.5C242.343 270.236 241.456 271.191 240.8 272.3C240.207 273.202 239.831 274.228 239.7 275.3H239.9Z",fill:"#04534E"}
721),m.jsx("path",{d:"M259.2 275.9C258.867 276.167 258.5 276.267 258.1 276.2C257.6 276.2 248.8 270.8 246.1 271C243.3 271.2 240.7 272.4 240.6 275.2C240.5 278 241.2 278.1 241.8 278.9C242.4 279.7 247.8 280.9 247.8 280.9H251L253.7 280.5L256 279.2L257.3 278.2L258.2 277.2L259.2 275.9Z",fill:"#0C8489"}),m.jsx("path",{d:"M245.2 274.5C245.2 275.1 244.933 275.433 244.4 275.5C243.867 275.567 243.567 275.267 243.5 274.6C243.5 274.133 243.767 273.9 244.3 273.9C244.967 273.767 245.267 273.967 245.2 274.5ZM246.2 272C246.2 271.6 246.5 271.4 247.1 271.4C248 271.4 248 271.5 248 272C248 272.5 247.6 272.8 247 272.8C246.4 272.8 246.1 272.5 246.1 272H246.2ZM251.4 273.5C251.467 273.033 251.733 272.767 252.2 272.7C252.867 272.7 253.133 272.967 253 273.5C252.8 274.3 252.6 274.2 252.2 274.2C252.014 274.17 251.841 274.089 251.699 273.965C251.558 273.841 251.454 273.68 251.4 273.5ZM252.4 276.7C252.4 276.1 252.733 275.767 253.4 275.7C253.867 275.7 254.133 275.967 254.2 276.5C254.2 277.233 254 277.567 253.6 277.5C252.933 277.5 252.567 277.233 252.5 276.7H252.4ZM249.9 278.7C249.9 278.3 250.2 278.067 250.8 278C251.7 277.9 251.6 278.3 251.6 278.8C251.6 279.2 251.333 279.433 250.8 279.5C250.333 279.5 250.033 279.267 249.9 278.8V278.7ZM245 277.9C245.067 277.5 245.333 277.267 245.8 277.2C245.921 277.155 246.051 277.14 246.179 277.156C246.307 277.173 246.429 277.22 246.535 277.293C246.641 277.367 246.728 277.465 246.787 277.579C246.847 277.694 246.878 277.821 246.878 277.95C246.878 278.079 246.847 278.206 246.787 278.321C246.728 278.435 246.641 278.533 246.535 278.607C246.429 278.68 246.307 278.727 246.179 278.744C246.051 278.76 245.921 278.745 245.8 278.7C245.601 278.663 245.419 278.567 245.276 278.424C245.133 278.281 245.037 278.099 245 277.9Z",fill:"#04534E"}),m.jsx("path",{d:"M245.2 274.4C245.2 274.867 244.9 275.133 244.3 275.2C244.101 275.163 243.919 275.067 243.776 274.924C243.633 274.781 243.537 274.598 243.5 274.4C243.567 273.933 243.833 273.733 244.3 273.8C244.767 273.867 245.067 274.033 245.2 274.3V274.4ZM247.7 271.9C247.7 272.3 247.533 272.533 247.2 272.6C246.6 272.6 246.267 272.333 246.2 271.8C246.2 271.4 246.433 271.167 246.9 271.1C247.433 271.1 247.7 271.367 247.7 271.9ZM252.9 273.2C252.833 273.6 252.567 273.833 252.1 273.9C251.5 273.9 251.267 273.667 251.4 273.2C251.4 272.867 251.633 272.667 252.1 272.6C252.767 272.6 253.033 272.8 252.9 273.2Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M250.1 275.4C250.1 276.067 249.867 276.4 249.4 276.4C248.734 276.4 248.4 276.1 248.4 275.5C248.4 275.033 248.7 274.8 249.3 274.8C250.2 274.8 250.1 274.8 250.1 275.4Z",fill:"#04534E"}),m.jsx("path",{d:"M246.4 277.8C246.4 278.2 246.133 278.433 245.6 278.5C245.414 278.47 245.241 278.389 245.099 278.265C244.958 278.141 244.854 277.98 244.8 277.8C244.866 277.333 245.2 277.1 245.8 277.1C246.2 277.1 246.4 277.3 246.4 277.7V277.8ZM250 275.3C249.963 275.499 249.867 275.681 249.724 275.824C249.581 275.967 249.398 276.063 249.2 276.1C249.001 276.063 248.819 275.967 248.676 275.824C248.533 275.681 248.437 275.499 248.4 275.3C248.437 275.101 248.533 274.919 248.676 274.776C248.819 274.633 249.001 274.537 249.2 274.5C249.398 274.537 249.581 274.633 249.724 274.776C249.867 274.919 249.963 275.101 250 275.3ZM254.2 276.3C254.2 276.967 253.933 277.3 253.4 277.3C253.135 277.3 252.88 277.195 252.693 277.007C252.505 276.82 252.4 276.565 252.4 276.3C252.4 275.9 252.633 275.7 253.1 275.7C253.766 275.7 254.1 275.933 254.1 276.4L254.2 276.3ZM251.5 278.6C251.5 279 251.233 279.233 250.7 279.3C250.033 279.3 249.733 279.067 249.8 278.6C249.866 278.133 250.166 277.9 250.7 277.9C251.166 277.9 251.433 278.133 251.5 278.6Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M251.8 276C251.8 276 253.1 275.8 253.4 276C253.6 276.333 253.6 276.6 253.4 276.8L252.7 276.7L251.8 276ZM250.5 271.7C250.5 271.7 251.5 272 251.9 272.4C252.233 272.867 252.333 273.167 252.2 273.3C252.067 273.433 251.833 273.367 251.5 273.1L250.5 271.7ZM247.5 273.7C247.5 273.7 248.7 274.4 248.9 274.7C249.233 275.1 249.3 275.4 249.1 275.6C249.1 275.7 248.4 275.6 248.3 275.3L247.5 273.7Z",fill:"#231F20"}),m.jsx("path",{d:"M247 274.6C247 274.6 248.3 274.8 248.6 275.1C249 275.233 249.2 275.367 249.2 275.5C249.2 27
7215.633 249.067 275.767 248.8 275.9L247.8 275.5C247.8 275.3 247 274.7 247 274.7V274.6ZM245.4 270.8C245.4 270.8 246.8 271 247.1 271.2C247.433 271.533 247.433 271.867 247.1 272.2C246.767 272.267 246.5 272.133 246.3 271.8C246.3 271.5 245.4 270.8 245.4 270.8ZM242.5 272.8C242.5 272.8 243.8 273.4 244.2 274C244.533 274.333 244.533 274.533 244.2 274.6C243.8 274.8 243.4 274.1 243.4 274L242.5 272.8Z",fill:"#231F20"}),m.jsx("path",{d:"M242.3 274.4L243.4 274.3C243.933 274.167 244.266 274.2 244.4 274.4C244.266 274.667 244 274.767 243.6 274.7L242.3 274.4ZM249.1 278.9C249.1 278.9 250.1 278.3 250.4 278.4C250.866 278.4 251.066 278.5 251 278.7C250.8 278.9 250.6 278.967 250.4 278.9H249.2H249.1ZM244.3 278.2C244.3 278.2 244.7 277.7 245 277.6L245.6 277.7C245.533 277.967 245.366 278.133 245.1 278.2H244.3Z",fill:"#231F20"}),m.jsx("path",{d:"M258 277.3C258 277.3 256.8 278.9 255 279.7C253 280.5 251.7 280.7 249.1 280.6C247.139 280.565 245.216 280.05 243.5 279.1C242.2 278.477 241.068 277.551 240.2 276.4C239.9 275.8 240.5 277.4 240.5 277.4L242 279.4L244 280.2L246.7 280.9L249.3 281.2H251.3L253.7 280.8L255.3 280.3L256.3 279.6L257.1 279L258 277.3ZM255.6 272.6C255.6 272.6 254.9 272.8 253.3 271.9C251.7 270.9 249.8 269.6 246.3 269.6C242.7 269.6 241.5 272 241.3 272.2L242.9 270.1L244.5 269.1L245.8 269H247L248.6 269.5L250 269.9L251.7 270.5L253.2 271.3L254.9 272.2L255.6 272.6ZM260.4 273.6H257.7C257.234 273.667 257 273.8 257 274L256.8 274.4L256.1 273L259 272.6L260.6 273.2L260.4 273.7V273.6Z",fill:"#04534E"}),m.jsx("path",{d:"M256.6 288.3C256.733 288.767 257 289.033 257.4 289.1H258.8L261.6 288.9L262.6 287.8L263.2 285.2L264 284.2L266.6 282.7L268.9 282.1L270.4 281.9L272.4 281.2L273.9 280.5L274.5 279.5L275.2 278L274.5 276L272.9 274L270.3 272.9H268L265.5 273.8L261.2 274.8C261.2 274.8 258.7 275.8 257.7 277.8C256.7 279.6 256.7 280.1 256.6 282.6C256.5 285.1 256.6 288.3 256.6 288.3Z",fill:"#0C8489",stroke:"#04534E",strokeWidth:"0.4"}),m.jsx("path",{d:"M257.7 287.4C258.6 287.4 257.9 286 258.9 284.4C259.9 282.8 260.9 280.7 261.3 280.7C261.5 280.833 261.733 280.9 262 280.9C262.3 280.8 263 280.2 263 280.1C262.866 279.767 263.1 279.2 263.7 278.4C264.4 277.8 265.5 277 265.9 276.9C266.366 276.767 266.633 276.767 266.7 276.9C266.8 277.1 266.5 277.4 266.8 277.6C267.266 277.667 267.7 277.5 268.1 277.1L268.2 276.4C268.1 276.4 268.7 275.9 269.7 276.1C270.7 276.3 270.7 276.3 270.8 276.6C270.9 277 270.4 277 270.5 277.3V277.7C270.6 277.9 270.8 278.5 271.5 278.5C272.1 278.367 272.366 278.233 272.3 278.1L272.5 277.8C272.5 277.8 272.7 277.4 272.5 277.2C272.233 276.933 272.233 276.867 272.5 277C272.8 277 273.7 278.4 274.1 277.9C274.366 277.167 274.433 276.633 274.3 276.3L272.7 274.1L270.3 273.2L267.1 273.5L263.9 275.3L261 276.8C261 276.8 260.9 279.2 260.4 278.8C259.8 278.3 259.1 277.2 258.9 277.5L257.9 280.5C257.6 281.4 256.7 284 256.9 285C256.9 286 257.4 287.4 257.7 287.4Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M260.6 283.6L260 283.9L259.8 284.7C259.9 285 260.4 285.3 260.4 285.3H260.8L261.5 285.1C261.5 285.1 261.8 284.8 261.8 284.4C261.8 284.067 261.7 283.9 261.5 283.9L260.6 283.6ZM265.6 279.5C265.133 279.433 264.9 279.5 264.9 279.7V280.2C264.9 280.2 264.9 280.8 265.2 280.9C265.5 281 266 281.2 266.2 281C266.4 280.867 266.533 280.633 266.6 280.3C266.6 279.9 266 279.7 266 279.7L265.6 279.5ZM269.6 280.5C269.533 280.3 269.3 280.2 268.9 280.2C268.5 280.2 268.333 280.5 268.4 281.1C268.6 281.567 268.933 281.7 269.4 281.5C269.8 281.5 269.7 280.9 269.7 280.8L269.6 280.4V280.5ZM258 281.2C258.067 281.6 258.4 281.833 259 281.9C259.234 281.905 259.462 281.827 259.645 281.681C259.828 281.535 259.953 281.329 260 281.1C260 280.8 259.7 281.4 259.3 281.5H258.4L258.1 281.2H258Z",fill:"#8CBEBF"}),m.jsx("path",{d:"M261.8 284.4C261.8 284.4 261.8 284.9 261.5 285.2L260.7 285.4C260.433 285.4 260.233 285.333 260.1 285.2L259.8 284.6C259.8 284.6 260.2 285.3 260.8 285.1C261.4 284.9 261.8 284.4 261.8 284.4ZM272.5 277.8C272.5 277.8 272.5 278.3 272.1 278.5C271.7 278.7 271.433 278.767 271.3 278.7C271.033 278.7 270.833 278.6 270.7 278.4C270.2 277.7 270.5 277.2 270.5 277.2C270.5 277.2 270.8 278.5 271.5 278.4C272.2 278.3 272.5 277.8 272.5 277.8ZM263 280C263 280 262.6 281 262 281C261.4 281 261.4 280.9 261.4 280.7H262C262.3 280.7 263 280.1 263 280.1V280ZM264.8 279.9C264.8 279.9 264.8 280.6 265 280.9C265.2 281.1 265.466 281.2 265.8 281.2C266.133 281.2 266.366 281.1 266.5 280.9V280.3L266.4 280.6L265.8 280.9C265.533 280.9 265.3 280.8 265.1 280.6L264.8 279.9ZM268.2 276.4C268.2 276.4 268.4 276.9 268 277.4C267.6 277.9 266.8 277.6 266.8 277.6C266.8 277.6 267.4 277.7 267.8 277.4C268.1 277 268.2 276.4 268.2 276.4Z",fill:"#04534E"}),m.jsx("path",{d:"M257.4 288.9C257.4 288.9 261.6 288.9 261.9 288.2C262.3 287.7 261.6 285.4 264.1 283.6C266.6 281.8 268.6 281.8 270 281.7C271.3 281.7 274.2 280.7 274.8 278.1C275.1 276.5 272.9 276.4 272.1 274.9C271.3 273.4 269.2 274 269.1 274C269.1 274 266.7 274 265.6 275C265 275.7 265.1 276.5 264.7 276.8C264.5 277.2 261.7 276.8 261.4 277.3C261.1 277.8 261.4 278.7 261.2 278.9C261 279.1 260.4 278.3 260.4 278.3L260.6 276L264.1 274L268.1 271.7H270.9L273.7 273.2L275.1 274.8C275.1 274.8 275.4 27
7215.4 275.5 276.6L275.4 278.2C275.002 279.329 274.275 280.314 273.313 281.027C272.351 281.74 271.197 282.148 270 282.2C267.6 282.3 265.4 283.4 264.4 284.2C263.3 285 262.7 288.5 262.7 288.9C262.7 289.3 257.5 289.1 257.5 289.1L257.4 288.9Z",fill:"#04534E"}),m.jsx("path",{d:"M259.1 280.7C258.834 280.9 258.634 280.867 258.5 280.6C258.3 279.9 258.8 278.9 258.8 278.9V280.1L259.2 280.4L259.1 280.7ZM261.8 280.1C261.6 280.1 261.6 279.4 261.8 279.1L263.1 278L262.6 279.2C262.5 279.5 262.1 280.2 261.8 280.2V280.1ZM260.8 284.4C260.6 284.4 260.5 284.133 260.5 283.6C260.5 282.8 261.3 282.3 261.3 282.3L261.1 283.3V284C261.1 284.267 261 284.4 260.8 284.4Z",fill:"#231F20"}),m.jsx("path",{d:"M262.7 283.2L261.9 283.9C261.434 284.233 261.067 284.4 260.8 284.4C260.5 284.4 260.9 283.8 261.1 283.7L262.7 283.2ZM266.3 278.1L265.6 279.1C265.334 279.7 265.334 280.033 265.6 280.1C265.8 280.3 266.1 279.5 266.1 279.3L266.3 278.1Z",fill:"#231F20"}),m.jsx("path",{d:"M267.6 279.9C267.6 279.9 267.3 279.6 266.7 279.4C266.1 279.333 265.767 279.4 265.7 279.6C265.7 279.8 265.3 280 265.5 280.2L266.2 279.9L266.9 279.8H267.7L267.6 279.9ZM266.9 276.4C267.1 276.4 267.367 276.233 267.7 275.9L268.2 274.9L267.4 275.4C267 275.733 266.834 276.067 266.9 276.4ZM272.4 276.2L271.4 276.9C271.134 277.233 271.034 277.5 271.1 277.7C271.367 277.767 271.6 277.633 271.8 277.3L272.4 276.3V276.2ZM270.8 279.9C270.8 279.9 270.6 280.4 270.1 280.7C269.6 281 269.1 281.1 269.1 281C268.967 28
7210.733 269.034 280.533 269.3 280.4L270 280.2L270.8 279.9Z",fill:"#231F20"}),m.jsx("path",{d:"M234.379 271.172C235.634 271.365 236.883 270.016 237.167 268.159C237.451 266.303 236.663 264.643 235.407 264.451C234.152 264.259 232.904 265.607 232.62 267.464C232.335 269.32 233.123 270.98 234.379 271.172Z",fill:"url(#paint0_radial_4989_137735)"}),m.jsx("path",{d:"M236.3 261.5L234.9 265L236 264.8L236.7 261.8L236.3 261.5Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M237 260C236.334 260 236 260.333 236 261C235.934 261.467 236.167 261.8 236.7 262C237.3 262 237.634 261.7 237.7 261.1C237.767 260.5 237.5 260.167 236.9 260.1L237 260ZM295.8 268.6L292.4 271.8L293.8 272.1L296.1 269.1L295.8 268.6Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M297.3 267.3C296.634 267.1 296.067 267.267 295.6 267.8C295.513 267.92 295.453 268.059 295.426 268.205C295.399 268.351 295.405 268.502 295.443 268.645C295.481 268.789 295.551 268.922 295.648 269.036C295.744 269.149 295.865 269.239 296 269.3C296.5 269.6 297.3 269.3 297.6 268.8C297.688 268.68 297.747 268.541 297.774 268.395C297.801 268.249 297.796 268.099 297.757 267.955C297.719 267.811 297.649 267.678 297.553 267.565C297.456 267.451 297.336 267.361 297.2 267.3H297.3ZM210.2 250.4L212 254.3L212.8 253.3L210.8 250.3L210.2 250.4Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M209.5 248.7C209.387 248.787 209.294 248.896 209.227 249.022C209.16 249.147 209.12 249.285 209.111 249.427C209.101 249.569 209.122 249.712 209.172 249.845C209.222 249.978 209.3 250.099 209.4 250.2C209.867 250.733 210.367 250.8 210.9 250.4C211.013 250.313 211.106 250.204 211.174 250.078C211.241 249.953 211.281 249.815 211.29 249.673C211.299 249.531 211.279 249.388 211.229 249.255C211.179 249.122 211.101 249.001 211 248.9C210.922 248.78 210.818 248.678 210.696 248.602C210.575 248.525 210.438 248.476 210.296 248.457C210.154 248.438 210.009 248.45 209.872 248.492C209.734 248.534 209.608 248.605 209.5 248.7Z",fill:"#FCCA3E",stroke:"#AA8C30",strokeWidth:"0.2"}),m.jsx("path",{d:"M237.3 260.2C236.9 260.2 236.1 260.5 236.1 261.1C236.167 261.633 236.434 261.9 236.9 261.9H236.3L236.1 261.5L235.9 261.1L236 260.6L236.3 260.2L236.7 260.1H237L237.3 260.2Z",fill:"#AA8C30"}),m.jsx("path",{d:"M236.5 262.5C236.5 262.5 236.3 262.5 236.1 262.8L235.5 263.6L236.2 261.7L236.7 261.9L236.5 262.5ZM297.5 267.6C297.2 267.3 296.1 267.4 295.8 268C295.6 268.667 295.767 269.1 296.3 269.3C296.8 269.5 296.1 269.3 296.1 269.3L295.6 268.9L295.5 268.5V267.9L295.9 267.5L296.5 267.2H297L297.3 267.4L297.6 267.6H297.5Z",fill:"#AA8C30"}),m.jsx("path",{d:"M295.5 269.8H294.9L293.7 270.5L295.6 268.8L296 269.3L295.5 269.8ZM209.9 248.5C209.6 248.8 209.3 249.7 209.7 250.1C209.881 250.255 210.112 250.34 210.35 250.34C210.589 250.34 210.819 250.255 211 250.1C211.4 249.8 211 250.3 211 250.3L210.4 250.6H210L209.5 250.4L209.2 249.9V249.3L209.3 248.8L209.6 248.6L209.9 248.5Z",fill:"#AA8C30"}),m.jsx("path",{d:"M211.2 251C211.2 251 211 251.2 211.1 251.6L211.3 252.8L210.3 250.6L210.8 250.4L211.2 251Z",fill:"#AA8C30"}),m.jsx("path",{d:"M212.036 258.936C212.967 260.755 214.718 261.72 215.947 261.091C217.176 260.462 217.418 258.477 216.487 256.658C215.556 254.839 213.805 253.874 212.576 254.503C211.347 255.132 211.105 257.117 212.036 258.936Z",fill:"url(#paint1_radial_4989_137735)"}),m.jsx("path",{d:"M210 257C210 257 210.8 257.2 211.2 257C211.6 256.667 211.8 256.433 211.8 256.3L212 255.6L211.2 254.4H210.4C210.4 254.2 210.334 254.033 210.2 253.9C210 253.9 208.9 255.2 209.1 255.4C209.3 255.6 209.4 255.3 209.5 255.4V256.4L210 257Z",fill:"#E92736"}),m.jsx("path",{d:"M211.2 254.5C211.2 254.7 211.7 255.3 211.9 255.3H212.8C212.9 255.3 213.5 254.8 213.5 254.5L213.4 253.9C213.3 253.7 213.4 253.1 213.1 253C212.967 253 212.867 252.933 212.8 252.8L212.6 252.3C212.5 252 210.6 253.1 210.8 253.3L211.2 253.5V254.5Z",fill:"#E92736"}),m.jsx("path",{d:"M215.4 254L215.3 252.6C215.033 252.6 214.833 252.5 214.7 252.3C214.833 252.233 214.933 252.1 215 251.9C215.1 251.6 213 252 213 252.2C213.2 252.5 213.5 252.3 213.5 252.5L213.1 253L213.3 253.9L213.5 254.3L214 254.4H215.1L215.4 254ZM232.9 264.3C232.9 264.3 233.2 264.9 233.6 265H234.3C234.5 265 234.7 264.9 234.9 264.7L235.2 263.6L234.7 263L234.9 262.6C234.9 262.4 233.3 262.6 233.3 262.8C233.3 263 233.5 262.9 233.5 263.1L232.9 263.6V264.3Z",fill:"#E92736"}),m.jsx("path",{d:"M235 263.6V264.6L235.5 265.1H236.4L236.7 264.6L237.1 264L237 263.6C237.133 263.533 237.233 263.4 237.3 263.2C237.4 262.9 235.6 262.4 235.6 262.6L235.7 263C235.7 263 235.1 263.4 235.1 263.6H235Z",fill:"#E92736"}),m.jsx("path",{d:"M237.8 266C238 265.9 238.6 265.3 238.6 265L238.5 264.6L238.9 264.5C238.9 264.4 237.6 263.2 237.6 263.5C237.5 263.7 237.8 263.8 237.6 263.9H237.2L236.7 264.6L236.6 264.9L236.7 265.3L237.4 266H237.8ZM290.7 270.4C290.7 270.4 290.7 271 291 271.4L291.6 271.7H292.2C292.4 271.7 292.9 271 292.9 270.8V270.1L293.1 269.9C293.2 269.7 291.8 269 291.7 269.3V269.6L291 269.8L290.7 270.4Z",fill:"#E92736"}),m.jsx("path",{d:"M292.7 270.8L292.2 271.4V272.1L293.1 272.5L293.5 272.3C293.834 272.3 294.067 272.2 294.2 272V271.7L294.7 271.5C294.8 271.4 293.7 270.2 293.6 270.3V270.6L292.7 270.8Z",fill:"#E92736"}),m.jsx("path",{d:"M293.2 273.8H294.2L294.5 273.4L294.8 273.5C295 273.5 294.8 272 294.7 272.1C294.567 272.167 294.5 272.267 294.5 272.4C294.3 272.4 294.167 272.3 294.1 272.1L293.4 272.2C293.2 272.2 293.067 272.267 293 272.4L292.9 272.7V273.6L293.2 273.8Z",fill:"#E92736"}),m.jsx("path",{d:"M211.3 255.3C211.5 255.5 211.3 256.1 211.1 256.3C211 256.5 210.1 256.3 210.1 256.1V255.4C210.233 255.2 210.466 255.033 210.8 254.9C211.066 254.967 211.233 255.1 211.3 255.3ZM211.6 254.1C211.533 254.433 211.6 254.633 211.8 254.7C211.8 254.9 212.5 255 212.8 254.9C212.8 254.9 213.2 253.8 213 253.6C212.866 253.467 212.666 253.433 212.4 253.5L211.6 254.1ZM213.8 253.1V253.7C213.8 253.7 214.3 254.1 214.6 254.1C214.8 254.1 214.9 253.3 214.9 253.1C214.9 252.9 214.9 253 214.7 252.9L213.8 253.1ZM234.7 264.1C234.7 264.4 234.1 264.6 233.9 264.6C233.7 264.6 233.4 263.9 233.5 263.8C233.5 263.667 233.633 263.567 233.9 263.5H234.6L234.7 264.1ZM235.5 263.6C235.366 263.667 235.3 263.833 235.3 264.1C235.3 264.2 235.5 264.7 235.7 264.8C235.9 264.9 236.7 264.4 236.7 264.2L236.4 263.8L235.5 263.6Z
721M237.5 264.4C237.3 264.467 237.166 264.6 237.1 264.8L237.3 265.5C237.633 265.5 237.9 265.4 238.1 265.2V264.9L237.5 264.4ZM292.3 271H291.5C291.3 271 291.3 270.1 291.5 270.1L291.9 270C292.1 270 292.266 270.133 292.4 270.4L292.3 271ZM293.1 271L292.6 271.2V272C292.7 272.1 293.6 272.2 293.6 272C293.8 272 293.7 271.6 293.7 271.6L293.1 271ZM294 272.6H293.5L293.2 273.2C293.2 273.4 293.7 273.5 293.8 273.5C293.933 273.5 294.033 273.433 294.1 273.3L294 272.6Z",fill:"#F7E204"}),m.jsx("path",{d:"M287.658 276.891C288.324 277.629 290.06 277.146 291.535 275.813C293.011 274.48 293.666 272.802 293 272.064C292.333 271.326 290.597 271.809 289.122 273.142C287.647 274.475 286.991 276.154 287.658 276.891Z",fill:"url(#paint2_radial_4989_137735)"}),m.jsx("path",{d:"M228.6 223.4C228.6 223.4 225.6 223.7 223.4 223.4C221.4 223 221.8 217.5 221.7 217.4C221.7 217.2 220.4 215.9 220.7 214.7C220.9 213.5 224.7 210.3 225.3 210.1C225.7 210 226.5 210.3 226.5 210.3C226.5 210.3 227.5 209.3 227.8 209.3C228.1 209.3 228.5 209.9 228.4 210.1C228.2 210.4 226.9 211.1 226.8 211.8C226.8 212.4 226.667 213 226.4 213.6C226 214.2 225.3 215 225.2 215.5C225 216.1 225 216.467 225.2 216.6C225.6 216.8 226.9 216.6 228 216.1L229.7 215.1C229.9 215.1 229.1 216.4 227.9 216.9C226.7 217.4 225.9 218 225.2 217.9C225.2 217.9 224.6 219.5 226.6 219.6C228.7 219.7 229.9 219.2 229.9 219.2L228.6 223.4ZM216.6 236.2C216.6 236.2 218.3 236.8 218.3 238.6C218.3 240.4 216.5 241.9 216.6 245.1C216.6 248.3 217.1 248.3 221.3 251.7C221.4 251.7 222.3 252.7 222.5 253.7C222.8 254.7 223.5 260.7 227.5 260.7C231.5 260.7 232.1 258.2 232.1 258.2L230.4 255.7C230.4 255.7 229 256.1 228.2 255.9C227.797 255.761 227.427 255.538 227.117 255.244C226.806 254.951 226.562 254.595 226.4 254.2C225.9 253.2 225.8 250.9 225.1 249.9C223.4 247.4 220.4 246.9 220.4 244.3C220.4 241.6 222.3 241.3 221.7 238.2C221.1 235.1 217.4 233.5 217.4 233.5L215.9 232.9L215.4 236L216.6 236.2Z",fill:"#A8AC71"}),m.jsx("path",{d:"M227.8 214.1C229.1 213.8 228.3 210.3 228.3 210.3L227.4 211C227.4 211 228 211.8 228 212.6C228 213.4 227.8 214.1 227.8 214.1Z",fill:"#F1A720"}),m.jsx("path",{d:"M230.2 249.2L229.5 248.6C229.1 248.3 226.9 246.6 227.3 241.6C227.7 235.8 236 232.8 236.5 230.5C237.2 227.9 239.1 226.8 232.4 221.6L230.8 223.5L233.6 225.5C233.6 225.5 234.2 225.2 234.2 226C234.2 226.7 233.5 227.4 233.2 228C233.2 228.5 229 231.4 228.7 231.7L226.3 233.7C226.3 233.7 225.2 234.7 224.2 236.9C223.2 239.1 223.7 241.9 223.7 241.9C223.7 241.9 223.7 248.1 230.2 249.2Z",fill:"#A8AC71"}),m.jsx("path",{d:"M226.2 252.4L226.6 254.6L225.3 255.1H224.7L224.3 255.2L223.3 256.2H223L222.8 255.5L222.7 254.4L223.9 254.9H224.4L224.7 254.8L225.2 253.6L226.2 252.4ZM222.2 252.8L221.7 252L220.9 251.3L221.9 250.8H222.9L222.7 252L222.2 252.8ZM224.5 249.3C224.5 249.3 225.1 249.6 225.3 250.1L225.8 251.1L224.2 251L223.1 250.6L223.8 249.6L224.5 249.3ZM223.9 258.9C223.9 258.9 223.6 258.7 223.4 258.2L223.1 256.9L224.1 256.7L225.3 257.2H225.6L225.3 257.8L224.2 258.8L223.9 258.9ZM227.9 255.6C227.9 255.6 227.1 255.3 226.9 254.9L226.7 254.5L226.4 255.7L226 256.9L226.1 257.1L227.1 256.8L227.7 256.1L227.9 255.6ZM224.2 259.4L225.2 260L226.2 260.4L226.8 259.9L227.2 258.9L227.3 258.8L224.8 259L224.2 259.4ZM227.7 258.4L229.8 257.2L229.9 256.1L229.5 255.8H228.3L228 257.2L227.7 258.5V258.4ZM226.2 260.4C226.2 260.4 227.7 261.1 230.2 260.2C231.267 259.6 231.734 259.267 231.6 259.2L230.6 258.8L229.6 259.6L226.2 260.4ZM224.2 244.2L223.9 243.2L223.8 242.2L224.5 242.6L225.6 243.4L224.9 244L224.2 244.2ZM226 247.2L225.3 246.4L224.8 245.4L225.6 245.6L226.5 246.1L226.1 247.2H226Z",fill:"#78732E"}),m.jsx("path",{d:"M221.3 213.7C221.1 214.2 220.9 215.1 221.6 215.3C222 215.3 223.6 215.3 225.3 213.3C226.1 212.3 226.1 211.3 226.1 211.3L226.5 210.3C226.5 210.3 225.8 209.8 224.7 210.5L221.3 213.7Z",fill:"#C6C7A6"}),m.jsx("path",{d:"M226 211.2C226.166 211.2 226.3 211.066 226.3 210.9C226.3 210.734 226.166 210.6 226 210.6C225.835 210.6 225.7 210.734 225.7 210.9C225.7 211.066 225.835 211.2 226 211.2Z",fill:"#1C242F"}),m.jsx("path",{d:"M223.8 211.2C223 211.8 222.4 212.5 222.4 212.5C222.4 212.5 223.5 212.2 224.4 211.4C225.026 210.918 225.817 210.703 226.6 210.8C226.734 210.733 226.734 210.6 226.6 210.4C226.3 210.2 225.5 210.1 225.3 210.2C225.3 210.2 224.5 210.6 223.8 211.2Z",fill:"#A8AC71"}),m.jsx("path",{d:"M227.3 243.6V241.8L226.6 242.4L225.9 243.4L226.9 243.7L227.3 243.6ZM223.7 241.6V239.7C223.7 238.8 224.1 237.2 224.1 237.2L224.5 238.3L225.8 240.3L226.2 240.6L225.2 241.3L224 241.7L223.7 241.6ZM227.3 241L227.5 240.2L227.9 239.2L226.8 240.2L226.3 240.6L226.9 241.1L227.3 241ZM224.3 236.3C224.3 236.3 224.5 235.7 225 235L226.1 233.5L226.6 235.5L226.9 237.1V237.4L226.4 237.6C226.3 237.6 225.1 237.6 224.9 237.3L224.3 236.3ZM228.1 238.5L228.8 237.8L229.6 237L227 237.5L227.4 238.3L228.1 238.5ZM226.6 233.2L227.5 232.4C228.2 231.7 228.5 231.8 228.5 231.8L228.8 234.6L227.5 234.2L226.6 233.2ZM229.8 237L231.4 235.4L228.8 234.6L229.3 236.4L229.8 237ZM230.9 232.8L231.1 230.1L229.9 230.9L228.9 231.7L229.2 232.1L230.2 232.7L230.9 232.8ZM233.2 230.2V228.2L232.3 229.1L231.7 229.7L232.4 230.1L233.2 230.2ZM234.2 233L235.4 232L236.6 230.7L233.3 230.4L233.4 231.8L234.2 233ZM226.4 222V223.5H229.1L228.4 222.5L227.6 222L226.8 221.2L226.4 222ZM231.8 235L233 234L234 233.2L231.3 232.9L231.4 234.7L231.8 235ZM236.8 230.2C236.8 230.2 237.1 229.2 237.
7211 228.2L236.9 226.7L234.9 228L235.2 229L236 229.9L236.8 230.2Z",fill:"#78732E"}),m.jsx("path",{d:"M233.4 227.8C233.4 227.8 234 227.1 234.1 226.7V226.4H235.7L236.6 226.5L236.7 226.6L236 227.4L235 228L233.8 228.1L233.4 227.8ZM236.6 226.3L235.6 224.6L235 223.8L234.2 226V226.3H236.6Z",fill:"#78732E"}),m.jsx("path",{d:"M217.3 241.8L217 242.4C217 242.4 218 241.8 218.9 241.9C219.8 242 220.6 242.9 220.6 242.9L220.8 242.2C220.8 242.2 219.7 241.2 219 241.1C218.3 241.1 217.3 241.8 217.3 241.8ZM217.8 237.1L218.1 237.4C218.1 237.5 218.1 236.7 219.2 236.2C220.2 235.8 220.9 236.2 220.9 236.2C220.9 236.2 220.7 235.5 220.2 235.4C219.666 235.267 219.166 235.4 218.7 235.8C218.1 236.2 217.8 237.1 217.8 237.1ZM221.4 240.6C221.4 240.6 220.9 239.6 220 239.3C219.2 239.1 218.1 239.8 218.1 239.8L217.9 240.3C217.9 240.3 219.1 239.7 219.9 240C220.8 240.4 221.2 241.4 221.2 241.4L221.4 240.6ZM217.4 236.6L217.7 236.9C217.7 236.9 217.5 235.9 218.1 235.2L219 234.4L218.5 234.2C218.5 234.2 217.8 234.7 217.5 235.2C217.3 235.8 217.266 236.233 217.4 236.5V236.6ZM216.9 234.6C217.2 234.1 217.9 233.9 217.9 233.9L217.6 233.7H217.3C217.3 233.7 216.9 233.9 216.6 234.5C216.3 235.1 216.3 236.1 216.3 236.1L216.8 236.3C216.8 236.3 216.7 235.3 216.9 234.7V234.6ZM223.2 219.4C223.933 219.133 224.333 219.033 224.4 219.1C224.5 219.2 223.4 220.1 223.9 221.4C223.3 222.4 223.1 223.3 223.1 223.3H223.7L224 221.8C224.363 222.474 224.876 223.056 225.5 223.5H226.3C226.3 223.5 226.3 222.5 226.8 221.5C227.223 222.029 227.773 222.442 228.4 222.7V222.4C228.4 222.4 227.5 221.9 227 221.2V221.1C227.6 220.1 228.4 219.8 228.4 219.8L229 220.2L229.1 220.1L228.7 219.5H228.2L226.8 220.9L226.2 219.6H225.8C225.8 219.6 225 219.6 224.2 220.9C224.1 219.9 225.2 218.9 225.2 218.9L225.1 218.6L223.1 219C222.4 219.3 221.9 220 221.9 220V220.6C221.9 220.6 222.6 219.8 223.2 219.4ZM224.4 221.1C224.9 220.4 225.9 219.9 225.9 219.9C225.9 219.9 225.9 220.5 226.6 221.2C226.2 222 226 223.1 226 223.1C226 223.1 225.1 222.5 224.4 221.5L224.3 221.2V221.1H224.4ZM218.4 238V238.6C218.4 238.6 219 237.9 219.9 237.9C220.8 237.9 221.7 238.6 221.7 238.6V237.7C221.5 237.7 220.7 237.2 220 237.2C219.2 237.2 218.3 238 218.3 238H218.4ZM235.4 229L235.1 228.2L235.5 228L236.9 226.7L236.6 226.3H235.3L234.2 226.2L234.6 224.8L235 223.7L234.6 223.3C234.6 223.3 234.7 223.7 233.9 223.8L231.7 223.1V223.5L233.7 224L234.7 223.8L234.2 224.8L234 225.6L234.2 225.7L234.1 226.4L235.2 226.5L236.6 226.6C236.6 226.6 235.9 227.4 235.2 227.7L234.9 227.8L234.1 226.6V227L234.6 228L233.4 227.8L233.1 228.1V230.1L231.7 229.7L231.4 229.9L231.1 230.1C231.1 230.1 230.8 231.3 230.8 232.7C229.6 232.4 228.9 231.7 228.9 231.7L228.6 231.9C228.6 231.9 228.4 233.1 228.7 234.5C227.948 234.263 227.263 233.852 226.7 233.3L226.3 233.7L226.7 237.2L226.8 237.5H226.2C225.2 237.5 224.4 236.4 224.4 236.4L224.1 237.2C224.1 237.2 224.5 239.4 225.7 240.4L226 240.6C225 241.4 223.7 241.6 223.7 241.6L223.8 242.2L225.5 243.5L224.2 244.2L224.4 244.6L225.8 243.6L227.3 244V243.6L226.1 243.4V243.3C226.6 242.9 227.3 241.8 227.3 241.8V241C227.3 241 226.9 241 226.4 240.6C227.9 239.6 227.9 239.1 227.9 239.1L228.2 238.6C228.2 238.6 227.7 238.4 227.3 237.6L229.7 237.1L229.9 236.9C229.9 236.9 229.3 236 229 234.9L231.4 235.4L231.8 235C231.8 235 231.5 234.1 231.4 233L233.9 233.3L234.2 233C234.2 233 233.4 231.5 233.4 230.7V230.6H236.6L236.8 230.2C236.8 230.2 235.8 229.5 235.4 229ZM227 241.4C227 241.4 226.7 242.2 226 243L225.7 243.2L225.3 243C224.566 242.4 224.233 242.067 224.3 242L226.3 240.7L227 241.4ZM227.7 238.9L226.2 240.4L225.9 240C225.2 239.1 224.3 238.4 224.4 237C224.4 237 224.9 238 226.1 237.9L226.9 237.7C227.3 238.5 227.566 238.9 227.7 238.9ZM229.3 236.9L227.3 237.4L227.1 237.1C226.7 235.8 226.7 233.9 226.7 233.9C226.7 233.9 227.6 234.5 228.7 234.8L229.3 236.9ZM229 234.5C228.8 233.4 229 232.2 229 232.2C229 232.2 229.7 232.8 230.9 233L231.1 234.7L229 234.5ZM233.6 232.7C233.6 232.7 232.9 233 231.4 232.8V230L233.2 230.5V230.6L233.6 232.7ZM233.6 230.2H233.4V228.1C233.4 228.1 234.2 228.3 234.8 228.2C234.8 228.467 234.933 228.8 235.2 229.2C235.5 229.8 236.1 230.2 236.1 230.2C236.1 230.2 234.2 230.4 233.5 230.2H233.6ZM227.6 245.2L227.4 244.7C227.4 244.7 226.7 245.2 226.4 245.8H226.2L224.6 245.1L224.8 245.4L226.3 246L226 247.2L226.2 247.5C226.2 247.5 226.2 246.7 226.6 246.1H227.6L227.4 246.8L227.1 248L227.4 248.2H229.1L228.8 247.9H227.3L227.6 246.9L227.8 246.3L227.6 245.7L226.7 245.8L227.5 245.1L227.6 245.2ZM218.5 244.1C219.161 244.129 219.793 244.375 220.3 244.8V244.3C220.3 244.3 219.5 243.3 218.6 243.3C217.6 243.3 216.6 244.2 216.6 244.2V245.2C216.6 245.2 217.5 244.1 218.5 244.1ZM229.1 259.6C228.1 260.1 226.9 260.1 226.9 260.1L227.6 258.8C229.6 258.3 230 256.9 230 256.9L229.9 256.4C229.9 256.4 229.4 257.7 227.7 258.4L228.3 255.8L227.8 255.6C227.8 255.6 227 256.6 226.2 256.9C226.539 256.212 226.742 255.465 226.8 254.7L226.6 254.3C226.6 254.3 226 254.8 225.2 254.9H224.7C225.2 254.3 226.1 252.4 226.1 252.4L226 252C226 252 225.3 253.7 224.6 254.5L224.3 254.8L222.6 254V254.3C222.6 254.3 223.3 254.8 224.1 255.1L223.1 256.1V256.9L225.5 257.2C225.083 257.866 224.539 258.444 223.9 258.9L224.2 259.4C224.2 259.4 225.3 259.4 227.2 258.9L226.2 260.4C226.1 260.4 228 260.5 229.2 259.9C230.4 259.3 230.8 258.7 230.8 258.7L230.4 258.3C230.4 258.3 230.2 259.2 229.1 259.6Z
721M223.6 256.3L224.6 255.2C225.8 255.5 226.2 255.1 226.2 255.1C226.2 255.1 226.4 255.8 225.7 256.9L223.6 256.3ZM224.7 258.8L225.7 257.5L226 257.2C227.2 257.2 227.9 256.2 227.9 256.2C227.9 256.2 228 257.2 227.5 258.4C225.9 259 224.7 258.8 224.7 258.8ZM223.2 250.9C224.4 251 225.8 251.5 225.8 251.5L225.7 250.9L223.4 250.5C223.8 249.6 224.6 249.2 224.6 249.2L224.2 249C224.2 249 223.8 249 223.2 250.2L223 250.4H222.7C221.7 250.4 220.8 251 220.8 251L221 251.3C221 251.3 221.9 250.9 222.8 250.9L222.2 252.9L222.4 253.4L223.2 250.9ZM220.8 246L220.6 245.4C220.6 245.4 219.3 245 218.4 245.4C217.5 245.8 216.8 246.9 216.8 246.9L217.2 247.7C217.2 247.7 217.8 246.5 218.7 246.2C219.6 245.9 220.8 246 220.8 246ZM223.2 247.9L222.4 247.5C222.4 247.5 221.1 247.8 220.6 248.3C220.1 248.8 219.7 250 219.9 250.3C220.1 250.7 220.266 250.9 220.4 250.9C220.6 250.9 220.6 249.6 221.3 249C222 248.4 223.2 247.9 223.2 247.9ZM220.2 247.5C220.6 247 221.6 246.8 221.6 246.8L221.1 246.3C221.1 246.3 219.9 246.5 219.3 247L217.9 248.7L218.6 249.4L220.1 247.5H220.2ZM224.2 211.7C224.9 210.9 225.5 210.9 225.7 210.9H226.3L225.6 212.9C225.4 213.7 225.1 213.9 224.8 214.4C224.333 215.067 224 215.833 223.8 216.7C223.8 217.5 223.966 217.933 224.3 218C224.566 217.867 224.733 217.7 224.8 217.5C224.8 217.2 224.6 217.5 224.4 217.5C224.2 217.5 224.4 217.2 224.2 216.7C224.2 216.2 224.8 214.9 225 214.5C225.4 214.1 225.7 213.567 225.9 212.9C225.9 212.2 226.4 210.9 226.4 210.9C226.4 210.767 226.066 210.7 225.4 210.7C225.098 210.727 224.806 210.821 224.546 210.977C224.286 211.133 224.065 211.346 223.9 211.6C223.5 212.1 222.5 212.5 222.5 212.5C222.5 212.5 223.6 212.5 224.2 211.7Z",fill:"white"}),m.jsx("path",{d:"M228.2 219.6H226.2L226.7 221.1L228.2 219.6ZM225.8 219.6L225.4 219.2L225.1 218.9L224.4 219.4L224 220.9L224.2 221.1L225.8 219.5V219.6ZM225.5 223.6L224.1 221.4L223.3 223.1L223.7 223.3L224.7 223.4L225.5 223.5V223.6ZM231.5 259.3H231.4C230.276 260.06 228.956 260.477 227.6 260.5C226.733 260.5 225.833 260.267 224.9 259.8C224.346 259.445 223.925 258.918 223.7 258.3C223.3 257.367 223.033 256.333 222.9 255.2C222.746 254.149 222.408 253.133 221.9 252.2C221.233 251.267 220.233 250.4 218.9 249.6C218.267 249.086 217.746 248.449 217.368 247.727C216.989 247.004 216.762 246.213 216.7 245.4V244.8C216.747 243.551 217.053 242.324 217.6 241.2C218.133 240.133 218.433 239.2 218.5 238.4V238C218.233 237.4 217.833 236.9 217.3 236.5L216.3 235.9L215.5 235.6V235.9L216.2 236.1L217.2 236.8C217.733 237.2 218.067 237.633 218.2 238.1V238.4C218.2 239.067 217.9 239.967 217.3 241.1C216.74 242.255 216.433 243.517 216.4 244.8C216.368 245.765 216.57 246.724 216.988 247.594C217.405 248.464 218.027 249.221 218.8 249.8C220 250.8 221.2 251.4 221.8 252.4C222.267 253.467 222.6 254.8 222.8 256.4L223.4 258.4C223.667 259.067 224.133 259.6 224.8 260C225.653 260.493 226.615 260.767 227.6 260.8C229.9 260.8 231.6 259.5 231.6 259.5L231.5 259.3Z",fill:"#78732E"}),m.jsx("path",{d:"M229.7 255.4L228.7 255.6C228.172 255.593 227.669 255.377 227.3 255C226.767 254.467 226.467 253.867 226.4 253.2C226.333 252.533 226.1 251.633 225.7 250.5C225.033 249.433 224.067 248.467 222.8 247.6C221.8 246.7 220.7 245.8 220.5 244.9V244.4C220.5 243.6 220.7 242.733 221.1 241.8C221.5 240.867 221.767 239.8 221.9 238.6V238C221.7 236.4 220.4 235.2 219.3 234.4L217 233.3V233.5H217.1C217.5 233.7 218.6 234.2 219.6 235C220.667 235.667 221.333 236.667 221.6 238V238.6C221.6 239.8 221.367 240.833 220.9 241.7C220.433 242.567 220.2 243.467 220.2 244.4V244.9C220.667 245.967 221.5 246.933 222.7 247.8C223.8 248.7 225 249.6 225.4 250.6C225.8 251.733 226.033 252.6 226.1 253.2C226.236 253.948 226.583 254.642 227.1 255.2C227.7 255.667 228.233 255.9 228.7 255.9L229.9 255.6L229.7 255.4Z",fill:"#78732E"}),m.jsx("path",{d:"M237 249.3C237 249.3 238.5 249.6 238.4 250.7C238.4 251.9 237.8 253.4 237.8 253.4L235.8 251.7L236.9 250.7L237.3 250.2L237.1 249.2L237 249.3Z",fill:"#A8AC71"}),m.jsx("path",{d:"M213.1 235.6C213.1 235.6 211.7 236.1 211.4 235.5C211.267 234.9 211.233 234.5 211.3 234.3C211.3 234.2 210.4 234.1 210.5 233.3C210.6 232.5 211.5 232.6 211.8 232.6C212 232.6 212.1 231.4 212.8 231.4C213.5 231.4 213.8 232.3 213.8 232.3L213.1 235.6Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M214.6 236C214.6 236 213.5 236.6 213.1 236C212.7 235.4 213.1 234.7 213 234.6C212.8 234.5 212.1 234.2 212.3 233.6C212.3 232.8 213.1 233.1 213.3 232.9C213.6 232.8 213.8 231.8 214.6 231.9C2
72115.3 232.1 215.4 232.7 215.4 232.7L214.6 236Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M216.6 236.3C216.6 236.3 216.3 237 215.4 236.8C214.5 236.6 214.9 235.5 214.7 235.3C214.5 235.1 214 234.9 214.1 234.1C214.2 233.3 215 233.5 215.3 233.4C215.6 233.3 215.8 232.1 216.3 232.3C216.8 232.5 217.5 233.1 217.3 233.4C217.3 233.4 216.2 233.8 216 234.6C215.8 235.4 216.6 236.3 216.6 236.3Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M235 249L233.2 246.9L231.4 244.7L229.6 243.8L228.4 241.9V239.7L228.8 238.4L229.5 237.4C229.5 237.4 225.8 238.8 227.7 245.9C228.5 248.9 230.5 249.3 230.5 249.3L233.9 249.1L234.9 249H235Z",fill:"#AF7029"}),m.jsx("path",{d:"M233.3 225.4C233.633 225.4 233.833 225.467 233.9 225.6L234 226.2V226.4L234.1 226.5C232.8 229.2 230.2 230.5 227.9 232.1C226.705 232.925 225.685 233.979 224.9 235.2C223.912 236.86 223.425 238.77 223.5 240.7C223.6 244.7 225.1 247 226.8 248.1C228.051 248.917 229.506 249.367 231 249.4H231.3L232.5 249.3L234.9 249.1L236.3 249.2C236.7 249.2 236.933 249.3 237 249.5L237.2 249.9C237.2 250.233 237.033 250.567 236.7 250.9L236 251.4V251.7L236.9 251.1C237.233 250.767 237.4 250.367 237.4 249.9L237.2 249.4C237 249.2 236.7 249.067 236.3 249L234.9 248.9L231.3 249.1H231.1C230.4 249.1 228.6 249.1 227 247.9C225.4 246.9 223.9 244.7 223.8 240.7V240.4C223.8 238.267 224.2 236.6 225 235.4C226.2 233.4 228 232.4 229.8 231.1C231.6 229.8 233.3 228.7 234.2 226.6C235.1 224.5 234.2 226.4 234.2 226.2L234.1 225.5C233.966 225.3 233.7 225.167 233.3 225.1V225.4Z",fill:"#816C2A"}),m.jsx("path",{d:"M238.3 250.1C238.3 250.1 237.3 251.7 237.1 251.8C236.9 251.9 237.9 252 238.1 252.4L237.9 252.8C237.9 252.8 236.9 252.1 236.4 252.1L236.3 251.5C236.3 251.5 236.8 251.3 237.2 250.9C237.5 250.6 237.9 249.8 237.9 249.6L238.3 250.1Z",fill:"white"}),m.jsx("path",{d:"M241.7 251.2L239.5 251.8L238.4 251.1C238.4 251.1 238.4 250.2 238 249.8C237.534 249.467 237.1 249.233 236.7 249.1C236.3 248.9 234.7 248.9 234.7 248.9L230.7 244.6L232.2 244.8L234.6 244.5L236.7 244.3L237.9 244.5L239.1 244.8L239.7 245.4L240.4 246L241.1 247L241.5 248.3L241.7 249.6V251.2Z",fill:"#FCCA3D"}),m.jsx("path",{d:"M241.8 251C241.8 251 241 251.3 240 251.3C239 251.3 238.4 251.1 238.4 251.1L238.2 251.8L237.8 252.8V255.4L239.9 255.8L241 255.4L241.6 252.6L241.7 251.1L241.8 251Z",fill:"#AF7029"}),m.jsx("path",{d:"M241.2 250V251H241.7V250.2L241.2 250ZM239.2 226L239 224.3L238.3 223.1L237.4 221.9L236.5 220.9L236 220.4L235.8 220.1L233.5 220.2L232.3 221.6C232.3 221.6 235.3 223.8 236.6 226.2C237.666 226.6 238.4 227.067 238.8 227.6L238.9 227.4L239.2 226Z",fill:"#FCCA3D"}),m.jsx("path",{d:"M237 228C237 229.667 236.8 230.667 236.4 231L237.8 229.4L238.8 227.6C238.179 226.978 237.428 226.5 236.6 226.2C236.867 226.8 237 227.4 237 228Z",fill:"#AF7029"}),m.jsx("path",{d:"M240.2 254.3L239.1 253L238.1 252.3L237.9 252.5H238L239 253.2L240 254.5L240.2 254.3Z",fill:"#816C2A"}),m.jsx("path",{d:"M241.6 252.4C241.6 252.4 241.4 253.2 240.6 253.9C239.8 254.6 238.8 255 238.8 255L241 255.9L242.5 254.5L241.5 252.4H241.6Z",fill:"#6F5B24"}),m.jsx("path",{d:"M241.9 254.3L241.7 254.5L241.3 254.9L241 255.3L241.6 252.9L242 253.6V254L241.9 254.3Z",fill:"#404118"}),m.jsx("path",{d:"M228.6 223.4C228.6 223.4 225.6 223.7 223.4 223.4C221.4 223 221.8 217.5 221.7 217.4C221.7 217.2 220.4 215.9 220.7 214.7C220.9 213.5 224.7 210.3 225.3 210.1C225.7 210 226.5 210.3 226.5 210.3C226.5 210.3 227.5 209.3 227.8 209.3C228.1 209.3 228.5 209.9 228.4 210.1C228.2 210.4 226.9 211.1 226.8 211.8C226.8 212.4 226.667 213 226.4 213.6C226 214.2 225.3 215 225.2 215.5C225 216.1 225 216.467 225.2 216.6C225.6 216.8 226.9 216.6 228 216.1L229.7 215.1C229.9 215.1 229.1 216.4 227.9 216.9C226.7 217.4 225.9 218 225.2 217.9C225.2 217.9 224.6 219.5 226.6 219.6C228.7 219.7 229.9 219.2 229.9 219.2L228.6 223.4Z",stroke:"#78732E",strokeWidth:"0.2"}),m.jsx("path",{d:"M255 200.5C255 200.5 249.3 199.5 249.4 204.1C249.4 205.433 249.9 206.2 250.9 206.4C252.1 206.7 254.5 206.9 256.5 208.7C258.5 210.5 258.7 211.8 258.7 212.9C258.7 213.9 258.2 214.9 258.2 214.9L259.5 221.1L260.7 225.7L264.5 223.5L266.8 216.7L263.9 204.5L255 200.5Z",fill:"#AB6D29",stroke:"#4D2A15",strokeWidth:"0.3"}),m.jsx("path",{d:"M260.5 224C260.5 224 262.5 223.2 263 221.6C263 221.2 261 219.3 261 219.3L262.5 220.3C263.1 220.833 263.434 221.033 263.5 220.9C263.8 220.9 264.7 218.8 264.3 218.3C263.9 217.8 263.4 216.8 262.6 216.3C261.8 215.8 260.7 215.8 260.7 215.8C260.7 215.8 262.2 215.3 263 215.8C263.7 216.1 263.8 216.6 263.9 216.4C263.905 215.379 263.736 214.364 263.4 213.4C2
72163.134 212.733 262.6 212.367 261.8 212.3C260.8 212.1 259.9 212.2 259.9 212.2C259.9 212.2 261.2 211.4 262.2 211.7C263.2 211.9 263.2 212.4 263.2 212.3L262.5 210C262.056 209.376 261.474 208.863 260.8 208.5L259.4 208.3H258.9C258.9 208.3 259.6 207.8 260.6 207.9C261.6 208 261.6 208.3 261.7 208.3C261.9 208.3 261.667 208.1 261 207.7L257.6 206.1H255.1C255.1 206.1 255.1 205.4 255.8 205.3C256.467 205.3 256.767 205.267 256.7 205.2C256.7 205 254.5 204.5 254.5 204.5H252.8L250.4 204.8L250.9 204.1C251.3 203.833 251.667 203.667 252 203.6C252.9 203.4 251.6 202.7 251.6 202.7L252.2 201.7L255.4 201.9L261.9 205.8L265 208.4L267 213.4L266.4 222L262 225.6L260 225.8L260.5 224Z",fill:"#4D2A15"}),m.jsx("path",{d:"M254.8 202.7C254.8 202.7 254.6 202.1 254.6 201.3V200.6C254.6 200.6 252.6 200.3 251.1 201.5C249.5 202.7 250.4 204.8 250.4 204.8C250.4 204.8 251.1 204.2 251.9 203.8C252.8 203.5 254.3 203.6 254.3 203.6C254.5 203.4 254 202.8 253.4 202.7L251.7 202.6C251.7 202.6 252.4 202.1 253.5 202.2C254.5 202.4 254.933 202.567 254.8 202.7Z",fill:"#D2A567"}),m.jsx("path",{d:"M261.3 224.7L259.9 225.2L260.8 231.2L266.5 240.9L269.5 240.4L270.5 238.6L271.2 238.9C271.6 239.3 272.7 241.2 273.6 241.6C274.6 241.9 275 241.8 275.9 242.5C276.8 243.2 279.8 247.7 279.9 247.8C280.1 248 279.7 245.9 279.7 245.9L278.8 243.2L277.7 241.3L277.5 240.8H279L280 241.4L281.5 242.7L282.3 243.6L282.7 244.6L282.9 245.4L283.3 246.7L284.1 248.4L285.1 250.1L285.4 249.5L284.9 247.5L283.4 242.6L282.4 241L284 242C284.4 242 285.5 243.8 285.5 243.8L286.2 245.5L286.7 247.1L287.1 248.5L287.6 250L288.5 249.5L288.3 248.4L287.5 245L287.2 241.4C287.2 241.4 287.6 241.4 288.2 242C288.8 242.6 289.2 243.9 289.2 243.9L289.5 247.1L290 250.1L291 253.1L292 255.1L292.7 256.1V254.6L291.5 241.8L291.6 241.3C291.6 241.3 291.8 241.2 292.2 241.8L293.1 243.3L293.4 245.3L293.6 246.7L293.9 249.3L294.2 252.1L295.5 255.1L296.2 256.8L296.6 254.8L296 241.2L296.3 240.8L297.3 241.8L297.9 242.6L298.4 245.6L298.7 254.3L299 256.5L301.6 233.9L303.1 233.6L303.3 233.1L302.2 232.3L299.6 228.3L297.9 224.4L294.9 218.8L289.6 212.4L285.5 209L284 208L284.2 207.1L285.1 205.7H284.3L282.5 206L280.7 205.4L277.2 203L273.5 201.2L271.3 200.4L266 199.1L260.7 198.4H258.4L256.2 198.7C256.2 198.7 255.2 199.2 254.8 199.9C254.466 200.367 254.366 201.067 254.5 202C254.5 202.867 255.233 203.567 256.7 204.1C258.2 204.7 261.7 207.1 261.7 207.1L263.3 208.7L263.9 209.5L264 210.1L265.2 219.1L262.9 223.9L261.3 224.7Z",fill:"#8F4620"}),m.jsx("path",{d:"M267 238.6C267 238.6 268 240.2 269.3 238.9C270.7 237.7 268.7 234.1 268.8 233.9C268.9 233.7 269.4 233.6 269.4 233.6L270.4 235.5C270.4 235.5 271 236.5 270.7 238C270.5 239.6 269 241 269 241L267.3 240.5L267 238.6Z",fill:"#AB6D29"}),m.jsx("path",{d:"M300.2 259.4L299 255.8L298.6 253L298.3 245.5C298.2 244.5 298.3 243.2 298.1 243L296.8 241.2L296.3 240.7L296.6 240.4C296.6 240.4 297.1 240.9 297.2 240.7C297.334 240.367 297.167 239.167 296.7 237.1C296 234 293.7 230.4 293.7 230.4L293.9 230.7L294.6 231.4L296.1 232.6L299.4 233.8L301.1 234.1L302.3 236.4C302.3 236.4 303.1 240.3 303 242.3C303 244.3 302.9 245.9 302.1 247.9C301.3 249.9 301.1 256.1 301.1 257.1L300.6 259.1L300.2 259.4Z",fill:"#4D2A15"}),m.jsx("path",{d:"M300.2 249C300.2 249 300.9 248.1 301.2 247C301.5 246 301.6 237.1 300.6 236C299.658 235.146 298.527 234.529 297.3 234.2L298.1 237.1L298.8 238.1L299.3 239.6C299.3 240.3 300 242.1 300.1 244.4L300.2 249Z",fill:"#8F4620"}),m.jsx("path",{d:"M295.4 254.4C295.4 254.4 295.9 250.3 295.7 247.3C295.5 244.3 295.2 243.9 294.9 243.3C294.062 241.707 293.392 240.031 292.9 238.3C292.234 235.633 291.7 233.967 291.3 233.3C290.8 232.8 289.9 231.7 289.7 232C289.5 232.3 289.5 232.9 289.5 232.9L288.2 232.6L287.9 231.8L288.3 230.5V229.9L288.1 229L289.7 230.3L293 232.5L294.7 239.5L296.2 243.7L296.4 250.9L296.3 257.3L295.4 254.4ZM297.4 234.7L298.7 235.7C299.2 236.1 300.2 236.7 300 236.7L298.4 236.1L297.4 235.4V234.7Z",fill:"#4D2A15"}),m.jsx("path",{d:"M291 252.8C291 252.8 291.6 251.4 291.5 249.5C291.4 247.6 290.5 243.2 290.2 242.7C289.9 242.2 288.6 241.3 287.5 238.7C286.3 236.3 286.4 235.7 285.6 234.9L284 232.9L284.3 230.2L287.1 231.7L288.4 232.3L289.8 239.3L291.1 241.3L291.7 244L292.4 250.5L292.7 255.7L292.5 256.2L291 252.8ZM287.6 249.8C287.6 249.8 287.6 247.8 287.2 246C286.733 244.067 286.233 242.8 285.7 242.2C284.479 240.972 283.374 239.633 282.4 238.2L279.3 234.2V231.5L281 232.7L282.8 233.7L283.6 236.7L284.6 238.8L286 240.8L287 241.6L287.5 244.8L287.8 246.6L288.6 249.2L288.3 250.5L287.6 249.8ZM285.2 249.8L284.4 249.1C284.4 249.1 284.9 248.6 284.7 247.6L283.7 244.6C283.1 243.1 283.1 243 282.8 242.7L279.3 239.5L276.3 236.9C275.433 236.433 274.967 236.233 274.9 236.3L274.5 233.1C274.5 233.1 275.5 234.5 276.2 234.7L277.8 235.3L280.1 239.3L280.9 240.3L282.9 242L283.8 243.7L284.4 245.7L285.2 248.4L285.4 250.1L285.2 249.8ZM280.8 249C280.8 249 279.5 247.5 279.2 246.5C279 245.5 279.4 245.5 279 244.4C278.313 242.943 277.283 241.674 276 240.7C274.9 239.7 273.3 238.4 273.4 237.7C273.467 237.033 273.567 236.767 273.7 236.9L274.4 237.5L277.9 241.3L279 243.3L279.9 245.8L280.4 246.9L280.9 248.4L280.8 249ZM293.6 230.4C293.6 230.4 296.1 233.4 296.7 230.6C297 229.4 295.9 227 295.9 227L292.9 222L288.2 216.2L285.4 214.9L286.4 216.5C286.4 216.5 288.4 218.5 291.1 223.2C293.8 227.8 293.2 230.2 293.2 230.2L293.6 230.4ZM279.4 212C279.4 212 284.3 216.2 287.4 220.7C290.5 225.2 291.8 228.2 291.1 228.7C290.4 229.4 288.4 228.4 287.6 227.2C286.8 225.9 286.1 223.7 283.2 220.3C280.3 216.9 278.8 216.4 278.8 216.4L276.6 213L279.4 212ZM276.8 222C276.8 222 279.8 224.4 281.5 226.3L284.3 229.7L285.4 230.8C285.4 230.8 284.8 229.6 285.2 229.2C285.6 228.8 286 229 286 229L276.8 219.3V222ZM276.2 222.2C276.2 222.2 277.2 224 278.7 225.5L281.9 228.6L282.6 231C282.6 231 278.4 227.8 278.4 228.6C278.581 229.455 278.92 230.269 279.4 231L278.1 230.3L276.3 227.8L275.3 225.5L274.1 222.5L276.2 222.2Z",fill:"#4D2A15"}),m.jsx("path",{d:"M263.6 232.2C263.6 232.2 265.8 234.2 267 232.2C268.2 230.3 267.2 228.2 267.2 228.2C267.2 228.2 270.3 232.7 271.2 228.4C271.3 227.6 269.3 224.7 269.3 224.7L270 224L271.
7216 226.6C271.6 226.6 273.1 226 273.1 224.2C273.1 222.4 271.5 220 271.5 220L273 221.6C273 221.6 275.8 221.6 275.9 219.9C275.9 218.2 273.5 216.4 273.5 216.4C273.5 216.4 275.5 216.5 275.5 215.4C275.4 214.2 272.8 213.4 272.7 212.7C272.6 212 273.5 210.8 274.7 211.5C275.9 212.2 277.5 212.7 278.2 211.4C278.9 210.1 278.2 209.8 278.2 209.8L276.5 209.4L273.7 208L271.6 207.2L269.4 206.9L270.2 208.6L270.8 213.1V215.2L271.2 219.8L270.2 223.6L269.5 224.3L269.1 224.8L268.1 226.8L266.9 228.3L265.2 230.5L263.6 232.2Z",fill:"#4D2A15"}),m.jsx("path",{d:"M279 240.7C279 240.7 278.5 239.4 277.3 238.4C276.1 237.4 274.3 237.4 274.3 237.4L277.5 240.8L279 240.7ZM283.5 241.5C283.5 241.5 282.5 239.5 281.3 238.2C280.1 236.9 279.3 235.2 278.9 235.2L278.4 235.3L278.7 237.9L280.9 240.1C280.9 240.1 282.9 241.6 283.5 241.5ZM287.2 241.3C287.2 241.3 286.7 238.9 285.5 236.6C284.3 234.3 282.9 233.3 282.9 233.3L283.2 235.8L284.2 238.2L285.9 240.6L287.2 241.3ZM290.2 240C290.2 240 291.1 235 290.3 233.7C289.793 232.888 289.013 232.285 288.1 232L287.6 232.7L288.1 236.3L289.2 239L290.2 240ZM293.2 231.7C293.2 231.7 293.9 232.1 294.8 233.7C295.7 235.3 296.9 240.4 296.9 240.7C296.9 241 296.4 240.8 296.3 240.7L293.3 236L292.7 231.7H293.2Z",fill:"#AB6D29"}),m.jsx("path",{d:"M272.3 237.5C272.3 237.5 273.9 237.1 273.9 236.5C273.9 235.9 271.9 234.9 272.1 234C272.2 233.6 273.7 234.1 273.8 233.8C274 233.5 272.3 230.8 272.8 230.2C273.3 229.6 274.8 233.1 274.8 233.1C274.8 233.1 275.6 234.7 275.3 235.6C274.3 238.6 272.3 237.5 272.3 237.5ZM276 233.9C276 233.7 278.5 234.2 278.5 234C278.6 233.5 276.3 231.7 276.3 231.7C276.3 231.7 275.8 230.7 276 230.6C276.1 230.4 277.6 230.7 277.7 230.6C277.7 230.3 276 228 276 227.6C276 227.2 276.5 227.6 276.5 227.6C276.5 227.6 277.8 229 278.5 230.1C279.3 231.3 280 232.2 279.7 234.1C279.5 236.1 275.7 234.5 276 233.9ZM287 230.3C287 230.3 286.5 228.6 286.8 228.4L287.6 228C287.6 228 286.3 227.2 285.7 227.2C285.167 227.067 284.9 227.067 284.9 227.2C284.7 227.5 285.9 229.2 285.9 229.2L287 230.3Z",fill:"#D2A567"}),m.jsx("path",{d:"M279.6 231.5C279.6 231.5 283.3 232.5 283.4 232.2C283.6 231.9 280.4 229 280.4 229V228.3C280.4 228.1 281.7 228.1 282.1 228.4C282.5 228.7 282.1 229.4 282.1 229.6C282.3 229.8 283.5 231.6 283.7 231.3C283.9 231 283.5 228.8 283.6 228.7C283.6 228.5 285 229.9 285.3 230.2C285.7 230.4 287.8 232 288 231.2C288.2 230.5 288.3 230.4 288.3 229.9C288.2 229.5 288.9 232 288 232.3C287 232.7 285.9 232 285.9 232L285 231.3L284.5 230.8C284.5 230.8 285.1 232.8 284.5 233C283.9 233.2 283 233.1 283 233.1L281.5 232.9L279.5 231.5H279.6ZM288.1 229C288.1 229 292.1 231.4 292.4 231C292.8 230.5 291.4 225 291.6 224.4C291.8 223.8 294.8 230.7 293.4 231.6C292.2 232.3 291.7 231.8 291.7 231.8L289.7 230.8L288.1 229ZM299.1 239L300 239.4L300.5 239.6L299.4 239.8L299.1 239ZM295.3 225.9L295.9 226.2L296.4 226.4L295.9 226.6L295.6 226.5L295.3 225.9ZM294.1 223.9C294.1 223.9 294.5 224.1 295.1 223.8C295.7 223.5 295.6 223.1 295.6 223L294.4 222.6L294.2 222.1H293L294.1 223.9ZM297.6 235.5L299.2 236.2C299.5 236.2 300.1 236.6 300 236.7C299.9 236.8 299 236.9 298.6 236.7L298 236.5L297.6 235.5ZM291.1 217.4H292.1C292.3 217.6 292.1 218.4 291.8 218.7L291 219.1L289.7 217.3L291.1 217.4ZM285.4 212.4L286.6 212.3C287.067 212.367 287.467 212.533 287.8 212.8C288.2 213 288.5 215.4 288.3 215.8C288.1 216.3 285.5 214.3 285.4 214.1C285.4 213.9 284.2 212.1 284.2 212.1L285.4 212.4ZM282.9 211.2C282.9 211.2 284.9 211.4 284.7 210.2C284.612 209.465 284.256 208.788 283.7 208.3L281.3 210L282.9 211.2ZM277.7 209C277.7 209 278.2 209.2 278.8 209C279.4 208.8 280.9 206.8 282 206.6C283 206.333 283.533 206.333 283.6 206.6C283.8 206.8 283.6 208 283.4 208.3C283.2 208.6 279.9 210 279.9 210L278.7 209.8L277.7 209.5V209ZM277.1 205.4C276.6 204.2 275.7 203.8 275.4 203.8C275.1 203.9 276.5 205.1 276.7 206.6L276.9 209.4H277.6V208.9L277.8 208.4V208L277.7 207.2L277.5 206.6L277.4 206.1L277.1 205.4ZM272.5 203.7C271.276 202.383 269.773 201.358 268.1 200.7C267.9 200.7 271.3 202.7 272.1 204.1C272.8 205.3 272.8 207.1 273.1 207.3C273.4 207.5 273.8 207.3 273.8 207.2C273.933 207.067 274 206.9 274 206.7L273.8 205.8L273.3 205L273 204.4L272.5 203.7ZM268.1 201.9C265.782 200.206 262.969 199.327 260.1 199.4C257.2 199.4 255.8 199.6 256.2 201.2C256.6 202.667 257.933 203.367 260.2 203.3C262.6 203.3 263.2 203.1 264.4 203.5C265.733 203.967 266.7 204.5 267.3 205.1C267.7 205.5 266.3 203.9 265.2 203.1L263.2 201.6C263.2 201.6 263 201.1 264.6 201.4C266.2 201.7 268.4 202.6 268.9 204C269.5 205.3 269.4 206 269.4 206.4C269.4 206.6 270 206.2 270 206.2L270.2 205.5C270.2 205.5 270.3 205 270 204.5C269.7 203.8 269.6 203.6 268.9 202.8L268.1 201.9ZM260.4 224.7C261.6 224.7 264.2 222.5 264.6 219.3C264.587 215.836 263.908 212.407 262.6 209.2C262.1 208.5 263.3 208.9 264 209.5C264.7 210.1 266 214.7 266 218C266 221.3 265.2 222.3 263.5 224C261.7 225.6 260.3 225.5 260.3 225.5L260.4 224.7ZM264.5 234C264.5 234 265.1 234.7 265.7 234.5C266.9 234 268.8 233.1 268.8 231.5C268.8 230.3 267.4 229.3 267.3 228.9V228.1L268.6 228.4L268.9 230.2C2
72168.9 230.2 269.4 230.7 269.9 230.5C270.4 230.3 271.9 229.2 271.8 228.1C271.7 227 270.1 225.8 270 225.3V224.3L271.2 224.5L271.6 226C271.6 226 271.9 226.6 272.6 226.4C273.3 226.2 274.6 225 274.3 224.4L273 222.3V221.6L273.5 221.9C273.5 221.9 273.9 222.1 274.9 221.8C275.9 221.5 276.7 220.8 276.7 220.2C276.7 219.6 276 219 275.9 218.6V218.1L276.5 218.2L277.3 219.2L277.5 220.2L277.2 221.2L276.1 222.5L274.9 222.9H274.6L275.3 224.1L275.1 225.7L274.1 226.7L272.7 227.4V228.9L271.9 230.5L270.2 231.5H269.7L269.5 232.5L268.5 234L266.5 235.3L265.2 235.5L264.4 234.4L264.5 234Z",fill:"#D2A567"}),m.jsx("path",{d:"M274.7 217.1C274.7 217.1 277.8 218.1 277.7 216.1C277.7 214.9 274.7 212.4 274.5 212C274.366 211.4 274.333 211.067 274.4 211L275.9 212.4C275.9 212.4 277.9 212.9 278.5 211.7C279 210.6 278.5 209.9 278.5 209.8H278.9L279.9 209.9L279.7 211.7L278.7 216.1C278.7 216.1 279 217.8 277.7 218C276.3 218 274.7 217.1 274.7 217.1ZM277.7 240.7C277.7 240.7 277.7 239.8 277 239.2C276.3 238.6 275 238 274.8 237.8L277 240.6L277.7 240.7ZM282.2 240.8L280.2 238.3C280 237.6 279.2 236.2 278.5 236.1C277.9 236.1 279.1 238.5 279.1 238.5L281.6 240.8H282.2ZM286.5 240.8L284.8 237.5C284.5 236.8 283.8 234.8 283 234.2C282.2 233.6 283 235.2 283 235.2L284 237.8L285.4 240.1L286.4 240.8H286.5ZM289.6 239C289.6 239 289.5 236.8 289.2 235.3C288.997 234.264 288.472 233.319 287.7 232.6L287.8 235.3L289.6 239ZM296.1 240.6L294.6 236.8L292.9 233.5L293.2 235.8L294.6 239.6L296.1 240.6ZM301.7 233.8C301.7 233.8 300.7 232.8 298.6 231.9C297.218 231.391 295.769 231.087 294.3 231L294.5 231.3L295.5 232.1L297.7 233.3L300.7 234L301.7 233.8Z",fill:"#D2A567"}),m.jsx("path",{d:"M278.6 235C278.6 235 278.6 237 279.6 238.1L283.3 241.8C283.7 242.2 284.1 244.5 284.8 246.4L285.9 250.4C286.2 251 286.8 251.9 286.4 251.8C285.866 251.733 285.466 251.3 285.2 250.5C284.9 249.8 285 249.8 285.1 248.8C285.1 247.8 283.6 242.9 282.9 242.4C282.2 241.9 279 239.2 277.8 237.4C276.6 235.5 276.8 235.1 276.8 235.1L278.6 235Z",fill:"#202020"}),m.jsx("path",{d:"M283.7 247.5C283.1 246.033 282.767 244.867 282.7 244C281.779 242.639 280.588 241.482 279.2 240.6C278.7 240.4 277.7 240.7 277.2 240.4L274.3 237.2C274.3 237.2 274 237.6 274.1 237.7C274.2 237.8 276.8 240.7 277.8 241.5C278.8 242.5 279.3 244.5 280 246.1C280.6 247.7 280.4 247.3 280.4 248.1C280.6 248.9 280.934 249.3 281.4 249.3C282.067 249.3 282.234 249.2 281.9 249C281.147 248.194 280.568 247.241 280.2 246.2C279.6 244.8 279 242.2 278.2 241.3L277.9 241.1L278.9 241C279.6 241 282.3 243.4 282.5 244.1C282.7 244.8 282.5 245.1 283.5 247.5C284.7 249.9 285.2 250.5 285.2 250.5H285.4L283.7 247.5ZM279.6 231.5L282 232.9L283 233.1C283 233.1 283.3 236.6 284.7 238.6C286.1 240.6 287.3 241.3 287.3 241.3C287.3 241.3 287.3 245.1 288.3 247.7C289.114 249.695 289.456 251.851 289.3 254C289.1 254.5 288.3 252.5 287.7 250.7L286.2 245.7C285.791 244.374 285.11 243.148 284.2 242.1C283.5 241.6 284 241.7 284.4 242.1C285.323 243.1 286.007 244.297 286.4 245.6C287 247.6 287.3 249.6 287.6 249.6C288 249.6 288.2 249.367 288.2 248.9L287.5 245.6C287.1 243.6 286.767 242.367 286.5 241.9C286.2 241.3 285.7 241.3 284.5 239.1C283.633 237.805 282.959 236.39 282.5 234.9V233.9C282.2 233.7 282.1 233.9 281.1 233.4C280.1 232.9 279.6 231.5 279.6 231.5Z",fill:"#202020"}),m.jsx("path",{d:"M284.5 230.8C284.5 230.8 285.7 231.8 286.4 232C287 232.3 288 232.3 288 232.3C288 232.3 287.7 235.7 289 237.8C290.3 240 291.7 241.2 291.7 241.2C291.7 241.2 291.9 242 292.3 246.7L292.9 253.3C292.9 255.1 293 261.7 292.8 261.5C291.8 260.7 292.6 257.2 292.1 255.7C291.6 254.2 290.8 254 289.8 249.7C288.8 245.7 289.5 244.7 288.8 243.1C288.1 241.5 287.2 241.4 287.2 241.4C287.2 241.4 288.5 241.6 289 243C289.5 244.3 289.6 247.8 290 249.5C291 253.5 292.4 255.5 292.4 255.5C292.4 255.5 292.1 250.5 291.7 247.7C291.3 244.9 291.4 242.6 290.8 241.5C290.3 240.5 289.2 239.5 288.5 238.2C287.8 236.7 287.6 233.9 287.3 233.2C287 232.5 286.8 232.7 286.3 232.5C284.8 231.9 284.5 230.8 284.5 230.8Z",fill:"#202020"}),m.jsx("path",{d:"M288 229C288 229 289.1 230.2 290.6 231C292 231.9 292.8 231.6 293 231.8C293.2 232 292.7 234.9 294.2 237.6C295.7 240.4 296.2 240.4 296.3 240.8L296.8 251.8C297 254.6 297.2 263.8 296.1 263.8C295 263.8 296 257 295.4 255.4L294.4 253C293.9 251.7 293.8 246.8 293 243.8C292.3 241.6 291.7 241.2 291.7 241.2C291.7 241.2 292.7 241.8 293.3 243.7C293.8 245.5 293.9 251.7 294.5 252.6C295.233 253.733 295.767 254.733 296.1 255.6C296.3 256.6 296.1 244.1 295.7 243.3C295.5 242.5 293 238 292.7 235.5C292.6 233 292.5 232.7 292.3 232.5C292.1 232.3 291.3 232.5 290.1 231.4C288.9 230.3 288.1 229 288.1 229H288Z",fill:"#202020"}),m.jsx("path",{d:"M293.8 230.4C293.8 230.2 294.6 231.8 296.8 232.7C299 233.6 301.3 233.4 301.6 233.7C302.788 236.231 303.37 239.005 303.3 241.8C303.3 246.3 302.5 245.9 301.8 249.8C301.1 253.7 301.1 261.6 300.7 262.8C300.5 263.3 300.2 263.5 300 264.3C299.7 265 300.2 266.5 299.5 266.5C298.8 266.5 298.7 265.4 298.7 264.8C298.7 264.2 299.4 262 299.4 259.8C299.4 257.6 299 257.4 298.6 254.8C298.3 252.3 298.3 244.1 298 243.3C297.7 242.5 296.3 240.8 296.3 240.8C296.3 240.8 297.8 241.8 298.2 242.8C298.6 244 298.6 253.1 299 254.9C299.4 256.8 299.3 254.5 299.4 253.4C299.6 252.4 300.1 247.9 300.1 245.5C300 243.1 299 237.9 298.1 237.1L299.1 238.7L299.7 239.2L300.5 239.6L299.7 239.4L299.2 239.1C299.897 241.16 300.236 243.325 300.2 245.5C300.3 249.5 299.7 258.5 300.3 258.7C301 258.7 300.8 253.7 301.5 249.7C302.2 245.7 303.1 245.1 302.8 241.7C302.5 238.5 301.6 234.9 300.9 234.4C300.2 233.9 298.3 234.1 296.5 233C294.7 231.9 293.7 230.7 293.8 230.4ZM265.2 235C265.2 235 265.8 235.3 266.6 235C267.3 234.6 269.3 233 269.3 232.3V231C269.3 231 269.3 23
7211.3 270 231.4C270.5 231.4 272.2 230.2 272.3 229.4V227C272 226.8 272.7 227.3 273.1 227C273.4 226.7 275 225.7 275 224.6C275 223.5 274 222.6 274 222.6H275.3C275.8 222.5 277.3 221.6 277.3 220.6C277.3 219.6 276.7 218.2 275.5 218.1C275.5 218.1 276.4 218.3 277.3 218.1C278.167 217.7 278.567 217.033 278.5 216.1C278.4 214.7 276.7 213.1 276.4 212.9C276.1 212.7 278.3 213.5 278.9 212.6C279.367 211.667 279.5 211 279.3 210.6C279.2 210.1 278.7 209.9 278.7 209.9C278.7 209.9 279.7 210.2 281 209.5C282.3 208.8 283.4 208 284 208C284.6 208 282.1 209.4 282 210.1C282 210.367 282.6 210.933 283.8 211.8L284 211.9C284.5 212.2 286.5 212.3 286.6 212.4C286.7 212.5 284.7 212.4 284.9 212.6C286.596 213.849 288.14 215.292 289.5 216.9C289.5 216.9 289.8 217.2 290.2 217.3L291.2 217.5H290L292.6 221.3C292.6 221.3 293 221.8 293.3 221.9L294.3 222.1C294.3 222.3 293.1 222.1 293.3 222.3L295.9 227.1C295.9 227.1 293.4 222.8 290.4 219.5C287.4 216.1 286.8 215.7 286.6 216C286.4 216.3 288.8 219.3 290.1 221.3C291.4 223.4 292.5 226 292.5 226C292.5 226 289.5 219.8 285.3 216C281.1 212.1 280.7 211.5 280.3 211.7C279.7 211.8 279.3 214.7 279.7 215.2C280 215.8 283 218.2 285.7 221.2C288.3 224.2 291.6 229.6 291.6 229.6C291.6 229.6 289.2 225.8 285.2 221.6C281.2 217.4 279.7 216.3 279.4 216.3C279.1 216.3 279 217.1 278.6 217.8C278.2 218.5 277.1 218.3 277.1 218.6C277.1 218.9 280.5 222 281.1 222.4C281.7 222.8 282.2 222.6 282.7 222.9L283.8 223.6L282.6 223.2C282 223 281.667 223 281.6 223.2C281.5 223.5 284.3 226.7 284.8 226.9L286.1 227.3C286.7 227.5 287.6 228.1 287.6 228.1L286 227.4C285.334 227.4 285 227.467 285 227.6C285 227.8 287.1 230.5 287 230.6C287 230.6 283.8 226.8 281.2 224.5C278.5 222.1 277.3 221.6 277.2 221.7C277.1 221.8 277.2 222.5 276.5 222.7C275.834 222.9 275.434 223.1 275.3 223.3C275.3 223.5 277.6 225.8 279.3 227.6L282.5 231.3L278.9 227.8C277.034 226.067 276.034 225.267 275.9 225.4C275.7 225.5 275.7 226.4 275.9 226.7C276 226.9 279.5 231 279.4 231.1C279.3 231.2 275.3 226.2 275 226.2C274.8 226.333 274.6 226.667 274.4 227.2C274.1 227.4 273 227.4 273 227.8C273 228.2 278.6 233.8 278.4 233.8C278.4 233.8 273.8 229.8 273.6 230.1C273.5 230.3 275.6 234.1 275.5 234.2C275.4 234.3 272.7 230.2 272.5 230.2C272.3 230.2 272.3 230.7 271.6 231.3C270.9 231.9 270.1 231.7 270.1 231.9C270.1 232.2 273.9 236.5 273.8 236.6C273.8 236.6 269.8 232.5 269.8 232.7C269.667 232.7 269.6 232.9 269.6 233.3C269.9 234.3 270.8 236.2 270.6 236.3C270.6 236.3 269.4 233.8 269.1 233.9C268.8 233.9 268.8 234.5 268.1 234.9C267.6 235.2 267.1 235.1 267.1 235.4C267.1 235.7 267.8 236.1 268.1 236.7C268.4 237.3 268.7 238.7 268.7 238.7C268.7 238.7 268.3 237.5 267.7 236.8C267.167 236.067 266.7 235.667 266.3 235.6C265.9 235.733 265.667 235.867 265.6 236L265.2 235Z",fill:"#202020"}),m.jsx("path",{d:"M301.6 233.7C301.6 233.7 302.8 233.6 303 233.3C303.2 233 302.5 233.3 301.4 232C300.2 230.8 297.4 222.3 294.1 218C288.9 211.1 284.1 208 284.1 208C284.1 208 289.8 211.3 294.3 217.9C298.9 224.5 300 229.8 301.3 231.1C302.6 232.5 303.8 232.7 303.7 233.1C303.7 233.5 303.467 233.767 303 233.9L301.3 234L301.5 233.7H301.6ZM263.2 231.8L263.4 231.9C263.7 231.9 265.3 230.4 265.2 229.9C265.067 229.9 264.634 229.633 263.9 229.1C263.3 228.5 263.2 227.6 263.2 227.6C263.2 227.6 263.7 228.6 264.2 228.9C264.734 229.233 265.2 229.333 265.6 229.2C265.8 228.9 268.1 227.2 268 226.6C267.867 226.667 267.4 226.5 266.6 226.1C265.4 225.5 265.8 224.5 265.8 224.5C265.8 224.5 266.2 225.4 266.9 225.7C267.7 225.967 268.234 225.967 268.5 225.7C268.7 225.4 270.2 223.3 270 222.7C269.867 222.767 269.4 222.633 268.6 222.3C267.9 221.8 267.5 220.6 267.5 220.6C267.5 220.6 268 221.6 268.9 221.8C269.834 221.867 270.4 221.533 270.6 220.8C270.8 220.2 271.3 217.8 270.6 217.2C270.6 217.2 269.4 217.6 268.6 217.2C267.8 216.8 267.5 215.7 267.5 215.7C267.5 215.7 268.1 216.7 269.1 216.7C270 216.9 270.4 216.4 270.5 216C270.7 215.7 270.7 214.3 270.5 213.6C270.3 212.9 269.6 212.9 269.5 211.8C269.567 211.933 269.067 212.067 268 212.2C266.4 212.4 266.2 210.9 266.2 210.9C266.2 210.9 267.2 211.8 268.1 211.7C269 211.6 269.3 210.9 269.4 210.3C269.267 209.7 269 209.1 268.6 208.5C268.4 207.9 268.3 207.2 268.2 207.3C268 207.3 267.8 207.9 266.6 207.7C265.4 207.5 265.1 206.7 265.1 206.7C265.1 206.7 266 207.3 266.6 207.3C267.334 207.3 267.734 207 267.8 206.4C267.8 206 267.5 205.1 266 203.8L263.2 201.6C263.2 201.6 265.2 202.7 266.5 203.8C267.8 204.8 268.5 205.9 268.5 205.9C268.5 205.9 269.9 206.4 270 205.9C270.267 205.5 270.167 204.833 269.7 203.9C269.3 203.2 268.1 201.9 268.1 201.9C268.1 201.9 269.3 202.9 269.9 204
721C270.5 205.1 270.3 205.9 270.3 206.1C270.3 206.3 273 207.4 273.6 207.1C274.067 206.633 274 205.967 273.4 205.1L272.4 203.7C272.4 203.7 273.1 204.4 273.6 205.2C274.134 206 274.334 206.567 274.2 206.9L273.7 207.6L275.5 208.6C276.4 209.1 277.4 209.6 277.5 209.3C277.7 209.033 277.767 208.433 277.7 207.5C277.6 206.7 277.1 205.4 277.1 205.4C277.1 205.4 277.7 206.6 277.8 207.5V209.5C278.1 209.7 278.8 209.8 278.8 209.8C278.8 209.8 278.2 210.2 277.1 209.8C275.9 209.5 270.9 207 270.7 207.2C270.5 207.5 273 209 274.2 210.2C275.4 211.2 275.9 212.4 275.9 212.4C275.9 212.4 275 211.6 274.1 211.1C273.2 210.6 270.6 209.3 270.4 209.5C270.3 209.7 271.4 209.9 271.5 210.1C271.6 210.3 270.7 211.1 270.7 211.5C270.7 211.9 274.5 214.5 274.4 214.7C274.2 215 273.4 215.7 273.2 215.7C273 215.7 271.2 214.2 271.2 214.4C271.2 214.7 272.2 215.6 272.2 215.8C272.2 216 271.6 216.4 271.7 216.8C271.8 217.2 273.8 218.9 273.7 219.5C273.7 220 272.7 220.5 272.9 220.9L274.1 222.5L272.6 221.4C272.3 221 271.6 220.2 271.5 220.3L270.7 222.3C270.7 222.7 271.7 223.2 271.8 224.1C271.9 225 271.7 226.1 271.6 226.1C271.6 226.1 270.3 224.4 270.1 224.4C269.767 224.333 269.5 224.5 269.3 224.9C269.1 225.3 268.3 226.6 268.5 226.9C268.5 227 269.8 227.3 269.8 228.3C269.8 229.3 269 230.2 268.9 230.2L267.3 228.2C267.1 228.2 265.5 230.1 265.5 230.2C265.5 230.5 266.5 231.3 266.4 231.6C266.2 232 265.4 231.6 264.9 231.8L263.6 232.3C263.4 232.3 263.2 231.8 263.2 231.8Z",fill:"#202020"}),m.jsx("path",{d:"M284 208C284 208 284.1 207.5 284.4 207.2C284.6 207 285.6 205.9 285.2 205.6C284.9 205.4 283.6 205.8 282.8 205.8C282 205.7 281.5 205.8 279.1 203.9C279.1 203.9 271.7 198.8 260.2 198.1C256.6 197.9 255 199.1 254.8 199.9C254.8 200 255.8 198.4 259.4 198.4C266.18 198.641 272.787 200.603 278.6 204.1C278.9 204.4 280.9 206.3 282.7 206.1C284.6 205.8 285 205.6 284.9 205.9L284.2 207.1L284 208ZM264 209.5C263.421 208.514 262.676 207.634 261.8 206.9C259.812 205.512 257.663 204.371 255.4 203.5C255.2 203.5 260.2 205.8 261.6 207.2L264 209.5Z",fill:"#202020"}),m.jsx("path",{d:"M264 217.8C264 217.8 263.6 217.3 262.6 216.6L260.6 215.7L263 216.3C263.6 216.9 264 217.8 264 217.8ZM263.3 213.5C263.3 213.5 263 213 261.6 212.5C260.334 212.167 259.767 212.067 259.9 212.2C260.1 212.4 261.2 211.6 262.2 212.2C262.487 212.31 262.744 212.485 262.952 212.71C263.16 212.935 263.313 213.206 263.4 213.5H263.3ZM262.5 209.9C262.5 209.9 262.2 209.3 261 208.9C259.667 208.433 258.967 208.233 258.9 208.3C258.8 208.4 260.2 208 261.4 208.5C262.7 209 262.5 209.9 262.5 209.9ZM261 207.7C261 207.7 260.7 207.2 258.3 206.7L255.1 206.1C255.2 206.2 258.4 205.8 259.3 206.1C260.2 206.5 261 207.7 261 207.7ZM256.7 205.2C256.7 205.2 255.3 204.8 253.9 204.7L250.4 204.8C250.4 204.8 254.4 204.2 255.4 204.4C256.4 204.8 256.834 205.067 256.7 205.2Z",fill:"#D2A567"}),m.jsx("path",{d:"M243.6 254.7C243.6 254.7 244.3 256 245.6 256C247.1 256 248.2 258 248.2 258L246.7 259.6L243 259.8L241.8 257.8L243.6 254.8V254.7ZM243.6 253.5C243.8 253.2 242.6 250.8 241.7 250.5C240.9 250 242 251.2 241.8 251.7C241.6 252.233 241.533 252.633 241.6 252.9C241.6 252.9 242.3 253.9 241.9 254.4C241.5 254.9 243.7 253.4 243.7 253.4L243.6 253.5Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M243 257.1C243 257.1 243.7 257.4 244.2 257.3C244.8 256.967 245.134 256.733 245.2 256.6M242.3 256.2C242.3 256.2 244.4 254.7 244.3 253.9C244.034 253.233 243.7 253 243.3 253.2L241.7 254.5L242.3 256.2Z",fill:"#F8C83C"}),m.jsx("path",{d:"M243 257.1C243 257.1 243.7 257.4 244.2 257.3C244.8 256.967 245.134 256.733 245.2 256.6M242.3 256.2C242.3 256.2 244.4 254.7 244.3 253.9C244.034 253.233 243.7 253 243.3 253.2L241.7 254.5L242.3 256.2Z",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M240.9 257.2C240.9 257.2 241.2 258.2 241.9 258.2C242.6 258.2 243.6 257.7 243.6 257.2C243.6 256.9 242.9 256.2 242.5 255.9C242 255.7 241 256.2 241 256.2L240.9 257.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M242.8 255.8C242.6 256.1 241.3 256.8 240.9 256.8C240.5 256.8 239.6 255.8 239.9 255.6L241.1 255.3C241.4 255.1 241.5 254.6 241.7 254.6C241.967 254.6 242.267 254.767 242.6 255.1C243.1 255.6 242.9 255.5 242.8 255.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M241.4 256.7C241.4 256.7 239.4 259.5 238.5 259.3C237.6 259.1 238.9 255.4 238.9 255.4L239.9 255.8C240.567 256 241.067 256.333 241.4 256.8V256.7Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M237.8 254.8C237.8 254.8 240.4 255.2 240.5 255.6C240.6 256 239.3 256.6 238.5 256.6C237.8 256.6 237.8 254.7 237.8 254.7V254.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M231.2 258.7C231.2 258.7 231.6 260 232.7 260.1C233.8 260.2 234.9 258.9 234.9 258.9L232.2 257.9L231.2 258.7Z",fill:"#202220"}),m.jsx("path",{d:"M231.2 258.7L231.5 259.4C231.767 259.8 232.167 260.033 232.7 260.1H232.8C233.9 260.1 235 258.9 235 258.9L232.2 257.7L231.2 258.7ZM231.2 258.7L232.2 257.9L234.9 258.9L234.7 259C234.4 259.4 233.6 260 232.8 260C232.2 260 231.8 259.767 231.6 259.3L231.4 258.9L231.3 258.8L231.2 258.7Z",fill:"#4B4139"}),m.jsx("path",{d:"M232 258.4C232 258.4 232.4 259.4 234 259.4C235.4 259.4 236.6 258.2 236.6 258.2L234.2 256.3L232 258.4Z",fill:"#202220"}),m.jsx("path",{d:"M232 258.4C232 258.4 232.4 259.4 234 259.4C234.985 259.334 235.912 258.907 236.6 258.2L234.2 256.2L231.9 258.4H232ZM232 258.4L234.2 256.4L236.6 258.2H236.5C235.822 258.849 234.937 259.238 234 259.3C233.713 259.337 233.422 259.312 233.145 259.226C232.869 259.139 232.615 258.994 232.4 258.8L232.1 258.5L232 258.4Z",fill:"#4B4139"}),m.jsx("path",{d:"M232.2 258.6C232.2 258.6 232.8 259.1 233.6 259.2
721L235.4 259L234.4 259.3H233.2L232.7 259.1L232.3 258.8L232.2 258.6Z",fill:"#4B4139"}),m.jsx("path",{d:"M234 257.3C234 257.3 234.6 258.9 236 258.7C237.3 258.6 237.4 257.7 237.4 257.7L235.8 255.5L234 257.3Z",fill:"#202220"}),m.jsx("path",{d:"M234 257.3L234.4 258.1C234.734 258.5 235.234 258.733 235.9 258.8H236.1C236.767 258.667 237.167 258.467 237.3 258.2L237.5 257.8L235.9 255.4L233.9 257.3H234ZM234 257.3L236 255.6L237.4 257.8C237.4 257.9 237.3 258.5 236.1 258.7H235.9C235.367 258.633 234.9 258.4 234.5 258L234.2 257.5V257.3H234Z",fill:"#4B4139"}),m.jsx("path",{d:"M234.1 257.6C234.1 257.6 235 258.6 235.7 258.6C236.433 258.533 236.833 258.433 236.9 258.3V258.4L236.5 258.6L235.9 258.7H235.2L234.6 258.3L234.1 257.6ZM231.5 259.2C231.5 259.2 232.1 259.9 232.7 259.9C233.3 259.9 234.2 259.4 234.2 259.4H234.3L234.2 259.5L233.6 259.9L232.8 260.1L232.2 260L231.8 259.7L231.5 259.4V259.2Z",fill:"#4B4139"}),m.jsx("path",{d:"M237.6 254.6C238.2 254.6 239.6 256.3 239.6 257.2C239.6 258.1 239.2 259.4 238.6 259.3C237.9 259.3 236.4 258 236.1 257.3C235.633 256.633 235.5 256.167 235.7 25
7215.9C235.9 255.5 237.7 254.6 237.7 254.6H237.6ZM231.2 254.8C231.2 254.8 230.2 254 229.7 254.4C229.2 254.8 229.4 256.2 229.7 256.4C230 256.8 231.2 255.8 231.2 255.8V254.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M231 255.8C231 255.8 229.6 255.8 229.6 256.5C229.6 257.2 230.3 257.8 230.4 258C230.5 258.2 231.8 257.4 231.8 257.4L231 255.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M231.6 256.9C231.6 256.9 230.1 257.3 230.1 257.9C230.1 258.3 230.8 259.2 231.2 259.2C231.6 259.2 232 258.3 232.2 258.2C232.4 258 231.6 256.9 231.6 256.9ZM232.3 252.8C232.3 252.8 232 252.4 231.4 252.6C230.8 252.8 230.1 253.5 230.3 254.4C230.433 255.467 230.566 256 230.7 256L232.8 255.3L232.3 252.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M232.4 254.4C232.4 254.4 230.6 255 230.5 255.7C230.5 256.567 230.833 257.1 231.5 257.3C231.9 257.4 233.5 255.9 233.5 255.9L232.4 254.4Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M234 257.4C234 257.4 232.2 258.6 232 258.6C231.7 258.6 231 257.6 231.2 257C231.4 256.4 232.6 255.9 233.1 255.7C233.6 255.5 234.1 257.4 234.1 257.4H234ZM235.6 250.8C235.6 250.8 235 250.4 233.9 250.4C232.9 250.5 232 251.9 231.9 252.7C231.8 253.5 231.9 254.7 232.3 254.9C232.7 255.1 235 253.3 235 253.3L235.6 250.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M233.4 256.2C232.6 256.2 232 255.1 232.1 254.4C232.2 253.7 233.7 252.6 234.5 252.8C235.3 252.8 235.1 254.8 235.1 254.8C235.1 254.8 234.1 256.3 233.4 256.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M235.8 256C235.8 256 235.4 257 234.7 257.3C233.9 257.633 233.334 257.467 233 256.8C232.5 256.1 233.2 255.8 233.5 255.5C233.9 255.2 234.9 255 234.9 255L235.8 256Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M234.6 253.8C234.6 253.8 233.7 254.4 234.2 255.2C234.667 255.867 235.167 256.267 235.7 256.4C236.233 256.533 236.733 256.3 237.2 255.7C237.9 254.8 238.4 254.8 238.3 254.1C238.3 253.367 238.033 252.867 237.5 252.6C237.1 252.4 235.8 252.6 234.5 253.7L234.6 253.8Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M237 250.4C237 250.4 236.1 250 235.4 250.4C234.733 250.867 234.366 251.533 234.3 252.4L234.4 254.1C234.4 254.1 235.4 253.9 235.9 253.4C236.4 252.9 236.7 252.7 236.6 252.4C236.466 252.4 236.366 252.1 236.3 251.5C236.3 250.5 237 250.4 237 250.4Z",fill:"#202220"}),m.jsx("path",{d:"M237 250.4C237 250.4 236 250.2 235.5 250.5C234.966 250.833 234.6 251.333 234.4 252C234.333 252.667 234.333 252.933 234.4 252.8C234.5 252.6 234.2 252.3 234.4 251.7C234.666 251.033 235.066 250.567 235.6 250.3L237 250.4Z",fill:"#4B4139"}),m.jsx("path",{d:"M263 269.6L264.3 269L265.9 268L266.2 269.8L264.8 270.8H263.6L262.9 270.3L263.1 269.6H263Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M261.1 269.7H262L263 269.6C263.2 269.6 263.5 270.6 263.5 270.6L263.1 271.1L261.9 271.8L260.9 271.2L260.8 269.8L261.1 269.7ZM270.8 269.2L270.1 268.3L268.4 266.8V270.8H270.2L271 269.5L270.8 269.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M261.1 269.7C261.1 269.7 260.8 269.3 260.1 269.4C259.167 269.6 258.6 270.033 258.4 270.7C258.4 271.2 258.4 272.7 258.8 273C259.2 273.333 259.8 273.433 260.6 273.3C261.4 273 265.6 270.4 265.6 270.4L264.6 270.7L263.4 270.5C263.4 270.5 262.9 271.2 262.2 271.3C261.6 271.3 261.267 271.1 261.2 270.7L261.1 269.7Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M264 271.1L263 271.5L262 272L262.3 273.3L264.1 273.7L265.2 272.7V271.5L264 271.1ZM272.3 270.2L271.7 269.6C271.3 269.2 271 269.067 270.8 269.2L269.8 270.3V271.2L270.8 271.7L271.5 271.8L272.5 271.2L272.3 270.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M266.1 269.6L264.9 270.3L263.9 271.1L264.9 272.1L265.8 272.3L267.8 270.9L267.6 269.6H266.1ZM273.7 271.2L273.3 270.6C272.9 270.333 272.567 270.2 272.3 270.2C272.1 270.2 271.3 271.4 271.3 271.4L271.2 271.7L271.9 272.5L273.2 272.8L274.1 272L273.7 271.2Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M270.4 272.6L271.4 272.8C271.4 272.8 271.3 273 271.6 273.2H271.9C271.9 273.1 271.9 274.2 272.9 274.9C272.9 274.9 274.1 275.3 274.6 274.9C275.2 274.6 275.1 275 275.1 275L276.7 273C276.7 273 276.7 272.6 276.3 272.6C276.3 272.6 276.6 271.4 275.6 271.1C274.6 270.8 273.7 271.2 273.7 271.2C273.7 271.2 272.9 272.7 272.5 272.5L271.9 272.1L271.3 271.4L270.6 271.2C270.2 271 269.9 270.3 269.9 270.3C269.9 270.3 269.3 270.3 269.1 270L268.6 269.4L267.1 270.4C267.1 270.4 267.1 270.9 266.2 271.5C265.334 272.1 264.867 272.333 264.8 272.2C264.7 272 264.6 273.5 263.6 273.2C262.6 273.1 262 272 262 272C262 272 261.3 271.9 260.9 272.5C260.5 273.1 260.2 273.3 260.2 273.9C260.267 274.567 260.5 275.133 260.9 275.6C261.2 275.9 262.2 276.6 263.3 276C264.5 275.4 264.1 274.5 264.1 274.5L264.7 274.1C265.434 273.433 266.1 272.967 266.7 272.7",fill:"#F8C83C"}),m.jsx("path",{d:"M270.4 272.6L271.4 272.8C271.4 272.8 271.3 273 271.6 273.2H271.9C271.9 273.1 271.9 274.2 272.9 274.9C272.9 274.9 274.1 275.3 274.6 274.9C275.2 274.6 275.1 275 275.1 275L276.7 273C276.7 273 276.7 272.6 276.3 272.6C276.3 272.6 276.6 271.4 275.6 271.1C274.6 270.8 273.7 271.2 273.7 271.2C273.7 271.2 272.9 272.7 272.5 272.5L271.9 272.1L271.3 271.4L270.6 271.2C270.2 271 269.9 270.3 269.9 270.3C269.9 270.3 269.3 270.3 269.1 270L268.6 269.4L267.1 270.4C267.1 270.4 267.1 270.9 266.2 271.5C265.334 272.1 264.867 272.333 264.8 272.2C264.7 272 264.6 273.5 263.6 273.2C262.6 273.1 262 272 262 272C262 272 261.3 271.9 260.9 272.5C260.5 273.1 260.2 273.3 260.2 273.9C260.267 274.567 260.5 275.133 260.9 275.6C261.2 275.9 262.2 276.6 263.3 276C264.5 275.4 264.1 274.5 264.1 274.5L264.7 274.1C265.434 273.433 266.1 272.967 266.7 272.7",stroke:"#977C2E",strokeWidth:"0.2",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M268.6 264.7V267.2C268.6 267.2 269 269.5 268.5 270.2C268 270.9 266.2 270.8 265.9 270.2C265.7 269.5 265.8 267.6 265.8 267.6L268.6 264.6V264.7Z",fill:"#F8C83C",stroke:"#977C2E",strokeWidth:"0.2"}),m.jsx("path",{d:"M266.6 272.4C266.6 272.4 266.2 273.1 267.4 273.2L268.1 272.9C268.367 272.567 268.467 272.367 268.4 272.3C268.3 272.2 268.3 273.2 269.4 273.3C270.5 273.4 270.4 272.2 270.4 272.2",fill:"#F8C83C"}),m.jsx("path",{d:"M266.6 272.4C266.6 272.4 266.2 273.1 267.4 273.2L268.1 272.9C268.367 272.567 268.467 272.367 268.4 272.3C268.3 272.2 268.3 273.2 269.4 273.3C270.5 273.4 270.4 272.2 270.4 272.2",stroke:"#977C2E",strokeWidth:"0.2",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M257 274.5C257 274.5 256.3 273.4 257 273C257.8 272.6 258.3 273 258.7 273C259.2 273 259 271.8 258.9 271.6C258.833 271.2 258.667 270.867 258.4 270.6C258.2 270.6 255.6 270.8 255.7 272.5C255.8 274.2 257 274.5 257 274.5ZM261 278.6C261 278.6 260.2 277.4 260.6 276.7C261 276 261.4 276.5 261.6 276.4C261.867 276.4 261.867 275.967 261.6 275.1C261.2 273.8 260.7 274 260.4 273.9C260.1 273.8 258.6 275 258.9 276.5C259.3 278.3 260.9 278.6 260.9 278.6H261ZM275.5 277.2C275.5 277.2 278.3 278.4 278.5 275.5C278.6 274 277.2 273 276.8 273C276.6 273 276.267 273.267 275.8 273.8C275.2 274.4 274.967 274.8 275.1 275C275.3 275.3 276.1 274.8 276.5 275.7C277.1 277.2 275.5 277.2 275.5 277.2Z",fill:"#202220"}),m.jsx("path",{d:"M261 278.6C261 278.6 258.8 278.1 258.8 276C258.8 274.6 260.4 274 260.4 274C260.4 274 259 274.7 258.9 276C258.9 278.1 260.9 278.6 260.9 278.6H261ZM257 274.5C257 274.5 255.7 274.2 255.6 272.4C255.4 270.6 258.4 270.7 258.4 270.7C258.4 270.7 255.6 270.7 255.7 272.5C255.9 274.3 257 274.5 257 274.5ZM275.5 277.2C275.5 277.2 276.1 277.5 276.7 277.4C277.5 277.467 278.067 277.067 278.4 276.2C278.7 275.1 278.5 274.6 277.8 273.7C277.2 273.1 276.867 272.867 276.8 273C276.7 273.2 277.4 273.1 277.8 273.7C278.2 274.3 278.7 275 278.3 276.2C277.9 277.4 276.8 277.4 276.3 277.4L275.5 277.2Z",fill:"#4B4139"}),m.jsx("path",{d:"M242.1 217.9L241.6 217.8L242 216.9L243.4 216.4L244.9 216.3H246.4L247.1 216.7L247.9 218.6L245 220.3L244.5 220.5L244.4 219.7L243.9 218.6L242.1 217.9Z",fill:"#904720"}
721),m.jsx("path",{d:"M269.5 260.4L269.4 256L257.4 259.6L262.2 264L269.5 260.4Z",fill:"#202020"}),m.jsx("path",{d:"M247.6 252.7L246.6 251.9L245.5 251.3H244.5L244.4 251.5L244.5 251.9L245.6 253.2L247.4 254.2L248.1 254.7L248.5 254.9L247.6 252.7ZM247.3 254.6H248L248.6 255.5L249.1 256.3L249.6 257.3L249.8 258L248.5 257.7L244.6 256.5L245 255.6L245.6 255L246.2 254.8L247 254.6H247.3Z",fill:"#D2A567"}),m.jsx("path",{d:"M249.8 257.8L250.4 257.7L250.8 257.3L250.6 255.9L250.9 251.3L247.8 247.6L247.1 249.7L248.1 253.5L248.7 255.7L249.8 257.8Z",fill:"#D2A567"}),m.jsx("path",{d:"M247.5 249.3C247.5 249.3 247.3 249.7 247.6 250.9C247.9 252.1 248.3 254.9 249.4 256.7C250.4 258.5 248.4 255.2 248.4 255.2C248.4 255.2 246.7 251.5 246.9 248.7C247.2 245.8 247.5 249.3 247.5 249.3Z",fill:"#AB6D29"}),m.jsx("path",{d:"M249.8 251.7C249.8 251.7 249.1 252.5 249 253.2V254.9C249 254.9 249 254.1 249.7 253.9C250.4 253.7 250.3 255.8 250.3 256L250.7 252.2L249.8 251.7ZM250.2 259.4L246.7 258.6C244.834 257.8 243.9 257.133 243.9 256.6C243.9 256.2 247.1 256.8 247.6 256.9C248.1 257 249.5 257.7 249.5 257.7H250.3L251.8 257.1L252 258.7L250.2 259.4ZM244.2 258.7C244.2 258.7 245.2 259.3 244.7 259.6C244.2 259.9 243.2 259.9 242.9 259.8L246.3 260.6L246.9 260L244.3 258.7H244.2Z",fill:"#AB6D29"}),m.jsx("path",{d:"M243.4 257.8C243.4 257.6 243.6 258.3 244.8 258.4C246 258.6 246.6 258.2 246.6 258.2L247.1 258.6L247.7 258.7L247.2 259.6L244.9 258.9L243.7 258.3L243.4 257.8Z",fill:"#D2A567"}),m.jsx("path",{d:"M251.3 256.2L251.9 257.1L252.3 255.1V253.1L251 252.3L251.3 256.2Z",fill:"#AB6D29"}),m.jsx("path",{d:"M247.8 253L246.8 251.2L245.4 248.7L246.2 247.3L247.2 248.7C247.2 248.7 246.9 249.7 247.2 250.7C247.2 251.7 247.8 252.9 247.8 252.9V253Z",fill:"#4D2A15"}),m.jsx("path",{d:"M240.6 259.2C240.6 259.2 241.1 258.5 242.1 258.4L244.1 258.5L246.1 259.7L246.6 260.4L242.6 259.8L240.6 259.2Z",fill:"#D2A567"}),m.jsx("path",{d:"M251.2 252L251.3 255.3C251.4 256 251.9 256.8 251.8 257.1C251.8 257.367 251.533 257.567 251 257.7C250.5 257.9 249.5 257.7 249.5 257.7C249.5 257.7 250.5 257.6 250.5 257.4L250.2 255.4C250.2 254.6 250.2 253.7 250 253.7C249.666 253.767 249.433 253.9 249.3 254.1C249.3 254.2 249.6 251.1 249.9 250.8C250.3 250.4 251.2 252.1 251.2 252.1V252Z",fill:"#8F4620"}),m.jsx("path",{d:"M243.8 258.4C243.8 258.4 243.4 258.1 243.4 257.8C243.4 257.5 243.8 259.1 246.1 259C248.3 258.9 248.1 258.8 248.1 258.8H249.2C249.2 258.8 249 259.8 248.8 259.9C248.6 259.9 247.1 261 247 261.1L246.5 261.4V261.2L246.2 259.5L244.3 258.8L243.8 258.4Z",fill:"#AB6D29"}),m.jsx("path",{d:"M247.8 253C247.8 253 245.2 250.2 244.3 248.5C243.4 246.8 244 244.3 244 244.3L246.4 247.5C246.4 247.5 246.1 248.1 246.2 249.1C246.3 250.1 247.8 252.9 247.8 252.9V253Z",fill:"#8F4620"}),m.jsx("path",{d:"M246.1 262.6C246.1 262.4 245.9 261.8 246.4 261.2C247.945 259.729 249.786 258.603 251.8 257.9V260.3L246.8 262.7L246.1 262.6Z",fill:"#AB6D29"}),m.jsx("path",{d:"M246.4 260.8L247.5 259.8C247.5 259.533 246.933 259.333 245.8 259.2L243.8 258.4C243.8 258.4 245.1 259.5 245.7 259.7C246.1 259.9 246.233 260.1 246.1 260.3L246.4 260.8ZM253 261.4L252 259.7L251.8 257.9L251 258.5L249.5 259C249.5 259 251.1 259 251.1 259.5C251.1 260 248.7 260.3 248.7 260.4C248.7 260.5 250.6 260 250.5 260.4C250.3 260.9 249.5 260.9 248.5 261.4L246.1 262.6C246.1 262.6 246.5 262.9 247.3 262.8L249.6 262.4L252.6 261.2L253 261.4Z",fill:"#8F4620"}),m.jsx("path",{d:"M253 261.4C253 261.4 252.2 261.1 251.6 257.5C251 253.9 251.1 253 251.1 253L252.6 254L253.9 256.3L253 261.4Z",fill:"#AB6D29"}),m.jsx("path",{d:"M253.5 255.4C253.5 255.4 252.8 257.4 252.8 258.6C252.8 259.733 252.866 260.667 253 261.4L254.5 263.2L255 262.7L255.3 261.1V258.4L253.5 255.4Z",fill:"#8F4620"}),m.jsx("path",{d:"M255.5 258.2C255.5 258.2 255.9 263.2 254.5 263.3C254 263.4 253.1 261.4 253 261.3C253 261.3 254.1 263.3 254.6 263C255.4 262.7 255.1 257.8 255.1 257.8L255.5 258.2ZM253 261.4L252.5 260.7C252.1 260.1 252.5 261.2 249.7 262.2C246.9 263.2 246.1 262.6 246.1 262.6C246.1 262.6 247 263.3 249.7 262.5C252.4 261.7 252.2 261.5 252.5 261.5L253 261.4Z",fill:"#202020"}),m.jsx("path",{d:"M248 255C248 255 248.5 255.3 249 256.3L249.8 258L249.9 257.9L249.1 256.2L247.4 253.6L248 255Z",fill:"#AB6D29"}),m.jsx("path",{d:"M246.4 261.2C246.4 261.2 246.7 260.2 246.4 260.1L244 259.9L240.6 259.2C240.6 259.2 241.9 260 243.1 260.3L245.8 261H246.3L246.4 261.2Z",fill:"#8F4620"}),m.jsx("path",{d:"M246.4 261.2L246.2 260.8C246 260.6 245.7 260.8 243.4 260.3L240.6 259.3C240.6 259.3 241.4 259.9 243.4 260.4L246.4 261.2Z",fill:"#202020"}),m.jsx("path",{d:"M247.4 254.6C247.4 254.6 245.7 254.6 245.2 255.1L243.9 256.7L245 256.8C245 256.8 244.9 255.8 245.4 255.3C245.9 254.8 246.7 254.7 247.4 254.6Z",fill:"#AB6D29"}),m.jsx("path",{d:"M244.2 251.4C244.2 251.4 244.9 252.3 245.6 252.6C246.4 252.867 246.967 253.2 247.3 253.6C247.7 253.9 248 255 248 255C248 255 245.6 253.9 245.2 253.4C244.7 252.8 244.2 251.4 244.2 251.4Z",fill:"#8F4620"}),m.jsx("path",{d:"M246.6 252C246.6 252 246.3 251.6 245.6 251.3C245 251.033 244.566 251 244.3 251.2V251.4L245.1 252.7L245.6 252.6C245.6 252.6 244.3 251.8 244.6 251.6C245.2 251 246.6 251.9 246.6 251.9V252Z",fill:"#8F4620"}),m.jsx("path",{d:"M253 248.9L266.6 241.9L273 250.9L261.3 253.9L255.1 254.5L252.1 252.3L253 248.9Z",fill:"#202020"}),m.jsx("path",{d:"M271.2 252.7L288 267.3L286.2 268.6L282.2 267.5L274 259.4L271 256.3L271.2 252.7Z",fill:"#4D2A15"}),m.jsx("path",{d:"M292.8 264.4L283.1 257.1L271 248L271.3 252.3L285.2 265.1L289.8 267.3L292.1 266.6L293.3 265.4L292.8 264.4Z",fill:"#4D2A15"}),m.jsx("path",{d:"M271.1 254.1C271.1 254.1 276 259.6 279.7 262.4C283.4 265.2 286.9 268.2 287.7 267.8C288.5 267.4 288.1 266.9 288.1 266.9L271.1 253V254.1Z",fill:"#803F1D"}),m.jsx("path",{d:"M283 268.1L281.4 269.4L279.4 268.6L269 258L269.5 256L271 256.3L283 268.1Z",fill:"#4D2A15"}),m.jsx("path",{d:"M292.8 264.4C292.8 264.4 291.5 267.4 288.8 266.7C286.1 266 271.2 251.9 271.2 251.9V253.4C271.2 253.4 286.2 267.2 289.2 267.7C292.1 268.3 294.5 265.7 294.2 265.5L292.8 264.5V264.4Z",fill:"#202020"}),m.jsx("path",{d:"M269.5 256.3C269.5 256.3 274.3 262.5 276.8 264.7C279.4 267 281.6 268.8 282.6 268.6C283.6 268.4 282 267.2 282 267.2L274.7 260.1L271 256.3C271 256.3 269.5 255.7 269.5 256.3Z",fill:"#803F1D"}),m.jsx("path",{d:"M270.7 256.3C270.7 256.3 282.9 268.7 283.8 269C285.8 269.6 288.8 267.5 288.8 267.5L287.8 266.9L287.6 267.3C287.6 267.3 287.1 268.5 284.4 268C279.537 264.466 275.077 260.409 271.1 255.9L270.7 256.3Z",fill:"#202020"}),m.jsx("path",{d:"M275.3 268.2L270.8 263.1L269.8 261.4L269.6 259.2
721L278.4 268.2L277.2 269L276.1 268.6L275.3 268.2Z",fill:"#4D2A15"}),m.jsx("path",{d:"M283.3 268.4C283.3 268.4 282.3 270 280.8 269.7C279.894 269.513 279.082 269.018 278.5 268.3L270 260L269.8 258.7C269.8 258.7 279.1 268.6 280.8 269C282 269.3 282.8 267.8 282.8 267.8L283.3 268.4Z",fill:"#202020"}),m.jsx("path",{d:"M278.6 268.1C278.6 268.1 278.2 269.3 276.9 269.1C275.6 268.9 275.3 268.5 275.3 268.5L270.1 262.3L270 260.7C270 260.7 275.4 268.1 276.6 268.6C277.9 269 278.2 267.7 278.2 267.7L278.6 268.1Z",fill:"#202020"}),m.jsx("path",{d:"M273 251.9C273 251.9 278 256.2 278.5 256.4C279 256.6 280.7 256.7 280.8 257C280.9 257.3 279.6 257 279.5 257.2C279.5 257.5 282.1 259.6 282.5 259.7C282.9 259.7 285 259.7 285 260C285 260.3 283.5 260 283.5 260.3C283.5 260.6 285.7 262.5 286.2 262.5C286.6 262.6 289.2 262.6 289.2 262.9C289.2 263.2 287.1 262.9 287.2 263.3C287.2 263.7 290.8 266 290.7 266.3C290.6 266.6 286.3 263.5 286.2 263.6L285.7 265C285.4 265.1 285.7 263.6 285.5 263C285.3 262.4 282.8 260.5 282.5 260.7C282.2 260.9 282.5 262.1 282.3 262.1C282.1 262.1 282.3 260.7 282.1 260.2C281.9 259.7 279.5 257.8 279.2 257.8C278.9 257.8 279.1 258.8 278.9 259C278.7 259.2 278.7 257.8 278.4 257.4C278.1 257 272.8 252.2 273 251.9Z",fill:"#B07229"}),m.jsx("path",{d:"M264.4 265.9C264.4 265.9 264.4 267.8 263.6 268.1C262.8 268.4 261.1 264.6 261.1 264.6L260.7 261L263.2 263.4L264.4 265.9ZM271.1 264.9V263.9L270.9 262.7L270.7 260.7L270.3 259.5L269.9 258.6H269.3L268 259.6L267.6 260.9L268.3 263.3L268.9 265.4L269.9 265.8L271.1 264.9Z",fill:"#4D2A15"}),m.jsx("path",{d:"M269.4 268.3C269.7 268.1 269.1 265.5 269.1 265.5L267.6 261.7L267.1 260.3L265.9 259.8L265.1 260.8L265.2 262.3L267.1 265.8C267.6 266.6 268.9 268.4 269.4 268.2V268.3Z",fill:"#4D2A15"}),m.jsx("path",{d:"M268 260C268.5 260.4 269 261.4 269.1 262.1C269.1 262.1 270.1 265 270 265.2C269.9 265.4 269.2 265.5 269.2 265.5C269.2 265.5 270.6 267 271 266.8C271.4 266.6 271.3 265.2 271.1 264.9C270.9 264.6 270.6 264.9 270.4 264.5C270.2 264.2 269.7 262.3 269.7 261.2V259C269.9 258.7 270.9 261.3 270.9 262.7L271.4 263.3L270.9 260.7L270.4 258.9L270.6 257.7V256.9L271.3 257.3C271.567 257.367 271.767 256.833 271.9 255.7C272.1 254 271.8 250.9 271.8 250.9L266.4 258L268 260Z",fill:"#202020"}),m.jsx("path",{d:"M268 259.4C268 259.4 267.8 261.4 268.5 263.4C269.2 265.3 269.4 265.4 269.5 265.6C269.7 265.9 269.7 268 269.5 268.2C269.5 268.2 268 264.7 267.5 263C267 261.3 267 260.6 266.7 260.4L266.1 260.3L268 259.4Z",fill:"#202020"}),m.jsx("path",{d:"M267.5 269.6C267.6 269.6 267.5 268.8 267.5 268.8L267.3 267L265.4 263L263.4 261.2L262.3 259.5L262.1 262.7C262.1 262.7 263.6 265.9 264.6 266.9C265.6 267.9 267.2 269.7 267.5 269.6Z",fill:"#4D2A15"}),m.jsx("path",{d:"M259.7 260.9C259.7 260.9 260.1 261.7 260.1 262.3V263.3L261.5 266.1C262.2 267.4 262.9 268.6 263.5 268.4C264 268.1 264.2 267.2 264.3 267.1C264.3 267 263.6 268.1 263.3 267.9C263 267.7 261.3 262.7 261.4 262.6L260.6 262L259.7 260.9ZM265.4 265.2L264 262.7C263.467 261.833 263.1 261.367 262.9 261.3C262.7 261.3 262.5 259.8 262.5 259.8C262.5 259.8 263 260.8 263.8 261.2C264.467 261.6 264.967 261.767 265.3 261.7L265.5 263.3L265.4 265.3V265.2Z",fill:"#202020"}),m.jsx("path",{d:"M262 262.6C262 262.6 262.3 263.7 263 264.8L264.9 267.1C264.9 267.1 263.6 265.9 262.9 264.9C262.2 263.9 261.8 262.6 261.8 262.6H261.9H262Z",fill:"#5C3A1D"}),m.jsx("path",{d:"M265.6 261.3C265.6 261.3 266 260.3 266.3 260.3L267.2 260.1C267.2 260.1 266.7 260 266.2 259.5L265.2 258.5L265.5 260L265.6 261.3ZM265.3 261.6L267.3 266C267.6 267.2 267.6 268.8 267.6 268.8L267 266.7C266.7 265.7 265.3 263 265.2 262.7C265.1 262.4 265.2 261.7 265.2 261.7L265.3 261.6Z",fill:"#202020"}),m.jsx("path",{d:"M267.4 259.5L267.8 254.7L267.4 252.9L265.2 248.1C265.2 248.1 265.1 248.8 264.5 248.8C263.572 248.542 262.738 248.021 262.1 247.3C261.664 248.555 261.595 249.907 261.9 251.2L266.2 259.1L267.4 259.5Z",fill:"#4D2A15"}),m.jsx("path",{d:"M259 262.7C259 262.7 259.7 263.5 260 263.4C260.3 263.3 260.3 261.8 259.8 260.9C259.3 260 254.2 253.2 253.4 252.8C252.7 252.4 259 262.7 259 262.7Z",fill:"#8B441F"}),m.jsx("path",{d:"M262.5 259.9C262.6 260.2 263 262.4 262.1 262.6C260.9 262.8 255.2 255.1 254.4 254C254.4 254 250.8 251.8 250.8 251.2C250.8 250.6 254.6 252 254.6 252L262.1 259.2
721L262.5 259.9Z",fill:"#8B441F"}),m.jsx("path",{d:"M259 262.7C259 262.7 258.4 261.6 258.3 260.7C258.233 260.033 258.133 259.567 258 259.3L253.4 252.7L251.6 251.6L251.8 253.5C251.8 253.5 253.1 255.9 255 258.1L259 262.7Z",fill:"#202020"}),m.jsx("path",{d:"M265.3 261.6C265.8 261.3 265.6 259.4 265.3 258.8C265.2 258.2 261.8 251.2 261.8 251.2L260.8 251.6L258.9 250.1L257.9 249L258.2 251.5V252.8L260.8 257.4L265.3 261.6ZM269.1 257.4L269.9 256.4L269.4 252.9L267.2 245.3C267.2 245.3 266.7 245.5 266.2 245.1L265 244.1L265.5 248.6L267.8 255L268 256.9L269.1 257.4Z",fill:"#4D2A15"}),m.jsx("path",{d:"M262.1 259.2C262.1 259.2 259.9 256.8 259.1 255.6L257.8 253.2C257.8 253.2 257.2 253.5 256.4 253.2C255.7 252.8 254.6 251.7 254.6 251.7C254.6 251.7 254 252.9 257.2 256.2C260.9 259.9 262.2 259.2 262.2 259.2H262.1Z",fill:"#202020"}),m.jsx("path",{d:"M267.5 260C268.5 259.6 268.5 255.7 267.5 253C266.6 250.4 265.2 248 265.2 248C265.2 248 267 252.4 267.4 254C267.8 255.8 267.4 257 267.1 257C266.8 256.9 266.8 256 266.1 254.3C265.3 252.6 264.8 252.2 264.8 252.2C264.8 252.2 267.4 259.2 266.7 259.1C266 258.9 262.4 251.1 262.2 250.9C262.1 250.7 262 251.2 262 251.2C262 251.2 265.2 261 267.5 260Z",fill:"#8B441F"}),m.jsx("path",{d:"M269.6 241L271.2 244.4L271.7 247.9L271.8 250.9C271.8 250.9 271.9 256.9 271.2 256.9C270.5 257.1 270.1 256.4 270.1 256.2L268.7 249.6L267.3 242.8L267.8 242.4L268 241.4L269 241.3L269.6 241Z",fill:"#4D2A15"}),m.jsx("path",{d:"M265.3 261.6C265.9 261.6 265.3 260 265.3 260C265.3 260 264.8 260.7 264.3 260.2C263.8 259.7 263.3 257.7 263.3 257.7L262.9 256.5C262.9 256.5 262.4 257.8 261.9 257.8C261.2 257.8 258.2 252.7 258.2 252.7L257.8 253.2C257.8 253.2 262.1 262.1 265.3 261.6Z",fill:"#8B441F"}),m.jsx("path",{d:"M263.3 257.7C263.3 257.7 263.8 256.5 263.6 255.3C263.129 253.912 262.526 252.573 261.8 251.3L260.8 251.2L258.9 250.2C259.995 252.9 261.477 255.427 263.3 257.7ZM265.8 255.9C265.8 255.9 265.4 253.2 264.1 250.7C263.611 249.472 262.936 248.325 262.1 247.3V250.1C262.1 250.1 263.3 250.6 264.1 252.1L265.8 255.9ZM269.2 251.3C269.2 251.3 269 248.3 268.5 246.6L267.5 242.6L267.8 242.4H268.3C269 242.5 269.3 244.1 269.3 244.1L269.1 241.6L268.9 241.2H267.8C267.8 241.2 268 241.9 267.7 242.2C267.4 242.5 267.2 242.1 267.1 242L267 242.3L267.2 243.9V245.3C267.2 245.3 267.6 247 268.2 248.1L269.2 251.3ZM271.8 250.9C271.8 250.9 272.3 246.7 271.4 243.9C271.052 242.65 270.438 241.49 269.6 240.5L269.1 241.1C269.1 241.1 270.6 243.4 271.1 245.5C271.5 247.8 271.8 250.9 271.8 250.9ZM267.5 253.1C267.5 253.1 267.1 249.7 266.5 247.6L265.7 244.6L264.8 243.9C264.8 243.9 265.3 246.1 265.3 246.8L265.2 247.8C265.2 247.8 265.6 249 266.2 250C266.8 251 267.5 253 267.5 253V253.1Z",fill:"#202020"}),m.jsx("path",{d:"M269.8 258.3C270.6 258.3 269.8 253.5 269.5 252.3L267.2 245.3C267.2 245.3 269.6 253.5 269.4 253.9C269.1 254.5 268.2 251.4 268 251.5C267.8 251.5 269.8 257 269 257.1C268.4 257.1 268 255.9 268 255.9V257.1C268 257.1 268.5 258.3 269.8 258.3Z",fill:"#904720"}),m.jsx("path",{d:"M270.8 255.9C271.4 255.9 270.6 251.4 270.2 249.3L268.7 243.3C268.7 243.3 269.8 246.1 270.5 249.3C271.2 252.5 271.5 256.6 271 256.7C270.3 256.7 270 256.1 270 256.1V255.4C270 255.4 270.2 255.9 270.8 255.9Z",fill:"#904720"}),m.jsx("path",{d:"M263 261.2C263 261.5 263 263.1 262.2 263C261.4 262.9 259.9 261.5 259.6 260.5C259.6 260.5 261.4 262.5 262 262.5C262.6 262.5 262.6 260.5 262.5 259.9C262.5 259.4 263 261.2 263 261.2Z",fill:"#312317"}),m.jsx("path",{d:"M267.3 239.6C267.3 239.6 268.3 240.3 269.3 239.8C269.691 239.531 270.013 239.174 270.239 238.756C270.465 238.339 270.588 237.874 270.6 237.4C270.666 236.8 270.5 236.167 270.1 235.5C269.5 234.8 270.9 236.1 270.9 237.4C270.9 238.7 270.9 240.8 268.9 241.3C266.9 241.8 267.8 241.2 267.8 241.2L267.3 239.6Z",fill:"#D2A567"}),m.jsx("path",{d:"M265.7 235.8C265.7 235.8 267 237.8 267.5 239.8C267.967 241.533 267.967 242.4 267.5 242.4C267.234 242.4 267.1 242.167 267.1 241.7L265.7 235.8Z",fill:"#8F4620"}),m.jsx("path",{d:"M243.3 238.3L251.7 250.6L262.4 238.6L255.7 231.8L243.3 238.3Z",fill:"#1E2121"}),m.jsx("path",{d:"M254 230.8L253.5 232.8L254.5 236L256.3 237.8L258.3 239.2L258.8 237.7L259.3 235.9L259.8 235.7L261.1 236.2L262 234.9L2
72163.4 232.5L263.1 231.5L262.7 230.8L260.6 227.1L259.9 228.5L259.2 228.9L258 228.2L256.5 230.2L254.6 229.3L254 230.8Z",fill:"#4D2A15"}),m.jsx("path",{d:"M258.4 239.2C258.4 239.2 258.7 238.9 258.9 238C259 237 259.1 234 258.8 232.8C258.5 231.6 257.8 229.3 257.6 229.5C257.4 229.6 258.8 232 258.6 235C258.4 237.9 258.6 238.7 257.9 239C257.2 239.3 258.4 239.2 258.4 239.2Z",fill:"#5C3818"}),m.jsx("path",{d:"M258.8 234.3C258.8 234.3 260.2 236.3 260.9 235.5C261.6 234.8 261.2 232.3 260.9 231.3L259.9 228.8L260.3 228.4L261 231.1C261.3 232.2 262 235.3 261.1 235.9C260.2 236.5 258.9 234.7 258.9 234.7V234.3H258.8Z",fill:"#5C3818"}),m.jsx("path",{d:"M254.3 235.6C254.3 235.6 254.8 234.9 255.4 234.9C256.066 234.967 256.333 235.033 256.2 235.1L256.8 236.7L257.7 238.4L258.5 239.3L258.1 239.8H257.4L255.4 238.8L254.8 238L254.3 235.6Z",fill:"#8F4620"}),m.jsx("path",{d:"M257.6 253C257 253.4 255.5 252.7 254.6 251.9L249.2 246.5L248.6 244L250.4 244.4L253.4 243.1L254 242.1L257.7 240.1L259.7 239.1L264.2 238.9L265.2 236.8C265.2 236.8 266.8 239.4 267 240.4C267.2 241.4 267.2 244.7 266.8 244.9C266.4 245.1 265 243.9 264.8 243.9C264.5 243.9 265.8 248.5 264.8 248.7C263.7 248.8 261.8 246.9 261.8 246.9C261.8 246.9 262.6 251.1 261.8 251.1C260.8 251.1 258.6 250.1 257.7 249.1C257.7 249.1 258.7 252.5 257.7 253.1L257.6 253Z",fill:"#D2A567"}),m.jsx("path",{d:"M256.8 247.7L257.7 249.1C257.9 249.4 257.7 251.4 257.5 251.7C257.2 252.5 256.2 250.8 255.7 249.4L253.9 246.4C253.9 246 256.8 247.7 256.8 247.7ZM265.5 237.4C265.5 237.4 267 243.9 266.3 244.1C265.5 244.3 263.3 242.1 263.1 241.7L259.8 236.6L259.2 235.9L259.4 235.6L260.7 236.1L265.5 237.4Z",fill:"#8F4620"}),m.jsx("path",{d:"M254.3 249.8C254 250.1 253.3 249 253 248.8L250.6 246.1C249.466 245.033 248.866 244.367 248.8 244.1C248.8 243.8 248.1 243.1 248.1 243.1L248.7 242.5L249.4 242.4C249.4 242.4 253.7 245.8 254 246.4C254.3 246.9 254.5 249.7 254.3 249.9V249.8ZM260.8 249.9C260.6 250.1 257.8 248 256.5 246.3C255.2 244.6 254.1 243.1 253.8 242.3L253.3 240.8L254.1 241C254.1 241 261.1 249.6 260.8 249.9ZM261.8 246.9C261.6 247.1 260.4 246.2 259.6 245.2C258.9 244.2 259.3 242.9 259.3 242.9C259.3 242.9 261.9 246.7 261.8 246.9ZM263.4 246.5C263 246.7 261.4 244.7 260 242.5C259 240.9 258.7 240.6 258.5 240.5L257.5 240.2L257.3 240L258 239.8L258.6 239.1L259.4 238.1L262.8 244.9C262.8 244.9 263.6 246.4 263.4 246.5Z",fill:"#8F4620"}),m.jsx("path",{d:"M254.6 251.9C254.6 252.2 254.6 252.4 253.6 252.3C252.8 252.3 247.9 249.6 245.8 246.1L243.3 242.1L244.3 241L251.9 249.7L254.6 251.9Z",fill:"#AB6D29"}),m.jsx("path",{d:"M254.6 251.9C254.6 252.3 254.334 252.433 253.8 252.3C253.2 252.2 251.3 251.5 248.3 248.1C245.3 244.7 244 242.2 244 242.1L243.9 240.7L244.8 240.3L250 248.3L254.6 251.9Z",fill:"#8F4620"}),m.jsx("path",{d:"M259.7 248.5C259.7 248.5 258.1 247.3 257.1 246.1C256.1 244.9 254.1 242.1 254.1 241.5C254.1 240.9 255.1 241 255.1 241L255 239.5L255.2 239.1L256.7 239.7L258.6 242L259.3 243C259.3 243 260.5 245.8 260.3 246C260 246.4 258.3 244.5 258.1 244.7C257.9 244.9 260.1 248.2 259.7 248.5ZM256.7 247.7C256.7 247.7 257.3 248.5 257 249C256.7 249.5 256.6 249.9 255.8 248.7C255 247.5 254.1 246.2 254 246.3C254 246.4 254.1 248.1 253.7 248.1C253.3 248.1 252.1 246.7 251.3 245.5L249.3 242.5C249.3 242.5 249.5 242 249.4 240.7L249.3 238.7C249.3 238.7 249.3 239.1 249.5 239.4L249.9 240L252.7 243.3L253.5 242.8L255.2 246.1L256.7 247.7ZM245.9 242.7C245.9 242.7 248.1 246.7 250.2 248.8C251.452 250.108 252.947 251.161 254.6 251.9L248 244L246 242.8L245.9 242.7ZM262.9 245.1C262.8 245.1 261.4 243.7 260.5 242.4C259.722 241.197 259.242 239.826 259.1 238.4L259.3 235.6C259.3 235.6 261.6 238 262.1 239.1C262.5 240.1 263.4 241.7 263.2 241.9C263 242.1 261.5 240.9 261.3 241.1C261.1 241.4 263.1 244.9 262.9 245.1ZM265.5 242.6C265.2 242.7 264 241.4 263.7 240.6C263.4 239.6 263.3 238 263.3 238L262.3 235.6L262.4 233L263.4 232.8L264.9 234.9C264.9 234.9 265.5 236.2 265.5 237.9C265.5 239.8 265.8 242.4 265.5 242.6ZM247.5 249.1C245.5 246.6 244.2 244.1 244.2 244.1L243.5 241.9L243.9 242.2C243.9 242.2 244.5 244.8 247.6 247.9C250.8 251 251.5 251.3 251.5 251.3C251.5 251.3 252.1 253 251.8 253.6C251.8 253.6 249.5 251.6 247.5 249.1Z",fill:"#4D2A15"}),m.jsx("path",{d:"M250.9 252.7C250.9 252.7 248.2 250.3 246 247.7C243.9 244.9 242.5 242.3 242.5 242.3L243.5 241.4C243.5 241.4 245.3 245.6 246.5 247.3L250.9 252.7ZM254.6 251.9L250 247C249.03 245.937 248.19 244.762 247.5 243.5L248.8 244C248.8 244 249.3 245.4 250.5 246.8L254.6 251.9ZM254 246.3C254 246.3 252.3 244.3 251.5 242.9L249.8 239.9C249.8 239.9 252.1 242.6 252.8 242.7H253.5C253.3 242.6 253.2 243.7 253.5 244.5C253.6 245.3 254 246.3 254 246.3ZM254.7 237.9C254.7 237.9 255 239.3 254.8 240.2C254.6 241.1 254.1 241 254.1 241L255.6 242.8C256.1 243.4 257.4 244.3 257.4 244.3L255.9 242.1C255.5 241.4 254.9 240.5 255.2 239.8C255.4 239.1 256.8 240.3 257.2 240.6L259.2 242.9C259.2 242.9 258.7 240.9 257.8 240.2L254.8 237.9H254.7Z",fill:"#202020"}),m.jsx("path",{d:"M261.6 242.3L260.2 238.8L258.9 234.8V237C258.9 238 258.5 239.4 258.1 239.6C257.7 239.8 257.6 239.8 256.8 239.6C256.1 239.4 257.4 240 257.4 240C257.4 240 258.2 240 258.4 239.6C258.8 239.2 258.9 238.4 259.3 238.5C259.6 238.6 260 239.8 260.3 240.4L261.6 242.3Z",fill:"#202020"}),m.jsx("path",{d:"M259 234.7C259 234.7 260.6 236.6 261.3 235.7C262 234.8 261.6 232.6 261.6 232.6C261.6 232.6 262.6 232.9 262.9 232.6C263.2 232.3 263.1 231.6 263.1 231.6C263.1 231.6 264.9 234.1 265.7 235.8C266.6 237.4 267 240.4 267 240.4C267 240.4 265.5 238 264.8 235.8C264.1 233.6 263.1 232.8 262.9 233C262.7 233.2 262.5 234.6 262.7 235.4L263.9 238.1C264.4 239.2 264.9 240.9 264.9 240.9L263.5 238.9C262.967 238.233 262.5 237.8 262.1 237.6C261.8 237.3 261.3 236.6 260.8 236.5C260.3 236.4 259.3 235.8 259.3 236.2L259.1 235.4L259 234.7Z",fill:"#202020"}),m.jsx("path",{d:"M253.4 242.6L255 245.4L256.8 247.7C256.8 247.7 255.2 246.3 254.6 245.4C254 244.4 253.4 242.6 253.4 242.6Z",fill:"#171717"}),m.jsx("path",{d:"M264.1 243C263.9 243.2 263.1 242.9 263.1 243.2C263 243.5 263.5 244.5 264.1 245.1C264.566 245.633 264.866 245.8 265 245.6L264.8 244.5V243C264.7 242.8 264.1 243 264.1 243Z",fill:"#8F4620"}),m.jsx("path",{d:"M244.7 231.5L243.7 232.1L242.7 234.4L243 238.7L244.7 241.1C245.3 242.1 247.5 244.5 248 244.3C248.5 244.1 249.2 242.5 249.2 241.6L249.4 239C249.4 239 249.9 240 250.8 240.9C251.7 241.9 252.5 242.8 252.8 242.7C253.3 242.7 254.5 240.2 254.6 239.8C254.6 239.5 251.4 231.8 251.4 231.8L250 231.1L244.7 231.5Z",fill:"#D2A567"}),m.jsx("path",{d:"M251.8 238L252.7 240.9C253 241.9 252.7 242.7 252.9 242.7C253 242.7 254.7 240.5 254.7 239.5C254.7 238.5 254.7 237.5 254.3 234.5C253.8 231.4 254.4 230.5 254.4 230.5L253.4 229.7L251.9 233L251.8 238ZM246.3 236.2L246.8 240.2C247 241.2 247.6 242.8 247.9 242.7C248.2 242.7 249.2 240.1 249.3 239.2C249.3 239.2 248.6 237.9 248.6 234.8C248.6 231.7 248.3 231.3 248.3 231.3L246.3 236.2Z",fill:"#AB6D29"}),m.jsx("path",{d:"M242 230C242 230 239.5 233.6 239.6 235.6C239.6 237.6 239.9 237.2 240.6 239C241.1 240.8 241.4 243.4 241.4 243.6C241.533 243.8 241.7 243.7 241.9 243.3L242 230Z",fill:"#45392D"}),m.jsx("path",{d:"M242 230.5C242 230.5 239.8 233.8 240 235.7C240.1 237.6 240.4 237.5 241 239.2C241.6 240.9 241.7 243.6 241.7 243.6C241.7 243.6 242.4 243.4 243.2 242.8L244.7 241.1L243.9 239.4L243.3 237.9L242.7 236.9L242.9 233.8L243.5 231.4V230.6L242 230.5Z",fill:"#AB6D29"}),m.jsx("path",{d:"M253.8 236.3L252.2 235.8C251.8 235.5 251.6 234.8 251.6 234.8L251.9 234.2L253.8 236.3Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M242.4 230.8C242.4 230.8 240.9 234.2 241 236.6C241.253 238.452 241.828 240.246 242.7 241.9V234.2L243.4 231.9V230.7L242.4 230.8Z",fill:"#D2A567"}),m.jsx("path",{d:"M246.3 231.6V233C246.2 233.5 245.3 234 245 234.6L244.2 236.9C244.2 236.9 244.5 235.9 245.1 235.4C245.6 234.9 245.8 234.4 245.9 234.8C246 235.1 246.2 236.4 246.1 236.7C245.9 236.833 245.634 237.367 245.3 238.3C245.094 238.917 245.094 239.583 245.3 240.2L245.7 238.4C245.9 237.933 246.067 237.7 246.2 237.7L247.2 239.5V238C247.4 237.3 248.2 236.4 248.3 236.4C248.6 236.4 248.9 236.2 248.1 235.8C247.8 235.6 248 232.4 248.1 232.2C248.4 232.1 249.6 232.1 249.5 231.6L248.2 229.9L246.2 231.6H246.3Z",fill:"#8F4620"}),m.jsx("path",{d:"M253.6 238.5L252.4 238.3L252 237.8V237.3L253 237.8L253.6 238.5Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M243.6 238.9L243.1 240.1L242.8 241.3L242.5 238.7L242.2 236.8L241.7 237.3C241.7 237.3 241.7 236.1 241.9 235.5C242.234 234.767 242.3 234.233 242.1 233.9
721C241.834 233.9 241.567 234.1 241.3 234.5L240.7 235.5L241.2 234C241.5 233.6 242.6 232.3 242.9 231.7L243.1 230.7L243.9 230.6C243.9 230.6 244.8 231.3 244.8 231.9C244.8 232.2 243.9 232.5 243.9 232.6C243.9 232.7 243.2 232.6 243.1 235.2C242.9 237.9 243.6 237.7 243.6 238.9ZM251 231.9C251 231.9 251.2 233.4 251 233.9C250.867 234.3 250.6 234.733 250.2 235.2C249.8 235.8 249.9 237.2 249.9 237.2L250.3 236.2L250.8 235.3C251 235.3 251.234 235.733 251.5 236.6L252.1 238.6C252.1 238.6 251.9 237.6 252.1 237.6C252.3 237.6 252.5 237.6 252.9 237.9L253.6 238.5C253.6 238.5 253.6 238.1 253.1 237.5C252.6 236.9 252.3 237.1 252.1 236.4C251.967 235.6 251.934 235.033 252 234.7C252.067 234.5 252.3 234.667 252.7 235.2L253.9 236.3L253.4 235.5V233.2C253.4 232.333 253.467 231.733 253.6 231.4C253.9 231.2 254 230.2 253.8 230C253.8 229.8 251 232 251 232V231.9Z",fill:"#8F4620"}),m.jsx("path",{d:"M259.7 228.9C259.7 228.9 259.7 230.5 260 231.5L260.9 234.5C260.9 234.5 260 233 259.6 231.7C259.2 230.3 258.9 228.9 258.6 228.7C258.2 228.7 257.8 229.4 257.8 230C257.865 231.171 258.136 232.322 258.6 233.4C259.1 234.1 257.9 232.4 257.6 231.5L257 229.8C257 229.8 256.7 230.5 256.8 231.4C257 232.3 257.7 233.5 257.7 233.5L256.9 232.7L256.4 232.2C256.4 232.2 256.4 233.4 256.7 233.9L257.7 235.2L256.7 234.3L256.3 233.8C256.3 233.8 256.4 235.5 256.8 236.4L258 238.7C258 238.7 257 238 256.4 236.5C255.795 234.388 255.525 232.195 255.6 230L256.6 228.5C257 227.8 257.6 224.7 257.6 224.7C257.6 224.7 258.2 227.6 258.7 228.2L259.7 228.9ZM252.8 228L253.4 229.1L253.9 229.9C253.9 229.9 253 230.9 252.1 231.6C251.2 232.3 249.9 233.1 249.6 232.7C249.333 232.233 249.233 231.967 249.3 231.9L251.2 230.4C251.751 229.934 252.194 229.354 252.5 228.7L252.8 228ZM244.1 230.9C244.1 230.9 244.2 232.7 245 232.6C245.8 232.6 248 230.3 248.1 230.2C248.3 230.2 248.4 229.6 248.4 229.4V228.8C248.4 228.8 245.9 231.2 245.1 231.3C244.912 231.336 244.719 231.317 244.541 231.246C244.364 231.175 244.211 231.055 244.1 230.9ZM244.1 228.5L243.9 230.1L244.1 230.8C244.2 230.9 242.4 231.4 242.1 230.8C241.8 230.2 242 229.6 242 229.6L243.2 229.5C243.6 229.4 244.2 228.5 244.2 228.5H244.1ZM260.4 226C260.4 226 261.1 227.8 261.6 228.6L262.7 230.8L261.2 229.2L260.2 228.4L260.4 227.5V226Z",fill:"#1E2121"}),m.jsx("path",{d:"M241.7 229.6H242.7L243.4 229.5L244 228.5C244 228.5 243.7 229.6 244 230.5C244.267 231.167 244.533 231.467 244.8 231.4C245.499 231.289 246.137 230.935 246.6 230.4L248.3 229C248.3 229 248.1 230 248.5 231C248.833 232 249.433 232.167 250.3 231.5C251.1 230.8 251.9 229.7 252.3 229.2L252.9 228.4L253.8 227.7L254.6 223.3L254.1 222.7L253.1 223.3L251.7 222.7L251.3 222.2L250.5 223.5L249.7 224H249.3L248.3 224.3L247.9 223.4L247.7 222.8L247.2 222.6L245.2 224.6L244.2 224.5L243.1 226.2L242.3 227.2L241.5 229.2L241.7 229.6Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M251.1 225.2C251.1 225.2 251.3 226.2 250.7 228.1C250.1 230 249.4 231.1 249.4 231.1C249.4 231.1 251.4 230 252.3 227.9C253.3 225.7 253 223.3 253 223.3L251.1 225.2ZM253.5 223.2C253.5 223.2 253.7 223.5 253.5 225.2L252.9 228.4L253.4 229.3C253.6 229.8 254.3 230.7 254.8 230.6C255.334 230.467 255.9 229.867 256.5 228.8L257.5 226.5C257.767 226.367 257.9 226.433 257.9 226.7C257.9 226.7 258.1 227.7 258.6 228.1C259.1 228.5 259.6 229.1 260 228.9C260.334 228.633 260.5 228.3 260.5 227.9L259.5 224.7L258.2 221.5L257.4 220.3L255.1 220.5L253.5 223.2Z",fill:"#8F4620"}),m.jsx("path",{d:"M257.4 220.3C257.4 220.3 258 221.6 258.1 223.1C258.2 224.6 257.8 226.1 257.8 226.1V223.1C257.7 221.9 257.2 221.4 257.2 221.1L257.4 220.3Z",fill:"#AB6D29"}),m.jsx("path",{d:"M260.5 226V228C260.3 228.5 259.5 227.5 258.9 225.5C258.4 223.5 258.5 223.1 258.1 222.1L257.4 220.3L258.5 220.1L260.5 226ZM254.9 229.8C254.9 229.8 257.1 228.5 257.4 224.8C257.4 223.1 256.4 220.3 256.4 220.3C256.4 220.3 256.4 223.3 255.6 225.3L254.1 228.4L254.9 227.9L255.5 227V228.3L254.9 229.8ZM253 223.3C253 223.3 253 224.1 252 224.8C251.1 225.6 249.5 226.4 249.5 226.4C249.5 226.4 250.7 225.3 251.1 224.3C251.5 223.3 251.2 222.7 251.2 222.7C251.2 222.7 251.1 223.2 250.6 223.7C250.1 224.2 249.3 224.1 249.3 224.1C249.3 224.1 249.3 223.6 249.8 223.1L250 222.5C250.2 221.7 250.9 220.6 250.9 220.6C250.9 220.6 251.4 221.8 251.9 222.3L253 223.3Z",fill:"#4D2A15"}),m.jsx("path",{d:"M259.8 218.9C259.8 218.9 260.3 220.2 260.5 222.1C260.7 223.9 260.5 226.1 260.5 226.1L259.1 223.6L258.6 221.3L257.7 220.5L256.9 220.4C256.9 220.4 257.6 220.1 257.6 219.5V218.7C258.3 218.972 259.062 219.041 259.8 218.9ZM254.9 226.7C254.9 226.7 256.1 225.1 256.4 223C256.7 221 256.4 220.3 256.4 220.3C256.4 220.3 255.9 220.2 255.4 219.8C254.9 219.4 254.4 218.4 254.4 218.4C254.4 218.4 254.6 219.4 254.4 220.8C254.2 222.2 253 223.3 253 223.3C253 223.3 253.6 223.5 254.2 223.2C255.4 222.5 255.2 221.2 255.2 221.2C255.2 221.2 255.5 221.4 255.5 223C255.5 224.6 254.9 226.7 254.9 226.7Z",fill:"#1E2121"}),m.jsx("path",{d:"M241 229.5C240.7 229.5 241.7 227.9 242.4 226.8L244.1 224.1C244.1 224.1 244.3 224.3 244.7 224.3C245.105 224.232 245.491 224.081 245.835 223.857C246.179 223.634 246.473 223.342 246.7 223L247.4 221C247.4 220.7 247.4 222.4 248.2 223.3C249 224.3 248.9 224.2 249.2 224.1C249.2 224.1 249.2 225.3 248.9 226.3L248.3 229C248.3 229 248.4 227 248.1 226.4C247.8 225.8 247.6 226.4 247.3 227.2C247 227.9 246.4 228.4 246.4 228.4L247.2 226.6C247.5 225.
7216 247.3 225.6 247.2 225.6L246.7 225.9C246.3 226.3 246.067 226.467 246 226.4C245.9 226.3 246.4 226.1 246.6 225.6C246.6 225.1 247.1 224.4 247.3 224.2L247.7 223.4C247.7 223.133 247.633 222.933 247.5 222.8C247.367 222.667 247 223 246.4 223.8C245.6 224.5 245.4 224.5 245.4 224.8L244.7 226.8L243.8 229.1L243.4 229.5L244 227.5C244.4 226.5 245 225 244.8 224.8C244.667 224.6 244.5 224.6 244.3 224.8C244.2 225 243.3 225.9 242.6 227C241.9 228.1 241.9 229.5 241.7 229.6L241 229.5Z",fill:"#8F4620"}),m.jsx("path",{d:"M260.5 217.7C260.5 217.8 260.6 218.7 259.8 218.9C259.141 219.097 258.435 219.061 257.8 218.8V217.6L260.5 217.7Z",fill:"#874F20"}),m.jsx("path",{d:"M244.8 220.3L244.2 222C243.7 223 243 223.7 243.1 223.8C243.2 223.9 243.6 224.4 244.3 224.3C245 224.2 245.1 220.5 245.1 220.5V220.3H244.8Z",fill:"#B27129"}),m.jsx("path",{d:"M254.8 218.2C254.8 218.2 254.4 223.2 253 223.2C251.6 223.2 251 220.7 251 220.7C251 220.7 250.8 224.2 249 224.2C248.1 224.2 247.3 221.5 247.4 221C247.4 221 247.1 222.8 246.2 223.5C244.5 224.9 243.4 224.2 243.4 224C243.3 223.8 244.8 222.3 245 220.3C245 220.433 245.234 220.267 245.7 219.8C246.1 219.133 246.434 218.767 246.7 218.7C247.2 218.7 249.3 217.8 249.3 217.8L250.3 216.5C250.3 216.5 250.5 216.9 251.3 216.4C251.763 216.041 252.111 215.554 252.3 215L254.5 216.8L254.7 218.2H254.8Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M249.1 213.3L251.3 216.3L251.8 215.9C252.066 216.3 252.166 216.633 252.1 216.9C251.8 217.6 251.1 218.7 251.6 219.9C251.533 219.833 251.6 219.333 251.8 218.4C252.066 217.6 252.3 217.267 252.5 217.4C252.7 217.4 253 222 253.3 222C253.6 222 254 219.9 254 218.4C254 216.9 254.3 218.1 254.5 218.4C254.6 218.7 255.9 220.8 257 220.4C258 220.2 258 218.2 257.9 217.8L257.1 214.8L252.2 211.8L251.8 213C251.5 213.8 249.1 213.3 249.1 213.3Z",fill:"#B27129"}),m.jsx("path",{d:"M256 212.8C256 212.8 256.3 213.1 256.8 214.3C257.3 215.5 257.3 219.4 256.8 219.4C256.1 219.4 254.8 218.7 254.6 218.1C254.4 217.6 254.7 215.7 254.3 215.1C253.841 214.43 253.503 213.686 253.3 212.9L253.4 211.4L254.5 211L256.1 212.8H256Z",fill:"#8F4620"}),m.jsx("path",{d:"M255.7 211.6L257.7 214.7L259.7 217.3L260.5 217.7C260.194 218.045 259.777 218.273 259.322 218.346C258.866 218.419 258.399 218.332 258 218.1C257.3 217.7 257.7 216.5 256.8 214.5C256.199 213.297 255.305 212.266 254.2 211.5L254.8 211L255.8 211.6H255.7Z",fill:"#4D2A15"}),m.jsx("path",{d:"M254.6 210C254.6 210 256.4 211.1 257.1 212.5L258.9 215.9C259.7 217.2 260.6 217.6 260.5 217.7C260.433 217.833 260.1 217.833 259.5 217.7L258.5 216.4L256.5 213C255.959 212.393 255.316 211.886 254.6 211.5L255.9 213.2C256.383 213.956 256.691 214.81 256.8 215.7L255.8 214.1C255.2 212.9 253.7 211.4 253.6 211.6L254.8 214L255.8 216.6L254.4 214.3C253.6 213 253.4 213.2 253.1 212.8L252 211.4C252 211.4 252.7 211.6 253.5 211.1C254.2 210.6 254.5 209.9 254.5 209.9L254.6 210Z",fill:"#1E2121"}),m.jsx("path",{d:"M249.8 213.3C249.8 213.3 251 213.6 251.7 213.5H252.6C252.6 213.5 253 214 253 214.6C253 215.2 252.5 216.3 252.4 216.4C252.2 216.4 252.2 215.4 251.9 215L249.9 213.3H249.8Z",fill:"#8F4620"}),m.jsx("path",{d:"M250.5 216.5C250.5 216.5 250.9 217.8 250.5 219.5C250.3 221.4 249.2 223.2 249 223.2C248.7 223.2 248.8 221.2 248.7 220.2V219.8L248.2 221C248.2 220.9 248.6 219.1 248.5 219V218.3L249.8 216.7L250.5 216.5Z",fill:"#B27129"}),m.jsx("path",{d:"M248.2 217.8C247.8 218.3 247.2 218.1 246.8 218.3C246.3 218.4 246.1 219.2 246.1 219.2C246.1 219.2 246.5 218.9 246.7 219C246.9 219.1 247.1 219 246.7 220C246.3 220.8 244.9 222.3 245 222.4C245 222.4 246.6 221.1 247 220.4C247.6 219.6 247.5 219.2 247.6 218.9C247.7 218.6 248.3 218.3 248.5 218.3C248.634 218.167 248.8 218.367 249 218.9L249.4 220.9L250.1 218.9L250.2 216.6L249.7 216.5L248.5 215.8C248.5 215.8 248.7 217.2 248.2 217.8Z",fill:"#8F4620"}),m.jsx("path",{d:"M254.6 208.6C254.6 208.6 255.1 209.9 254.1 210.7C253.833 210.967 253.467 211.133 253 211.2C252.4 211.2 251.6 210.7 251.6 210.7L248.5 209.4L246.8 208.9L246 208.7L246.1 207.8L248.6 207.9L251 208.9L252 209.2L253 209.3H253.6L254.2 209.2L254.5 208.9L254.6 208.6Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M254.6 208.6C254.7 208.8 254.4 209.6 254.2 209.6C254 209.8 253.467 209.833 252.6 209.7C251.6 209.5 250.7 208.9 249.6 208.7C248.667 208.3 247.833 208.1 247.1 208.1C246 208.1 246.6 207.7 246.6 207.7C246.6 207.7 248.5 207.5 250.1 208.1C251.7 208.7 252.4 209.1 253.2 209.1C254.4 209.1 254.6 208.6 254.6 208.6Z",fill:"#AB6D29"}),m.jsx("path",{d:"M246.1 207.7H246.8L247.3 207.5L247.2 208H246.2L246.1 207.7Z",fill:"#4D2A15"}),m.jsx("path",{d:"M252.2 211.5C252.2 211.5 253.3 212.5 253 213.5L251 212.5L247.5 211.1L245.7 210.5L245.4 210.2L246 209.6V209L248.3 209.3L250.7 210L252.2 211.5Z",fill:"#DBAD6C"}
721),m.jsx("path",{d:"M249.9 213C249.9 213 251.9 215.5 251.4 216.4L246.9 213.4L245.2 216.1L241.5 214.3C241.5 214.3 244.5 212 244.9 211.5L245.2 210.9L246.9 211.3L249.6 212.1L249.9 213Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M248.8 209.3C248.8 209.3 250.4 209.7 251.5 210.3C252.5 210.7 253.9 210.9 253.9 210.9C253.9 210.9 253.3 211.5 252.2 211.5C251.733 211.367 251.2 211.033 250.6 210.5C249.7 209.7 248.6 209.7 248.6 209.7L248.8 209.3Z",fill:"#AB6D29"}),m.jsx("path",{d:"M246 208.4L247.9 209C248.6 209.3 248.6 209.2 248.9 209.2L249 209C249 209 249.2 209.7 248.6 209.7C248 209.7 247.9 209.5 247.2 209.2C246.5 208.9 246 209.2 246 209.2V208.4Z",fill:"#4D2A15"}),m.jsx("path",{d:"M252.3 212.9C252.3 212.9 253.2 213.4 253 213.5C252.867 213.633 252.434 213.733 251.7 213.8C251.1 213.8 250.6 213.733 250.2 213.6C249.6 213.4 249.4 212.5 248.2 212L245.9 211.2L244.9 211L245.7 210.7L248.3 211.2L250.5 211.9L251.8 212.5L252.3 212.9ZM248 214.4L248.5 216.4L248.2 217.7L247.5 218.1L246.9 217.9L246.7 217.5C246.7 217.5 247 217 246.7 216.6C246.4 216.2 245.1 215.6 245.1 215.6C245.1 215.6 245.6 214.6 246.1 214.4C246.8 214.2 246.5 213.4 246.5 213.4L248 214.4Z",fill:"#AB6D29"}),m.jsx("path",{d:"M245.4 210.2C245.4 210.2 245.8 210.6 246.7 210.7L248.4 211C248.6 211.1 249.2 210.8 249.3 210.8L248.8 211.1L250.8 211.8C251.7 212.2 252.4 212.8 252.4 212.8L250.8 212.1L248.4 211.4C246.8 211.1 245.3 211.2 244.9 211.1C244.5 211 245.1 211 245.2 210.8C245.4 210.533 245.466 210.333 245.4 210.2Z",fill:"#4D2A15"}),m.jsx("path",{d:"M251.2 215.8C251.2 215.8 251.7 216.4 251.2 216.6C250.7 216.8 249.2 216.7 248.6 216L248.2 215C247.9 214.7 246.9 214 246.2 213.7C245.7 213.3 246.5 213.2 246.5 213.2L249.4 214.5C250.2 214.9 251.2 215.8 251.2 215.8Z",fill:"#AB6D29"}),m.jsx("path",{d:"M251.3 215.9C251.3 215.9 250.3 214.5 247.3 213.3L248.2 213.1H246.7L246 212.8C244.4 212.4 244.3 212.4 244.2 212.2C244.134 212.067 244 212.167 243.8 212.5L243.2 213.3C243.848 213.098 244.536 213.063 245.2 213.2C246 213.4 246.267 213.7 246 214.1C246 214.4 244.9 215.7 245 215.7C245.1 215.7 245.7 214.5 246.5 214.7C247.234 214.967 247.567 215.167 247.5 215.3L247.4 214.6C247.2 214.4 246.4 213.6 246.6 213.6C246.8 213.6 247.8 213.9 249.2 214.6C250.6 215.3 250.8 215.5 251.2 215.9H251.3Z",fill:"#4D2A15"}),m.jsx("path",{d:"M246.5 213.6C246.5 213.6 248.7 214.3 248.6 216.6C248.6 219 246.8 218.6 246.6 217.7C246.4 216.8 246.9 218.1 247.5 218C248.167 217.867 248.433 217.3 248.3 216.3C248.3 215.5 248.033 214.9 247.5 214.5L246.5 213.6Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M236.8 208C236.8 208 237.1 208 236.4 209.8C236.01 211.023 235.362 212.148 234.5 213.1C232.7 215.1 231.9 215.1 232.1 215.9C232.3 216.8 233 216.6 233.1 216.6C233.3 216.6 236.6 211.8 236.6 211.8L237.3 209L237.1 208.2L236.9 207.9L236.8 208Z",fill:"#6C3F18"}),m.jsx("path",{d:"M244.9 204.5C244.9 204.5 245.9 205.9 245.5 208.5C245.2 211.2 241.7 213.5 241.7 213.5L236.7 217.1L234.5 216.9H233.9L233.2 216.5C233 216.5 232.8 215.5 232.8 215.5L233.4 214.7L235.3 212.9L236.4 211.2C236.4 211.2 237 210.2 237 209.3L236.9 207.9L237.3 208.6L237.5 210L237.3 211.6L238.7 210.6L240.4 209.9C240.4 209.9 240.9 209.8 241.3 208.9C241.6 207.9 241.9 206.4 241.9 205.7V204.3H242.1C242.1 204.4 242.6 205.3 242.6 205.7L242.9 207.9L243.8 207.1L244.5 205.9L244.9 204.5Z",fill:"#DBAD6C"}),m.jsx("path",{d:"M245.5 217.8C245.5 217.8 245.8 218 245.7 219C245.6 220 244.7 220.5 244.4 220.5V219.2L243.3 218.2L242.1 217.9L242.3 217.7C242.4 217.5 243.7 217 243.7 217L245.5 217.8Z",fill:"#904720"}),m.jsx("path",{d:"M244.6 217.8C244.6 217.8 244.9 218.1 245.5 218C246.1 217.9 246.3 217 246 216.6C245.7 216.2 245.8 217.4 245.5 217.6C245.1 217.6 244.7 216.6 244.2 216.6C243.7 216.4 242.9 216.8 242.7 217.1C242.5 217.4 243.5 217.1 243.5 217.1L244.1 217.3L244.5 217.4L244.6 217.8Z",fill:"#AB6D29"}),m.jsx("path",{d:"M237.2 214.1C237.2 214.1 237.9 214.3 238.6 214.2C239.3 214.1 241.1 213.4 241.1 213.4L242.5 212.4C243.1 211.7 245 210.6 245.2 208.2C245.4 205.9 244.9 204.5 244.9 204.5C244.9 204.5 247.7 207.5 245.2 211C243.6 213.3 242.2 214 242.2 214C242.2 214 245 213.2 245.2 213.9C245.4 214.5 245.1 215.5 245 215.7C245 215.7 246.5 216 246.8 216.8C246.9 217.3 245 216.3 243.6 216.6C242.829 216.792 242.132 217.21 241.6 217.8C241.6 217.8 241.3 217.4 240.1 217.4C238.8 217.4 238.2 218 237.5 217.9C236.8 217.8 234.5 217.4 234.1 216.8L235.6 215.1C236.3 213.8 237.2 214.1 237.2 214.1Z",fill:"#904720"}),m.jsx("path",{d:"M243 207.8C243 207.8 244.1 206.8 244.5 205.9L244.9 204.5C244.9 204.5 245 205.3 244.4 206.3L243 207.8Z",fill:"#AB6D29"}),m.jsx("path",{d:"M242.7 205.4C242.7 205.4 243.7 208.8 242.7 210.3C241.7 211.7 237.6 213.5 237.6 213.5C237.6 213.5 240.7 211.8 241.6 209.9C242.6 207.9 242.6 206.3 242.6 206.3L242.7 205.4Z",fill:"#904720"}),m.jsx("path",{d:"M238.6 214.2C238.6 214.2 239.9 214.2 240.6 213.7C241.4 213.3 242.5 212.3 242.5 212.3C242.5 212.3 241.5 213.2 241.2 213.2C240.866 213.067 240.733 212.8 240.8 212.4C240.8 212.4 240.6 213.1 240 213.5L238.6 214.2ZM241.6 209.9C241.6 209.9 242.8 208.7 242.8 206.3C242.8 203.9 241.8 204.3 241.8 204.3C241.8 204.3 242.6 204.9 242.4 206.7C242.3 208.6 241.7 209.9 241.7 209.9H241.6ZM243 210.1C243 210.1 244.3 209.8 244.7 209.1C245.2 208.3 245.2 206.9 245.2 206.9C245.2 206.9 245 208.2 244.7 208.7C244.3 209.2 243 210.1 243 210.1ZM242.3 217.7C242.3 217.7 242.9 216.5 243.7 216.7C244.6 217.1 244.6 217.7 244.6 217.7C244.6 217.7 244.3 217.3 243.6 217.2L242.3 217.7ZM239.9 215.5L242.9 214.7L245.2 213.9C245.2 213.9 244.3 214.9 243 215.8C241.466 216.467 240.633 216.733 240.5 216.6C240.3 216.4 243 215.5 243.2 215C243.2 215 240.8 215.7 239.9 215.5Z",fill:"#1E2121"}),m.jsx("path",{d:"M237 212.7C237.464 213.018 237.782 213.508 237.886 214.061C237.989 214.614 237.868 215.186 237.55 215.65C237.231 216.114 236.742 216.433 236.189 216.536C235.635 216.639 235.064 216.518 234.6 216.2",fill:"white"}),m.jsx("path",{d:"M236.9 212.9C237.192 213.225 237.364 213.64 237.385 214.076C237.407 214.512 237.278 214.942 237.02 215.295C236.762 215.647 236.39 215.899 235.968 216.009C235.545 216.12 235.
721098 216.081 234.7 215.9",fill:"#F16E16"}),m.jsx("path",{d:"M236 214C236.152 213.986 236.305 214.016 236.44 214.086C236.576 214.156 236.689 214.263 236.765 214.395C236.842 214.527 236.879 214.678 236.873 214.83C236.866 214.983 236.816 215.13 236.729 215.255C236.641 215.38 236.52 215.478 236.379 215.536C236.238 215.594 236.083 215.611 235.933 215.584C235.783 215.557 235.643 215.488 235.531 215.385C235.419 215.281 235.339 215.148 235.3 215",fill:"black"}),m.jsx("path",{d:"M236.2 214.9C236.187 214.966 236.148 215.025 236.092 215.062C236.035 215.1 235.967 215.113 235.9 215.1C235.834 215.087 235.776 215.048 235.738 214.991C235.701 214.935 235.687 214.866 235.7 214.8C235.695 214.763 235.7 214.725 235.716 214.69C235.731 214.656 235.756 214.627 235.787 214.606C235.819 214.585 235.855 214.573 235.893 214.572C235.931 214.571 235.968 214.581 236 214.6C236 214.6 236.2 214.7 236.2 214.9Z",fill:"#D5D3CA"}),m.jsx("path",{d:"M237.5 211.3C237.5 211.3 238.7 210.1 239 208.5V206L239.7 206.7L240 207.9L239.6 209.9L240.9 209.3C241.66 207.748 242.005 206.025 241.9 204.3C241.9 204.3 242.2 205 241.7 207.3C241.2 209.6 240.8 209.9 239.1 210.9C237.808 211.693 236.767 212.838 236.1 214.2L234.2 216.7C234.2 216.7 235.1 215.5 235.5 214.5C236.3 213.1 236.767 212.367 236.9 212.3L237.5 211.3Z",fill:"#AB6D29"}),m.jsx("path",{d:"M236.9 212.3C236.9 212.3 237.4 210.7 237.4 209.8C237.4 208.9 236.8 207.9 236.8 207.9C236.8 207.9 237.6 207.9 237.7 209.7C237.7 211.7 237.4 211.7 236.9 212.3Z",fill:"#904720"}),m.jsx("path",{d:"M239.3 210.3C239.3 210.3 239.9 208.8 239.9 207.9C239.9 206.9 239.1 206 239.1 206C239.1 206 240.1 206.2 240.1 208C240.1 209.7 239.9 209.7 239.3 210.3Z",fill:"#4D2A15"}),m.jsx("path",{d:"M233.7 216.8C233.7 216.8 233.2 216.2 233.3 215.8C233.4 215.4 233.3 215.2 234.4 214C235.21 213.293 235.888 212.446 236.4 211.5C236.7 210.9 237.6 209.2 236.9 207.9C236.9 207.9 237.4 209.9 236.3 211.3C235.561 212.434 234.65 213.447 233.6 214.3C232.6 215 232.6 215.3 232.6 215.7C232.6 216.1 232.7 216.367 232.9 216.5L233.7 216.8Z",fill:"#AB6D29"}),m.jsx("path",{d:"M244.4 220.5C244.4 220.5 244.6 220.5 244.8 220.2C244.933 219.933 244.833 219.533 244.5 219C244.168 218.552 243.717 218.206 243.2 218L241.6 217.8C241.6 217.8 241.9 218.4 242.6 218.8C243 219 243.6 218.8 244 219.1C244.3 219.5 244.4 220.5 244.4 220.5Z",fill:"#6C4119"}),m.jsx("path",{d:"M244.4 220.5C244.4 220.5 245.6 220.1 245.7 218.9L245.6 217.9C245.6 217.9 245.8 218.3 246.3 218.5L246.7 218.3C246.7 218.3 246 220.6 244.4 220.5Z",fill:"#6C4119"}),m.jsx("path",{d:"M235.8 220.3L236.5 220.9L237.2 221.6L240.2 220.8L241.2 219.9L240.3 218.6H238.2L235.8 220.3Z",fill:"#BF802D"}),m.jsx("path",{d:"M243 219.3L242.5 218.5C242.5 218.5 242.3 218.2 241.9 218C241.5 217.8 239.7 217.8 239.7 217.8L238.4 218C238.4 218 238 218.4 237.4 218.2L235.2 217.5L233.8 216.8C233.8 216.8 232.7 216.4 232.4 216.5C232.2 216.5 231.4 217.5 231.4 217.5C231.4 217.5 231.1 218.1 231.5 218.1C231.8 218.1 231 218.3 231 218.3C231 218.3 228.7 219.5 228.4 221.7C228.1 223.9 232.1 227.2 233.6 225.5C233.6 225.5 231.4 223.9 231.8 222.5C232.2 221.167 233.266 220.4 235 220.2C236.7 220.2 236.8 219.9 237.6 219.4C238.3 218.8 239.7 218.5 240.8 219.6C241.8 220.7 236.8 221.7 236.8 221.7L237.4 222.5C237.4 222.5 243.5 220.4 243 219.3Z",fill:"#F9C83A",stroke:"#8F4620",strokeWidth:"0.3"}),m.jsx("path",{d:"M231.5 224.5C231.5 224.5 229 223.9 229.2 221.6C229.31 220.869 229.621 220.183 230.098 219.619C230.574 219.054 231.198 218.632 231.9 218.4C232.3 218.3 232.2 217.1 232.6 217C233 216.9 233.8 217 234.2 217.3C234.5 217.7 235.3 218 235.3 218C235.3 218 230.9 220 230.8 222.5C230.8 224.2 231.5 224.5 231.5 224.5Z",fill:"#FCF3D8"}),m.jsx("path",{d:"M243 219C243 219 242.7 219.2 242.6 219C242.2 218.2 241.1 218 240.2 218C239.1 218 238.3 218.4 237.5 218.4L236.1 218.2C235.1 218.2 233.3 216.8 232.8 216.9C232.4 217.167 232.233 217.5 232.3 217.9C232.3 218.1 231.5 218.2 231.3 217.9C231.1 217.6 232 216.5 232.8 216.5C234.9 216.5 236.5 217.9 237.5 217.9C238.5 217.9 238.8 217.4 240.2 217.4C241.6 217.4 243 218 243 219Z",fill:"#FDEAAF"}),m.jsx("path",{d:"M236.2 220.7L237.9 220.1L239.7 219.5L238.1 220.5L236.4 220.9L236.2 220.7Z",fill:"#513625"}),m.jsx("path",{d:"M232.6 225.8C232.466 226 231.666 225.7 230.2 224.9C228 223.7 228.4 222.4 228.4 222.4C228.4 222.4 228.1 220.9 229.6 219.4C231 217.8 231.2 218.3 231.3 218.4V218.5L230 219.5L229.3 220.6L228.8 221.6V222.6L229.5 223.8L231.5 225.1L232.6 225.8Z",fill:"#F9C83A"}),m.jsx("path",{d:"M231.9 217.2V217L231.7 217.1L231.9 217.2ZM231.9 217.2H231.7V217.3L231.9 217.2ZM231.9 217.2H231.7L231.3 217.7L231.1 218.2C231.1 218.4 231.2 218.567 231.4 218.7H232.6V218.4L232.4 218.3H231.6V218L231.9 217.6V217.2ZM231.9 217.2V217L231.8 216.8C231.762 216.795 231.724 216.8 231.69 216.816C231.655 216.831 231.626 216.856 231.605 216.887C231.584 216.919 231.573 216.955 231.572 216.993C231.571 217.03 231.58 217.068 231.6 217.1L231.9 217.2Z",fill:"#8B5122"}),m.jsx("path",{d:"M236.1 219.3L233.1 220.2C232.8 220.4 234 220.2 234.9 220.2H236.7C237.9 219.7 240.3 218.8 240.5 219.8C240.7 220.8 237.2 221.5 237.2 221.5V221.8L240 221.1L241.4 220.4L241.9 219.6L240.5 218.6H238.5L237.5 218.9L236.1 219.3Z",fill:"#F9C83A"}),m.jsx("path",{d:"M231.8 223.6C232 224.2 232.5 225.1 233 225.4C233 225.667 232.567 225.733 231.7 225.
7216C230.7 225.3 229.3 224.9 228.4 222.3V222.8L228.9 223.8L229.9 224.8L231.3 225.8L232.3 226L233.2 225.8L233.6 225.5L232.7 224.7L231.7 222.9V223.6H231.8Z",fill:"#8F4620"}),m.jsx("path",{d:"M241.7 250.1V251.1H241.1L241.2 249.8L241.7 250.1ZM237.9 222.6L236.9 221.5H236.3L237.3 222.9L237.9 222.6Z",fill:"#FCCA3D"}),m.jsx("path",{d:"M241.6 252.4L240.3 251.6L238.3 251.1V251.4H238.5L240.2 251.9L241.5 252.6L241.6 252.4ZM241.6 249.9H239.4C238.6 250.167 238.2 250.367 238.2 250.5L238.3 250.7C238.899 250.243 239.649 250.029 240.4 250.1H241.5L241.6 249.9ZM241.3 247.8L239.3 248.8L237.9 249.8L238.1 250L238.5 249.7L239.4 249.1L241.4 248.1L241.3 247.8ZM239.9 245.6L239.7 246.6L239.2 247.2L237.9 248.6L237.2 249.3L237.3 249.5L238.5 248.3L239.4 247.3L239.9 246.7C240.166 246.1 240.266 245.767 240.2 245.7H239.9V245.6ZM238.2 244.6C238.352 245.196 238.317 245.824 238.1 246.4L237.3 248.1L236.9 248.9L236.8 249.2H237C237 249.2 238 247.5 238.3 246.5L238.5 245.3V244.6H238.2ZM236.5 244.4V245.4L236.4 246.7L235.9 248.2L235.6 249H235.8L236.6 246.8C236.8 246.333 236.866 245.833 236.8 245.3V244.4H236.5ZM235.2 244.4V245.4L235.1 246.9L234.7 248.9H234.9L235 248.3L235.3 247C235.5 246.1 235.5 244.4 235.5 244.4H235.2ZM233.9 244.7V246.9C233.6 247.7 233.5 248.9 233.5 248.9H233.8L234.1 247V244.6L233.9 244.7ZM232.8 244.7V244.9L232.5 246.7L232.1 248.2L231.9 249L232.1 249.1L232.8 246.8L233 244.9V244.8H232.8V244.7ZM231.5 244.8V245.3C231.5 245.833 231.4 246.4 231.2 247C230.933 247.533 230.6 247.933 230.2 248.2L229.5 248.7H229.4L229.5 248.9C229.5 248.9 230.9 248.1 231.5 247.1C231.779 246.367 231.881 245.58 231.8 244.8H231.5ZM230.8 244.6V244.7L230 246.2L229 247.2L228.5 247.4L228.3 247.5L228.4 247.8C228.4 247.8 229.6 247.1 230.2 246.4C230.7 245.7 231 244.6 231 244.6H230.8ZM229.6 244V244.1L229.2 244.6C229.2 244.8 229.1 244.967 228.9 245.1L228.1 245.6L227.6 245.9L227.7 246.1L228.2 245.8L229 245.3L229.6 244.6L229.8 244.1L229.6 244ZM229 243.2L228.8 243.5L228.1 244.2L227.7 244.6L227.4 244.8V245L228 244.7L229.2 243.4L229 243.2ZM228.8 242.7L228.6 242.9L227.9 243.3L227.2 243.6V243.9C227.4 243.9 227.566 243.833 227.7 243.7L228.9 242.9L228.8 242.7ZM228.5 242.2L227.9 242.5L227.5 242.7L227.1 242.9V243.1L227.6 243L228.6 242.4L228.5 242.2ZM228.3 241.1L227.8 241.5L227.1 241.8V242C227.5 242 227.833 241.867 228.1 241.6L228.5 241.3L228.3 241.1ZM228.3 239.3L227.9 239.7L227.3 240.5L227.2 240.6V240.9L227.4 240.8L227.5 240.6C227.5 240.4 227.7 240.167 228.1 239.9L228.4 239.7L228.5 239.5L228.3 239.3ZM236.9 229.1H238.2V229L238.1 229.1V229H238V228.9H238.1H236.9V229.1ZM236.9 228.3L237.5 228.2L238.3 227.7L238.6 227.4H238.9V227.1L238.4 227.3L237.6 227.8L236.9 228.1V228.3ZM236.9 227.1L237.4 226.9L238.4 226.3L239.1 226V225.7L238.6 225.9L237.6 226.5L236.8 226.9V227.1H236.9ZM236.4 226.1L237.6 225.1L238.9 224.2L238.8 224L237.5 225L236.3 225.8L236.4 226.1ZM235.6 224.8L238.2 222.9L238 222.7L235.4 224.6L235.6 224.8ZM234.4 223.5L235.9 222.5L237.1 221.7L237 221.5L235.8 222.3L234.3 223.3L234.4 223.5ZM233.6 222.8L235.7 221.3L236.3 220.9V220.7L235.6 221L233.4 222.6L233.6 222.8Z",fill:"#816C2A"}),m.jsx("path",{d:"M235.6 220.3L237.6 222.3C238.467 223.367 238.933 224.467 239 225.6V226C238.727 227.496 238.033 228.884 237 230C235.5 231.9 233.2 233.5 231.4 235.1C230.5 235.831 229.693 236.67 229 237.6C228.39 238.41 228.042 239.387 228 240.4V240.5C228 241.567 228.333 242.467 229 243.2C229.597 244.034 230.492 244.607 231.5 244.8H232.1C233.5 244.8 235.1 244.3 236.6 244.3C237.8 244.233 238.967 244.733 240.1 245.8C241.1 246.9 241.4 248.7 241.4 250.4L241.1 253.7L240.8 255.2H241C241 255.2 241.7 252.9 241.7 250.4C241.7 248.7 241.3 246.8 240.3 245.6C239.819 245.109 239.243 244.723 238.606 244.465C237.97 244.207 237.287 244.082 236.6 244.1C235 244.1 233.5 244.5 232.1 244.5H231.5C231.034 244.462 230.583 244.316 230.184 244.073C229.785 243.829 229.448 243.496 229.2 243.1C228.663 242.335 228.351 241.434 228.3 240.5V240.4C228.3 239.133 228.833 237.967 229.9 236.9C231.3 235.3 233.5 233.7 235.4 231.9C237.4 230.3 239 228.4 239.3 225.9V225.6C239.3 224.2 238.3 222.8 237.4 221.7L235.6 220V220.3Z",fill:"#78732E"}),m.jsx("path",{d:"M233.7 222.8L233.4 222.5L233.1 222.6L233.6 223L233.7 222.8ZM234.5 223.5L234.3 223.3H234.1L234.3 223.6L234.5 223.5Z",fill:"#A8AC71"}),m.jsx("path",{d:"M235.6 224.8L235.4 224.5L235.3 224.7L235.6 224.8ZM236.4 226V225.8H236.1L236.4 226.1V226ZM236.9 227.2V226.9H236.8L236.9 227.2ZM227.2 241L227.3 240.4C227.4 240.1 227.1 240.5 227.1 240.5V240.9H227.2V241Z",fill:"#78732E"}),m.jsx("path",{d:"M227.1 241.7V242.1H227.2L227.1 241.7Z",fill:"white"}),m.jsx("path",{d:"M227.2 243.1V242.8H227V243.3L227.2 243.1Z",fill:"#78732E"}),m.jsx("path",{d:"M227.3 243.9V243.6H227.1V243.9H227.3ZM227.8 246.2L227.6 245.8V246.2H227.8Z",fill:"white"}),m.jsx("path",{d:"M228.5 247.8L228.4 247.5H228.2L228.5 247.8ZM229.7 248.9L229.3 248.6C229.1 248.4 229.2 248.8 229.2 248.8L229.5 249L229.7 248.9ZM237.5 249.5L237.2 249.3L237.4 249.6V249.5H237.5Z",fill:"#A8AC71"}),m.jsx("path",{d:"M238.2 250L237.9 249.8V250H238.1H238.2Z",fill:"white"}),m.jsx("path",{d:"M238.3 250.3L238.1 250.5L238.4 250.7L238.3 250.3Z",fill:"#A8AC71"}),m.jsx("path",{d:"M238 252.6V252.3L237.8 252.6H238ZM226 210.9C226 210.9 226.5 210.8 226.1 211.3L226.4 210.9L226.2 210.8L226 210.9Z",fill:"white"}),m.jsx("path",{d:"M235.7 220L236 220.3L235.6 220.2L235.7 220Z",fill:"#F9C83A"}),m.jsx("path",{d:"M236 220.3H235.4L235.6 220.2L236 220.3Z",fill:"#8F4620"}),m.jsx("path",{d:"M240.7 255.3C240.7 255.3 241.1 255.3 241.2 255C241.4 254.8 241.2 255.3 241.2 255.3L240.9 255.4L240.7 255.3Z",fill:"#977C2E"})]}),m.jsxs("defs",{children:[m.jsxs("radialGradient",{id:"paint0_radial_4989_137735",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(2.78573 1.17983 -1.15213 2.79993 234.885 267.814)",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"white"}),m.jsx("stop",{offset:"1",stopColor:"#F15770"})]}),m.jsxs("radialGradient",{id:"paint1_radial_4989_137735",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(-0.27566 -2.98743 2.7721 -0.263226 214.229 257.819)",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"white"}),m.jsx("stop",{offset:"1",stopColor:"#F15770"})]}),m.jsxs("radialGradient",{id:"paint2_radial_4989_137735",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(1.00364 1.19767 -2.32347 2.00377 290.391 274.461)",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"white"}),m.jsx("stop",{offset:"1",stopColor:"#F15770"})]}),m.jsx("clipPath",{id:"clip0_4989_137735",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})]})]}),BJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_myr)",children:[m.jsx("path",{d:"M0 0H512V36.6H0V0Z",fill:"#CC0000"}),m.jsx("path",{d:"M0 36.6001H512V73.0001H0V36.6001Z",fill:"white"}),m.jsx("path",{d:"M0 73.1001H512V109.7H0V73.1001Z",fill:"#CC0000"}),m.jsx("path",{d:"M0 109.7H512V146.3H0V109.7Z",fill:"white"}
721),m.jsx("path",{d:"M0 146.3H512V182.9H0V146.3Z",fill:"#CC0000"}),m.jsx("path",{d:"M0 182.9H512V219.4H0V182.9Z",fill:"white"}),m.jsx("path",{d:"M0 219.4H512V256H0V219.4Z",fill:"#CC0000"}),m.jsx("path",{d:"M0 256H512V292.6H0V256Z",fill:"white"}),m.jsx("path",{d:"M0 292.6H512V329H0V292.6Z",fill:"#CC0000"}),m.jsx("path",{d:"M0 329.1H512V365.7H0V329.1Z",fill:"white"}),m.jsx("path",{d:"M0 365.7H512V402.3H0V365.7Z",fill:"#CC0000"}),m.jsx("path",{d:"M0 402.3H512V438.9H0V402.3Z",fill:"white"}),m.jsx("path",{d:"M0 438.9H512V475.4H0V438.9Z",fill:"#CC0000"}),m.jsx("path",{d:"M0 475.4H512V512H0V475.4Z",fill:"white"}),m.jsx("path",{d:"M0 0H256V292.6H0V0Z",fill:"#000066"}),m.jsx("path",{d:"M166 93.0001L170.8 125.5L189.2 98.3001L179.2 129.6L207.7 113L185.2 137L218 134.4L187.3 146.3L218 158L185.2 155.5L207.7 179.5L179.3 162.8L189.1 194.3L170.7 167L165.9 199.5L161.2 167L142.8 194.2L152.7 162.8L124.3 179.5L146.7 155.5L113.9 158L144.6 146.2L114 134.3L146.8 136.9L124.3 112.9L152.7 129.5L142.7 98.1001L161.2 125.4L166 92.8001V93.0001Z",fill:"#FFCC00"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_myr",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),VJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_ngn)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M341.3 0H512V512H341.3V0ZM0 0H170.7V512H0V0Z",fill:"#008753"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_ngn",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),HJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_nok)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#ED2939"}),m.jsx("path",{d:"M128 0H256V512H128V0Z",fill:"white"}),m.jsx("path",{d:"M0 192H512V320H0V192Z",fill:"white"}),m.jsx("path",{d:"M160 0H224V512H160V0Z",fill:"#002664"}),m.jsx("path",{d:"M0 224H512V288H0V224Z",fill:"#002664"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_nok",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),WJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_npr)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.5 505.5H385.3L137.4 254.1L394.7 254.4L6.6 6.5V505.5H6.5Z",fill:"#CE0000",stroke:"#000063",strokeWidth:"13"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M180.7 371.8L153.7 380.8L174.9 400.6L146.4 398.8L158.1 425L132.6 412.7L133.1 441.3L114.3 420.4L103.6 447L94.4 420.7L74.1 441.3L75.9 413.6L49 425L61.6 400L32.3 400.6L53.8 382.3L26.5 371.8L53.5 362.8L32.2 343L60.6 344.8L49 318.6L74.6 330.9L74.1 302.3L92.9 323.2L103.6 296.6L112.7 322.9L133.1 302.3L131.2 330L158.2 318.6L145.5 343.6L174.9 343L153.4 361.3L180.7 371.8Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_npr",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),qJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_nzd)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#00247D"}),m.jsx("path",{d:"M396.394 157.728V166.813L414.564 157.728H396.394Z",fill:"#CC142B"}),m.jsx("path",{d:"M468.428 221.214L468.428 228.785L483.569 221.214L468.428 221.214Z",fill:"#CC142B"}),m.jsx("path",{d:"M312.462 242.252L312.462 251.337L330.632 242.252L312.462 242.252Z",fill:"#CC142B"}),m.jsx("path",{d:"M396.394 374.857V385.456L417.592 374.857H396.394Z",fill:"#CC142B"}),m.jsx("path",{d:"M0 0H256V256H0V0Z",fill:"#012169"}),m.jsx("path",{d:"M256 0V32L161 128L256 221.5V256H222.5L127 162L34 256H0V222L93 128.5L0 37V0H31L127 94L220 0H256Z",fill:"white"}),m.jsx("path",{d:"M0 104V152H256V104H0ZM104 0V256H152V0H104Z",fill:"#C8102E"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_nzd",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),zJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_php)",children:[m.jsx("path",{d:"M0 0H512V256H0V0Z",fill:"#0038A8"}),m.jsx("path",{d:"M0 256H512V512H0V256Z",fill:"#CE1126"}),m.jsx("path",{d:"M443.4 256L0 512V0",fill:"white"}),m.jsx("path",{d:"M158.9 148L152.3 154.6L155.5 204.9L152.2 205.2L146.2 159.3L140.7 164.7L148.9 205.7C142.32 207.03 136.067 209.647 130.5 213.4L107.2
721178.6H99.5L127.7 215.4L125.2 217.5L91.9 179.5H82.5V189L120.5 222.3L118.3 224.8L81.5 196.6V204.3L116.3 227.6C112.583 233.174 110 239.427 108.7 246L67.7 237.8L62.2 243.3L108.2 249.3L107.8 252.7L57.5 249.4L50.8 256L57.5 262.6L107.8 259.4L108.1 262.7L62.2 268.7L67.6 274.2L108.6 266C109.931 272.58 112.547 278.833 116.3 284.4L81.5 307.7V315.4L118.3 287.2L120.4 289.7L82.4 323V332.4H92L125.3 294.4L127.8 296.6L99.6 333.4H107.3L130.6 298.6C136.175 302.317 142.427 304.9 149 306.2L140.8 347.2L146.3 352.7L152.3 306.7L155.6 307.1L152.4 357.4L159 364.1L165.6 357.4L162.4 307.1L165.7 306.8L171.7 352.7L177.2 347.3L169 306.3C175.58 304.969 181.833 302.353 187.4 298.6L210.7 333.4H218.4L190 296.6L192.5 294.5L225.8 332.5H235.2V323L197.2 289.7L199.4 287.2L236.2 315.4V307.7L201.4 284.4C205.117 278.825 207.7 272.573 209 266L250 274.2L255.5 268.7L209.5 262.7L209.9 259.4L260.2 262.6L266.9 256L260.2 249.4L209.9 252.7C209.9 251.5 209.8 250.367 209.6 249.3L255.5 243.3L250.1 237.8L209.1 246C207.769 239.42 205.153 233.167 201.4 227.6L236.2 204.3V196.6L199.4 224.8L197.3 222.3L235.3 189V179.6H225.8L192.5 217.6L190 215.4L218.2 178.6H210.5L187.2 213.4C181.625 209.682 175.373 207.1 168.8 205.8L177 164.8L171.5 159.3L165.5 205.3L162.2 204.9L165.4 154.6L158.9 148Z",fill:"#FCD116"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_php",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),ZJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_pkr)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-95 0H673V512H-95V0Z",fill:"#0C590B"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-95 0H97.5V512H-95V0Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M403.7 225.4L372.5 218.8L356.1 246.1L352.7 214.5L321.7 207.3L350.7 194.3L348 162.6L369.4 186.2L398.7 173.8L382.8 201.4L403.8 225.4H403.7Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M415.4 306C408.766 320.54 399.318 333.622 387.6 344.49C375.882 355.358 362.128 363.797 347.131 369.32C332.133 374.842 316.191 377.339 300.223 376.667C284.256 375.994 268.579 372.165 254.1 365.4C239.541 358.674 226.45 349.142 215.578 337.352C204.706 325.561 196.265 311.743 190.739 296.687C185.213 281.631 182.709 265.634 183.372 249.609C184.034 233.585 187.85 217.848 194.6 203.3C201.378 188.208 211.228 174.695 223.522 163.623C235.815 152.552 250.283 144.166 266 139C261.882 142.428 257.943 146.066 254.2 149.9C234.69 171.507 224.333 199.846 225.313 228.941C226.293 258.036 238.533 285.614 259.453 305.859C280.372 326.104 308.336 337.435 337.448 337.461C366.56 337.487 394.544 326.207 415.5 306H415.4Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_pkr",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),KJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_pln)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V0H512V512Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M512 512H0V256H512V512Z",fill:"#DC143C"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_pln",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),GJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_qar)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#8D1B3D"}),m.jsx("path",{d:"M0 0V512H113L217.2 483.6L113 455L217.2 426.6L113 398.2L217.2 369.8L113 341.3L217.2 313L113 284.4L217.2 256L113 227.6L217.2 199L113 170.7L217.2 142.2L113 113.8L217.2 85.3L113 57L217.2 28.6L113 0H0Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_qar",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),YJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_ron)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H170.7V512H0V0Z",fill:"#00319C"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M170.7 0H341.3V512H170.7V0Z",fill:"#FFDE00"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M341.3 0H512V512H341.3V0Z",fill:"#DE2110"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_ron",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),JJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_sar)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-128 0H639.882V511.922H-128V0Z",fill:"#165D31"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M65.519 145.113C64.6933 157.086 63.558 178.14 73.7758 180.308C86.0578 181.443 79.2459 159.459 83.684 155.537C84.6129 153.473 86.161 153.473 86.2642 156.053V174.631C86.161 180.824 90.083 182.475 93.1793 183.817C96.482 183.507 98.5462 183.611 99.8879 186.707L101.333 219.012C101.333 219.012 108.867 221.076 109.177 200.847C109.59 188.977 106.803 178.966 108.454 176.695C108.454 174.425 111.344 174.322 113.408 175.354C116.608 177.624 118.053 180.514 123.007 179.276C130.645 177.212 135.186 173.496 135.392 167.716",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M354.197 362.577C363.383 362.886 369.369 362.99 377.522 363.919L387.018 362.886C397.648 361.854 398.164 378.058 398.164 378.058C398.061 387.554 394.346 387.966 389.701 388.999C387.018 389.411 385.573 387.45 384.231 385.386C382.511 386.074 380.137 386.212 377.11 385.799L365.756 385.283C361.628 384.973 359.461 385.799 355.435 385.386C354.507 386.728 353.371 388.482 350.997 387.966C348.933 387.76 346.456 381.877 347.179 377.542C348.624 374.343 348.211 375.375 348.107 373.93Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_sar",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),XJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_sek)",children:[m.jsx("path",{d:"M0 0H512V512H0V0Z",fill:"#005293"}),m.jsx("path",{d:"M134 0V204.8H0V307.2H134V512H236.4V307.2H512V204.8H236.4V0H134Z",fill:"#FECB00"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_sek",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),QJe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_sgd)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-20 0H748.007V512.029H-20V0Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-20 0H748.007V255.978H-20V0Z",fill:"#DF0000"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M157.155 42.916C136.944 47.2463 118.839 58.3997 105.881 74.5026C92.9228 90.6056 85.9005 110.677 85.9937 131.346C86.087 152.015 93.29 172.023 106.393 188.008C119.496 203.994 137.701 214.983 157.949 219.131C144.316 223.121 129.941 223.888 115.96 221.373C101.979 218.857 88.7741 213.126 77.3866 204.634C65.9991 196.141 56.7408 185.119 50.342 172.436C43.9433 159.753 40.5792 145.757 40.5151 131.551C40.451 117.346 43.6888 103.32 49.9728 90.58C56.2569 77.8399 65.4155 66.7344 76.7259 58.1394C88.0364 49.5445 101.189 43.6954 115.147 41.0535C129.105 38.4116 143.486 39.0492 157.155 42.916Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M125.943 117.332L112.288 107.362L129.267 107.218L134.469 91.106L139.887 107.218H156.793L143.211 117.332L148.413 133.444L134.613 123.546L120.886 133.516L125.943 117.332Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_sgd",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),eXe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_thb)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#F4F5F8"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 173.4H512V344H0V173.4Z",fill:"#2D2A4A"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V88H0V0ZM0 426.7H512V512H0V426.7Z",fill:"#A51931"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_thb",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),tXe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_try)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#E30A17"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M348.8 264C348.8 334.6 290.5 391.9 218.7 391.9C146.9 391.9 88.6001 334.6 88.6001 263.9C88.6001 193.2 146.8 136.1 218.6 136.1C290.4 136.1 348.9 193.3 348.9 264H348.8Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M355.3 264C355.3 320.5 308.7 366.3 251.2 366.3C193.7 366.3 147.2 320.5 147.2 264C147.2 207.5 193.7 161.7 251.2 161.7C308.7 161.7 355.2 207.5 355.2 264H355.3Z",fill:"#E30A17"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M374.1 204.2L373.1 251.5L328.9 263.5L372.4 279L371.4 322.3L399.7 288.5L442.6 303.3L417.8 267L448 230.9L401.6 243.7L374.1 204.2Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_try",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),nXe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_twd)",children:[m.jsx("path",{d:"M0 0H768V512H0V0Z",fill:"#FF0000"}),m.jsx("path",{d:"M0 0H384V256H0V0Z",fill:"#000095"}),m.jsx("path",{d:"M214.3 115.1L204.9 105.7L192 102.3L179.1 105.7L169.7 115.1L166.3 128L169.7 140.9L179.1 150.3L192 153.7L204.9 150.3L214.3 140.9L217.7 128L214.3 115.1Z",fill:"white"}),m.jsx("path",{d:"M192 182.4C222.044 182.4 246.4 158.044 246.4 128C246.4 97.9557 222.044 73.6 192 73.6C161.956 73.6 137.6 97.9557 137.6 128C137.6 158.044 161.956 182.4 192 182.4Z",fill:"#000095"}),m.jsx("path",{d:"M192 176C218.51 176 240 154.51 240 128C240 101.49 218.51 80 192 80C165.49 80 144 101.49 144 128C144 154.51 165.49 176 192 176Z",fill:"white"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_twd",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),rXe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_uah)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V512H0V0Z",fill:"#FFD700"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H512V256H0V0Z",fill:"#0057B8"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_uah",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),iXe=t=>m.jsxs("svg",{width:"256",height:"256",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsx("g",{clipPath:"url(#clip0_4989_137730)",children:m.jsxs("g",{clipPath:"url(#clip1_4989_137730)",children:[m.jsx("path",{d:"M-65.3379 -3.625H434.837V259.625H-65.3379",fill:"#B31942"}),m.jsx("path",{d:"M-65.3379 26.75H434.837ZM434.837 67.25H-65.3379ZM-65.3379 107.75H434.837ZM434.837 148.25H-65.3379ZM-65.3379 188.75H434.837ZM434.837 229.25H-65.3379Z",fill:"black"}),m.jsx("path",{d:"M-65.3379 26.75H434.837M434.837 67.25H-65.3379M-65.3379 107.75H434.837M434.837 148.25H-65.3379M-65.3379 188.75H434.837M434.837 229.25H-65.3379",stroke:"white",strokeWidth:"20.25"}),m.jsx("path",{d:"M-65.3379 -3.625H134.732V138.125H-65.3379",fill:"#0A3161"}),m.jsx("path",{d:"M1.352 16.625L6.11306 31.278L-6.35156 22.2219H9.05555L-3.40906 31.278L1.352 16.625Z",fill:"white"}),m.jsx("path",{d:"M1.352 44.975L6.11306 59.628L-6.35156 50.5719H9.05555L-3.40906 59.628L1.352 44.975Z",fill:"white"}),m.jsx("path",{d:"M1.352 73.325L6.11306 87.978L-6.35156 78.9219H9.05555L-3.40906 87.978L1.352 73.325Z",fill:"white"}),m.jsx("path",{d:"M1.352 101.675L6.11306 116.328L-6.35156 107.272H9.05555L-3.40906 116.328L1.352 101.675Z",fill:"white"}),m.jsx("path",{d:"M18.0248 2.44998L22.7859 17.103L10.3213 8.04694H25.7284L13.2638 17.103L18.0248 2.44998Z",fill:"white"}),m.jsx("path",{d:"M18.0248 30.8L22.7859 45.453L10.3213 36.3969H25.7284L13.2638 45.453L18.0248 30.8Z",fill:"white"}),m.jsx("path",{d:"M18.0248 59.15L22.7859 73.803L10.3213 64.7469H25.7284L13.2638 73.803L18.0248 59.15Z",fill:"white"}),m.jsx("path",{d:"M18.0248 87.5L22.7859 102.153L10.3213 93.0969H25.7284L13.2638 102.153L18.0248 87.5Z",fill:"white"}),m.jsx("path",{d:"M18.0248 115.85L22.7859 130.503L10.3213 121.447H25.7284L13.2638 130.503L18.0248 115.85Z",fill:"white"}),m.jsx("path",{d:"M34.6977 16.625L39.4588 31.278L26.9941 22.2219H42.4013L29.9366 31.278L34.6977 16.625Z",fill:"white"}),m.jsx("path",{d:"M34.6977 44.975L39.4588 59.628L26.9941 50.5719H42.4013L29.9366 59.628L34.6977 44.975Z",fill:"white"}),m.jsx("path",{d:"M34.6977 73.325L39.4588 87.978L26.9941 78.9219H42.4013L29.9366 87.978L34.6977 73.325Z",fill:"white"}),m.jsx("path",{d:"M34.6977 101.675L39.4588 116.328L26.9941 107.272H42.4013L29.9366 116.328L34.6977 101.675Z",fill:"white"}
721),m.jsx("path",{d:"M51.3696 2.44992L56.1306 17.103L43.666 8.04688H59.0731L46.6085 17.103L51.3696 2.44992Z",fill:"white"}),m.jsx("path",{d:"M51.3696 30.7999L56.1306 45.453L43.666 36.3969H59.0731L46.6085 45.453L51.3696 30.7999Z",fill:"white"}),m.jsx("path",{d:"M51.3696 59.1499L56.1306 73.803L43.666 64.7469H59.0731L46.6085 73.803L51.3696 59.1499Z",fill:"white"}),m.jsx("path",{d:"M51.3696 87.4999L56.1306 102.153L43.666 93.0969H59.0731L46.6085 102.153L51.3696 87.4999Z",fill:"white"}),m.jsx("path",{d:"M51.3696 115.85L56.1306 130.503L43.666 121.447H59.0731L46.6085 130.503L51.3696 115.85Z",fill:"white"}),m.jsx("path",{d:"M68.0424 16.625L72.8035 31.278L60.3389 22.2219H75.746L63.2814 31.278L68.0424 16.625Z",fill:"white"}),m.jsx("path",{d:"M68.0424 44.9749L72.8035 59.628L60.3389 50.5719H75.746L63.2814 59.628L68.0424 44.9749Z",fill:"white"}),m.jsx("path",{d:"M68.0424 73.325L72.8035 87.978L60.3389 78.9219H75.746L63.2814 87.978L68.0424 73.325Z",fill:"white"}),m.jsx("path",{d:"M68.0424 101.675L72.8035 116.328L60.3389 107.272H75.746L63.2814 116.328L68.0424 101.675Z",fill:"white"}),m.jsx("path",{d:"M84.7143 2.44998L89.4754 17.103L77.0107 8.04694H92.4179L79.9532 17.103L84.7143 2.44998Z",fill:"white"}),m.jsx("path",{d:"M84.7143 30.8L89.4754 45.453L77.0107 36.3969H92.4179L79.9532 45.453L84.7143 30.8Z",fill:"white"}),m.jsx("path",{d:"M84.7143 59.15L89.4754 73.803L77.0107 64.7469H92.4179L79.9532 73.803L84.7143 59.15Z",fill:"white"}),m.jsx("path",{d:"M84.7143 87.5L89.4754 102.153L77.0107 93.0969H92.4179L79.9532 102.153L84.7143 87.5Z",fill:"white"}),m.jsx("path",{d:"M84.7143 115.85L89.4754 130.503L77.0107 121.447H92.4179L79.9532 130.503L84.7143 115.85Z",fill:"white"}),m.jsx("path",{d:"M101.387 16.625L106.148 31.278L93.6836 22.2219H109.091L96.6261 31.278L101.387 16.625Z",fill:"white"}),m.jsx("path",{d:"M101.387 44.975L106.148 59.628L93.6836 50.5719H109.091L96.6261 59.628L101.387 44.975Z",fill:"white"}),m.jsx("path",{d:"M101.387 73.325L106.148 87.978L93.6836 78.9219H109.091L96.6261 87.978L101.387 73.325Z",fill:"white"}),m.jsx("path",{d:"M101.387 101.675L106.148 116.328L93.6836 107.272H109.091L96.6261 116.328L101.387 101.675Z",fill:"white"}),m.jsx("path",{d:"M118.06 2.44995L122.821 17.103L110.356 8.04691H125.764L113.299 17.103L118.06 2.44995Z",fill:"white"}),m.jsx("path",{d:"M118.06 30.8L122.821 45.453L110.356 36.3969H125.764L113.299 45.453L118.06 30.8Z",fill:"white"}),m.jsx("path",{d:"M118.06 59.15L122.821 73.803L110.356 64.7469H125.764L113.299 73.803L118.06 59.15Z",fill:"white"}),m.jsx("path",{d:"M118.06 87.4999L122.821 102.153L110.356 93.0969H125.764L113.299 102.153L118.06 87.4999Z",fill:"white"}),m.jsx("path",{d:"M118.06 115.85L122.821 130.503L110.356 121.447H125.764L113.299 130.503L118.06 115.85Z",fill:"white"})]})}),m.jsxs("defs",{children:[m.jsx("clipPath",{id:"clip0_4989_137730",children:m.jsx("rect",{width:"256",height:"256",rx:"128",fill:"white"})}),m.jsx("clipPath",{id:"clip1_4989_137730",children:m.jsx("rect",{width:"500.175",height:"263.25",fill:"white",transform:"translate(-65.3379 -3.625)"})})]})]}),aXe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_vnd)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-128 0H640.007V512.029H-128V0Z",fill:"#DA251D"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M349.566 381.113L259.977 314.211L170.894 381.764L204.056 271.945L115.045 204.176L225.153 203.236L259.254 93.7792L294.151 203.02L404.258 203.164L315.753 271.584L349.566 381.113Z",fill:"#FFFF00"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_vnd",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),sXe=t=>m.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[m.jsxs("g",{clipPath:"url(#clip0_zar)",children:[m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M82.23 512.093L335.766 341.463H696.085V512.093H82.23Z",fill:"#000C8A"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M65.9358 0H696.188V170.732H335.663C335.663 170.732 69.3176 -1.63968 65.9358 0Z",fill:"#E1392D"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-71.8999 64.05V104.325L1
72153.966 255.995L-71.8999 407.665V448.043L212.585 255.995L-71.8999 64.05Z",fill:"#FFB915"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-71.8999 64.05V0H22.9966L324.288 203.935H696.085V308.157H324.288L22.9966 511.99H-71.8999V448.043L212.585 255.995L-71.8999 64.05Z",fill:"#007847"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.9966 0H82.23L335.766 170.732H696.085V203.935H324.288L22.9966 0ZM22.9966 512.093H82.23L335.766 341.463H696.085V308.26H324.288L22.9966 512.093Z",fill:"white"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-71.8999 407.768V104.427L153.966 255.995L-71.8999 407.768Z",fill:"#000001"})]}),m.jsx("defs",{children:m.jsx("clipPath",{id:"clip0_zar",children:m.jsx("rect",{width:"512",height:"512",rx:"256",fill:"white"})})})]}),oXe={US:"usd",MX:"mxn",BR:"brl",GB:"gbp",AT:"eur",BE:"eur",HR:"eur",CY:"eur",EE:"eur",FI:"eur",FR:"eur",DE:"eur",GR:"eur",IE:"eur",IT:"eur",LV:"eur",LT:"eur",LU:"eur",MT:"eur",NL:"eur",PT:"eur",SK:"eur",SI:"eur",ES:"eur",AD:"eur",MC:"eur",SM:"eur",VA:"eur",XK:"eur",ME:"eur",CN:"cny",JP:"jpy",IN:"inr",CA:"cad",KR:"krw",AU:"aud",ID:"idr",SA:"sar",TR:"try",CH:"chf",TW:"twd",SE:"sek",NG:"ngn",PL:"pln",AR:"ars",AE:"aed",TH:"thb",ZA:"zar",DK:"dkk",EG:"egp",MY:"myr",SG:"sgd",CO:"cop",PH:"php",CL:"clp",BD:"bdt",VN:"vnd",CZ:"czk",IL:"ils",HK:"hkd",NZ:"nzd",PK:"pkr",RO:"ron",KZ:"kzt",NO:"nok",HU:"huf",UA:"uah",KW:"kwd",QA:"qar",ET:"etb",MA:"mad",BG:"bgn",KE:"kes",NP:"npr"},cXe={usd:{symbol:"$",name:"US Dollar",icon:m.jsx(iXe,{})},eur:{symbol:"â¬",name:"Euro",icon:m.jsx(IJe,{})},gbp:{symbol:"£",name:"British Pound",icon:m.jsx(TJe,{})},mxn:{symbol:"$",name:"Mexican Peso",icon:m.jsx(jJe,{})},brl:{symbol:"R$",name:"Brazilian Real",icon:m.jsx(mJe,{})},cny:{symbol:"Â¥",name:"Chinese Yuan",icon:m.jsx(_Je,{})},jpy:{symbol:"Â¥",name:"Japanese Yen",icon:m.jsx(OJe,{})},inr:{symbol:"â¹",name:"Indian Rupee",icon:m.jsx(RJe,{})}
721,cad:{symbol:"$",name:"Canadian Dollar",icon:m.jsx(vJe,{})},krw:{symbol:"â©",name:"South Korean Won",icon:m.jsx(NJe,{})},aud:{symbol:"$",name:"Australian Dollar",icon:m.jsx(pJe,{})},idr:{symbol:"Rp",name:"Indonesian Rupiah",icon:m.jsx($Je,{})},sar:{symbol:"ï·¼",name:"Saudi Riyal",icon:m.jsx(JJe,{})},try:{symbol:"âº",name:"Turkish Lira",icon:m.jsx(tXe,{})},chf:{symbol:"CHF",name:"Swiss Franc",icon:m.jsx(wJe,{})},twd:{symbol:"NT$",name:"New Taiwan Dollar",icon:m.jsx(nXe,{})},sek:{symbol:"kr",name:"Swedish Krona",icon:m.jsx(XJe,{})},ngn:{symbol:"â¦",name:"Nigerian Naira",icon:m.jsx(VJe,{})},pln:{symbol:"zÅ",name:"Polish Zloty",icon:m.jsx(KJe,{})},ars:{symbol:"$",name:"Argentine Peso",icon:m.jsx(hJe,{})},aed:{symbol:"د.Ø¥",name:"UAE Dirham",icon:m.jsx(fJe,{})},thb:{symbol:"฿",name:"Thai Baht",icon:m.jsx(eXe,{})},zar:{symbol:"R",name:"South African Rand",icon:m.jsx(sXe,{})},dkk:{symbol:"kr",name:"Danish Krone",icon:m.jsx(SJe,{})},egp:{symbol:"E£",name:"Egyptian Pound",icon:m.jsx(AJe,{})},myr:{symbol:"RM",name:"Malaysian Ringgit",icon:m.jsx(BJe,{})},sgd:{symbol:"$",name:"Singapore Dollar",icon:m.jsx(QJe,{})},cop:{symbol:"$",name:"Colombian Peso",icon:m.jsx(CJe,{})},php:{symbol:"â±",name:"Philippine Peso",icon:m.jsx(zJe,{})},clp:{symbol:"$",name:"Chilean Peso",icon:m.jsx(bJe,{})},bdt:{symbol:"à§³",name:"Bangladeshi Taka",icon:m.jsx(gJe,{})},vnd:{symbol:"â«",name:"Vietnamese Dong",icon:m.jsx(aXe,{})},czk:{symbol:"KÄ",name:"Czech Koruna",icon:m.jsx(EJe,{})},ils:{symbol:"âª",name:"Israeli Shekel",icon:m.jsx(PJe,{})},hkd:{symbol:"$",name:"Hong Kong Dollar",icon:m.jsx(LJe,{})},nzd:{symbol:"$",name:"New Zealand Dollar",icon:m.jsx(qJe,{})},pkr:{symbol:"â¨",name:"Pakistani Rupee",icon:m.jsx(ZJe,{})},ron:{symbol:"lei",name:"Romanian Leu",icon:m.jsx(YJe,{})},kzt:{symbol:"â¸",name:"Kazakhstani Tenge",icon:m.jsx(FJe,{})},nok:{symbol:"kr",name:"Norwegian Krone",icon:m.jsx(HJe,{})},huf:{symbol:"Ft",name:"Hungarian Forint",icon:m.jsx(kJe,{})},uah:{symbol:"â´",name:"Ukrainian Hryvnia",icon:m.jsx(rXe,{})},kwd:{symbol:"د.Ù",name:"Kuwaiti Dinar",icon:m.jsx(DJe,{})},qar:{symbol:"ï·¼",name:"Qatari Riyal",icon:m.jsx(GJe,{})},etb:{symbol:"Br",name:"Ethiopian Birr",icon:m.jsx(xJe,{})},mad:{symbol:"د.Ù
.",name:"Moroccan Dirham",icon:m.jsx(UJe,{})},bgn:{symbol:"лв",name:"Bulgarian Lev",icon:m.jsx(yJe,{})},kes:{symbol:"KSh",name:"Kenyan Shilling",icon:m.jsx(MJe,{})},npr:{symbol:"â¨",name:"Nepalese Rupee",icon:m.jsx(WJe,{})}},uct={usd:[["asset","Currency"],["bank_beneficiary_name","Beneficiary name"],["bank_beneficiary_address","Beneficiary address"],["bank_account_number","Account number"],["bank_routing_number","Routing number"],["bank_name","Bank name"],["bank_address","Bank address"]],eur:[["asset","Currency"],["account_holder_name","Account holder"],["iban","IBAN"],["bic","BIC / SWIFT"],["bank_name","Bank name"],["bank_address","Bank address"]],mxn:[["asset","Currency"],["account_holder_name","Account holder"],["clabe","CLABE"],["bank_name","Bank name"],["bank_address","Bank address"]],brl:[["asset","Currency"],["account_holder_name","Account holder"],["br_code","PIX code"],["bank_name","Bank name"],["bank_address","Bank address"]],gbp:[["asset","Currency"],["account_holder_name","Account holder"],["account_number","Account number"],["sort_code","Sort code"],["bank_name","Bank name"],["bank_address","Bank address"]]},bY=t=>{let[,e]=navigator.language.toUpperCase().split("-");if(!e)return;let n=oXe[e];return t.find(r=>r===n)},dct=()=>{let{openModal:t,closePrivyModal:e,privy:n}=Vt(),{setModalData:r}=es();return L.useMemo(()=>({fund:i=>{if(i.source.assets.length<1)throw Error("Invalid input: expected non-empty source.assets");let a=i.source.defaultAsset??bY(i.source.assets)??i.source.assets[0],s={...i,source:{...i.source,selectedAsset:a}};return new Promise((o,c)=>{r({FundWithBankDepositScreen:{onSuccess:async()=>{await e({shouldCallAuthOnSuccess:!1,isSuccess:!0}),o({})},onFailure:async l=>{await e({shouldCallAuthOnSuccess:!1,isSuccess:!1}),c(l)},getCustomer:async({kycRedirectUrl:l})=>{let u={provider:s.provider};
721return l&&(u.kyc_redirect_url=l),await n.fetchPrivyRoute($1e,{query:u})},createOrUpdateCustomer:async({hasAcceptedTerms:l,kycRedirectUrl:u})=>await n.fetchPrivyRoute(P1e,{body:{provider:s.provider,has_accepted_terms:l,kyc_redirect_url:u}}),getOrCreateVirtualAccount:async l=>await n.fetchPrivyRoute(R1e,{body:l}),opts:s}}),t("FundWithBankDepositScreen")})}}),[])},_Y=(t,e)=>t.length>0?null:3>parseFloat(e)?"amount_too_low":"provider_errors",Ts=Pi(()=>null),Kh=t=>{Ts.getState()!==null?Ts.setState(t):console.warn("[FiatOnramp] setState skipped â no active flow")},t6=()=>{let t=Ts.getState();if(!t)throw Error("Unexpected call to getFiatOnrampFlowState");return t},fct=()=>{let t=t6();return t.localQuotes??t.initialQuotes},lXe=t=>t.localSelectedQuote??(t.localQuotes===null?t.initialSelectedQuote:null),hct=()=>lXe(t6()),[pct,uXe]=((t,e=750)=>{let n;return[(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{t(...r)},e)},()=>{n&&clearTimeout(n)}]})(async(t,e)=>{let{getQuotes:n,flowId:r}=t6();Kh({isLoading:!0});try{let i=await n({source:{asset:e.source.selectedAsset.toUpperCase(),amount:t},destination:{asset:e.destination.asset,chain:e.destination.chain,address:e.destination.address},environment:e.environment});if(Ts.getState()?.flowId!==r)return;let a=i.quotes??[],s=i.provider_errors,o=_Y(a,t);Kh({localQuotes:a,localSelectedQuote:a[0]??null,isLoading:!1,quotesWarning:o,quotesErrors:s??null,destinationCurrencySymbol:i.destination_currency_symbol??null,destinationCurrencyIconUrl:i.destination_currency_icon_url??null,destinationNetworkIconUrl:i.destination_network_icon_url??null})}catch{if(Ts.getState()?.flowId!==r)return;Kh({localQuotes:[],localSelectedQuote:null,quotesWarning:"provider_errors",quotesErrors:null})}}),dXe=()=>{let{stripeSession:t,controller:e}=t6();t&&(e.current?.abort(),t.onramp.destroy(),Kh({stripeSession:null}))},fXe=()=>{let{openModal:t,closePrivyModal:e,privy:n}=Vt(),{navigate:r}=es(),{user:i}=$i(),a=L.useRef(null);return L.useMemo(()=>({fund:async s=>{let{reject:o,resolve:c,promise:l}=Promise.withResolvers(),u=s.source.assets??Object.keys(cXe);if(u.length<1)return o(Error("Invalid input: expected non-empty source.assets")),await l;if(Ts.getState())return o(Error("Existing fiat onramp flow in progress")),await l;let d=s.source.defaultAsset??bY(u)??u[0],f={...s,environment:s.environment??"production",source:{...s.source,assets:u,selectedAsset:d}},h=async _=>await n.fetchPrivyRoute(O1e,{body:_}),p=async()=>{a.current?.abort(),t(null),await e({shouldCallAuthOnSuccess:!1,isSuccess:!0}),setTimeout(()=>{Ts.setState(null)},0)},g=s.showBackButton?()=>function({controller:_,reject:E}){uXe(),dXe(),_.current?.abort(),Ts.setState(null),E(new lA)}({controller:a,reject:o}):void 0,y=Symbol("fiat-onramp-flow");Ts.setState({onSuccess:async _=>{await p(),c(_)},onFailure:async _=>{await p(),o(_)},onBack:g,getQuotes:h,getProviderUrl:async _=>await n.fetchPrivyRoute(M1e,{body:_}),getStatus:async _=>await n.fetchPrivyRoute(N1e,{query:{..._}}),controller:a,flowId:y,opts:f,amount:f.defaultAmount??"0",state:{status:"select-amount"},error:null,isLoading:!0,quotesWarning:null,quotesErrors:null,initialQuotes:null,initialSelectedQuote:null,localQuotes:null,localSelectedQuote:null,destinationCurrencyIconUrl:null,destinationCurrencySymbol:null,destinationNetworkIconUrl:null,stripeElement:null,stripeSession:null,stripeConfirmCheckoutDetails:null,email:i?.email?.address??null,phone:i?.phone?.number??null,privy:n}),s.showBackButton?r("FiatOnrampScreen"):t("FiatOnrampScreen");let v=await h({source:{asset:f.source.selectedAsset.toUpperCase(),amount:f.defaultAmount??"0"},destination:{asset:f.destination.asset,chain:f.destination.chain,address:f.destination.address},environment:f.environment}).catch(()=>({quotes:[]}));if(Ts.getState()?.flowId!==y)return await l;let b=v.quotes,w=v.provider_errors;return Kh({initialQuotes:b,initialSelectedQuote:b[0]??null,quotesWarning:_Y(b,f.defaultAmount??"0"),quotesErrors:w??null,isLoading:!1,destinationCurrencySymbol:v.destination_currency_symbol??null,destinationCurrencyIconUrl:v.destination_currency_icon_url??null,destinationNetworkIconUrl:v.destination_network_icon_url??null}),await l}}),[t,e,n,r,i])},fg=Pi(()=>null),nh=()=>fg.setState(null),gct=()=>{let{fund:t}=fXe(),{createDepositAddress:e}=mWe(),{openModal:n,closePrivyModal:r}=Vt(),{navigate:i}=es();return L.useMemo(()=>({addFunds:async a=>{if(!a.destination?.address)throw Error("Invalid input: expected destination.address");if(!a.destination?.chain)throw Error("Invalid input: expected destination.chain");if(!a.destination?.asset)throw Error("Invalid input: expected destination.asset");if(!Wo.getState().user)throw Error("User must be authenticated to add funds");if(fg.getState())throw Error("Existing funding flow in progress");if(a.fiat?.source?.assets?.length===0)throw Error("Invalid input: expected non-empty fiat.source.assets");let{resolve:s,reject:o,promise:c}=Promise.withResolvers();
721if(!a.fiat&&!a.crypto){let h=Error("At least one of fiat or crypto config must be provided");return fg.setState({error:h.message,onCancel:async()=>{nh(),n(null),await r({shouldCallAuthOnSuccess:!1,isSuccess:!1}),o(h)}}),n("AddFundsSelectionScreen"),await c}let l=async()=>{try{let h=await t({source:a.fiat?.source??{},destination:a.destination,environment:a.fiat?.environment,defaultAmount:a.fiat?.defaultAmount,showBackButton:!(!a.fiat||!a.crypto)});nh(),s({method:"fiat",status:h.status})}catch(h){f(h)}},u=async()=>{try{let h={destinationChain:a.destination.chain,destinationCurrency:a.destination.asset,destinationAddress:a.destination.address,refundAddress:a.crypto?.refundAddress,slippageBps:a.crypto?.slippageBps,showBackButton:!(!a.fiat||!a.crypto),entrySource:"unified_funding"};await e(h),nh(),s({method:"crypto",status:"completed"})}catch(h){f(h)}},d=()=>{fg.setState({startFiat:l,startCrypto:u,onCancel:async()=>{nh(),n(null),await r({shouldCallAuthOnSuccess:!1,isSuccess:!1}),o(Error("User cancelled funding"))}})},f=h=>{if((p=>p instanceof lA)(h))return d(),void i("AddFundsSelectionScreen");nh(),o(h)};return a.fiat&&!a.crypto?l():a.crypto&&!a.fiat?u():(d(),n("AddFundsSelectionScreen")),await c}}),[r,e,t,i,n])};function hXe(t){let{sendTransaction:e}=L.useContext(Ia);return La("sendTransaction",t),{sendTransaction:e}}function pXe(t){let{signMessage:e}=L.useContext(Ia);return La("signMessage",t),{signMessage:e}}function gXe(t){let{signTypedData:e}=L.useContext(Ia);return La("signTypedData",t),{signTypedData:e}}const Qb=t=>t.walletClientType==="privy"?`${t.meta.id}.${t.address}`:t.meta.id,yXe=({setActiveWalletForWagmi:t})=>{let{wallets:e,ready:n}=KS(),{user:r}=YS(),i=ts(),{reconnect:a}=Sie();xVe({onSuccess:async({wallet:s})=>{let o=Qb(s);await i.storage?.removeItem(`${o}.disconnected`),!t&&(await i.storage?.setItem("recentConnectorId",o),i.connectors.some(c=>c.id===o)&&a())}}),uJe({onSuccess:async({wallet:s})=>{let o=Qb(s);await i.storage?.removeItem(`${o}.disconnected`),!t&&(await i.storage?.setItem("recentConnectorId",o),i.connectors.some(c=>c.id===o)&&a())}}),AVe({onComplete:async({user:s,loginAccount:o})=>{if(!o||o.type==="wallet")return;let c=s.linkedAccounts.filter(l=>l.type==="wallet"&&l.walletClientType==="privy");c.length!==0&&(await i.storage?.removeItem("io.privy.wallet.disconnected"),await Promise.all(c.map(async l=>{let u=`io.privy.wallet.${l.address}`;await i.storage?.removeItem(`${u}.disconnected`)})),i.state.status!=="connected"&&a())}}),L.useEffect(()=>{t&&(async()=>{let s=t({wallets:e,user:r});if(!s)return mXe(i),void a();let[o]=await gM([s],i);o?(await vXe(s,o,i),a()):console.error(`Failed to setup connector for ${s.address}`)})()},[e,r,t]),L.useEffect(()=>{t||gM(e,i).then(async()=>{if(!n||i.state.status==="connected")return;let s=await i.storage?.getItem("recentConnectorId");s&&await i.storage?.getItem(`${s}.disconnected`)||a()})},[e,!t,n])};let gM=async(t,e)=>{let n=await Promise.all(t.map(async r=>{let i=await r.getEthereumProvider(),a=Qb(r),s=e.connectors.find(c=>c.id===a);if(s)return s;let o=fE({target:{provider:i,id:a,name:r.meta.name,icon:typeof r.meta.icon=="string"?r.meta.icon:void 0}});return e._internal.connectors.setup(o)}));return e._internal.connectors.setState(n),n},mXe=t=>{t._internal.connectors.setState([]),t.setState(e=>({chainId:e.chainId,connections:new Map,current:null,status:"disconnected"}))},vXe=async(t,e,n)=>{let r=e.id;await Promise.all([n.storage?.removeItem(`${r}.disconnected`),n.storage?.setItem("recentConnectorId",r)]);let i=Number(t.chainId.replace("eip155:",""));n.chains.find(s=>s.id===i)||(i=n.chains[0].id);let a=new Map([[e.uid,{accounts:[t.address],chainId:i,connector:e}]]);n.setState(s=>({...s,chainId:i,connections:a,current:e.uid,status:"connected"}))};const wXe=({children:t,setActiveWalletForWagmi:e})=>(yXe({setActiveWalletForWagmi:e}),m.jsx(m.Fragment,{children:t})),bXe=({children:t,setActiveWalletForWagmi:e,...n})=>m.jsx(qM,{reconnectOnMount:!1,...n,children:m.jsx(wXe,{setActiveWalletForWagmi:e,children:t})}),_Xe=t=>jD({ssr:!0,...t,connectors:t.connectors?.filter(e=>e.type==="mock"),multiInjectedProviderDiscovery:!1}),yM=({className:t="",variant:e="desktop"})=>m.jsx("div",{className:`size-8 p-2 rounded-lg ${e==="mobile"?"outline outline-1 outline-offset-[-1px] outline-grey-70":""} inline-flex justify-center items-center gap-2 overflow-hidden ${t}`,children:m.jsx("div",{"data-svg-wrapper":!0,"data-name":"Close",className:"relative flex items-center justify-center",children:m.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.03923 3.581C3.38509 3.25964 3.94578 3.25971 4.29156 3.58114L7.75585 6.79937L11.2245 3.57529C11.5702 3.25375 12.1309 3.25352 12.4768 3.57477C12.8228 3.89601 12.8231 4.41709 12.4774 4.73863L9.00802 7.96338L12.5205 11.2625C12.8663 11.5839 12.8662 12.105 12.5203 12.4263C12.1745 12.7477 11.6138 12.7476 11.268 12.4262L7.75626 9.12777L4.32104 12.4012C3.97537 12.7227 3.41468 12.723 3.06871 12.4017C2.72273 12.0805 2.72247 11.5594 3.06814 11.2378L6.50408 7.96376L3.03907 4.74486C2.6933 4.42343 2.69336 3.90235 3.03923 3.581Z",fill:"white"})})})}),kA=2*60*60*1e3,CXe=24*60*60*1e3,CY="referral_offer_deadline";function EXe(t){return t==="treatment_b"?{durationMs:null}:t==="treatment_a"?{durationMs:CXe}:{durationMs:kA}}function SXe(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(CY);
721if(!t)return null;const e=JSON.parse(t);if(typeof e?.deadline=="number"&&e.deadline>0)return{code:e.code??null,deadline:e.deadline}}catch{}return null}function EY(t){const e=SXe();return e&&e.code===t?e.deadline:null}function mM(t,e=kA){const n=EY(t);if(n!=null)return n;const r=Date.now()+e;try{window.localStorage.setItem(CY,JSON.stringify({code:t,deadline:r}))}catch{}return r}function AXe(t,e=kA){if(e===null)return!1;const n=EY(t);return n!=null&&Date.now()>=n}const xXe=(t,e)=>Bt({queryKey:["profile",t],queryFn:async()=>{const n=await bt.api.profile[":wallet"].$get({param:{wallet:t}});if(!n.ok)throw new Error("Failed to fetch profile data");return n.json()},enabled:e?.enabled??!!t}),yct=(t,e)=>Bt({queryKey:["profile","portfolio",t??null,e],queryFn:async()=>{if(!t)throw new Error("Wallet address is required");const n=await bt.api.profile[":wallet"].portfolio.$get({param:{wallet:t},query:{days:String(e)}});if(!n.ok)throw new Error("Failed to fetch portfolio data");return n.json()},enabled:!!t,staleTime:6e4}),SY=async t=>{const e=await bt.api.cards[":nftId"].$get({param:{nftId:t}});if(!e.ok){const n=await qn(e,"Failed to fetch the card");throw new OQ(n,e.status)}return e.json()},mct=(t,e)=>Bt({queryKey:["cards",e],queryFn:()=>SY(e),enabled:!!t&&t!==Ls&&!!e,staleTime:3e4}),vct=t=>Bt({queryKey:["cards",t],queryFn:()=>SY(t),enabled:!!t,staleTime:3e4,retry:!1}),wct=t=>Bt({queryKey:["odds","showcase","top",t.collection,t.productId,t.packType??null,t.limit??100],queryFn:async()=>{const e={limit:(t.limit??100).toString()};t.productId?e.productId=t.productId:t.collection&&(e.collection=t.collection),t.packType&&(e.packType=t.packType);const n=await bt.api.odds.showcase.top.$get({query:e});if(!n.ok)throw new Error("Failed to fetch top showcase cards");return n.json()},enabled:t.enabled??!0,staleTime:18e5}),bct=t=>{const e=t.pageSize??48;return MD({queryKey:["odds","showcase","all",t.collection??null,t.productId??null,t.packType??null,e],initialPageParam:0,queryFn:async({pageParam:n})=>{const r={limit:e.toString(),offset:String(n)};t.productId?r.productId=t.productId:t.collection&&(r.collection=t.collection),t.packType&&(r.packType=t.packType);const i=await bt.api.odds.showcase.all.$get({query:r});if(!i.ok)throw new Error("Failed to fetch all showcase cards");return i.json()},getNextPageParam:n=>{const r=n.offset+n.limit;return r<n.total?r:void 0},enabled:t.enabled??!0,staleTime:18e5})},_ct=t=>Bt({queryKey:["odds","showcase","spotlights",t??null],queryFn:async()=>{if(!t)throw new Error("Product ID is required");const e=await bt.api.odds.showcase.spotlights.$get({query:{productId:t}});if(!e.ok)throw new Error("Failed to fetch spotlight showcase cards");return e.json()},enabled:!!t,staleTime:6e4}),Cct=t=>Bt({queryKey:["profile","activity",t],queryFn:async()=>{if(!t)throw new Error("Wallet address is required");const e=await bt.api.profile[":wallet"].activity.$get({param:{wallet:t}});if(!e.ok)throw new Error("Failed to fetch activity");return e.json()},enabled:!!t}),e9=new Set;function IXe(){e9.clear()}function TXe(t){const e=U2(),n=CQ[t],[r,i]=L.useState(()=>$Xe(e,t,n));return L.useEffect(()=>{if(n.type==="static"){i({enabled:n.value,ready:!0});return}const{failover:a}=n,s=(o=!1)=>{const c=e.isFeatureEnabled(t),l=o||e.flagsEndpointWasHit||e.config.advanced_disable_feature_flags;i({enabled:c??a,ready:l})};return s(),e.onFeatureFlags((o,c,l)=>{s(l?.errorsLoading===!0)})},[e,t,n]),r}function LXe(t,e){const n=U2(),r=e?.recordExposure??!0,[i,a]=L.useState(()=>kXe(n,t));return L.useEffect(()=>{const s=(o=!1)=>{const c=o||n.flagsEndpointWasHit||n.config.advanced_disable_feature_flags;a({variant:n.getFeatureFlag(t,{send_event:!1}),ready:c})};return s(),n.onFeatureFlags((o,c,l)=>{s(l?.errorsLoading===!0)})},[n,t]),L.useEffect(()=>{e9.has(t)||!r||!(n.flagsEndpointWasHit||n.config.advanced_disable_feature_flags)||i.variant!==void 0&&(e9.add(t),n.getFeatureFlag(t))},[n,t,r,i.ready,i.variant]),{variant:i.variant,ready:i.ready}}function kXe(t,e){const n=t.flagsEndpointWasHit||t.config.advanced_disable_feature_flags;return{variant:t.getFeatureFlag(e,{send_event:!1}),ready:n}}function $Xe(t,e,n){if(n.type==="static")return{enabled:n.value,ready:!0};const r=t.isFeatureEnabled(e),i=t.flagsEndpointWasHit||t.config.advanced_disable_feature_flags;return{enabled:r??n.failover,ready:i}}const n6="referral",r6="referral_timestamp",$A="referral_candidate",PA="referral_candidate_timestamp",t9=new Set,RA=()=>{for(const t of t9)t()},PXe=t=>(t9.add(t),()=>t9.delete(t)),RXe=()=>{localStorage.removeItem(n6),localStorage.removeItem(r6),RA()},vM=()=>{localStorage.removeItem($A),localStorage.removeItem(PA)},AY=(t,e)=>{const n=localStorage.getItem(t),r=Number(localStorage.getItem(e));return!n||!Number.isFinite(r)||r<=0?null:{code:n,capturedAt:r}};function cm(){return OA()?.code??null}function OA(){return AY(n6,r6)}const OXe=t=>{const e=cm();if(e){e.toLowerCase()!==t.toLowerCase()&&(localStorage.setItem($A,t),localStorage.setItem(PA,Date.now().toString()));return}localStorage.setItem(n6,t),localStorage.setItem(r6,Date.now().toString()),RA()},xY=t=>{if(t){vM();return}RXe();const e=AY($A,PA);vM(),e&&(localStorage.setItem(n6,e.code),localStorage.setItem(r6,e.capturedAt.toString()),RA())};function i6(){return L.useSyncExternalStore(PXe,cm,cm)}function Ect(){const t=$J();L.useEffect(()=>{const n=new URLSearchParams(t.search).get("ref")?.trim().slice(0,64);n&&OXe(n)},[t.search])}const MXe=3e3;function NXe(t,e,n){const[r,i]=L.useState(!1);return L.useEffect(()=>{if(!e){i(!1);return}if(t)return;const a=setTimeout(()=>i(!0),n);return()=>clearTimeout(a)},[t,e,n]),t||e&&r}function a6(){const{enabled:t,ready:e}=TXe(ex.referralOnboarding),{authenticated:n,address:r,ready:i}=Ht(),a=NXe(i,n,MXe),s=i6(),o=xXe(r,{enabled:n}
721),c=o.data,l=c&&typeof c=="object"&&"profile"in c?c.profile.stats.played:0,u=n?l===0:!0,d=t&&!!s&&u,{variant:f,ready:h}=LXe(ex.referralOfferExpiry,{recordExposure:d}),{durationMs:p}=EXe(f),g=p!==null,y=n?!o.isPending:!0,v=e&&a&&y&&h;return{hasReferralOffer:d&&!AXe(s,p),eligible:d,isNewUser:u,referralCode:s,offerDurationMs:p,hasTimer:g,ready:v}}const DXe=["/landing/card.webp","/landing/backgrounds/bg-card-three.webp","/landing/backgrounds/bg-card-two.webp"],FXe=[{card:0,left:8,width:150,rot:-10,duration:7,delay:0},{card:1,left:55,width:120,rot:12,duration:8.5,delay:-3.5},{card:2,left:30,width:104,rot:-5,duration:6.5,delay:-5},{card:1,left:72,width:112,rot:8,duration:7.5,delay:-2},{card:2,left:-2,width:128,rot:-14,duration:9,delay:-6}];function UXe(){return m.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-[1] overflow-hidden",children:FXe.map(t=>m.jsx(PJ.img,{src:DXe[t.card],alt:"",style:{left:`${t.left}%`,width:t.width},className:"absolute h-auto rounded-md opacity-40 brightness-75 drop-shadow-2xl",initial:{top:"-30%",rotate:t.rot-4},animate:{top:"120%",rotate:t.rot+4},transition:{duration:t.duration,delay:t.delay,repeat:Number.POSITIVE_INFINITY,ease:"easeIn"}},`${t.card}-${t.left}-${t.rot}`))})}function jXe(){return m.jsx("img",{src:"/packs/referral/gacha-watermark.webp",alt:"",className:"absolute bottom-0 left-0 z-[2] h-[110px] w-full object-cover"})}function BXe({referral:t}){const{t:e}=ta("play");return t?m.jsx("img",{"data-testid":"referral-welcome-offer-card",src:"/packs/referral/welcome-ticket-logged-out.webp",alt:e("referral.modal.welcomeOffer"),className:"relative z-10 w-full max-w-[260px] drop-shadow-2xl"}):m.jsxs("div",{className:"relative z-10 flex flex-col items-start gap-4",children:[m.jsx("img",{src:"/landing/images/labels/one-pull-and-a-dream.webp",alt:e("referral.modal.defaultHeadline"),className:"w-full max-w-[300px]"}),m.jsx("p",{className:"max-w-[300px] text-sm text-grey-20",children:e("referral.modal.defaultSubtitle")})]})}function Sct({title:t,titleImg:e,subtitle:n,mobileMaxWidthClass:r}){return m.jsxs("div",{className:"relative z-10 flex flex-col items-start gap-4",children:[e?m.jsx("img",{src:e,alt:t,className:`z-10 w-full h-auto md:w-[335px] md:max-w-none md:h-auto object-contain object-left ${r??""}`}):m.jsx("h2",{className:"text-4xl font-bold uppercase italic leading-[0.95] text-white font-space-grotesk",children:t}),n&&m.jsx("p",{className:"max-w-[300px] text-base font-bold leading-140 text-white",children:n})]})}function VXe({children:t,hero:e}){const{hasReferralOffer:n}=a6();return m.jsxs("div",{className:"grid w-full grid-cols-1 md:grid-cols-[minmax(0,44%)_minmax(0,56%)]",children:[m.jsxs("div",{className:"relative hidden overflow-hidden bg-grey-90 p-8 md:flex md:min-
721h-[560px] md:flex-col md:justify-center",children:[m.jsx(jXe,{}),m.jsx(UXe,{}),m.jsx("img",{src:"/logo.webp",alt:"Gacha",className:"absolute left-8 top-8 z-10 h-8 w-auto"}),m.jsx("div",{className:"flex items-center justify-center",children:e??m.jsx(BXe,{referral:n})})]}),m.jsx("div",{className:"flex flex-col",children:t})]})}const HXe=L.forwardRef(({className:t,...e},n)=>m.jsx("textarea",{className:dm("flex min-h-[80px] w-full rounded-md border border-neutral-200 bg-white px-3 py-2 text-base ring-offset-white placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:border-neutral-800 dark:bg-neutral-950 dark:ring-offset-neutral-950 dark:placeholder:text-neutral-400 dark:focus-visible:ring-neutral-300",t),ref:n,...e}));HXe.displayName="Textarea";function WXe({className:t,...e}){return m.jsx("div",{"data-slot":"input-group",role:"group",className:dm("group/input-group border-neutral-200 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow] dark:border-neutral-800","h-9 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","dark:focus-visible:border-grey-60","dark:hover:border-grey-60","has-[[data-slot][aria-invalid=true]]:ring-red-500/20 has-[[data-slot][aria-invalid=true]]:border-red-500 dark:has-[[data-slot][aria-invalid=true]]:ring-red-500/40 dark:has-[[data-slot][aria-invalid=true]]:ring-red-900/20 dark:has-[[data-slot][aria-invalid=true]]:border-red-900 dark:dark:has-[[data-slot][aria-invalid=true]]:ring-red-900/40",t),...e})}const qXe=OJ("text-neutral-500 flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 dark:text-neutral-400",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]","block-start":"[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5","block-end":"[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function zXe({className:t,align:e="inline-start",...n}){return m.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:dm(qXe({align:e}),t),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}function ZXe({className:t,...e}){return m.jsx(RJ,{"data-slot":"input-group-control",className:dm("flex-1 rounded-none border-0 bg-transparent shadow-none dark:bg-transparent",t),...e})}var n9={exports:{}},r9={exports:{}},i9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(r){if(r==null)throw new TypeError("Expected a string but received a ".concat(r));if(r.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(r.constructor.name))}t.exports=e.default,t.exports.default=e.default})(i9,i9.exports);var Ae=i9.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a),a=Date.parse(a),isNaN(a)?null:new Date(a)}t.exports=e.default,t.exports.default=e.default})(r9,r9.exports);var MA=r9.exports,a9={exports:{}},of={},s9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(r){return r==null}t.exports=e.default,t.exports.default=e.default})(s9,s9.exports);var IY=s9.exports,yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.farsiLocales=yn.englishLocales=yn.dotDecimal=yn.decimal=yn.commaDecimal=yn.bengaliLocales=yn.arabicLocales=yn.alphanumeric=yn.alpha=void 0;var Li=yn.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÃÆÄİıÃÅÃ]+$/i,"bg-BG":/^[Ð-Я]+$/i,"cs-CZ":/^[A-ZÃÄÄÃÄÃÅÃÅŠŤÃŮÎ]+$/i,"da-DK":/^[A-ZÃÃÃ
]+$/i,"de-DE":/^[A-ZÃÃÃÃ]+$/i,"el-GR":/^[Î-Ï]+$/i,"es-ES":/^[A-ZÃÃÃÃÃÃÃ]+$/i,"fa-IR":/^[Ø§Ø¨Ù¾ØªØ«Ø¬ÚØØ®Ø¯Ø°Ø±Ø²ÚØ³Ø´ØµØ¶Ø·Ø¸Ø¹ØºÙÙÚ©Ú¯ÙÙ
ÙÙÙÛ]+$/i,"fi-FI":/^[A-ZÃ
ÃÃ]+$/i,"fr-FR":/^[A-ZÃÃÃÃÃÃÃÃÃÃÃÅÃÃß]+$/i,"it-IT":/^[A-ZÃÃÃÃÃÃÃÃ]+$/i,"ja-JP":/^[ã-ãã¡-ã¶ï½¦-ï¾ä¸-é¾ ã¼ã»ãã]+$/i,"nb-NO":/^[A-ZÃÃÃ
]+$/i,"nl-NL":/^[A-ZÃÃÃÃÃÃÃÃ]+$/i,"nn-NO":/^[A-ZÃÃÃ
]+$/i,"hu-HU":/^[A-ZÃÃÃÃÃÅÃÃŰ]+$/i,"pl-PL":/^[A-ZÄÄÄÅÅÅÃŻŹ]+$/i,"pt-PT":/^[A-ZÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ]+$/i,"ru-RU":/^[Ð-ЯÐ]+$/i,"kk-KZ":/^[Ð-ЯÐ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZÄÄÄŠŽ]+$/i,"sk-SK":/^[A-ZÃÄÄÃÃÅÊŤÃÃŽĹÅĽÃÃ]+$/i,"sr-RS@latin":/^[A-ZÄÄŽŠÄ]+$/i,"sr-RS":/^[Ð-ЯÐÐÐÐÐÐ]+$/i,"sv-SE":/^[A-ZÃ
ÃÃ]+$/i,"th-TH":/^[à¸-à¹\s]+$/i,"tr-TR":/^[A-ZÃÄİıÃÅÃ]+$/i,"uk-UA":/^[Ð-ЩЬЮЯÐIÐÒÑ]+$/i,"vi-VN":/^[A-ZÃÃẠẢÃÃẦẤẬẨẪÄẰẮẶẲẴÄÃÃẸẺẼÃá»áº¾á»á»á»ÃÃá»á»Ä¨ÃÃá»á»ÃÃá»á»á»á»á»Æ á»á»á»¢á»á» ÃÃỤỦŨƯỪỨỰỬỮỲÃỴỶỸ]+$/i,"ko-KR":/^[ã±-ã
ã
-ã
£ê°-í£]*$/,"ku-IQ":/^[Ø¦Ø§Ø¨Ù¾ØªØ¬ÚØØ®Ø¯Ø±ÚØ²ÚسشعغÙÚ¤ÙÚ©Ú¯ÙÚµÙ
ÙÙÛÚ¾ÛÛÛÙØ·Ø¤Ø«Ø¢Ø¥Ø£Ùضصةظذ]+$/i,ar:/^[Ø¡Ø¢Ø£Ø¤Ø¥Ø¦Ø§Ø¨Ø©ØªØ«Ø¬ØØ®Ø¯Ø°Ø±Ø²Ø³Ø´ØµØ¶Ø·Ø¸Ø¹ØºÙÙÙÙÙ
ÙÙÙÙÙÙÙÙÙÙÙÙÙÙ°]+$/,he:/^[×-ת]+$/,fa:/^['Ø¢Ø§Ø¡Ø£Ø¤Ø¦Ø¨Ù¾ØªØ«Ø¬ÚØØ®Ø¯Ø°Ø±Ø²ÚØ³Ø´ØµØ¶Ø·Ø¸Ø¹ØºÙÙÚ©Ú¯ÙÙ
ÙÙÙØ©Û']+$/i,bn:/^['à¦à¦à¦à¦à¦
à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦ ডঢণতথদধনপফবà¦à¦®à¦¯à¦°à¦²à¦¶à¦·à¦¸à¦¹à¦¼à¦½à¦¾à¦¿à§à§à§à§à§à§à§à§à§à§à§à§à§à§à§à§ ৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCÄD-GÄHĤIJÄ´K-PRSÅTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/,"ta-IN":/^[\u0B80-\u0BFF]+$/i,"te-IN":/^[\u0C00-\u0C7F]+$/i,"kn-IN":/^[\u0C80-\u0CFF]+$/i,"ml-IN":/^[\u0D00-\u0D7F]+$/i,"gu-IN":/^[\u0A80-\u0AFF]+$/i,"pa-IN":/^[\u0A00-\u0A7F]+$/i,"or-IN":/^[\u0B00-\u0B7F]+$/i},ki=yn.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÃÆÄİıÃÅÃ]+$/i,"bg-BG":/^[0-9Ð-Я]+$/i,"cs-CZ":/^[0-9A-ZÃÄÄÃÄÃÅÃÅŠŤÃŮÎ]+$/i,"da-DK":/^[0-9A-ZÃÃÃ
]+$/i,"de-DE":/^[0-9A-ZÃÃÃÃ]+$/i,"el-GR":/^[0-9Î-Ï]+$/i,"es-ES":/^[0-9A-ZÃÃÃÃÃÃÃ]+$/i,"fi-FI":/^[0-9A-ZÃ
ÃÃ]+$/i,"fr-FR":/^[0-9A-ZÃÃÃÃÃÃÃÃÃÃÃÅÃÃß]+$/i,"it-IT":/^[0-9A-ZÃÃÃÃÃÃÃÃ]+$/i,"ja-JP":/^[0-9ï¼-ï¼ã-ãã¡-ã¶ï½¦-ï¾ä¸-é¾ ã¼ã»ãã]+$/i,"hu-HU":/^[0-9A-ZÃÃÃÃÃÅÃÃŰ]+$/i,"nb-NO":/^[0-9A-ZÃÃÃ
]+$/i,"nl-NL":/^[0-9A-ZÃÃÃÃÃÃÃÃ]+$/i,"nn-NO":/^[0-9A-ZÃÃÃ
]+$/i,"pl-PL":/^[0-9A-ZÄÄÄÅÅÅÃŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ]+$/i,"ru-RU":/^[0-9Ð-ЯÐ]+$/i,"kk-KZ":/^[0-9Ð-ЯÐ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZÄÄÄŠŽ]+$/i,"sk-SK":/^[0-9A-ZÃÄÄÃÃÅÊŤÃÃŽĹÅĽÃÃ]+$/i,"sr-RS@latin":/^[0-9A-ZÄÄŽŠÄ]+$/i,"sr-RS":/^[0-9Ð-ЯÐÐÐÐÐÐ]+$/i,"sv-SE":/^[0-9A-ZÃ
ÃÃ]+$/i,"th-TH":/^[à¸-à¹\s]+$/i,"tr-TR":/^[0-9A-ZÃÄİıÃÅÃ]+$/i,"uk-UA":/^[0-9Ð-ЩЬЮЯÐIÐÒÑ]+$/i,"ko-KR":/^[0-9ã±-ã
ã
-ã
£ê°-í£]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9Ø¦Ø§Ø¨Ù¾ØªØ¬ÚØØ®Ø¯Ø±ÚØ²ÚسشعغÙÚ¤ÙÚ©Ú¯ÙÚµÙ
ÙÙÛÚ¾ÛÛÛÙØ·Ø¤Ø«Ø¢Ø¥Ø£Ùضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÃÃẠẢÃÃẦẤẬẨẪÄẰẮẶẲẴÄÃÃẸẺẼÃá»áº¾á»á»á»ÃÃá»á»Ä¨ÃÃá»á»ÃÃá»á»á»á»á»Æ á»á»á»¢á»á» ÃÃỤỦŨƯỪỨỰỬỮỲÃỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9Ø¡Ø¢Ø£Ø¤Ø¥Ø¦Ø§Ø¨Ø©ØªØ«Ø¬ØØ®Ø¯Ø°Ø±Ø²Ø³Ø´ØµØ¶Ø·Ø¸Ø¹ØºÙÙÙÙÙ
ÙÙÙÙÙÙÙÙÙÙÙÙÙÙ°]+$/,he:/^[0-9×-ת]+$/,fa:/^['0-9Ø¢Ø§Ø¡Ø£Ø¤Ø¦Ø¨Ù¾ØªØ«Ø¬ÚØØ®Ø¯Ø°Ø±Ø²ÚØ³Ø´ØµØ¶Ø·Ø¸Ø¹ØºÙÙÚ©Ú¯ÙÙ
ÙÙÙØ©ÛÛ±Û²Û³Û´ÛµÛ¶Û·Û¸Û¹Û°']+$/i,bn:/^['à¦à¦à¦à¦à¦
à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦à¦ ডঢণতথদধনপফবà¦à¦®à¦¯à¦°à¦²à¦¶à¦·à¦¸à¦¹à¦¼à¦½à¦¾à¦¿à§à§à§à§à§à§à§à§à§à§à§à§à§à§à§à§ ৡৢৣ০১২৩৪৫৬à§à§®à§¯à§°à§±à§²à§³à§´à§µà§¶à§·à§¸à§¹à§ºà§»']+$/,eo:/^[0-9ABCÄD-GÄHĤIJÄ´K-PRSÅTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/,"ta-IN":/^[0-9\u0B80-\u0BFF.]+$/i,"te-IN":/^[0-9\u0C00-\u0C7F.]+$/i,"kn-IN":/^[0-9\u0C80-\u0CFF.]+$/i,"ml-IN":/^[0-9\u0D00-\u0D7F.]+$/i,"gu-IN":/^[0-9\u0A80-\u0AFF.]+$/i,"pa-IN":/^[0-9\u0A00-\u0A7F.]+$/i,"or-IN":/^[0-9\u0B00-\u0B7F.]+$/i},li=yn.decimal={"en-US":".",ar:"Ù«"},wM=yn.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"];for(var l3,f7=0;f7<wM.length;f7++)l3="en-".concat(wM[f7]),Li[l3]=Li["en-US"],ki[l3]=ki["en-US"],li[l3]=li["en-US"];var bM=yn.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];for(var u3,h7=0;h7<bM.length;h7++)u3="ar-".concat(bM[h7]),Li[u3]=Li.ar,ki[u3]=ki.ar,li[u3]=li.ar;var _M=yn.farsiLocales=["IR","AF"];for(var p7,g7=0;g7<_M.length;g7++)p7="fa-".concat(_M[g7]),ki[p7]=ki.fa,li[p7]=li.ar;var CM=yn.bengaliLocales=["BD","IN"];for(var d3,y7=0;y7<CM.length;y7++)d3="bn-".concat(CM[y7]),Li[d3]=Li.bn,ki[d3]=ki.bn,li[d3]=li["en-US"];var EM=yn.dotDecimal=["ar-EG","ar-LB","ar-LY"],SM=yn.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","gu-IN","hi-IN","hu-HU","id-ID","it-IT","kk-KZ","kn-IN","ku-IQ","ml-IN","nb-NO","nl-NL","nn-NO","or-IN","pa-IN","pl-PL","pt-PT","ru-RU","si-LK","sl-SI","sr-RS","sr-RS@latin","sv-SE","ta-IN","te-IN","tr-TR","uk-UA","vi-VN"];for(var m7=0;m7<EM.length;m7++)li[EM[m7]]=li["en-US"];for(var v7=0;v7<SM.length;v7++)li[SM[v7]]=",";Li["fr-CA"]=Li["fr-FR"];ki["fr-CA"]=ki["fr-FR"];Li["pt-BR"]=Li["pt-PT"];ki["pt-BR"]=ki["pt-PT"];li["pt-BR"]=li["pt-PT"];Li["pl-Pl"]=Li["pl-PL"];ki["pl-Pl"]=ki["pl-PL"];li["pl-Pl"]=li["pl-PL"];Li["fa-AF"]=Li.fa;
721Object.defineProperty(of,"__esModule",{value:!0});of.default=GXe;of.locales=void 0;var KXe=LY(Ae),f3=LY(IY),TY=yn;function LY(t){return t&&t.__esModule?t:{default:t}}function GXe(t,e){(0,KXe.default)(t),e=e||{};var n=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(e.locale?TY.decimal[e.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(t===""||t==="."||t===","||t==="-"||t==="+")return!1;var r=parseFloat(t.replace(",","."));return n.test(t)&&(!e.hasOwnProperty("min")||(0,f3.default)(e.min)||r>=e.min)&&(!e.hasOwnProperty("max")||(0,f3.default)(e.max)||r<=e.max)&&(!e.hasOwnProperty("lt")||(0,f3.default)(e.lt)||r<e.lt)&&(!e.hasOwnProperty("gt")||(0,f3.default)(e.gt)||r>e.gt)}of.locales=Object.keys(TY.decimal);(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(of);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a)?parseFloat(a):NaN}t.exports=e.default,t.exports.default=e.default})(a9,a9.exports);var kY=a9.exports,o9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){return(0,n.default)(a),parseInt(a,s||10)}t.exports=e.default,t.exports.default=e.default})(o9,o9.exports);var YXe=o9.exports,c9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){return(0,n.default)(a),s?a==="1"||/^true$/i.test(a):a!=="0"&&!/^false$/i.test(a)&&a!==""}t.exports=e.default,t.exports.default=e.default})(c9,c9.exports);var JXe=c9.exports,l9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){return(0,n.default)(a),a===s}t.exports=e.default,t.exports.default=e.default})(l9,l9.exports);var XXe=l9.exports,u9={exports:{}},d9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function n(i){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n(i)}function r(i){return n(i)==="object"&&i!==null?typeof i.toString=="function"?i=i.toString():i="[object Object]":(i===null||typeof i>"u"||isNaN(i)&&!i.length)&&(i=""),String(i)}t.exports=e.default,t.exports.default=e.default})(d9,d9.exports);var $Y=d9.exports,f9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;for(var a in i)typeof r[a]>"u"&&(r[a]=i[a]);return r}t.exports=e.default,t.exports.default=e.default})(f9,f9.exports);var di=f9.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=a(Ae),r=a($Y),i=a(di);function a(c){return c&&c.__esModule?c:{default:c}}var s={ignoreCase:!1,minOccurrences:1};function o(c,l,u){return(0,n.default)(c),u=(0,i.default)(u,s),u.ignoreCase?c.toLowerCase().split((0,r.default)(l).toLowerCase()).length>u.minOccurrences:c.split((0,r.default)(l)).length>u.minOccurrences}t.exports=e.default,t.exports.default=e.default})(u9,u9.exports);var QXe=u9.exports,h9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s,o){return(0,n.default)(a),Object.prototype.toString.call(s)!=="[object RegExp]"&&(s=new RegExp(s,o)),!!a.match(s)}t.exports=e.default,t.exports.default=e.default})(h9,h9.exports);var eQe=h9.exports,p9={exports:{}},g9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function n(i){return Object.prototype.toString.call(i)==="[object RegExp]"}function r(i,a){for(var s=0;s<a.length;s++){var o=a[s];if(i===o||n(o)&&o.test(i))return!0}return!1}t.exports=e.default,t.exports.default=e.default})(g9,g9.exports);var PY=g9.exports,y9={exports:{}};
vendor: 3,491 bytes, line 721
721(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},i(s)}function a(s,o){(0,n.default)(s);var c,l;i(o)==="object"?(c=o.min||0,l=o.max):(c=arguments[1],l=arguments[2]);var u=encodeURI(s).split(/%..|./).length-1;return u>=c&&(typeof l>"u"||u<=l)}t.exports=e.default,t.exports.default=e.default})(y9,y9.exports);var RY=y9.exports,m9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(Ae),r=i(di);function i(o){return o&&o.__esModule?o:{default:o}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function s(o,c){(0,n.default)(o),c=(0,r.default)(c,a),c.allow_trailing_dot&&o[o.length-1]==="."&&(o=o.substring(0,o.length-1)),c.allow_wildcard===!0&&o.indexOf("*.")===0&&(o=o.substring(2));var l=o.split("."),u=l[l.length-1];return c.require_tld&&(l.length<2||!c.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(u)||/\s/.test(u))||!c.allow_numeric_tld&&/^\d+$/.test(u)?!1:l.every(function(d){return!(d.length>63&&!c.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(d)||/[\uff01-\uff5e]/.test(d)||/^-|-$/.test(d)||!c.allow_underscores&&/_/.test(d))})}t.exports=e.default,t.exports.default=e.default})(m9,m9.exports);var NA=m9.exports,v9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var n=r(Ae);function r(d){return d&&d.__esModule?d:{default:d}}function i(d){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},i(d)}var a="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",s="(".concat(a,"[.]){3}").concat(a),o=new RegExp("^".concat(s,"$")),c="(?:[0-9a-fA-F]{1,4})",l=new RegExp("^("+"(?:".concat(c,":){7}(?:").concat(c,"|:)|")+"(?:".concat(c,":){6}(?:").concat(s,"|:").concat(c,"|:)|")+"(?:".concat(c,":){5}(?::").concat(s,"|(:").concat(c,"){1,2}|:)|")+"(?:".concat(c,":){4}(?:(:").concat(c,"){0,1}:").concat(s,"|(:").concat(c,"){1,3}|:)|")+"(?:".concat(c,":){3}(?:(:").concat(c,"){0,2}:").concat(s,"|(:").concat(c,"){1,4}|:)|")+"(?:".concat(c,":){2}(?:(:").concat(c,"){0,3}:").concat(s,"|(:").concat(c,"){1,5}|:)|")+"(?:".concat(c,":){1}(?:(:").concat(c,"){0,4}:").concat(s,"|(:").concat(c,"){1,6}|:)|")+"(?::((?::".concat(c,"){0,5}:").concat(s,"|(?::").concat(c,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function u(d){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(d);var h=(i(f)==="object"?f.version:arguments[1])||"";return h?h.toString()==="4"?o.test(d):h.toString()==="6"?l.test(d):!1:u(d,{version:4})||u(d,{version:6})}t.exports=e.default,t.exports.default=e.default})(v9,v9.exports);var s6=v9.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=b;var n=c(Ae),r=c(PY),i=c(RY),a=c(NA),s=c(s6),o=c(di);function c(w){return w&&w.__esModule?w:{default:w}}var l={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blackl
721isted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},u=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,d=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,f=/^[a-z\d]+$/,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,p=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,g=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,y=254;function v(w){var _=w.replace(/^"(.+)"$/,"$1");if(!_.trim())return!1;var E=/[\.";<>]/.test(_);if(E){if(_===w)return!1;var C=_.split('"').length===_.split('\\"').length;if(!C)return!1}return!0}function b(w,_){if((0,n.default)(w),_=(0,o.default)(_,l),_.require_display_name||_.allow_display_name){var E=w.match(u);if(E){var C=E[1];if(w=w.replace(C,"").replace(/(^<|>$)/g,""),C.endsWith(" ")&&(C=C.slice(0,-1)),!v(C))return!1}else if(_.require_display_name)return!1}if(!_.ignore_max_length&&w.length>y)return!1;var x=w.split("@"),$=x.pop(),T=$.toLowerCase();if(_.host_blacklist.length>0&&(0,r.default)(T,_.host_blacklist)||_.host_whitelist.length>0&&!(0,r.default)(T,_.host_whitelist))return!1;var U=x.join("@");if(_.domain_specific_validation&&(T==="gmail.com"||T==="googlemail.com")){U=U.toLowerCase();var O=U.split("+")[0];if(!(0,i.default)(O.replace(/\./g,""),{min:6,max:30}))return!1;for(var F=O.split("."),k=0;k<F.length;k++)if(!f.test(F[k]))return!1}if(_.ignore_max_length===!1&&(!(0,i.default)(U,{max:64})||!(0,i.default)($,{max:254})))return!1;if(!(0,a.default)($,{require_tld:_.require_tld,ignore_max_length:_.ignore_max_length,allow_underscores:_.allow_underscores})){if(!_.allow_ip_domain)return!1;if(!(0,s.default)($)){if(!$.startsWith("[")||!$.endsWith("]"))return!1;var S=$.slice(1,-1);if(S.length===0||!(0,s.default)(S))return!1}}if(_.blacklisted_chars&&U.search(new RegExp("[".concat(_.blacklisted_chars,"]+"),"g"))!==-1)return!1;if(U[0]==='"'&&U[U.length-1]==='"')return U=U.slice(1,U.length-1),_.allow_utf8_local_part?g.test(U):h.test(U);for(var I=_.allow_utf8_local_part?p:d,A=U.split("."),R=0;R<A.length;R++)if(!I.test(A[R]))return!1;return!0}t.exports=e.default,t.exports.default=e.default})(p9,p9.exports);var OY=p9.exports,w9={exports:{}},b9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(i,a){return i.indexOf(a)!==-1};e.default=n,t.exports=e.default,t.exports.default=e.default})(b9,b9.exports);var MY=b9.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=v;var n=c(Ae),r=c(PY),i=c(MY),a=c(NA),s=c(s6),o=c(di);function c(b){return b&&b.__esModule?b:{default:b}}function l(b,w){return p(b)||h(b,w)||d(b,w)||u()}function u(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 722In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(b,w){if(b){if(typeof b=="string")return f(b,w);var _={}.toString.call(b).slice(8,-1);return _==="Object"&&b.constructor&&(_=b.constructor.name),_==="Map"||_==="Set"?Array.from(b):_==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_)?f(b,w):void 0}}function f(b,w){(w==null||w>b.length)&&(w=b.length);for(var _=0,E=Array(w);_<w;_++)E[_]=b[_];return E}function h(b,w){var _=b==null?null:typeof Symbol<"u"&&b[Symbol.iterator]||b["@@iterator"];if(_!=null){var E,C,x,$,T=[],U=!0,O=!1;try{if(x=(_=_.call(b)).next,w!==0)for(;!(U=(E=x.call(_)).done)&&(T.push(E.value),T.length!==w);U=!0);}catch(F){O=!0,C=F}finally{try{if(!U&&_.return!=null&&($=_.return(),Object($)!==$))return}finally{if(O)throw C}}return T}}function p(b){if(Array.isArray(b))return b}var g={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},y=/^\[([^\]]+)\](?::([0-9]+))?$/;function v(b,w){if((0,n.default)(b),!b||/[\s<>]/.test(b)||b.indexOf("mailto:")===0||(w=(0,o.default)(w,g),w.validate_length&&b.length>w.max_allowed_length)||!w.allow_fragments&&(0,i.default)(b,"#")||!w.allow_query_components&&((0,i.default)(b,"?")||(0,i.default)(b,"&")))return!1;var _,E,C,x,$,T,U,O;U=b.split("#"),b=U.shift(),U=b.split("?"),b=U.shift();var F=b.match(/^([a-z][a-z0-9+\-.]*):/i),k=!1,S=function(ne){return k=!0,_=ne.toLowerCase(),w.require_valid_protocol&&w.protocols.indexOf(_)===-1?!1:b.substring(F[0].length)};if(F){var I=F[1],A=b.substring(F[0].length),R=A.slice(0,2)==="//";if(R){if(b=S(I),b===!1)return!1}else{var N=A.indexOf("/"),P=N===-1?A:A.substring(0,N),j=P.indexOf("@");if(j!==-1){var M=P.substring(0,j),V=/^[a-zA-Z0-9\-_.%:]*$/,B=V.test(M);if(B){if(w.require_protocol)return!1}else if(b=S(I),b===!1)return!1}else{var G=/^[0-9]/.test(A);if(G){if(w.require_protocol)return!1}else if(b=S(I),b===!1)return!1}}}else if(w.require_protocol)return!1;if(b.slice(0,2)==="//"){if(!k&&!w.allow_protocol_relative_urls)return!1;b=b.slice(2)}if(b==="")return!1;if(U=b.split("/"),b=U.shift(),b===""&&!w.require_host)return!0;
722if(U=b.split("@"),U.length>1){if(w.disallow_auth||U[0]===""||(E=U.shift(),E.indexOf(":")>=0&&E.split(":").length>2))return!1;var Z=E.split(":"),ie=l(Z,2),oe=ie[0],z=ie[1];if(oe===""&&z==="")return!1}x=U.join("@"),T=null,O=null;var J=x.match(y);if(J?(C="",O=J[1],T=J[2]||null):(U=x.split(":"),C=U.shift(),U.length&&(T=U.join(":"))),T!==null&&T.length>0){if($=parseInt(T,10),!/^[0-9]+$/.test(T)||$<=0||$>65535)return!1}else if(w.require_port)return!1;return w.host_whitelist?(0,r.default)(C,w.host_whitelist):C===""&&!w.require_host?!0:!(!(0,s.default)(C)&&!(0,a.default)(C,w)&&(!O||!(0,s.default)(O,6))||(C=C||O,w.host_blacklist&&(0,r.default)(C,w.host_blacklist)))}t.exports=e.default,t.exports.default=e.default})(w9,w9.exports);var tQe=w9.exports,_9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var n=r(Ae);function r(d){return d&&d.__esModule?d:{default:d}}var i=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,a=/^([0-9a-fA-F]){12}$/,s=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,o=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,c=/^([0-9a-fA-F]){16}$/,l=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function u(d,f){return(0,n.default)(d),f!=null&&f.eui&&(f.eui=String(f.eui)),f!=null&&f.no_colons||f!=null&&f.no_separators?f.eui==="48"?a.test(d):f.eui==="64"?c.test(d):a.test(d)||c.test(d):f?.eui==="48"?i.test(d)||s.test(d):f?.eui==="64"?o.test(d)||l.test(d):u(d,{eui:"48"})||u(d,{eui:"64"})}t.exports=e.default,t.exports.default=e.default})(_9,_9.exports);var nQe=_9.exports,C9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var n=i(Ae),r=i(s6);function i(l){return l&&l.__esModule?l:{default:l}}var a=/^\d{1,3}$/,s=32,o=128;function c(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(0,n.default)(l);var d=l.split("/");if(d.length!==2||!a.test(d[1])||d[1].length>1&&d[1].startsWith("0"))return!1;var f=(0,r.default)(d[0],u);if(!f)return!1;var h=null;switch(String(u)){case"4":h=s;break;case"6":h=o;break;default:h=(0,r.default)(d[0],"6")?o:s}return d[1]<=h&&d[1]>=0}t.exports=e.default,t.exports.default=e.default})(C9,C9.exports);var rQe=C9.exports,E9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=p;var n=r(di);function r(g){return g&&g.__esModule?g:{default:g}}function i(g,y){return o(g)||s(g,y)||l(g,y)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 723In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(g,y){var v=g==null?null:typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(v!=null){var b,w,_,E,C=[],x=!0,$=!1;try{if(_=(v=v.call(g)).next,y!==0)for(;!(x=(b=_.call(v)).done)&&(C.push(b.value),C.length!==y);x=!0);}catch(T){$=!0,w=T}finally{try{if(!x&&v.return!=null&&(E=v.return(),Object(E)!==E))return}finally{if($)throw w}}return C}}function o(g){if(Array.isArray(g))return g}function c(g,y){var v=typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(!v){if(Array.isArray(g)||(v=l(g))||y){v&&(g=v);var b=0,w=function(){};return{s:w,n:function(){return b>=g.length?{done:!0}:{done:!1,value:g[b++]}},e:function($){throw $},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 724In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _,E=!0,C=!1;return{s:function(){v=v.call(g)},n:function(){var $=v.next();return E=$.done,$},e:function($){C=!0,_=$},f:function(){try{E||v.return==null||v.return()}finally{if(C)throw _}}}}function l(g,y){if(g){if(typeof g=="string")return u(g,y);var v={}.toString.call(g).slice(8,-1);return v==="Object"&&g.constructor&&(v=g.constructor.name),v==="Map"||v==="Set"?Array.from(g):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?u(g,y):void 0}}function u(g,y){(y==null||y>g.length)&&(y=g.length);for(var v=0,b=Array(y);v<y;v++)b[v]=g[v];return b}var d={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};function f(g){return/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(g)}function h(g,y){for(var v=[],b=Math.max(g.length,y.length),w=0;w<b;
724w++)v.push([g[w],y[w]]);return v}function p(g,y){if(typeof y=="string"?y=(0,n.default)({format:y},d):y=(0,n.default)(y,d),typeof g=="string"&&f(y.format)){if(y.strictMode&&g.length!==y.format.length)return!1;var v=y.delimiters.find(function(I){return y.format.indexOf(I)!==-1}),b=y.strictMode?v:y.delimiters.find(function(I){return g.indexOf(I)!==-1}),w=h(g.split(b),y.format.toLowerCase().split(v)),_={},E=c(w),C;try{for(E.s();!(C=E.n()).done;){var x=i(C.value,2),$=x[0],T=x[1];if(!$||!T||$.length!==T.length)return!1;_[T.charAt(0)]=$}}catch(I){E.e(I)}finally{E.f()}var U=_.y;if(U.startsWith("-"))return!1;if(_.y.length===2){var O=parseInt(_.y,10);if(isNaN(O))return!1;var F=new Date().getFullYear()%100;O<F?U="20".concat(_.y):U="19".concat(_.y)}var k=_.m;_.m.length===1&&(k="0".concat(_.m));var S=_.d;return _.d.length===1&&(S="0".concat(_.d)),new Date("".concat(U,"-").concat(k,"-").concat(S,"T00:00:00.000Z")).getUTCDate()===+_.d}return y.strictMode?!1:Object.prototype.toString.call(g)==="[object Date]"&&isFinite(g)}t.exports=e.default,t.exports.default=e.default})(E9,E9.exports);var NY=E9.exports,S9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=r(di);function r(o){return o&&o.__esModule?o:{default:o}}var i={hourFormat:"hour24",mode:"default"},a={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/,withOptionalSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9]))?$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/,withOptionalSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9])(?::([0-5][0-9]))? (A|P)M$/}};function s(o,c){return c=(0,n.default)(c,i),typeof o!="string"?!1:a[c.hourFormat][c.mode].test(o)}t.exports=e.default,t.exports.default=e.default})(S9,S9.exports);var iQe=S9.exports,A9={exports:{}},x9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(i,a){return i.some(function(s){return a===s})};e.default=n,t.exports=e.default,t.exports.default=e.default})(x9,x9.exports);var j0=x9.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var n=i(Ae),r=i(j0);function i(l){return l&&l.__esModule?l:{default:l}}var a={loose:!1},s=["true","false","1","0"],o=[].concat(s,["yes","no"]);function c(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a;return(0,n.default)(l),u.loose?(0,r.default)(o,l.toLowerCase()):(0,r.default)(s,l)}t.exports=e.default,t.exports.default=e.default})(A9,A9.exports);var aQe=A9.exports,I9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=b;var n=r(Ae);function r(w){return w&&w.__esModule?w:{default:w}}var i="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",a="(([a-zA-Z]{2,3}(-".concat(i,")?)|([a-zA-Z]{5,8}))"),s="([A-Za-z]{4})",o="([A-Za-z]{2}|\\d{3})",c="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",l="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",u="(".concat(l,"(-[A-Za-z0-9]{2,8})+)"),d="(x(-[A-Za-z0-9]{1,8})+)",f="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",h="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",p="(".concat(f,"|").concat(h,")"),g="(-|_)",y="".concat(a,"(").concat(g).concat(s,")?(").concat(g).concat(o,")?(").concat(g).concat(c,")*(").concat(g).concat(u,")*(").concat(g).concat(d,")?"),v=new RegExp("(^".concat(d,"$)|(^").concat(p,"$)|(^").concat(y,"$)"));function b(w){return(0,n.default)(w),v.test(w)}t.exports=e.default,t.exports.default=e.default})(I9,I9.exports);var sQe=I9.exports,T9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function a(s){if((0,n.default)(s),!i.test(s))return!1;for(var o=0,c=0;c<s.length;c++)c%3===0?o+=s[c]*3:c%3===1?o+=s[c]*7:o+=s[c]*1;return o%10===0}t.exports=e.default,t.exports.default=e.default})(T9,T9.exports);var oQe=T9.exports,B0={};Object.defineProperty(B0,"__esModule",{value:!0});B0.default=uQe;B0.locales=void 0;var cQe=lQe(Ae),L9=yn;function lQe(t){return t&&t.__esModule?t:{default:t}}function uQe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,cQe.default)(t);var r=t,i=n.ignore;if(i)if(i instanceof RegExp)r=r.replace(i,"");else if(typeof i=="string")r=r.replace(new RegExp("[".concat(i.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(e in L9.alpha)return L9.alpha[e].test(r);throw new Error("Invalid locale '".concat(e,"'"))}B0.locales=Object.keys(L9.alpha);var V0={};Object.defineProperty(V0,"__esModule",{value:!0});V0.default=hQe;V0.locales=void 0;var dQe=fQe(Ae),k9=yn;function fQe(t){return t&&t.__esModule?t:{default:t}}function hQe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,dQe.default)(t);var r=t,i=n.ignore;if(i)if(i instanceof RegExp)r=r.replace(i,"");else if(typeof i=="string")r=r.replace(new RegExp("[".concat(i.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(e in k9.alphanumeric)return k9.alphanumeric[e].test(r);throw new Error("Invalid locale '".concat(e,"'"))}V0.locales=Object.keys(k9.alphanumeric);var $9={exports:{}};
724(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(Ae),r=yn;function i(o){return o&&o.__esModule?o:{default:o}}var a=/^[0-9]+$/;function s(o,c){return(0,n.default)(o),c&&c.no_symbols?a.test(o):new RegExp("^[+-]?([0-9]*[".concat((c||{}).locale?r.decimal[c.locale]:".","])?[0-9]+$")).test(o)}t.exports=e.default,t.exports.default=e.default})($9,$9.exports);var pQe=$9.exports,H0={};Object.defineProperty(H0,"__esModule",{value:!0});H0.default=mQe;H0.locales=void 0;var gQe=yQe(Ae);function yQe(t){return t&&t.__esModule?t:{default:t}}var P9={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$|^[A-Z]\d{6}[A-Z]{2}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$|^[A-Z]\d{8}$/,ZA:/^[TAMD]\d{8}$/};H0.locales=Object.keys(P9);function mQe(t,e){(0,gQe.default)(t);var n=t.replace(/\s/g,"").toUpperCase();return e.toUpperCase()in P9&&P9[e].test(n)}var R9={exports:{}},O9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=i(Ae),r=i(IY);function i(c){return c&&c.__esModule?c:{default:c}}var a=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,s=/^[-+]?[0-9]+$/;function o(c,l){(0,n.default)(c),l=l||{};var u=l.allow_leading_zeroes===!1?a:s,d=!l.hasOwnProperty("min")||(0,r.default)(l.min)||c>=l.min,f=!l.hasOwnProperty("max")||(0,r.default)(l.max)||c<=l.max,h=!l.hasOwnProperty("lt")||(0,r.default)(l.lt)||c<l.lt,p=!l.hasOwnProperty("gt")||(0,r.default)(l.gt)||c>l.gt;return u.test(c)&&d&&f&&h&&p}t.exports=e.default,t.exports.default=e.default})(O9,O9.exports);var DA=O9.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(DA);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a,{allow_leading_zeroes:!1,min:0,max:65535})}t.exports=e.default,t.exports.default=e.default})(R9,R9.exports);var vQe=R9.exports,M9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a),a===a.toLowerCase()}t.exports=e.default,t.exports.default=e.default})(M9,M9.exports);var wQe=M9.exports,N9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a),a===a.toUpperCase()}t.exports=e.default,t.exports.default=e.default})(N9,N9.exports);
724var bQe=N9.exports,D9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=r(Ae);function r(o){return o&&o.__esModule?o:{default:o}}var i=/^[0-9]{15}$/,a=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function s(o,c){(0,n.default)(o),c=c||{};var l=i;if(c.allow_hyphens&&(l=a),!l.test(o))return!1;o=o.replace(/-/g,"");for(var u=0,d=2,f=14,h=0;h<f;h++){var p=o.substring(f-h-1,f-h),g=parseInt(p,10)*d;g>=10?u+=g%10+1:u+=g,d===1?d+=1:d-=1}var y=(10-u%10)%10;return y===parseInt(o.substring(14,15),10)}t.exports=e.default,t.exports.default=e.default})(D9,D9.exports);var _Qe=D9.exports,F9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^[\x00-\x7F]+$/;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(F9,F9.exports);var CQe=F9.exports,cf={};Object.defineProperty(cf,"__esModule",{value:!0});cf.default=xQe;cf.fullWidth=void 0;var EQe=SQe(Ae);function SQe(t){return t&&t.__esModule?t:{default:t}}var AQe=cf.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function xQe(t){return(0,EQe.default)(t),AQe.test(t)}var lf={};Object.defineProperty(lf,"__esModule",{value:!0});lf.default=kQe;lf.halfWidth=void 0;var IQe=TQe(Ae);function TQe(t){return t&&t.__esModule?t:{default:t}}var LQe=lf.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function kQe(t){return(0,IQe.default)(t),LQe.test(t)}var U9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=a(Ae),r=cf,i=lf;function a(o){return o&&o.__esModule?o:{default:o}}function s(o){return(0,n.default)(o),r.fullWidth.test(o)&&i.halfWidth.test(o)}t.exports=e.default,t.exports.default=e.default})(U9,U9.exports);var $Qe=U9.exports,j9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/[^\x00-\x7F]/;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(j9,j9.exports);var PQe=j9.exports,B9={exports:{}},V9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(r,i){var a=r.join("");return new RegExp(a,i)}t.exports=e.default,t.exports.default=e.default})(V9,V9.exports);var RQe=V9.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(Ae),r=i(RQe);function i(o){return o&&o.__esModule?o:{default:o}}var a=(0,r.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function s(o){return(0,n.default)(o),a.test(o)}t.exports=e.default,t.exports.default=e.default})(B9,B9.exports);var OQe=B9.exports,H9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(H9,H9.exports);var MQe=H9.exports,W9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var n=s(di),r=s(Ae),i=s(j0),a=yn;function s(d){return d&&d.__esModule?d:{default:d}}function o(d){var f=new RegExp("^[-+]?([0-9]+)?(\\".concat(a.decimal[d.locale],"[0-9]{").concat(d.decimal_digits,"})").concat(d.force_decimal?"":"?","$"));return f}var c={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},l=["","-","+"];function u(d,f){if((0,r.default)(d),f=(0,n.default)(f,c),f.locale in a.decimal)return!(0,i.default)(l,d.replace(/ /g,""))&&o(f).test(d);throw new Error("Invalid locale '".concat(f.locale,"'"))}t.exports=e.default,t.exports.default=e.default})(W9,W9.exports);var NQe=W9.exports,q9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^(0x|0h)?[0-9A-F]+$/i;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(q9,q9.exports);var DY=q9.exports,z9={exports:{}};
724(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^(0o)?[0-7]+$/i;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(z9,z9.exports);var DQe=z9.exports,Z9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=i(Ae),r=i(kY);function i(s){return s&&s.__esModule?s:{default:s}}function a(s,o){return(0,n.default)(s),(0,r.default)(s)%parseInt(o,10)===0}t.exports=e.default,t.exports.default=e.default})(Z9,Z9.exports);var FQe=Z9.exports,K9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(K9,K9.exports);var UQe=K9.exports,G9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var n=r(Ae);function r(d){return d&&d.__esModule?d:{default:d}}function i(d){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},i(d)}var a=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,s=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d\d?|1(\.0)?|0(\.0)?)\)$/,o=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,c=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d\d?|1(\.0)?|0(\.0)?)\)$/,l=/^rgba?/;function u(d,f){(0,n.default)(d);var h=!1,p=!0;if(i(f)!=="object"?arguments.length>=2&&(p=arguments[1]):(h=f.allowSpaces!==void 0?f.allowSpaces:h,p=f.includePercentValues!==void 0?f.includePercentValues:p),h){if(!l.test(d))return!1;d=d.replace(/\s/g,"")}return p?a.test(d)||s.test(d)||o.test(d)||c.test(d):a.test(d)||s.test(d)}t.exports=e.default,t.exports.default=e.default})(G9,G9.exports);var jQe=G9.exports,Y9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=r(Ae);function r(o){return o&&o.__esModule?o:{default:o}}var i=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,a=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function s(o){(0,n.default)(o);var c=o.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return c.indexOf(",")!==-1?i.test(c):a.test(c)}t.exports=e.default,t.exports.default=e.default})(Y9,Y9.exports);var BQe=Y9.exports,J9={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(J9,J9.exports);var VQe=J9.exports,W0={};Object.defineProperty(W0,"__esModule",{value:!0});W0.default=ZQe;W0.locales=void 0;var HQe=FY(Ae),AM=FY(j0);function FY(t){return t&&t.__esModule?t:{default:t}}var lm={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}
724$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function WQe(t){var e=t.filter(function(n){return!(n in lm)});return!(e.length>0)}function qQe(t,e){var n=t.replace(/[\s\-]+/gi,"").toUpperCase(),r=n.slice(0,2).toUpperCase(),i=r in lm;if(e.whitelist){if(!WQe(e.whitelist))return!1;var a=(0,AM.default)(e.whitelist,r);if(!a)return!1}if(e.blacklist){var s=(0,AM.default)(e.blacklist,r);if(s)return!1}return i&&lm[r].test(n)}function zQe(t){var e=t.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),n=e.slice(4)+e.slice(0,4),r=n.replace(/[A-Z]/g,function(a){return a.charCodeAt(0)-55}),i=r.match(/\d{1,7}/g).reduce(function(a,s){return Number(a+s)%97},"");return i===1}function ZQe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,HQe.default)(t),qQe(t,e)&&zQe(t)}W0.locales=Object.keys(lm);var X9={exports:{}},uf={};Object.defineProperty(uf,"__esModule",{value:!0});uf.CountryCodes=void 0;uf.default=YQe;var KQe=GQe(Ae);function GQe(t){return t&&t.__esModule?t:{default:t}}var UY=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function YQe(t){return(0,KQe.default)(t),UY.has(t.toUpperCase())}uf.CountryCodes=UY;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(Ae),r=uf;function i(o){return o&&o.__esModule?o:{default:o}}var a=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function s(o){(0,n.default)(o);var c=o.slice(4,6).toUpperCase();return!r.CountryCodes.has(c)&&c!=="XK"?!1:a.test(o)}t.exports=e.default,t.exports.default=e.default})(X9,X9.exports);var JQe=X9.exports,Q9={exports:{}};
724(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^[a-f0-9]{32}$/;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(Q9,Q9.exports);var XQe=Q9.exports,e_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function a(s,o){(0,n.default)(s);var c=new RegExp("^[a-fA-F0-9]{".concat(i[o],"}$"));return c.test(s)}t.exports=e.default,t.exports.default=e.default})(e_,e_.exports);var QQe=e_.exports,t_={exports:{}},n_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var n=i(Ae),r=i(di);function i(u){return u&&u.__esModule?u:{default:u}}var a=/^[A-Za-z0-9+/]+={0,2}$/,s=/^[A-Za-z0-9+/]+$/,o=/^[A-Za-z0-9_-]+={0,2}$/,c=/^[A-Za-z0-9_-]+$/;function l(u,d){var f;if((0,n.default)(u),d=(0,r.default)(d,{urlSafe:!1,padding:!((f=d)!==null&&f!==void 0&&f.urlSafe)}),u==="")return!0;if(d.padding&&u.length%4!==0)return!1;var h;return d.urlSafe?h=d.padding?o:c:h=d.padding?a:s,(!d.padding||u.length%4===0)&&h.test(u)}t.exports=e.default,t.exports.default=e.default})(n_,n_.exports);var jY=n_.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=i(Ae),r=i(jY);function i(s){return s&&s.__esModule?s:{default:s}}function a(s){(0,n.default)(s);var o=s.split("."),c=o.length;return c!==3?!1:o.reduce(function(l,u){return l&&(0,r.default)(u,{urlSafe:!0})},!0)}t.exports=e.default,t.exports.default=e.default})(t_,t_.exports);var eet=t_.exports,r_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var n=a(Ae),r=a(j0),i=a(di);function a(l){return l&&l.__esModule?l:{default:l}}function s(l){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},s(l)}var o={allow_primitives:!1};function c(l,u){(0,n.default)(l);try{u=(0,i.default)(u,o);var d=[];u.allow_primitives&&(d=[null,!1,!0]);var f=JSON.parse(l);return(0,r.default)(d,f)||!!f&&s(f)==="object"}catch{}return!1}t.exports=e.default,t.exports.default=e.default})(r_,r_.exports);var tet=r_.exports,i_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(Ae),r=i(di);function i(o){return o&&o.__esModule?o:{default:o}}var a={ignore_whitespace:!1};function s(o,c){return(0,n.default)(o),c=(0,r.default)(c,a),(c.ignore_whitespace?o.trim().length:o.length)===0}t.exports=e.default,t.exports.default=e.default})(i_,i_.exports);var net=i_.exports,a_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},i(s)}function a(s,o){(0,n.default)(s);var c,l;i(o)==="object"?(c=o.min||0,l=o.max):(c=arguments[1]||0,l=arguments[2]);var u=s.match(/[^\uFE0F\uFE0E][\uFE0F\uFE0E]/g)||[],d=s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],f=s.length-u.length-d.length,h=f>=c&&(typeof l>"u"||f<=l);return h&&Array.isArray(o?.discreteLengths)?o.discreteLengths.some(function(p){return p===f}):h}t.exports=e.default,t.exports.default=e.default})(a_,a_.exports);var ret=a_.exports,s_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a),/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/i.test(a)}t.exports=e.default,t.exports.default=e.default})(s_,s_.exports);var iet=s_.exports,o_={exports:{}};
724(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,6:/^[0-9A-F]{8}-[0-9A-F]{4}-6[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,8:/^[0-9A-F]{8}-[0-9A-F]{4}-8[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,nil:/^00000000-0000-0000-0000-000000000000$/i,max:/^ffffffff-ffff-ffff-ffff-ffffffffffff$/i,loose:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,all:/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i};function a(s,o){return(0,n.default)(s),o==null&&(o="all"),o in i?i[o].test(s):!1}t.exports=e.default,t.exports.default=e.default})(o_,o_.exports);var aet=o_.exports,c_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=i(Ae),r=i(DY);function i(s){return s&&s.__esModule?s:{default:s}}function a(s){return(0,n.default)(s),(0,r.default)(s)&&s.length===24}t.exports=e.default,t.exports.default=e.default})(c_,c_.exports);var set=c_.exports,l_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(MA);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},i(s)}function a(s,o){var c=(i(o)==="object"?o.comparisonDate:o)||Date().toString(),l=(0,n.default)(c),u=(0,n.default)(s);return!!(u&&l&&u>l)}t.exports=e.default,t.exports.default=e.default})(l_,l_.exports);var oet=l_.exports,u_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(MA);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},i(s)}function a(s,o){var c=(i(o)==="object"?o.comparisonDate:o)||Date().toString(),l=(0,n.default)(c),u=(0,n.default)(s);return!!(u&&l&&u<l)}t.exports=e.default,t.exports.default=e.default})(u_,u_.exports);var cet=u_.exports,d_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=i(Ae),r=i($Y);function i(o){return o&&o.__esModule?o:{default:o}}function a(o){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},a(o)}function s(o,c){(0,n.default)(o);var l;if(Object.prototype.toString.call(c)==="[object Array]"){var u=[];for(l in c)({}).hasOwnProperty.call(c,l)&&(u[l]=(0,r.default)(c[l]));return u.indexOf(o)>=0}else{if(a(c)==="object")return c.hasOwnProperty(o);if(c&&typeof c.indexOf=="function")return c.indexOf(o)>=0}return!1}t.exports=e.default,t.exports.default=e.default})(d_,d_.exports);var uet=d_.exports,f_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){(0,n.default)(a);for(var s=a.replace(/[- ]+/g,""),o=0,c,l,u,d=s.length-1;d>=0;d--)c=s.substring(d,d+1),l=parseInt(c,10),u?(l*=2,l>=10?o+=l%10+1:o+=l):o+=l,u=!u;return!!(o%10===0&&s)}t.exports=e.default,t.exports.default=e.default})(f_,f_.exports);var BY=f_.exports,h_={exports:{}};
724(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=i(Ae),r=i(BY);function i(c){return c&&c.__esModule?c:{default:c}}var a={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},s=function(){var c=[];for(var l in a)a.hasOwnProperty(l)&&c.push(a[l]);return c}();function o(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var u=l.provider,d=c.replace(/[- ]+/g,"");if(u&&u.toLowerCase()in a){if(!a[u.toLowerCase()].test(d))return!1}else{if(u&&!(u.toLowerCase()in a))throw new Error("".concat(u," is not a valid credit card provider."));if(!s.some(function(f){return f.test(d)}))return!1}return(0,r.default)(c)}t.exports=e.default,t.exports.default=e.default})(h_,h_.exports);var det=h_.exports,p_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=a(Ae),r=a(j0),i=a(DA);function a(c){return c&&c.__esModule?c:{default:c}}var s={PL:function(l){(0,n.default)(l);var u={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(l!=null&&l.length===11&&(0,i.default)(l,{allow_leading_zeroes:!0})){var d=l.split("").slice(0,-1),f=d.reduce(function(g,y,v){return g+Number(y)*u[v+1]},0),h=f%10,p=Number(l.charAt(l.length-1));if(h===0&&p===0||p===10-h)return!0}return!1},ES:function(l){(0,n.default)(l);var u=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,d={X:0,Y:1,Z:2},f=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],h=l.trim().toUpperCase();if(!u.test(h))return!1;var p=h.slice(0,-1).replace(/[X,Y,Z]/g,function(g){return d[g]});return h.endsWith(f[p%23])},FI:function(l){if((0,n.default)(l),l.length!==11||!l.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/))return!1;var u="0123456789ABCDEFHJKLMNPRSTUVWXY",d=parseInt(l.slice(0,6),10)*1e3+parseInt(l.slice(7,10),10),f=d%31,h=u[f];return h===l.slice(10,11)},IN:function(l){var u=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,d=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],f=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],h=l.trim();if(!u.test(h))return!1;var p=0,g=h.replace(/\s/g,"").split("").map(Number).reverse();return g.forEach(function(y,v){p=d[p][f[v%8][y]]}),p===0},IR:function(l){if(!l.match(/^\d{10}$/)||(l="0000".concat(l).slice(l.length-6),parseInt(l.slice(3,9),10)===0))return!1;for(var u=parseInt(l.slice(9,10),10),d=0,f=0;f<9;f++)d+=parseInt(l.slice(f,f+1),10)*(10-f);return d%=11,d<2&&u===d||d>=2&&u===11-d},IT:function(l){return l.length!==9||l==="CA00000AA"?!1:l.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(l){var u=l.trim();if(isNaN(Number(u))||u.length!==11||u==="00000000000")return!1;var d=u.split("").map(Number),f=(11-(3*d[0]+7*d[1]+6*d[2]+1*d[3]+8*d[4]+9*d[5]+4*d[6]+5*d[7]+2*d[8])%11)%11,h=(11-(5*d[0]+4*d[1]+3*d[2]+2*d[3]+7*d[4]+6*d[5]+5*d[6]+4*d[7]+3*d[8]+2*f)%11)%11;return!(f!==d[9]||h!==d[10])},TH:function(l){if(!l.match(/^[1-8]\d{12}$/))return!1;for(var u=0,d=0;d<12;d++)u+=parseInt(l[d],10)*(13-d);return l[12]===((11-u%11)%10).toString()},LK:function(l){var u=/^[1-9]\d{8}[vx]$/i,d=/^[1-9]\d{11}$/i;return l.length===10&&u.test(l)?!0:!!(l.length===12&&d.test(l))},"he-IL":function(l){var u=/^\d{9}$/,d=l.trim();if(!u.test(d))return!1;for(var f=d,h=0,p,g=0;g<f.length;g++)p=Number(f[g])*(g%2+1),h+=p>9?p-9:p;return h%10===0},"ar-LY":function(l){var u=/^(1|2)\d{11}$/,d=l.trim();return!!u.test(d)},"ar-TN":function(l){var u=/^\d{8}$/,d=l.trim();return!!u.test(d)},"zh-CN":function(l){var u=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],d=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],f=["1","0","X","9","8","7","6","5","4","3","2"],h=function(E){return(0,r.default)(u,E)},p=function(E){var C=parseInt(E.substring(0,4),10),x=parseInt(E.substring(4,6),10),$=parseInt(E.substring(6),10),T=new Date(C,x-1,$);return T>new Date?!1:T.getFullYear()===C&&T.getMonth()===x-1&&T.getDate()===$},g=function(E){for(var C=E.substring(0,17),x=0,$=0;$<17;
724$++)x+=parseInt(C.charAt($),10)*parseInt(d[$],10);var T=x%11;return f[T]},y=function(E){return g(E)===E.charAt(17).toUpperCase()},v=function(E){var C=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(E);if(!C)return!1;var x=E.substring(0,2);if(C=h(x),!C)return!1;var $="19".concat(E.substring(6,12));return C=p($),!!C},b=function(E){var C=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(E);if(!C)return!1;var x=E.substring(0,2);if(C=h(x),!C)return!1;var $=E.substring(6,14);return C=p($),C?y(E):!1},w=function(E){var C=/^\d{15}|(\d{17}(\d|x|X))$/.test(E);return C?E.length===15?v(E):b(E):!1};return w(l)},"zh-HK":function(l){l=l.trim();var u=/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/,d=/^[0-9]$/;if(l=l.toUpperCase(),!u.test(l))return!1;l=l.replace(/\[|\]|\(|\)/g,""),l.length===8&&(l="3".concat(l));for(var f=0,h=0;h<=7;h++){var p=void 0;d.test(l[h])?p=l[h]:p=(l[h].charCodeAt(0)-55)%11,f+=p*(9-h)}f%=11;var g;return f===0?g="0":f===1?g="A":g=String(11-f),g===l[l.length-1]},"zh-TW":function(l){var u={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},d=l.trim().toUpperCase();return/^[A-Z][0-9]{9}$/.test(d)?Array.from(d).reduce(function(f,h,p){if(p===0){var g=u[h];return g%10*9+Math.floor(g/10)}return p===9?(10-f%10-Number(h))%10===0:f+Number(h)*(9-p)},0):!1},PK:function(l){var u=/^[1-7][0-9]{4}-[0-9]{7}-[1-9]$/,d=l.trim();return u.test(d)}};function o(c,l){if((0,n.default)(c),l in s)return s[l](c);if(l==="any"){for(var u in s)if(s.hasOwnProperty(u)){var d=s[u];if(d(c))return!0}return!1}throw new Error("Invalid locale '".concat(l,"'"))}t.exports=e.default,t.exports.default=e.default})(p_,p_.exports);var fet=p_.exports,g_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var n=r(Ae);function r(u){return u&&u.__esModule?u:{default:u}}var i=8,a=14,s=/^(\d{8}|\d{13}|\d{14})$/;function o(u,d){return u===i||u===a?d%2===0?3:1:d%2===0?1:3}function c(u){var d=u.slice(0,-1).split("").map(function(h,p){return Number(h)*o(u.length,p)}).reduce(function(h,p){return h+p},0),f=10-d%10;return f<10?f:0}function l(u){(0,n.default)(u);var d=Number(u.slice(-1));return s.test(u)&&d===c(u)}t.exports=e.default,t.exports.default=e.default})(g_,g_.exports);var het=g_.exports,y_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function a(s){if((0,n.default)(s),!i.test(s))return!1;for(var o=!0,c=0,l=s.length-2;l>=0;l--)if(s[l]>="A"&&s[l]<="Z")for(var u=s[l].charCodeAt(0)-55,d=u%10,f=Math.trunc(u/10),h=0,p=[d,f];h<p.length;h++){var g=p[h];o?g>=5?c+=1+(g-5)*2:c+=g*2:c+=g,o=!o}else{var y=s[l].charCodeAt(0)-48;o?y>=5?c+=1+(y-5)*2:c+=y*2:c+=y,o=!o}var v=Math.trunc((c+9)/10)*10-c;return+s[s.length-1]===v}t.exports=e.default,t.exports.default=e.default})(y_,y_.exports);var pet=y_.exports,m_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=r(Ae);function r(c){return c&&c.__esModule?c:{default:c}}var i=/^(?:[0-9]{9}X|[0-9]{10})$/,a=/^(?:[0-9]{13})$/,s=[1,3];function o(c,l){(0,n.default)(c);var u=String(l?.version||l);if(!(l!=null&&l.version||l))return o(c,{version:10})||o(c,{version:13});var d=c.replace(/[\s-]+/g,""),f=0;if(u==="10"){if(!i.test(d))return!1;for(var h=0;h<u-1;h++)f+=(h+1)*d.charAt(h);if(d.charAt(9)==="X"?f+=10*10:f+=10*d.charAt(9),f%11===0)return!0}else if(u==="13"){if(!a.test(d))return!1;for(var p=0;p<12;p++)f+=s[p%2]*d.charAt(p);if(d.charAt(12)-(10-f%10)%10===0)return!0}return!1}t.exports=e.default,t.exports.default=e.default})(m_,m_.exports);var get=m_.exports,v_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i="^\\d{4}-?\\d{3}[\\dX]$";function a(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(s);var c=i;if(c=o.require_hyphen?c.replace("?",""):c,c=o.case_sensitive?new RegExp(c):new RegExp(c,"i"),!c.test(s))return!1;for(var l=s.replace("-","").toUpperCase(),u=0,d=0;d<l.length;d++){var f=l[d];u+=(f==="X"?10:+f)*(8-d)}return u%11===0}t.exports=e.default,t.exports.default=e.default})(v_,v_.exports);var yet=v_.exports,w_={exports:{}},qu={};
724Object.defineProperty(qu,"__esModule",{value:!0});qu.iso7064Check=met;qu.luhnCheck=vet;qu.reverseMultiplyAndSum=wet;qu.verhoeffCheck=bet;function met(t){for(var e=10,n=0;n<t.length-1;n++)e=(parseInt(t[n],10)+e)%10===0?10*2%11:(parseInt(t[n],10)+e)%10*2%11;return e=e===1?0:11-e,e===parseInt(t[10],10)}function vet(t){for(var e=0,n=!1,r=t.length-1;r>=0;r--){if(n){var i=parseInt(t[r],10)*2;i>9?e+=i.toString().split("").map(function(a){return parseInt(a,10)}).reduce(function(a,s){return a+s},0):e+=i}else e+=parseInt(t[r],10);n=!n}return e%10===0}function wet(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*(e-r);return n}function bet(t){for(var e=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],n=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],r=t.split("").reverse().join(""),i=0,a=0;a<r.length;a++)i=e[i][n[a%8][parseInt(r[a],10)]];return i===0}(function(t,e){function n(H){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},n(H)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=$t;var r=o(Ae),i=s(qu),a=o(NY);function s(H,q){if(typeof WeakMap=="function")var se=new WeakMap,de=new WeakMap;return(s=function(pe,ye){if(!ye&&pe&&pe.__esModule)return pe;var ge,Pe,_e={__proto__:null,default:pe};if(pe===null||n(pe)!="object"&&typeof pe!="function")return _e;if(ge=ye?de:se){if(ge.has(pe))return ge.get(pe);ge.set(pe,_e)}for(var Ie in pe)Ie!=="default"&&{}.hasOwnProperty.call(pe,Ie)&&((Pe=(ge=Object.defineProperty)&&Object.getOwnPropertyDescriptor(pe,Ie))&&(Pe.get||Pe.set)?ge(_e,Ie,Pe):_e[Ie]=pe[Ie]);return _e})(H,q)}function o(H){return H&&H.__esModule?H:{default:H}}function c(H){return f(H)||d(H)||u(H)||l()}function l(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 725In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(H,q){if(H){if(typeof H=="string")return h(H,q);var se={}.toString.call(H).slice(8,-1);return se==="Object"&&H.constructor&&(se=H.constructor.name),se==="Map"||se==="Set"?Array.from(H):se==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(se)?h(H,q):void 0}}function d(H){if(typeof Symbol<"u"&&H[Symbol.iterator]!=null||H["@@iterator"]!=null)return Array.from(H)}function f(H){if(Array.isArray(H))return h(H)}function h(H,q){(q==null||q>H.length)&&(q=H.length);for(var se=0,de=Array(q);se<q;se++)de[se]=H[se];return de}function p(H){var q=H.slice(0,2),se=parseInt(H.slice(2,4),10);se>40?(se-=40,q="20".concat(q)):se>20?(se-=20,q="18".concat(q)):q="19".concat(q),se<10&&(se="0".concat(se));var de="".concat(q,"/").concat(se,"/").concat(H.slice(4,6));if(!(0,a.default)(de,"YYYY/MM/DD"))return!1;for(var he=H.split("").map(function(Pe){return parseInt(Pe,10)}),pe=[2,4,8,5,10,9,7,3,6],ye=0,ge=0;ge<pe.length;ge++)ye+=he[ge]*pe[ge];return ye=ye%11===10?0:ye%11,ye===he[9]}function g(H){var q=H.split(""),se=q.filter(function(he,pe){return pe%2}).map(function(he){return Number(he)*2}).join("").split(""),de=q.filter(function(he,pe){return!(pe%2)}).concat(se).map(function(he){return Number(he)}).reduce(function(he,pe){return he+pe});return de%10===0}function y(H){H=H.replace(/\W/,"");var q=parseInt(H.slice(0,2),10);if(H.length===10)q<54?q="20".concat(q):q="19".concat(q);else{if(H.slice(6)==="000")return!1;if(q<54)q="19".concat(q);else return!1}q.length===3&&(q=[q.slice(0,2),"0",q.slice(2)].join(""));var se=parseInt(H.slice(2,4),10);if(se>50&&(se-=50),se>20){if(parseInt(q,10)<2004)return!1;se-=20}se<10&&(se="0".concat(se));var de="".concat(q,"/").concat(se,"/").concat(H.slice(4,6));if(!(0,a.default)(de,"YYYY/MM/DD"))return!1;if(H.length===10&&parseInt(H,10)%11!==0){var he=parseInt(H.slice(0,9),10)%11;if(parseInt(q,10)<1986&&he===10){if(parseInt(H.slice(9),10)!==0)return!1}else return!1}return!0}function v(H){return i.luhnCheck(H)}function b(H){for(var q=H.split("").map(function(Pe){return parseInt(Pe,10)}),se=[],de=0;de<q.length-1;de++){se.push("");for(var he=0;he<q.length-1;he++)q[de]===q[he]&&(se[de]+=he)}if(se=se.filter(function(Pe){return Pe.length>1}),se.length!==2&&se.length!==3)return!1;if(se[0].length===3){for(var pe=se[0].split("").map(function(Pe){return parseInt(Pe,10)}),ye=0,ge=0;ge<pe.length-1;ge++)pe[ge]+1===pe[ge+1]&&(ye+=1);if(ye===2)return!1}
725return i.iso7064Check(H)}function w(H){H=H.replace(/\W/,"");var q=parseInt(H.slice(4,6),10),se=H.slice(6,7);switch(se){case"0":case"1":case"2":case"3":q="19".concat(q);break;case"4":case"9":q<37?q="20".concat(q):q="19".concat(q);break;default:if(q<37)q="20".concat(q);else if(q>58)q="18".concat(q);else return!1;break}q.length===3&&(q=[q.slice(0,2),"0",q.slice(2)].join(""));var de="".concat(q,"/").concat(H.slice(2,4),"/").concat(H.slice(0,2));if(!(0,a.default)(de,"YYYY/MM/DD"))return!1;for(var he=H.split("").map(function(Pe){return parseInt(Pe,10)}),pe=0,ye=4,ge=0;ge<9;ge++)pe+=he[ge]*ye,ye-=1,ye===1&&(ye=7);return pe%=11,pe===1?!1:pe===0?he[9]===0:he[9]===11-pe}function _(H){for(var q=H.slice(0,8).split("").map(function(pe){return parseInt(pe,10)}),se=0,de=1;de<q.length;de+=2)se+=q[de];for(var he=0;he<q.length;he+=2)q[he]<2?se+=1-q[he]:(se+=2*(q[he]-2)+5,q[he]>4&&(se+=2));return String.fromCharCode(se%26+65)===H.charAt(8)}function E(H){for(var q=H.split("").map(function(he){return parseInt(he,10)}),se=0,de=0;de<8;de++)se+=q[de]*Math.pow(2,8-de);return se%11%10===q[8]}function C(H){var q=i.reverseMultiplyAndSum(H.split("").slice(0,7).map(function(se){return parseInt(se,10)}),8);return H.length===9&&H[8]!=="W"&&(q+=(H[8].charCodeAt(0)-64)*9),q%=23,q===0?H[7].toUpperCase()==="W":H[7].toUpperCase()===String.fromCharCode(64+q)}var x={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function $(){var H=[];for(var q in x)x.hasOwnProperty(q)&&H.push.apply(H,c(x[q]));return H}function T(H){return $().indexOf(H.slice(0,2))!==-1}function U(H){for(var q=0,se=H.split(""),de=parseInt(se.pop(),10),he=0;he<se.length;he++)q+=se[9-he]*(2+he%6);var pe=11-q%11;return pe===11?pe=0:pe===10&&(pe=9),de===pe}function O(H){var q=H.toUpperCase().split("");if(isNaN(parseInt(q[0],10))&&q.length>1){var se=0;switch(q[0]){case"Y":se=1;break;case"Z":se=2;break}q.splice(0,1,se)}else for(;q.length<9;)q.unshift(0);var de=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"];q=q.join("");var he=parseInt(q.slice(0,8),10)%23;return q[8]===de[he]}function F(H){var q=H.slice(1,3),se=H.slice(0,1);switch(se){case"1":case"2":q="18".concat(q);break;case"3":case"4":q="19".concat(q);break;default:q="20".concat(q);break}var de="".concat(q,"/").concat(H.slice(3,5),"/").concat(H.slice(5,7));if(!(0,a.default)(de,"YYYY/MM/DD"))return!1;for(var he=H.split("").map(function(_e){return parseInt(_e,10)}),pe=0,ye=1,ge=0;ge<10;ge++)pe+=he[ge]*ye,ye+=1,ye===10&&(ye=1);if(pe%11===10){pe=0,ye=3;for(var Pe=0;Pe<10;Pe++)pe+=he[Pe]*ye,ye+=1,ye===10&&(ye=1);if(pe%11===10)return he[10]===0}return pe%11===he[10]}function k(H){var q=H.slice(4,6),se=H.slice(6,7);switch(se){case"+":q="18".concat(q);break;case"-":q="19".concat(q);break;default:q="20".concat(q);break}var de="".concat(q,"/").concat(H.slice(2,4),"/").concat(H.slice(0,2));if(!(0,a.default)(de,"YYYY/MM/DD"))return!1;var he=parseInt(H.slice(0,6)+H.slice(7,10),10)%31;if(he<10)return he===parseInt(H.slice(10),10);he-=10;var pe=["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"];return pe[he]===H.slice(10)}function S(H){if(H.slice(2,4)!=="00"||H.slice(4,6)!=="00"){var q="".concat(H.slice(0,2),"/").concat(H.slice(2,4),"/").concat(H.slice(4,6));if(!(0,a.default)(q,"YY/MM/DD"))return!1}var se=97-parseInt(H.slice(0,9),10)%97,de=parseInt(H.slice(9,11),10);return!(se!==de&&(se=97-parseInt("2".concat(H.slice(0,9)),10)%97,se!==de))}function I(H){H=H.replace(/\s/g,"");var q=parseInt(H.slice(0,10),10)%511,se=parseInt(H.slice(10,13),10);return q===se}function A(H){var q="".concat(H.slice(0,4),"/").concat(H.slice(4,6),"/").concat(H.slice(6,8));return!(0,a.default)(q,"YYYY/MM/DD")||!i.luhnCheck(H.slice(0,12))?!1:i.verhoeffCheck("".concat(H.slice(0,11)).concat(H[12]))}
vendor: 5,037 bytes, line 725
725function R(H){return i.iso7064Check(H)}function N(H){for(var q=H.split("").map(function(he){return parseInt(he,10)}),se=8,de=1;de<9;de++)se+=q[de]*(de+1);return se%11===q[9]}function P(H){for(var q=!1,se=!1,de=0;de<3;de++)if(!q&&/[AEIOU]/.test(H[de]))q=!0;else if(!se&&q&&H[de]==="X")se=!0;else if(de>0&&(q&&!se&&!/[AEIOU]/.test(H[de])||se&&!/X/.test(H[de])))return!1;return!0}function j(H){var q=H.toUpperCase().split("");if(!P(q.slice(0,3))||!P(q.slice(3,6)))return!1;for(var se=[6,7,9,10,12,13,14],de={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},he=0,pe=se;he<pe.length;he++){var ye=pe[he];q[ye]in de&&q.splice(ye,1,de[q[ye]])}var ge={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"},Pe=ge[q[8]],_e=parseInt(q[9]+q[10],10);_e>40&&(_e-=40),_e<10&&(_e="0".concat(_e));var Ie="".concat(q[6]).concat(q[7],"/").concat(Pe,"/").concat(_e);if(!(0,a.default)(Ie,"YY/MM/DD"))return!1;for(var qe=0,Fe=1;Fe<q.length-1;Fe+=2){var pt=parseInt(q[Fe],10);isNaN(pt)&&(pt=q[Fe].charCodeAt(0)-65),qe+=pt}for(var ze={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},Ue=0;Ue<q.length-1;Ue+=2){var Ve=0;if(q[Ue]in ze)Ve=ze[q[Ue]];else{var st=parseInt(q[Ue],10);Ve=2*st+1,st>4&&(Ve+=2)}qe+=Ve}return String.fromCharCode(65+qe%26)===q[15]}function M(H){H=H.replace(/\W/,"");var q=H.slice(0,2);if(q!=="32"){var se=H.slice(2,4);if(se!=="00"){var de=H.slice(4,6);switch(H[6]){case"0":de="18".concat(de);break;case"1":de="19".concat(de);break;default:de="20".concat(de);break}var he="".concat(de,"/").concat(H.slice(2,4),"/").concat(q);if(!(0,a.default)(he,"YYYY/MM/DD"))return!1}for(var pe=1101,ye=[1,6,3,7,9,10,5,8,4,2],ge=0;ge<H.length-1;ge++)pe-=parseInt(H[ge],10)*ye[ge];return parseInt(H[10],10)===pe%11}return!0}function V(H){if(H.length!==9){for(var q=H.toUpperCase().split("");q.length<8;)q.unshift(0);switch(H[7]){case"A":case"P":if(parseInt(q[6],10)===0)return!1;break;default:{var se=parseInt(q.join("").slice(0,5),10);if(se>32e3)return!1;var de=parseInt(q.join("").slice(5,7),10);if(se===de)return!1}}}return!0}function B(H){return i.reverseMultiplyAndSum(H.split("").slice(0,8).map(function(q){return parseInt(q,10)}),9)%11===parseInt(H[8],10)}function G(H){if(H.length===10){for(var q=[6,5,7,2,3,4,5,6,7],se=0,de=0;de<q.length;de++)se+=parseInt(H[de],10)*q[de];return se%=11,se===10?!1:se===parseInt(H[9],10)}var he=H.slice(0,2),pe=parseInt(H.slice(2,4),10);pe>80?(he="18".concat(he),pe-=80):pe>60?(he="22".concat(he),pe-=60):pe>40?(he="21".concat(he),pe-=40):pe>20?(he="20".concat(he),pe-=20):he="19".concat(he),pe<10&&(pe="0".concat(pe));var ye="".concat(he,"/").concat(pe,"/").concat(H.slice(4,6));if(!(0,a.default)(ye,"YYYY/MM/DD"))return!1;for(var ge=0,Pe=1,_e=0;_e<H.length-1;_e++)ge+=parseInt(H[_e],10)*Pe%10,Pe+=2,Pe>10?Pe=1:Pe===5&&(Pe+=2);return ge=10-ge%10,ge===parseInt(H[10],10)}function Z(H){if(H.length===11){var q,se;if(q=0,H==="11111111111"||H==="22222222222"||H==="33333333333"||H==="44444444444"||H==="55555555555"||H==="66666666666"||H==="77777777777"||H==="88888888888"||H==="99999999999"||H==="00000000000")return!1;for(var de=1;de<=9;de++)q+=parseInt(H.substring(de-1,de),10)*(11-de);if(se=q*10%11,se===10&&(se=0),se!==parseInt(H.substring(9,10),10))return!1;q=0;for(var he=1;he<=10;he++)q+=parseInt(H.substring(he-1,he),10)*(12-he);return se=q*10%11,se===10&&(se=0),se===parseInt(H.substring(10,11),10)}if(H==="00000000000000"||H==="11111111111111"||H==="22222222222222"||H==="33333333333333"||H==="44444444444444"||H==="55555555555555"||H==="66666666666666"||H==="77777777777777"||H==="88888888888888"||H==="99999999999999")return!1;for(var pe=H.length-2,ye=H.substring(0,pe),ge=H.substring(pe),Pe=0,_e=pe-7,Ie=pe;Ie>=1;Ie--)Pe+=ye.charAt(pe-Ie)*_e,_e-=1,_e<2&&(_e=9);var qe=Pe%11<2?0:11-Pe%11;if(qe!==parseInt(ge.charAt(0),10))return!1;pe+=1,ye=H.substring(0,pe),Pe=0,_e=pe-7;for(var Fe=pe;Fe>=1;Fe--)Pe+=ye.charAt(pe-Fe)*_e,_e-=1,_e<2&&(_e=9);return qe=Pe%11<2?0:11-Pe%11,qe===parseInt(ge.charAt(1),10)}function ie(H){var q=11-i.reverseMultiplyAndSum(H.split("").slice(0,8).map(function(se){return parseInt(se,10)}),9)%11;return q>9?parseInt(H[8],10)===0:q===parseInt(H[8],10)}function oe(H){if(H.slice(0,4)!=="9000"){var q=H.slice(1,3);switch(H[0]){case"1":case"2":q="19".concat(q);break;case"3":case"4":q="18".concat(q);break;case"5":case"6":q="20".concat(q);break}var se="".concat(q,"/").concat(H.slice(3,5),"/").concat(H.slice(5,7));if(se.length===8){if(!(0,a.default)(se,"YY/MM/DD"))return!1}else if(!(0,a.default)(se,"YYYY/MM/DD"))return!1;for(var de=H.split("").map(function(ge){return parseInt(ge,10)}),he=[2,7,9,1,4,6,3,5,8,2,7,9],pe=0,ye=0;ye<he.length;ye++)pe+=de[ye]*he[ye];return pe%11===10?de[12]===1:de[12]===pe%11}return!0}function z(H){if(H.length===9){if(H=H.replace(/\W/,""),H.slice(6)==="000")return!1;var q=parseInt(H.slice(0,2),10);if(q>53)return!1;q<10?q="190".concat(q):q="19".concat(q);var se=parseInt(H.slice(2,4),10);se>50&&(se-=50),se<10&&(se="0".concat(se));
725var de="".concat(q,"/").concat(se,"/").concat(H.slice(4,6));if(!(0,a.default)(de,"YYYY/MM/DD"))return!1}return!0}function J(H){var q=11-i.reverseMultiplyAndSum(H.split("").slice(0,7).map(function(se){return parseInt(se,10)}),8)%11;return q===10?parseInt(H[7],10)===0:q===parseInt(H[7],10)}function K(H){var q=H.slice(0);H.length>11&&(q=q.slice(2));var se="",de=q.slice(2,4),he=parseInt(q.slice(4,6),10);if(H.length>11)se=H.slice(0,4);else if(se=H.slice(0,2),H.length===11&&he<60){var pe=new Date().getFullYear().toString(),ye=parseInt(pe.slice(0,2),10);if(pe=parseInt(pe,10),H[6]==="-")parseInt("".concat(ye).concat(se),10)>pe?se="".concat(ye-1).concat(se):se="".concat(ye).concat(se);else if(se="".concat(ye-1).concat(se),pe-parseInt(se,10)<100)return!1}he>60&&(he-=60),he<10&&(he="0".concat(he));var ge="".concat(se,"/").concat(de,"/").concat(he);if(ge.length===8){if(!(0,a.default)(ge,"YY/MM/DD"))return!1}else if(!(0,a.default)(ge,"YYYY/MM/DD"))return!1;return i.luhnCheck(H.replace(/\W/,""))}function ne(H){for(var q=H.split("").map(function(pe){return parseInt(pe,10)}),se=[-1,5,7,9,4,6,10,5,7],de=0,he=0;he<se.length;he++)de+=q[he]*se[he];return de%11===10?q[9]===0:q[9]===de%11}var ce={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-AR":/(20|23|24|27|30|33|34)[0-9]{8}[0-9]/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/,"uk-UA":/^\d{10}$/};ce["lb-LU"]=ce["fr-LU"],ce["lt-LT"]=ce["et-EE"],ce["nl-BE"]=ce["fr-BE"],ce["fr-CA"]=ce["en-CA"];var xe={"bg-BG":p,"cs-CZ":y,"de-AT":v,"de-DE":b,"dk-DK":w,"el-CY":_,"el-GR":E,"en-CA":g,"en-IE":C,"en-US":T,"es-AR":U,"es-ES":O,"et-EE":F,"fi-FI":k,"fr-BE":S,"fr-FR":I,"fr-LU":A,"hr-HR":R,"hu-HU":N,"it-IT":j,"lv-LV":M,"mt-MT":V,"nl-NL":B,"pl-PL":G,"pt-BR":Z,"pt-PT":ie,"ro-RO":oe,"sk-SK":z,"sl-SI":J,"sv-SE":K,"uk-UA":ne};xe["lb-LU"]=xe["fr-LU"],xe["lt-LT"]=xe["et-EE"],xe["nl-BE"]=xe["fr-BE"],xe["fr-CA"]=xe["en-CA"];var ke=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,Me={"de-AT":ke,"de-DE":/[\/\\]/g,"fr-BE":ke};Me["nl-BE"]=Me["fr-BE"];function $t(H){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US";(0,r.default)(H);var se=H.slice(0);if(q in ce)return q in Me&&(se=se.replace(Me[q],"")),ce[q].test(se)?q in xe?xe[q](se):!0:!1;throw new Error("Invalid locale '".concat(q,"'"))}t.exports=e.default,t.exports.default=e.default})(w_,w_.exports);var _et=w_.exports,q0={};Object.defineProperty(q0,"__esModule",{value:!0});q0.default=Aet;q0.locales=void 0;var Cet=Eet(Ae);function Eet(t){return t&&t.__esModule?t:{default:t}}var mn={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?([79][1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"ar-QA":/^(\+?974|0)?([3567]\d{7})$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}
725$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|7|6|5|4)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7[1-9]\d{8}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|53|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?0[79][567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-GT":/^(\+?502)?[2|6|7]\d{7}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+996\s?)?(22[0-9]|50[0-9]|55[0-9]|70[0-9]|75[0-9]|77[0-9]|880|990|995|996|997|998)\s?\d{3}\s?\d{3}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}
725$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+?244)?9\d{8}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[2-9]\d{7}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38)?0(50|6[36-8]|7[357]|9[1-9])\d{7}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/,"mk-MK":/^(\+?389|0)?((?:2[2-9]\d{6}|(?:3[1-4]|4[2-8])\d{6}|500\d{5}|5[2-9]\d{6}|7[0-9][2-9]\d{5}|8[1-9]\d{6}|800\d{5}|8009\d{4}))$/};mn["en-CA"]=mn["en-US"];mn["fr-CA"]=mn["en-CA"];mn["fr-BE"]=mn["nl-BE"];mn["zh-HK"]=mn["en-HK"];mn["zh-MO"]=mn["en-MO"];mn["ga-IE"]=mn["en-IE"];mn["fr-CH"]=mn["de-CH"];mn["it-CH"]=mn["fr-CH"];function Aet(t,e,n){if((0,Cet.default)(t),n&&n.strictMode&&!t.startsWith("+"))return!1;if(Array.isArray(e))return e.some(function(a){if(mn.hasOwnProperty(a)){var s=mn[a];if(s.test(t))return!0}return!1});if(e in mn)return mn[e].test(t);if(!e||e==="any"){for(var r in mn)if(mn.hasOwnProperty(r)){var i=mn[r];if(i.test(t))return!0}return!1}throw new Error("Invalid locale '".concat(e,"'"))}q0.locales=Object.keys(mn);var b_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^(0x)[0-9a-f]{40}$/i;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(b_,b_.exports);var xet=b_.exports,__={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=i(di),r=i(Ae);function i(c){return c&&c.__esModule?c:{default:c}}function a(c){var l="\\d{".concat(c.digits_after_decimal[0],"}");c.digits_after_decimal.forEach(function(b,w){w!==0&&(l="".concat(l,"|\\d{").concat(b,"}"))});var u="(".concat(c.symbol.replace(/\W/,function(b){return"\\".concat(b)}),")").concat(c.require_symbol?"":"?"),d="-?",f="[1-9]\\d*",h="[1-9]\\d{0,2}(\\".concat(c.thousands_separator,"\\d{3})*"),p=["0",f,h],g="(".concat(p.join("|"),")?"),y="(\\".concat(c.decimal_separator,"(").concat(l,"))").concat(c.require_decimal?"":"?"),v=g+(c.allow_decimal||c.require_decimal?y:"");return c.allow_negatives&&!c.parens_for_negatives&&(c.negative_sign_after_digits?v+=d:c.negative_sign_before_digits&&(v=d+v)),c.allow_negative_sign_placeholder?v="( (?!\\-))?".concat(v):c.allow_space_after_symbol?v=" ?".concat(v):c.allow_space_after_digits&&(v+="( (?!$))?"),c.symbol_after_digits?v+=u:v=u+v,c.allow_negatives&&(c.parens_for_negatives?v="(\\(".concat(v,"\\)|").concat(v,")"):c.negative_sign_before_digits||c.negative_sign_after_digits||(v=d+v)),new RegExp("^(?!-? )(?=.*\\d)".concat(v,"$"))}var s={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal
vendor: 5,342 bytes, line 725
725:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function o(c,l){return(0,r.default)(c),l=(0,n.default)(l,s),a(l).test(c)}t.exports=e.default,t.exports.default=e.default})(__,__.exports);var Iet=__.exports,C_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=r(Ae);function r(o){return o&&o.__esModule?o:{default:o}}var i=/^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/,a=/^(1|2|3|m)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function s(o){return(0,n.default)(o),i.test(o)||a.test(o)}t.exports=e.default,t.exports.default=e.default})(C_,C_.exports);var Tet=C_.exports,z0={};Object.defineProperty(z0,"__esModule",{value:!0});z0.isFreightContainerID=void 0;z0.isISO6346=VY;var Let=ket(Ae);function ket(t){return t&&t.__esModule?t:{default:t}}var $et=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,Pet=/^[0-9]$/;function VY(t){if((0,Let.default)(t),t=t.toUpperCase(),!$et.test(t))return!1;if(t.length===11){for(var e=0,n=0;n<t.length-1;n++)if(Pet.test(t[n]))e+=t[n]*Math.pow(2,n);else{var r=void 0,i=t.charCodeAt(n)-55;i<11?r=i:i>=11&&i<=20?r=12+i%11:i>=21&&i<=30?r=23+i%21:r=34+i%31,e+=r*Math.pow(2,n)}var a=e%11;return a===10&&(a=0),Number(t[t.length-1])===a}return!0}z0.isFreightContainerID=VY;var E_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function a(s){return(0,n.default)(s),i.has(s)}t.exports=e.default,t.exports.default=e.default})(E_,E_.exports);var Ret=E_.exports,S_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=r(Ae);function r(c){return c&&c.__esModule?c:{default:c}}var i=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,a=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,s=function(l){var u=l.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(u){var d=Number(u[1]),f=Number(u[2]);return d%4===0&&d%100!==0||d%400===0?f<=366:f<=365}var h=l.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),p=h[1],g=h[2],y=h[3],v=g&&"0".concat(g).slice(-2),b=y&&"0".concat(y).slice(-2),w=new Date("".concat(p,"-").concat(v||"01","-").concat(b||"01"));return g&&y?w.getUTCFullYear()===p&&w.getUTCMonth()+1===g&&w.getUTCDate()===y:!0};function o(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var u=l.strictSeparator?a.test(c):i.test(c);return u&&l.strict?s(c):u}t.exports=e.default,t.exports.default=e.default})(S_,S_.exports);var Oet=S_.exports,A_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=v;var n=r(Ae);function r(b){return b&&b.__esModule?b:{default:b}}var i=/[0-9]{4}/,a=/(0[1-9]|1[0-2])/,s=/([12]\d|0[1-9]|3[01])/,o=/([01][0-9]|2[0-3])/,c=/[0-5][0-9]/,l=/([0-5][0-9]|60)/,u=/(\.[0-9]+)?/,d=new RegExp("[-+]".concat(o.source,":").concat(c.source)),f=new RegExp("([zZ]|".concat(d.source,")")),h=new RegExp("".concat(o.source,":").concat(c.source,":").concat(l.source).concat(u.source)),p=new RegExp("".concat(i.source,"-").concat(a.source,"-").concat(s.source)),g=new RegExp("".concat(h.source).concat(f.source)),y=new RegExp("^".concat(p.source,"[ tT]").concat(g.source,"$"));function v(b){return(0,n.default)(b),y.test(b)}t.exports=e.default,t.exports.default=e.default})(A_,A_.exports);var Met=A_.exports,Z0={};Object.defineProperty(Z0,"__esModule",{value:!0});Z0.ScriptCodes=void 0;Z0.default=Fet;var Net=Det(Ae);function Det(t){return t&&t.__esModule?t:{default:t}}var HY=new Set(["Adlm","Afak","Aghb","Ahom","Arab","Aran","Armi","Armn","Avst","Bali","Bamu","Bass","Batk","Beng","Bhks","Blis","Bopo","Brah","Brai","Bugi","Buhd","Cakm","Cans","Cari","Cham","Cher","Chis","Chrs","Cirt","Copt","Cpmn","Cprt","Cyrl","Cyrs","Deva","Diak","Dogr","Dsrt","Dupl","Egyd","Egyh","Egyp","Elba","Elym","Ethi","Gara","Geok","Geor","Glag","Gong","Gonm","Goth","Gran","Grek","Gujr","Gukh","Guru","Hanb","Hang","Hani","Hano","Hans","Hant","Hatr","Hebr","Hira","Hluw","Hmng","Hm
725np","Hrkt","Hung","Inds","Ital","Jamo","Java","Jpan","Jurc","Kali","Kana","Kawi","Khar","Khmr","Khoj","Kitl","Kits","Knda","Kore","Kpel","Krai","Kthi","Lana","Laoo","Latf","Latg","Latn","Leke","Lepc","Limb","Lina","Linb","Lisu","Loma","Lyci","Lydi","Mahj","Maka","Mand","Mani","Marc","Maya","Medf","Mend","Merc","Mero","Mlym","Modi","Mong","Moon","Mroo","Mtei","Mult","Mymr","Nagm","Nand","Narb","Nbat","Newa","Nkdb","Nkgb","Nkoo","Nshu","Ogam","Olck","Onao","Orkh","Orya","Osge","Osma","Ougr","Palm","Pauc","Pcun","Pelm","Perm","Phag","Phli","Phlp","Phlv","Phnx","Plrd","Piqd","Prti","Psin","Qaaa","Qaab","Qaac","Qaad","Qaae","Qaaf","Qaag","Qaah","Qaai","Qaaj","Qaak","Qaal","Qaam","Qaan","Qaao","Qaap","Qaaq","Qaar","Qaas","Qaat","Qaau","Qaav","Qaaw","Qaax","Qaay","Qaaz","Qaba","Qabb","Qabc","Qabd","Qabe","Qabf","Qabg","Qabh","Qabi","Qabj","Qabk","Qabl","Qabm","Qabn","Qabo","Qabp","Qabq","Qabr","Qabs","Qabt","Qabu","Qabv","Qabw","Qabx","Ranj","Rjng","Rohg","Roro","Runr","Samr","Sara","Sarb","Saur","Sgnw","Shaw","Shrd","Shui","Sidd","Sidt","Sind","Sinh","Sogd","Sogo","Sora","Soyo","Sund","Sunu","Sylo","Syrc","Syre","Syrj","Syrn","Tagb","Takr","Tale","Talu","Taml","Tang","Tavt","Tayo","Telu","Teng","Tfng","Tglg","Thaa","Thai","Tibt","Tirh","Tnsa","Todr","Tols","Toto","Tutg","Ugar","Vaii","Visp","Vith","Wara","Wcho","Wole","Xpeo","Xsux","Yezi","Yiii","Zanb","Zinh","Zmth","Zsye","Zsym","Zxxx","Zyyy","Zzzz"]);function Fet(t){return(0,Net.default)(t),HY.has(t)}Z0.ScriptCodes=HY;var x_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function a(s){return(0,n.default)(s),i.has(s.toUpperCase())}t.exports=e.default,t.exports.default=e.default})(x_,x_.exports);var Uet=x_.exports,I_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=new Set(["004","008","010","012","016","020","024","028","031","032","036","040","044","048","050","051","052","056","060","064","068","070","072","074","076","084","086","090","092","096","100","104","108","112","116","120","124","132","136","140","144","148","152","156","158","162","166","170","174","175","178","180","184","188","191","192","196","203","204","208","212","214","218","222","226","231","232","233","234","238","239","242","246","248","250","254","258","260","262","266","268","270","275","276","288","292","296","300","304","308","312","316","320","324","328","332","334","336","340","344","348","352","356","360","364","368","372","376","380","384","388","392","398","400","404","408","410","414","417","418","422","426","428","430","434","438","440","442","446","450","454","458","462","466","470","474","478","480","484","492","496","498","499","500","504","508","512","516","520","524","528","531","533","534","535","540","548","554","558","562","566","570","574","578","580","581","583","584","585","586","591","598","600","604","608","612","616","620","624","626","630","634","638","642","643","646","652","654","659","660","662","663","666","670","674","678","682","686","688","690","694","702","703","704","705","706","710","716","724","728","729","732","740","744","748","752","756","760","762","764","768","772","776","780","784","788","792","795","796","798","800","804","807","818","826","831","832","833","834","840","850","854","858","860","862","876","882","887","894"]);function a(s){return(0,n.default)(s),i.has(s)}t.exports=e.default,t.exports.default=e.default})(I_,I_.exports);var jet=I_.exports,K0={};Object.defineProperty(K0,"__esModule",{value:!0});K0.CurrencyCodes=void 0;K0.default=Het;var Bet=Vet(Ae);function Vet(t){return t&&t.__esModule?t:{default:t}}var WY=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function Het(t){return(0,Bet.default)(t),WY.has(t.toUpperCase())}K0.CurrencyCodes=WY;var T_={exports:{}};
725(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var n=i(Ae),r=i(di);function i(l){return l&&l.__esModule?l:{default:l}}var a=/^[A-Z2-7]+=*$/,s=/^[A-HJKMNP-TV-Z0-9]+$/,o={crockford:!1};function c(l,u){if((0,n.default)(l),u=(0,r.default)(u,o),u.crockford)return s.test(l);var d=l.length;return!!(d%8===0&&a.test(l))}t.exports=e.default,t.exports.default=e.default})(T_,T_.exports);var Wet=T_.exports,L_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^[A-HJ-NP-Za-km-z1-9]*$/;function a(s){return(0,n.default)(s),!!i.test(s)}t.exports=e.default,t.exports.default=e.default})(L_,L_.exports);var qet=L_.exports,k_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=r(Ae);function r(c){return c&&c.__esModule?c:{default:c}}var i=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,a=/^[a-z\-]+=[a-z0-9\-]+$/i,s=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function o(c){(0,n.default)(c);var l=c.split(",");if(l.length<2)return!1;var u=l.shift().trim().split(";"),d=u.shift();if(d.slice(0,5)!=="data:")return!1;var f=d.slice(5);if(f!==""&&!i.test(f))return!1;for(var h=0;h<u.length;h++)if(!(h===u.length-1&&u[h].toLowerCase()==="base64")&&!a.test(u[h]))return!1;for(var p=0;p<l.length;p++)if(!s.test(l[p]))return!1;return!0}t.exports=e.default,t.exports.default=e.default})(k_,k_.exports);var zet=k_.exports,$_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function a(s){return(0,n.default)(s),s.indexOf("magnet:?")!==0?!1:i.test(s)}t.exports=e.default,t.exports.default=e.default})($_,$_.exports);var Zet=$_.exports,P_={exports:{}},R_={exports:{}},O_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){if((0,n.default)(a),s){var o=new RegExp("[".concat(s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return a.replace(o,"")}for(var c=a.length-1;/\s/.test(a.charAt(c));)c-=1;return a.slice(0,c+1)}t.exports=e.default,t.exports.default=e.default})(O_,O_.exports);var qY=O_.exports,M_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){(0,n.default)(a);var o=s?new RegExp("^[".concat(s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return a.replace(o,"")}t.exports=e.default,t.exports.default=e.default})(M_,M_.exports);var zY=M_.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=i(qY),r=i(zY);function i(s){return s&&s.__esModule?s:{default:s}}function a(s,o){return(0,n.default)((0,r.default)(s,o),o)}t.exports=e.default,t.exports.default=e.default})(R_,R_.exports);var ZY=R_.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=p;var n=a(ZY),r=a(OY),i=a(Ae);function a(g){return g&&g.__esModule?g:{default:g}}function s(g,y){return l(g)||c(g,y)||d(g,y)||o()}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 726In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(g,y){var v=g==null?null:typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(v!=null){var b,w,_,E,C=[],x=!0,$=!1;try{if(_=(v=v.call(g)).next,y!==0)for(;!(x=(b=_.call(v)).done)&&(C.push(b.value),C.length!==y);x=!0);}catch(T){$=!0,w=T}finally{try{if(!x&&v.return!=null&&(E=v.return(),Object(E)!==E))return}finally{if($)throw w}}return C}}function l(g){if(Array.isArray(g))return g}function u(g,y){var v=typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(!v){if(Array.isArray(g)||(v=d(g))||y){v&&(g=v);var b=0,w=function(){};return{s:w,n:function(){return b>=g.length?{done:!0}:{done:!1,value:g[b++]}},e:function($){throw $},f:w}
726}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 727In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _,E=!0,C=!1;return{s:function(){v=v.call(g)},n:function(){var $=v.next();return E=$.done,$},e:function($){C=!0,_=$},f:function(){try{E||v.return==null||v.return()}finally{if(C)throw _}}}}function d(g,y){if(g){if(typeof g=="string")return f(g,y);var v={}.toString.call(g).slice(8,-1);return v==="Object"&&g.constructor&&(v=g.constructor.name),v==="Map"||v==="Set"?Array.from(g):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?f(g,y):void 0}}function f(g,y){(y==null||y>g.length)&&(y=g.length);for(var v=0,b=Array(y);v<y;v++)b[v]=g[v];return b}function h(g){var y=new Set(["subject","body","cc","bcc"]),v={cc:"",bcc:""},b=!1,w=g.split("&");if(w.length>4)return!1;var _=u(w),E;try{for(_.s();!(E=_.n()).done;){var C=E.value,x=C.split("="),$=s(x,2),T=$[0],U=$[1];if(T&&!y.has(T)){b=!0;break}U&&(T==="cc"||T==="bcc")&&(v[T]=U),T&&y.delete(T)}}catch(O){_.e(O)}finally{_.f()}return b?!1:v}function p(g,y){if((0,i.default)(g),g.indexOf("mailto:")!==0)return!1;var v=g.replace("mailto:","").split("?"),b=s(v,2),w=b[0],_=b[1],E=_===void 0?"":_;if(!w&&!E)return!0;var C=h(E);return C?"".concat(w,",").concat(C.cc,",").concat(C.bcc).split(",").every(function(x){return x=(0,n.default)(x," "),x?(0,r.default)(x,y):!0}):!1}t.exports=e.default,t.exports.default=e.default})(P_,P_.exports);var Ket=P_.exports,N_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=r(Ae);function r(c){return c&&c.__esModule?c:{default:c}}var i=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,a=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,s=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function o(c){return(0,n.default)(c),i.test(c)||a.test(c)||s.test(c)}t.exports=e.default,t.exports.default=e.default})(N_,N_.exports);var Get=N_.exports,D_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=a(Ae),r=a(di),i=a(MY);function a(f){return f&&f.__esModule?f:{default:f}}var s=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,o=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,c=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,l=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,u={checkDMS:!1};function d(f,h){if((0,n.default)(f),h=(0,r.default)(h,u),!(0,i.default)(f,","))return!1;var p=f.split(",");return p[0].startsWith("(")&&!p[1].endsWith(")")||p[1].endsWith(")")&&!p[0].startsWith("(")?!1:h.checkDMS?c.test(p[0])&&l.test(p[1]):s.test(p[0])&&o.test(p[1])}t.exports=e.default,t.exports.default=e.default})(D_,D_.exports);var Yet=D_.exports,G0={};Object.defineProperty(G0,"__esModule",{value:!0});G0.default=Qet;G0.locales=void 0;var Jet=Xet(Ae);function Xet(t){return t&&t.__esModule?t:{default:t}}var xM=/^\d{3}$/,Fi=/^\d{4}$/,Mr=/^\d{5}$/,w7=/^\d{6}$/,Sd={AD:/^AD\d{3}$/,AT:Fi,AU:Fi,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BD:/^([1-8][0-9]{3}|9[0-4][0-9]{2})$/,BE:Fi,BG:Fi,BR:/^\d{5}-?\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:Fi,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CO:/^(05|08|11|13|15|17|18|19|20|23|25|27|41|44|47|50|52|54|63|66|68|70|73|76|81|85|86|88|91|94|95|97|99)(\d{4})$/,CZ:/^\d{3}\s?\d{2}$/,DE:Mr,DK:Fi,DO:Mr,DZ:Mr,EE:Mr,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:Mr,FR:/^(?:(?:0[1-9]|[1-8]\d|9[0-5])\d{3}|97[1-46]\d{2})$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:Fi,ID:Mr,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:xM,IT:Mr,JP:/^\d{3}\-\d{4}$/,KE:Mr,KR:/^(\d{5}|\d{6}
727)$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:Fi,LV:/^LV\-\d{4}$/,LK:Mr,MG:xM,MX:Mr,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:Mr,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:Fi,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:Fi,PK:Mr,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:w7,RU:w7,SA:Mr,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:w7,SI:Fi,SK:/^\d{3}\s?\d{2}$/,TH:Mr,TN:Fi,TW:/^\d{3}(\d{2,3})?$/,UA:Mr,US:/^\d{5}(-\d{4})?$/,ZA:Fi,ZM:Mr};G0.locales=Object.keys(Sd);function Qet(t,e){if((0,Jet.default)(t),e in Sd)return Sd[e].test(t);if(e==="any"){for(var n in Sd)if(Sd.hasOwnProperty(n)){var r=Sd[n];if(r.test(t))return!0}return!1}throw new Error("Invalid locale '".concat(e,"'"))}var F_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a),a.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}t.exports=e.default,t.exports.default=e.default})(F_,F_.exports);var ett=F_.exports,U_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,n.default)(a),a.replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`").replace(/&/g,"&")}t.exports=e.default,t.exports.default=e.default})(U_,U_.exports);var ttt=U_.exports,j_={exports:{}},B_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){return(0,n.default)(a),a.replace(new RegExp("[".concat(s,"]+"),"g"),"")}t.exports=e.default,t.exports.default=e.default})(B_,B_.exports);var KY=B_.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=i(Ae),r=i(KY);function i(s){return s&&s.__esModule?s:{default:s}}function a(s,o){(0,n.default)(s);var c=o?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,r.default)(s,c)}t.exports=e.default,t.exports.default=e.default})(j_,j_.exports);var ntt=j_.exports,V_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){return(0,n.default)(a),a.replace(new RegExp("[^".concat(s,"]+"),"g"),"")}t.exports=e.default,t.exports.default=e.default})(V_,V_.exports);var rtt=V_.exports,H_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(Ae);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){(0,n.default)(a);for(var o=a.length-1;o>=0;o--)if(s.indexOf(a[o])===-1)return!1;return!0}t.exports=e.default,t.exports.default=e.default})(H_,H_.exports);var itt=H_.exports,W_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var n=r(di);function r(d){return d&&d.__esModule?d:{default:d}}var i={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,yandex_convert_yandexru:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},a=["icloud.com","me.com"],s=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],o=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],c=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function l(d){return d.length>1?d:""}function u(d,f){f=(0,n.default)(f,i);var h=d.split("@"),p=h.pop(),g=h.join("@"),y=[g,p];if(y[1]=y[1].toLowerCase(),y[1]==="gmail.com"||y[1]==="googlemail.com"){if(f.gmail_remove_subaddress&&(y[0]=y[0].split("+")[0]),f.gmail_remove_dots&&(y[0]=y[0].replace(/\.+/g,l)),!y[0].length)return!1;(f.all_lowercase||f.gmail_lowercase)&&(y[0]=y[0].toLowerCase()),y[1]=f.gmail_convert_googlemaildotcom?"gmail.com":y[1]}else if(a.indexOf(y[1])>=0){if(f.icloud_remove_subaddress&&(y[0]=y[0].split("+")[0]),!y[0].length)return!1;(f.all_lowercase||f.icloud_lowercase)&&(y[0]=y[0].toLowerCase())}else if(s.indexOf(y[1])>=0){if(f.outlookdotcom_remove_subaddress&&(y[0]=y[0].split("+")[0]),!y[0].length)return!1;(f.all_lowercase||f.outlookdotcom_lowercase)&&(y[0]=y[0].toLowerCase())}else if(o.indexOf(y[1])>=0){if(f.yahoo_remove_subaddress){var v=y[0].split("-");y[0]=v.length>1?v.slice(0,-1).join("-"):v[0]}if(!y[0].length)return!1;(f.all_lowercase||f.yahoo_lowercase)&&(y[0]=y[0].toLowerCase())}else c.indexOf(y[1])>=0?((f.all_lowercase||f.yandex_lowercase)&&(y[0]=y[0].toLowerCase()),y[1]=f.yandex_convert_yandexru?"yandex.ru":y[1]):f.all_lowercase&&(y[0]=y[0].toLowerCase());return y.join("@")}t.exports=e.default,t.exports.default=e.default})(W_,W_.exports);var att=W_.exports,q_={exports:{}};
727(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function a(s){return(0,n.default)(s),i.test(s)}t.exports=e.default,t.exports.default=e.default})(q_,q_.exports);var stt=q_.exports,z_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=r(Ae);function r(s){return s&&s.__esModule?s:{default:s}}var i={"cs-CZ":function(o){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(o)},"de-DE":function(o){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÃ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÃ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÃ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÃ|GP|GR|GS|GT|GÃ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÃ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÃ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÃ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÃ|ÃB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÃ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÃD|BUL|BÃR|BÃS|BÃZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÃW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÃ|FOR|FRG|FRI|FRW|FTL|FÃS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÃ|HOG|HOH|HOL|HOM|HOR|HÃS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÃL|KEH|KEL|KEM|KIB|KLE|KLZ|KÃN|KÃT|KÃZ|KRU|KÃN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÃB|LOS|LRO|LSZ|LÃN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÃB|MÃR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÃHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÃ|PRÃ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÃD|RÃG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÃ|SLZ|SMÃ|SOB|SOG|SOK|SÃM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÃW|SWA|SZB|TBB|TDO|TET|TIR|TÃL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÃM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(o)},"de-LI":function(o){return/^FL[- ]?\d{1,5}[UZ]?$/.test(o)},"en-IN":function(o){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(o)},"en-SG":function(o){return/^[A-Z]{3}[ -]?[\d]{4}[ -]?[A-Z]{1}$/.test(o)},"es-AR":function(o){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(o)},"fi-FI":function(o){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(o)},"hu-HU":function(o){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(o)},"pt-BR":function(o){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(o)},"pt-PT":function(o){return/^(([A-Z]{2}[ -·]?[0-9]{2}[ -·]?[0-9]{2})|([0-9]{2}[ -·]?[A-Z]{2}[ -·]?[0-9]{2})|([0-9]{2}[ -·]?[0-9]{2}[ -·]?[A-Z]{2})|([A-Z]{2}[ -·]?[0-9]{2}[ -·]?[A-Z]{2}))$/.test(o)},"sq-AL":function(o){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(o)}
727,"sv-SE":function(o){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÃ
Ãà ]{2,7}$)/.test(o.trim())},"en-PK":function(o){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(o.trim())}};function a(s,o){if((0,n.default)(s),o in i)return i[o](s);if(o==="any"){for(var c in i){var l=i[c];if(l(s))return!0}return!1}throw new Error("Invalid locale '".concat(o,"'"))}t.exports=e.default,t.exports.default=e.default})(z_,z_.exports);var ott=z_.exports,Z_={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var n=i(di),r=i(Ae);function i(p){return p&&p.__esModule?p:{default:p}}var a=/^[A-Z]$/,s=/^[a-z]$/,o=/^[0-9]$/,c=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,l={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function u(p){var g={};return Array.from(p).forEach(function(y){var v=g[y];v?g[y]+=1:g[y]=1}),g}function d(p){var g=u(p),y={length:p.length,uniqueChars:Object.keys(g).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(g).forEach(function(v){a.test(v)?y.uppercaseCount+=g[v]:s.test(v)?y.lowercaseCount+=g[v]:o.test(v)?y.numberCount+=g[v]:c.test(v)&&(y.symbolCount+=g[v])}),y}function f(p,g){var y=0;return y+=p.uniqueChars*g.pointsPerUnique,y+=(p.length-p.uniqueChars)*g.pointsPerRepeat,p.lowercaseCount>0&&(y+=g.pointsForContainingLower),p.uppercaseCount>0&&(y+=g.pointsForContainingUpper),p.numberCount>0&&(y+=g.pointsForContainingNumber),p.symbolCount>0&&(y+=g.pointsForContainingSymbol),y}function h(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,r.default)(p);var y=d(p);return g=(0,n.default)(g||{},l),g.returnScore?f(y,g):y.length>=g.minLength&&y.lowercaseCount>=g.minLowercase&&y.uppercaseCount>=g.minUppercase&&y.numberCount>=g.minNumbers&&y.symbolCount>=g.minSymbols}t.exports=e.default,t.exports.default=e.default})(Z_,Z_.exports);var ctt=Z_.exports,Y0={};function K_(t){"@babel/helpers - typeof";return K_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K_(t)}Object.defineProperty(Y0,"__esModule",{value:!0});Y0.default=ptt;Y0.vatMatchers=void 0;var IM=utt(Ae),ltt=GY(qu);function GY(t,e){if(typeof WeakMap=="function")var n=new WeakMap,r=new WeakMap;return(GY=function(a,s){if(!s&&a&&a.__esModule)return a;var o,c,l={__proto__:null,default:a};if(a===null||K_(a)!="object"&&typeof a!="function")return l;if(o=s?r:n){if(o.has(a))return o.get(a);o.set(a,l)}for(var u in a)u!=="default"&&{}.hasOwnProperty.call(a,u)&&((c=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,u))&&(c.get||c.set)?o(l,u,c):l[u]=a[u]);return l})(t,e)}function utt(t){return t&&t.__esModule?t:{default:t}}var dtt=function(e){var n=e.match(/^(AU)?(\d{11})$/);if(!n)return!1;var r=[10,1,3,5,7,9,11,13,15,17,19];e=e.replace(/^AU/,"");for(var i=(parseInt(e.slice(0,1),10)-1).toString()+e.slice(1),a=0,s=0;s<11;s++)a+=r[s]*i.charAt(s);return a!==0&&a%89===0},ftt=function(e){var n=function(i){var a=i.pop(),s=[5,4,3,2,7,6,5,4],o=(11-i.reduce(function(c,l,u){return c+l*s[u]},0)%11)%11;return a===o};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(e)&&n(e.match(/\d/g).map(function(r){return+r}))},htt=function(e){var n=e.match(/^(PT)?(\d{9})$/);if(!n)return!1;var r=n[2],i=11-ltt.reverseMultiplyAndSum(r.split("").slice(0,8).map(function(a){return parseInt(a,10)}),9)%11;return i>9?parseInt(r[8],10)===0:i===parseInt(r[8],10)},TM=Y0.vatMatchers={AT:function(e){return/^(AT)?U\d{8}$/.test(e)},BE:function(e){return/^(BE)?\d{10}$/.test(e)},BG:function(e){return/^(BG)?\d{9,10}$/.test(e)},HR:function(e){return/^(HR)?\d{11}$/.test(e)},CY:function(e){return/^(CY)?\w{9}$/.test(e)},CZ:function(e){return/^(CZ)?\d{8,10}$/.test(e)},DK:function(e){return/^(DK)?\d{8}$/.test(e)},EE:function(e){return/^(EE)?\d{9}$/.test(e)},FI:function(e){return/^(FI)?\d{8}$/.test(e)},FR:function(e){return/^(FR)([A-Z0-9]{2}\d{9})$/.test(e)},DE:function(e){return/^(DE)?\d{9}$/.test(e)},EL:function(e){return/^(EL)?\d{9}$/.test(e)},HU:function(e){return/^(HU)?\d{8}$/.test(e)},IE:function(e){return/^(IE)?\d{7}\w{1}(W)?$/.test(e)},IT:function(e){return/^(IT)?\d{11}$/.test(e)},LV:function(e){return/^(LV)?\d{11}$/.test(e)},LT:function(e){return/^(LT)?\d{9,12}$/.test(e)},LU:function(e){return/^(LU)?\d{8}$/.test(e)},MT:function(e){return/^(MT)?\d{8}$/.test(e)},NL:function(e){return/^(NL)?\d{9}B\d{2}$/.test(e)},PL:function(e){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(e)},PT:htt,RO:function(e){return/^(RO)?\d{2,10}$/.test(e)},SK:function(e){return/^(SK)?\d{10}$/.test(e)},SI:function(e){return/^(SI)?\d{8}$/.test(e)},ES:function(e){return/^(ES)?\w\d{7}[A-Z]$/.test(e)},SE:function(e){return/^(SE)?\d{12}$/.test(e)},AL:function(e){return/^(AL)?\w{9}[A-Z]$/.test(e)},MK:function(e){return/^(MK)?\d{13}$/.test(e)},AU:dtt,BY:function(e){return/^(УÐÐ )?\d{9}$/.test(e)},CA:function(e){return/^(CA)?\d{9}$/.test(e)},IS:function(e){return/^(IS)?\d{5,6}$/.test(e)},IN:function(e){return/^(IN)?\d{15}$/.test(e)},ID:function(e){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(e)},IL:function(e){return/^(IL)?\d{9}$/.test(e)},KZ:function(e){return/^(KZ)?\d{12}$/.test(e)}
727,NZ:function(e){return/^(NZ)?\d{9}$/.test(e)},NG:function(e){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(e)},NO:function(e){return/^(NO)?\d{9}MVA$/.test(e)},PH:function(e){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(e)},RU:function(e){return/^(RU)?(\d{10}|\d{12})$/.test(e)},SM:function(e){return/^(SM)?\d{5}$/.test(e)},SA:function(e){return/^(SA)?\d{15}$/.test(e)},RS:function(e){return/^(RS)?\d{9}$/.test(e)},CH:ftt,TR:function(e){return/^(TR)?\d{10}$/.test(e)},UA:function(e){return/^(UA)?\d{12}$/.test(e)},GB:function(e){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(e)},UZ:function(e){return/^(UZ)?\d{9}$/.test(e)},AR:function(e){return/^(AR)?\d{11}$/.test(e)},BO:function(e){return/^(BO)?\d{7}$/.test(e)},BR:function(e){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(e)},CL:function(e){return/^(CL)?\d{8}-\d{1}$/.test(e)},CO:function(e){return/^(CO)?\d{10}$/.test(e)},CR:function(e){return/^(CR)?\d{9,12}$/.test(e)},EC:function(e){return/^(EC)?\d{13}$/.test(e)},SV:function(e){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(e)},GT:function(e){return/^(GT)?\d{7}-\d{1}$/.test(e)},HN:function(e){return/^(HN)?$/.test(e)},MX:function(e){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(e)},NI:function(e){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(e)},PA:function(e){return/^(PA)?$/.test(e)},PY:function(e){return/^(PY)?\d{6,8}-\d{1}$/.test(e)},PE:function(e){return/^(PE)?\d{11}$/.test(e)},DO:function(e){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(e)},UY:function(e){return/^(UY)?\d{12}$/.test(e)},VE:function(e){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(e)}};function ptt(t,e){if((0,IM.default)(t),(0,IM.default)(e),e in TM)return TM[e](t);throw new Error("Invalid country code: '".concat(e,"'"))}(function(t,e){function n(ss){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(tc){return typeof tc}:function(tc){return tc&&typeof Symbol=="function"&&tc.constructor===Symbol&&tc!==Symbol.prototype?"symbol":typeof tc},n(ss)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=we(MA),i=we(kY),a=we(YXe),s=we(JXe),o=we(XXe),c=we(QXe),l=we(eQe),u=we(OY),d=we(tQe),f=we(nQe),h=we(s6),p=we(rQe),g=we(NA),y=we(NY),v=we(iQe),b=we(aQe),w=we(sQe),_=we(oQe),E=Cn(B0),C=Cn(V0),x=we(pQe),$=Cn(H0),T=we(vQe),U=we(wQe),O=we(bQe),F=we(_Qe),k=we(CQe),S=we(cf),I=we(lf),A=we($Qe),R=we(PQe),N=we(OQe),P=we(MQe),j=we(DA),M=Cn(of),V=we(NQe),B=we(DY),G=we(DQe),Z=we(FQe),ie=we(UQe),oe=we(jQe),z=we(BQe),J=we(VQe),K=Cn(W0),ne=we(JQe),ce=we(XQe),xe=we(QQe),ke=we(eet),Me=we(tet),$t=we(net),H=we(ret),q=we(RY),se=we(iet),de=we(aet),he=we(set),pe=we(oet),ye=we(cet),ge=we(uet),Pe=we(BY),_e=we(det),Ie=we(fet),qe=we(het),Fe=we(pet),pt=we(get),ze=we(yet),Ue=we(_et),Ve=Cn(q0),st=we(xet),as=we(Iet),Ku=we(Tet),pf=z0,l6=we(Ret),D=we(Oet),W=we(Met),X=we(Z0),Y=we(uf),ae=we(Uet),le=we(jet),me=we(K0),Ee=we(Wet),ot=we(qet),wt=we(jY),an=we(zet),Gt=we(Zet),bn=we(Ket),ct=we(Get),Yt=we(Yet),Mn=Cn(G0),xr=we(zY),$a=we(qY),fi=we(ZY),Kr=we(ett),Qs=we(ttt),hi=we(ntt),Gr=we(rtt),gf=we(KY),yf=we(itt),X0=we(att),It=we(stt),_n=we(ott),ht=we(ctt),Nn=we(Y0);function Cn(ss,tc){if(typeof WeakMap=="function")var pJ=new WeakMap,gJ=new WeakMap;return(Cn=function(pi,HA){if(!HA&&pi&&pi.__esModule)return pi;var Gu,Q0,mf={__proto__:null,default:pi};if(pi===null||n(pi)!="object"&&typeof pi!="function")return mf;if(Gu=HA?gJ:pJ){if(Gu.has(pi))return Gu.get(pi);Gu.set(pi,mf)}for(var Yu in pi)Yu!=="default"&&{}.hasOwnProperty.call(pi,Yu)&&((Q0=(Gu=Object.defineProperty)&&Object.getOwnPropertyDescriptor(pi,Yu))&&(Q0.get||Q0.set)?Gu(mf,Yu,Q0):mf[Yu]=pi[Yu]);return mf})(ss,tc)}function we(ss){return ss&&ss.__esModule?ss:{default:ss}}var ec="13.15.23",u6={version:ec,toDate:r.default,toFloat:i.default,toInt:a.default,toBoolean:s.default,equals:o.default,contains:c.default,matches:l.default,isEmail:u.default,isURL:d.default,isMACAddress:f.default,isIP:h.default,isIPRange:p.default,isFQDN:g.default,isBoolean:b.default,isIBAN:K.default,isBIC:ne.default,isAbaRouting:_.default,isAlpha:E.default,isAlphaLocales:E.locales,isAlphanumeric:C.default,isAlphanumericLocales:C.locales,isNumeric:x.default,isPassportNumber:$.default,passportNumberLocales:$.locales,isPort:T.default,isLowercase:U.default,isUppercase:O.default,isAscii:k.default,isFullWidth:S.default,isHalfWidth:I.default,isVariableWidth:A.default,isMultibyte:R.default,isSemVer:N.default,isSurrogatePair:P.default,isInt:j.default,isIMEI:F.default,isFloat:M.default,isFloatLocales:M.locales,isDecimal:V.default,isHexadecimal:B.default,isOctal:G.default,isDiv
727isibleBy:Z.default,isHexColor:ie.default,isRgbColor:oe.default,isHSL:z.default,isISRC:J.default,isMD5:ce.default,isHash:xe.default,isJWT:ke.default,isJSON:Me.default,isEmpty:$t.default,isLength:H.default,isLocale:w.default,isByteLength:q.default,isULID:se.default,isUUID:de.default,isMongoId:he.default,isAfter:pe.default,isBefore:ye.default,isIn:ge.default,isLuhnNumber:Pe.default,isCreditCard:_e.default,isIdentityCard:Ie.default,isEAN:qe.default,isISIN:Fe.default,isISBN:pt.default,isISSN:ze.default,isMobilePhone:Ve.default,isMobilePhoneLocales:Ve.locales,isPostalCode:Mn.default,isPostalCodeLocales:Mn.locales,isEthereumAddress:st.default,isCurrency:as.default,isBtcAddress:Ku.default,isISO6346:pf.isISO6346,isFreightContainerID:pf.isFreightContainerID,isISO6391:l6.default,isISO8601:D.default,isISO15924:X.default,isRFC3339:W.default,isISO31661Alpha2:Y.default,isISO31661Alpha3:ae.default,isISO31661Numeric:le.default,isISO4217:me.default,isBase32:Ee.default,isBase58:ot.default,isBase64:wt.default,isDataURI:an.default,isMagnetURI:Gt.default,isMailtoURI:bn.default,isMimeType:ct.default,isLatLong:Yt.default,ltrim:xr.default,rtrim:$a.default,trim:fi.default,escape:Kr.default,unescape:Qs.default,stripLow:hi.default,whitelist:Gr.default,blacklist:gf.default,isWhitelisted:yf.default,normalizeEmail:X0.default,toString,isSlug:It.default,isStrongPassword:ht.default,isTaxID:Ue.default,isDate:y.default,isTime:v.default,isLicensePlate:_n.default,isVAT:Nn.default,ibanLocales:K.locales};e.default=u6,t.exports=e.default,t.exports.default=e.default})(n9,n9.exports);var gtt=n9.exports;const YY=Zs(gtt),um=t=>!t||t.trim()===""?!1:YY.isEmail(t),Act=(t,e="us")=>{if(!t||t.trim()==="")return!1;try{return Dve(t.trim(),e.toUpperCase())}catch{return!1}},ytt=t=>{const e=(t??"").replace(/\D/g,"");return e.length>=7&&e.length<=15},mtt={US:{pattern:/^\d{5}(-\d{4})?$/,message:"Enter a valid ZIP code"},AU:{pattern:/^\d{4}$/,message:"Enter a valid postcode"},CA:{pattern:/^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/,message:"Enter a valid postal code"}},Ui=t=>t==null?!1:!YY.isEmpty(t.trim()),vtt=t=>{const e={};Ui(t.firstName)||(e.firstName="Enter your first name"),Ui(t.lastName)||(e.lastName="Enter your last name"),Ui(t.email)?um(t.email)||(e.email="Enter a valid email address"):e.email="Enter your email address",Ui(t.phone)?ytt(t.phone)||(e.phone="Enter a valid mobile phone number"):e.phone="Enter your mobile phone number",Ui(t.country)||(e.country="Select a country"),Ui(t.addressLine1)||(e.addressLine1="Enter your address"),Ui(t.city)||(e.city="Enter your city"),Ui(t.state)||(e.state="Enter your state or region");const n=t.country.toUpperCase();if(!tee.includes(n))if(!Ui(t.zipCode))e.zipCode="Enter your postal code";else{const r=mtt[n];r&&!r.pattern.test(t.zipCode.trim())&&(e.zipCode=r.message)}n==="US"&&Ui(t.state)&&(EQ(t.state)||(e.state="Select a state"));for(const r of aee)iee(t[r])&&(e[r]=nee);return t.country==="id"&&(Ui(t.receiverTaxId)||(e.receiverTaxId="Receiver Tax ID is required for Indonesia")),t.country==="kr"&&(Ui(t.receiverTaxId)||(e.receiverTaxId="PCCC (Personal Customs Clearance Code) is required for South Korea")),t.country==="br"&&(Ui(t.receiverTaxId)||(e.receiverTaxId="CPF / CNPJ is required for Brazil")),e},xct=t=>{const e=vtt(t);return Object.keys(e).length===0};function wtt({className:t,labelClassName:e,valueClassName:n}){const{t:r}=ta("play"),{offerDurationMs:i,hasTimer:a}=a6(),s=i6(),[o,c]=L.useState(()=>a?mM(s,i??void 0):null);L.useEffect(()=>{c(a?mM(s,i??void 0):null)},[s,a,i]);const[l,u]=L.useState(()=>Date.now());if(L.useEffect(()=>{const g=setInterval(()=>u(Date.now()),1e3);return()=>clearInterval(g)},[]),!a||o===null)return null;const d=Math.max(0,Math.floor((o-l)/1e3)),f=String(Math.floor(d/3600)).padStart(2,"0"),h=String(Math.floor(d%3600/60)).padStart(2,"0"),p=String(d%60).padStart(2,"0");return m.jsxs("div",{className:t,children:[m.jsx("span",{className:e,children:r("referral.banner.offerEndsIn")}),m.jsxs("span",{className:n,children:[f,"h : ",h,"m : ",p,"s"]})]})}function btt({onVerify:t,submitting:e,onBack:n,error:r}){const{t:i}=ta("common"),[a,s]=L.useState("");return m.jsxs("div",{className:"self-stretch flex flex-col gap-4",children:[m.jsxs(WXe,{className:"h-12 border-grey-70",children:[m.jsx(ZXe,{type:"text",name:"otp",value:a,onChange:o=>s(o.target.value),onKeyDown:o=>{o.key==="Enter"&&a.trim()&&t(a)},placeholder:i("login.otpPlaceholder"),className:"text-grey-30 text-sm font-normal font-space-grotesk placeholder:text-grey-50"}),m.jsx(zXe,{align:"inline-end",children:m.jsx(zM,{size:"sm",onClick:()=>t(a),disabled:!a.trim()||e,children:i(e?"login.verifying":"login.verify")})})]}),r&&m.jsx("div",{className:"text-red-400 text-sm font-normal font-space-grotesk text-center",children:r}),m.jsxs(wh,{type:"button",onClick:n,variant:"outline",className:"h-8 pl-6 pr-3 py-2 flex gap-2 border-0 text-grey-30 text-sm font-medium font-space-grotesk hover:text-secondary-10",children:[m.jsx(vre,{className:"w-4 h-4"}),i("login.backToMethods")]})]})}function LM({showCountdown:t,showBanner:e=!0,showTitle:n=!0,children:r}){const{t:i}=ta("common");return m.jsxs("div",{className:"flex flex-col gap-6 h-full",children:[n&&m.jsx("div",{className:"text-white text-lg font-medium font-space-grotesk",children:i("login.title")}),t&&m.jsx(wtt,{className:"flex flex-col items-center gap-1 text-center",labelClassName:"text-[10px] font-bold uppercase tracking-widest text-grey-30",valueClassName:"font-mono text-2xl font-bold tabular-nums text-primary-10"}),r,m.jsxs("div",{className:"flex flex-col gap-2 w-full flex-1 justify-end",children:[m.jsx("div",{className:"self-stretch text-center text-grey-30 text-xs font-normal font-space-grotesk leading-4",children:m.jsx(eee,{t:i,i18nKey:"login.termsAgreement",components:{1:m.jsx("a",{href:SQ,target:"_blank",rel:"noreferrer",className:"text-secondary-10"})}})}),e&&m.jsx("div",{className:"w-full flex justify-center",children:m.jsx(Stt,{})})]})]})}function _tt({handlers:t,authBusy:e,authError:n,abstractLabel:r="Abstract",resetKey:i}){const{t:a}=ta("common"),[s,o]=L.useState("");L.useEffect(()=>{o("")},[i]);const c=()=>{um(s)&&t.onEmailContinue(s.trim())};return m.jsxs("div",{className:"self-stretch flex flex-col gap-4",children:[m.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[m.jsxs(wh,{type:"button",onClick:t.onGoogle,disabled:e,variant:"outline",size:"lg",className:"h-12 gap-3 bg-grey-90 border-grey-70 hover:border-grey-60 hover:bg-grey-90",children:[m.jsx(Ctt,{}),m.jsx("span",{className:"text-white text-sm font-normal font-space-grotesk",children:a("login.google")})]}),m.jsxs(wh,{type:"button",onClick:t.onApple,disabled:e,variant:"outline",size:"lg",className:"h-12 gap-3 bg-grey-90 border-grey-70 hover:border-grey-60 hover:bg-grey-90",children:[m.jsx(Ett,{}),m.jsx("span",{className:"text-white text-sm font-normal font-space-grotesk",children:a("login.apple")}
727)]})]}),m.jsxs(wh,{type:"button",onClick:t.onAbstract,disabled:e,variant:"outline",size:"lg",className:"h-12 w-full gap-3 bg-grey-90 border-grey-70 hover:border-grey-60 hover:bg-grey-90",children:[m.jsx(JY,{}),m.jsx("span",{className:"text-white text-sm font-normal font-space-grotesk",children:r})]}),m.jsxs("div",{className:"flex items-center gap-3 py-1",children:[m.jsx("div",{className:"h-px flex-1 bg-grey-70"}),m.jsx("span",{className:"text-grey-40 text-xs font-space-grotesk",children:a("login.or")}),m.jsx("div",{className:"h-px flex-1 bg-grey-70"})]}),m.jsx("input",{type:"email",name:"email",value:s,onChange:l=>o(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()},placeholder:a("login.emailPlaceholder"),className:"h-12 w-full rounded-lg border border-grey-70 bg-grey-90 px-4 text-sm text-white placeholder:text-grey-40 focus:border-primary-10 focus:outline-none font-space-grotesk"}),m.jsx(zM,{onClick:c,replaceWithLoader:!0,disabled:!s.trim()||e||!um(s),variant:"outline",size:"lg",className:"h-12 w-full border-0 bg-grey-80 text-grey-30 font-space-grotesk hover:bg-grey-70 disabled:opacity-100",children:a("login.continue")}),n&&m.jsx("div",{className:"text-red-400 text-sm font-normal font-space-grotesk text-center",children:n})]})}const Ctt=()=>{const{t}=ta("common");return m.jsx("div",{className:"w-6 h-6 relative",children:m.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("title",{children:t("login.googleIconTitle")}),m.jsx("path",{d:"M12 9.81812V14.4654H18.4582C18.1746 15.9599 17.3236 17.2254 16.0472 18.0763L19.9417 21.0982C22.2108 19.0037 23.5199 15.9273 23.5199 12.2728C23.5199 11.4219 23.4436 10.6036 23.3017 9.81825L12 9.81812Z",fill:"white"}),m.jsx("path",{d:"M5.27461 14.2841L4.39625 14.9564L1.28711 17.3782C3.26165 21.2945 7.30862 24 11.9995 24C15.2394 24 17.9557 22.9309 19.9412 21.0983L16.0467 18.0764C14.9776 18.7964 13.614 19.2328 11.9995 19.2328C8.87951 19.2328 6.22868 17.1274 5.27952 14.291L5.27461 14.2841Z",fill:"white"}),m.jsx("path",{d:"M1.28718 6.62183C0.469042 8.23631 0 10.0581 0 11.9999C0 13.9417 0.469042 15.7636 1.28718 17.378C1.28718 17.3889 5.27997 14.2799 5.27997 14.2799C5.03998 13.5599 4.89812 12.7963 4.89812 11.9998C4.89812 11.2033 5.03998 10.4398 5.27997 9.71976L1.28718 6.62183Z",fill:"white"}),m.jsx("path",{d:"M11.9997 4.77818C13.767 4.77818 15.3379 5.38907 16.5925 6.56727L20.0288 3.13095C17.9452 1.18917 15.2398 0 11.9997 0C7.30887 0 3.26165 2.69454 1.28711 6.62183L5.27978 9.72001C6.22882 6.88362 8.87976 4.77818 11.9997 4.77818Z",fill:"white"})]})})},Ett=()=>{const{t}=ta("common");return m.jsx("div",{className:"w-6 h-6 relative",children:m.jsxs("svg",{width:"21",height:"24",viewBox:"0 0 21 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("title",{children:t("login.appleIconTitle")}),m.jsx("path",{d:"M19.792 18.7033C19.429 19.5418 18.9994 20.3136 18.5016 21.0232C17.8231 21.9906 17.2676 22.6602 16.8395 23.0321C16.1758 23.6424 15.4647 23.955 14.7032 23.9728C14.1566 23.9728 13.4973 23.8172 12.73 23.5017C11.9601 23.1876 11.2525 23.0321 10.6056 23.0321C9.92709 23.0321 9.19941 23.1876 8.42106 23.5017C7.64153 23.8172 7.01355 23.9817 6.53342 23.9979C5.80322 24.0291 5.07539 23.7076 4.3489 23.0321C3.88521 22.6276 3.30523 21.9343 2.61043 20.9521C1.86498 19.9033 1.25211 18.687 0.771975 17.3004C0.25777 15.8026 0 14.3523 0 12.9482C0 11.3398 0.347544 9.95259 1.04367 8.79011C1.59076 7.85636 2.31859 7.11979 3.22953 6.57906C4.14046 6.03834 5.12473 5.76279 6.18469 5.74516C6.76467 5.74516 7.52524 5.92457 8.4704 6.27715C9.41288 6.63091 10.0181 6.81032 10.2834 6.81032C10.4817 6.81032 11.154 6.60054 12.2937 6.18234C13.3714 5.7945 14.281 5.63391 15.0262 5.69717C17.0454 5.86012 18.5624 6.6561 19.5712 8.09013C17.7654 9.18432 16.8721 10.7169 16.8898 12.6829C16.9061 14.2142 17.4617 15.4886 18.5535 16.5004C19.0483 16.97 19.6009 17.333 20.2156 17.5907C20.0823 17.9774 19.9416 18.3477 19.792 18.7033V18.7033ZM15.161 0.480137C15.161 1.68041 14.7225 2.8011 13.8484 3.83841C12.7937 5.07155 11.5179 5.78413 10.1343 5.67168C10.1167 5.52769 10.1065 5.37614 10.1065 5.21688C10.1065 4.06462 10.6081 2.83147 11.4989 1.82321C11.9436 1.3127 12.5092 0.888228 13.1951 0.549615C13.8796 0.216055 14.5269 0.031589 15.1358 0C15.1536 0.160458 15.161 0.320926 15.161 0.480121V0.480137Z",fill:"white"})]})})},JY=()=>{const{t}=ta("common");return m.jsx("img",{src:"/abstract-black.png",alt:t("login.abstractIconAlt"),className:"w-4 h-4"})},Stt=()=>{const{t}=ta("common");return m.jsxs("svg",{width:"150",height:"13",viewBox:"0 0 150 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("title",{children:t("login.privyBannerTitle")}),m.jsx("path",{d:"M0 5.005V10.0035H1.508V6.487H2.6715C3.47425 6.487 3.85125 6.48375 3.89675 6.4805C4.22175 6.4545 4.381 6.43175 4.60525 6.383C5.16554 6.27035 5.68329 6.0036 6.10025 5.61275C6.63975 5.1025 6.95825 4.355 7.0135 3.48075C7.02 3.38325 7.02 3.094 7.0135 2.9965C6.981 2.42125 6.8315 1.90775 6.5715 1.4625C6.20076 0.844814 5.6115 0.388949 4.9205 0.18525C4.61825 0.08775 4.35175 0.0455 3.91625 0.00975C3.8675 0.0065 3.315 0 1.92725 0H0V5.005ZM3.52625 1.3C4.1275 1.31625 4.53375 1.44625 4.87825 1.7225C4.94975 1.77775 5.05375 1.88175 5.1025 1.9435C5.32582 2.23874 5.46002 2.59171 5.48925 2.96075C5.50225 3.0745 5.50225 3.40275 5.48925 3.5165C5.46325 3.7375 5.4145 3.939 5.34625 4.11775C5.26787 4.32263 5.14716 4.50868 4.992 4.66375C4.69607 4.95228 4.31118 5.13213 3.9 5.174C3.705 5.2 3.77 5.2 2.59675 5.20325H1.508V1.2935H2.4505C2.9705 1.2935 3.4515 1.2935 3.52625 1.3ZM60.9862 1.85575V3.71475H60.8985L60.8692 3.66925C60.7508 3.47333 60.6194 3.2855 60.476 3.107C60.3362 2.9445 60.151 2.79825 59.9235 2.665C59.748 2.5675 59.5822 2.5025 59.3612 2.46025C59.1793 2.42432 58.9943 2.40582 58.8087 2.405C58.3087 2.3836 57.8118 2.4932 57.3672 2.72293C56.9225 2.95265 56.5456 3.29455 56.2737 3.71475C55.8753 4.33708 55.6478 5.05334 55.614 5.7915C55.5912 6.11 55.5945 6.49025 55.6205 6.80875C55.6855 7.6115 55.9032 8.281 56.277 8.84C56.6254 9.37301 57.1386 9.77744 57.7383 9.99162C58.338 10.2058 58.9913 10.218 59.5985 10.0262C59.9521 9.90163 60.2662 9.68513 60.5085 9.399C60.6417 9.23325 60.7815 9.0415 60.866 8.89525L60.8985 8.84H61.0187V10.0035H62.4422V0H60.9862V1.85575ZM59.2832 3.65625C59.7057 3.70175 60.0308 3.85125 60.3135 4.13725C60.606 4.42975 60.801 4.8165 60.9147 5.32025C61.0317 5.84025 61.0415 6.52925 60.9342 7.085C60.8662 7.51223 60.6944 7.91622 60.4337 8.2615C60.2817 8.45612 60.0882 8.61431 59.8672 8.72452C59.6462 8.83473 59.4034 8.89417 59.1565 8.8985C58.901 8.91366 58.645 8.87945 58.4025 8.79775C58.1517 8.69579 57.9255 8.54162 57.7389 8.3455C57.5523 8.14937 57.4096 7.91578 57.3202 7.66025C57.1935 7.33525 57.1187 6.994 57.0862 6.58125C57.0765 6.47725 57.0732 6.1425 57.0798 6.019C57.1058 5.512 57.2097 5.07325 57.3917 4.70275C57.4795 4.51488 57.5957 4.34167 57.7362 4.18925C57.8851 4.02549 58.0655 3.89334 58.2664 3.80066C58.4674 3.70798 58.685 3.65666 58.9062 3.64975C58.9875 3.64325 59.1987 3.64975 59.2832 3.65625ZM68.2728 5.00175L68.276 10.0002H69.6995L69.7028 8.84H69.823L69.8522 8.88875C69.9302 9.03175 70.1252 9.29825 70.2455 9.44125C70.4762 9.69288 70.7621 9.88757 71.0807 10.01C71.817 10.2438 72.6147 10.1868 73.3102 9.85075C73.8778 9.56006 74.3386 9.09697 74.6265 8.528C74.8687 8.0577 75.0209 7.54624 75.075 7.02C75.1432 6.45775 75.1335 5.8175 75.0457 5.291C74.9665 4.80016 74.8015 4.3271 74.5583 3.8935C74.2759 3.38969 73.8522 2.97957 73.3395 2.71375C72.8933 2.49064 72.3982 2.38335 71.8997 2.40175C71.5888 2.39705 71.2798 2.45222 70.9897 2.56425C70.6871 2.70096 70.4176 2.90165 70.2 3.1525C70.
72707 3.3215 69.9335 3.5165 69.8425 3.66925L69.8197 3.71475H69.732V0H68.2695L68.2728 5.00175ZM71.89 3.65625C72.2377 3.68875 72.5205 3.79925 72.7675 3.99425C72.9889 4.16845 73.1706 4.38782 73.3005 4.63775C73.4402 4.91075 73.554 5.28775 73.606 5.6485C73.6547 6.0255 73.658 6.4285 73.6125 6.799C73.5649 7.26457 73.4103 7.71283 73.1607 8.10875C72.9547 8.43198 72.6472 8.67773 72.2865 8.8075C71.994 8.905 71.6235 8.931 71.292 8.8725C71.0615 8.82995 70.8426 8.73938 70.6494 8.60668C70.4562 8.47397 70.2932 8.30211 70.1707 8.10225C70.1155 8.01942 70.0666 7.93251 70.0245 7.84225C69.862 7.5075 69.7645 7.12725 69.7255 6.67875C69.7125 6.5195 69.706 6.3895 69.7093 6.1815C69.7125 5.9345 69.7255 5.78175 69.7515 5.58025C69.875 4.758 70.2292 4.15675 70.7752 3.8545C71.0063 3.73201 71.2615 3.66209 71.5228 3.64975C71.6452 3.64499 71.7678 3.64716 71.89 3.65625ZM22.4412 0.70525L22.438 1.6055V2.5025H21.346V3.6725H22.438V5.8825L22.4412 8.20625C22.4608 8.66125 22.5712 8.99925 22.7987 9.3015C23.0405 9.62299 23.3787 9.85873 23.764 9.97425C24.0597 10.0717 24.3587 10.1107 24.7065 10.0977C25.001 10.0911 25.2927 10.0384 25.571 9.94175L25.311 8.73925L25.1875 8.75875C24.9267 8.81785 24.6553 8.81115 24.3977 8.73925C24.2905 8.70675 24.2157 8.658 24.1377 8.58C24.0077 8.44675 23.9427 8.294 23.9102 8.03725C23.9037 7.97225 23.9037 7.83575 23.9005 5.82075V3.67575H25.4377V2.5025H23.9005V0.702H22.4412V0.70525ZM43.3355 0.70525V2.5025H42.2337V3.6725H43.3322V5.915L43.3355 8.24525C43.341 8.53138 43.4132 8.81228 43.5464 9.06561C43.6795 9.31893 43.8699 9.53769 44.1025 9.7045C44.3787 9.8995 44.7622 10.0392 45.162 10.0848C45.4383 10.1172 45.8218 10.101 46.0752 10.0522C46.1727 10.0328 46.319 9.99375 46.4002 9.96775L46.4652 9.94825V9.932L46.202 8.73925L46.0817 8.75875C45.8901 8.80393 45.6919 8.81384 45.4967 8.788C45.2205 8.74575 45.0677 8.658 44.9442 8.47275C44.8784 8.37039 44.8352 8.25516 44.8175 8.13475C44.798 8.00475 44.798 8.13475 44.798 5.82725V3.6725H46.3255V2.5025H44.798L44.7948 1.60225V0.702H43.3355V0.70525ZM95.3582 0.767C94.7171 0.801364 94.0897 0.965837 93.5142 1.25041C92.9386 1.53498 92.427 1.93369 92.0105 2.42228C91.594 2.91087 91.2812 3.47911 91.0913 4.09242C90.9014 4.70572 90.8382 5.35127 90.9057 5.98975C90.9885 6.77749 91.2672 7.53197 91.7165 8.18429C92.1658 8.8366 92.7713 9.36598 93.4778 9.72408C94.1843 10.0822 94.9693 10.2576 95.761 10.2343C96.5527 10.211 97.326 9.98976 98.0102 9.59075C98.7954 9.13263 99.4313 8.45718 99.8413 7.64583C100.251 6.83449 100.418 5.92187 100.321 5.018C100.249 4.3155 100.021 3.63793 99.6538 3.03466C99.2866 2.43139 98.7896 1.91762 98.1987 1.53075C97.3577 0.979417 96.3623 0.711774 95.3582 0.767ZM114.01 0.767C113.525 0.799975 113.054 0.939389 112.629 1.17532C112.204 1.41125 111.837 1.73789 111.553 2.132C111.501 2.197 111.407 2.33675 111.364 2.40175L111.348 2.43425H111.196L111.192 1.01725H108.8V12.8472H111.342V8.86275H111.501L111.517 8.8855C112.12 9.63701 112.995 10.1214 113.951 10.2342C114.531 10.2901 115.115 10.197 115.649 9.96381C116.182 9.73062 116.647 9.36505 117 8.90175C117.539 8.21925 117.887 7.30925 117.998 6.28225C118.03 5.9995 118.04 5.82725 118.04 5.512C118.04 5.252 118.04 5.1545 118.017 4.94C117.957 3.91204 117.591 2.92543 116.967 2.106C116.788 1.88671 116.587 1.68633 116.366 1.508C115.7 0.974382 114.858 0.709969 114.007 0.767H114.01ZM113.704 2.73325C114.117 2.782 114.462 2.9445 114.744 3.22075C115.063 3.53275 115.287 3.9715 115.404 4.52075C115.515 5.031 115.528 5.71675 115.443 6.2725C115.393 6.64167 115.279 6.99919 115.105 7.32875C115.06 7.41 114.962 7.553 114.91 7.618C114.745 7.83109 114.532 8.0028 114.289 8.11956C114.046 8.23632 113.779 8.29493 113.509 8.29075C113.239 8.30924 112.967 8.26286 112.718 8.15547C112.469 8.04807 112.249 7.88275 112.076 7.67325C111.895 7.44869 111.757 7.19324 111.667 6.91925C111.509 6.41166 111.441 5.88048 111.465 5.3495C111.481 4.706 111.589 4.20225 111.797 3.77325C111.965 3.40405 112.25 3.1011 112.609 2.912C112.824 2.8015 113.032 2.7495 113.305 2.7235C113.363 2.717 113.643 2.7235 113.704 2.73325ZM118.18 1.0075L118.176 2.0475V3.0745H118.641C119.051 3.07775 119.109 3.081 119.142 3.0875C119.278 3.11675 119.356 3.1785 119.398 3.289C119.424 3.36375 119.424 3.315 119.424 4.251C119.434 5.35381 119.437 6.45666 119.434 7.5595V10.01H121.976V7.605L121.979 5.06025C121.989 4.75475 122.015 4.5305 122.067 4.3
7271925C122.216 3.70175 122.567 3.367 123.155 3.2695C123.324 3.2435 123.22 3.2435 124.78 3.2435H126.21V1.001H125.203C124.072 1.001 123.932 1.00425 123.685 1.0335C123.09 1.0985 122.697 1.29025 122.398 1.6445C122.236 1.8395 122.106 2.0735 121.989 2.379L121.969 2.43425H121.82V1.00425H120C118.55 1.00425 118.18 1.00425 118.18 1.01075V1.0075ZM127.01 5.50875V10.01H128.268L129.522 10.0068V1.00425H127.01V5.50875ZM130.195 1.0075L130.192 1.1375V1.261L131.706 5.616L133.23 9.99375L133.237 10.01H136.585L136.594 9.99375L138.112 5.6225L139.63 1.2675V1.0075H137.215L135.037 7.267H134.875L133.809 4.1795L132.733 1.0465L132.717 1.0075H131.456L130.195 1.01075V1.0075ZM140.068 1.0075C140.065 1.0075 140.062 1.06925 140.062 1.1375V1.26425L141.713 6.006C142.623 8.6125 143.364 10.751 143.364 10.7542C143.367 10.7607 143.292 10.7607 141.804 10.7607H140.237V12.8472H141.846C143.501 12.8472 143.546 12.8472 143.754 12.8278C144.778 12.7367 145.473 12.298 145.909 11.479C146 11.3002 146.052 11.1702 146.191 10.777L149.175 2.2035L149.5 1.26425V1.00425H147.085L144.911 7.26375H144.748L143.686 4.18925L142.61 1.05625L142.59 1.00425H141.329L140.068 1.0075ZM11.8852 2.392C11.4432 2.4245 11.0402 2.587 10.7087 2.86325C10.4616 3.07292 10.2743 3.34428 10.166 3.64975L10.1497 3.692H10.075V2.5025H8.66125V10.0035H10.1237V7.631C10.1237 5.031 10.1237 5.2455 10.1497 5.0895C10.187 4.88136 10.2654 4.68274 10.3803 4.50527C10.4953 4.32781 10.6445 4.17507 10.8193 4.056C11.089 3.8675 11.3847 3.76675 11.752 3.7375C12.0575 3.72844 12.363 3.75572 12.662 3.81875H12.675V2.42125L12.6067 2.41475C12.4085 2.392 12.0412 2.38225 11.8852 2.392ZM16.601 2.40825C15.8438 2.44725 15.2035 2.68125 14.6672 3.11025C14.4123 3.31373 14.1899 3.55482 14.0075 3.82525C13.638
7276 4.38793 13.4153 5.03342 13.3575 5.70375C13.3174 6.09815 13.3174 6.4956 13.3575 6.89C13.4201 7.59975 13.674 8.27925 14.092 8.85625C14.4968 9.40213 15.0666 9.80324 15.717 10.0002C16.4028 10.2083 17.2445 10.2083 17.927 10.0002C18.5563 9.80812 19.1104 9.42544 19.513 8.905C19.9615 8.3265 20.2247 7.605 20.293 6.7665C20.3352 6.292 20.3125 5.772 20.2345 5.33C20.104 4.50277 19.6932 3.74549 19.071 3.185C18.545 2.7385 17.8904 2.47101 17.2022 2.42125C17.0203 2.40175 16.7765 2.3985 16.601 2.40825ZM17.0625 3.63675C17.3485 3.66925 17.589 3.74725 17.8035 3.8805C18.0724 4.05772 18.2943 4.29748 18.4502 4.57925C18.7154 5.07929 18.8496 5.63834 18.8403 6.20425C18.8468 6.604 18.8012 6.99725 18.7037 7.345C18.6082 7.751 18.405 8.12374 18.1155 8.424C17.9172 8.619 17.7255 8.7425 17.4818 8.827C17.2722 8.89604 17.0524 8.92901 16.8317 8.9245C16.5255 8.9336 16.2218 8.8666 15.9477 8.7295C15.7937 8.65048 15.6533 8.54735 15.5317 8.424C15.2506 8.13516 15.05 7.77771 14.95 7.38725C14.7647 6.7405 14.755 5.93775 14.924 5.27475C15.0214 4.82078 15.251 4.40578 15.5837 4.082C15.8791 3.80268 16.2663 3.64087 16.6725 3.627C16.8026 3.62315 16.9328 3.6264 17.0625 3.63675ZM29.9163 2.405C29.6042 2.4245 29.4092 2.45375 29.1687 2.51225C28.7526 2.61549 28.3622 2.80322 28.0217 3.06376C27.6812 3.3243 27.3979 3.65209 27.1895 4.02675C26.8015 4.72072 26.6095 5.50707 26.6337 6.30175C26.6337 6.5715 26.6337 6.63975 26.6532 6.82175C26.7052 7.397 26.8417 7.90075 27.0725 8.34925C27.2889 8.79455 27.607 9.18275 28.001 9.48252C28.3951 9.78229 28.8541 9.98524 29.341 10.075C29.939 10.1952 30.667 10.179 31.2422 10.0328C31.8832 9.88813 32.4574 9.53352 32.8737 9.02525C33.0796 8.75808 33.2289 8.45177 33.3125 8.125L32.6267 7.99825L31.941 7.87475L31.915 7.917C31.7748 8.28015 31.5018 8.57641 31.1512 8.74575C30.9233 8.8526 30.6776 8.9165 30.4265 8.93425C30.3323 8.944 30.0592 8.944 29.9585 8.93425C29.6079 8.90705 29.27 8.7907 28.977 8.59625C28.6908 8.39722 28.4639 8.12428 28.3205 7.8065C28.1761 7.48048 28.0966 7.12943 28.0865 6.773V6.6885H33.41V6.42525C33.41 5.8305 33.3905 5.52825 33.3288 5.1675C33.2637 4.771 33.1565 4.4395 32.9875 4.1015C32.7882 3.68431 32.4917 3.321 32.123 3.042C31.6167 2.6701 31.0144 2.45128 30.3875 2.4115C30.2295 2.40194 30.0712 2.39869 29.913 2.40175L29.9163 2.405ZM30.3387 3.62375C30.7287 3.666 31.0505 3.8025 31.33 4.04625C31.6161 4.30073 31.8178 4.63627 31.9085 5.00825C31.9507 5.174 31.9767 5.3885 31.9767 5.54775V5.5965H28.0897V5.5575C28.1157 5.24225 28.1873 4.979 28.3237 4.70925C28.4862 4.38425 28.7137 4.12425 29.0192 3.92275C29.2965 3.73 29.6242 3.62267 29.9618 3.614C30.0268 3.61075 30.277 3.614 30.342 3.62375H30.3387ZM37.9567 2.40825C37.3067 2.44075 36.7445 2.6195 36.2603 2.9445C35.5802 3.41578 35.0905 4.11409 34.879 4.914C34.7107 5.52724 34.6557 6.16601 34.7165 6.799C34.7815 7.50425 34.9895 8.14125 35.3275 8.671C35.516 8.9635 35.7565 9.23325 36.0262 9.451C36.3693 9.72845 36.7685 9.92805 37.1962 10.036C37.612 10.1423 38.0424 10.1797 38.4702 10.1465C38.9024 10.126 39.3264 10.0211 39.7182 9.83775C40.145 9.63868 40.5122 9.3315 40.7836 8.94668C41.055 8.56187 41.221 8.11279 41.2652 7.644L41.2685 7.631H39.8482L39.832 7.683C39.7579 8.0044 39.5853 8.29463 39.3382 8.51313C39.0912 8.73164 38.782 8.86751 38.454 8.90175C38.2622 8.9245 38.025 8.92125 37.8267 8.8855C37.365 8.7995 36.9561 8.53427 36.6892 8.14775C36.5072 7.904 36.3642 7.5855 36.2797 7.241C36.1538 6.68187 36.1361 6.10377 36.2277 5.538C36.3026 5.01197 36.5414 4.52293 36.9102 4.1405C37.1073 3.94745 37.3465 3.80282 37.609 3.718C38.0236 3.59735 38.4654 3.60871 38.8732 3.7505C39.065 3.81875 39.208 3.913 39.3607 4.0625C39.591 4.28426 39.7552 4.56551 39.8352 4.875L39.8482 4.92375H41.2685V4.90425C41.222 4.40407 41.0354 3.92714 40.7302 3.52819C40.4249 3.12923 40.0134 2.82443 39.5427 2.64875C39.0392 2.44926 38.4968 2.36701 37.9567 2.40825ZM50.765 2.40825C50.0502 2.43201 49.3639 2.69397 48.815 3.1525C48.2788 3.6179 47.8931 4.23216 47.7067 4.91725C47.5377 5.49575 47.4857 6.18475 47.5507 6.8575C47.606 7.4425 47.7555 7.956 47.996 8.4175C48.192 8.79748 48.4634 9.13352 48.7937 9.40509C49.1239 9.67666 49.5061 9.87806 49.9167 9.997C50.453 10.153 51.0965 10.1952 51.714 10.114C52.923 9.95475 53.8427 9.2625 54.171 8.26475C54.21 8.138 54.2132 8.12825 54.2035 8.125C54.197 8.125 52.8612 7.88125 52.8417 7.88125C52.832 7.88125 52.8288 7.88125 52.8092 7.93325C52.7508 8.06975 52.663 8.22575 52.5752 8.32975C52.5233 8.39475 52.416 8.502 52.3478 8.55725C52.13 8.73275 51.8602 8.84975 51.558 8.90825C51.402 8.93425 51.2882 8.944 51.0997 8.944C50.8917 8.944 50.752 8.931 50.5798 8.89525C50.3128 8.84386 50.0603 8.73496 49.8398 8.57613C49.6192 8.4173 49.4359 8.21234 49.3025 7.9755C49.0948 7.59792 48.9843 7.17465 48.9808 6.74375V6.69175H54.3042V6.331L54.2977 5.86625C54.2653 5.135 54.1255 4.56625 53.859 4.0495C53.6569 3.66139 53.3724 3.32213 53.0255 3.05547C52.6786 2.78881 52.2775 2.6012 51.8505 2.50575C51.5125 2.42125 51.1355 2.38875 50.7682 2.40825H50.765ZM51.2362 3.62375C51.4665 3.6445 51.6903 3.71094 51.8945 3.8192C52.0987 3.92746 52.2793 4.07536 52.4257 4.25425C52.7263 4.62105 52.8854 5.08342 52.8742 5.5575V5.5965H48.984V5.577C48.984 5.5705 48.984 5.5315 48.9905 5.49575C49.0378 4.95633 49.2875 4.45478 49.6892 4.09175C50.0036 3.80906 50.4047 3.64172 50.8267 3.61725C50.908 3.61075 51.1517 3.61725 51.2362 3.62375ZM75.9135 2.5415L78.6337 10.088C78.5654 10.2953 78.4928 10.5012 78.416 10.7055C78.3329 10.9233 78.2069 11.1223 78.0455 11.2905C77.9122 11.4205 77.779 11.479 77.5645 11.5147C77.4767 11.5278 77.2297 11.5245 77.1257 11.5147C77.005 11.4982 76.8855 11.4732 76.7682 11.44L76.4173 12.6327C76.4173 12.6392 76.5212 12.6782 76.6317 12.7042C76.9
727015 12.7725 77.142 12.7985 77.4638 12.7952C77.6458 12.792 77.7237 12.7855 77.8667 12.7627C78.7475 12.6327 79.3812 12.0835 79.7712 11.1117L82.9042 2.51875C82.9042 2.51225 81.3377 2.49925 81.3345 2.5025L80.3822 5.4145L79.4365 8.32H79.3585L79.287 8.10875L78.3412 5.2L77.4638 2.5025H75.8972L75.9135 2.5415ZM95.2412 11.635C94.8577 11.648 94.614 11.6642 94.3312 11.687C93.5122 11.765 92.859 11.9112 92.5665 12.0867C92.339 12.22 92.3195 12.3663 92.5015 12.5028C92.7875 12.7172 93.5707 12.8895 94.5685 12.9577C95.1906 13.0001 95.8146 13.0055 96.4372 12.974C97.565 12.9122 98.4652 12.7205 98.748 12.4865C98.8195 12.4247 98.8455 12.376 98.8455 12.3142C98.8455 12.2817 98.8455 12.2752 98.8325 12.2427C98.7188 12.0185 98.0785 11.8202 97.1263 11.713C96.5005 11.6426 95.8706 11.6165 95.2412 11.635Z",fill:"white"})]})};function FA(t,e){if(!e){FT(t);return}const{$set_once:n,...r}=e;FT(t,r)}const R2={guaranteedPullOfferShown:"risk_free_offer_shown",guaranteedPullDismissed:"risk_free_dismissed",guaranteedPullClicked:"risk_free_clicked",campaignOfferShown:"campaign_offer_shown",campaignOfferDismissed:"campaign_offer_dismissed",campaignOfferClicked:"campaign_offer_clicked",campaignOfferPillTapped:"campaign_offer_pill_tapped",guaranteedPullCardValue:"risk_free_card_value",guaranteedPullDeeplink:"risk_free_deeplink",guaranteedPullBannerShown:"risk_free_banner_shown",guaranteedPullBannerClicked:"risk_free_banner_clicked",packViewed:"pack_viewed",packDetailCardClicked:"pack_detail_card_clicked",purchaseModalOpened:"purchase_modal_opened",purchaseBlockedSignedOut:"purchase_blocked_signed_out",purchaseFundsInsufficient:"purchase_funds_insufficient",purchaseMethodSelected:"purchase_method_selected",purchaseCancelled:"purchase_cancelled",purchaseTxSubmitted:"purchase_tx_submitted",purchaseTxFailed:"purchase_tx_failed",purchaseCompleted:"purchase_completed",purchaseCreditCardCompleted:"purchase_credit_card_completed",purchaseCreditCardFailed:"purchase_credit_card_failed",purchaseCreditsFailed:"purchase_credits_failed",marketplacePurchase:"marketplace_purchase",depositCtaClicked:"deposit_cta_clicked",walletFunded:"wallet_funded",coinflowWithdrawalOnboardingStarted:"coinflow-withdrawal.onboarding.started",coinflowWithdrawalOnboardingCompleted:"coinflow-withdrawal.onboarding.completed",coinflowWithdrawalBridgeSigned:"coinflow-withdrawal.bridge.signed",coinflowWithdrawalBridgeCompleted:"coinflow-withdrawal.bridge.completed",coinflowWithdrawalBridgeFailed:"coinflow-withdrawal.bridge.failed",coinflowWithdrawalPayoutSigned:"coinflow-withdrawal.payout.signed",coinflowWithdrawalPayoutCompleted:"coinflow-withdrawal.payout.completed",coinflowWithdrawalPayoutFailed:"coinflow-withdrawal.payout.failed",pullCardRevealCompleted:"pull_card_reveal_completed",firstPackClick:"first_pack_click",packClick:"pack_click",forYouSlotViewed:"for_you_slot_viewed",forYouSlotClicked:"for_you_slot_clicked",followAdded:"follow_added",followRemoved:"follow_removed",followPackClick:"follow_pack_click",forYouIntroViewed:"for_you_intro_viewed",forYouIntroCtaClicked:"for_you_intro_cta_clicked",forYouIntroDismissed:"for_you_intro_dismissed",referralLinkOpened:"referral_link_opened",signupModalViewed:"signup_modal_viewed",signupStarted:"signup_started",signupCompleted:"signup_completed",loginCompleted:"login_completed",onboardingAttributionSubmitted:"onboarding_attribution_submitted",onboardingCollectingLevelSubmitted:"onboarding_collecting_level_submitted",onboardingHereForSubmitted:"onboarding_here_for_submitted",onboardingUsernameSet:"onboarding_username_set",onboardingHowItWorksCompleted:"onboarding_howitworks_completed",onboardingSkipped:"onboarding_skipped"};function XY(t,e,n){t?.capture(e,n),FA(e,n)}function Ict(t,e){t?.setPersonProperties({signup_source:e})}function Tct(t,e){t?.setPersonProperties({onboarding_source:e})}function Lct(t,e){t?.setPersonProperties({onboarding_collecting_level:e})}function kct(t,e){t?.setPersonProperties({onboarding_here_for:e})}const kM="pokemon.firstPackClickFired";function $ct(t,e){if(!t||typeof window>"u")return;const n=new Date().toISOString();try{if(window.localStorage.getItem(kM))return;window.localStorage.setItem(kM,n)}catch{return}t.capture(R2.firstPackClick,{...e,$set_once:{first_pack_click_at:n,first_pack_click_collection:e.collection,first_pack_click_product_id:e.productId}}),FA(R2.firstPackClick,e)}function Pct(t,e){t?.capture(R2.packClick,e),FA(R2.packClick,e)}function Att(){const{hasReferralOffer:t,referralCode:e}
727=a6(),n=U2(),{t:r}=ta("play"),i=L.useRef(!1);return L.useEffect(()=>{t&&!i.current&&(i.current=!0,XY(n,R2.signupModalViewed,{ref_code:e}))},[t,e,n]),t?m.jsx("img",{"data-testid":"referral-welcome-offer-card",src:"/packs/referral/welcome-ticket.webp",alt:r("referral.modal.welcomeOffer"),className:"mx-auto w-full max-w-[220px] drop-shadow-2xl"}):null}function xtt({controller:t,isOpen:e,onClose:n}){const{t:r}=ta("common"),i=MJ(),{hasReferralOffer:a}=a6(),s=Itt(t,e);return i?m.jsx(NJ,{open:e,onOpenChange:o=>!o&&n(),children:m.jsxs(DJ,{side:"bottom",className:"bg-grey-90 border-t border-t-grey-80 rounded-t-lg w-full px-6 pt-8 pb-12 gap-6 flex flex-col max-h-[90vh] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-black","aria-describedby":void 0,children:[m.jsx(sx,{className:"sr-only",children:r("login.srTitle")}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-white text-lg font-medium font-space-grotesk",children:"Login or Signup"}),m.jsx("button",{type:"button","aria-label":r("login.closeAriaLabel"),className:"rounded-lg hover:bg-grey-80 transition-colors focus-visible:outline-none",onClick:n,children:m.jsx(yM,{variant:"mobile"})})]}),a&&m.jsx("div",{className:"flex justify-center pt-2",children:m.jsx(Att,{})}),m.jsx(LM,{showCountdown:a,showTitle:!1,children:s})]})}):m.jsx(PQ,{open:e,onOpenChange:o=>o===!1&&n(),children:m.jsxs(RQ,{className:"bg-grey-90 border border-grey-80 rounded-lg w-[895px] max-w-[95vw] p-0 gap-0 overflow-hidden","aria-describedby":void 0,children:[m.jsx(sx,{className:"sr-only",children:r("login.srTitle")}),m.jsx("button",{type:"button","aria-label":r("login.closeAriaLabel"),className:"absolute right-4 top-4 z-20 rounded-lg hover:bg-grey-80 transition-colors focus-visible:outline-none",onClick:n,children:m.jsx(yM,{variant:"desktop"})}),m.jsx(VXe,{children:m.jsx("div",{className:"flex flex-col px-8 pt-12 pb-6 h-full",children:m.jsx(LM,{showCountdown:a,children:s})})})]})})}function Itt(t,e){return t?t.otpActive?m.jsx(btt,{onVerify:t.verifyOtp,submitting:t.otpSubmitting,onBack:t.backToMethods,error:t.authError}):t.methodsMode==="abstract-only"?m.jsxs(wh,{variant:"outline",onClick:t.handlers.onAbstract,disabled:t.authBusy,className:"h-12 w-full gap-3 bg-grey-90 border-grey-70 hover:border-grey-60 hover:bg-grey-90",children:[t.authBusy?m.jsx(FJ,{}):m.jsx(JY,{}),m.jsx("span",{className:"text-white text-sm font-normal font-space-grotesk",children:t.abstractLabel})]}):m.jsx(_tt,{handlers:t.handlers,authBusy:t.authBusy,authError:t.authError,abstractLabel:t.abstractLabel,resetKey:e}):null}const Ttt=bm(rp).id,QY=t=>t.id===Ttt?[xQ]:[...t.rpcUrls.public.http],vh=t=>{const e=QY(t);return e.length>1?AQ(e.map(n=>Ii(n))):Ii(e[0])},eJ=L.createContext(null),tJ=()=>L.useContext(eJ),Ltt=({children:t})=>{const[e,n]=L.useState(),r=L.useMemo(()=>({client:e,setClient:n}),[e]);return m.jsx(eJ.Provider,{value:r,children:t})};function ktt({loginWithAgw:t,requestPrivyLogin:e,isConnecting:n,needsSiwe:r,setController:i}){const a=U2(),s=L.useRef({loginWithAgw:t,requestPrivyLogin:e,posthog:a});s.current={loginWithAgw:t,requestPrivyLogin:e,posthog:a};const o=L.useCallback(()=>{const d=cm();d&&XY(s.current.posthog,R2.signupStarted,{ref_code:d,method:"abstract"}),s.current.loginWithAgw().catch(f=>{console.error("AGW login error:",f)})},[]),c=L.useMemo(()=>({onGoogle:()=>s.current.requestPrivyLogin({method:"google"}),onApple:()=>s.current.requestPrivyLogin({method:"apple"}),onAbstract:o,onEmailContinue:d=>s.current.requestPrivyLogin({method:"email",email:d})}),[o]),l=r?"Sign to continue":"Abstract",u=L.useCallback(()=>{},[]);return L.useEffect(()=>{i({methodsMode:"full",handlers:c,authBusy:n,abstractLabel:l,authError:null,otpActive:!1,otpSubmitting:!1,verifyOtp:u,backToMethods:u})},[i,c,n,l,u]),null}const UA=Pi(t=>({synced:!1,syncedUsername:null,markSynced:e=>t({synced:!0,syncedUsername:e}),reset:()=>t({synced:!1,syncedUsername:null})})),jA=bm(rp),$tt=IQ(),or=jA,nJ=$tt,Nd=vh(jA),Ptt=3,Rtt=5e3,h3=()=>{},Ott=async()=>null,BA=L.createContext({provider:"privy",authenticated:!1,walletConnected:!1,ready:!1,isConnecting:!1,login:h3,logout:h3,address:Ls,agwAddress:Ls,client:{getTransactionCount:()=>Promise.resolve(0),sendTransaction:()=>Promise.reject("client is not initialised"),signTransaction:()=>Promise.reject("client is not initialised"),sendRawTransaction:()=>Promise.reject("client is not initialised"),signTypedData:()=>Promise.reject("client is not initialised"),signMessage:()=>Promise.reject("client is not initialised")},openLoginModal:h3,closeLoginModal:h3,isLoginModalOpen:!1,getAuthHeaders:Ott}),Mtt=()=>{const t=bN();return L.useCallback((e,n)=>{t.captureException(e,n)},[t])},po=bm(rp),Ntt=async(t,e={})=>{const n=await TQ(rp,QY(bm(rp))).waitForTransactionReceipt({hash:t,onReplaced:console.warn,pollingInterval:350,...e});if(n.status==="reverted")throw new Error("transaction reverted");return n},rJ=[{target:po.contracts.usdc2.address,selector:jc("approve(address,uint256)"),valueLimit:{limitType:za.Unlimited,limit:BigInt(5e4)*BigInt(10**po.contracts.usdc2.decimals),period:BigInt(Math.floor(60*60))},maxValuePerUse:BigInt(5e4)*BigInt(10**po.contracts.usdc2.decimals),constraints:[{condition:qg.Equal,index:0n,limit:{limitType:za.Unlimited,limit:BigInt(5e4)*BigInt(10**po.contracts.usdc2.decimals),period:BigInt(Math.floor(60*60))},refValue:M2([{type:"address"}],[po.contracts.gachaMall.address])}]},{target:po.contracts.gachaMall.address,selector:jc("purchase(uint32,address,uint256,address,uint256,bytes) external"),valueLimit:{limitType:za.Unlimited,limit:$l("30"),period:0n},maxValuePerUse:$l("30"),constraints:[]},{target:po.contracts.gachaMall.address,selector:jc("buyBack(uint256[],address,uint256,uint256,bytes) external"),valueLimit:{limitType:za.Unlimited,limit:$l("30"),period:0n},maxValuePerUse:$l("30"),constraints:[]},{target:po.contracts.gachaPvP.address,selector:jc({type:"function",name:"batchPurchase2",input
727s:[{name:"purchaseInfo",type:"tuple[]",internalType:"struct PurchaseParam[]",components:[{name:"cardAmount",type:"uint256",internalType:"uint256"},{name:"presetId",type:"uint32",internalType:"uint32"},{name:"amount",type:"uint256",internalType:"uint256"},{name:"player",type:"address",internalType:"address"},{name:"deadline",type:"uint256",internalType:"uint256"},{name:"signature",type:"bytes",internalType:"bytes"}]}],outputs:[],stateMutability:"nonpayable"}),valueLimit:{limitType:za.Unlimited,limit:$l("30"),period:0n},maxValuePerUse:$l("30"),constraints:[]}],iJ=[],Dtt=async(t,e)=>{const n={account:t.account,chain:po,session:{signer:e.address,expiresAt:BigInt(Math.floor(Date.now()/1e3)+86400),feeLimit:{limitType:za.Lifetime,limit:$l("30"),period:0n},callPolicies:rJ,transferPolicies:iJ}},{session:r,transactionHash:i}=await t.createSession(n);return{session:r,sessionSigner:e,transactionHash:i}};function Ftt(t,e){return rJ.find(n=>n.target.toLowerCase()===e.toLowerCase()&&n.selector===t)!==void 0}function Utt(t){return iJ.find(e=>e.target.toLowerCase()===t.toLowerCase())!==void 0}const jtt=()=>{const t=Mtt();return L.useCallback(async(e,n)=>{let r=5;for(;r--;)try{const i=await Dtt(e,n);if(!i.transactionHash)throw new Error("Something went wrong with session creation");return await Ntt(i.transactionHash),i}catch(i){if(i instanceof Error&&i.message.includes("Failed to initialize request"))throw _N.error("Please allow popups for pull.gacha.game and try again"),i;if(t(i),!r)throw i}throw new Error("failed to create session")},[t])},Btt=t=>Number(t.expiresAt)*1e3<new Date().getTime()+6e4,Vtt=()=>{const t=tJ(),e=jtt(),[n,r]=e2(_m.sessionCache),i=L.useCallback(async(s,o)=>{const{account:c}=s;if(n&&!Btt(n.session)&&n.account===c.address){if(t.client)return[t.client,o];const{session:l}=n,u=G7(n.signer),d=s.toSessionClient(u,l);return t.setClient(d),[d,o]}else{const l=Ine(),u=G7(l),{session:d}=await e(s,u);r({session:d,signer:l,account:c.address});const f=s.toSessionClient(u,d);return t.setClient(f),[f,o?o+1:void 0]}},[n,e,t,r]),a=L.useCallback(s=>{const o=`0x${s.data.slice(2,10)}`;return jc("approve(address,uint256)")===o?!1:!!o&&o.length>=10?Ftt(o,s.to):Utt(s.to)},[]);return{getSessionClient:i,isSupportedBySessinClient:a}},Htt=()=>{const[,t]=e2(_m.sessionCache),e=tJ();return L.useCallback(()=>{t(void 0),e.setClient(void 0),console.debug("session has been reset")},[e,t])},Wtt=()=>{const{login:t,loginAsync:e,logout:n,isConnecting:r,isReconnecting:i,account:a}=qtt(),{data:s}=S0e(),o=Htt(),c=bN(),l=a.address,u=!r&&!i&&(l!=null&&s!=null||a.status==="disconnected"),d=L.useCallback(()=>{o(),n(),c.reset(),IXe(),Ahe()},[n,o,c]);return L.useMemo(()=>l==null||s==null?{agwAddress:void 0,walletConnected:!1,login:t,loginAsync:e,logout:d,isConnecting:r,ready:u,client:void 0}:{agwAddress:l,walletConnected:!0,login:t,loginAsync:e,logout:d,isConnecting:r,ready:u,client:s},[l,s,d,r,u,t,e])},qtt=()=>{const{connect:t,connectAsync:e,connectors:n,status:r}=_ie(),{disconnect:i,status:a}=Eie(),s=LC(),o=L.useCallback(()=>{if(s.address)return;const u=n.find(d=>d.id==="xyz.abs.privy");if(!u)throw new Error("Abstract connector not found");t({connector:u})},[s.address,t,n]),c=L.useCallback(async()=>{if(s.address)return;const u=n.find(d=>d.id==="xyz.abs.privy");if(!u)throw new Error("Abstract connector not found");await e({connector:u})},[s.address,e,n]),l=L.useCallback(()=>{i()},[i]);return{account:s,login:o,loginAsync:c,isDisconnecting:a==="pending",isConnecting:r==="pending",isReconnecting:s.isReconnecting,logout:l}},ztt="https://websdk.appsflyersdk.com/manifestLoader.v1.js",Ztt="https://websdk.appsflyersdk.com",Ktt="website-pull.gacha.game";let p3;function Rct(){return p3||(p3=new Promise(t=>{window.AF_LOADER_CONFIG={baseUrl:Ztt,plugins:["pba"]},window.AppsFlyerSdkObject="AF";const e=window.AF??Object.assign((...r)=>{e.q=e.q||[],e.q.push([Date.now(),...r])},{});e.id=e.id||{pba:{webAppId:Ktt}},window.AF=e;const n=document.createElement("script");n.src=ztt,n.async=!0,n.onload=()=>t(),n.onerror=()=>{console.warn("[AppsFlyer] Web SDK loader failed to load"),t()},document.head.appendChild(n)}),p3)}function Gtt(t){window.AF?.("pba","setCustomerUserId",t)}function Xs(t,e){const n=e?.revenue!==void 0&&e.revenue>0;
727window.AF?.("pba","event",{eventType:"EVENT",eventName:t,...n?{eventRevenue:e.revenue}:{},...n&&e.currency?{eventRevenueCurrency:e.currency}:{},...e?.eventValue?{eventValue:e.eventValue}:{}})}function Oct(t){Xs("af_purchase",{revenue:t.amountUsd,currency:"USD",eventValue:{af_content_id:t.productId,af_quantity:t.quantity,af_order_id:t.txHash,af_receipt_id:t.txHash,af_customer_event_id:t.txHash}})}function Mct(t){Xs("af_spent_credits",{eventValue:{af_content_id:t.productId,af_quantity:t.quantity}})}function Nct(t){Xs("first_purchase",{revenue:t.amountUsd,currency:"USD",eventValue:{af_content_id:t.productId,af_quantity:t.quantity,af_order_id:t.txHash,af_receipt_id:t.txHash,af_customer_event_id:t.txHash}})}function Dct(t){Xs("af_complete_registration",{eventValue:{af_registration_method:t}})}function Fct(){Xs("af_login")}function Uct(t){Xs("af_initiated_checkout",{eventValue:{af_content_id:t}})}function jct(t){Xs("af_content_view",{eventValue:{af_content_id:t,af_content_type:"pack"}})}function Bct(t){Xs("wallet_funded",{eventValue:{deposit_amount_usd:t}})}function Vct(t){Xs("af_purchase",{eventValue:{af_content_id:t,af_content_type:"marketplace"}})}function Hct(t){Xs("pull_card_reveal_completed",{eventValue:{af_content_id:t}})}function aJ(t){const e=U2(),[n,r]=L.useState(()=>t==null);return L.useEffect(()=>{if(t==null){r(!0);return}r(!1);const i=t.toLowerCase(),a=()=>e.get_distinct_id?.()?.toLowerCase()===i,s=e.onFeatureFlags((o,c,l)=>{(l?.errorsLoading===!0||a())&&r(!0)});return e.identify(t,void 0,{address:t}),xhe(t),Gtt(t),e.flagsEndpointWasHit&&a()&&r(!0),()=>{s()}},[e,t]),n}const Ytt=({children:t,setLoginProvider:e,shouldOpenModal:n,setLoginModalOpen:r,pendingLogin:i,setPendingLogin:a,setLoginController:s})=>{const{loginAsync:o,logout:c,isConnecting:l,ready:u,agwAddress:d,client:f}=Wtt(),{authToken:h,authenticated:p,clearToken:g,signIn:y}=UJ(d),[v,b]=e2(jJ,null),w=v!=null&&v.expiresAt>Date.now();L.useEffect(()=>{if(!(u&&d==null&&v!=null))return;const ne=window.setTimeout(()=>{b(null)},5e3);return()=>{window.clearTimeout(ne)}},[u,d,v,b]);const{getSessionClient:_,isSupportedBySessinClient:E}=Vtt(),{mutateAsync:C}=hJ(),x=L.useRef(null),$=L.useRef(null),[T,U]=L.useState(0),O=i6(),{i18n:F}=ta();L.useEffect(()=>{U(0)},[O,F.language]),L.useEffect(()=>{if(!d||!p||!h){d||(x.current=null,$.current=null,T!==0&&U(0),UA.getState().reset());return}const ce=`${d.toLowerCase()}:${O??""}:${F.language}`;if(x.current===ce||$.current===ce||T>=Ptt)return;$.current=ce;const xe=OA();C({wallet:d,authToken:h,identityToken:null,authMethod:"agw",posthogDeviceId:CN(),userAgent:navigator.userAgent,referralCode:xe?.code,referralCapturedAt:xe?.capturedAt,locale:F.language}).then(ke=>{x.current=ce,ke&&"referralCodeResolved"in ke&&typeof ke.referralCodeResolved=="boolean"&&xY(ke.referralCodeResolved)}).catch(ke=>{console.error("Failed to sync AGW user with /api/user/me",ke),setTimeout(()=>U(Me=>Me+1),Rtt)}).finally(()=>{$.current===ce&&($.current=null)})},[d,p,h,C,T,O,F.language]);const k=L.useCallback(()=>{g(),c()},[g,c]);L.useEffect(()=>{n&&p&&r(!1)},[n,p,r]);const S=L.useRef(!1);L.useEffect(()=>{p&&(S.current=!0)},[p]);const I=u&&d!=null&&!p&&!w;L.useEffect(()=>{p||S.current&&I&&!n&&(S.current=!1,r(!0))},[p,I,n,r]);const A=L.useCallback(()=>{r(!0)},[r]),R=L.useCallback(()=>{r(!1)},[r]),N=L.useCallback(()=>{if(d&&!p){y();return}A()},[d,p,A,y]),P=L.useCallback(async()=>{if(d){await y();return}await o()},[d,o,y]);L.useEffect(()=>{i?.method!=="abstract"||!u||(a(null),P())},[i,u,P,a]);const j=L.useCallback(async ne=>{if(!f)throw new Error("wallet client is not initialised");const{skipPaymaster:ce,...xe}=ne;if(E(ne)){const[Me,$t]=await _(f,ne.nonce);return await Me.signTransaction({account:f.account,...xe,nonce:$t,maxPriorityFeePerGas:0n,chain:or})}return await f.signTransaction({account:f.account,...xe,maxPriorityFeePerGas:0n,chain:or})},[f,_,E]),M=L.useCallback(async ne=>{if(!f)throw new Error("wallet client is not initialised");return await Zt(f,gm,"sendRawTransaction")({serializedTransaction:ne})},[f]),V=L.useCallback(async ne=>{if(!f)throw new Error("wallet client is not initialised");const ce=f,xe=ce;if(!xe.signTypedData)throw new Error("Typed data signing is not supported by this wallet");return xe.signTypedData({account:ce.account,domain:OD(ne.domain),types:RD(ne.types),primaryType:ne.primaryType,message:ne.message})},[f]),B=L.useCallback(async ne=>{if(!f)throw new Error("wallet client is not initialised");return f.signMessage({message:ne})},[f]),G=L.useCallback(async ne=>{if(!f)throw new Error("wallet client is not initialised");const{skipPaymaster:ce,...xe}=ne;if(E(ne)){const[Me,$t]=await _(f,ne.nonce);return await Me.sendTransaction({account:f.account,...xe,nonce:$t,gas:ne.gas?BigInt(ne.gas):void 0,maxPriorityFeePerGas:0n,chain:or})}return await f.sendTransaction({account:f.account,...xe,gas:ne.gas?BigInt(ne.gas):void 0,maxPriorityFeePerGas:0n,chain:or})},[f,_,E]),Z=L.useCallback(async()=>
727{if(!d)throw new Error("wallet client is not initialised");const ne=ti({chain:or,transport:Nd});return await Qh(ne,{address:_t(d,or.id),blockTag:"pending"})},[d]),ie=L.useCallback(async()=>h?{"auth-token":h}:null,[h]),oe=aJ(p&&d!=null?d:null),z=I&&!n&&!S.current,J=u&&(z?!0:d==null?!w:p&&oe),K=L.useMemo(()=>({provider:"agw",authenticated:!z&&p&&d!=null,walletConnected:!z&&d!=null,ready:J,isConnecting:l,address:z?Ls:d??Ls,agwAddress:z?Ls:d??Ls,client:{signTransaction:j,sendRawTransaction:M,sendTransaction:G,getTransactionCount:Z,signTypedData:V,signMessage:B},login:N,logout:k,openLoginModal:A,closeLoginModal:R,isLoginModalOpen:n,getAuthHeaders:ie}),[d,p,ie,z,R,Z,l,N,k,A,J,M,G,B,V,n,j]);return m.jsxs(BA.Provider,{value:K,children:[t,m.jsx(ktt,{loginWithAgw:P,requestPrivyLogin:ne=>{a(ne),e("privy")},isConnecting:l,needsSiwe:d!=null&&!p,setController:s})]})};function Jtt({switchToAgw:t,pendingLogin:e,onPendingConsumed:n,ensureWalletCreated:r,onClose:i,isOpen:a,setController:s}){const[o,c]=L.useState("pick"),[l,u]=L.useState(null),[,d]=e2(_m.recentLoginMethod,null),{sendCode:f,loginWithCode:h,state:p}=lJe({onComplete:()=>{r().then(()=>i())},onError:O=>{console.error("Email login failed:",O),u("Login failed. Please refresh the page and try again.")}}),{initOAuth:g,state:y}=cJe({onComplete:()=>{r().then(()=>i())},onError:O=>{console.error("OAuth login failed:",O),u("Login failed. Please refresh the page and try again.")}}),v=p.status==="sending-code"||p.status==="submitting-code"||y.status==="loading",b=o==="otp",w=p.status==="submitting-code",_=L.useRef({sendCode:f,loginWithCode:h,initOAuth:g,storeRecentLoginMethod:d,switchToAgw:t});_.current={sendCode:f,loginWithCode:h,initOAuth:g,storeRecentLoginMethod:d,switchToAgw:t};const E=L.useCallback(async O=>{if(!um(O)){u("Please enter a valid email address.");return}try{u(null),await _.current.sendCode({email:O.trim()}),c("otp"),_.current.storeRecentLoginMethod("email")}catch(F){console.error("Failed to send email code:",F),u("Something went wrong, please refresh the page and try again.")}},[]),C=L.useCallback(O=>{_.current.initOAuth({provider:O}).then(()=>_.current.storeRecentLoginMethod(O))},[]),x=L.useCallback(O=>_.current.loginWithCode({code:O}),[]),$=L.useCallback(()=>{c("pick"),u(null)},[]),T=L.useMemo(()=>({onGoogle:()=>C("google"),onApple:()=>C("apple"),onAbstract:()=>_.current.switchToAgw(),onEmailContinue:O=>void E(O)}),[C,E]);L.useEffect(()=>{a&&(c("pick"),u(null))},[a]);const U=L.useRef(null);return L.useEffect(()=>{!e||e.method==="abstract"||U.current!==e&&(U.current=e,n(),e.method==="email"?E(e.email):C(e.method))},[e,n,E,C]),L.useEffect(()=>{s({methodsMode:"full",handlers:T,authBusy:v,abstractLabel:"Abstract",authError:l,otpActive:b,otpSubmitting:w,verifyOtp:x,backToMethods:$})},[s,T,v,l,b,w,x,$]),null}const df=t=>t.value!==void 0&&t.value>0,zs=t=>{if(typeof document>"u")return;const e=document.cookie.match(new RegExp(`(^|;\\s*)(${t})=([^;]*)`));return e?decodeURIComponent(e[3]):void 0},VA="_axwrt",$M="axwrt",Xtt=60*60*24*365,Wct=()=>{if(typeof document>"u"||typeof window>"u")return;const t=zs(VA);if(!t||zs($M)===t)return;const{hostname:e}=window.location,r=e==="localhost"||/^\d{1,3}(\.\d{1,3}){3}$/.test(e)?"":`; domain=.${e}`;document.cookie=`${$M}=${encodeURIComponent(t)}; max-age=${Xtt}; path=/${r}; SameSite=Lax`},ff=t=>typeof window>"u"?void 0:new URLSearchParams(window.location.search).get(t)||void 0,zu=t=>{if(!(typeof window>"u"||!window.localStorage))try{return window.localStorage.getItem(t)||void 0}catch{return}},qo=(t,e)=>{if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(t,e)}catch{}},Qtt="_axeid",PM="_aleid_fallback",RM="_alart_fallback",sJ=()=>{const t=ff("aleid");return t?(qo(PM,t),t):zs(Qtt)||zu(PM)},ent=()=>{const t=ff("alart");return t?(qo(RM,t),t):zu(RM)},tnt=()=>{const t=zs("_fbc");if(t)return t;const e=zu("_fbc_fallback");if(e)return e;const n=ff("fbclid");if(n){const a=`fb.1.${Date.now()}.${n}`;return qo("_fbc_fallback",a),a}},nnt=async(t=3e3,e=100)=>{const n=Date.now();for(;Date.now()-n<t;){const r=zs("_fbp");if(r)return r;await new Promise(i=>setTimeout(i,e))}return zu("_fbp_fallback")},rnt=async()=>{const t=zs("_fbp");if(t)return qo("_fbp_fallback",t),t;const e=await nnt();return e?(qo("_fbp_fallback",e),e):zu("_fbp_fallback")},int="a2_j1c4qxr4ua26",OM="_rdt_cid_fallback",hf=()=>{const t=ff("rdt_cid");return t?(qo(OM,t),t):zu(OM)},oJ=()=>zs("_rdt_uuid"),ant=(t,e)=>{if(!(typeof window>"u"||!window.rdt))try{const n=hf();window.rdt("init",int,{externalId:t,...e?{email:e}:{},...n?{clickId:n}:{}})}catch{}},qct=t=>{if(!(typeof window>"u"||!window.rdt)&&df(t))try{const e=hf(),n=Math.round(t.value/t.quantity*100)/100;window.rdt("track","Purchase",{itemCount:Number(t.quantity),value:Math.round(t.value*100)/100,conversionId:t.txHash,currency:t.currency,...t.email?{email:t.email}:{},externalId:t.walletHash,products:[{id:t.productId,category:t.productCategory,name:t.productName,quantity:Number(t.quantity),itemPrice:Number(n)}],...e?{clickId:e}:{}})}catch{}},zct=t=>{if(!(typeof window>"u"||!window.rdt)&&df(t))try{const e=hf(),n=Math.round(t.value/t.quantity*100)/100;window.rdt("track","Custom",{customEventName:"FirstPurchase",itemCount:Number(t.quantity),value:Math.round(t.value*100)/100,conversionId:`${t.txHash}_first`,currency:t.currency,...t.email?{email:t.email}:{},externalId:t.walletHash,products:[{id:t.productId,category:t.productCategory,name:t.productName,quantity:Number(t.quantity),itemPrice:Number(n)}],...e?{clickId:e}:{}})}catch{}},snt=t=>[t],Zct=async t=>{const{txHash:e,productId:n,productName:r,productCategory:i,value:a,currency:s="USD",wallet:o,email:c,method:l,quantity:u=1}=t,d=o.trim().toLowerCase(),f=await ip(d),h=c?await ip(c):void 0,p=await rnt(),g=tnt();return{txHash:e,eventId:e,eventName:"Purchase",productId:n,productName:r,productCategory:i,value:a,currency:s,wallet:d,walletHash:f,email:c,emailHash:h,method:l,quantity:u,pageUrl:typeof window<"u"?window.location.href:"",fbp:p,fbc:g,clientUserAgent:typeof navigator<"u"?navigator.userAgent:void 0,rdtUuid:oJ(),rdtClickId:hf(),aleid:sJ(),alart:ent(),axwrt:zs(VA),timestamp:Math.floor(Date.now()/1e3)}},Kct=(t,e)=>{if(!(typeof window>"u"||!window.dataLayer)&&df(e))try{const n=snt(e.walletHash),r=Math.round(e.value/e.quantity*100)/100,i=[{item_id:e.productId,item_name:e.productName,item_category:e.productCategory,price:Number(r),quantity:Number(e.quantity)}];
727t==="purchase"&&window.gtag&&window.gtag("event","conversion",{send_to:"AW-18175486153/SBmrCMmaurAcEMnR39pD",value:e.value,currency:e.currency,transaction_id:e.txHash});const a=hf(),s=oJ(),o=t==="first_purchase"?`${e.txHash}_first`:e.txHash;window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:t,event_name:e.eventName,transaction_id:e.txHash,conversion_id:o,reddit_uuid:s,rdt_click_id:a,applovin_click_id:e.aleid,applovin_alart:e.alart,applovin_visitor_id:e.axwrt,event_id:e.eventId,tx_hash:e.txHash,product_id:e.productId,name:e.productName,category:e.productCategory,quantity:Number(e.quantity),value:Number(e.value),currency:e.currency,wallet:e.wallet,email:e.email,email_hash:e.emailHash,method:e.method,user_data:{external_id:n,em:e.emailHash},reddit_user_data:{external_id:e.walletHash,email:e.emailHash,uuid:s,click_id:a},ecommerce:{transaction_id:e.txHash,value:Number(e.value),currency:e.currency,items:i},items:i})}catch(n){console.error(`Failed to send ${t} event to dataLayer:`,n)}},o6="2526075094582286",Gct=()=>{if(!(typeof window>"u"||!window.fbq))try{window.fbq("track","PageView")}catch{}},Yct=t=>{if(!(typeof window>"u"||!window.fbq))try{window.fbq("trackSingle",o6,"ViewContent",{content_ids:[t.productId],content_type:"product",content_name:t.productName,currency:t.currency??"USD",...t.price!==void 0?{value:t.price}:{}})}catch{}},Jct=t=>{if(!(typeof window>"u"||!window.fbq))try{const e=t.quantity??1;window.fbq("trackSingle",o6,"InitiateCheckout",{content_ids:[t.productId],content_type:"product",content_name:t.productName,currency:t.currency??"USD",num_items:e,value:Math.round(t.price*e*100)/100})}catch{}},Xct=t=>{if(!(typeof window>"u"||!window.fbq))try{window.fbq("trackSingle",o6,"CompleteRegistration",{...t.method?{registration_method:t.method}:{}})}catch{}},Qct=t=>{if(!(typeof window>"u"||!window.fbq)&&df(t))try{window.fbq("trackSingle",o6,"Purchase",{content_ids:[t.productId],content_type:"product",content_name:t.productName,currency:t.currency,num_items:Number(t.quantity),value:t.value},{eventID:t.eventId})}catch{}},elt=()=>{if(!(typeof window>"u"))try{const t=ff("fbclid");if(t){const i=`fb.1.${Date.now()}.${t}`;qo("_fbc_fallback",i)}const e=()=>{const n=zs("_fbp");n&&qo("_fbp_fallback",n)};if(e(),window.fbq)setTimeout(e,500);else{const n=setInterval(()=>{window.fbq&&(clearInterval(n),setTimeout(e,500))},100);setTimeout(()=>clearInterval(n),1e4)}}catch(t){console.debug("Failed to initialize Facebook tracking:",t)}},tlt=()=>{typeof window>"u"||hf()},MM="_ttclid_fallback",ont=()=>{const t=ff("ttclid");return t?(qo(MM,t),t):zu(MM)},nlt=()=>{typeof window>"u"||ont()},cnt=async(t,e)=>{if(!(typeof window>"u"||!window.ttq))try{const n=await ip(t.trim().toLowerCase()).catch(()=>{});window.ttq.identify({...e?{email:e}:{},...n?{external_id:n}:{}})}catch{}},rlt=t=>{if(!(typeof window>"u"||!window.ttq)&&df(t))try{window.ttq.track("Purchase",{value:Number(t.value),currency:t.currency,content_type:"product",contents:[{content_id:t.productId,content_name:t.productName,price:Number(t.value/t.quantity),quantity:Number(t.quantity)}]},{event_id:t.eventId})}catch{}},lnt=1247,J0=t=>({item_id:t.productId,...t.productName?{item_name:t.productName}:{},item_category_id:lnt,...t.price!==void 0?{price:t.price}:{},...t.quantity!==void 0?{quantity:t.quantity}:{},...t.imageUrl?{image_url:t.imageUrl}:{}}),ilt=()=>{if(!(typeof window>"u"||!window.axon))try{window.axon("track","page_view")}catch{}},alt=t=>{if(!(typeof window>"u"||!window.axon))try{window.axon("track","view_item",{items:[J0({productId:t.productId,productName:t.productName,price:t.price,imageUrl:t.imageUrl})],currency:t.currency??"USD",...t.price!==void 0?{value:t.price}:{}})}catch{}},slt=t=>{if(!(typeof window>"u"||!window.axon))try{const e=t.quantity??1;window.axon("track","add_to_cart",{currency:t.currency??"USD",items:[J0({productId:t.productId,productName:t.productName,price:t.price,quantity:e,imageUrl:t.imageUrl})],value:Math.round(t.price*e*100)/100})}catch{}},olt=t=>{if(!(typeof window>"u"||!window.axon))try{const e=t.quantity??1;window.axon("track","begin_checkout",{currency:t.currency??"USD",items:[J0({productId:t.productId,productName:t.productName,price:t.price,quantity:e,imageUrl:t.imageUrl})],value:Math.round(t.price*e*100)/100})}catch{}},clt=t=>{if(!(typeof window>"u"||!window.axon))try{window.axon("track","login",{...t?{user_data:{user_id:t}}:{}})}catch{}},llt=t=>
727{if(!(typeof window>"u"||!window.axon))try{const e=sJ(),n=zs(VA),r={...t.userId?{user_id:t.userId}:{},...e?{aleid:e}:{},...n?{axwrt:n}:{}};window.axon("track","sign_up",{method:t.method,...Object.keys(r).length>0?{user_data:r}:{}})}catch{}},ult=t=>{if(!(typeof window>"u"||!window.axon))try{const e=t.quantity??1;window.axon("track","add_payment_info",{currency:t.currency??"USD",payment_type:"wallet",items:[J0({productId:t.productId,productName:t.productName,price:t.price,quantity:e})],value:Math.round(t.price*e*100)/100})}catch{}},dlt=t=>{if(!(typeof window>"u"||!window.axon)&&df(t)&&!(!t.aleid&&!t.axwrt))try{const e=Math.round(t.value/t.quantity*100)/100,n=t.email?.trim().toLowerCase()||`${t.wallet}@gacha.game`;window.axon("track","purchase",{currency:t.currency,items:[J0({productId:t.productId,productName:t.productName,price:e,quantity:t.quantity})],shipping:0,tax:0,transaction_id:t.txHash,value:Number(t.value),user_data:{email:n,user_id:t.wallet,...t.aleid?{aleid:t.aleid}:{},...t.axwrt?{axwrt:t.axwrt}:{}}})}catch{}},b7=new Set,unt=3,dnt=5e3,_7=()=>{if(!(typeof window>"u")){window.localStorage.removeItem("privy:connections");for(let t=window.localStorage.length-1;t>=0;t-=1){const e=window.localStorage.key(t);e?.startsWith("privy:sent:")&&window.localStorage.removeItem(e)}}},fnt=()=>{const{ready:t,authenticated:e,logout:n,getAccessToken:r,user:i}=YS(),{ready:a,wallets:s}=KS(),{identityToken:o}=Cje(),{mutateAsync:c}=hJ(),l=i6(),{i18n:u}=ta(),[d,f]=L.useState(null),h=U2(),p=IN(i?.linkedAccounts),g=L.useMemo(()=>see(i?.linkedAccounts,s),[i?.linkedAccounts,s]),y=s.filter(Cg).map(I=>I.address).join(","),v=L.useMemo(()=>s.filter(I=>!Cg(I)),[s]),b=a||y!=="",w=t&&b,_=L.useCallback(()=>{UA.getState().reset(),n().finally(_7)},[n]);L.useEffect(()=>{t&&!e&&_7()},[t,e]);const E=v.length>0,C=g?.address;L.useEffect(()=>{!w||!E||_7()},[E,w]);const x=e?g:void 0,$=x?.address,T=$?`${$}:${l??""}:${u.language}`:void 0,U=d!==null&&d.key===T?d.count:0,O=i?.email?.address||i?.google?.email||i?.apple?.email||void 0,F=aJ(w&&$?$:null),k=t?e?!b||!$||o==null||!F?"identifying":"authenticated":"guest":"hydrating",S=k==="guest"||k==="authenticated";return L.useEffect(()=>{if(k!=="identifying"||!b||C)return;const I=setTimeout(()=>{p&&h?.capture("privy_canonical_wallet_unavailable",{canonicalWallet:p,connectedEmbeddedWallets:y}),_()},1e4);return()=>clearTimeout(I)},[k,b,C,p,y,h,_]),L.useEffect(()=>{},[$,t,o,v,e,S,w,k,s,a]),L.useEffect(()=>{if(!w||!$||!o||!T||U>=unt||b7.has(T))return;b7.add(T),(async()=>{try{const A=await r();if(!A)throw new Error("Failed to update user with wallet address: no privy access token");const R=OA(),N=await c({wallet:$,authToken:A,identityToken:o,authMethod:"privy",posthogDeviceId:CN(),userAgent:navigator.userAgent,referralCode:R?.code,referralCapturedAt:R?.capturedAt,locale:u.language});N&&"referralCodeResolved"in N&&typeof N.referralCodeResolved=="boolean"&&xY(N.referralCodeResolved)}catch(A){if(A instanceof Error&&A.status===409)_N.error("This email is already linked to another account. Please sign in with a different method."),_();else{console.error("Failed to update user with wallet address:",A);const R=A instanceof Error?A.status:void 0;(R===void 0||R>=500)&&setTimeout(()=>f(N=>({key:T,count:N?.key===T?N.count+1:1})),dnt)}}finally{b7.delete(T)}})()},[w,$,r,c,o,_,U,T,u.language]),L.useEffect(()=>{if(!w||!$)return;(async()=>{const A=$.toLowerCase(),[R,N]=await Promise.all([ip(A).catch(()=>{}),O?ip(O).catch(()=>{}):Promise.resolve(void 0)]);R&&ant(R,N),cnt($,O??void 0)})()},[w,$,O]),L.useMemo(()=>({ready:S,sdkReady:w,logout:_,ewAddress:$,wallet:x,getAccessToken:r,identityToken:o,email:O}),[S,w,_,$,x,r,o,O])},hnt="iframe not initialized",pnt=12,gnt=250,ynt=t=>t instanceof Error&&t.message.includes(hnt),g3=async(t,e)=>{const n=pnt,r=gnt;let i;for(let a=0;a<=n;a+=1)try{const s=await t();return a>0&&console.debug(`[signer] embedded-wallet signer ready after ${a} retr${a===1?"y":"ies"}`),s}catch(s){if(!ynt(s))throw s;i=s,a<n&&await new Promise(o=>setTimeout(o,r))}throw i},mnt=({children:t,setLoginProvider:e,shouldOpenModal:n,setLoginModalOpen:r,pendingLogin:i,setPendingLogin:a,setLoginController:s})=>{const{ewAddress:o,wallet:c,ready:l,sdkReady:u,logout:d,getAccessToken:f,identityToken:h,email:p}=fnt(),{createWallet:g}=hK(),{signTransaction:y}=dJe(),{sendTransaction:v}=hXe(),{signTypedData:b}=gXe(),{signMessage:w}=pXe(),_=L.useCallback((...B)=>g3(()=>y(...B)),[y]),E=L.useCallback((...B)=>g3(()=>v(...B)),[v]),C=L.useCallback((...B)=>g3(()=>b(...B)),[b]),x=L.useCallback((...B)=>g3(()=>w(...B)),[w]),$=Tnt(),T=L.useRef($);T.current=$,L.useEffect(()=>BJ(()=>{d(),r(!0)}),[d,r]);const U=L.useCallback(async B=>{if(!o||B.skipPaymaster)return null;const G=ti({chain:or,transport:Nd}),[Z,ie]=await Promise.all([B.gas!=null?BigInt(B.gas):G.estimateGas({account:_t(o),to:_t(B.to),data:B.data,...B.value!=null?{value:B.value}:{}}),B.maxFeePerGas!=null?BigInt(B.maxFeePerGas):G.getGasPrice()]),oe=Z*ie,z=await T.current.mutateAsync({wallet:o,to:B.to,data:B.data}),J=_t(z.paymasterAddress),K=await G.getBalance({address:J});return K<oe?(console.log({message:"paymaster balance insufficient",paymasterAddress:J,paymasterBalance:K,gasCost:oe}),null):{paymasterAddress:z.paymasterAddress,paymasterData:z.paymasterData}},[o]),O=L.useCallback(async B=>{if(!o)throw new Error("wallet is not initialised");const G=ti({chain:or,transport:Nd}),[Z,ie,oe]=await Promise.all([B.gas!=null?BigInt(B.gas):G.estimateGas({account:_t(o),to:_t(B.to),data:B.data}),B.maxFeePerGas!=null?BigInt(B.maxFeePerGas):G.getGasPrice(),B.nonce??Qh(G,{address:_t(o),blockTag:"pending"})]),z={type:"eip712",to:_t(B.to),from:_t(o),data:B.data,value:B.value??0n,gas:Z,maxFeePerGas:ie,maxPriorityFeePerGas:0n,nonce:oe,chainId:or.id,paymaster:_t(B.paymaster),paymasterInput:B.paymasterInput},J=jA.custom?.getEip712Domain?.(z);if(!J)throw new Error("Chain does not support EIP-712 transactions");const{signature:K}
727=await C({domain:{name:J.domain.name,version:J.domain.version,chainId:typeof J.domain.chainId=="bigint"?Number(J.domain.chainId):J.domain.chainId,verifyingContract:J.domain.verifyingContract},types:J.types,primaryType:J.primaryType,message:J.message},{address:o});return LQ({...z,customSignature:K})},[o,C]),F=L.useCallback(()=>{r(!0)},[r]),k=L.useCallback(()=>{r(!1)},[r]),S=L.useCallback(async()=>g({createAdditional:!1}).catch(B=>{B instanceof Error&&B.message.includes("already has an embedded wallet")||console.error("[auth] failed to create a wallet for the new user:",B)}),[g]),I=L.useCallback(async B=>{if(!o)throw new Error("wallet client is not initialised");const G=await U(B);if(G)return O({to:B.to,data:B.data,value:B.value,gas:B.gas,maxFeePerGas:B.maxFeePerGas,nonce:B.nonce,paymaster:G.paymasterAddress,paymasterInput:G.paymasterData});const{skipPaymaster:Z,...ie}=B;return(await _({...ie,chainId:or.id,maxPriorityFeePerGas:0n},{address:o})).signature},[o,_,U,O]),A=L.useCallback(async B=>{const G=ti({chain:or,transport:Nd});return await gm(G,{serializedTransaction:B})},[]),R=L.useCallback(async()=>{if(!c)throw new Error("wallet client is not initialised");const B=ti({chain:or,transport:Nd});return await Qh(B,{address:_t(c.address,or.id),blockTag:"pending"})},[c]),N=L.useCallback(async B=>{if(!o)throw new Error("wallet client is not initialised");const{signature:G}=await C({domain:OD(B.domain),types:RD(B.types),primaryType:B.primaryType,message:B.message},{address:o});return G},[o,C]),P=L.useCallback(async B=>{if(!o)throw new Error("wallet client is not initialised");const{signature:G}=await x({message:B},{address:o});return G},[o,x]),j=L.useCallback(async B=>{if(!o)throw new Error("wallet client is not initialised");const G=await U(B);if(G){const z=await O({to:B.to,data:B.data,value:B.value,gas:B.gas,maxFeePerGas:B.maxFeePerGas,nonce:B.nonce,paymaster:G.paymasterAddress,paymasterInput:G.paymasterData});return A(z)}const{skipPaymaster:Z,...ie}=B;return(await E({...ie,chainId:or.id,maxPriorityFeePerGas:0n},{address:o})).hash},[o,E,U,A,O]),M=L.useCallback(async()=>{const B=await f();return!B||!h?null:{"auth-token":B,"id-token":h}},[h,f]),V=L.useMemo(()=>({provider:"privy",authenticated:u&&o!=null&&h!=null,walletConnected:u&&o!=null,ready:l,address:o??Ls,agwAddress:o??Ls,client:{signTransaction:I,sendRawTransaction:A,sendTransaction:j,getTransactionCount:R,signTypedData:N,signMessage:P},login:F,logout:d,isConnecting:!1,openLoginModal:F,closeLoginModal:k,isLoginModalOpen:n,getAuthHeaders:M,email:p}),[o,k,p,R,M,h,d,F,l,u,A,j,P,N,n,I]);return m.jsxs(BA.Provider,{value:V,children:[t,m.jsx(Jtt,{switchToAgw:()=>{a({method:"abstract"}),e("agw")},pendingLogin:i,onPendingConsumed:()=>a(null),ensureWalletCreated:S,onClose:k,isOpen:n,setController:s})]})},flt=({children:t,queryClient:e})=>{const[n]=e2("wagmi.recentConnectorId",null),r=n==="xyz.abs.privy",[i]=e2(_m.recentLoginMethod,null),[a,s]=L.useState(i==="agw"||r&&i===null?"agw":"privy"),[o,c]=L.useState(!1),[l,u]=L.useState(null),[d,f]=L.useState(null),h=a==="agw";return m.jsxs(S7,{client:e,children:[h?m.jsx(_0e,{chain:or,transport:Nd,queryClient:e,children:m.jsx(Ltt,{children:m.jsx(Ytt,{shouldOpenModal:o,setLoginProvider:s,setLoginModalOpen:c,pendingLogin:l,setPendingLogin:u,setLoginController:f,children:t})})}
727):m.jsx(oJe,{appId:tx.appId,clientId:tx.clientId,config:{appearance:{theme:"dark"},defaultChain:or,supportedChains:[or,nJ],loginMethods:["email","google","apple"],externalWallets:{disableAllExternalWallets:!0,walletConnect:{enabled:!1}},embeddedWallets:{ethereum:{createOnLogin:"off"},solana:{createOnLogin:"off"}}},children:m.jsx(S7,{client:e,children:m.jsx(bXe,{config:vnt,children:m.jsx(mnt,{setLoginProvider:s,shouldOpenModal:o,setLoginModalOpen:c,pendingLogin:l,setPendingLogin:u,setLoginController:f,children:t})})})}),m.jsx(xtt,{controller:d,isOpen:o,onClose:()=>c(!1)})]})},vnt=_Xe({chains:[or,nJ],transports:{[nx.id]:vh(nx),[rx.id]:vh(rx),[ix.id]:vh(ix),[ax.id]:vh(ax)}}),Ht=()=>{const t=L.useContext(BA);if(!t)throw new Error("wallet client must be used within AuthProvider");return t};async function c6(t){if(t.status!==412)return;const e=await t.json(),n=new Error("3DS challenge required");throw n.status=412,n.challenge=e.challenge,n}function hlt(){return{colorDepth:window.screen.colorDepth,screenHeight:window.screen.height,screenWidth:window.screen.width,timeZone:new Date().getTimezoneOffset()}}const wnt=2e3,NM=100,G_="x-device-id";let DM=!1;async function bnt(t){const e=r=>!!r[G_]||DM,n=t();return e(n)?n:new Promise(r=>{const i=Date.now(),a=()=>{const s=t();if(e(s))return r(s);if(Date.now()-i>=wnt)return DM=!0,r(s);window.setTimeout(a,NM)};window.setTimeout(a,NM)})}async function Qo(){try{const{getCoinflowProtectionHeaders:t}=await Ne(async()=>{const{getCoinflowProtectionHeaders:r}=await import("./index-B6aUbwA1.js");return{getCoinflowProtectionHeaders:r}},__vite__mapDeps([198,199,2,200,1,3,201,4,5,6,7])),n=(await bnt(t))[G_];return n?{[G_]:n}:{}}catch(t){return kQ.captureException(t,{flow:"purchase",step:"coinflow_protection_headers"}),{}}}const plt=async(t,e)=>{const n=await e().catch(()=>null);n&&await bt.api.txs["deposit-source"].$post({json:{txHash:t}},{headers:n}).catch(r=>{console.error("Failed to report deposit client source:",r)})};class cJ extends Error{status;hasUserFacingMessage;refusal;constructor(e,n,r,i=null){super(e),this.name="DepositQuoteError",this.status=n,this.hasUserFacingMessage=r,this.refusal=i}}const C7=(t,e)=>{const n=t[e];return typeof n=="string"&&n.length>0?n:null},lJ=async t=>{if(t.status!==400)return null;const e=await t.json().catch(()=>null);if(e==null||typeof e!="object"||!("error"in e))return null;const n=e.error;if(n==null||typeof n!="object")return null;const r=C7(n,"message");return r?{message:r,code:C7(n,"code"),maxAmountUsd:C7(n,"maxAmountUsd")}:null},glt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("not authenticated");const r=await bt.api.deposits.eoa.$post({json:{params:e.params}},{headers:n});if(!r.ok){const i=await lJ(r);throw new cJ(i?.message??"Failed to retrieve deposit address",r.status,i!=null,i)}return r.json()}})},ylt=(t,e={})=>{const{getAuthHeaders:n}=Ht();return Bt({...e,queryKey:["deposits","relay",t,"status"],queryFn:async()=>{if(!t)throw new Error("[depositRelayStatus] Request id required");const r=await n();if(!r)throw new Error("not authenticated");const i=await bt.api.deposits.relay[":requestId"].status.$get({param:{requestId:t},query:{}},{headers:r});if(!i.ok)throw new Error("Failed to retrieve relay deposit status");return(await i.json()).data},enabled:e.enabled!==!1&&!!t})},mlt=(t,e={})=>{const{getAuthHeaders:n}=Ht();return Bt({...e,queryKey:["deposits","relay-address",t,"status"],queryFn:async()=>{if(!t)throw new Error("[depositRelayAddressStatus] Deposit address required");const r=await n();if(!r)throw new Error("not authenticated");const i=await bt.api.deposits["relay-address"].status.$get({query:{depositAddress:t}},{headers:r});if(!i.ok)throw new Error("Failed to retrieve relay deposit status");return(await i.json()).data},enabled:e.enabled!==!1&&!!t})},vlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("not authenticated");const r=await bt.api.deposits["relay-address"].reindex.$post({json:e},{headers:n});if(!r.ok){const i=await r.text().catch(()=>"");throw new Error(i||"Failed to reindex relay deposit address")}return(await r.json()).data}})},wlt=(t,e={})=>Bt({...e,queryKey:["deposits","eoa",t,"status"],queryFn:async()=>
727{if(!t)throw new Error("[depositEoaStatus] Wallet address required");const n=await bt.api.deposits.eoa[":walletAddress"].status.$get({param:{walletAddress:t}});if(!n.ok)throw new Error("Failed to retrieve deposit addresses");return(await n.json()).data},enabled:e.enabled!==!1&&!!t}),blt=(t={})=>Bt({queryKey:["deposits","supported-assets"],queryFn:async()=>{const e=await bt.api.deposits["supported-assets"].$get();if(!e.ok)throw new Error("Failed to fetch supported deposit assets");return e.json()},staleTime:4*60*60*1e3,enabled:t.enabled}),vl=bt.api["fiat-checkout"],Zu=bt.api["fiat-deposit"];class _nt extends Error{constructor(e,n){super("A card checkout authorization is already active"),this.retryAt=e,this.retryAfterMs=n,this.name="CardModifierAuthorizationActiveError"}status=409}class Cnt extends Error{status=409;constructor(){super("The checkout reservation was released before it could be authorized"),this.name="CardModifierReservationLostError"}}const _lt=(t={})=>{const{getAuthHeaders:e}=Ht();return it({...t,mutationFn:async n=>{const r=await e();if(!r)throw new Error("user is not authenticated");return Ent({productId:n.productId,quantity:n.quantity,campaignId:n.campaignId,discountCode:n.discountCode,checkoutSessionKey:n.checkoutSessionKey,headers:r})}})},Ent=async t=>{const e=await bt.api["fiat-checkout"].tokens.$post({json:{productId:t.productId,quantity:t.quantity??1,...t.campaignId?{campaignId:t.campaignId}:{},...t.discountCode?{discountCode:t.discountCode}:{},...t.checkoutSessionKey?{checkoutSessionKey:t.checkoutSessionKey}:{}}},{headers:t.headers});if(!e.ok){const r=await e.json().catch(()=>null);if(e.status===409&&typeof r=="object"&&r!==null&&"code"in r&&r.code==="CARD_MODIFIER_AUTHORIZATION_ACTIVE"&&"retryAt"in r&&typeof r.retryAt=="string"){const a="retryAfterMs"in r&&typeof r.retryAfterMs=="number"?r.retryAfterMs:Math.max(Date.parse(r.retryAt)-Date.now(),0);throw new _nt(r.retryAt,a)}if(e.status===409&&typeof r=="object"&&r!==null&&"code"in r&&r.code==="CARD_MODIFIER_RESERVATION_LOST")throw new Cnt;const i=new Error("Failed to process credit card payment");throw i.status=e.status,i}return(await e.json()).data},Clt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r=await bt.api["fiat-checkout"]["cancel-claim"].$post({json:{...e.campaignId?{campaignId:e.campaignId}:{},...e.releaseDiscount?{releaseDiscount:!0}:{},...e.checkoutSessionKey?{checkoutSessionKey:e.checkoutSessionKey}:{},...e.productId?{productId:e.productId}:{}}},{headers:n});if(!r.ok)throw new Error(await qn(r,"Failed to cancel campaign claim"));return r.json()}})},Snt=async t=>{const e=await bt.api["fiat-checkout"]["cross-chain-call"][":requestId"].status.$get({param:{requestId:t.requestId}},{headers:t.headers});if(!e.ok)throw new Error(await qn(e,"Failed to fetch payment status"));return(await e.json()).data},Elt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");return Snt({requestId:e.requestId,headers:n})}})},Slt=(t={})=>{const{getAuthHeaders:e}=Ht();return it({...t,mutationFn:async n=>{const r=await e();if(!r)throw new Error("user is not authenticated");return Ant({amountUsd:n.amountUsd,headers:r})}})},Ant=async t=>{const e=await bt.api["fiat-deposit"].tokens.$post({json:{amountUsd:t.amountUsd}},{headers:t.headers});if(!e.ok){const r=await lJ(e.clone());if(r)throw new cJ(r.message,e.status,!0,r);const i=await qn(e,"Failed to process credit card deposit");throw new Error(i)}return(await e.json()).data},xnt=async t=>{const e=await bt.api["fiat-deposit"]["cross-chain-call"][":requestId"].status.$get({param:{requestId:t.requestId}},{headers:t.headers});if(!e.ok)throw new Error(await qn(e,"Failed to fetch deposit status"));return(await e.json()).data},Alt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");return xnt({requestId:e.requestId,headers:n})}})},xlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r=await vl["saved-card"][":token"].$delete({param:{token:e.token}},{headers:n});if(!r.ok)throw new Error(await qn(r,"Failed to remove card"));return r.json()}})},Ilt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const{requestId:r,checkoutJwtToken:i,subtotalCents:a,transactionData:s,productName:o,...c}=e,l={...n,...await Qo()},u=await vl.charge.card.$post({json:{requestId:r,...i!==void 0&&{checkoutJwtToken:i},subtotalCents:a,currency:"USD",transactionData:s,...o!==void 0&&{productName:o},...c}},{headers:l});return await c6(u),await cl(u,"Card payment failed"),u.json()}})},Tlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r={...n,...await Qo()},i=await vl.charge["google-pay"].$post({json:{requestId:e.requestId,checkoutJwtToken:e.checkoutJwtToken,subtotalCents:e.subtotalCents,currency:"USD",transactionData:e.transactionData,...e.productName!==void 0&&{productName:e.productName},googlePayToken:e.googlePayToken,authentication3DS:e.authentication3DS}},{headers:r});return await dC(i,"Failed to charge Google Pay"),i.json()}})},Llt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r={...n,...await Qo()},i=await vl.charge["saved-card"].$post({json:{requestId:e.requestId,...e.checkoutJwtToken!==void 0&&{checkoutJwtToken:e.checkoutJwtToken},subtotalCents:e.subtotalCents,currency:"USD",transactionData:e.transactionData,...e.productName!==void 0&&{productName:e.productName},token:e.token,authentication3DS:e.authentication3DS}},{headers:r});return await c6(i),await cl(i,"Failed to charge saved card"),i.json()}})},klt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r=await vl.charge.card.complete.$post({json:e},{headers:n});return await cl(r,"Card payment failed"),r.json()}})},$lt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r=await vl.charge["saved-card"].complete.$post({json:e},{headers:n});return await cl(r,"Failed to charge saved card"),r.json()}})},Int=async t=>{const e=await bt.api["fiat-checkout"]["cross-chain-call"][":requestId"].declined.$post({param:{requestId:t.requestId},json:{code:t.code,message:t.message}},{headers:t.headers});if(!e.ok)throw new Error(await qn(e,"Failed to record purchase decline"));return(await e.json()).data},Plt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");return Int({...e,headers:n})}})},Rlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async()=>{const e=await t();if(!e)throw new Error("user is not authenticated");const n=await vl["apple-pay"]["validate-merchant"].$post({},{headers:e});if(!n.ok)throw new Error(await qn(n,"Failed to validate Apple Pay merchant"));return n.json()}})},Olt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async()=>{const e=await t();if(!e)throw new Error("user is not authenticated");const n=await Zu["apple-pay"]["validate-merchant"].$post({},{headers:e});if(!n.ok)throw new Error(await qn(n,"Failed to validate Apple Pay deposit merchant"));return n.json()}})},Mlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r={...n,...await Qo()},i=await vl.charge["apple-pay"].$post({json:{requestId:e.requestId,subtotalCents:e.subtotalCents,currency:"USD",transactionData:e.transactionData,...e.productName!==void 0&&{productName:e.productName},applePayPayment:{token:e.applePayToken,billingContact:e.billingContact,shippingContact:e.shippingContact}}},{headers:r});return await dC(i,"Failed to charge Apple Pay"),i.json()}})},Nlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r={...n,...await Qo()},i=await Zu.charge["apple-pay"].$post({json:{requestId:e.requestId,subtotalCents:e.subtotalCents,currency:"USD",applePayPayment:{token:e.applePayToken,billingContact:e.billingContact,shippingContact:e.shippingContact}}},{headers:r});return await dC(i,"Failed to charge Apple Pay deposit"),i.json()}})},Dlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r={...n,...await Qo()},i=await Zu.charge["google-pay"].$post({json:{requestId:e.requestId,checkoutJwtToken:e.checkoutJwtToken,subtotalCents:e.subtotalCents,currency:"USD",googlePayToken:e.googlePayToken}},{headers:r});if(!i.ok)throw new Error(await qn(i,"Failed to charge Google Pay deposit"));return i.json()}})},Flt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r={...n,...await Qo()},i=await Zu.charge["saved-card"].$post({json:{requestId:e.requestId,subtotalCents:e.subtotalCents,currency:"USD",token:e.token,authentication3DS:e.authentication3DS}},{headers:r});return await c6(i),await cl(i,"Failed to charge saved card deposit"),i.json()}})},Ult=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const{requestId:r,checkoutJwtToken:i,subtotalCents:a,...s}=e,o={...n,...await Qo()},c=await Zu.charge.card.$post({json:{requestId:r,checkoutJwtToken:i,subtotalCents:a,currency:"USD",...s}},{headers:o});return await c6(c),await cl(c,"Deposit card payment failed"),c.json()}})},jlt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r=await Zu.charge["saved-card"].complete.$post({json:e},{headers:n});return await cl(r,"Failed to charge saved card deposit"),r.json()}})},Blt=()=>{const{getAuthHeaders:t}=Ht();return it({mutationFn:async e=>{const n=await t();if(!n)throw new Error("user is not authenticated");const r={...n,...await Qo()},i=await Zu.charge.card.complete.$post({json:e},{headers:r});return await cl(i,"Deposit card payment failed"),i.json()}})},Tnt=()=>it({mutationFn:async({wallet:t,to:e,data:n})=>{const r=await bt.api.txs.paymaster.$get({query:{wallet:t,to:e,data:n}});if(!r.ok){const i=await r.text().catch(()=>"");throw new Error(`Failed to fetch paymaster info: ${r.status}${i?` - ${i}`:""}`)}return r.json()}}),Lnt=t=>["products",t],knt=1e3*60*5,$nt="anon",Pnt=(t,e)=>t&&e?e.toLowerCase():$nt,Rnt=async t=>{const e=await t?.()??void 0,n=await bt.api.products.$get(void 0,{headers:e});if(!n.ok){const r=await qn(n,"Failed to fetch products from API");throw new Error(r)}return n.json()},Vlt=()=>{const{getAuthHeaders:t,address:e,authenticated:n}=Ht(),r=Pnt(n,e),i=n?t:void 0;return Bt({queryKey:Lnt(r),queryFn:()=>Rnt(i),placeholderData:a=>a,staleTime:knt})},Hlt=t=>
727Bt({queryKey:["product-inventory-spotlights",t],queryFn:async()=>{if(!t)throw new Error("Product ID is required");const e=await bt.api["product-inventory-spotlights"][":productId"].$get({param:{productId:t}});if(!e.ok)throw new Error("Failed to fetch product inventory spotlights");return e.json()},enabled:!!t}),FM=20,Wlt=(t,e)=>Bt({queryKey:["admin-spotlight-cards","authed",t.band??"valid",t.productId??"",t.search??"",t.tier??"all",t.page??1,t.pageSize??FM],queryFn:async()=>{if(!t.adminHeaders)throw new Error("Admin password is required");const n={tier:t.tier??"all",page:String(t.page??1),pageSize:String(t.pageSize??FM),band:t.band??"valid"};t.productId&&(n.productId=t.productId),t.search&&(n.search=t.search);const r=await xn(In["product-inventory-spotlights"].cards.$get,{query:n},{headers:t.adminHeaders});if(!r.ok){const i=await qn(r,"Failed to fetch spotlight cards");throw new Error(i)}return r.json()},enabled:e?.enabled??!!t.adminHeaders,staleTime:0,placeholderData:n=>n}),Dl="user-1",Ont="/default-avatar.png",Mnt=[{name:"Pikachu with Grey Felt Hat #85",rarity:"Mythical",collection:"pokemon",image:Ir,fmv:935},{name:"KLEAVOR VSTAR #249",rarity:"Rare",collection:"pokemon",image:Ir,fmv:150},{name:"SQUIRTLE #170",rarity:"Rare",collection:"pokemon",image:Ir,fmv:85},{name:"FA/GARDENIA'S VIGOR #GG61",rarity:"Rare",collection:"pokemon",image:Ir,fmv:86},{name:"PONCHO-WEARING EEVEE #138",rarity:"Legendary",collection:"pokemon",image:Ir,fmv:821},{name:"MEW ex #232",rarity:"Mythical",collection:"pokemon",image:Ir,fmv:1440},{name:"PONCHO-WEAR.PIKACHU #230",rarity:"Eternal",collection:"pokemon",image:Ir,fmv:5592},{name:"CHARIZARD VMAX #308",rarity:"Legendary",collection:"pokemon",image:Ir,fmv:450},{name:"UMBREON VMAX #215",rarity:"Epic",collection:"pokemon",image:Ir,fmv:320},{name:"RAYQUAZA VMAX #218",rarity:"Mythical",collection:"pokemon",image:Ir,fmv:550},{name:"LUFFY #001",rarity:"Rare",collection:"onepiece",image:Ir,fmv:125},{name:"ZORO #002",rarity:"Epic",collection:"onepiece",image:Ir,fmv:145},{name:"NAMI #003",rarity:"Rare",collection:"onepiece",image:Ir,fmv:95},{name:"SANJI #004",rarity:"Epic",collection:"onepiece",image:Ir,fmv:185},{name:"ACE #010",rarity:"Legendary",collection:"onepiece",image:Ir,fmv:380},{name:"ROBIN #006",rarity:"Epic",collection:"onepiece",image:Ir,fmv:165}],Nnt=["PSA","CGC","BGS","SGC"],Dnt=["8","8.5","9","9.5","10"],Fnt=["player#1111","RareHunter22","MintVault","NeonCollector","EpicNexus","CardWhale","ShadowGrade","PackWizard","ApexCards","PixelTrader"],UM=["Silver 2","Bronze","Silver 1","Silver 3","Gold","Platinum","Diamond"],y3=(t,e)=>`${t}-${e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,Nr=t=>{let e=0;for(let n=0;n<t.length;n+=1)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)},jM=(t,e)=>{const n=Nr(e)%t.length;return t[n]},BM=(t,e,n=.18)=>{const r=Nr(`v-${e}`)%1e3/1e3;return t*(1+(r*2-1)*n)},Unt=t=>`product-${t.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}`,VM=t=>Math.round(t*100)/100,jnt=t=>t==="Common"||t==="Rare"?"Starter Pack":t==="Epic"?"Collector Pack":t==="Legendary"?"Elite Pack":"Master Pack",Bnt=t=>{const e=t.name.toLowerCase(),n=[];return t.collection==="pokemon"?(e.includes("pikachu")&&n.push("Electric"),e.includes("charizard")&&n.push("Fire"),e.includes("squirtle")&&n.push("Water"),e.includes("vmax")&&n.push("VMAX"),e.includes("vstar")&&n.push("VSTAR"),e.includes("ex")&&n.push("EX")):(n.push("Pirate"),e.includes("luffy")&&n.push("Captain"),e.includes("zoro")&&n.push("Swordsman")),n.length>0?n:["Collector"]},Vnt=()=>{const t=Fnt.map((s,o)=>({id:`user-${o+1}`,username:s,walletAddress:`0x${String(Nr(s)).padStart(8,"0")}...${String(Nr(`${s}-wallet`)).slice(0,4)}`,avatarUrl:Ont,tier:UM[o%UM.length]})),e=Mnt.map(s=>{const o=Unt(s.name),c=s.collection==="pokemon";return{id:o,name:s.name,image:s.image,rarity:s.rarity,collection:s.collection,cardType:"graded",franchise:c?"Pokemon":"One Piece",set:c?"Pokemon Promo":"Romance Dawn",packOrigin:jnt(s.rarity),traits:Bnt(s),market:{bestAsk:null,bestOffer:null,lastSold:null,trend7d:(Nr(`trend-${o}`)%150-50)/10,fmv:s.fmv,askCount:0,offerCount:0}}}),n=t.filter(s=>s.id!==Dl).map(s=>s.id),r=[],i=[];for(const s of e){const o=s.market.fmv??100,c=s.id,l=Nr(`owned-${c}`)%4;for(let d=0;d<4;d+=1){const f=jM(Dnt,`${c}-grade-${d}`),h=jM(Nnt,`${c}-grader-${d}`),p=d===l?Dl:n[(Nr(`${c}-owner-${d}`)%n.length+d)%n.length],y=(p===Dl?Nr(`${c}-self-listed-${d}`)%10<4:Nr(`${c}-listed-${d}`)%10<7)?VM(BM(o*(f==="10"?1.35:f==="9.5"?1.15:.92),`${c}-ask-${d}`)):null;r.push({tokenId:y3("instance",`${c}-${d}`),cardProductId:s.id,serial:`${1e8+Nr(`${c}-${d}`)}`,condition:"Near Mint",grade:`${h} ${f}`,vault:Nr(`${c}-vault-${d}`)%5===0?"Abstract Vault":void 0,ownerId:p,askPrice:y,inventoryUuid:y?y3("listing",`${c}-${d}`):null,listingExpiresAt:y?new Date(Date.now()+1e3*60*60*24*30):null,acquisitionSource:p===Dl?"pack":"marketplace",acquiredAt:new Date(Date.now()-Nr(`${c}-acq-${d}`)%240*60*60*1e3)})}const u=Nr(`offers-${c}`)%3;for(let d=0;d<u;d+=1){const f=t[Nr(`${c}-offer-user-${d}`)%(t.length-1)+1],h=VM(BM(o*.85,`${c}-offer-price-${d}`,.12)),p=Nr(`${c}-offer-grade-${d}`)%2===0?r.find(g=>g.cardProductId===s.id&&g.ownerId!==Dl&&g.askPrice!==null)?.grade:void 0;i.push({id:y3("offer",`${c}-${d}`),cardProductId:s.id,price:h,fromUserId:f.id,fromUsername:f.username,fromAvatarUrl:f.avatarUrl,createdAt:new Date(Date.now()-Nr(`${c}-offer-date-${d}`)%168*60*60*1e3),status:"active",message:"Interested - open to negotiating.",targetGrade:p})}}const a=t.find(s=>
727s.id===Dl);return a&&[{cardProductId:"product-mew-ex-232",price:1268.5,targetGrade:"PSA 10",createdAt:"2026-03-06T14:20:00.000Z",message:"Interested - open to negotiating."},{cardProductId:"product-charizard-vmax-308",price:392,targetGrade:"BGS 9.5",createdAt:"2026-03-07T09:45:00.000Z",message:"Can close fast at this price."},{cardProductId:"product-umbreon-vmax-215",price:286.75,targetGrade:"CGC 9",createdAt:"2026-03-07T18:05:00.000Z",message:"Happy to discuss if needed."}].forEach(o=>{e.some(c=>c.id===o.cardProductId)&&i.push({id:y3("offer",`${o.cardProductId}-current-user`),cardProductId:o.cardProductId,price:o.price,fromUserId:a.id,fromUsername:a.username,fromAvatarUrl:a.avatarUrl,createdAt:new Date(o.createdAt),status:"active",message:o.message,targetGrade:o.targetGrade})}),{users:t,cardProducts:e,cardInstances:r,catalogOffers:i}},md=Vnt(),uJ=(t,e,n)=>t.map(r=>{const i=e.filter(s=>s.cardProductId===r.id&&s.askPrice!==null).map(s=>s.askPrice).sort((s,o)=>s-o),a=n.filter(s=>s.cardProductId===r.id&&s.status==="active").map(s=>s.price).sort((s,o)=>o-s);return{...r,market:{...r.market,bestAsk:i[0]??null,bestOffer:a[0]??null,askCount:i.length,offerCount:a.length}}}),vc=t=>({...t,cardProducts:uJ(t.cardProducts,t.cardInstances,t.catalogOffers)}),HM=t=>`${t}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,qlt=Pi((t,e)=>({users:md.users,cardProducts:uJ(md.cardProducts,md.cardInstances,md.catalogOffers),cardInstances:md.cardInstances,catalogOffers:md.catalogOffers,recentlyViewedSkus:[],currentUserId:Dl,usdcBalance:2e3,getCurrentUserId:()=>e().currentUserId,getCurrentUser:()=>e().users.find(n=>n.id===e().currentUserId),getUserById:n=>e().users.find(r=>r.id===n),getCardProductById:n=>e().cardProducts.find(r=>r.id===n),getInstancesForProduct:n=>e().cardInstances.filter(r=>r.cardProductId===n).sort((r,i)=>r.askPrice!==null&&i.askPrice!==null?r.askPrice-i.askPrice:r.askPrice!==null?-1:i.askPrice!==null?1:0),getCatalogOffersForProduct:n=>e().catalogOffers.filter(r=>r.cardProductId===n&&r.status==="active").sort((r,i)=>i.price-r.price),getCardProductWithDetails:n=>{const r=e().getCardProductById(n);if(!r)return null;const i=e().getInstancesForProduct(n),a=e().getCatalogOffersForProduct(n),s=a.find(c=>c.fromUserId===e().currentUserId)??null,o=i.filter(c=>c.ownerId===e().currentUserId);return{...r,instances:i,offers:a,viewerHasOffer:s!==null,viewerOffer:s,viewerOwnsInstance:o.length>0,viewerInstances:o}},getSimilarProducts:(n,r=4)=>{const i=e().getCardProductById(n);return i?e().cardProducts.filter(a=>a.id!==n&&(a.collection===i.collection||a.rarity===i.rarity)).slice(0,r):[]},searchCardProducts:n=>{let r=[...e().cardProducts];if(n.cardType&&n.cardType!=="all"&&(r=r.filter(i=>i.collection===n.cardType)),n.query){const i=n.query.toLowerCase();r=r.filter(a=>a.name.toLowerCase().includes(i)||a.franchise?.toLowerCase().includes(i)||a.set?.toLowerCase().includes(i)||a.traits?.some(s=>s.toLowerCase().includes(i)))}if(n.rarities&&n.rarities.size>0&&(r=r.filter(i=>n.rarities?.has(i.rarity))),n.minPrice!=null){const i=n.minPrice;r=r.filter(a=>(a.market.bestAsk??a.market.fmv??0)>=i)}if(n.maxPrice!=null){const i=n.maxPrice;r=r.filter(a=>(a.market.bestAsk??a.market.fmv??Number.MAX_SAFE_INTEGER)<=i)}switch(n.hasListings&&(r=r.filter(i=>i.market.askCount>0)),n.sortBy){case"oldest":r.sort((i,a)=>i.id.localeCompare(a.id));break;case"price-low":r.sort((i,a)=>{const s=i.market.bestAsk??i.market.fmv??Number.MAX_SAFE_INTEGER,o=a.market.bestAsk??a.market.fmv??Number.MAX_SAFE_INTEGER;return s-o});break;case"price-high":r.sort((i,a)=>{const s=i.market.bestAsk??i.market.fmv??0;return(a.market.bestAsk??a.market.fmv??0)-s});break;default:r.sort((i,a)=>a.id.localeCompare(i.id));break}return r},canMakeOfferOnProduct:(n,r)=>{const i=e().currentUserId,s=e().getInstancesForProduct(n).filter(o=>o.ownerId!==i);return s.length===0?!1:r?s.some(o=>o.grade===r):!0},trackRecentlyViewedSku:n=>{t(r=>({recentlyViewedSkus:[n,...r.recentlyViewedSkus.filter(i=>i!==n)].slice(0,20)}))},getRecentlyViewedSkus:n=>n?e().recentlyViewedSkus.slice(0,n):e().recentlyViewedSkus,buyNow:(n,r)=>{if(!e().getCardProductById(n))return{success:!1,error:"Card product not found"};const a=e().currentUserId,o=e().getInstancesForProduct(n).filter(l=>l.ownerId!==a&&l.askPrice!==null&&(!r||l.grade===r)).sort((l,u)=>(l.askPrice??0)-(u.askPrice??0))[0];if(!o||o.askPrice===null)return{success:!1,error:"No listings available"};const c=o.askPrice;return e().usdcBalance<o.askPrice?{success:!1,error:"Insufficient balance"}:(t(l=>vc({...l,usdcBalance:l.usdcBalance-c,cardInstances:l.cardInstances.map(u=>u.tokenId===o.tokenId?{...u,ownerId:l.currentUserId,askPrice:null,inventoryUuid:null,listingExpiresAt:null,acquisitionSource:"marketplace",acquiredAt:new Date}:u),catalogOffers:l.catalogOffers.map(u=>u.cardProductId===n&&u.status==="active"?{...u,status:"rejected"}:u),cardProducts:l.cardProducts.map(u=>u.id===n?{...u,market:{...u.market,lastSold:o.askPrice}}:u)})),{success:!0,cardInstance:{...o,ownerId:a,askPrice:null,inventoryUuid:null,listingExpiresAt:null}})},makeCatalogOffer:(n,r,i,a)=>
727{if(!e().getCardProductById(n))return{success:!1,error:"Card product not found"};if(r<=0)return{success:!1,error:"Offer price must be greater than 0"};if(e().usdcBalance<r)return{success:!1,error:"Insufficient balance"};const o=e().currentUserId;if(e().catalogOffers.find(u=>u.cardProductId===n&&u.fromUserId===o&&u.status==="active"))return{success:!1,error:"You already have an active offer. Edit or cancel it first."};if(!e().canMakeOfferOnProduct(n,a))return{success:!1,error:"Offers are not available for this product"};const l=e().getCurrentUser();return l?(t(u=>vc({...u,usdcBalance:u.usdcBalance-r,catalogOffers:[...u.catalogOffers,{id:HM("offer"),cardProductId:n,price:r,fromUserId:u.currentUserId,fromUsername:l.username,fromAvatarUrl:l.avatarUrl,createdAt:new Date,status:"active",message:i,targetGrade:a}]})),{success:!0}):{success:!1,error:"Current user not found"}},editCatalogOffer:(n,r,i,a)=>{const s=e().catalogOffers.find(c=>c.id===n);if(!s)return{success:!1,error:"Offer not found"};const o=e().cancelCatalogOffer(n);return o.success?e().makeCatalogOffer(s.cardProductId,r,i,a??s.targetGrade):o},cancelCatalogOffer:n=>{const r=e().catalogOffers.find(i=>i.id===n);return r?r.fromUserId!==e().currentUserId?{success:!1,error:"You do not own this offer"}:r.status!=="active"?{success:!1,error:"Offer is not active"}:(t(i=>vc({...i,usdcBalance:i.usdcBalance+r.price,catalogOffers:i.catalogOffers.map(a=>a.id===n?{...a,status:"cancelled"}:a)})),{success:!0}):{success:!1,error:"Offer not found"}},acceptCatalogOffer:n=>{const r=e().catalogOffers.find(o=>o.id===n);if(!r)return{success:!1,error:"Offer not found"};if(r.status!=="active")return{success:!1,error:"Offer is not active"};const i=e().currentUserId,a=e().getInstancesForProduct(r.cardProductId).filter(o=>o.ownerId===i);if(a.length===0)return{success:!1,error:"You do not own this card"};const s=a.find(o=>r.targetGrade?o.grade===r.targetGrade:!0)??a[0];return s?(t(o=>vc({...o,usdcBalance:o.usdcBalance+r.price,cardInstances:o.cardInstances.map(c=>c.tokenId===s.tokenId?{...c,ownerId:r.fromUserId,askPrice:null,inventoryUuid:null,listingExpiresAt:null,acquisitionSource:"marketplace",acquiredAt:new Date}:c),catalogOffers:o.catalogOffers.map(c=>c.id===n?{...c,status:"accepted"}:c.cardProductId===r.cardProductId&&c.status==="active"?{...c,status:"rejected"}:c),cardProducts:o.cardProducts.map(c=>c.id===r.cardProductId?{...c,market:{...c.market,lastSold:r.price}}:c)})),{success:!0,cardInstance:{...s,ownerId:r.fromUserId,askPrice:null,inventoryUuid:null,listingExpiresAt:null}}):{success:!1,error:"No matching instance found"}},rejectCatalogOffer:n=>{const r=e().catalogOffers.find(i=>i.id===n);return r?r.status!=="active"?{success:!1,error:"Offer is not active"}:(t(i=>vc({...i,usdcBalance:i.usdcBalance+r.price,catalogOffers:i.catalogOffers.map(a=>a.id===n?{...a,status:"rejected"}:a)})),{success:!0}):{success:!1,error:"Offer not found"}},listInstanceForSale:(n,r,i)=>{const a=e().cardInstances.find(s=>s.tokenId===n);return a?a.ownerId!==e().currentUserId?{success:!1,error:"You do not own this instance"}:r<=0?{success:!1,error:"Price must be greater than 0"}:(t(s=>vc({...s,cardInstances:s.cardInstances.map(o=>o.tokenId===n?{...o,askPrice:r,inventoryUuid:HM("listing"),listingExpiresAt:new Date(Date.now()+i*60*60*1e3)}:o)})),{success:!0}):{success:!1,error:"Card instance not found"}},updateInstanceListing:(n,r,i)=>{const a=e().cardInstances.find(s=>s.inventoryUuid===n);return a?a.ownerId!==e().currentUserId?{success:!1,error:"You do not own this listing"}:r<=0?{success:!1,error:"Price must be greater than 0"}:(t(s=>vc({...s,cardInstances:s.cardInstances.map(o=>o.inventoryUuid===n?{...o,askPrice:r,listingExpiresAt:new Date(Date.now()+i*60*60*1e3)}:o)})),{success:!0}):{success:!1,error:"Listing not found"}},cancelInstanceListing:n=>{const r=e().cardInstances.find(i=>i.inventoryUuid===n);return r?r.ownerId!==e().currentUserId?{success:!1,error:"You do not own this listing"}:(t(i=>vc({...i,cardInstances:i.cardInstances.map(a=>a.inventoryUuid===n?{...a,askPrice:null,inventoryUuid:null,listingExpiresAt:null}:a)})),{success:!0}):{success:!1,error:"Listing not found"}}})),zlt=t=>
727t===null?"â":`$${t.toLocaleString("en-US",{minimumFractionDigits:t%1!==0?2:0,maximumFractionDigits:2})}`,Hnt=t=>$Q(t).div(1e6).toNumber(),Wnt=MQ(Zo,{fetch:zo}),Zlt=(t,e,n,r,i,a,s)=>{const o=e??5,c=!n,l=c?o*2:o;return Bt({queryKey:["pulls",e,n,r,i,a,s],queryFn:async()=>{const u={limit:l.toString()};n&&(u.productId=n),r&&(u.packType=r),a&&(u.setId=a),s&&(u.collection=s);const d=await bt.api.pulls.$get({query:u});if(!d.ok)throw new Error("Failed to fetch recent wins");return d.json()},select:u=>{if(!c||!u.recent)return u;if(t){const f=t.toLowerCase(),h=u.recent.filter(p=>p.owner!==f).slice(0,o);return{...u,recent:h,count:h.length}}const d=u.recent.slice(0,o);return{...u,recent:d,count:d.length}},refetchInterval:n2*1e3,staleTime:n2*1e3,retry:3,retryDelay:1e3})},Klt=(t,e,n,r,i,a,s,o)=>Bt({queryKey:["pulls","top",t,e,n,r,i,a,s,o],queryFn:async()=>{const c=await bt.api.pulls.top.$get({query:{limit:t?t.toString():"2",cardPacksOnly:(!!e).toString(),...n?{days:n.toString()}:{},...r?{productId:r}:{},...i?{packType:i}:{},...s?{setId:s}:{},...o?{collection:o}:{}}});if(!c.ok)throw new Error("Failed to fetch recent wins");return await c.json()},refetchInterval:n2*1e3,staleTime:n2*1e3,retry:3,retryDelay:1e3}),Glt=(t,e,n,r,i,a,s)=>Bt({queryKey:["pulls","big-wins",t,e,n,r,i,a,s],queryFn:async()=>{const o=await Wnt.api.pulls["big-wins"].$get({query:{limit:t?.toString(),packType:e,productId:n,minMultiplier:r?.toString(),includeGuaranteedPull:void 0,setId:a,collection:s}});if(!o.ok)throw new Error("Failed to fetch big wins");return o.json()},refetchInterval:n2*1e3,staleTime:n2*1e3,retry:3,retryDelay:1e3});async function dJ(t,e){const n=new URLSearchParams;e?.page&&n.set("page",e.page.toString()),e?.limit&&n.set("limit",e.limit.toString()),e?.minValue&&n.set("minValue",e.minValue.toString()),e?.maxValue&&n.set("maxValue",e.maxValue.toString()),e?.grade?.length&&n.set("grade",e.grade.join(",")),e?.sortBy==="pulledAt"&&n.set("sortBy","mintedAt"),e?.sortBy==="value"&&n.set("sortBy","value"),e?.sortOrder&&n.set("sortOrder",e.sortOrder),e?.search&&n.set("search",e.search);const r=await bt.api.profile[":wallet"].inventory.$get({param:{wallet:t},query:Object.fromEntries(n)});if(!r.ok)throw new Error("Failed to fetch complete wins data");const i=await r.json();return{...i,data:i.data.map(a=>({...a,isSoldBack:!1,isRedeemed:!1,pulledAt:a.mintedAt,nftId:a.nftId,purchaseToken:a.purchaseToken??void 0}))}}const Ylt=(t,e)=>Bt({queryKey:["profile",t,"inventory",e],queryFn:async()=>dJ(t,e),enabled:!!t});async function qnt(t,e){const n=new URLSearchParams;e?.page&&n.set("page",e.page.toString()),e?.limit&&n.set("limit",e.limit.toString()),e?.minValue&&n.set("minValue",e.minValue.toString()),e?.maxValue&&n.set("maxValue",e.maxValue.toString()),e?.grade?.length&&n.set("grade",e.grade.join(",")),e?.sortBy==="pulledAt"&&n.set("sortBy","loggedAt"),e?.sortBy==="value"&&n.set("sortBy","value"),e?.sortOrder&&n.set("sortOrder",e.sortOrder),e?.onlyOwned&&n.set("onlyOwned",e.onlyOwned.toString()),e?.search&&n.set("search",e.search);const r=await bt.api.pulls[":wallet"].$get({param:{wallet:t},query:Object.fromEntries(n)});if(!r.ok)throw new Error("Failed to fetch complete wins data");const i=await r.json();return{...i,data:i.data.map(a=>({...a,pulledAt:a.loggedAt,nftId:a.nftId,purchaseToken:a.purchaseToken??void 0,isSoldBack:a.buybackTxHash!=null,isTransferred:a.transferTxHash!=null&&a.buybackTxHash==null,transferredAt:a.transferLoggedAt,transferredTo:a.transferTo,transferAmount:a.transferSalePriceUsdc!=null?Hnt(a.transferSalePriceUsdc):null}))}}const Jlt=(t,e)=>MD({queryKey:["profileInventoryOrPulls",t,e],queryFn:async({pageParam:n=1})=>e?.onlyOwned?dJ(t,{...e,page:n}):qnt(t,{...e,page:n}),getNextPageParam:n=>n.pagination.hasNextPage?n.pagination.page+1:void 0,initialPageParam:1,enabled:!!t}),fJ="Something went wrong, reload the page and try again",znt="Something went wrong, reload the page and try again";async function Znt(t){const e={};t.authToken&&(e["auth-token"]=t.authToken),t.identityToken&&(e["id-token"]=t.identityToken);const n=await bt.api.user.me.$post({json:{wallet:t.wallet.toLowerCase(),authMethod:t.authMethod,posthogDeviceId:t.posthogDeviceId,userAgent:t.userAgent,referralCode:t.referralCode,referralCapturedAt:t.referralCapturedAt,locale:t.locale}},{headers:e});if(!n.ok){const r=new Error(`Failed to sync /api/user/me: HTTP ${n.status}`);throw r.status=n.status,r}return n.json()}const hJ=()=>{const t=ns();return it({mutationKey:["user","me"],mutationFn:Znt,onSuccess:e=>
727{if(t.invalidateQueries({queryKey:["user","me"]}),e&&"username"in e){const n=typeof e.username=="string"?e.username:null;UA.getState().markSynced(n)}}})},Xlt=t=>{const{address:e,authenticated:n,getAuthHeaders:r}=Ht();return Bt({queryKey:["user","me",e],queryFn:async()=>{const i=await r();if(!i)throw new Error("not authenticated");const a=await bt.api.user.me.$get({},{headers:i});if(!a.ok)throw new Error(`Failed to fetch account: HTTP ${a.status}`);return a.json()},enabled:(t?.enabled??!0)&&n})},Qlt=t=>["Pull Gacha email verification",t.wallet.toLowerCase(),`Email: ${t.email.trim().toLowerCase()}`].join(` 728`),eut=t=>["Pull Gacha username update",t.wallet.toLowerCase(),`Username: ${t.username.trim()}`,`Timestamp: ${Math.floor(Date.now()/1e3)}`].join(` 729`),tut=()=>it({mutationFn:async t=>{const e=await bt.api.user.email["request-otp"].$post({json:{wallet:t.wallet.toLowerCase(),email:t.email.trim().toLowerCase(),message:t.message,signature:t.signature}});if(!e.ok){const n=await Cm(e,fJ);throw n.errorCode?new Em(n.error,{errorCode:n.errorCode,errorParams:n.errorParams}):new Error(n.error)}return e.json()}}),nut=()=>it({mutationFn:async t=>{const e=await bt.api.user.email.verify.$post({json:{wallet:t.wallet.toLowerCase(),email:t.email.trim().toLowerCase(),otp:t.otp,message:t.message,signature:t.signature}});if(!e.ok){const n=await Cm(e,fJ);throw n.errorCode?new Em(n.error,{errorCode:n.errorCode,errorParams:n.errorParams}):new Error(n.error)}return e.json()}}),rut=()=>it({mutationFn:async t=>{const e=await bt.api.user.username.update.$post({json:{wallet:t.wallet.toLowerCase(),username:t.username.trim(),message:t.message,signature:t.signature}},t.headers?{headers:t.headers}:void 0);if(!e.ok){const n=await Cm(e,znt);throw n.errorCode?new Em(n.error,{errorCode:n.errorCode,errorParams:n.errorParams}):new Error(n.error)}return e.json()}}),Knt="Something went wrong, reload the page and try again",iut=()=>it({mutationFn:async t=>{const e=await bt.api.user[":address"].$delete({param:{address:t.wallet.toLowerCase()}},{headers:t.headers});if(!e.ok){const n=await Cm(e,Knt);throw n.errorCode?new Em(n.error,{errorCode:n.errorCode,errorParams:n.errorParams}):new Error(n.error)}return{ok:!0}}}),aut=t=>Bt({queryKey:["user-tier",t],queryFn:async()=>{if(!t)throw new Error("No wallet provided");const e=await bt.api.user[":address"].tier.$get({param:{address:t.toLowerCase()}});if(!e.ok)throw new Error("Failed to fetch user tier");return e.json()},enabled:!!t}),sut=(t,e)=>Bt({queryKey:["tier",t],queryFn:async()=>{if(!t)throw new Error("No wallet provided");const n=await bt.api.tier[":address"].$get({param:{address:t.toLowerCase()}});if(!n.ok)throw new Error("Failed to fetch tier");return n.json()},enabled:e?.enabled??!!t}),out=t=>Bt({queryKey:["user-points",t],queryFn:async()=>{if(!t)throw new Error("No wallet provided");const e=await bt.api.points[":address"].$get({param:{address:t.toLowerCase()}});if(!e.ok)throw new Error("Failed to fetch user points");return e.json()},enabled:!!t});export{pat as $,flt as A,oee as B,sut as C,vie as D,KS as E,vct as F,TXe as G,rn as H,Oot as I,jYe as J,VYe as K,es as L,zr as M,Vt as N,Vu as O,dl as P,fe as Q,Nat as R,Uat as S,eee as T,Kat as U,RYe as V,cee as W,nit as X,Q as Y,b7e as Z,IV as _,$l as a,eze as a$,gat as a0,Aot as a1,P0 as a2,Fat as a3,oct as a4,O5e as a5,Pd as a6,nBe as a7,I7e as a8,Dat as a9,Qit as aA,Jit as aB,Kit as aC,kot as aD,xot as aE,Dot as aF,Ka as aG,by as aH,om as aI,LYe as aJ,hat as aK,Yc as aL,gy as aM,gWe as aN,dje as aO,WYe as aP,qYe as aQ,TYe as aR,xat as aS,nat as aT,Tp as aU,Tat as aV,Dc as aW,Gwe as aX,cXe as aY,$Ze as aZ,rze as a_,Qv as aa,Wp as ab,jv as ac,bVe as ad,hot as ae,Hat as af,fat as ag,mje as ah,Lp as ai,ps as aj,S7e as ak,$i as al,rBe as am,iM as an,Cy as ao,Sb as ap,Rat as aq,ig as ar,kat as as,Not as at,Mat as au,$ot as av,Zit as aw,Yit as ax,Xit as ay,KB as az,Mtt as b,h4e as b$,v7e as b0,mat as b1,yat as b2,wat as b3,vat as b4,n8e as b5,cat as b6,oat as b7,JYe as b8,XGe as b9,Rnt as bA,Ylt as bB,vre as bC,mct as bD,qlt as bE,Hnt as bF,fg as bG,nh as bH,Go as bI,Yo as bJ,Jo as bK,wE as bL,r3e as bM,Ks as bN,Ru as bO,Gs as bP,u3e as bQ,Mot as bR,lBe as bS,En as bT,uK as bU,oV as bV,uct as bW,ict as bX,rct as bY,nct as bZ,IYe as b_,rv as ba,_d as bb,tct as bc,fot as bd,xt as be,WS as bf,ZZ as bg,KZ as bh,dot as bi,uot as bj,A7e as bk,bd as bl,o6e as bm,_y as bn,JR as bo,ect as bp,fje as bq,hje as br,vVe as bs,e8e as bt,Xat as bu,pM as bv,cct as bw,Pnt as bx,knt as by,Lnt as bz,Sm as c,rf as c$,Bc as c0,n0 as c1,nre as c2,bxe as c3,Bo as c4,uF as c5,He as c6,Wlt as c7,Hlt as c8,Qo as c9,nze as cA,jE as cB,Wu as cC,tZe as cD,tze as cE,kZe as cF,Got as cG,Dze as cH,Kot as cI,yM as cJ,vlt as cK,Iu as cL,yWe as cM,qot as cN,lat as cO,h1e as cP,v5 as cQ,ll as cR,dat as cS,PD as cT,YS as cU,Ki as cV,Eot as cW,D5e as cX,ya as cY,Hd as cZ,uze as c_,hlt as ca,NYe as cb,eat as cc,v8 as cd,Tot as ce,$H as cf,Oat as cg,Lot as ch,Iot as ci,Pot as cj,Rot as ck,aBe as cl,jK as cm,Ou as cn,Nit as co,iat as cp,aat as cq,rat as cr,Dit as cs,lct as ct,act as cu,sct as cv,Git as cw,Ge as cx,Zot as cy,zot as cz,Ntt as d,Vct as d$,ml as d0,Cze as d1,Sze as d2,W
729n as d3,Oze as d4,tY as d5,Jot as d6,Xot as d7,dZe as d8,sat as d9,yct as dA,HXe as dB,vtt as dC,xct as dD,tee as dE,aee as dF,nee as dG,Act as dH,Xlt as dI,FT as dJ,Cct as dK,tut as dL,nut as dM,rut as dN,iut as dO,Qlt as dP,eut as dQ,Jlt as dR,bct as dS,wct as dT,_ct as dU,jXe as dV,UXe as dW,Klt as dX,jct as dY,alt as dZ,Yct as d_,mZe as da,Yot as db,Qot as dc,Zw as dd,MD as de,LC as df,LXe as dg,Ce as dh,dn as di,Sc as dj,CVe as dk,Fot as dl,RH as dm,Zat as dn,Qwe as dp,Xwe as dq,t8e as dr,L7e as ds,qU as dt,QY as du,Zlt as dv,Glt as dw,Vlt as dx,Pi as dy,out as dz,zlt as e,Drt as e$,a6 as e0,mM as e1,Sct as e2,UA as e3,VXe as e4,Tct as e5,Lct as e6,kct as e7,Ict as e8,llt as e9,JVe as eA,hHe as eB,YVe as eC,mHe as eD,OHe as eE,BVe as eF,YK as eG,GK as eH,qK as eI,Hot as eJ,Ao as eK,Vot as eL,tat as eM,Aa as eN,mrt as eO,vrt as eP,_rt as eQ,brt as eR,krt as eS,Lrt as eT,Rrt as eU,Hrt as eV,The as eW,Lhe as eX,Urt as eY,Phe as eZ,$he as e_,Xct as ea,Dct as eb,Fct as ec,cm as ed,Pct as ee,$ct as ef,iA as eg,wn as eh,R0 as ei,Oi as ej,RVe as ek,Js as el,ai as em,ka as en,KVe as eo,Xo as ep,al as eq,iHe as er,em as es,oHe as et,CHe as eu,Ga as ev,jot as ew,Vv as ex,Wv as ey,vHe as ez,lee as f,Tv as f$,jrt as f0,khe as f1,Frt as f2,Brt as f3,Prt as f4,Nrt as f5,Mrt as f6,Ort as f7,Vrt as f8,$rt as f9,K7 as fA,x$ as fB,Fu as fC,TW as fD,Oe as fE,Eu as fF,aS as fG,rt as fH,_0 as fI,sxe as fJ,Ybe as fK,IW as fL,U8 as fM,k$e as fN,tPe as fO,FS as fP,VPe as fQ,DS as fR,Lv as fS,Fp as fT,Uu as fU,Wa as fV,A$ as fW,wq as fX,lAe as fY,Su as fZ,Zc as f_,wrt as fa,Art as fb,xrt as fc,Irt as fd,Trt as fe,Srt as ff,prt as fg,Ert as fh,Crt as fi,grt as fj,yrt as fk,qne as fl,CC as fm,Vne as fn,$g as fo,srt as fp,zl as fq,oD as fr,Lne as fs,wi as ft,m6 as fu,Wne as fv,wx as fw,ha as fx,ort as fy,ia as fz,Zct as g,xlt as g$,bs as g0,ga as g1,ws as g2,EZ as g3,va as g4,xi as g5,yCe as g6,oCe as g7,cre as g8,vxe as g9,Yrt as gA,Jrt as gB,Xrt as gC,Qrt as gD,tit as gE,eit as gF,Krt as gG,Grt as gH,Vpe as gI,n9e as gJ,f9e as gK,k8 as gL,o9e as gM,c9e as gN,r9e as gO,die as gP,mie as gQ,Hct as gR,aut as gS,jee as gT,rrt as gU,nrt as gV,Slt as gW,Alt as gX,plt as gY,Flt as gZ,Ult as g_,jh as ga,C3 as gb,Pre as gc,kre as gd,hn as ge,x8 as gf,Ut as gg,Pk as gh,Dh as gi,ibe as gj,est as gk,BN as gl,Gz as gm,MP as gn,B$e as go,j$e as gp,RN as gq,Ts as gr,lXe as gs,Kh as gt,t6 as gu,pct as gv,uXe as gw,dXe as gx,hct as gy,fct as gz,qct as h,Blt as h0,jlt as h1,Nlt as h2,Dlt as h3,Olt as h4,cJ as h5,mlt as h6,Bct as h7,blt as h8,glt as h9,Wct as hA,clt as hB,frt as hC,hrt as hD,_h as hE,elt as h
729F,tlt as hG,nlt as hH,Rct as hI,aD as hJ,Oee as hK,Mee as hL,Nee as hM,Dee as hN,Fee as hO,Uee as hP,Bee as hQ,Vee as hR,Hee as hS,Wee as hT,ou as hU,op as hV,mx as hW,vx as hX,xm as hY,iDe as hZ,wlt as ha,ylt as hb,dct as hc,gct as hd,mWe as he,_lt as hf,Elt as hg,Plt as hh,Tlt as hi,Mlt as hj,Rlt as hk,_nt as hl,Cnt as hm,Clt as hn,Llt as ho,$lt as hp,klt as hq,Ilt as hr,Mct as hs,Oct as ht,Ent as hu,BA as hv,vh as hw,Ect as hx,ilt as hy,Gct as hz,rlt as i,dlt as j,Qct as k,Kct as l,zct as m,Nct as n,XY as o,TN as p,R2 as q,Uct as r,mee as s,ult as t,Ht as u,slt as v,VN as w,olt as x,Jct as y,xXe as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.