@powerhousedao/connect 1.0.0-dev.199 → 1.0.0-dev.200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/.env +2 -2
  2. package/dist/assets/app-D5JkX4Uj.js +582 -0
  3. package/dist/assets/app-D5JkX4Uj.js.map +1 -0
  4. package/dist/assets/app-loader-D4PbvzrB.css +1 -0
  5. package/dist/assets/{app-loader-Dn48G7po.js → app-loader-DW3rvYVW.js} +3 -3
  6. package/dist/assets/app-loader-DW3rvYVW.js.map +1 -0
  7. package/dist/assets/{browser-camIpcNU.js → browser-BY_9pOaF.js} +2 -2
  8. package/dist/assets/{browser-camIpcNU.js.map → browser-BY_9pOaF.js.map} +1 -1
  9. package/dist/assets/{ccip-D-9jk-RD.js → ccip-CSm_dBY-.js} +2 -2
  10. package/dist/assets/{ccip-D-9jk-RD.js.map → ccip-CSm_dBY-.js.map} +1 -1
  11. package/dist/assets/content-CZbRXB00.js +7 -0
  12. package/dist/assets/content-CZbRXB00.js.map +1 -0
  13. package/dist/assets/editor-BtO6Gypb.js +2 -0
  14. package/dist/assets/editor-BtO6Gypb.js.map +1 -0
  15. package/dist/assets/editor-CTeXLKFR.js +2 -0
  16. package/dist/assets/editor-CTeXLKFR.js.map +1 -0
  17. package/dist/assets/editor-DOC8FvI_.js +2 -0
  18. package/dist/assets/editor-DOC8FvI_.js.map +1 -0
  19. package/dist/assets/editor-DZFHIVmh.js +346 -0
  20. package/dist/assets/editor-DZFHIVmh.js.map +1 -0
  21. package/dist/assets/editors-BOSfNWsm.js +3 -0
  22. package/dist/assets/editors-BOSfNWsm.js.map +1 -0
  23. package/dist/assets/{getEnsName-DiyJcfh8.js → getEnsName-UdBChzmd.js} +4 -4
  24. package/dist/assets/{getEnsName-DiyJcfh8.js.map → getEnsName-UdBChzmd.js.map} +1 -1
  25. package/dist/assets/index-D0RJI-lW.js +3 -0
  26. package/dist/assets/{index-BBo8moLy.js.map → index-D0RJI-lW.js.map} +1 -1
  27. package/dist/assets/{index-B38XkIrT.js → index-olgtq3p2.js} +2 -2
  28. package/dist/assets/{index-B38XkIrT.js.map → index-olgtq3p2.js.map} +1 -1
  29. package/dist/assets/{isAddressEqual-CXyuWVb7.js → isAddressEqual-B0vzZnZp.js} +2 -2
  30. package/dist/assets/{isAddressEqual-CXyuWVb7.js.map → isAddressEqual-B0vzZnZp.js.map} +1 -1
  31. package/dist/assets/json-_CDXNk-y.js +3 -0
  32. package/dist/assets/{json-CHCvwHN3.js.map → json-_CDXNk-y.js.map} +1 -1
  33. package/dist/assets/{main.BmAe1Lus.js → main.vaE8bYXL.js} +2 -2
  34. package/dist/assets/{main.BmAe1Lus.js.map → main.vaE8bYXL.js.map} +1 -1
  35. package/dist/assets/react-error-boundary.esm-CGkLiKiB.js +2 -0
  36. package/dist/assets/react-error-boundary.esm-CGkLiKiB.js.map +1 -0
  37. package/dist/assets/root-Uu_62bEJ.js +17 -0
  38. package/dist/assets/root-Uu_62bEJ.js.map +1 -0
  39. package/dist/assets/{router-B1NCyaFw.js → router-WBIxvb9L.js} +4 -4
  40. package/dist/assets/router-WBIxvb9L.js.map +1 -0
  41. package/dist/index.html +5 -5
  42. package/dist/service-worker.js +1 -1
  43. package/dist/studio/index.js +31 -4
  44. package/dist/swEnv.js +4 -4
  45. package/dist/vite-envs.sh +9 -9
  46. package/package.json +10 -10
  47. package/dist/assets/app-DvSjLYs-.js +0 -449
  48. package/dist/assets/app-DvSjLYs-.js.map +0 -1
  49. package/dist/assets/app-loader-Dn48G7po.js.map +0 -1
  50. package/dist/assets/app-loader-iGtpD3C9.css +0 -1
  51. package/dist/assets/content-TOddMACx.js +0 -7
  52. package/dist/assets/content-TOddMACx.js.map +0 -1
  53. package/dist/assets/editor-Ba951Cwc.js +0 -346
  54. package/dist/assets/editor-Ba951Cwc.js.map +0 -1
  55. package/dist/assets/index-BBo8moLy.js +0 -3
  56. package/dist/assets/json-CHCvwHN3.js +0 -3
  57. package/dist/assets/root-D8qKMM0F.js +0 -17
  58. package/dist/assets/root-D8qKMM0F.js.map +0 -1
  59. package/dist/assets/router-B1NCyaFw.js.map +0 -1
  60. package/dist/assets/useUiNodes-D93b3yJT.js +0 -107
  61. package/dist/assets/useUiNodes-D93b3yJT.js.map +0 -1
@@ -0,0 +1,582 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-olgtq3p2.js","assets/main.vaE8bYXL.js","assets/app-loader-DW3rvYVW.js","assets/app-loader-D4PbvzrB.css","assets/browser-BY_9pOaF.js","assets/getEnsName-UdBChzmd.js","assets/isAddressEqual-B0vzZnZp.js","assets/router-WBIxvb9L.js"])))=>i.map(i=>d[i]);
2
+ var n$=Object.defineProperty;var D0=t=>{throw TypeError(t)};var r$=(t,e,n)=>e in t?n$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ke=(t,e,n)=>r$(t,typeof e!="symbol"?e+"":e,n),qy=(t,e,n)=>e.has(t)||D0("Cannot "+n);var de=(t,e,n)=>(qy(t,e,"read from private field"),n?n.call(t):e.get(t)),It=(t,e,n)=>e.has(t)?D0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),bt=(t,e,n,r)=>(qy(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),un=(t,e,n)=>(qy(t,e,"access private method"),n);var Ap=(t,e,n,r)=>({set _(i){bt(t,e,i,n)},get _(){return de(t,e,r)}});import{_ as Te}from"./main.vaE8bYXL.js";import{jsx as T,jsxs as _e,Fragment as Zo}from"react/jsx-runtime";import*as k from"react";import Ae,{createElement as qa,isValidElement as gs,cloneElement as rm,Children as i$,createContext as fu,useContext as da,useState as Qe,useRef as hn,useEffect as jt,useLayoutEffect as Kf,useCallback as xe,useMemo as En,Suspense as cC,lazy as s$,forwardRef as fa,Component as o$,Fragment as pb,useId as a$,useSyncExternalStore as c$,useReducer as l$,useDebugValue as u$}from"react";import{g as lC,a as dw,o as Js,s as $l,n as to,L as im,c as Ai,b as Np,p as d$,t as f$}from"./app-loader-DW3rvYVW.js";import*as uC from"react-dom";import p$,{createPortal as h$}from"react-dom";function m$(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 s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function ut(){return ut=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ut.apply(null,arguments)}var dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Xpe(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var g$={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 y$=pa(g$);var v$=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function k0(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(y$[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(v$),s=null;(s=i.exec(t))!==null;)if(s[0].trim())if(s[1]){var o=s[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),e.attrs[a[0]]=a[1],i.lastIndex--}else s[2]&&(e.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return e}var b$=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,_$=/^\s*$/,w$=Object.create(null);function dC(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(dC,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var E$={parse:function(t,e){e||(e={}),e.components||(e.components=w$);var n,r=[],i=[],s=-1,o=!1;if(t.indexOf("<")!==0){var a=t.indexOf("<");r.push({type:"text",content:a===-1?t:t.substring(0,a)})}return t.replace(b$,function(c,l){if(o){if(c!=="</"+n.name+">")return;o=!1}var u,d=c.charAt(1)!=="/",f=c.startsWith("<!--"),p=l+c.length,m=t.charAt(p);if(f){var h=k0(c);return s<0?(r.push(h),r):((u=i[s]).children.push(h),r)}if(d&&(s++,(n=k0(c)).type==="tag"&&e.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!m||m==="<"||n.children.push({type:"text",content:t.slice(p,t.indexOf("<",p))}),s===0&&r.push(n),(u=i[s-1])&&u.children.push(n),i[s]=n),(!d||n.voidElement)&&(s>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(s--,n=s===-1?r:i[s]),!o&&m!=="<"&&m)){u=s===-1?r:i[s].children;var g=t.indexOf("<",p),y=t.slice(p,g===-1?void 0:g);_$.test(y)&&(y=" "),(g>-1&&s+u.length>=0||y!==" ")&&u.push({type:"text",content:y})}}),r},stringify:function(t){return t.reduce(function(e,n){return e+dC("",n)},"")}};function Ch(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const A0={};function sm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&A0[e[0]]||(typeof e[0]=="string"&&(A0[e[0]]=new Date),Ch(...e))}const fC=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function N0(t,e,n){t.loadNamespaces(e,fC(t,n))}function P0(t,e,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,fC(t,r))}function S$(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=e.languages[0],i=e.options?e.options.fallbackLng:!1,s=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const l=e.services.backendConnector.state[`${a}|${c}`];return l===-1||l===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(r,t)&&(!i||o(s,t)))}function x$(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(sm("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(i,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,t))return!1}}):S$(t,e,n)}function Gy(t,e){if(!t)return!1;const n=t.props?t.props.children:t.children;return e?n.length>0:!!n}function Zy(t){if(!t)return[];const e=t.props?t.props.children:t.children;return t.props&&t.props.i18nIsDynamicList?cl(e):e}function T$(t){return Object.prototype.toString.call(t)!=="[object Array]"?!1:t.every(e=>gs(e))}function cl(t){return Array.isArray(t)?t:[t]}function I$(t,e){const n={...e};return n.props=Object.assign(t.props,e.props),n}function pC(t,e){if(!t)return"";let n="";const r=cl(t),i=e.transSupportBasicHtmlNodes&&e.transKeepBasicHtmlNodesFor?e.transKeepBasicHtmlNodesFor:[];return r.forEach((s,o)=>{if(typeof s=="string")n+=`${s}`;else if(gs(s)){const a=Object.keys(s.props).length,c=i.indexOf(s.type)>-1,l=s.props.children;if(!l&&c&&a===0)n+=`<${s.type}/>`;else if(!l&&(!c||a!==0))n+=`<${o}></${o}>`;else if(s.props.i18nIsDynamicList)n+=`<${o}></${o}>`;else if(c&&a===1&&typeof l=="string")n+=`<${s.type}>${l}</${s.type}>`;else{const u=pC(l,e);n+=`<${o}>${u}</${o}>`}}else if(s===null)Ch("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof s=="object"){const{format:a,...c}=s,l=Object.keys(c);if(l.length===1){const u=a?`${l[0]}, ${a}`:l[0];n+=`{{${u}}}`}else Ch("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",s)}else Ch("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",s)}),n}function O$(t,e,n,r,i,s){if(e==="")return[];const o=r.transKeepBasicHtmlNodesFor||[],a=e&&new RegExp(o.map(g=>`<${g}`).join("|")).test(e);if(!t&&!a&&!s)return[e];const c={};function l(g){cl(g).forEach(v=>{typeof v!="string"&&(Gy(v)?l(Zy(v)):typeof v=="object"&&!gs(v)&&Object.assign(c,v))})}l(t);const u=E$.parse(`<0>${e}</0>`),d={...c,...i};function f(g,y,v){const b=Zy(g),E=m(b,y.children,v);return T$(b)&&E.length===0||g.props&&g.props.i18nIsDynamicList?b:E}function p(g,y,v,b,E){g.dummy?(g.children=y,v.push(rm(g,{key:b},E?void 0:y))):v.push(...i$.map([g],w=>{const S={...w.props};return delete S.i18nIsDynamicList,Ae.createElement(w.type,ut({},S,{key:b,ref:w.ref},E?{}:{children:y}))}))}function m(g,y,v){const b=cl(g);return cl(y).reduce((w,S,_)=>{const O=S.children&&S.children[0]&&S.children[0].content&&n.services.interpolator.interpolate(S.children[0].content,d,n.language);if(S.type==="tag"){let M=b[parseInt(S.name,10)];v.length===1&&!M&&(M=v[0][S.name]),M||(M={});const F=Object.keys(S.attrs).length!==0?I$({props:S.attrs},M):M,q=gs(F),I=q&&Gy(S,!0)&&!S.voidElement,$=a&&typeof F=="object"&&F.dummy&&!q,x=typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,S.name);if(typeof F=="string"){const A=n.services.interpolator.interpolate(F,d,n.language);w.push(A)}else if(Gy(F)||I){const A=f(F,S,v);p(F,A,w,_)}else if($){const A=m(b,S.children,v);p(F,A,w,_)}else if(Number.isNaN(parseFloat(S.name)))if(x){const A=f(F,S,v);p(F,A,w,_,S.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(S.name)>-1)if(S.voidElement)w.push(qa(S.name,{key:`${S.name}-${_}`}));else{const A=m(b,S.children,v);w.push(qa(S.name,{key:`${S.name}-${_}`},A))}else if(S.voidElement)w.push(`<${S.name} />`);else{const A=m(b,S.children,v);w.push(`<${S.name}>${A}</${S.name}>`)}else if(typeof F=="object"&&!q){const A=S.children[0]?O:null;A&&w.push(A)}else p(F,O,w,_,S.children.length!==1||!O)}else if(S.type==="text"){const M=r.transWrapTextNodes,F=s?r.unescape(n.services.interpolator.interpolate(S.content,d,n.language)):n.services.interpolator.interpolate(S.content,d,n.language);M?w.push(qa(M,{key:`${S.name}-${_}`},F)):w.push(F)}return w},[])}const h=m([{dummy:!0,children:t||[]}],u,cl(t||[]));return Zy(h[0])}function C$(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:l,ns:u,i18n:d,t:f,shouldUnescape:p,...m}=t;const h=d||dw();if(!h)return sm("You will need to pass in an i18next instance by using i18nextReactModule"),e;const g=f||h.t.bind(h)||(I=>I);s&&(o.context=s);const y={...lC(),...h.options&&h.options.react};let v=u||g.ns||h.options&&h.options.defaultNS;v=typeof v=="string"?[v]:v||["translation"];const b=pC(e,y),E=c||b||y.transEmptyNodeValue||i,{hashTransKey:w}=y,S=i||(w?w(b||E):b||E);h.options&&h.options.interpolation&&h.options.interpolation.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...h.options.interpolation.defaultVariables}:{...h.options.interpolation.defaultVariables});const _=a?o.interpolation:{interpolation:{...o.interpolation,prefix:"#$?",suffix:"?$#"}},O={...o,count:n,...a,..._,defaultValue:E,ns:v},M=S?g(S,O):E;l&&Object.keys(l).forEach(I=>{const $=l[I];if(typeof $.type=="function"||!$.props||!$.props.children||M.indexOf(`${I}/>`)<0&&M.indexOf(`${I} />`)<0)return;function x(){return Ae.createElement(Ae.Fragment,null,$)}l[I]=Ae.createElement(x,null)});const F=O$(l||e,M,h,y,O,p),q=r!==void 0?r:y.defaultTransParent;return q?qa(q,m,F):F}const hC=fu();class R${constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function mC(t){let{children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o={},values:a,defaults:c,components:l,ns:u,i18n:d,t:f,shouldUnescape:p,...m}=t;const{i18n:h,defaultNS:g}=da(hC)||{},y=d||h||dw(),v=f||y&&y.t.bind(y);return C$({children:e,count:n,parent:r,i18nKey:i,context:s,tOptions:o,values:a,defaults:c,components:l,ns:u||v&&v.ns||g||y&&y.options&&y.options.defaultNS,i18n:y,t:f,shouldUnescape:p,...m})}const D$=(t,e)=>{const n=hn();return jt(()=>{n.current=t},[t,e]),n.current};function ha(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:r,defaultNS:i}=da(hC)||{},s=n||r||dw();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new R$),!s){sm("You will need to pass in an i18next instance by using initReactI18next");const b=(w,S)=>typeof S=="string"?S:S&&typeof S=="object"&&typeof S.defaultValue=="string"?S.defaultValue:Array.isArray(w)?w[w.length-1]:w,E=[b,{},!1];return E.t=b,E.i18n={},E.ready=!1,E}s.options.react&&s.options.react.wait!==void 0&&sm("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...lC(),...s.options.react,...e},{useSuspense:a,keyPrefix:c}=o;let l=i||s.options&&s.options.defaultNS;l=typeof l=="string"?[l]:l||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(l);const u=(s.isInitialized||s.initializedStoreOnce)&&l.every(b=>x$(b,s,o));function d(){return s.getFixedT(e.lng||null,o.nsMode==="fallback"?l:l[0],c)}const[f,p]=Qe(d);let m=l.join();e.lng&&(m=`${e.lng}${m}`);const h=D$(m),g=hn(!0);jt(()=>{const{bindI18n:b,bindI18nStore:E}=o;g.current=!0,!u&&!a&&(e.lng?P0(s,e.lng,l,()=>{g.current&&p(d)}):N0(s,l,()=>{g.current&&p(d)})),u&&h&&h!==m&&g.current&&p(d);function w(){g.current&&p(d)}return b&&s&&s.on(b,w),E&&s&&s.store.on(E,w),()=>{g.current=!1,b&&s&&b.split(" ").forEach(S=>s.off(S,w)),E&&s&&E.split(" ").forEach(S=>s.store.off(S,w))}},[s,m]);const y=hn(!0);jt(()=>{g.current&&!y.current&&p(d),y.current=!1},[s,c]);const v=[f,s,u];if(v.t=f,v.i18n=s,v.ready=u,u||!u&&!a)return v;throw new Promise(b=>{e.lng?P0(s,e.lng,l,()=>b()):N0(s,l,()=>b())})}function k$(t){return t?typeof t=="number"?{width:t.toString()+"px",height:t.toString()+"px"}:{width:t,height:t}:{}}const fw="-",A$=t=>{const e=P$(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(fw);return a[0]===""&&a.length!==1&&a.shift(),gC(a,e)||N$(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},gC=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?gC(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(fw);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},M0=/^\[(.+)\]$/,N$=t=>{if(M0.test(t)){const e=M0.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},P$=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return L$(Object.entries(t.classGroups),n).forEach(([s,o])=>{hb(o,r,s,e)}),r},hb=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:L0(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(M$(i)){hb(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{hb(o,L0(e,s),n,r)})})},L0=(t,e)=>{let n=t;return e.split(fw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},M$=t=>t.isThemeGetter,L$=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,F$=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},yC="!",$$=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=e.length,o=a=>{const c=[];let l=0,u=0,d;for(let g=0;g<a.length;g++){let y=a[g];if(l===0){if(y===i&&(r||a.slice(g,g+s)===e)){c.push(a.slice(u,g)),u=g+s;continue}if(y==="/"){d=g;continue}}y==="["?l++:y==="]"&&l--}const f=c.length===0?a:a.substring(u),p=f.startsWith(yC),m=p?f.substring(1):f,h=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}};return n?a=>n({className:a,parseClassName:o}):o},j$=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},U$=t=>({cache:F$(t.cacheSize),parseClassName:$$(t),...A$(t)}),B$=/\s+/,z$=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(B$);let a="";for(let c=o.length-1;c>=0;c-=1){const l=o[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(l);let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){a=l+(a.length>0?" "+a:a);continue}if(h=r(f),!h){a=l+(a.length>0?" "+a:a);continue}m=!1}const g=j$(u).join(":"),y=d?g+yC:g,v=y+h;if(s.includes(v))continue;s.push(v);const b=i(h,m);for(let E=0;E<b.length;++E){const w=b[E];s.push(y+w)}a=l+(a.length>0?" "+a:a)}return a};function Jf(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=vC(e))&&(r&&(r+=" "),r+=n);return r}const vC=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=vC(t[r]))&&(n&&(n+=" "),n+=e);return n};function V$(t,...e){let n,r,i,s=o;function o(c){const l=e.reduce((u,d)=>d(u),t());return n=U$(l),r=n.cache.get,i=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=z$(c,n);return i(c,u),u}return function(){return s(Jf.apply(null,arguments))}}const mn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},bC=/^\[(?:([a-z-]+):)?(.+)\]$/i,H$=/^\d+\/\d+$/,W$=new Set(["px","full","screen"]),q$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,G$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Z$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Y$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,K$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ls=t=>ml(t)||W$.has(t)||H$.test(t),wo=t=>pu(t,"length",ij),ml=t=>!!t&&!Number.isNaN(Number(t)),Yy=t=>pu(t,"number",ml),Pu=t=>!!t&&Number.isInteger(Number(t)),J$=t=>t.endsWith("%")&&ml(t.slice(0,-1)),xt=t=>bC.test(t),Eo=t=>q$.test(t),X$=new Set(["length","size","percentage"]),Q$=t=>pu(t,X$,_C),ej=t=>pu(t,"position",_C),tj=new Set(["image","url"]),nj=t=>pu(t,tj,oj),rj=t=>pu(t,"",sj),Mu=()=>!0,pu=(t,e,n)=>{const r=bC.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},ij=t=>G$.test(t)&&!Z$.test(t),_C=()=>!1,sj=t=>Y$.test(t),oj=t=>K$.test(t),aj=()=>{const t=mn("colors"),e=mn("spacing"),n=mn("blur"),r=mn("brightness"),i=mn("borderColor"),s=mn("borderRadius"),o=mn("borderSpacing"),a=mn("borderWidth"),c=mn("contrast"),l=mn("grayscale"),u=mn("hueRotate"),d=mn("invert"),f=mn("gap"),p=mn("gradientColorStops"),m=mn("gradientColorStopPositions"),h=mn("inset"),g=mn("margin"),y=mn("opacity"),v=mn("padding"),b=mn("saturate"),E=mn("scale"),w=mn("sepia"),S=mn("skew"),_=mn("space"),O=mn("translate"),M=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",xt,e],I=()=>[xt,e],$=()=>["",Ls,wo],x=()=>["auto",ml,xt],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",xt],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[ml,xt];return{cacheSize:500,separator:":",theme:{colors:[Mu],spacing:[Ls,wo],blur:["none","",Eo,xt],brightness:U(),borderColor:[t],borderRadius:["none","","full",Eo,xt],borderSpacing:I(),borderWidth:$(),contrast:U(),grayscale:L(),hueRotate:U(),invert:L(),gap:I(),gradientColorStops:[t],gradientColorStopPositions:[J$,wo],inset:q(),margin:q(),opacity:U(),padding:I(),saturate:U(),scale:U(),sepia:L(),skew:U(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",xt]}],container:["container"],columns:[{columns:[Eo]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),xt]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Pu,xt]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xt]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",Pu,xt]}],"grid-cols":[{"grid-cols":[Mu]}],"col-start-end":[{col:["auto",{span:["full",Pu,xt]},xt]}],"col-start":[{"col-start":x()}],"col-end":[{"col-end":x()}],"grid-rows":[{"grid-rows":[Mu]}],"row-start-end":[{row:["auto",{span:[Pu,xt]},xt]}],"row-start":[{"row-start":x()}],"row-end":[{"row-end":x()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...J()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...J(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...J(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",xt,e]}],"min-w":[{"min-w":[xt,e,"min","max","fit"]}],"max-w":[{"max-w":[xt,e,"none","full","min","max","fit","prose",{screen:[Eo]},Eo]}],h:[{h:[xt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[xt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Eo,wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yy]}],"font-family":[{font:[Mu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",xt]}],"line-clamp":[{"line-clamp":["none",ml,Yy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ls,xt]}],"list-image":[{"list-image":["none",xt]}],"list-style-type":[{list:["none","disc","decimal",xt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ls,wo]}],"underline-offset":[{"underline-offset":["auto",Ls,xt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),ej]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Q$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nj]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:P()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[Ls,xt]}],"outline-w":[{outline:[Ls,wo]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ls,wo]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Eo,rj]}],"shadow-color":[{shadow:[Mu]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Eo,xt]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xt]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",xt]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",xt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Pu,xt]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ls,wo,Yy]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},St=V$(aj);var cj="Expected a function",F0=NaN,lj="[object Symbol]",uj=/^\s+|\s+$/g,dj=/^[-+]0x[0-9a-f]+$/i,fj=/^0b[01]+$/i,pj=/^0o[0-7]+$/i,hj=parseInt,mj=typeof dr=="object"&&dr&&dr.Object===Object&&dr,gj=typeof self=="object"&&self&&self.Object===Object&&self,yj=mj||gj||Function("return this")(),vj=Object.prototype,bj=vj.toString,_j=Math.max,wj=Math.min,Ky=function(){return yj.Date.now()};function Ej(t,e,n){var r,i,s,o,a,c,l=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(cj);e=$0(e)||0,mb(n)&&(u=!!n.leading,d="maxWait"in n,s=d?_j($0(n.maxWait)||0,e):s,f="trailing"in n?!!n.trailing:f);function p(S){var _=r,O=i;return r=i=void 0,l=S,o=t.apply(O,_),o}function m(S){return l=S,a=setTimeout(y,e),u?p(S):o}function h(S){var _=S-c,O=S-l,M=e-_;return d?wj(M,s-O):M}function g(S){var _=S-c,O=S-l;return c===void 0||_>=e||_<0||d&&O>=s}function y(){var S=Ky();if(g(S))return v(S);a=setTimeout(y,h(S))}function v(S){return a=void 0,f&&r?p(S):(r=i=void 0,o)}function b(){a!==void 0&&clearTimeout(a),l=0,r=c=i=a=void 0}function E(){return a===void 0?o:v(Ky())}function w(){var S=Ky(),_=g(S);if(r=arguments,i=this,c=S,_){if(a===void 0)return m(c);if(d)return a=setTimeout(y,e),p(c)}return a===void 0&&(a=setTimeout(y,e)),o}return w.cancel=b,w.flush=E,w}function mb(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Sj(t){return!!t&&typeof t=="object"}function xj(t){return typeof t=="symbol"||Sj(t)&&bj.call(t)==lj}function $0(t){if(typeof t=="number")return t;if(xj(t))return F0;if(mb(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=mb(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(uj,"");var n=fj.test(t);return n||pj.test(t)?hj(t.slice(2),n?2:8):dj.test(t)?F0:+t}var Tj=Ej;const j0=pa(Tj);var Ij=typeof window<"u"?Kf:jt;function Oj(t,e,n,r){const i=hn(e);Ij(()=>{i.current=e},[e]),jt(()=>{const s=window;if(!(s&&s.addEventListener))return;const o=a=>{i.current(a)};return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,n,r])}function Qpe(){const[t,e]=Qe(null),n=xe(async r=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch(i){return console.warn("Copy failed",i),e(null),!1}},[]);return[t,n]}function Cj(t){const e=hn(t);e.current=t,jt(()=>()=>{e.current()},[])}function Rj(t,e=500,n){const r=hn();Cj(()=>{r.current&&r.current.cancel()});const i=En(()=>{const s=j0(t,e,n),o=(...a)=>s(...a);return o.cancel=()=>{s.cancel()},o.isPending=()=>!!r.current,o.flush=()=>s.flush(),o},[t,e,n]);return jt(()=>{r.current=j0(t,e,n)},[t,e,n]),i}function Dj(t,e,n){const r=(l,u)=>l===u,i=t instanceof Function?t():t,[s,o]=Qe(i),a=hn(i),c=Rj(o,e,n);return r(a.current,i)||(c(i),a.current=i),[s,c]}function ehe(t,e,n="mousedown",r={}){Oj(n,i=>{const s=i.target;if(!s||!s.isConnected)return;(Array.isArray(t)?t.filter(a=>!!a.current).every(a=>a.current&&!a.current.contains(s)):t.current&&!t.current.contains(s))&&e(i)},void 0,r)}const kj=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})};function Aj(t){return T("div",{style:{width:t.width,height:t.height}})}function Nj(t){try{return s$(()=>kj(Object.assign({"../../../assets/icon-components/ArrowFilledRight.tsx":()=>Te(()=>import("./ArrowFilledRight-BXP1j8Cl.js"),[]),"../../../assets/icon-components/ArrowLeft.tsx":()=>Te(()=>import("./ArrowLeft-8ZR_YHAJ.js"),[]),"../../../assets/icon-components/ArrowUp.tsx":()=>Te(()=>import("./ArrowUp-E2jS6Wzt.js"),[]),"../../../assets/icon-components/BarChart.tsx":()=>Te(()=>import("./BarChart-C-E6t7dt.js"),[]),"../../../assets/icon-components/BaseArrowLeft.tsx":()=>Te(()=>import("./BaseArrowLeft-DtHrkTW4.js"),[]),"../../../assets/icon-components/BaseArrowRight.tsx":()=>Te(()=>import("./BaseArrowRight-BIwzFHnh.js"),[]),"../../../assets/icon-components/Braces.tsx":()=>Te(()=>import("./Braces-3LcexUsR.js"),[]),"../../../assets/icon-components/Branch.tsx":()=>Te(()=>import("./Branch-D0CssEh3.js"),[]),"../../../assets/icon-components/BrickGlobe.tsx":()=>Te(()=>import("./BrickGlobe-CdHw7ZVP.js"),[]),"../../../assets/icon-components/Briefcase.tsx":()=>Te(()=>import("./Briefcase-CV2bgnSj.js"),[]),"../../../assets/icon-components/Calendar.tsx":()=>Te(()=>import("./Calendar-DuXN-sPt.js"),[]),"../../../assets/icon-components/CalendarTime.tsx":()=>Te(()=>import("./CalendarTime-BowYBiVM.js"),[]),"../../../assets/icon-components/Caret.tsx":()=>Te(()=>import("./Caret-r16V7Hcs.js"),[]),"../../../assets/icon-components/CaretDown.tsx":()=>Te(()=>import("./CaretDown-DljrBfIz.js"),[]),"../../../assets/icon-components/CaretLeft.tsx":()=>Te(()=>import("./CaretLeft-B_Lzd_Rn.js"),[]),"../../../assets/icon-components/CaretRight.tsx":()=>Te(()=>import("./CaretRight-Bbz5nCpg.js"),[]),"../../../assets/icon-components/CaretSort.tsx":()=>Te(()=>import("./CaretSort-DSgBum1h.js"),[]),"../../../assets/icon-components/Check.tsx":()=>Te(()=>import("./Check-CbV9BYHY.js"),[]),"../../../assets/icon-components/CheckCircle.tsx":()=>Te(()=>import("./CheckCircle-CX2jIKoF.js"),[]),"../../../assets/icon-components/CheckCircleFill.tsx":()=>Te(()=>import("./CheckCircleFill-DLK12sW5.js"),[]),"../../../assets/icon-components/Checkmark.tsx":()=>Te(()=>import("./Checkmark-DBvUEZAd.js"),[]),"../../../assets/icon-components/ChevronDown.tsx":()=>Te(()=>import("./ChevronDown-eUsCPXcB.js"),[]),"../../../assets/icon-components/Circle.tsx":()=>Te(()=>import("./Circle-8dOehHQf.js"),[]),"../../../assets/icon-components/CircleInfo.tsx":()=>Te(()=>import("./CircleInfo-D0ktZDko.js"),[]),"../../../assets/icon-components/Clock.tsx":()=>Te(()=>import("./Clock-CudavWaE.js"),[]),"../../../assets/icon-components/ClockFill.tsx":()=>Te(()=>import("./ClockFill-yWs52y_e.js"),[]),"../../../assets/icon-components/CloudSlash.tsx":()=>Te(()=>import("./CloudSlash-D18Hl3VW.js"),[]),"../../../assets/icon-components/Collapse.tsx":()=>Te(()=>import("./Collapse-BOxZH5-e.js"),[]),"../../../assets/icon-components/Connect.tsx":()=>Te(()=>import("./Connect-laqJZT3s.js"),[]),"../../../assets/icon-components/Copy.tsx":()=>Te(()=>import("./Copy-CkOtWZ6m.js"),[]),"../../../assets/icon-components/CrossCircle.tsx":()=>Te(()=>import("./CrossCircle-Bp9diEe9.js"),[]),"../../../assets/icon-components/Danger.tsx":()=>Te(()=>import("./Danger-CLu7nxgz.js"),[]),"../../../assets/icon-components/Discord.tsx":()=>Te(()=>import("./Discord-CcPWRT8g.js"),[]),"../../../assets/icon-components/Drive.tsx":()=>Te(()=>import("./Drive-CzahDx9j.js"),[]),"../../../assets/icon-components/Edit.tsx":()=>Te(()=>import("./Edit-D9GlgGu8.js"),[]),"../../../assets/icon-components/Ellipsis.tsx":()=>Te(()=>import("./Ellipsis-DWNUJYUI.js"),[]),"../../../assets/icon-components/Error.tsx":()=>Te(()=>import("./Error-FBAhqFT5.js"),[]),"../../../assets/icon-components/Exclamation.tsx":()=>Te(()=>import("./Exclamation-BGFGsVRw.js"),[]),"../../../assets/icon-components/File.tsx":()=>Te(()=>import("./File-DWKl25DR.js"),[]),"../../../assets/icon-components/FilesEarmark.tsx":()=>Te(()=>import("./FilesEarmark-BTL53WSf.js"),[]),"../../../assets/icon-components/FolderClose.tsx":()=>Te(()=>import("./FolderClose-BVMKeKvW.js"),[]),"../../../assets/icon-components/FolderOpen.tsx":()=>Te(()=>import("./FolderOpen-DT55_X9N.js"),[]),"../../../assets/icon-components/FolderPlus.tsx":()=>Te(()=>import("./FolderPlus-C2G5PVs-.js"),[]),"../../../assets/icon-components/Forum.tsx":()=>Te(()=>import("./Forum-Cfgyizyn.js"),[]),"../../../assets/icon-components/Gear.tsx":()=>Te(()=>import("./Gear-CoQ9O06k.js"),[]),"../../../assets/icon-components/Github.tsx":()=>Te(()=>import("./Github-CjkZIHCO.js"),[]),"../../../assets/icon-components/Globe.tsx":()=>Te(()=>import("./Globe-Dy2otZRk.js"),[]),"../../../assets/icon-components/GlobeWww.tsx":()=>Te(()=>import("./GlobeWww-Ci7aa5CE.js"),[]),"../../../assets/icon-components/Hdd.tsx":()=>Te(()=>import("./Hdd-CP-hFB7d.js"),[]),"../../../assets/icon-components/History.tsx":()=>Te(()=>import("./History-CmOiP5qa.js"),[]),"../../../assets/icon-components/InfoSquare.tsx":()=>Te(()=>import("./InfoSquare-DbYZrwmg.js"),[]),"../../../assets/icon-components/Link.tsx":()=>Te(()=>import("./Link-CXIVQOz6.js"),[]),"../../../assets/icon-components/Linkedin.tsx":()=>Te(()=>import("./Linkedin-exhl1yGN.js"),[]),"../../../assets/icon-components/Lock.tsx":()=>Te(()=>import("./Lock-DWdDRi_O.js"),[]),"../../../assets/icon-components/M.tsx":()=>Te(()=>import("./M-ByQIo8bX.js"),[]),"../../../assets/icon-components/PackageManager.tsx":()=>Te(()=>import("./PackageManager-D6Ia8zHs.js"),[]),"../../../assets/icon-components/Pencil.tsx":()=>Te(()=>import("./Pencil-D830iveq.js"),[]),"../../../assets/icon-components/People.tsx":()=>Te(()=>import("./People-B1tewG8c.js"),[]),"../../../assets/icon-components/Person.tsx":()=>Te(()=>import("./Person-BPRmm67U.js"),[]),"../../../assets/icon-components/Pin.tsx":()=>Te(()=>import("./Pin-D53eCMAz.js"),[]),"../../../assets/icon-components/PinFilled.tsx":()=>Te(()=>import("./PinFilled-CMXfFW67.js"),[]),"../../../assets/icon-components/Plus.tsx":()=>Te(()=>import("./Plus-XUIm1wNw.js"),[]),"../../../assets/icon-components/PlusCircle.tsx":()=>Te(()=>import("./PlusCircle-D1IRYULb.js"),[]),"../../../assets/icon-components/PowerhouseLogoSmall.tsx":()=>Te(()=>import("./PowerhouseLogoSmall-DF1uUwIC.js"),[]),"../../../assets/icon-components/Project.tsx":()=>Te(()=>import("./Project-EsBam9d0.js"),[]),"../../../assets/icon-components/QuestionSquare.tsx":()=>Te(()=>import("./QuestionSquare-CDaw1i6L.js"),[]),"../../../assets/icon-components/RedoArrow.tsx":()=>Te(()=>import("./RedoArrow-DM-fqhEP.js"),[]),"../../../assets/icon-components/Reload.tsx":()=>Te(()=>import("./Reload-DPZbA7yl.js"),[]),"../../../assets/icon-components/Renown.tsx":()=>Te(()=>import("./Renown-CItksi2j.js"),[]),"../../../assets/icon-components/RenownHover.tsx":()=>Te(()=>import("./RenownHover-cYQgnwQW.js"),[]),"../../../assets/icon-components/Ring.tsx":()=>Te(()=>import("./Ring-BivnmVc5.js"),[]),"../../../assets/icon-components/Save.tsx":()=>Te(()=>import("./Save-BWCZPY82.js"),[]),"../../../assets/icon-components/Search.tsx":()=>Te(()=>import("./Search-BiEcSbcf.js"),[]),"../../../assets/icon-components/Server.tsx":()=>Te(()=>import("./Server-cAzmNxsS.js"),[]),"../../../assets/icon-components/Settings.tsx":()=>Te(()=>import("./Settings-Cca-sV-_.js"),[]),"../../../assets/icon-components/Synced.tsx":()=>Te(()=>import("./Synced-CjieGKOk.js"),[]),"../../../assets/icon-components/Syncing.tsx":()=>Te(()=>import("./Syncing-KnDBLSYe.js"),[]),"../../../assets/icon-components/Trash.tsx":()=>Te(()=>import("./Trash-DIHOD5wQ.js"),[]),"../../../assets/icon-components/TrashFill.tsx":()=>Te(()=>import("./TrashFill-CG3humXp.js"),[]),"../../../assets/icon-components/TreeViewSlash.tsx":()=>Te(()=>import("./TreeViewSlash-CKJADIpa.js"),[]),"../../../assets/icon-components/TriangleDown.tsx":()=>Te(()=>import("./TriangleDown-Boh-WZzH.js"),[]),"../../../assets/icon-components/VariantArrowLeft.tsx":()=>Te(()=>import("./VariantArrowLeft-Dl1-3L5q.js"),[]),"../../../assets/icon-components/VerticalDots.tsx":()=>Te(()=>import("./VerticalDots-CCZxgZM8.js"),[]),"../../../assets/icon-components/WarningFill.tsx":()=>Te(()=>import("./WarningFill-CRRaW3Oz.js"),[]),"../../../assets/icon-components/XTwitter.tsx":()=>Te(()=>import("./XTwitter-CW6IaHUb.js"),[]),"../../../assets/icon-components/Xmark.tsx":()=>Te(()=>import("./Xmark-CZ3t0Fap.js"),[]),"../../../assets/icon-components/XmarkLight.tsx":()=>Te(()=>import("./XmarkLight-BkhBFy51.js"),[]),"../../../assets/icon-components/Youtube.tsx":()=>Te(()=>import("./Youtube-h-Dc9pri.js"),[])}),`../../../assets/icon-components/${t}.tsx`,6))}catch(e){return console.error(e),Aj}}function ze({name:t,size:e=24,color:n,style:r,...i}){const s=k$(e),o={color:n,...s,style:r},a=En(()=>Nj(t),[t]);return T(cC,{fallback:T("div",{"data-testid":"icon-fallback",style:s}),name:"icon-component",children:T(a,{...i,style:o})})}function Qa(t){"@babel/helpers - typeof";return Qa=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},Qa(t)}function Pj(t,e){if(Qa(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Qa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wC(t){var e=Pj(t,"string");return Qa(e)=="symbol"?e:e+""}function Qu(t,e,n){return(e=wC(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U0(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 lt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?U0(Object(n),!0).forEach(function(r){Qu(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Mj(t){if(Array.isArray(t))return t}function Lj(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,o,a=[],c=!0,l=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return a}}function gb(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 EC(t,e){if(t){if(typeof t=="string")return gb(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)?gb(t,e):void 0}}function Fj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xs(t,e){return Mj(t)||Lj(t,e)||EC(t,e)||Fj()}function $j(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function po(t,e){if(t==null)return{};var n,r,i=$j(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var jj=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Uj(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,i=r===void 0?!1:r,s=t.defaultValue,o=s===void 0?null:s,a=t.inputValue,c=t.menuIsOpen,l=t.onChange,u=t.onInputChange,d=t.onMenuClose,f=t.onMenuOpen,p=t.value,m=po(t,jj),h=Qe(a!==void 0?a:n),g=Xs(h,2),y=g[0],v=g[1],b=Qe(c!==void 0?c:i),E=Xs(b,2),w=E[0],S=E[1],_=Qe(p!==void 0?p:o),O=Xs(_,2),M=O[0],F=O[1],q=xe(function(J,L){typeof l=="function"&&l(J,L),F(J)},[l]),I=xe(function(J,L){var G;typeof u=="function"&&(G=u(J,L)),v(G!==void 0?G:J)},[u]),$=xe(function(){typeof f=="function"&&f(),S(!0)},[f]),x=xe(function(){typeof d=="function"&&d(),S(!1)},[d]),A=a!==void 0?a:y,P=c!==void 0?c:w,B=p!==void 0?p:M;return lt(lt({},m),{},{inputValue:A,menuIsOpen:P,onChange:q,onInputChange:I,onMenuClose:x,onMenuOpen:$,value:B})}function Bj(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B0(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,wC(r.key),r)}}function zj(t,e,n){return B0(t.prototype,e),B0(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function yb(t,e){return yb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},yb(t,e)}function Vj(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&&yb(t,e)}function om(t){return om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},om(t)}function SC(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SC=function(){return!!t})()}function Hj(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wj(t,e){if(e&&(Qa(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hj(t)}function qj(t){var e=SC();return function(){var n,r=om(t);if(e){var i=om(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Wj(this,n)}}function Gj(t){if(Array.isArray(t))return gb(t)}function Zj(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Yj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pw(t){return Gj(t)||Zj(t)||EC(t)||Yj()}function Kj(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function Jj(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Xj=function(){function t(n){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Jj(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=Kj(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},t}(),lr="-ms-",am="-moz-",Yt="-webkit-",xC="comm",hw="rule",mw="decl",Qj="@import",TC="@keyframes",eU="@layer",tU=Math.abs,xg=String.fromCharCode,nU=Object.assign;function rU(t,e){return ir(t,0)^45?(((e<<2^ir(t,0))<<2^ir(t,1))<<2^ir(t,2))<<2^ir(t,3):0}function IC(t){return t.trim()}function iU(t,e){return(t=e.exec(t))?t[0]:t}function Kt(t,e,n){return t.replace(e,n)}function vb(t,e){return t.indexOf(e)}function ir(t,e){return t.charCodeAt(e)|0}function Ad(t,e,n){return t.slice(e,n)}function as(t){return t.length}function gw(t){return t.length}function Pp(t,e){return e.push(t),t}function sU(t,e){return t.map(e).join("")}var Tg=1,jl=1,OC=0,jr=0,Un=0,hu="";function Ig(t,e,n,r,i,s,o){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:Tg,column:jl,length:o,return:""}}function Lu(t,e){return nU(Ig("",null,null,"",null,null,0),t,{length:-t.length},e)}function oU(){return Un}function aU(){return Un=jr>0?ir(hu,--jr):0,jl--,Un===10&&(jl=1,Tg--),Un}function Jr(){return Un=jr<OC?ir(hu,jr++):0,jl++,Un===10&&(jl=1,Tg++),Un}function ys(){return ir(hu,jr)}function Rh(){return jr}function Xf(t,e){return Ad(hu,t,e)}function Nd(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 CC(t){return Tg=jl=1,OC=as(hu=t),jr=0,[]}function RC(t){return hu="",t}function Dh(t){return IC(Xf(jr-1,bb(t===91?t+2:t===40?t+1:t)))}function cU(t){for(;(Un=ys())&&Un<33;)Jr();return Nd(t)>2||Nd(Un)>3?"":" "}function lU(t,e){for(;--e&&Jr()&&!(Un<48||Un>102||Un>57&&Un<65||Un>70&&Un<97););return Xf(t,Rh()+(e<6&&ys()==32&&Jr()==32))}function bb(t){for(;Jr();)switch(Un){case t:return jr;case 34:case 39:t!==34&&t!==39&&bb(Un);break;case 40:t===41&&bb(t);break;case 92:Jr();break}return jr}function uU(t,e){for(;Jr()&&t+Un!==57;)if(t+Un===84&&ys()===47)break;return"/*"+Xf(e,jr-1)+"*"+xg(t===47?t:Jr())}function dU(t){for(;!Nd(ys());)Jr();return Xf(t,jr)}function fU(t){return RC(kh("",null,null,null,[""],t=CC(t),0,[0],t))}function kh(t,e,n,r,i,s,o,a,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,y=1,v=0,b="",E=i,w=s,S=r,_=b;g;)switch(m=v,v=Jr()){case 40:if(m!=108&&ir(_,d-1)==58){vb(_+=Kt(Dh(v),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:_+=Dh(v);break;case 9:case 10:case 13:case 32:_+=cU(m);break;case 92:_+=lU(Rh()-1,7);continue;case 47:switch(ys()){case 42:case 47:Pp(pU(uU(Jr(),Rh()),e,n),c);break;default:_+="/"}break;case 123*h:a[l++]=as(_)*y;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:y==-1&&(_=Kt(_,/\f/g,"")),p>0&&as(_)-d&&Pp(p>32?V0(_+";",r,n,d-1):V0(Kt(_," ","")+";",r,n,d-2),c);break;case 59:_+=";";default:if(Pp(S=z0(_,e,n,l,u,i,a,b,E=[],w=[],d),s),v===123)if(u===0)kh(_,e,S,S,E,s,d,a,w);else switch(f===99&&ir(_,3)===110?100:f){case 100:case 108:case 109:case 115:kh(t,S,S,r&&Pp(z0(t,S,S,0,0,i,a,b,i,E=[],d),w),i,w,d,a,r?E:w);break;default:kh(_,S,S,S,[""],w,0,a,w)}}l=u=p=0,h=y=1,b=_="",d=o;break;case 58:d=1+as(_),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&aU()==125)continue}switch(_+=xg(v),v*h){case 38:y=u>0?1:(_+="\f",-1);break;case 44:a[l++]=(as(_)-1)*y,y=1;break;case 64:ys()===45&&(_+=Dh(Jr())),f=ys(),u=d=as(b=_+=dU(Rh())),v++;break;case 45:m===45&&as(_)==2&&(h=0)}}return s}function z0(t,e,n,r,i,s,o,a,c,l,u){for(var d=i-1,f=i===0?s:[""],p=gw(f),m=0,h=0,g=0;m<r;++m)for(var y=0,v=Ad(t,d+1,d=tU(h=o[m])),b=t;y<p;++y)(b=IC(h>0?f[y]+" "+v:Kt(v,/&\f/g,f[y])))&&(c[g++]=b);return Ig(t,e,n,i===0?hw:a,c,l,u)}function pU(t,e,n){return Ig(t,e,n,xC,xg(oU()),Ad(t,2,-2),0)}function V0(t,e,n,r){return Ig(t,e,n,mw,Ad(t,0,r),Ad(t,r+1,-1),r)}function gl(t,e){for(var n="",r=gw(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function hU(t,e,n,r){switch(t.type){case eU:if(t.children.length)break;case Qj:case mw:return t.return=t.return||t.value;case xC:return"";case TC:return t.return=t.value+"{"+gl(t.children,r)+"}";case hw:t.value=t.props.join(",")}return as(n=gl(t.children,r))?t.return=t.value+"{"+n+"}":""}function mU(t){var e=gw(t);return function(n,r,i,s){for(var o="",a=0;a<e;a++)o+=t[a](n,r,i,s)||"";return o}}function gU(t){return function(e){e.root||(e=e.return)&&t(e)}}function yU(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var vU=function(e,n,r){for(var i=0,s=0;i=s,s=ys(),i===38&&s===12&&(n[r]=1),!Nd(s);)Jr();return Xf(e,jr)},bU=function(e,n){var r=-1,i=44;do switch(Nd(i)){case 0:i===38&&ys()===12&&(n[r]=1),e[r]+=vU(jr-1,n,r);break;case 2:e[r]+=Dh(i);break;case 4:if(i===44){e[++r]=ys()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=xg(i)}while(i=Jr());return e},_U=function(e,n){return RC(bU(CC(e),n))},H0=new WeakMap,wU=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!H0.get(r))&&!i){H0.set(e,!0);for(var s=[],o=_U(n,s),a=r.props,c=0,l=0;c<o.length;c++)for(var u=0;u<a.length;u++,l++)e.props[l]=s[c]?o[c].replace(/&\f/g,a[u]):a[u]+" "+o[c]}}},EU=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function DC(t,e){switch(rU(t,e)){case 5103:return Yt+"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 Yt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Yt+t+am+t+lr+t+t;case 6828:case 4268:return Yt+t+lr+t+t;case 6165:return Yt+t+lr+"flex-"+t+t;case 5187:return Yt+t+Kt(t,/(\w+).+(:[^]+)/,Yt+"box-$1$2"+lr+"flex-$1$2")+t;case 5443:return Yt+t+lr+"flex-item-"+Kt(t,/flex-|-self/,"")+t;case 4675:return Yt+t+lr+"flex-line-pack"+Kt(t,/align-content|flex-|-self/,"")+t;case 5548:return Yt+t+lr+Kt(t,"shrink","negative")+t;case 5292:return Yt+t+lr+Kt(t,"basis","preferred-size")+t;case 6060:return Yt+"box-"+Kt(t,"-grow","")+Yt+t+lr+Kt(t,"grow","positive")+t;case 4554:return Yt+Kt(t,/([^-])(transform)/g,"$1"+Yt+"$2")+t;case 6187:return Kt(Kt(Kt(t,/(zoom-|grab)/,Yt+"$1"),/(image-set)/,Yt+"$1"),t,"")+t;case 5495:case 3959:return Kt(t,/(image-set\([^]*)/,Yt+"$1$`$1");case 4968:return Kt(Kt(t,/(.+:)(flex-)?(.*)/,Yt+"box-pack:$3"+lr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Yt+t+t;case 4095:case 3583:case 4068:case 2532:return Kt(t,/(.+)-inline(.+)/,Yt+"$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(ir(t,e+1)){case 109:if(ir(t,e+4)!==45)break;case 102:return Kt(t,/(.+:)(.+)-([^]+)/,"$1"+Yt+"$2-$3$1"+am+(ir(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~vb(t,"stretch")?DC(Kt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(ir(t,e+1)!==115)break;case 6444:switch(ir(t,as(t)-3-(~vb(t,"!important")&&10))){case 107:return Kt(t,":",":"+Yt)+t;case 101:return Kt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Yt+(ir(t,14)===45?"inline-":"")+"box$3$1"+Yt+"$2$3$1"+lr+"$2box$3")+t}break;case 5936:switch(ir(t,e+11)){case 114:return Yt+t+lr+Kt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Yt+t+lr+Kt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Yt+t+lr+Kt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Yt+t+lr+t+t}return t}var SU=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case mw:e.return=DC(e.value,e.length);break;case TC:return gl([Lu(e,{value:Kt(e.value,"@","@"+Yt)})],i);case hw:if(e.length)return sU(e.props,function(s){switch(iU(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return gl([Lu(e,{props:[Kt(s,/:(read-\w+)/,":"+am+"$1")]})],i);case"::placeholder":return gl([Lu(e,{props:[Kt(s,/:(plac\w+)/,":"+Yt+"input-$1")]}),Lu(e,{props:[Kt(s,/:(plac\w+)/,":"+am+"$1")]}),Lu(e,{props:[Kt(s,/:(plac\w+)/,lr+"input-$1")]})],i)}return""})}},xU=[SU],TU=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(h){var g=h.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(h),h.setAttribute("data-s",""))})}var i=e.stylisPlugins||xU,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(h){for(var g=h.getAttribute("data-emotion").split(" "),y=1;y<g.length;y++)s[g[y]]=!0;a.push(h)});var c,l=[wU,EU];{var u,d=[hU,gU(function(h){u.insert(h)})],f=mU(l.concat(i,d)),p=function(g){return gl(fU(g),f)};c=function(g,y,v,b){u=v,p(g?g+"{"+y.styles+"}":y.styles),b&&(m.inserted[y.name]=!0)}}var m={key:n,sheet:new Xj({key:n,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:c};return m.sheet.hydrate(a),m},kC={exports:{}},sn={};/** @license React v16.13.1
5
+ * react-is.production.min.js
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */var Qn=typeof Symbol=="function"&&Symbol.for,yw=Qn?Symbol.for("react.element"):60103,vw=Qn?Symbol.for("react.portal"):60106,Og=Qn?Symbol.for("react.fragment"):60107,Cg=Qn?Symbol.for("react.strict_mode"):60108,Rg=Qn?Symbol.for("react.profiler"):60114,Dg=Qn?Symbol.for("react.provider"):60109,kg=Qn?Symbol.for("react.context"):60110,bw=Qn?Symbol.for("react.async_mode"):60111,Ag=Qn?Symbol.for("react.concurrent_mode"):60111,Ng=Qn?Symbol.for("react.forward_ref"):60112,Pg=Qn?Symbol.for("react.suspense"):60113,IU=Qn?Symbol.for("react.suspense_list"):60120,Mg=Qn?Symbol.for("react.memo"):60115,Lg=Qn?Symbol.for("react.lazy"):60116,OU=Qn?Symbol.for("react.block"):60121,CU=Qn?Symbol.for("react.fundamental"):60117,RU=Qn?Symbol.for("react.responder"):60118,DU=Qn?Symbol.for("react.scope"):60119;function ri(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case yw:switch(t=t.type,t){case bw:case Ag:case Og:case Rg:case Cg:case Pg:return t;default:switch(t=t&&t.$$typeof,t){case kg:case Ng:case Lg:case Mg:case Dg:return t;default:return e}}case vw:return e}}}function AC(t){return ri(t)===Ag}sn.AsyncMode=bw;sn.ConcurrentMode=Ag;sn.ContextConsumer=kg;sn.ContextProvider=Dg;sn.Element=yw;sn.ForwardRef=Ng;sn.Fragment=Og;sn.Lazy=Lg;sn.Memo=Mg;sn.Portal=vw;sn.Profiler=Rg;sn.StrictMode=Cg;sn.Suspense=Pg;sn.isAsyncMode=function(t){return AC(t)||ri(t)===bw};sn.isConcurrentMode=AC;sn.isContextConsumer=function(t){return ri(t)===kg};sn.isContextProvider=function(t){return ri(t)===Dg};sn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===yw};sn.isForwardRef=function(t){return ri(t)===Ng};sn.isFragment=function(t){return ri(t)===Og};sn.isLazy=function(t){return ri(t)===Lg};sn.isMemo=function(t){return ri(t)===Mg};sn.isPortal=function(t){return ri(t)===vw};sn.isProfiler=function(t){return ri(t)===Rg};sn.isStrictMode=function(t){return ri(t)===Cg};sn.isSuspense=function(t){return ri(t)===Pg};sn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Og||t===Ag||t===Rg||t===Cg||t===Pg||t===IU||typeof t=="object"&&t!==null&&(t.$$typeof===Lg||t.$$typeof===Mg||t.$$typeof===Dg||t.$$typeof===kg||t.$$typeof===Ng||t.$$typeof===CU||t.$$typeof===RU||t.$$typeof===DU||t.$$typeof===OU)};sn.typeOf=ri;kC.exports=sn;var kU=kC.exports,NC=kU,AU={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},NU={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},PC={};PC[NC.ForwardRef]=AU;PC[NC.Memo]=NU;var PU=!0;function MU(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var MC=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||PU===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},LU=function(e,n,r){MC(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var s=n;do e.insert(n===s?"."+i:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function FU(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var $U={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},jU=/[A-Z]|^ms/g,UU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,LC=function(e){return e.charCodeAt(1)===45},W0=function(e){return e!=null&&typeof e!="boolean"},Jy=yU(function(t){return LC(t)?t:t.replace(jU,"-$&").toLowerCase()}),q0=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(UU,function(r,i,s){return cs={name:i,styles:s,next:cs},i})}return $U[e]!==1&&!LC(e)&&typeof n=="number"&&n!==0?n+"px":n};function Pd(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return cs={name:i.name,styles:i.styles,next:cs},i.name;var s=n;if(s.styles!==void 0){var o=s.next;if(o!==void 0)for(;o!==void 0;)cs={name:o.name,styles:o.styles,next:cs},o=o.next;var a=s.styles+";";return a}return BU(t,e,n)}case"function":{if(t!==void 0){var c=cs,l=n(t);return cs=c,Pd(t,e,l)}break}}var u=n;return u}function BU(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Pd(t,e,n[i])+";";else for(var s in n){var o=n[s];if(typeof o!="object"){var a=o;W0(a)&&(r+=Jy(s)+":"+q0(s,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&e==null)for(var c=0;c<o.length;c++)W0(o[c])&&(r+=Jy(s)+":"+q0(s,o[c])+";");else{var l=Pd(t,e,o);switch(s){case"animation":case"animationName":{r+=Jy(s)+":"+l+";";break}default:r+=s+"{"+l+"}"}}}return r}var G0=/label:\s*([^\s;{]+)\s*(;|$)/g,cs;function FC(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";cs=void 0;var s=t[0];if(s==null||s.raw===void 0)r=!1,i+=Pd(n,e,s);else{var o=s;i+=o[0]}for(var a=1;a<t.length;a++)if(i+=Pd(n,e,t[a]),r){var c=s;i+=c[a]}G0.lastIndex=0;for(var l="",u;(u=G0.exec(i))!==null;)l+="-"+u[1];var d=FU(i)+l;return{name:d,styles:i,next:cs}}var zU=function(e){return e()},VU=k.useInsertionEffect?k.useInsertionEffect:!1,HU=VU||zU,$C=k.createContext(typeof HTMLElement<"u"?TU({key:"css"}):null);$C.Provider;var WU=function(e){return fa(function(n,r){var i=da($C);return e(n,i,r)})},qU=k.createContext({}),_w={}.hasOwnProperty,_b="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",GU=function(e,n){var r={};for(var i in n)_w.call(n,i)&&(r[i]=n[i]);return r[_b]=e,r},ZU=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return MC(n,r,i),HU(function(){return LU(n,r,i)}),null},YU=WU(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var i=t[_b],s=[r],o="";typeof t.className=="string"?o=MU(e.registered,s,t.className):t.className!=null&&(o=t.className+" ");var a=FC(s,void 0,k.useContext(qU));o+=e.key+"-"+a.name;var c={};for(var l in t)_w.call(t,l)&&l!=="css"&&l!==_b&&(c[l]=t[l]);return c.className=o,n&&(c.ref=n),k.createElement(k.Fragment,null,k.createElement(ZU,{cache:e,serialized:a,isStringTag:typeof i=="string"}),k.createElement(i,c))}),KU=YU,at=function(e,n){var r=arguments;if(n==null||!_w.call(n,"css"))return k.createElement.apply(void 0,r);var i=r.length,s=new Array(i);s[0]=KU,s[1]=GU(e,n);for(var o=2;o<i;o++)s[o]=r[o];return k.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(at);function ww(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return FC(e)}function JU(){var t=ww.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function XU(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const QU=["top","right","bottom","left"],Yo=Math.min,Wr=Math.max,cm=Math.round,Mp=Math.floor,vs=t=>({x:t,y:t}),eB={left:"right",right:"left",bottom:"top",top:"bottom"},tB={start:"end",end:"start"};function wb(t,e,n){return Wr(t,Yo(e,n))}function no(t,e){return typeof t=="function"?t(e):t}function ro(t){return t.split("-")[0]}function mu(t){return t.split("-")[1]}function Ew(t){return t==="x"?"y":"x"}function Sw(t){return t==="y"?"height":"width"}function Ko(t){return["top","bottom"].includes(ro(t))?"y":"x"}function xw(t){return Ew(Ko(t))}function nB(t,e,n){n===void 0&&(n=!1);const r=mu(t),i=xw(t),s=Sw(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=lm(o)),[o,lm(o)]}function rB(t){const e=lm(t);return[Eb(t),e,Eb(e)]}function Eb(t){return t.replace(/start|end/g,e=>tB[e])}function iB(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function sB(t,e,n,r){const i=mu(t);let s=iB(ro(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Eb)))),s}function lm(t){return t.replace(/left|right|bottom|top/g,e=>eB[e])}function oB(t){return{top:0,right:0,bottom:0,left:0,...t}}function jC(t){return typeof t!="number"?oB(t):{top:t,right:t,bottom:t,left:t}}function um(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Z0(t,e,n){let{reference:r,floating:i}=t;const s=Ko(e),o=xw(e),a=Sw(o),c=ro(e),l=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(mu(e)){case"start":p[o]-=f*(n&&l?-1:1);break;case"end":p[o]+=f*(n&&l?-1:1);break}return p}const aB=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Z0(l,r,c),f=r,p={},m=0;for(let h=0;h<a.length;h++){const{name:g,fn:y}=a[h],{x:v,y:b,data:E,reset:w}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:t,floating:e}});u=v??u,d=b??d,p={...p,[g]:{...p[g],...E}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(l=w.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:u,y:d}=Z0(l,f,c)),h=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function Md(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=no(e,t),m=jC(p),g=a[f?d==="floating"?"reference":"floating":d],y=um(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},w=um(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:c}):v);return{top:(y.top-w.top+m.top)/E.y,bottom:(w.bottom-y.bottom+m.bottom)/E.y,left:(y.left-w.left+m.left)/E.x,right:(w.right-y.right+m.right)/E.x}}const cB=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=no(t,e)||{};if(l==null)return{};const d=jC(u),f={x:n,y:r},p=xw(i),m=Sw(p),h=await o.getDimensions(l),g=p==="y",y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",E=s.reference[m]+s.reference[p]-f[p]-s.floating[m],w=f[p]-s.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let _=S?S[b]:0;(!_||!await(o.isElement==null?void 0:o.isElement(S)))&&(_=a.floating[b]||s.floating[m]);const O=E/2-w/2,M=_/2-h[m]/2-1,F=Yo(d[y],M),q=Yo(d[v],M),I=F,$=_-h[m]-q,x=_/2-h[m]/2+O,A=wb(I,x,$),P=!c.arrow&&mu(i)!=null&&x!==A&&s.reference[m]/2-(x<I?F:q)-h[m]/2<0,B=P?x<I?x-I:x-$:0;return{[p]:f[p]+B,data:{[p]:A,centerOffset:x-A-B,...P&&{alignmentOffset:B}},reset:P}}}),lB=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=no(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ro(i),v=Ko(a),b=ro(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(l.floating)),w=f||(b||!h?[lm(a)]:rB(a)),S=m!=="none";!f&&S&&w.push(...sB(a,h,m,E));const _=[a,...w],O=await Md(e,g),M=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&M.push(O[y]),d){const x=nB(i,o,E);M.push(O[x[0]],O[x[1]])}if(F=[...F,{placement:i,overflows:M}],!M.every(x=>x<=0)){var q,I;const x=(((q=s.flip)==null?void 0:q.index)||0)+1,A=_[x];if(A)return{data:{index:x,overflows:F},reset:{placement:A}};let P=(I=F.filter(B=>B.overflows[0]<=0).sort((B,J)=>B.overflows[1]-J.overflows[1])[0])==null?void 0:I.placement;if(!P)switch(p){case"bestFit":{var $;const B=($=F.filter(J=>{if(S){const L=Ko(J.placement);return L===v||L==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(L=>L>0).reduce((L,G)=>L+G,0)]).sort((J,L)=>J[1]-L[1])[0])==null?void 0:$[0];B&&(P=B);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Y0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function K0(t){return QU.some(e=>t[e]>=0)}const uB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=no(t,e);switch(r){case"referenceHidden":{const s=await Md(e,{...i,elementContext:"reference"}),o=Y0(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:K0(o)}}}case"escaped":{const s=await Md(e,{...i,altBoundary:!0}),o=Y0(s,n.floating);return{data:{escapedOffsets:o,escaped:K0(o)}}}default:return{}}}}};async function dB(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ro(n),a=mu(n),c=Ko(n)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,d=no(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}const fB=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await dB(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},pB=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...c}=no(t,e),l={x:n,y:r},u=await Md(e,c),d=Ko(ro(i)),f=Ew(d);let p=l[f],m=l[d];if(s){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=p+u[g],b=p-u[y];p=wb(v,p,b)}if(o){const g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",v=m+u[g],b=m-u[y];m=wb(v,m,b)}const h=a.fn({...e,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:s,[d]:o}}}}}},hB=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=no(t,e),u={x:n,y:r},d=Ko(i),f=Ew(d);let p=u[f],m=u[d];const h=no(a,e),g=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const b=f==="y"?"height":"width",E=s.reference[f]-s.floating[b]+g.mainAxis,w=s.reference[f]+s.reference[b]-g.mainAxis;p<E?p=E:p>w&&(p=w)}if(l){var y,v;const b=f==="y"?"width":"height",E=["top","left"].includes(ro(i)),w=s.reference[d]-s.floating[b]+(E&&((y=o.offset)==null?void 0:y[d])||0)+(E?0:g.crossAxis),S=s.reference[d]+s.reference[b]+(E?0:((v=o.offset)==null?void 0:v[d])||0)-(E?g.crossAxis:0);m<w?m=w:m>S&&(m=S)}return{[f]:p,[d]:m}}}},mB=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:c=()=>{},...l}=no(t,e),u=await Md(e,l),d=ro(i),f=mu(i),p=Ko(i)==="y",{width:m,height:h}=s.floating;let g,y;d==="top"||d==="bottom"?(g=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,g=f==="end"?"top":"bottom");const v=h-u.top-u.bottom,b=m-u.left-u.right,E=Yo(h-u[g],v),w=Yo(m-u[y],b),S=!e.middlewareData.shift;let _=E,O=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(O=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=v),S&&!f){const F=Wr(u.left,0),q=Wr(u.right,0),I=Wr(u.top,0),$=Wr(u.bottom,0);p?O=m-2*(F!==0||q!==0?F+q:Wr(u.left,u.right)):_=h-2*(I!==0||$!==0?I+$:Wr(u.top,u.bottom))}await c({...e,availableWidth:O,availableHeight:_});const M=await o.getDimensions(a.floating);return m!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}};function Fg(){return typeof window<"u"}function gu(t){return UC(t)?(t.nodeName||"").toLowerCase():"#document"}function Xr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Rs(t){var e;return(e=(UC(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function UC(t){return Fg()?t instanceof Node||t instanceof Xr(t).Node:!1}function zi(t){return Fg()?t instanceof Element||t instanceof Xr(t).Element:!1}function xs(t){return Fg()?t instanceof HTMLElement||t instanceof Xr(t).HTMLElement:!1}function J0(t){return!Fg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xr(t).ShadowRoot}function Qf(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Vi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function gB(t){return["table","td","th"].includes(gu(t))}function $g(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Tw(t){const e=Iw(),n=zi(t)?Vi(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function yB(t){let e=Jo(t);for(;xs(e)&&!Ul(e);){if(Tw(e))return e;if($g(e))return null;e=Jo(e)}return null}function Iw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ul(t){return["html","body","#document"].includes(gu(t))}function Vi(t){return Xr(t).getComputedStyle(t)}function jg(t){return zi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Jo(t){if(gu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||J0(t)&&t.host||Rs(t);return J0(e)?e.host:e}function BC(t){const e=Jo(t);return Ul(e)?t.ownerDocument?t.ownerDocument.body:t.body:xs(e)&&Qf(e)?e:BC(e)}function Ld(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=BC(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Xr(i);if(s){const a=Sb(o);return e.concat(o,o.visualViewport||[],Qf(i)?i:[],a&&n?Ld(a):[])}return e.concat(i,Ld(i,[],n))}function Sb(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function zC(t){const e=Vi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=xs(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=cm(n)!==s||cm(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Ow(t){return zi(t)?t:t.contextElement}function yl(t){const e=Ow(t);if(!xs(e))return vs(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=zC(e);let o=(s?cm(n.width):n.width)/r,a=(s?cm(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const vB=vs(0);function VC(t){const e=Xr(t);return!Iw()||!e.visualViewport?vB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bB(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Xr(t)?!1:e}function ec(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Ow(t);let o=vs(1);e&&(r?zi(r)&&(o=yl(r)):o=yl(t));const a=bB(s,n,r)?VC(s):vs(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const f=Xr(s),p=r&&zi(r)?Xr(r):r;let m=f,h=Sb(m);for(;h&&r&&p!==m;){const g=yl(h),y=h.getBoundingClientRect(),v=Vi(h),b=y.left+(h.clientLeft+parseFloat(v.paddingLeft))*g.x,E=y.top+(h.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,l*=g.y,u*=g.x,d*=g.y,c+=b,l+=E,m=Xr(h),h=Sb(m)}}return um({width:u,height:d,x:c,y:l})}function Cw(t,e){const n=jg(t).scrollLeft;return e?e.left+n:ec(Rs(t)).left+n}function HC(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Cw(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function _B(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Rs(r),a=e?$g(e.floating):!1;if(r===o||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=vs(1);const u=vs(0),d=xs(r);if((d||!d&&!s)&&((gu(r)!=="body"||Qf(o))&&(c=jg(r)),xs(r))){const p=ec(r);l=yl(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=o&&!d&&!s?HC(o,c,!0):vs(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function wB(t){return Array.from(t.getClientRects())}function EB(t){const e=Rs(t),n=jg(t),r=t.ownerDocument.body,i=Wr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Wr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Cw(t);const a=-n.scrollTop;return Vi(r).direction==="rtl"&&(o+=Wr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function SB(t,e){const n=Xr(t),r=Rs(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=Iw();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function xB(t,e){const n=ec(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=xs(t)?yl(t):vs(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=r*s.y;return{width:o,height:a,x:c,y:l}}function X0(t,e,n){let r;if(e==="viewport")r=SB(t,n);else if(e==="document")r=EB(Rs(t));else if(zi(e))r=xB(e,n);else{const i=VC(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return um(r)}function WC(t,e){const n=Jo(t);return n===e||!zi(n)||Ul(n)?!1:Vi(n).position==="fixed"||WC(n,e)}function TB(t,e){const n=e.get(t);if(n)return n;let r=Ld(t,[],!1).filter(a=>zi(a)&&gu(a)!=="body"),i=null;const s=Vi(t).position==="fixed";let o=s?Jo(t):t;for(;zi(o)&&!Ul(o);){const a=Vi(o),c=Tw(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Qf(o)&&!c&&WC(t,o))?r=r.filter(u=>u!==o):i=a,o=Jo(o)}return e.set(t,r),r}function IB(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?$g(e)?[]:TB(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((l,u)=>{const d=X0(e,u,i);return l.top=Wr(d.top,l.top),l.right=Yo(d.right,l.right),l.bottom=Yo(d.bottom,l.bottom),l.left=Wr(d.left,l.left),l},X0(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function OB(t){const{width:e,height:n}=zC(t);return{width:e,height:n}}function CB(t,e,n){const r=xs(e),i=Rs(e),s=n==="fixed",o=ec(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=vs(0);if(r||!r&&!s)if((gu(e)!=="body"||Qf(i))&&(a=jg(e)),r){const f=ec(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Cw(i));const l=i&&!r&&!s?HC(i,a):vs(0),u=o.left+a.scrollLeft-c.x-l.x,d=o.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:o.width,height:o.height}}function Xy(t){return Vi(t).position==="static"}function Q0(t,e){if(!xs(t)||Vi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Rs(t)===n&&(n=n.ownerDocument.body),n}function qC(t,e){const n=Xr(t);if($g(t))return n;if(!xs(t)){let i=Jo(t);for(;i&&!Ul(i);){if(zi(i)&&!Xy(i))return i;i=Jo(i)}return n}let r=Q0(t,e);for(;r&&gB(r)&&Xy(r);)r=Q0(r,e);return r&&Ul(r)&&Xy(r)&&!Tw(r)?n:r||yB(t)||n}const RB=async function(t){const e=this.getOffsetParent||qC,n=this.getDimensions,r=await n(t.floating);return{reference:CB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DB(t){return Vi(t).direction==="rtl"}const kB={convertOffsetParentRelativeRectToViewportRelativeRect:_B,getDocumentElement:Rs,getClippingRect:IB,getOffsetParent:qC,getElementRects:RB,getClientRects:wB,getDimensions:OB,getScale:yl,isElement:zi,isRTL:DB};function GC(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function AB(t,e){let n=null,r;const i=Rs(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=t.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(a||e(),!f||!p)return;const m=Mp(d),h=Mp(i.clientWidth-(u+f)),g=Mp(i.clientHeight-(d+p)),y=Mp(u),b={rootMargin:-m+"px "+-h+"px "+-g+"px "+-y+"px",threshold:Wr(0,Yo(1,c))||1};let E=!0;function w(S){const _=S[0].intersectionRatio;if(_!==c){if(!E)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_===1&&!GC(l,t.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return o(!0),s}function ZC(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=Ow(t),u=i||s?[...l?Ld(l):[],...Ld(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=l&&a?AB(l,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(y=>{let[v]=y;v&&v.target===l&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),l&&!c&&p.observe(l),p.observe(e));let m,h=c?ec(t):null;c&&g();function g(){const y=ec(t);h&&!GC(h,y)&&n(),h=y,m=requestAnimationFrame(g)}return n(),()=>{var y;u.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const NB=fB,PB=pB,MB=lB,LB=mB,FB=uB,ex=cB,$B=hB,jB=(t,e,n)=>{const r=new Map,i={platform:kB,...n},s={...i.platform,_c:r};return aB(t,e,{...i,platform:s})};var xb=Kf,UB=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],dm=function(){};function BB(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function zB(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var s=[].concat(r);if(e&&t)for(var o in e)e.hasOwnProperty(o)&&e[o]&&s.push("".concat(BB(t,o)));return s.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var tx=function(e){return JB(e)?e.filter(Boolean):Qa(e)==="object"&&e!==null?[e]:[]},YC=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=po(e,UB);return lt({},n)},Dn=function(e,n,r){var i=e.cx,s=e.getStyles,o=e.getClassNames,a=e.className;return{css:s(n,e),className:i(r??{},o(n,e),a)}};function Ug(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function VB(t){return Ug(t)?window.innerHeight:t.clientHeight}function KC(t){return Ug(t)?window.pageYOffset:t.scrollTop}function fm(t,e){if(Ug(t)){window.scrollTo(0,e);return}t.scrollTop=e}function HB(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var i=t;i=i.parentElement;)if(e=getComputedStyle(i),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.documentElement}function WB(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function Lp(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:dm,i=KC(t),s=e-i,o=10,a=0;function c(){a+=o;var l=WB(a,i,s,n);fm(t,l),a<n?window.requestAnimationFrame(c):r(t)}c()}function nx(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.offsetHeight/3;r.bottom+i>n.bottom?fm(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+i,t.scrollHeight)):r.top-i<n.top&&fm(t,Math.max(e.offsetTop-i,0))}function qB(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function rx(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function GB(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var JC=!1,ZB={get passive(){return JC=!0}},Fp=typeof window<"u"?window:{};Fp.addEventListener&&Fp.removeEventListener&&(Fp.addEventListener("p",dm,ZB),Fp.removeEventListener("p",dm,!1));var YB=JC;function KB(t){return t!=null}function JB(t){return Array.isArray(t)}function $p(t,e,n){return t?e:n}var XB=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=Object.entries(e).filter(function(o){var a=Xs(o,1),c=a[0];return!r.includes(c)});return s.reduce(function(o,a){var c=Xs(a,2),l=c[0],u=c[1];return o[l]=u,o},{})},QB=["children","innerProps"],e3=["children","innerProps"];function t3(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,i=t.placement,s=t.shouldScroll,o=t.isFixedPosition,a=t.controlHeight,c=HB(n),l={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return l;var u=c.getBoundingClientRect(),d=u.height,f=n.getBoundingClientRect(),p=f.bottom,m=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect(),y=g.top,v=o?window.innerHeight:VB(c),b=KC(c),E=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),S=y-w,_=v-h,O=S+b,M=d-b-h,F=p-v+b+E,q=b+h-w,I=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:e};if(M>=m&&!o)return s&&Lp(c,F,I),{placement:"bottom",maxHeight:e};if(!o&&M>=r||o&&_>=r){s&&Lp(c,F,I);var $=o?_-E:M-E;return{placement:"bottom",maxHeight:$}}if(i==="auto"||o){var x=e,A=o?S:O;return A>=r&&(x=Math.min(A-E-a,e)),{placement:"top",maxHeight:x}}if(i==="bottom")return s&&fm(c,F),{placement:"bottom",maxHeight:e};break;case"top":if(S>=m)return{placement:"top",maxHeight:e};if(O>=m&&!o)return s&&Lp(c,q,I),{placement:"top",maxHeight:e};if(!o&&O>=r||o&&S>=r){var P=e;return(!o&&O>=r||o&&S>=r)&&(P=o?S-w:O-w),s&&Lp(c,q,I),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return l}function n3(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var XC=function(e){return e==="auto"?"bottom":e},r3=function(e,n){var r,i=e.placement,s=e.theme,o=s.borderRadius,a=s.spacing,c=s.colors;return lt((r={label:"menu"},Qu(r,n3(i),"100%"),Qu(r,"position","absolute"),Qu(r,"width","100%"),Qu(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},QC=fu(null),i3=function(e){var n=e.children,r=e.minMenuHeight,i=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,a=e.menuShouldScrollIntoView,c=e.theme,l=da(QC)||{},u=l.setPortalPlacement,d=hn(null),f=Qe(i),p=Xs(f,2),m=p[0],h=p[1],g=Qe(null),y=Xs(g,2),v=y[0],b=y[1],E=c.spacing.controlHeight;return xb(function(){var w=d.current;if(w){var S=o==="fixed",_=a&&!S,O=t3({maxHeight:i,menuEl:w,minHeight:r,placement:s,shouldScroll:_,isFixedPosition:S,controlHeight:E});h(O.maxHeight),b(O.placement),u==null||u(O.placement)}},[i,s,o,a,r,u,E]),n({ref:d,placerProps:lt(lt({},e),{},{placement:v||XC(s),maxHeight:m})})},s3=function(e){var n=e.children,r=e.innerRef,i=e.innerProps;return at("div",ut({},Dn(e,"menu",{menu:!0}),{ref:r},i),n)},o3=s3,a3=function(e,n){var r=e.maxHeight,i=e.theme.spacing.baseUnit;return lt({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},c3=function(e){var n=e.children,r=e.innerProps,i=e.innerRef,s=e.isMulti;return at("div",ut({},Dn(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:i},r),n)},eR=function(e,n){var r=e.theme,i=r.spacing.baseUnit,s=r.colors;return lt({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},l3=eR,u3=eR,d3=function(e){var n=e.children,r=n===void 0?"No options":n,i=e.innerProps,s=po(e,QB);return at("div",ut({},Dn(lt(lt({},s),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},f3=function(e){var n=e.children,r=n===void 0?"Loading...":n,i=e.innerProps,s=po(e,e3);return at("div",ut({},Dn(lt(lt({},s),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},p3=function(e){var n=e.rect,r=e.offset,i=e.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},h3=function(e){var n=e.appendTo,r=e.children,i=e.controlElement,s=e.innerProps,o=e.menuPlacement,a=e.menuPosition,c=hn(null),l=hn(null),u=Qe(XC(o)),d=Xs(u,2),f=d[0],p=d[1],m=En(function(){return{setPortalPlacement:p}},[]),h=Qe(null),g=Xs(h,2),y=g[0],v=g[1],b=xe(function(){if(i){var _=qB(i),O=a==="fixed"?0:window.pageYOffset,M=_[f]+O;(M!==(y==null?void 0:y.offset)||_.left!==(y==null?void 0:y.rect.left)||_.width!==(y==null?void 0:y.rect.width))&&v({offset:M,rect:_})}},[i,a,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);xb(function(){b()},[b]);var E=xe(function(){typeof l.current=="function"&&(l.current(),l.current=null),i&&c.current&&(l.current=ZC(i,c.current,b,{elementResize:"ResizeObserver"in window}))},[i,b]);xb(function(){E()},[E]);var w=xe(function(_){c.current=_,E()},[E]);if(!n&&a!=="fixed"||!y)return null;var S=at("div",ut({ref:w},Dn(lt(lt({},e),{},{offset:y.offset,position:a,rect:y.rect}),"menuPortal",{"menu-portal":!0}),s),r);return at(QC.Provider,{value:m},n?h$(S,n):S)},m3=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},g3=function(e){var n=e.children,r=e.innerProps,i=e.isDisabled,s=e.isRtl;return at("div",ut({},Dn(e,"container",{"--is-disabled":i,"--is-rtl":s}),r),n)},y3=function(e,n){var r=e.theme.spacing,i=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return lt({alignItems:"center",display:i&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},v3=function(e){var n=e.children,r=e.innerProps,i=e.isMulti,s=e.hasValue;return at("div",ut({},Dn(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":s}),r),n)},b3=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},_3=function(e){var n=e.children,r=e.innerProps;return at("div",ut({},Dn(e,"indicatorsContainer",{indicators:!0}),r),n)},ix,w3=["size"],E3=["innerProps","isRtl","size"],S3={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},tR=function(e){var n=e.size,r=po(e,w3);return at("svg",ut({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:S3},r))},Rw=function(e){return at(tR,ut({size:20},e),at("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},nR=function(e){return at(tR,ut({size:20},e),at("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},rR=function(e,n){var r=e.isFocused,i=e.theme,s=i.spacing.baseUnit,o=i.colors;return lt({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:s*2,":hover":{color:r?o.neutral80:o.neutral40}})},x3=rR,T3=function(e){var n=e.children,r=e.innerProps;return at("div",ut({},Dn(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||at(nR,null))},I3=rR,O3=function(e){var n=e.children,r=e.innerProps;return at("div",ut({},Dn(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||at(Rw,null))},C3=function(e,n){var r=e.isDisabled,i=e.theme,s=i.spacing.baseUnit,o=i.colors;return lt({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},R3=function(e){var n=e.innerProps;return at("span",ut({},n,Dn(e,"indicatorSeparator",{"indicator-separator":!0})))},D3=JU(ix||(ix=XU([`
12
+ 0%, 80%, 100% { opacity: 0; }
13
+ 40% { opacity: 1; }
14
+ `]))),k3=function(e,n){var r=e.isFocused,i=e.size,s=e.theme,o=s.colors,a=s.spacing.baseUnit;return lt({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2})},Qy=function(e){var n=e.delay,r=e.offset;return at("span",{css:ww({animation:"".concat(D3," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},A3=function(e){var n=e.innerProps,r=e.isRtl,i=e.size,s=i===void 0?4:i,o=po(e,E3);return at("div",ut({},Dn(lt(lt({},o),{},{innerProps:n,isRtl:r,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),at(Qy,{delay:0,offset:r}),at(Qy,{delay:160,offset:!0}),at(Qy,{delay:320,offset:!r}))},N3=function(e,n){var r=e.isDisabled,i=e.isFocused,s=e.theme,o=s.colors,a=s.borderRadius,c=s.spacing;return lt({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:i?o.primary:o.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},P3=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,s=e.innerRef,o=e.innerProps,a=e.menuIsOpen;return at("div",ut({ref:s},Dn(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),o,{"aria-disabled":r||void 0}),n)},M3=P3,L3=["data"],F3=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},$3=function(e){var n=e.children,r=e.cx,i=e.getStyles,s=e.getClassNames,o=e.Heading,a=e.headingProps,c=e.innerProps,l=e.label,u=e.theme,d=e.selectProps;return at("div",ut({},Dn(e,"group",{group:!0}),c),at(o,ut({},a,{selectProps:d,theme:u,getStyles:i,getClassNames:s,cx:r}),l),at("div",null,n))},j3=function(e,n){var r=e.theme,i=r.colors,s=r.spacing;return lt({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},U3=function(e){var n=YC(e);n.data;var r=po(n,L3);return at("div",ut({},Dn(e,"groupHeading",{"group-heading":!0}),r))},B3=$3,z3=["innerRef","isDisabled","isHidden","inputClassName"],V3=function(e,n){var r=e.isDisabled,i=e.value,s=e.theme,o=s.spacing,a=s.colors;return lt(lt({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},H3),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:a.neutral80})},iR={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},H3={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":lt({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},iR)},W3=function(e){return lt({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},iR)},q3=function(e){var n=e.cx,r=e.value,i=YC(e),s=i.innerRef,o=i.isDisabled,a=i.isHidden,c=i.inputClassName,l=po(i,z3);return at("div",ut({},Dn(e,"input",{"input-container":!0}),{"data-value":r||""}),at("input",ut({className:n({input:!0},c),ref:s,style:W3(a),disabled:o},l)))},G3=q3,Z3=function(e,n){var r=e.theme,i=r.spacing,s=r.borderRadius,o=r.colors;return lt({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:i.baseUnit/2})},Y3=function(e,n){var r=e.theme,i=r.borderRadius,s=r.colors,o=e.cropWithEllipsis;return lt({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},K3=function(e,n){var r=e.theme,i=r.spacing,s=r.borderRadius,o=r.colors,a=e.isFocused;return lt({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:a?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},sR=function(e){var n=e.children,r=e.innerProps;return at("div",r,n)},J3=sR,X3=sR;function Q3(t){var e=t.children,n=t.innerProps;return at("div",ut({role:"button"},n),e||at(Rw,{size:14}))}var ez=function(e){var n=e.children,r=e.components,i=e.data,s=e.innerProps,o=e.isDisabled,a=e.removeProps,c=e.selectProps,l=r.Container,u=r.Label,d=r.Remove;return at(l,{data:i,innerProps:lt(lt({},Dn(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:c},at(u,{data:i,innerProps:lt({},Dn(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),at(d,{data:i,innerProps:lt(lt({},Dn(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:c}))},tz=ez,nz=function(e,n){var r=e.isDisabled,i=e.isFocused,s=e.isSelected,o=e.theme,a=o.spacing,c=o.colors;return lt({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:s?c.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:s?c.primary:c.primary50}})},rz=function(e){var n=e.children,r=e.isDisabled,i=e.isFocused,s=e.isSelected,o=e.innerRef,a=e.innerProps;return at("div",ut({},Dn(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":s}),{ref:o,"aria-disabled":r},a),n)},iz=rz,sz=function(e,n){var r=e.theme,i=r.spacing,s=r.colors;return lt({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},oz=function(e){var n=e.children,r=e.innerProps;return at("div",ut({},Dn(e,"placeholder",{placeholder:!0}),r),n)},az=oz,cz=function(e,n){var r=e.isDisabled,i=e.theme,s=i.spacing,o=i.colors;return lt({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},lz=function(e){var n=e.children,r=e.isDisabled,i=e.innerProps;return at("div",ut({},Dn(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},uz=lz,Bg={ClearIndicator:O3,Control:M3,DropdownIndicator:T3,DownChevron:nR,CrossIcon:Rw,Group:B3,GroupHeading:U3,IndicatorsContainer:_3,IndicatorSeparator:R3,Input:G3,LoadingIndicator:A3,Menu:o3,MenuList:c3,MenuPortal:h3,LoadingMessage:f3,NoOptionsMessage:d3,MultiValue:tz,MultiValueContainer:J3,MultiValueLabel:X3,MultiValueRemove:Q3,Option:iz,Placeholder:az,SelectContainer:g3,SingleValue:uz,ValueContainer:v3},dz=function(e){return lt(lt({},Bg),e.components)},sx=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function fz(t,e){return!!(t===e||sx(t)&&sx(e))}function pz(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!fz(t[n],e[n]))return!1;return!0}function hz(t,e){e===void 0&&(e=pz);var n=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(n&&n.lastThis===this&&e(i,n.lastArgs))return n.lastResult;var o=t.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}var mz={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},gz=function(e){return at("span",ut({css:mz},e))},ox=gz,yz={guidance:function(e){var n=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,s=e.context,o=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,i=r===void 0?"":r,s=e.labels,o=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,i=e.options,s=e.label,o=s===void 0?"":s,a=e.selectValue,c=e.isDisabled,l=e.isSelected,u=e.isAppleDevice,d=function(h,g){return h&&h.length?"".concat(h.indexOf(g)+1," of ").concat(h.length):""};if(n==="value"&&a)return"value ".concat(o," focused, ").concat(d(a,r),".");if(n==="menu"&&u){var f=c?" disabled":"",p="".concat(l?" selected":"").concat(f);return"".concat(o).concat(p,", ").concat(d(i,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},vz=function(e){var n=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,s=e.focusableOptions,o=e.isFocused,a=e.selectValue,c=e.selectProps,l=e.id,u=e.isAppleDevice,d=c.ariaLiveMessages,f=c.getOptionLabel,p=c.inputValue,m=c.isMulti,h=c.isOptionDisabled,g=c.isSearchable,y=c.menuIsOpen,v=c.options,b=c.screenReaderStatus,E=c.tabSelectsValue,w=c.isLoading,S=c["aria-label"],_=c["aria-live"],O=En(function(){return lt(lt({},yz),d||{})},[d]),M=En(function(){var A="";if(n&&O.onChange){var P=n.option,B=n.options,J=n.removedValue,L=n.removedValues,G=n.value,U=function(ge){return Array.isArray(ge)?null:ge},C=J||P||U(G),Z=C?f(C):"",H=B||L||void 0,V=H?H.map(f):[],ce=lt({isDisabled:C&&h(C,a),label:Z,labels:V},n);A=O.onChange(ce)}return A},[n,O,h,a,f]),F=En(function(){var A="",P=r||i,B=!!(r&&a&&a.includes(r));if(P&&O.onFocus){var J={focused:P,label:f(P),isDisabled:h(P,a),isSelected:B,options:s,context:P===r?"menu":"value",selectValue:a,isAppleDevice:u};A=O.onFocus(J)}return A},[r,i,f,h,O,s,a,u]),q=En(function(){var A="";if(y&&v.length&&!w&&O.onFilter){var P=b({count:s.length});A=O.onFilter({inputValue:p,resultsMessage:P})}return A},[s,p,y,O,v,b,w]),I=(n==null?void 0:n.action)==="initial-input-focus",$=En(function(){var A="";if(O.guidance){var P=i?"value":y?"menu":"input";A=O.guidance({"aria-label":S,context:P,isDisabled:r&&h(r,a),isMulti:m,isSearchable:g,tabSelectsValue:E,isInitialFocus:I})}return A},[S,r,i,m,h,g,y,O,a,E,I]),x=at(pb,null,at("span",{id:"aria-selection"},M),at("span",{id:"aria-focused"},F),at("span",{id:"aria-results"},q),at("span",{id:"aria-guidance"},$));return at(pb,null,at(ox,{id:l},I&&x),at(ox,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!I&&x))},bz=vz,Tb=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],_z=new RegExp("["+Tb.map(function(t){return t.letters}).join("")+"]","g"),oR={};for(var ev=0;ev<Tb.length;ev++)for(var tv=Tb[ev],nv=0;nv<tv.letters.length;nv++)oR[tv.letters[nv]]=tv.base;var aR=function(e){return e.replace(_z,function(n){return oR[n]})},wz=hz(aR),ax=function(e){return e.replace(/^\s+|\s+$/g,"")},Ez=function(e){return"".concat(e.label," ").concat(e.value)},Sz=function(e){return function(n,r){if(n.data.__isNew__)return!0;var i=lt({ignoreCase:!0,ignoreAccents:!0,stringify:Ez,trim:!0,matchFrom:"any"},e),s=i.ignoreCase,o=i.ignoreAccents,a=i.stringify,c=i.trim,l=i.matchFrom,u=c?ax(r):r,d=c?ax(a(n)):a(n);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),o&&(u=wz(u),d=aR(d)),l==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},xz=["innerRef"];function Tz(t){var e=t.innerRef,n=po(t,xz),r=XB(n,"onExited","in","enter","exit","appear");return at("input",ut({ref:e},r,{css:ww({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Iz=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Oz(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,i=t.onTopArrive,s=t.onTopLeave,o=hn(!1),a=hn(!1),c=hn(0),l=hn(null),u=xe(function(g,y){if(l.current!==null){var v=l.current,b=v.scrollTop,E=v.scrollHeight,w=v.clientHeight,S=l.current,_=y>0,O=E-w-b,M=!1;O>y&&o.current&&(r&&r(g),o.current=!1),_&&a.current&&(s&&s(g),a.current=!1),_&&y>O?(n&&!o.current&&n(g),S.scrollTop=E,M=!0,o.current=!0):!_&&-y>b&&(i&&!a.current&&i(g),S.scrollTop=0,M=!0,a.current=!0),M&&Iz(g)}},[n,r,i,s]),d=xe(function(g){u(g,g.deltaY)},[u]),f=xe(function(g){c.current=g.changedTouches[0].clientY},[]),p=xe(function(g){var y=c.current-g.changedTouches[0].clientY;u(g,y)},[u]),m=xe(function(g){if(g){var y=YB?{passive:!1}:!1;g.addEventListener("wheel",d,y),g.addEventListener("touchstart",f,y),g.addEventListener("touchmove",p,y)}},[p,f,d]),h=xe(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",p,!1))},[p,f,d]);return jt(function(){if(e){var g=l.current;return m(g),function(){h(g)}}},[e,m,h]),function(g){l.current=g}}var cx=["boxSizing","height","overflow","paddingRight","position"],lx={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function ux(t){t.cancelable&&t.preventDefault()}function dx(t){t.stopPropagation()}function fx(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function px(){return"ontouchstart"in window||navigator.maxTouchPoints}var hx=!!(typeof window<"u"&&window.document&&window.document.createElement),Fu=0,Uc={capture:!1,passive:!1};function Cz(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,i=hn({}),s=hn(null),o=xe(function(c){if(hx){var l=document.body,u=l&&l.style;if(r&&cx.forEach(function(m){var h=u&&u[m];i.current[m]=h}),r&&Fu<1){var d=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,p=window.innerWidth-f+d||0;Object.keys(lx).forEach(function(m){var h=lx[m];u&&(u[m]=h)}),u&&(u.paddingRight="".concat(p,"px"))}l&&px()&&(l.addEventListener("touchmove",ux,Uc),c&&(c.addEventListener("touchstart",fx,Uc),c.addEventListener("touchmove",dx,Uc))),Fu+=1}},[r]),a=xe(function(c){if(hx){var l=document.body,u=l&&l.style;Fu=Math.max(Fu-1,0),r&&Fu<1&&cx.forEach(function(d){var f=i.current[d];u&&(u[d]=f)}),l&&px()&&(l.removeEventListener("touchmove",ux,Uc),c&&(c.removeEventListener("touchstart",fx,Uc),c.removeEventListener("touchmove",dx,Uc)))}},[r]);return jt(function(){if(e){var c=s.current;return o(c),function(){a(c)}}},[e,o,a]),function(c){s.current=c}}var Rz=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Dz={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function kz(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,i=r===void 0?!0:r,s=t.onBottomArrive,o=t.onBottomLeave,a=t.onTopArrive,c=t.onTopLeave,l=Oz({isEnabled:i,onBottomArrive:s,onBottomLeave:o,onTopArrive:a,onTopLeave:c}),u=Cz({isEnabled:n}),d=function(p){l(p),u(p)};return at(pb,null,n&&at("div",{onClick:Rz,css:Dz}),e(d))}var Az={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Nz=function(e){var n=e.name,r=e.onFocus;return at("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Az,value:"",onChange:function(){}})},Pz=Nz;function Dw(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function Mz(){return Dw(/^iPhone/i)}function cR(){return Dw(/^Mac/i)}function Lz(){return Dw(/^iPad/i)||cR()&&navigator.maxTouchPoints>1}function Fz(){return Mz()||Lz()}function $z(){return cR()||Fz()}var jz=function(e){return e.label},Uz=function(e){return e.label},Bz=function(e){return e.value},zz=function(e){return!!e.isDisabled},Vz={clearIndicator:I3,container:m3,control:N3,dropdownIndicator:x3,group:F3,groupHeading:j3,indicatorsContainer:b3,indicatorSeparator:C3,input:V3,loadingIndicator:k3,loadingMessage:u3,menu:r3,menuList:a3,menuPortal:p3,multiValue:Z3,multiValueLabel:Y3,multiValueRemove:K3,noOptionsMessage:l3,option:nz,placeholder:sz,singleValue:cz,valueContainer:y3},Hz={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Wz=4,lR=4,qz=38,Gz=lR*2,Zz={baseUnit:lR,controlHeight:qz,menuGutter:Gz},rv={borderRadius:Wz,colors:Hz,spacing:Zz},Yz={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:rx(),captureMenuScroll:!rx(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Sz(),formatGroupLabel:jz,getOptionLabel:Uz,getOptionValue:Bz,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:zz,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!GB(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function mx(t,e,n,r){var i=fR(t,e,n),s=pR(t,e,n),o=dR(t,e),a=pm(t,e);return{type:"option",data:e,isDisabled:i,isSelected:s,label:o,value:a,index:r}}function Ah(t,e){return t.options.map(function(n,r){if("options"in n){var i=n.options.map(function(o,a){return mx(t,o,e,a)}).filter(function(o){return yx(t,o)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var s=mx(t,n,e,r);return yx(t,s)?s:void 0}).filter(KB)}function uR(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,pw(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function gx(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,pw(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function Kz(t,e){return uR(Ah(t,e))}function yx(t,e){var n=t.inputValue,r=n===void 0?"":n,i=e.data,s=e.isSelected,o=e.label,a=e.value;return(!mR(t)||!s)&&hR(t,{label:o,value:a,data:i},r)}function Jz(t,e){var n=t.focusedValue,r=t.selectValue,i=r.indexOf(n);if(i>-1){var s=e.indexOf(n);if(s>-1)return n;if(i<e.length)return e[i]}return null}function Xz(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var iv=function(e,n){var r,i=(r=e.find(function(s){return s.data===n}))===null||r===void 0?void 0:r.id;return i||null},dR=function(e,n){return e.getOptionLabel(n)},pm=function(e,n){return e.getOptionValue(n)};function fR(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function pR(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=pm(t,e);return n.some(function(i){return pm(t,i)===r})}function hR(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var mR=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},Qz=1,gR=function(t){Vj(n,t);var e=qj(n);function n(r){var i;if(Bj(this,n),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=$z(),i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,l){var u=i.props,d=u.onChange,f=u.name;l.name=f,i.ariaOnChange(c,l),d(c,l)},i.setValue=function(c,l,u){var d=i.props,f=d.closeMenuOnSelect,p=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(i.setState({inputIsHiddenAfterUpdate:!p}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:l,option:u})},i.selectOption=function(c){var l=i.props,u=l.blurInputOnSelect,d=l.isMulti,f=l.name,p=i.state.selectValue,m=d&&i.isOptionSelected(c,p),h=i.isOptionDisabled(c,p);if(m){var g=i.getOptionValue(c);i.setValue(p.filter(function(y){return i.getOptionValue(y)!==g}),"deselect-option",c)}else if(!h)d?i.setValue([].concat(pw(p),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:f});return}u&&i.blurInput()},i.removeValue=function(c){var l=i.props.isMulti,u=i.state.selectValue,d=i.getOptionValue(c),f=u.filter(function(m){return i.getOptionValue(m)!==d}),p=$p(l,f,f[0]||null);i.onChange(p,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange($p(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,l=i.state.selectValue,u=l[l.length-1],d=l.slice(0,l.length-1),f=$p(c,d,d[0]||null);u&&i.onChange(f,{action:"pop-value",removedValue:u})},i.getFocusedOptionId=function(c){return iv(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return gx(Ah(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];return zB.apply(void 0,[i.props.classNamePrefix].concat(l))},i.getOptionLabel=function(c){return dR(i.props,c)},i.getOptionValue=function(c){return pm(i.props,c)},i.getStyles=function(c,l){var u=i.props.unstyled,d=Vz[c](l,u);d.boxSizing="border-box";var f=i.props.styles[c];return f?f(d,l):d},i.getClassNames=function(c,l){var u,d;return(u=(d=i.props.classNames)[c])===null||u===void 0?void 0:u.call(d,l)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return dz(i.props)},i.buildCategorizedOptions=function(){return Ah(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return uR(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,l){i.setState({ariaSelection:lt({value:c},l)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var l=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():l&&i.openMenu("first"):(l&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var l=i.props,u=l.isMulti,d=l.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!u}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&Ug(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var l=c.touches,u=l&&l.item(0);u&&(i.initialTouchX=u.clientX,i.initialTouchY=u.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var l=c.touches,u=l&&l.item(0);if(u){var d=Math.abs(u.clientX-i.initialTouchX),f=Math.abs(u.clientY-i.initialTouchY),p=5;i.userIsDragging=d>p||f>p}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var l=i.props.inputValue,u=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(u,{action:"input-change",prevInputValue:l}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var l=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:l}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var l=i.getFocusableOptions(),u=l.indexOf(c);i.setState({focusedOption:c,focusedOptionId:u>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return mR(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var l=i.props,u=l.isMulti,d=l.backspaceRemovesValue,f=l.escapeClearsValue,p=l.inputValue,m=l.isClearable,h=l.isDisabled,g=l.menuIsOpen,y=l.onKeyDown,v=l.tabSelectsValue,b=l.openMenuOnFocus,E=i.state,w=E.focusedOption,S=E.focusedValue,_=E.selectValue;if(!h&&!(typeof y=="function"&&(y(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!u||p)return;i.focusValue("previous");break;case"ArrowRight":if(!u||p)return;i.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(S)i.removeValue(S);else{if(!d)return;u?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!g||!v||!w||b&&i.isOptionSelected(w,_))return;i.selectOption(w);break;case"Enter":if(c.keyCode===229)break;if(g){if(!w||i.isComposing)return;i.selectOption(w);break}return;case"Escape":g?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:p}),i.onMenuClose()):m&&f&&i.clearValue();break;case" ":if(p)return;if(!g){i.openMenu("first");break}if(!w)return;i.selectOption(w);break;case"ArrowUp":g?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":g?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!g)return;i.focusOption("pageup");break;case"PageDown":if(!g)return;i.focusOption("pagedown");break;case"Home":if(!g)return;i.focusOption("first");break;case"End":if(!g)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Qz),i.state.selectValue=tx(r.value),r.menuIsOpen&&i.state.selectValue.length){var s=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),a=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=s,i.state.focusedOption=o[a],i.state.focusedOptionId=iv(s,o[a])}return i}return zj(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&nx(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isDisabled,a=s.menuIsOpen,c=this.state.isFocused;(c&&!o&&i.isDisabled||c&&a&&!i.menuIsOpen)&&this.focusInput(),c&&o&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!o&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(nx(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,s){this.props.onInputChange(i,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var s=this,o=this.state,a=o.selectValue,c=o.isFocused,l=this.buildFocusableOptions(),u=i==="first"?0:l.length-1;if(!this.props.isMulti){var d=l.indexOf(a[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[u],focusedOptionId:this.getFocusedOptionId(l[u])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(i){var s=this.state,o=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=o.indexOf(a);a||(c=-1);var l=o.length-1,u=-1;if(o.length){switch(i){case"previous":c===0?u=0:c===-1?u=l:u=c-1;break;case"next":c>-1&&c<l&&(u=c+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:o[u]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var c=0,l=a.indexOf(o);o||(l=-1),i==="up"?c=l>0?l-1:a.length-1:i==="down"?c=(l+1)%a.length:i==="pageup"?(c=l-s,c<0&&(c=0)):i==="pagedown"?(c=l+s,c>a.length-1&&(c=a.length-1)):i==="last"&&(c=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(rv):lt(lt({},rv),this.props.theme):rv}},{key:"getCommonProps",value:function(){var i=this.clearValue,s=this.cx,o=this.getStyles,a=this.getClassNames,c=this.getValue,l=this.selectOption,u=this.setValue,d=this.props,f=d.isMulti,p=d.isRtl,m=d.options,h=this.hasValue();return{clearValue:i,cx:s,getStyles:o,getClassNames:a,getValue:c,hasValue:h,isMulti:f,isRtl:p,options:m,selectOption:l,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,s=i.isClearable,o=i.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(i,s){return fR(this.props,i,s)}},{key:"isOptionSelected",value:function(i,s){return pR(this.props,i,s)}},{key:"filterOption",value:function(i,s){return hR(this.props,i,s)}},{key:"formatOptionLabel",value:function(i,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:s,inputValue:o,selectValue:a})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,s=i.isDisabled,o=i.isSearchable,a=i.inputId,c=i.inputValue,l=i.tabIndex,u=i.form,d=i.menuIsOpen,f=i.required,p=this.getComponents(),m=p.Input,h=this.state,g=h.inputIsHidden,y=h.ariaSelection,v=this.commonProps,b=a||this.getElementId("input"),E=lt(lt(lt({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(y==null?void 0:y.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?k.createElement(m,ut({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:b,innerRef:this.getInputRef,isDisabled:s,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:u,type:"text",value:c},E)):k.createElement(Tz,ut({id:b,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:dm,onFocus:this.onInputFocus,disabled:s,tabIndex:l,inputMode:"none",form:u,value:""},E))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,s=this.getComponents(),o=s.MultiValue,a=s.MultiValueContainer,c=s.MultiValueLabel,l=s.MultiValueRemove,u=s.SingleValue,d=s.Placeholder,f=this.commonProps,p=this.props,m=p.controlShouldRenderValue,h=p.isDisabled,g=p.isMulti,y=p.inputValue,v=p.placeholder,b=this.state,E=b.selectValue,w=b.focusedValue,S=b.isFocused;if(!this.hasValue()||!m)return y?null:k.createElement(d,ut({},f,{key:"placeholder",isDisabled:h,isFocused:S,innerProps:{id:this.getElementId("placeholder")}}),v);if(g)return E.map(function(O,M){var F=O===w,q="".concat(i.getOptionLabel(O),"-").concat(i.getOptionValue(O));return k.createElement(o,ut({},f,{components:{Container:a,Label:c,Remove:l},isFocused:F,isDisabled:h,key:q,index:M,removeProps:{onClick:function(){return i.removeValue(O)},onTouchEnd:function(){return i.removeValue(O)},onMouseDown:function($){$.preventDefault()}},data:O}),i.formatOptionLabel(O,"value"))});if(y)return null;var _=E[0];return k.createElement(u,ut({},f,{data:_,isDisabled:h}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),s=i.ClearIndicator,o=this.commonProps,a=this.props,c=a.isDisabled,l=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||c||!this.hasValue()||l)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return k.createElement(s,ut({},o,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),s=i.LoadingIndicator,o=this.commonProps,a=this.props,c=a.isDisabled,l=a.isLoading,u=this.state.isFocused;if(!s||!l)return null;var d={"aria-hidden":"true"};return k.createElement(s,ut({},o,{innerProps:d,isDisabled:c,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator,o=i.IndicatorSeparator;if(!s||!o)return null;var a=this.commonProps,c=this.props.isDisabled,l=this.state.isFocused;return k.createElement(o,ut({},a,{isDisabled:c,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),s=i.DropdownIndicator;if(!s)return null;var o=this.commonProps,a=this.props.isDisabled,c=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return k.createElement(s,ut({},o,{innerProps:l,isDisabled:a,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,s=this.getComponents(),o=s.Group,a=s.GroupHeading,c=s.Menu,l=s.MenuList,u=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,p=s.Option,m=this.commonProps,h=this.state.focusedOption,g=this.props,y=g.captureMenuScroll,v=g.inputValue,b=g.isLoading,E=g.loadingMessage,w=g.minMenuHeight,S=g.maxMenuHeight,_=g.menuIsOpen,O=g.menuPlacement,M=g.menuPosition,F=g.menuPortalTarget,q=g.menuShouldBlockScroll,I=g.menuShouldScrollIntoView,$=g.noOptionsMessage,x=g.onMenuScrollToTop,A=g.onMenuScrollToBottom;if(!_)return null;var P=function(Z,H){var V=Z.type,ce=Z.data,le=Z.isDisabled,ge=Z.isSelected,Re=Z.label,Ge=Z.value,st=h===ce,He=le?void 0:function(){return i.onOptionHover(ce)},gt=le?void 0:function(){return i.selectOption(ce)},D="".concat(i.getElementId("option"),"-").concat(H),me={id:D,onClick:gt,onMouseMove:He,onMouseOver:He,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:ge};return k.createElement(p,ut({},m,{innerProps:me,data:ce,isDisabled:le,isSelected:ge,key:D,label:Re,type:V,value:Ge,isFocused:st,innerRef:st?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(Z.data,"menu"))},B;if(this.hasOptions())B=this.getCategorizedOptions().map(function(C){if(C.type==="group"){var Z=C.data,H=C.options,V=C.index,ce="".concat(i.getElementId("group"),"-").concat(V),le="".concat(ce,"-heading");return k.createElement(o,ut({},m,{key:ce,data:Z,options:H,Heading:a,headingProps:{id:le,data:C.data},label:i.formatGroupLabel(C.data)}),C.options.map(function(ge){return P(ge,"".concat(V,"-").concat(ge.index))}))}else if(C.type==="option")return P(C,"".concat(C.index))});else if(b){var J=E({inputValue:v});if(J===null)return null;B=k.createElement(d,m,J)}else{var L=$({inputValue:v});if(L===null)return null;B=k.createElement(f,m,L)}var G={minMenuHeight:w,maxMenuHeight:S,menuPlacement:O,menuPosition:M,menuShouldScrollIntoView:I},U=k.createElement(i3,ut({},m,G),function(C){var Z=C.ref,H=C.placerProps,V=H.placement,ce=H.maxHeight;return k.createElement(c,ut({},m,G,{innerRef:Z,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:b,placement:V}),k.createElement(kz,{captureEnabled:y,onTopArrive:x,onBottomArrive:A,lockEnabled:q},function(le){return k.createElement(l,ut({},m,{innerRef:function(Re){i.getMenuListRef(Re),le(Re)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:b,maxHeight:ce,focusedOption:h}),B)}))});return F||M==="fixed"?k.createElement(u,ut({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:O,menuPosition:M}),U):U}},{key:"renderFormField",value:function(){var i=this,s=this.props,o=s.delimiter,a=s.isDisabled,c=s.isMulti,l=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!a)return k.createElement(Pz,{name:l,onFocus:this.onValueInputFocus});if(!(!l||a))if(c)if(o){var f=d.map(function(h){return i.getOptionValue(h)}).join(o);return k.createElement("input",{name:l,type:"hidden",value:f})}else{var p=d.length>0?d.map(function(h,g){return k.createElement("input",{key:"i-".concat(g),name:l,type:"hidden",value:i.getOptionValue(h)})}):k.createElement("input",{name:l,type:"hidden",value:""});return k.createElement("div",null,p)}else{var m=d[0]?this.getOptionValue(d[0]):"";return k.createElement("input",{name:l,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,s=this.state,o=s.ariaSelection,a=s.focusedOption,c=s.focusedValue,l=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return k.createElement(bz,ut({},i,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:a,focusedValue:c,isFocused:l,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),s=i.Control,o=i.IndicatorsContainer,a=i.SelectContainer,c=i.ValueContainer,l=this.props,u=l.className,d=l.id,f=l.isDisabled,p=l.menuIsOpen,m=this.state.isFocused,h=this.commonProps=this.getCommonProps();return k.createElement(a,ut({},h,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),k.createElement(s,ut({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:p}),k.createElement(c,ut({},h,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),k.createElement(o,ut({},h,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,s){var o=s.prevProps,a=s.clearFocusValueOnUpdate,c=s.inputIsHiddenAfterUpdate,l=s.ariaSelection,u=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,p=i.options,m=i.value,h=i.menuIsOpen,g=i.inputValue,y=i.isMulti,v=tx(m),b={};if(o&&(m!==o.value||p!==o.options||h!==o.menuIsOpen||g!==o.inputValue)){var E=h?Kz(i,v):[],w=h?gx(Ah(i,v),"".concat(f,"-option")):[],S=a?Jz(s,v):null,_=Xz(s,E),O=iv(w,_);b={selectValue:v,focusedOption:_,focusedOptionId:O,focusableOptionsWithIds:w,focusedValue:S,clearFocusValueOnUpdate:!1}}var M=c!=null&&i!==o?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},F=l,q=u&&d;return u&&!q&&(F={value:$p(y,v,v[0]||null),options:v,action:"initial-input-focus"},q=!d),(l==null?void 0:l.action)==="initial-input-focus"&&(F=null),lt(lt(lt({},b),M),{},{prevProps:i,ariaSelection:F,prevWasFocused:q})}}]),n}(o$);gR.defaultProps=Yz;var e5=fa(function(t,e){var n=Uj(t);return k.createElement(gR,ut({ref:e},n))}),t5=e5;function n5(t){return T(Bg.DropdownIndicator,{...t,children:T(ze,{name:"ChevronDown",size:16})})}function r5(t){return T(Bg.ClearIndicator,{...t,children:T(ze,{name:"Xmark",size:16})})}function i5(t){const{label:e,onClick:n,...r}=t,i=!!e&&!!n;return _e(Bg.MenuList,{...r,children:[t.children,i?T("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:n,children:e}):null]})}function jp(t){const e=t["aria-invalid"]==="true",{addItemButtonProps:n,...r}=t;return T(t5,{...r,components:{DropdownIndicator:n5,ClearIndicator:r5,MenuList:i=>i5({...i,...n})},styles:{dropdownIndicator:()=>({label:"indicatorContainer",display:"flex",transition:"color 150ms",color:"var(--gray-900)",padding:8,boxSizing:"border-box"}),clearIndicator:i=>({...i,color:"var(--gray-900)"}),container:i=>({...i,borderColor:"var(--gray-200)",fontSize:12}),placeholder:i=>({...i,color:e?"var(--red-800)":"var(--gray-500)"}),control:()=>({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:32,outline:"0 !important",position:"relative",transition:"all 100ms",backgroundColor:"var(--white)",borderColor:e?"var(--red-900)":"var(--gray-200)",borderStyle:"solid",borderWidth:1,borderRadius:"6px",boxSizing:"border-box"}),option:(i,s)=>({...i,backgroundColor:s.isSelected?"var(--slate-50)":"var(--white)",color:"var(--gray-800)",":hover":{backgroundColor:"var(--slate-50)"}}),menuList:i=>({...i,padding:0,borderRadius:"6px"})},theme:i=>({...i,colors:{...i.colors,primary:"var(--slate-100)",primary25:"var(--slate-50)",primary50:"var(--slate-100)",primary75:"var(--slate-100)",danger:"var(--red-900)",dangerLight:"var(--red-100)",neutral0:"var(--white)",neutral5:"var(--gray-50)",neutral10:"var(--gray-100)",neutral20:"var(--gray-200)",neutral30:"var(--gray-300)",neutral40:"var(--gray-400)",neutral50:"var(--gray-500)",neutral60:"var(--gray-600)",neutral70:"var(--gray-700)",neutral80:"var(--gray-800)",neutral90:"var(--gray-900)"}})})}function fi(t,e){const{className:n,...r}=t;return{className:St(e,typeof n=="string"&&n),...r}}const Pr=fa(function(t,e){const{color:n="dark",size:r="medium",className:i="",children:s,icon:o,iconPosition:a="left",...c}=t,l={small:"px-2 py-1.5 text-xs rounded-md font-medium",medium:"px-6 py-3 text-base rounded-xl font-semibold tracking-wide"},u=Jf({light:"bg-gray-200 text-gray-600 hover:text-gray-700 hover:border-gray-300 active:border-slate-100 active:text-gray-600 disabled:text-gray-400",dark:"bg-gray-800 text-slate-50 hover:bg-slate-800 active:border-slate-700 disabled:bg-gray-300 disabled:text-slate-100",red:"bg-red-900 text-slate-50 hover:opacity-80 active:border-red-800 disabled:text-red-400 disabled:opacity-100",blue:"bg-blue-900 text-slate-50 hover:opacity-80 active:border-blue-800 disabled:text-blue-400 disabled:opacity-100"}[n],l[r]),d=St("flex items-center justify-center gap-2 border border-none outline-none transition disabled:cursor-not-allowed",u,i);return _e("button",{className:d,ref:e,...c,children:[a==="left"&&o,s,a==="right"&&o]})}),s5=t=>{const{children:e,cookies:n,submitLabel:r,rejectLabel:i,onSubmit:s=()=>{},onReject:o=()=>{},...a}=t,[c,l]=Qe(n),u=f=>{const{id:p,checked:m}=f.target;l(h=>h.map(g=>g.id===p?{...g,value:m}:g))},d="min-w-64 h-8 text-base";return _e("div",{...fi(a,"flex flex-col items-center"),children:[T("div",{className:"text-center",children:e}),T("div",{className:"my-8 flex gap-x-16 text-sm font-medium",children:c.map(f=>_e("div",{className:"cursor-pointer",children:[T("input",{checked:f.value,className:"mr-1 size-3 cursor-pointer rounded-sm border-2 border-gray-900 accent-gray-900 focus:outline-none",id:f.id,onChange:u,type:"checkbox"}),T("label",{className:"cursor-pointer select-none",htmlFor:f.id,children:f.label})]},f.id))}),_e("div",{className:"flex gap-x-8",children:[T(Pr,{className:d,color:"light",onClick:()=>o(),size:"small",children:i}),T(Pr,{className:d,onClick:()=>s(c),size:"small",children:r})]})]})};function Bl(t){const{title:e,isOpen:n,onOpenChange:r,children:i,containerClassName:s,toggleClassName:o,contentClassName:a}=t;return _e("div",{className:St(s),children:[_e("div",{className:St("flex cursor-pointer justify-between text-gray-500",o),onClick:r,children:[T("h2",{className:" font-semibold text-inherit",children:e}),T(ze,{className:Jf("transition",n?"":"-rotate-90"),size:16,name:"ChevronDown"})]}),T("div",{className:St("max-h-0 overflow-hidden transition-[max-height] duration-300 ease-in-out",n&&"max-h-screen",a),children:i})]})}function Mr(t){return T("div",{...t,className:St("h-px bg-gray-200",t.className)})}const qr="DRIVE",gd="FOLDER",sr="FILE",the="CREATE",nhe="WRITE",rhe="READ",ihe="UI_NODE",kw="DUPLICATE",Aw="NEW_FOLDER",zg="RENAME",Vg="DELETE",yR="SETTINGS",vR="REMOVE_TRIGGER",bR="ADD_TRIGGER",_R="ADD_INVALID_TRIGGER",o5=[Aw,zg,yR],a5=[zg,Vg,kw],c5=[Aw,zg,Vg,kw],Nw=[bR,vR,_R],l5=[{value:Js,icon:T(ze,{name:"Lock"}),description:"Only available to you"},{value:$l,icon:T(ze,{name:"People"}),description:"Only available to people in this drive"},{value:to,icon:T(ze,{name:"Globe"}),description:"Available to everyone",disabled:!0}],u5={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:T(ze,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:T(ze,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:T(ze,{name:"Drive"})}},d5={[bR]:{label:"Add Trigger",icon:T(ze,{className:"text-orange-900",name:"Plus"})},[vR]:{label:"Remove Trigger",icon:T(ze,{className:"text-orange-900",name:"Xmark"})},[_R]:{label:"Add Trigger",icon:T(ze,{className:"text-orange-900",name:"Exclamation"})}},f5={[kw]:{label:"Duplicate",icon:T(ze,{name:"FilesEarmark"})},[Aw]:{label:"New Folder",icon:T(ze,{name:"FolderPlus"})},[zg]:{label:"Rename",icon:T(ze,{name:"Pencil"})},[Vg]:{label:"Delete",icon:T(ze,{name:"Trash"}),className:"text-red-900"},[yR]:{label:"Settings",icon:T(ze,{name:"Gear"})}},she={...d5,...f5};function dt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function vx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Hg(...t){return e=>{let n=!1;const r=t.map(i=>{const s=vx(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():vx(t[i],null)}}}}function Ln(...t){return k.useCallback(Hg(...t),t)}function p5(t,e){const n=k.createContext(e),r=s=>{const{children:o,...a}=s,c=k.useMemo(()=>a,Object.values(a));return T(n.Provider,{value:c,children:o})};r.displayName=t+"Provider";function i(s){const o=k.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function ma(t,e=[]){let n=[];function r(s,o){const a=k.createContext(o),c=n.length;n=[...n,o];const l=d=>{var y;const{scope:f,children:p,...m}=d,h=((y=f==null?void 0:f[t])==null?void 0:y[c])||a,g=k.useMemo(()=>m,Object.values(m));return T(h.Provider,{value:g,children:p})};l.displayName=s+"Provider";function u(d,f){var h;const p=((h=f==null?void 0:f[t])==null?void 0:h[c])||a,m=k.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const i=()=>{const s=n.map(o=>k.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return k.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[r,h5(i,...e)]}function h5(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Hi(t){const e=k.useRef(t);return k.useEffect(()=>{e.current=t}),k.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function ep({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=m5({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:r,a=Hi(n),c=k.useCallback(l=>{if(s){const d=typeof l=="function"?l(t):l;d!==t&&a(d)}else i(l)},[s,t,i,a]);return[o,c]}function m5({defaultProp:t,onChange:e}){const n=k.useState(t),[r]=n,i=k.useRef(r),s=Hi(e);return k.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var Xo=k.forwardRef((t,e)=>{const{children:n,...r}=t,i=k.Children.toArray(n),s=i.find(g5);if(s){const o=s.props.children,a=i.map(c=>c===s?k.Children.count(o)>1?k.Children.only(null):k.isValidElement(o)?o.props.children:null:c);return T(Ib,{...r,ref:e,children:k.isValidElement(o)?k.cloneElement(o,void 0,a):null})}return T(Ib,{...r,ref:e,children:n})});Xo.displayName="Slot";var Ib=k.forwardRef((t,e)=>{const{children:n,...r}=t;if(k.isValidElement(n)){const i=v5(n);return k.cloneElement(n,{...y5(r,n.props),ref:e?Hg(e,i):i})}return k.Children.count(n)>1?k.Children.only(null):null});Ib.displayName="SlotClone";var wR=({children:t})=>T(Zo,{children:t});function g5(t){return k.isValidElement(t)&&t.type===wR}function y5(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function v5(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var b5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zt=b5.reduce((t,e)=>{const n=k.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Xo:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T(a,{...o,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function ER(t,e){t&&uC.flushSync(()=>t.dispatchEvent(e))}function SR(t){const e=t+"CollectionProvider",[n,r]=ma(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:m,children:h}=p,g=Ae.useRef(null),y=Ae.useRef(new Map).current;return T(i,{scope:m,itemMap:y,collectionRef:g,children:h})};o.displayName=e;const a=t+"CollectionSlot",c=Ae.forwardRef((p,m)=>{const{scope:h,children:g}=p,y=s(a,h),v=Ln(m,y.collectionRef);return T(Xo,{ref:v,children:g})});c.displayName=a;const l=t+"CollectionItemSlot",u="data-radix-collection-item",d=Ae.forwardRef((p,m)=>{const{scope:h,children:g,...y}=p,v=Ae.useRef(null),b=Ln(m,v),E=s(l,h);return Ae.useEffect(()=>(E.itemMap.set(v,{ref:v,...y}),()=>void E.itemMap.delete(v))),T(Xo,{[u]:"",ref:b,children:g})});d.displayName=l;function f(p){const m=s(t+"CollectionConsumer",p);return Ae.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((E,w)=>y.indexOf(E.ref.current)-y.indexOf(w.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:c,ItemSlot:d},f,r]}var _5=k.createContext(void 0);function xR(t){const e=k.useContext(_5);return t||e||"ltr"}function w5(t,e=globalThis==null?void 0:globalThis.document){const n=Hi(t);k.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var E5="DismissableLayer",Ob="dismissableLayer.update",S5="dismissableLayer.pointerDownOutside",x5="dismissableLayer.focusOutside",bx,TR=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tp=k.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=k.useContext(TR),[u,d]=k.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=k.useState({}),m=Ln(e,_=>d(_)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=h.indexOf(g),v=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,w=O5(_=>{const O=_.target,M=[...l.branches].some(F=>F.contains(O));!E||M||(i==null||i(_),o==null||o(_),_.defaultPrevented||a==null||a())},f),S=C5(_=>{const O=_.target;[...l.branches].some(F=>F.contains(O))||(s==null||s(_),o==null||o(_),_.defaultPrevented||a==null||a())},f);return w5(_=>{v===l.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},f),k.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(bx=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),_x(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=bx)}},[u,f,n,l]),k.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),_x())},[u,l]),k.useEffect(()=>{const _=()=>p({});return document.addEventListener(Ob,_),()=>document.removeEventListener(Ob,_)},[]),T(Zt.div,{...c,ref:m,style:{pointerEvents:b?E?"auto":"none":void 0,...t.style},onFocusCapture:dt(t.onFocusCapture,S.onFocusCapture),onBlurCapture:dt(t.onBlurCapture,S.onBlurCapture),onPointerDownCapture:dt(t.onPointerDownCapture,w.onPointerDownCapture)})});tp.displayName=E5;var T5="DismissableLayerBranch",I5=k.forwardRef((t,e)=>{const n=k.useContext(TR),r=k.useRef(null),i=Ln(e,r);return k.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),T(Zt.div,{...t,ref:i})});I5.displayName=T5;function O5(t,e=globalThis==null?void 0:globalThis.document){const n=Hi(t),r=k.useRef(!1),i=k.useRef(()=>{});return k.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){IR(S5,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function C5(t,e=globalThis==null?void 0:globalThis.document){const n=Hi(t),r=k.useRef(!1);return k.useEffect(()=>{const i=s=>{s.target&&!r.current&&IR(x5,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _x(){const t=new CustomEvent(Ob);document.dispatchEvent(t)}function IR(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?ER(i,s):i.dispatchEvent(s)}var sv=0;function Pw(){k.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??wx()),document.body.insertAdjacentElement("beforeend",t[1]??wx()),sv++,()=>{sv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),sv--}},[])}function wx(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ov="focusScope.autoFocusOnMount",av="focusScope.autoFocusOnUnmount",Ex={bubbles:!1,cancelable:!0},R5="FocusScope",Wg=k.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=k.useState(null),l=Hi(i),u=Hi(s),d=k.useRef(null),f=Ln(e,h=>c(h)),p=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let h=function(b){if(p.paused||!a)return;const E=b.target;a.contains(E)?d.current=E:To(d.current,{select:!0})},g=function(b){if(p.paused||!a)return;const E=b.relatedTarget;E!==null&&(a.contains(E)||To(d.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&To(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",g);const v=new MutationObserver(y);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,p.paused]),k.useEffect(()=>{if(a){xx.add(p);const h=document.activeElement;if(!a.contains(h)){const y=new CustomEvent(ov,Ex);a.addEventListener(ov,l),a.dispatchEvent(y),y.defaultPrevented||(D5(M5(OR(a)),{select:!0}),document.activeElement===h&&To(a))}return()=>{a.removeEventListener(ov,l),setTimeout(()=>{const y=new CustomEvent(av,Ex);a.addEventListener(av,u),a.dispatchEvent(y),y.defaultPrevented||To(h??document.body,{select:!0}),a.removeEventListener(av,u),xx.remove(p)},0)}}},[a,l,u,p]);const m=k.useCallback(h=>{if(!n&&!r||p.paused)return;const g=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,y=document.activeElement;if(g&&y){const v=h.currentTarget,[b,E]=k5(v);b&&E?!h.shiftKey&&y===E?(h.preventDefault(),n&&To(b,{select:!0})):h.shiftKey&&y===b&&(h.preventDefault(),n&&To(E,{select:!0})):y===v&&h.preventDefault()}},[n,r,p.paused]);return T(Zt.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Wg.displayName=R5;function D5(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(To(r,{select:e}),document.activeElement!==n)return}function k5(t){const e=OR(t),n=Sx(e,t),r=Sx(e.reverse(),t);return[n,r]}function OR(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Sx(t,e){for(const n of t)if(!A5(n,{upTo:e}))return n}function A5(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function N5(t){return t instanceof HTMLInputElement&&"select"in t}function To(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&N5(t)&&e&&t.select()}}var xx=P5();function P5(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Tx(t,e),t.unshift(e)},remove(e){var n;t=Tx(t,e),(n=t[0])==null||n.resume()}}}function Tx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function M5(t){return t.filter(e=>e.tagName!=="A")}var tc=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},L5=k.useId||(()=>{}),F5=0;function Fr(t){const[e,n]=k.useState(L5());return tc(()=>{t||n(r=>r??String(F5++))},[t]),t||(e?`radix-${e}`:"")}var Nh=typeof document<"u"?Kf:jt;function hm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!hm(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!hm(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function CR(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ix(t,e){const n=CR(t);return Math.round(e*n)/n}function cv(t){const e=k.useRef(t);return Nh(()=>{e.current=t}),e}function $5(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,d]=k.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=k.useState(r);hm(f,r)||p(r);const[m,h]=k.useState(null),[g,y]=k.useState(null),v=k.useCallback(J=>{J!==S.current&&(S.current=J,h(J))},[]),b=k.useCallback(J=>{J!==_.current&&(_.current=J,y(J))},[]),E=s||m,w=o||g,S=k.useRef(null),_=k.useRef(null),O=k.useRef(u),M=c!=null,F=cv(c),q=cv(i),I=cv(l),$=k.useCallback(()=>{if(!S.current||!_.current)return;const J={placement:e,strategy:n,middleware:f};q.current&&(J.platform=q.current),jB(S.current,_.current,J).then(L=>{const G={...L,isPositioned:I.current!==!1};x.current&&!hm(O.current,G)&&(O.current=G,uC.flushSync(()=>{d(G)}))})},[f,e,n,q,I]);Nh(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(J=>({...J,isPositioned:!1})))},[l]);const x=k.useRef(!1);Nh(()=>(x.current=!0,()=>{x.current=!1}),[]),Nh(()=>{if(E&&(S.current=E),w&&(_.current=w),E&&w){if(F.current)return F.current(E,w,$);$()}},[E,w,$,F,M]);const A=k.useMemo(()=>({reference:S,floating:_,setReference:v,setFloating:b}),[v,b]),P=k.useMemo(()=>({reference:E,floating:w}),[E,w]),B=k.useMemo(()=>{const J={position:n,left:0,top:0};if(!P.floating)return J;const L=Ix(P.floating,u.x),G=Ix(P.floating,u.y);return a?{...J,transform:"translate("+L+"px, "+G+"px)",...CR(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:G}},[n,a,P.floating,u.x,u.y]);return k.useMemo(()=>({...u,update:$,refs:A,elements:P,floatingStyles:B}),[u,$,A,P,B])}const j5=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?ex({element:r.current,padding:i}).fn(n):{}:r?ex({element:r,padding:i}).fn(n):{}}}},U5=(t,e)=>({...NB(t),options:[t,e]}),B5=(t,e)=>({...PB(t),options:[t,e]}),z5=(t,e)=>({...$B(t),options:[t,e]}),V5=(t,e)=>({...MB(t),options:[t,e]}),H5=(t,e)=>({...LB(t),options:[t,e]}),W5=(t,e)=>({...FB(t),options:[t,e]}),q5=(t,e)=>({...j5(t),options:[t,e]});var G5="Arrow",RR=k.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return T(Zt.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:T("polygon",{points:"0,0 30,0 15,10"})})});RR.displayName=G5;var Z5=RR;function Y5(t){const[e,n]=k.useState(void 0);return tc(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Mw="Popper",[DR,yu]=ma(Mw),[K5,kR]=DR(Mw),AR=t=>{const{__scopePopper:e,children:n}=t,[r,i]=k.useState(null);return T(K5,{scope:e,anchor:r,onAnchorChange:i,children:n})};AR.displayName=Mw;var NR="PopperAnchor",PR=k.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=kR(NR,n),o=k.useRef(null),a=Ln(e,o);return k.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:T(Zt.div,{...i,ref:a})});PR.displayName=NR;var Lw="PopperContent",[J5,X5]=DR(Lw),MR=k.forwardRef((t,e)=>{var le,ge,Re,Ge,st,He;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...h}=t,g=kR(Lw,n),[y,v]=k.useState(null),b=Ln(e,gt=>v(gt)),[E,w]=k.useState(null),S=Y5(E),_=(S==null?void 0:S.width)??0,O=(S==null?void 0:S.height)??0,M=r+(s!=="center"?"-"+s:""),F=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},q=Array.isArray(l)?l:[l],I=q.length>0,$={padding:F,boundary:q.filter(e4),altBoundary:I},{refs:x,floatingStyles:A,placement:P,isPositioned:B,middlewareData:J}=$5({strategy:"fixed",placement:M,whileElementsMounted:(...gt)=>ZC(...gt,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[U5({mainAxis:i+O,alignmentAxis:o}),c&&B5({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?z5():void 0,...$}),c&&V5({...$}),H5({...$,apply:({elements:gt,rects:D,availableWidth:me,availableHeight:ue})=>{const{width:K,height:R}=D.reference,N=gt.floating.style;N.setProperty("--radix-popper-available-width",`${me}px`),N.setProperty("--radix-popper-available-height",`${ue}px`),N.setProperty("--radix-popper-anchor-width",`${K}px`),N.setProperty("--radix-popper-anchor-height",`${R}px`)}}),E&&q5({element:E,padding:a}),t4({arrowWidth:_,arrowHeight:O}),f&&W5({strategy:"referenceHidden",...$})]}),[L,G]=$R(P),U=Hi(m);tc(()=>{B&&(U==null||U())},[B,U]);const C=(le=J.arrow)==null?void 0:le.x,Z=(ge=J.arrow)==null?void 0:ge.y,H=((Re=J.arrow)==null?void 0:Re.centerOffset)!==0,[V,ce]=k.useState();return tc(()=>{y&&ce(window.getComputedStyle(y).zIndex)},[y]),T("div",{ref:x.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:B?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[(Ge=J.transformOrigin)==null?void 0:Ge.x,(st=J.transformOrigin)==null?void 0:st.y].join(" "),...((He=J.hide)==null?void 0:He.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:T(J5,{scope:n,placedSide:L,onArrowChange:w,arrowX:C,arrowY:Z,shouldHideArrow:H,children:T(Zt.div,{"data-side":L,"data-align":G,...h,ref:b,style:{...h.style,animation:B?void 0:"none"}})})})});MR.displayName=Lw;var LR="PopperArrow",Q5={top:"bottom",right:"left",bottom:"top",left:"right"},FR=k.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=X5(LR,r),o=Q5[s.placedSide];return T("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:T(Z5,{...i,ref:n,style:{...i.style,display:"block"}})})});FR.displayName=LR;function e4(t){return t!==null}var t4=t=>({name:"transformOrigin",options:t,fn(e){var g,y,v;const{placement:n,rects:r,middlewareData:i}=e,o=((g=i.arrow)==null?void 0:g.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[l,u]=$R(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=i.arrow)==null?void 0:y.x)??0)+a/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+c/2;let m="",h="";return l==="bottom"?(m=o?d:`${f}px`,h=`${-c}px`):l==="top"?(m=o?d:`${f}px`,h=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,h=o?d:`${p}px`):l==="left"&&(m=`${r.floating.width+c}px`,h=o?d:`${p}px`),{data:{x:m,y:h}}}});function $R(t){const[e,n="center"]=t.split("-");return[e,n]}var Fw=AR,qg=PR,$w=MR,jw=FR,n4="Portal",np=k.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=k.useState(!1);tc(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?p$.createPortal(T(Zt.div,{...r,ref:e}),o):null});np.displayName=n4;function r4(t,e){return k.useReducer((n,r)=>e[n][r]??n,t)}var bi=t=>{const{present:e,children:n}=t,r=i4(e),i=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),s=Ln(r.ref,s4(i));return typeof n=="function"||r.isPresent?k.cloneElement(i,{ref:s}):null};bi.displayName="Presence";function i4(t){const[e,n]=k.useState(),r=k.useRef({}),i=k.useRef(t),s=k.useRef("none"),o=t?"mounted":"unmounted",[a,c]=r4(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const l=Up(r.current);s.current=a==="mounted"?l:"none"},[a]),tc(()=>{const l=r.current,u=i.current;if(u!==t){const f=s.current,p=Up(l);t?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),tc(()=>{if(e){let l;const u=e.ownerDocument.defaultView??window,d=p=>{const h=Up(r.current).includes(p.animationName);if(p.target===e&&h&&(c("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",l=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=p=>{p.target===e&&(s.current=Up(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(l),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:k.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Up(t){return(t==null?void 0:t.animationName)||"none"}function s4(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var lv="rovingFocusGroup.onEntryFocus",o4={bubbles:!1,cancelable:!0},Gg="RovingFocusGroup",[Cb,jR,a4]=SR(Gg),[c4,UR]=ma(Gg,[a4]),[l4,u4]=c4(Gg),BR=k.forwardRef((t,e)=>T(Cb.Provider,{scope:t.__scopeRovingFocusGroup,children:T(Cb.Slot,{scope:t.__scopeRovingFocusGroup,children:T(d4,{...t,ref:e})})}));BR.displayName=Gg;var d4=k.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=t,f=k.useRef(null),p=Ln(e,f),m=xR(s),[h=null,g]=ep({prop:o,defaultProp:a,onChange:c}),[y,v]=k.useState(!1),b=Hi(l),E=jR(n),w=k.useRef(!1),[S,_]=k.useState(0);return k.useEffect(()=>{const O=f.current;if(O)return O.addEventListener(lv,b),()=>O.removeEventListener(lv,b)},[b]),T(l4,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:k.useCallback(O=>g(O),[g]),onItemShiftTab:k.useCallback(()=>v(!0),[]),onFocusableItemAdd:k.useCallback(()=>_(O=>O+1),[]),onFocusableItemRemove:k.useCallback(()=>_(O=>O-1),[]),children:T(Zt.div,{tabIndex:y||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:dt(t.onMouseDown,()=>{w.current=!0}),onFocus:dt(t.onFocus,O=>{const M=!w.current;if(O.target===O.currentTarget&&M&&!y){const F=new CustomEvent(lv,o4);if(O.currentTarget.dispatchEvent(F),!F.defaultPrevented){const q=E().filter(P=>P.focusable),I=q.find(P=>P.active),$=q.find(P=>P.id===h),A=[I,$,...q].filter(Boolean).map(P=>P.ref.current);HR(A,u)}}w.current=!1}),onBlur:dt(t.onBlur,()=>v(!1))})})}),zR="RovingFocusGroupItem",VR=k.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=t,a=Fr(),c=s||a,l=u4(zR,n),u=l.currentTabStopId===c,d=jR(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return k.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),T(Cb.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:T(Zt.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...o,ref:e,onMouseDown:dt(t.onMouseDown,m=>{r?l.onItemFocus(c):m.preventDefault()}),onFocus:dt(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:dt(t.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const h=h4(m,l.orientation,l.dir);if(h!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(h==="last")y.reverse();else if(h==="prev"||h==="next"){h==="prev"&&y.reverse();const v=y.indexOf(m.currentTarget);y=l.loop?m4(y,v+1):y.slice(v+1)}setTimeout(()=>HR(y))}})})})});VR.displayName=zR;var f4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function p4(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function h4(t,e,n){const r=p4(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return f4[r]}function HR(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function m4(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var g4=BR,y4=VR,v4=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Bc=new WeakMap,Bp=new WeakMap,zp={},uv=0,WR=function(t){return t&&(t.host||WR(t.parentNode))},b4=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=WR(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},_4=function(t,e,n,r){var i=b4(e,Array.isArray(t)?t:[t]);zp[n]||(zp[n]=new WeakMap);var s=zp[n],o=[],a=new Set,c=new Set(i),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};i.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",h=(Bc.get(f)||0)+1,g=(s.get(f)||0)+1;Bc.set(f,h),s.set(f,g),o.push(f),h===1&&m&&Bp.set(f,!0),g===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(e),a.clear(),uv++,function(){o.forEach(function(d){var f=Bc.get(d)-1,p=s.get(d)-1;Bc.set(d,f),s.set(d,p),f||(Bp.has(d)||d.removeAttribute(r),Bp.delete(d)),p||d.removeAttribute(n)}),uv--,uv||(Bc=new WeakMap,Bc=new WeakMap,Bp=new WeakMap,zp={})}},Uw=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=v4(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),_4(r,i,n,"aria-hidden")):function(){return null}},us=function(){return us=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},us.apply(this,arguments)};function qR(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 w4(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Ph="right-scroll-bar-position",Mh="width-before-scroll-bar",E4="with-scroll-bars-hidden",S4="--removed-body-scroll-bar-size";function dv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function x4(t,e){var n=Qe(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var T4=typeof window<"u"?k.useLayoutEffect:k.useEffect,Ox=new WeakMap;function I4(t,e){var n=x4(null,function(r){return t.forEach(function(i){return dv(i,r)})});return T4(function(){var r=Ox.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||dv(a,null)}),s.forEach(function(a){i.has(a)||dv(a,o)})}Ox.set(n,t)},[t]),n}function O4(t){return t}function C4(t,e){e===void 0&&(e=O4);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),n}}}};return i}function R4(t){t===void 0&&(t={});var e=C4(null);return e.options=us({async:!0,ssr:!1},t),e}var GR=function(t){var e=t.sideCar,n=qR(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return k.createElement(r,us({},n))};GR.isSideCarExport=!0;function D4(t,e){return t.useMedium(e),GR}var ZR=R4(),fv=function(){},Zg=k.forwardRef(function(t,e){var n=k.useRef(null),r=k.useState({onScrollCapture:fv,onWheelCapture:fv,onTouchMoveCapture:fv}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,p=t.noIsolation,m=t.inert,h=t.allowPinchZoom,g=t.as,y=g===void 0?"div":g,v=t.gapMode,b=qR(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,w=I4([n,e]),S=us(us({},b),i);return k.createElement(k.Fragment,null,u&&k.createElement(E,{sideCar:ZR,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:v}),o?k.cloneElement(k.Children.only(a),us(us({},S),{ref:w})):k.createElement(y,us({},S,{className:c,ref:w}),a))});Zg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zg.classNames={fullWidth:Mh,zeroRight:Ph};var k4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function A4(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=k4();return e&&t.setAttribute("nonce",e),t}function N4(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function P4(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var M4=function(){var t=0,e=null;return{add:function(n){t==0&&(e=A4())&&(N4(e,n),P4(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},L4=function(){var t=M4();return function(e,n){k.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},YR=function(){var t=L4(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},F4={left:0,top:0,right:0,gap:0},pv=function(t){return parseInt(t||"",10)||0},$4=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[pv(n),pv(r),pv(i)]},j4=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return F4;var e=$4(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},U4=YR(),vl="data-scroll-locked",B4=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
15
+ .`.concat(E4,` {
16
+ overflow: hidden `).concat(r,`;
17
+ padding-right: `).concat(a,"px ").concat(r,`;
18
+ }
19
+ body[`).concat(vl,`] {
20
+ overflow: hidden `).concat(r,`;
21
+ overscroll-behavior: contain;
22
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
23
+ padding-left: `.concat(i,`px;
24
+ padding-top: `).concat(s,`px;
25
+ padding-right: `).concat(o,`px;
26
+ margin-left:0;
27
+ margin-top:0;
28
+ margin-right: `).concat(a,"px ").concat(r,`;
29
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
30
+ }
31
+
32
+ .`).concat(Ph,` {
33
+ right: `).concat(a,"px ").concat(r,`;
34
+ }
35
+
36
+ .`).concat(Mh,` {
37
+ margin-right: `).concat(a,"px ").concat(r,`;
38
+ }
39
+
40
+ .`).concat(Ph," .").concat(Ph,` {
41
+ right: 0 `).concat(r,`;
42
+ }
43
+
44
+ .`).concat(Mh," .").concat(Mh,` {
45
+ margin-right: 0 `).concat(r,`;
46
+ }
47
+
48
+ body[`).concat(vl,`] {
49
+ `).concat(S4,": ").concat(a,`px;
50
+ }
51
+ `)},Cx=function(){var t=parseInt(document.body.getAttribute(vl)||"0",10);return isFinite(t)?t:0},z4=function(){k.useEffect(function(){return document.body.setAttribute(vl,(Cx()+1).toString()),function(){var t=Cx()-1;t<=0?document.body.removeAttribute(vl):document.body.setAttribute(vl,t.toString())}},[])},V4=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;z4();var s=k.useMemo(function(){return j4(i)},[i]);return k.createElement(U4,{styles:B4(s,!e,i,n?"":"!important")})},Rb=!1;if(typeof window<"u")try{var Vp=Object.defineProperty({},"passive",{get:function(){return Rb=!0,!0}});window.addEventListener("test",Vp,Vp),window.removeEventListener("test",Vp,Vp)}catch{Rb=!1}var zc=Rb?{passive:!1}:!1,H4=function(t){return t.tagName==="TEXTAREA"},KR=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!H4(t)&&n[e]==="visible")},W4=function(t){return KR(t,"overflowY")},q4=function(t){return KR(t,"overflowX")},Rx=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=JR(t,r);if(i){var s=XR(t,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},G4=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Z4=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},JR=function(t,e){return t==="v"?W4(e):q4(e)},XR=function(t,e){return t==="v"?G4(e):Z4(e)},Y4=function(t,e){return t==="h"&&e==="rtl"?-1:1},K4=function(t,e,n,r,i){var s=Y4(t,window.getComputedStyle(e).direction),o=s*r,a=n.target,c=e.contains(a),l=!1,u=o>0,d=0,f=0;do{var p=XR(t,a),m=p[0],h=p[1],g=p[2],y=h-g-s*m;(m||y)&&JR(t,a)&&(d+=y,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(l=!0),l},Hp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Dx=function(t){return[t.deltaX,t.deltaY]},kx=function(t){return t&&"current"in t?t.current:t},J4=function(t,e){return t[0]===e[0]&&t[1]===e[1]},X4=function(t){return`
52
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
53
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
54
+ `)},Q4=0,Vc=[];function eV(t){var e=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),i=k.useState(Q4++)[0],s=k.useState(YR)[0],o=k.useRef(t);k.useEffect(function(){o.current=t},[t]),k.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var h=w4([t.lockRef.current],(t.shards||[]).map(kx),!0).filter(Boolean);return h.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),h.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=k.useCallback(function(h,g){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!o.current.allowPinchZoom;var y=Hp(h),v=n.current,b="deltaX"in h?h.deltaX:v[0]-y[0],E="deltaY"in h?h.deltaY:v[1]-y[1],w,S=h.target,_=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in h&&_==="h"&&S.type==="range")return!1;var O=Rx(_,S);if(!O)return!0;if(O?w=_:(w=_==="v"?"h":"v",O=Rx(_,S)),!O)return!1;if(!r.current&&"changedTouches"in h&&(b||E)&&(r.current=w),!w)return!0;var M=r.current||w;return K4(M,g,h,M==="h"?b:E)},[]),c=k.useCallback(function(h){var g=h;if(!(!Vc.length||Vc[Vc.length-1]!==s)){var y="deltaY"in g?Dx(g):Hp(g),v=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&J4(w.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(kx).filter(Boolean).filter(function(w){return w.contains(g.target)}),E=b.length>0?a(g,b[0]):!o.current.noIsolation;E&&g.cancelable&&g.preventDefault()}}},[]),l=k.useCallback(function(h,g,y,v){var b={name:h,delta:g,target:y,should:v,shadowParent:tV(y)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(E){return E!==b})},1)},[]),u=k.useCallback(function(h){n.current=Hp(h),r.current=void 0},[]),d=k.useCallback(function(h){l(h.type,Dx(h),h.target,a(h,t.lockRef.current))},[]),f=k.useCallback(function(h){l(h.type,Hp(h),h.target,a(h,t.lockRef.current))},[]);k.useEffect(function(){return Vc.push(s),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,zc),document.addEventListener("touchmove",c,zc),document.addEventListener("touchstart",u,zc),function(){Vc=Vc.filter(function(h){return h!==s}),document.removeEventListener("wheel",c,zc),document.removeEventListener("touchmove",c,zc),document.removeEventListener("touchstart",u,zc)}},[]);var p=t.removeScrollBar,m=t.inert;return k.createElement(k.Fragment,null,m?k.createElement(s,{styles:X4(i)}):null,p?k.createElement(V4,{gapMode:t.gapMode}):null)}function tV(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const nV=D4(ZR,eV);var Yg=k.forwardRef(function(t,e){return k.createElement(Zg,us({},t,{ref:e,sideCar:nV}))});Yg.classNames=Zg.classNames;var Db=["Enter"," "],rV=["ArrowDown","PageUp","Home"],QR=["ArrowUp","PageDown","End"],iV=[...rV,...QR],sV={ltr:[...Db,"ArrowRight"],rtl:[...Db,"ArrowLeft"]},oV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},rp="Menu",[Fd,aV,cV]=SR(rp),[Tc,eD]=ma(rp,[cV,yu,UR]),Kg=yu(),tD=UR(),[lV,Ic]=Tc(rp),[uV,ip]=Tc(rp),nD=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=Kg(e),[c,l]=k.useState(null),u=k.useRef(!1),d=Hi(s),f=xR(i);return k.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),T(Fw,{...a,children:T(lV,{scope:e,open:n,onOpenChange:d,content:c,onContentChange:l,children:T(uV,{scope:e,onClose:k.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};nD.displayName=rp;var dV="MenuAnchor",Bw=k.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Kg(n);return T(qg,{...i,...r,ref:e})});Bw.displayName=dV;var zw="MenuPortal",[fV,rD]=Tc(zw,{forceMount:void 0}),iD=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Ic(zw,e);return T(fV,{scope:e,forceMount:n,children:T(bi,{present:n||s.open,children:T(np,{asChild:!0,container:i,children:r})})})};iD.displayName=zw;var hi="MenuContent",[pV,Vw]=Tc(hi),sD=k.forwardRef((t,e)=>{const n=rD(hi,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ic(hi,t.__scopeMenu),o=ip(hi,t.__scopeMenu);return T(Fd.Provider,{scope:t.__scopeMenu,children:T(bi,{present:r||s.open,children:T(Fd.Slot,{scope:t.__scopeMenu,children:o.modal?T(hV,{...i,ref:e}):T(mV,{...i,ref:e})})})})}),hV=k.forwardRef((t,e)=>{const n=Ic(hi,t.__scopeMenu),r=k.useRef(null),i=Ln(e,r);return k.useEffect(()=>{const s=r.current;if(s)return Uw(s)},[]),T(Hw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:dt(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mV=k.forwardRef((t,e)=>{const n=Ic(hi,t.__scopeMenu);return T(Hw,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hw=k.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=t,g=Ic(hi,n),y=ip(hi,n),v=Kg(n),b=tD(n),E=aV(n),[w,S]=k.useState(null),_=k.useRef(null),O=Ln(e,_,g.onContentChange),M=k.useRef(0),F=k.useRef(""),q=k.useRef(0),I=k.useRef(null),$=k.useRef("right"),x=k.useRef(0),A=m?Yg:k.Fragment,P=m?{as:Xo,allowPinchZoom:!0}:void 0,B=L=>{var le,ge;const G=F.current+L,U=E().filter(Re=>!Re.disabled),C=document.activeElement,Z=(le=U.find(Re=>Re.ref.current===C))==null?void 0:le.textValue,H=U.map(Re=>Re.textValue),V=OV(H,G,Z),ce=(ge=U.find(Re=>Re.textValue===V))==null?void 0:ge.ref.current;(function Re(Ge){F.current=Ge,window.clearTimeout(M.current),Ge!==""&&(M.current=window.setTimeout(()=>Re(""),1e3))})(G),ce&&setTimeout(()=>ce.focus())};k.useEffect(()=>()=>window.clearTimeout(M.current),[]),Pw();const J=k.useCallback(L=>{var U,C;return $.current===((U=I.current)==null?void 0:U.side)&&RV(L,(C=I.current)==null?void 0:C.area)},[]);return T(pV,{scope:n,searchRef:F,onItemEnter:k.useCallback(L=>{J(L)&&L.preventDefault()},[J]),onItemLeave:k.useCallback(L=>{var G;J(L)||((G=_.current)==null||G.focus(),S(null))},[J]),onTriggerLeave:k.useCallback(L=>{J(L)&&L.preventDefault()},[J]),pointerGraceTimerRef:q,onPointerGraceIntentChange:k.useCallback(L=>{I.current=L},[]),children:T(A,{...P,children:T(Wg,{asChild:!0,trapped:i,onMountAutoFocus:dt(s,L=>{var G;L.preventDefault(),(G=_.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:T(tp,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:T(g4,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:S,onEntryFocus:dt(c,L=>{y.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:T($w,{role:"menu","aria-orientation":"vertical","data-state":wD(g.open),"data-radix-menu-content":"",dir:y.dir,...v,...h,ref:O,style:{outline:"none",...h.style},onKeyDown:dt(h.onKeyDown,L=>{const U=L.target.closest("[data-radix-menu-content]")===L.currentTarget,C=L.ctrlKey||L.altKey||L.metaKey,Z=L.key.length===1;U&&(L.key==="Tab"&&L.preventDefault(),!C&&Z&&B(L.key));const H=_.current;if(L.target!==H||!iV.includes(L.key))return;L.preventDefault();const ce=E().filter(le=>!le.disabled).map(le=>le.ref.current);QR.includes(L.key)&&ce.reverse(),TV(ce)}),onBlur:dt(t.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(M.current),F.current="")}),onPointerMove:dt(t.onPointerMove,$d(L=>{const G=L.target,U=x.current!==L.clientX;if(L.currentTarget.contains(G)&&U){const C=L.clientX>x.current?"right":"left";$.current=C,x.current=L.clientX}}))})})})})})})});sD.displayName=hi;var gV="MenuGroup",Ww=k.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T(Zt.div,{role:"group",...r,ref:e})});Ww.displayName=gV;var yV="MenuLabel",oD=k.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T(Zt.div,{...r,ref:e})});oD.displayName=yV;var mm="MenuItem",Ax="menu.itemSelect",Jg=k.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=k.useRef(null),o=ip(mm,t.__scopeMenu),a=Vw(mm,t.__scopeMenu),c=Ln(e,s),l=k.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(Ax,{bubbles:!0,cancelable:!0});d.addEventListener(Ax,p=>r==null?void 0:r(p),{once:!0}),ER(d,f),f.defaultPrevented?l.current=!1:o.onClose()}};return T(aD,{...i,ref:c,disabled:n,onClick:dt(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),l.current=!0},onPointerUp:dt(t.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:dt(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Db.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Jg.displayName=mm;var aD=k.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=Vw(mm,n),a=tD(n),c=k.useRef(null),l=Ln(e,c),[u,d]=k.useState(!1),[f,p]=k.useState("");return k.useEffect(()=>{const m=c.current;m&&p((m.textContent??"").trim())},[s.children]),T(Fd.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:T(y4,{asChild:!0,...a,focusable:!r,children:T(Zt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:dt(t.onPointerMove,$d(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:dt(t.onPointerLeave,$d(m=>o.onItemLeave(m))),onFocus:dt(t.onFocus,()=>d(!0)),onBlur:dt(t.onBlur,()=>d(!1))})})})}),vV="MenuCheckboxItem",cD=k.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return T(pD,{scope:t.__scopeMenu,checked:n,children:T(Jg,{role:"menuitemcheckbox","aria-checked":gm(n)?"mixed":n,...i,ref:e,"data-state":Gw(n),onSelect:dt(i.onSelect,()=>r==null?void 0:r(gm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cD.displayName=vV;var lD="MenuRadioGroup",[bV,_V]=Tc(lD,{value:void 0,onValueChange:()=>{}}),uD=k.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Hi(r);return T(bV,{scope:t.__scopeMenu,value:n,onValueChange:s,children:T(Ww,{...i,ref:e})})});uD.displayName=lD;var dD="MenuRadioItem",fD=k.forwardRef((t,e)=>{const{value:n,...r}=t,i=_V(dD,t.__scopeMenu),s=n===i.value;return T(pD,{scope:t.__scopeMenu,checked:s,children:T(Jg,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":Gw(s),onSelect:dt(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});fD.displayName=dD;var qw="MenuItemIndicator",[pD,wV]=Tc(qw,{checked:!1}),hD=k.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=wV(qw,n);return T(bi,{present:r||gm(s.checked)||s.checked===!0,children:T(Zt.span,{...i,ref:e,"data-state":Gw(s.checked)})})});hD.displayName=qw;var EV="MenuSeparator",mD=k.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T(Zt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});mD.displayName=EV;var SV="MenuArrow",gD=k.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Kg(n);return T(jw,{...i,...r,ref:e})});gD.displayName=SV;var xV="MenuSub",[ohe,yD]=Tc(xV),ed="MenuSubTrigger",vD=k.forwardRef((t,e)=>{const n=Ic(ed,t.__scopeMenu),r=ip(ed,t.__scopeMenu),i=yD(ed,t.__scopeMenu),s=Vw(ed,t.__scopeMenu),o=k.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:t.__scopeMenu},u=k.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return k.useEffect(()=>u,[u]),k.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),T(Bw,{asChild:!0,...l,children:T(aD,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":wD(n.open),...t,ref:Hg(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:dt(t.onPointerMove,$d(d=>{s.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:dt(t.onPointerLeave,$d(d=>{var p,m;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const h=(m=n.content)==null?void 0:m.dataset.side,g=h==="right",y=g?-5:5,v=f[g?"left":"right"],b=f[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:v,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:v,y:f.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:dt(t.onKeyDown,d=>{var p;const f=s.searchRef.current!=="";t.disabled||f&&d.key===" "||sV[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});vD.displayName=ed;var bD="MenuSubContent",_D=k.forwardRef((t,e)=>{const n=rD(hi,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Ic(hi,t.__scopeMenu),o=ip(hi,t.__scopeMenu),a=yD(bD,t.__scopeMenu),c=k.useRef(null),l=Ln(e,c);return T(Fd.Provider,{scope:t.__scopeMenu,children:T(bi,{present:r||s.open,children:T(Fd.Slot,{scope:t.__scopeMenu,children:T(Hw,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;o.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:dt(t.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:dt(t.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:dt(t.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=oV[o.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});_D.displayName=bD;function wD(t){return t?"open":"closed"}function gm(t){return t==="indeterminate"}function Gw(t){return gm(t)?"indeterminate":t?"checked":"unchecked"}function TV(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function IV(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function OV(t,e,n){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=IV(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==n));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function CV(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,c=e[s].y,l=e[o].x,u=e[o].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(i=!i)}return i}function RV(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return CV(n,e)}function $d(t){return e=>e.pointerType==="mouse"?t(e):void 0}var DV=nD,kV=Bw,AV=iD,NV=sD,PV=Ww,MV=oD,LV=Jg,FV=cD,$V=uD,jV=fD,UV=hD,BV=mD,zV=gD,VV=vD,HV=_D,Zw="DropdownMenu",[WV,ahe]=ma(Zw,[eD]),Cr=eD(),[qV,ED]=WV(Zw),SD=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,c=Cr(e),l=k.useRef(null),[u=!1,d]=ep({prop:i,defaultProp:s,onChange:o});return T(qV,{scope:e,triggerId:Fr(),triggerRef:l,contentId:Fr(),open:u,onOpenChange:d,onOpenToggle:k.useCallback(()=>d(f=>!f),[d]),modal:a,children:T(DV,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};SD.displayName=Zw;var xD="DropdownMenuTrigger",TD=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=ED(xD,n),o=Cr(n);return T(kV,{asChild:!0,...o,children:T(Zt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Hg(e,s.triggerRef),onPointerDown:dt(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:dt(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});TD.displayName=xD;var GV="DropdownMenuPortal",ID=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Cr(e);return T(AV,{...r,...n})};ID.displayName=GV;var OD="DropdownMenuContent",CD=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=ED(OD,n),s=Cr(n),o=k.useRef(!1);return T(NV,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:dt(t.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:dt(t.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!i.modal||u)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});CD.displayName=OD;var ZV="DropdownMenuGroup",YV=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(PV,{...i,...r,ref:e})});YV.displayName=ZV;var KV="DropdownMenuLabel",JV=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(MV,{...i,...r,ref:e})});JV.displayName=KV;var XV="DropdownMenuItem",RD=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(LV,{...i,...r,ref:e})});RD.displayName=XV;var QV="DropdownMenuCheckboxItem",e6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(FV,{...i,...r,ref:e})});e6.displayName=QV;var t6="DropdownMenuRadioGroup",n6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T($V,{...i,...r,ref:e})});n6.displayName=t6;var r6="DropdownMenuRadioItem",i6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(jV,{...i,...r,ref:e})});i6.displayName=r6;var s6="DropdownMenuItemIndicator",o6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(UV,{...i,...r,ref:e})});o6.displayName=s6;var a6="DropdownMenuSeparator",c6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(BV,{...i,...r,ref:e})});c6.displayName=a6;var l6="DropdownMenuArrow",u6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(zV,{...i,...r,ref:e})});u6.displayName=l6;var d6="DropdownMenuSubTrigger",f6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(VV,{...i,...r,ref:e})});f6.displayName=d6;var p6="DropdownMenuSubContent",h6=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Cr(n);return T(HV,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});h6.displayName=p6;var m6=SD,g6=TD,y6=ID,v6=CD,b6=RD;const _6=m6,w6=g6,E6=fa(function({children:t,...e},n){return T(y6,{children:T(v6,{...e,ref:n,children:t})})}),S6=b6;function DD(t){const{children:e,items:n,open:r,onItemClick:i,onOpenChange:s}=t;return _e(_6,{onOpenChange:s,open:r,children:[T(w6,{asChild:!0,className:"outline-none",children:e}),T(E6,{className:"modal-shadow cursor-pointer rounded-2xl bg-white text-sm font-medium text-slate-200",children:n.map(({id:o,label:a,icon:c,className:l})=>_e(S6,{className:St("flex items-center px-5 py-2 outline-none first-of-type:rounded-t-2xl first-of-type:pt-3 last-of-type:rounded-b-2xl last-of-type:pb-3 hover:bg-slate-50",l),onClick:u=>u.stopPropagation(),onSelect:()=>i(o),children:[c?T("span",{className:"mr-2 inline-block",children:c}):null,a]},o))})]})}const kD="2.22.17";let $u={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t??"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${kD}`};class Xn extends Error{constructor(e,n={}){var a;const r=(()=>{var c;return n.cause instanceof Xn?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof Xn&&n.cause.docsPath||n.docsPath,s=(a=$u.getDocsUrl)==null?void 0:a.call($u,{...n,docsPath:i}),o=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...$u.version?[`Version: ${$u.version}`]:[]].join(`
55
+ `);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,"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,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=e,this.version=kD}walk(e){return AD(this,e)}}function AD(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?AD(t.cause,e):e?null:t}class x6 extends Xn{constructor({max:e,min:n,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class che extends Xn{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class T6 extends Xn{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class I6 extends Xn{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}class lhe extends Xn{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class ND extends Xn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}class uhe extends Xn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}function vu(t,{dir:e,size:n=32}={}){return typeof t=="string"?O6(t,{dir:e,size:n}):C6(t,{dir:e,size:n})}function O6(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new ND({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function C6(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new ND({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const s=e==="right";r[s?i:n-i-1]=t[s?i:t.length-i-1]}return r}function Yw(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Nx(t){return Yw(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function hv(t,{dir:e="left"}={}){let n=typeof t=="string"?t.replace("0x",""):t,r=0;for(let i=0;i<n.length-1&&n[e==="left"?i:n.length-i-1].toString()==="0";i++)r++;return n=e==="left"?n.slice(r):n.slice(0,n.length-r),typeof t=="string"?(n.length===1&&e==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const R6=new TextEncoder;function D6(t,e={}){return typeof t=="number"||typeof t=="bigint"?A6(t,e):typeof t=="boolean"?k6(t,e):Yw(t)?PD(t,e):MD(t,e)}function k6(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?(Oc(n,{size:e.size}),vu(n,{size:e.size})):n}const Fs={zero:48,nine:57,A:65,F:70,a:97,f:102};function Px(t){if(t>=Fs.zero&&t<=Fs.nine)return t-Fs.zero;if(t>=Fs.A&&t<=Fs.F)return t-(Fs.A-10);if(t>=Fs.a&&t<=Fs.f)return t-(Fs.a-10)}function PD(t,e={}){let n=t;e.size&&(Oc(n,{size:e.size}),n=vu(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=Px(r.charCodeAt(a++)),l=Px(r.charCodeAt(a++));if(c===void 0||l===void 0)throw new Xn(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[o]=c*16+l}return s}function A6(t,e){const n=ym(t,e);return PD(n)}function MD(t,e={}){const n=R6.encode(t);return typeof e.size=="number"?(Oc(n,{size:e.size}),vu(n,{dir:"right",size:e.size})):n}function Oc(t,{size:e}){if(Nx(t)>e)throw new I6({givenSize:Nx(t),maxSize:e})}function N6(t,e={}){const{signed:n}=e;e.size&&Oc(t,{size:e.size});const r=BigInt(t);if(!n)return r;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function dhe(t,e={}){let n=t;if(e.size&&(Oc(n,{size:e.size}),n=hv(n)),hv(n)==="0x00")return!1;if(hv(n)==="0x01")return!0;throw new T6(n)}function fhe(t,e={}){return Number(N6(t,e))}const P6=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function M6(t,e={}){return typeof t=="number"||typeof t=="bigint"?ym(t,e):typeof t=="string"?FD(t,e):typeof t=="boolean"?L6(t,e):LD(t,e)}function L6(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(Oc(n,{size:e.size}),vu(n,{size:e.size})):n}function LD(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=P6[t[i]];const r=`0x${n}`;return typeof e.size=="number"?(Oc(r,{size:e.size}),vu(r,{dir:"right",size:e.size})):r}function ym(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new x6({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${t}${c}`})}const a=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?vu(a,{size:r}):a}const F6=new TextEncoder;function FD(t,e={}){const n=F6.encode(t);return LD(n,e)}class $6 extends Xn{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class Kw 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}}function vm(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function j6(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Xg(t,...e){if(!j6(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 phe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");vm(t.outputLen),vm(t.blockLen)}function Mx(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 U6(t,e){Xg(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const Wp=BigInt(2**32-1),Lx=BigInt(32);function B6(t,e=!1){return e?{h:Number(t&Wp),l:Number(t>>Lx&Wp)}:{h:Number(t>>Lx&Wp)|0,l:Number(t&Wp)|0}}function z6(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=B6(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const V6=(t,e,n)=>t<<n|e>>>32-n,H6=(t,e,n)=>e<<n|t>>>32-n,W6=(t,e,n)=>e<<n-32|t>>>64-n,q6=(t,e,n)=>t<<n-32|e>>>64-n,Hc=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function G6(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function hhe(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function mhe(t,e){return t<<32-e|t>>>e}const Fx=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Z6(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function $x(t){for(let e=0;e<t.length;e++)t[e]=Z6(t[e])}function Y6(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function $D(t){return typeof t=="string"&&(t=Y6(t)),Xg(t),t}function ghe(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];Xg(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const s=t[r];n.set(s,i),i+=s.length}return n}let K6=class{clone(){return this._cloneInto()}};function J6(t){const e=r=>t().update($D(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function vhe(t=32){if(Hc&&typeof Hc.getRandomValues=="function")return Hc.getRandomValues(new Uint8Array(t));if(Hc&&typeof Hc.randomBytes=="function")return Hc.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const jD=[],UD=[],BD=[],X6=BigInt(0),ju=BigInt(1),Q6=BigInt(2),e9=BigInt(7),t9=BigInt(256),n9=BigInt(113);for(let t=0,e=ju,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],jD.push(2*(5*r+n)),UD.push((t+1)*(t+2)/2%64);let i=X6;for(let s=0;s<7;s++)e=(e<<ju^(e>>e9)*n9)%t9,e&Q6&&(i^=ju<<(ju<<BigInt(s))-ju);BD.push(i)}const[r9,i9]=z6(BD,!0),jx=(t,e,n)=>n>32?W6(t,e,n):V6(t,e,n),Ux=(t,e,n)=>n>32?q6(t,e,n):H6(t,e,n);function s9(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=jx(l,u,1)^n[a],f=Ux(l,u,1)^n[a+1];for(let p=0;p<50;p+=10)t[o+p]^=d,t[o+p+1]^=f}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=UD[o],c=jx(i,s,a),l=Ux(i,s,a),u=jD[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=r9[r],t[1]^=i9[r]}n.fill(0)}class Jw extends K6{constructor(e,n,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,vm(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=G6(this.state)}keccak(){Fx||$x(this.state32),s9(this.state32,this.rounds),Fx||$x(this.state32),this.posOut=0,this.pos=0}update(e){Mx(this);const{blockLen:n,state:r}=this;e=$D(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=e[s++];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){Mx(this,!1),Xg(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return vm(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(U6(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,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Jw(n,r,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const o9=(t,e,n)=>J6(()=>new Jw(e,t,n)),a9=o9(1,136,256/8);function c9(t,e){const n=e||"hex",r=a9(Yw(t,{strict:!1})?D6(t):t);return n==="bytes"?r:M6(r)}const mv=new Kw(8192);function zD(t,e){if(mv.has(`${t}.${e}`))return mv.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=c9(MD(n),"bytes"),i=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return mv.set(`${t}.${e}`,s),s}function qp(t,e){if(!u9(t,{strict:!1}))throw new $6({address:t});return zD(t,e)}const l9=/^0x[a-fA-F0-9]{40}$/,gv=new Kw(8192);function u9(t,e){const{strict:n=!0}=e??{},r=`${t}.${n}`;if(gv.has(r))return gv.get(r);const i=l9.test(t)?t.toLowerCase()===t?!0:n?zD(t)===t:!0:!1;return gv.set(r,i),i}function d9(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const Ga=(t,e,n)=>JSON.stringify(t,(r,i)=>typeof i=="bigint"?i.toString():i,n),bhe=t=>t,Xw=t=>t;class yd extends Xn{constructor({body:e,cause:n,details:r,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${Xw(o)}`,e&&`Request body: ${Ga(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class VD extends Xn{constructor({body:e,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Xw(r)}`,`Request body: ${Ga(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class Bx extends Xn{constructor({body:e,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Xw(n)}`,`Request body: ${Ga(e)}`],name:"TimeoutError"})}}const f9=-1;class Br extends Xn{constructor(e,{code:n,docsPath:r,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof VD?e.code:n??f9}}class bu extends Br{constructor(e,n){super(e,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class jd extends Br{constructor(e){super(e,{code:jd.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(jd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Ud extends Br{constructor(e){super(e,{code:Ud.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Ud,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Bd extends Br{constructor(e,{method:n}={}){super(e,{code:Bd.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(Bd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class zd extends Br{constructor(e){super(e,{code:zd.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
56
+ `)})}}Object.defineProperty(zd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class zl extends Br{constructor(e){super(e,{code:zl.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(zl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Vd extends Br{constructor(e){super(e,{code:Vd.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
57
+ `)})}}Object.defineProperty(Vd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Hd extends Br{constructor(e){super(e,{code:Hd.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Hd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Ho extends Br{constructor(e){super(e,{code:Ho.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Wd extends Br{constructor(e){super(e,{code:Wd.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Wd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Pa extends Br{constructor(e,{method:n}={}){super(e,{code:Pa.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Pa,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Vl extends Br{constructor(e){super(e,{code:Vl.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Vl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class qd extends Br{constructor(e){super(e,{code:qd.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(qd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class gr extends bu{constructor(e){super(e,{code:gr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(gr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Gd extends bu{constructor(e){super(e,{code:Gd.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Gd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Zd extends bu{constructor(e,{method:n}={}){super(e,{code:Zd.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(Zd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Yd extends bu{constructor(e){super(e,{code:Yd.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Yd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Kd extends bu{constructor(e){super(e,{code:Kd.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Kd,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class nc extends bu{constructor(e){super(e,{code:nc.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(nc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class p9 extends Br{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function h9(){let t=()=>{},e=()=>{};return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}const yv=new Map;function m9({fn:t,id:e,shouldSplitBatch:n,wait:r=0,sort:i}){const s=async()=>{const u=c();o();const d=u.map(({args:f})=>f);d.length!==0&&t(d).then(f=>{i&&Array.isArray(f)&&f.sort(i);for(let p=0;p<u.length;p++){const{resolve:m}=u[p];m==null||m([f[p],f])}}).catch(f=>{for(let p=0;p<u.length;p++){const{reject:m}=u[p];m==null||m(f)}})},o=()=>yv.delete(e),a=()=>c().map(({args:u})=>u),c=()=>yv.get(e)||[],l=u=>yv.set(e,[...c(),u]);return{flush:o,async schedule(u){const{promise:d,resolve:f,reject:p}=h9();return(n==null?void 0:n([...a(),u]))&&s(),c().length>0?(l({args:u,resolve:f,reject:p}),d):(l({args:u,resolve:f,reject:p}),setTimeout(s,r),d)}}}async function g9(t){return new Promise(e=>setTimeout(e,t))}const Gp=new Kw(8192);function y9(t,{enabled:e=!0,id:n}){if(!e||!n)return t();if(Gp.get(n))return Gp.get(n);const r=t().finally(()=>Gp.delete(n));return Gp.set(n,r),r}function HD(t,{delay:e=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await g9(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a<n&&await r({count:a,error:l}))return c({error:l});s(l)}};o()})}function v9(t,e={}){return async(n,r={})=>{var d;const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...r},{method:l}=n;if((d=s==null?void 0:s.exclude)!=null&&d.includes(l))throw new Pa(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new Pa(new Error("method not supported"),{method:l});const u=i?FD(`${c}.${Ga(n)}`):void 0;return y9(()=>HD(async()=>{try{return await t(n)}catch(f){const p=f;switch(p.code){case jd.code:throw new jd(p);case Ud.code:throw new Ud(p);case Bd.code:throw new Bd(p,{method:n.method});case zd.code:throw new zd(p);case zl.code:throw new zl(p);case Vd.code:throw new Vd(p);case Hd.code:throw new Hd(p);case Ho.code:throw new Ho(p);case Wd.code:throw new Wd(p);case Pa.code:throw new Pa(p,{method:n.method});case Vl.code:throw new Vl(p);case qd.code:throw new qd(p);case gr.code:throw new gr(p);case Gd.code:throw new Gd(p);case Zd.code:throw new Zd(p);case Yd.code:throw new Yd(p);case Kd.code:throw new Kd(p);case nc.code:throw new nc(p);case 5e3:throw new gr(p);default:throw f instanceof Xn?f:new p9(p)}}},{delay:({count:f,error:p})=>{var m;if(p&&p instanceof yd){const h=(m=p==null?void 0:p.headers)==null?void 0:m.get("Retry-After");if(h!=null&&h.match(/\d/))return Number.parseInt(h)*1e3}return~~(1<<f)*o},retryCount:a,shouldRetry:({error:f})=>b9(f)}),{enabled:i,id:u})}}function b9(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Vl.code||t.code===zl.code:t instanceof yd&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function _9(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function WD(t,{errorInstance:e=new Error("timed out"),timeout:n,signal:r}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;n>0&&(o=setTimeout(()=>{r?a.abort():s(e)},n)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function w9(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const zx=w9();function E9(t,e={}){return{async request(n){var d;const{body:r,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=n,a={...e.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:l,signal:u}=a;try{const f=await WD(async({signal:m})=>{const h={...a,body:Array.isArray(r)?Ga(r.map(b=>({jsonrpc:"2.0",id:b.id??zx.take(),...b}))):Ga({jsonrpc:"2.0",id:r.id??zx.take(),...r}),headers:{"Content-Type":"application/json",...c},method:l||"POST",signal:u||(o>0?m:null)},g=new Request(t,h),y=await(i==null?void 0:i(g,h))??{...h,url:t};return await fetch(y.url??t,y)},{errorInstance:new Bx({body:r,url:t}),timeout:o,signal:!0});s&&await s(f);let p;if((d=f.headers.get("Content-Type"))!=null&&d.startsWith("application/json"))p=await f.json();else{p=await f.text();try{p=JSON.parse(p||"{}")}catch(m){if(f.ok)throw m;p={error:p}}}if(!f.ok)throw new yd({body:r,details:Ga(p.error)||f.statusText,headers:f.headers,status:f.status,url:t});return p}catch(f){throw f instanceof yd||f instanceof Bx?f:new yd({body:r,cause:f,url:t})}}}}const Lh="2.16.3",S9=()=>`@wagmi/core@${Lh}`;var qD=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)},bm,GD;let ZD=class kb extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return S9()}constructor(e,n={}){var s;super(),bm.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 kb?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details,i=n.cause instanceof kb&&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(`
58
+ `),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return qD(this,bm,"m",GD).call(this,this,e)}};bm=new WeakSet,GD=function t(e,n){return n!=null&&n(e)?e:e.cause?qD(this,bm,"m",t).call(this,e.cause,n):e};class Ab extends ZD{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const Nb=256;let Zp=Nb,Yp;function YD(t=11){if(!Yp||Zp+t>Nb*2){Yp="",Zp=0;for(let e=0;e<Nb;e++)Yp+=(256+Math.random()*256|0).toString(16).substring(1)}return Yp.substring(Zp,Zp+++t)}function x9(t){const{batch:e,cacheTime:n=t.pollingInterval??4e3,ccipRead:r,key:i="base",name:s="Base Client",pollingInterval:o=4e3,type:a="base"}=t,c=t.chain,l=t.account?d9(t.account):void 0,{config:u,request:d,value:f}=t.transport({chain:c,pollingInterval:o}),p={...u,...f},m={account:l,batch:e,cacheTime:n,ccipRead:r,chain:c,key:i,name:s,pollingInterval:o,request:d,transport:p,type:a,uid:YD()};function h(g){return y=>{const v=y(g);for(const E in m)delete v[E];const b={...g,...v};return Object.assign(b,{extend:h(b)})}}return Object.assign(m,{extend:h(m)})}function T9({key:t,methods:e,name:n,request:r,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const l=YD();return{config:{key:t,name:n,request:r,retryCount:i,retryDelay:s,timeout:o,type:a},request:v9(r,{methods:e,retryCount:i,retryDelay:s,uid:l}),value:c}}class I9 extends Xn{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function O9(t,e={}){const{batch:n,fetchOptions:r,key:i="http",methods:s,name:o="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:c,retryDelay:l}=e;return({chain:u,retryCount:d,timeout:f})=>{const{batchSize:p=1e3,wait:m=0}=typeof n=="object"?n:{},h=e.retryCount??d,g=f??e.timeout??1e4,y=u==null?void 0:u.rpcUrls.default.http[0];if(!y)throw new I9;const v=E9(y,{fetchOptions:r,onRequest:a,onResponse:c,timeout:g});return T9({key:i,methods:s,name:o,async request({method:b,params:E}){const w={method:b,params:E},{schedule:S}=m9({id:y,wait:m,shouldSplitBatch(F){return F.length>p},fn:F=>v.request({body:F}),sort:(F,q)=>F.id-q.id}),_=async F=>n?S(F):[await v.request({body:F})],[{error:O,result:M}]=await _(w);if(O)throw new VD({body:w,error:O,url:y});return M},retryCount:h,retryDelay:l,timeout:g,type:"http"},{fetchOptions:r,url:y})}}let vv=!1;async function C9(t,e={}){var l,u;if(vv)return[];vv=!0,t.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const n=[];if((l=e.connectors)!=null&&l.length)for(const d of e.connectors){let f;typeof d=="function"?f=t._internal.connectors.setup(d):f=d,n.push(f)}else n.push(...t.connectors);let r;try{r=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const i={};for(const[,d]of t.state.connections)i[d.connector.id]=1;r&&(i[r]=0);const s=Object.keys(i).length>0?[...n].sort((d,f)=>(i[d.id]??10)-(i[f.id]??10)):n;let o=!1;const a=[],c=[];for(const d of s){const f=await d.getProvider().catch(()=>{});if(!f||c.some(h=>h===f)||!await d.isAuthorized())continue;const m=await d.connect({isReconnecting:!0}).catch(()=>null);m&&(d.emitter.off("connect",t._internal.events.connect),d.emitter.on("change",t._internal.events.change),d.emitter.on("disconnect",t._internal.events.disconnect),t.setState(h=>{const g=new Map(o?h.connections:new Map).set(d.uid,{accounts:m.accounts,chainId:m.chainId,connector:d});return{...h,current:o?h.current:d.uid,connections:g}}),a.push({accounts:m.accounts,chainId:m.chainId,connector:d}),c.push(f),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(d=>({...d,status:"connected"})):t.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),vv=!1,a}class Wc extends ZD{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}Qw.type="injected";function Qw(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"?{...R9[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==null?void 0:l.ethereum}}}let i,s,o,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:Qw.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&t.target&&(o||(o=this.onConnect.bind(this),l.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:u}={}){var p,m,h,g,y,v;const d=await this.getProvider();if(!d)throw new Wc;let f=[];if(u)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(g=(h=(m=(p=(await d.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:h.value)==null?void 0:g.map(E=>qp(E)),f.length>0&&(f=await this.getAccounts())}catch(b){const E=b;if(E.code===gr.code)throw new gr(E);if(E.code===Ho.code)throw E}try{!(f!=null&&f.length)&&!u&&(f=(await d.request({method:"eth_requestAccounts"})).map(w=>qp(w))),o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),d.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a));let b=await this.getChainId();if(l&&b!==l){const E=await this.switchChain({chainId:l}).catch(w=>{if(w.code===gr.code)throw w;return{id:b}});b=(E==null?void 0:E.id)??b}return e&&await((y=c.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),t.target||await((v=c.storage)==null?void 0:v.setItem("injected.connected",!0)),{accounts:f,chainId:b}}catch(b){const E=b;throw E.code===gr.code?new gr(E):E.code===Ho.code?new Ho(E):E}},async disconnect(){var u,d;const l=await this.getProvider();if(!l)throw new Wc;s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o));try{await WD(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((u=c.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),t.target||await((d=c.storage)==null?void 0:d.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new Wc;return(await l.request({method:"eth_accounts"})).map(d=>qp(d))},async getChainId(){const l=await this.getProvider();if(!l)throw new Wc;const u=await l.request({method:"eth_chainId"});return Number(u)},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=Fh(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(){var l,u;try{if(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!t.target&&!await((u=c.storage)==null?void 0:u.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const m=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",m),!!await this.getProvider()),h=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(y=>window.addEventListener("ethereum#initialized",()=>y(m()),{once:!0}))]:[],new Promise(y=>setTimeout(()=>y(m()),h))]))return!0}throw new Wc}return!!(await HD(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var m,h,g,y;const d=await this.getProvider();if(!d)throw new Wc;const f=c.chains.find(v=>v.id===u);if(!f)throw new nc(new Ab);const p=new Promise(v=>{const b=E=>{"chainId"in E&&E.chainId===u&&(c.emitter.off("change",b),v())};c.emitter.on("change",b)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:ym(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),p]),f}catch(v){const b=v;if(b.code===4902||((h=(m=b==null?void 0:b.data)==null?void 0:m.originalError)==null?void 0:h.code)===4902)try{const{default:E,...w}=f.blockExplorers??{};let S;l!=null&&l.blockExplorerUrls?S=l.blockExplorerUrls:E&&(S=[E.url,...Object.values(w).map(M=>M.url)]);let _;(g=l==null?void 0:l.rpcUrls)!=null&&g.length?_=l.rpcUrls:_=[((y=f.rpcUrls.default)==null?void 0:y.http[0])??""];const O={blockExplorerUrls:S,chainId:ym(u),chainName:(l==null?void 0:l.chainName)??f.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??f.nativeCurrency,rpcUrls:_};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[O]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new gr(new Error("User rejected switch after adding network."))}),p]),f}catch(E){throw new gr(E)}throw b.code===gr.code?new gr(b):new nc(b)}},async onAccountsChanged(l){var u;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),e&&await((u=c.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(d=>qp(d))})},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&&(o&&(f.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),f.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a)))},async onDisconnect(l){const u=await this.getProvider();l&&l.code===1013&&u&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),u&&(s&&(u.removeListener("chainChanged",s),s=void 0),a&&(u.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o))))}})}const R9={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:Fh(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return Fh(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","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){var e,n;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(n=t.phantom)==null?void 0:n.ethereum:Fh(t,"isPhantom")}}};function Fh(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r!=null&&r.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}function D9(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 k9(){const t=new Set;let e=[];const n=()=>D9(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r==null||r()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),r==null||r(),r=n()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const A9=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let d=o(r.getState());l=f=>{const p=o(f);if(!u(d,p)){const m=d;a(d=p,m)}},c!=null&&c.fireImmediately&&a(d,d)}return i(l)},t(e,n,r)},N9=A9;function P9(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,void 0),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const Pb=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return Pb(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Pb(r)(n)}}}},M9=(t,e)=>(n,r,i)=>{let s={storage:P9(()=>localStorage),partialize:h=>h,version:0,merge:(h,g)=>({...g,...h}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...h)},r,i);const u=()=>{const h=s.partialize({...r()});return l.setItem(s.name,{state:h,version:s.version})},d=i.setState;i.setState=(h,g)=>{d(h,g),u()};const f=t((...h)=>{n(...h),u()},r,i);i.getInitialState=()=>f;let p;const m=()=>{var h,g;if(!l)return;o=!1,a.forEach(v=>{var b;return v((b=r())!=null?b:f)});const y=((g=s.onRehydrateStorage)==null?void 0:g.call(s,(h=r())!=null?h:f))||void 0;return Pb(l.getItem.bind(l))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate)return[!0,s.migrate(v.state,v.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var b;const[E,w]=v;if(p=s.merge(w,(b=r())!=null?b:f),n(p,!0),E)return u()}).then(()=>{y==null||y(p,void 0),p=r(),o=!0,c.forEach(v=>v(p))}).catch(v=>{y==null||y(void 0,v)})};return i.persist={setOptions:h=>{s={...s,...h},h.storage&&(l=h.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:h=>(a.add(h),()=>{a.delete(h)}),onFinishHydration:h=>(c.add(h),()=>{c.delete(h)})},s.skipHydration||m(),p||f},L9=M9,Vx=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({},e,d),n.forEach(p=>p(e,f))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=e=t(r,i,a);return a},bv=t=>t?Vx(t):Vx;var KD={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 s(c,l,u,d,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new i(u,d||c,f),m=n?n+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function a(){this._events=new r,this._eventsCount=0}a.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},a.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,p=d.length,m=new Array(p);f<p;f++)m[f]=d[f].fn;return m},a.prototype.listenerCount=function(l){var u=n?n+l:l,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(l,u,d,f,p,m){var h=n?n+l:l;if(!this._events[h])return!1;var g=this._events[h],y=arguments.length,v,b;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,d),!0;case 4:return g.fn.call(g.context,u,d,f),!0;case 5:return g.fn.call(g.context,u,d,f,p),!0;case 6:return g.fn.call(g.context,u,d,f,p,m),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];g.fn.apply(g.context,v)}else{var E=g.length,w;for(b=0;b<E;b++)switch(g[b].once&&this.removeListener(l,g[b].fn,void 0,!0),y){case 1:g[b].fn.call(g[b].context);break;case 2:g[b].fn.call(g[b].context,u);break;case 3:g[b].fn.call(g[b].context,u,d);break;case 4:g[b].fn.call(g[b].context,u,d,f);break;default:if(!v)for(w=1,v=new Array(y-1);w<y;w++)v[w-1]=arguments[w];g[b].fn.apply(g[b].context,v)}}return!0},a.prototype.on=function(l,u,d){return s(this,l,u,d,!1)},a.prototype.once=function(l,u,d){return s(this,l,u,d,!0)},a.prototype.removeListener=function(l,u,d,f){var p=n?n+l:l;if(!this._events[p])return this;if(!u)return o(this,p),this;var m=this._events[p];if(m.fn)m.fn===u&&(!f||m.once)&&(!d||m.context===d)&&o(this,p);else{for(var h=0,g=[],y=m.length;h<y;h++)(m[h].fn!==u||f&&!m[h].once||d&&m[h].context!==d)&&g.push(m[h]);g.length?this._events[p]=g.length===1?g[0]:g:o(this,p)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&o(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(KD);var F9=KD.exports;const $9=pa(F9);class j9{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 $9})}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 U9(t){return new j9(t)}function B9(t,e){return JSON.parse(t,(n,r)=>{let i=r;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(n,i))??i})}function Hx(t,e){return t.slice(0,e).join(".")||"."}function Wx(t,e){const{length:n}=t;for(let r=0;r<n;++r)if(t[r]===e)return r+1;return 0}function z9(t,e){const n=typeof t=="function",r=typeof e=="function",i=[],s=[];return function(a,c){if(typeof c=="object")if(i.length){const l=Wx(i,this);l===0?i[i.length]=this:(i.splice(l),s.splice(l)),s[s.length]=a;const u=Wx(i,c);if(u!==0)return r?e.call(this,a,c,Hx(s,u)):`[ref=${Hx(s,u)}]`}else i[0]=c,s[0]=a;return n?t.call(this,a,c):c}}function V9(t,e,n,r){return JSON.stringify(t,z9((i,s)=>{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},r),n??void 0)}function H9(t){const{deserialize:e=B9,key:n="wagmi",serialize:r=V9,storage:i=JD}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:n,async getItem(o,a){const c=i.getItem(`${n}.${o}`),l=await s(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${n}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,r(a)))},async removeItem(o){await s(i.removeItem(`${n}.${o}`))}}}const JD={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function W9(){const t=typeof window<"u"&&window.localStorage?window.localStorage:JD;return{getItem(e){return t.getItem(e)},removeItem(e){t.removeItem(e)},setItem(e,n){try{t.setItem(e,n)}catch{}}}}const Mb=256;let Kp=Mb,Jp;function q9(t=11){if(!Jp||Kp+t>Mb*2){Jp="",Kp=0;for(let e=0;e<Mb;e++)Jp+=(256+Math.random()*256|0).toString(16).substring(1)}return Jp.substring(Kp,Kp+++t)}function G9(t){const{multiInjectedProviderDiscovery:e=!0,storage:n=H9({storage:W9()}),syncConnectedChain:r=!0,ssr:i=!1,...s}=t,o=typeof window<"u"&&e?k9():void 0,a=bv(()=>s.chains),c=bv(()=>{const w=[],S=new Set;for(const _ of s.connectors??[]){const O=l(_);if(w.push(O),!i&&O.rdns){const M=typeof O.rdns=="string"?[O.rdns]:O.rdns;for(const F of M)S.add(F)}}if(!i&&o){const _=o.getProviders();for(const O of _)S.has(O.info.rdns)||w.push(l(u(O)))}return w});function l(w){var O;const S=U9(q9()),_={...w({emitter:S,chains:a.getState(),storage:n,transports:s.transports}),emitter:S,uid:S.uid};return S.on("connect",b),(O=_.setup)==null||O.call(_),_}function u(w){const{info:S}=w,_=w.provider;return Qw({target:{...S,id:S.rdns,provider:_}})}const d=new Map;function f(w={}){const S=w.chainId??g.getState().chainId,_=a.getState().find(M=>M.id===S);if(w.chainId&&!_)throw new Ab;{const M=d.get(g.getState().chainId);if(M&&!_)return M;if(!_)throw new Ab}{const M=d.get(S);if(M)return M}let O;if(s.client)O=s.client({chain:_});else{const M=_.id,F=a.getState().map($=>$.id),q={},I=Object.entries(s);for(const[$,x]of I)if(!($==="chains"||$==="client"||$==="connectors"||$==="transports"))if(typeof x=="object")if(M in x)q[$]=x[M];else{if(F.some(P=>P in x))continue;q[$]=x}else q[$]=x;O=x9({...q,chain:_,batch:q.batch??{multicall:!0},transport:$=>s.transports[M]({...$,connectors:c})})}return d.set(S,O),O}function p(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const h="0.0.0-canary-";Lh.startsWith(h)?m=Number.parseInt(Lh.replace(h,"")):m=Number.parseInt(Lh.split(".")[0]??"0");const g=bv(N9(n?L9(p,{migrate(w,S){if(S===m)return w;const _=p(),O=y(w,_.chainId);return{..._,chainId:O}},name:"store",partialize(w){return{connections:{__type:"Map",value:Array.from(w.connections.entries()).map(([S,_])=>{const{id:O,name:M,type:F,uid:q}=_.connector;return[S,{..._,connector:{id:O,name:M,type:F,uid:q}}]})},chainId:w.chainId,current:w.current}},merge(w,S){typeof w=="object"&&w&&"status"in w&&delete w.status;const _=y(w,S.chainId);return{...S,...w,chainId:_}},skipHydration:i,storage:n,version:m}):p));g.setState(p());function y(w,S){return w&&typeof w=="object"&&"chainId"in w&&typeof w.chainId=="number"&&a.getState().some(_=>_.id===w.chainId)?w.chainId:S}r&&g.subscribe(({connections:w,current:S})=>{var _;return S?(_=w.get(S))==null?void 0:_.chainId:void 0},w=>{if(a.getState().some(_=>_.id===w))return g.setState(_=>({..._,chainId:w??_.chainId}))}),o==null||o.subscribe(w=>{const S=new Set,_=new Set;for(const M of c.getState())if(S.add(M.id),M.rdns){const F=typeof M.rdns=="string"?[M.rdns]:M.rdns;for(const q of F)_.add(q)}const O=[];for(const M of w){if(_.has(M.info.rdns))continue;const F=l(u(M));S.has(F.id)||O.push(F)}n&&!g.persist.hasHydrated()||c.setState(M=>[...M,...O],!0)});function v(w){g.setState(S=>{const _=S.connections.get(w.uid);return _?{...S,connections:new Map(S.connections).set(w.uid,{accounts:w.accounts??_.accounts,chainId:w.chainId??_.chainId,connector:_.connector})}:S})}function b(w){g.getState().status==="connecting"||g.getState().status==="reconnecting"||g.setState(S=>{const _=c.getState().find(O=>O.uid===w.uid);return _?(_.emitter.listenerCount("connect")&&_.emitter.off("connect",v),_.emitter.listenerCount("change")||_.emitter.on("change",v),_.emitter.listenerCount("disconnect")||_.emitter.on("disconnect",E),{...S,connections:new Map(S.connections).set(w.uid,{accounts:w.accounts,chainId:w.chainId,connector:_}),current:w.uid,status:"connected"}):S})}function E(w){g.setState(S=>{const _=S.connections.get(w.uid);if(_){const M=_.connector;M.emitter.listenerCount("change")&&_.connector.emitter.off("change",v),M.emitter.listenerCount("disconnect")&&_.connector.emitter.off("disconnect",E),M.emitter.listenerCount("connect")||_.connector.emitter.on("connect",b)}if(S.connections.delete(w.uid),S.connections.size===0)return{...S,connections:new Map,current:null,status:"disconnected"};const O=S.connections.values().next().value;return{...S,connections:new Map(S.connections),current:O.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:f,get state(){return g.getState()},setState(w){let S;typeof w=="function"?S=w(g.getState()):S=w;const _=p();typeof S!="object"&&(S=_),Object.keys(_).some(M=>!(M in S))&&(S=_),g.setState(S,!0)},subscribe(w,S,_){return g.subscribe(w,S,_?{..._,fireImmediately:_.emitImmediately}:void 0)},_internal:{mipd:o,store:g,ssr:!!i,syncConnectedChain:r,transports:s.transports,chains:{setState(w){const S=typeof w=="function"?w(a.getState()):w;if(S.length!==0)return a.setState(S,!0)},subscribe(w){return a.subscribe(w)}},connectors:{providerDetailToConnector:u,setup:l,setState(w){return c.setState(typeof w=="function"?w(c.getState()):w,!0)},subscribe(w){return c.subscribe(w)}},events:{change:v,connect:b,disconnect:E}}}}function Z9(t,e){const{initialState:n,reconnectOnMount:r}=e;return n&&!t._internal.store.persist.hasHydrated()&&t.setState({...n,chainId:t.chains.some(i=>i.id===n.chainId)?n.chainId:t.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){t._internal.ssr&&(await t._internal.store.persist.rehydrate(),t._internal.mipd&&t._internal.connectors.setState(i=>{var c;const s=new Set;for(const l of i??[])if(l.rdns){const u=Array.isArray(l.rdns)?l.rdns:[l.rdns];for(const d of u)s.add(d)}const o=[],a=((c=t._internal.mipd)==null?void 0:c.getProviders())??[];for(const l of a){if(s.has(l.info.rdns))continue;const u=t._internal.connectors.providerDetailToConnector(l),d=t._internal.connectors.setup(u);o.push(d)}return[...i,...o]})),r?C9(t):t.storage&&t.setState(i=>({...i,connections:new Map}))}}}function Y9(t){const{children:e,config:n,initialState:r,reconnectOnMount:i=!0}=t,{onMount:s}=Z9(n,{initialState:r,reconnectOnMount:i});n._internal.ssr||s();const o=hn(!0);return jt(()=>{if(o.current&&n._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const K9=fu(void 0);function J9(t){const{children:e,config:n}=t,r={value:n};return qa(Y9,t,qa(K9.Provider,r,e))}var XD={exports:{}},QD={};/**
59
+ * @license React
60
+ * use-sync-external-store-shim.production.js
61
+ *
62
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE file in the root directory of this source tree.
66
+ */var Hl=Ae;function X9(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Q9=typeof Object.is=="function"?Object.is:X9,e8=Hl.useState,t8=Hl.useEffect,n8=Hl.useLayoutEffect,r8=Hl.useDebugValue;function i8(t,e){var n=e(),r=e8({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return n8(function(){i.value=n,i.getSnapshot=e,_v(i)&&s({inst:i})},[t,n,e]),t8(function(){return _v(i)&&s({inst:i}),t(function(){_v(i)&&s({inst:i})})},[t]),r8(n),n}function _v(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Q9(t,n)}catch{return!0}}function s8(t,e){return e()}var o8=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s8:i8;QD.useSyncExternalStore=Hl.useSyncExternalStore!==void 0?Hl.useSyncExternalStore:o8;XD.exports=QD;var a8=XD.exports,Qg=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ey=typeof window>"u"||"Deno"in globalThis;function Ti(){}function c8(t,e){return typeof t=="function"?t(e):t}function l8(t){return typeof t=="number"&&t>=0&&t!==1/0}function u8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function qx(t,e){return typeof t=="function"?t(e):t}function d8(t,e){return typeof t=="function"?t(e):t}function Gx(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==eE(o,e.options))return!1}else if(!Xd(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function Zx(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Jd(e.options.mutationKey)!==Jd(s))return!1}else if(!Xd(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function eE(t,e){return((e==null?void 0:e.queryKeyHashFn)||Jd)(t)}function Jd(t){return JSON.stringify(t,(e,n)=>Lb(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Xd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Xd(t[n],e[n])):!1}function e1(t,e){if(t===e)return t;const n=Yx(t)&&Yx(e);if(n||Lb(t)&&Lb(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,a=n?[]:{};let c=0;for(let l=0;l<o;l++){const u=n?l:s[l];(!n&&r.includes(u)||n)&&t[u]===void 0&&e[u]===void 0?(a[u]=void 0,c++):(a[u]=e1(t[u],e[u]),a[u]===t[u]&&t[u]!==void 0&&c++)}return i===o&&c===i?t:a}return e}function _he(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Yx(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Lb(t){if(!Kx(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Kx(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Kx(t){return Object.prototype.toString.call(t)==="[object Object]"}function f8(t){return new Promise(e=>{setTimeout(e,t)})}function p8(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?e1(t,e):e}function h8(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function m8(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var tE=Symbol();function t1(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===tE?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var za,Fo,Rl,QO,g8=(QO=class extends Qg{constructor(){super();It(this,za);It(this,Fo);It(this,Rl);bt(this,Rl,e=>{if(!ey&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){de(this,Fo)||this.setEventListener(de(this,Rl))}onUnsubscribe(){var e;this.hasListeners()||((e=de(this,Fo))==null||e.call(this),bt(this,Fo,void 0))}setEventListener(e){var n;bt(this,Rl,e),(n=de(this,Fo))==null||n.call(this),bt(this,Fo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){de(this,za)!==e&&(bt(this,za,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof de(this,za)=="boolean"?de(this,za):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},za=new WeakMap,Fo=new WeakMap,Rl=new WeakMap,QO),n1=new g8,Dl,$o,kl,eC,y8=(eC=class extends Qg{constructor(){super();It(this,Dl,!0);It(this,$o);It(this,kl);bt(this,kl,e=>{if(!ey&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){de(this,$o)||this.setEventListener(de(this,kl))}onUnsubscribe(){var e;this.hasListeners()||((e=de(this,$o))==null||e.call(this),bt(this,$o,void 0))}setEventListener(e){var n;bt(this,kl,e),(n=de(this,$o))==null||n.call(this),bt(this,$o,e(this.setOnline.bind(this)))}setOnline(e){de(this,Dl)!==e&&(bt(this,Dl,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return de(this,Dl)}},Dl=new WeakMap,$o=new WeakMap,kl=new WeakMap,eC),_m=new y8;function v8(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function b8(t){return Math.min(1e3*2**t,3e4)}function r1(t){return(t??"online")==="online"?_m.isOnline():!0}var i1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function wv(t){return t instanceof i1}function s1(t){let e=!1,n=0,r=!1,i;const s=v8(),o=h=>{var g;r||(f(new i1(h)),(g=t.abort)==null||g.call(t))},a=()=>{e=!0},c=()=>{e=!1},l=()=>n1.isFocused()&&(t.networkMode==="always"||_m.isOnline())&&t.canRun(),u=()=>r1(t.networkMode)&&t.canRun(),d=h=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,h),i==null||i(),s.resolve(h))},f=h=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,h),i==null||i(),s.reject(h))},p=()=>new Promise(h=>{var g;i=y=>{(r||l())&&h(y)},(g=t.onPause)==null||g.call(t)}).then(()=>{var h;i=void 0,r||(h=t.onContinue)==null||h.call(t)}),m=()=>{if(r)return;let h;const g=n===0?t.initialPromise:void 0;try{h=g??t.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(d).catch(y=>{var S;if(r)return;const v=t.retry??(ey?0:3),b=t.retryDelay??b8,E=typeof b=="function"?b(n,y):b,w=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(e||!w){f(y);return}n++,(S=t.onFail)==null||S.call(t,n,y),f8(E).then(()=>l()?void 0:p()).then(()=>{e?f(y):m()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),s)}}function _8(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var br=_8(),Va,tC,o1=(tC=class{constructor(){It(this,Va)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),l8(this.gcTime)&&bt(this,Va,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ey?1/0:5*60*1e3))}clearGcTimeout(){de(this,Va)&&(clearTimeout(de(this,Va)),bt(this,Va,void 0))}},Va=new WeakMap,tC),Al,Nl,ui,ur,Gf,Ha,Ii,js,nC,w8=(nC=class extends o1{constructor(e){super();It(this,Ii);It(this,Al);It(this,Nl);It(this,ui);It(this,ur);It(this,Gf);It(this,Ha);bt(this,Ha,!1),bt(this,Gf,e.defaultOptions),this.setOptions(e.options),this.observers=[],bt(this,ui,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,bt(this,Al,S8(this.options)),this.state=e.state??de(this,Al),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=de(this,ur))==null?void 0:e.promise}setOptions(e){this.options={...de(this,Gf),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&de(this,ui).remove(this)}setData(e,n){const r=p8(this.state.data,e,this.options);return un(this,Ii,js).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){un(this,Ii,js).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=de(this,ur))==null?void 0:r.promise;return(i=de(this,ur))==null||i.cancel(e),n?n.then(Ti).catch(Ti):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(de(this,Al))}isActive(){return this.observers.some(e=>d8(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tE||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!u8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=de(this,ur))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=de(this,ur))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),de(this,ui).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(de(this,ur)&&(de(this,Ha)?de(this,ur).cancel({revert:!0}):de(this,ur).cancelRetry()),this.scheduleGc()),de(this,ui).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||un(this,Ii,js).call(this,{type:"invalidate"})}fetch(e,n){var c,l,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(de(this,ur))return de(this,ur).continueRetry(),de(this,ur).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(bt(this,Ha,!0),r.signal)})},s=()=>{const d=t1(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),bt(this,Ha,!1),this.options.persister?this.options.persister(d,f,this):d(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(c=this.options.behavior)==null||c.onFetch(o,this),bt(this,Nl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=o.fetchOptions)==null?void 0:l.meta))&&un(this,Ii,js).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const a=d=>{var f,p,m,h;wv(d)&&d.silent||un(this,Ii,js).call(this,{type:"error",error:d}),wv(d)||((p=(f=de(this,ui).config).onError)==null||p.call(f,d,this),(h=(m=de(this,ui).config).onSettled)==null||h.call(m,this.state.data,d,this)),this.scheduleGc()};return bt(this,ur,s1({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,p,m,h;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(g){a(g);return}(p=(f=de(this,ui).config).onSuccess)==null||p.call(f,d,this),(h=(m=de(this,ui).config).onSettled)==null||h.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{un(this,Ii,js).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{un(this,Ii,js).call(this,{type:"pause"})},onContinue:()=>{un(this,Ii,js).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),de(this,ur).start()}},Al=new WeakMap,Nl=new WeakMap,ui=new WeakMap,ur=new WeakMap,Gf=new WeakMap,Ha=new WeakMap,Ii=new WeakSet,js=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...E8(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return wv(i)&&i.revert&&de(this,Nl)?{...de(this,Nl),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),br.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),de(this,ui).notify({query:this,type:"updated",action:e})})},nC);function E8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:r1(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function S8(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ns,rC,x8=(rC=class extends Qg{constructor(e={}){super();It(this,ns);this.config=e,bt(this,ns,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??eE(i,n);let o=this.get(s);return o||(o=new w8({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){de(this,ns).has(e.queryHash)||(de(this,ns).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=de(this,ns).get(e.queryHash);n&&(e.destroy(),n===e&&de(this,ns).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){br.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return de(this,ns).get(e)}getAll(){return[...de(this,ns).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Gx(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Gx(e,r)):n}notify(e){br.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){br.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ns=new WeakMap,rC),rs,mr,Wa,is,Io,iC,T8=(iC=class extends o1{constructor(e){super();It(this,is);It(this,rs);It(this,mr);It(this,Wa);this.mutationId=e.mutationId,bt(this,mr,e.mutationCache),bt(this,rs,[]),this.state=e.state||I8(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){de(this,rs).includes(e)||(de(this,rs).push(e),this.clearGcTimeout(),de(this,mr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){bt(this,rs,de(this,rs).filter(n=>n!==e)),this.scheduleGc(),de(this,mr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){de(this,rs).length||(this.state.status==="pending"?this.scheduleGc():de(this,mr).remove(this))}continue(){var e;return((e=de(this,Wa))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,a,c,l,u,d,f,p,m,h,g,y,v,b,E,w,S,_;bt(this,Wa,s1({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(O,M)=>{un(this,is,Io).call(this,{type:"failed",failureCount:O,error:M})},onPause:()=>{un(this,is,Io).call(this,{type:"pause"})},onContinue:()=>{un(this,is,Io).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>de(this,mr).canRun(this)}));const n=this.state.status==="pending",r=!de(this,Wa).canStart();try{if(!n){un(this,is,Io).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=de(this,mr).config).onMutate)==null?void 0:s.call(i,e,this));const M=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));M!==this.state.context&&un(this,is,Io).call(this,{type:"pending",context:M,variables:e,isPaused:r})}const O=await de(this,Wa).start();return await((l=(c=de(this,mr).config).onSuccess)==null?void 0:l.call(c,O,e,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,O,e,this.state.context)),await((p=(f=de(this,mr).config).onSettled)==null?void 0:p.call(f,O,null,this.state.variables,this.state.context,this)),await((h=(m=this.options).onSettled)==null?void 0:h.call(m,O,null,e,this.state.context)),un(this,is,Io).call(this,{type:"success",data:O}),O}catch(O){try{throw await((y=(g=de(this,mr).config).onError)==null?void 0:y.call(g,O,e,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,O,e,this.state.context)),await((w=(E=de(this,mr).config).onSettled)==null?void 0:w.call(E,void 0,O,this.state.variables,this.state.context,this)),await((_=(S=this.options).onSettled)==null?void 0:_.call(S,void 0,O,e,this.state.context)),O}finally{un(this,is,Io).call(this,{type:"error",error:O})}}finally{de(this,mr).runNext(this)}}},rs=new WeakMap,mr=new WeakMap,Wa=new WeakMap,is=new WeakSet,Io=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),br.batch(()=>{de(this,rs).forEach(r=>{r.onMutationUpdate(e)}),de(this,mr).notify({mutation:this,type:"updated",action:e})})},iC);function I8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qs,Oi,Zf,sC,O8=(sC=class extends Qg{constructor(e={}){super();It(this,qs);It(this,Oi);It(this,Zf);this.config=e,bt(this,qs,new Set),bt(this,Oi,new Map),bt(this,Zf,0)}build(e,n,r){const i=new T8({mutationCache:this,mutationId:++Ap(this,Zf)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){de(this,qs).add(e);const n=Xp(e);if(typeof n=="string"){const r=de(this,Oi).get(n);r?r.push(e):de(this,Oi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(de(this,qs).delete(e)){const n=Xp(e);if(typeof n=="string"){const r=de(this,Oi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&de(this,Oi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Xp(e);if(typeof n=="string"){const r=de(this,Oi).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Xp(e);if(typeof n=="string"){const i=(r=de(this,Oi).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){br.batch(()=>{de(this,qs).forEach(e=>{this.notify({type:"removed",mutation:e})}),de(this,qs).clear(),de(this,Oi).clear()})}getAll(){return Array.from(de(this,qs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Zx(n,r))}findAll(e={}){return this.getAll().filter(n=>Zx(e,n))}notify(e){br.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return br.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ti))))}},qs=new WeakMap,Oi=new WeakMap,Zf=new WeakMap,sC);function Xp(t){var e;return(e=t.options.scope)==null?void 0:e.id}function Jx(t){return{onFetch:(e,n)=>{var u,d,f,p,m;const r=e.options,i=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((p=e.state.data)==null?void 0:p.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let h=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},y=t1(e.options,e.fetchOptions),v=async(b,E,w)=>{if(h)return Promise.reject();if(E==null&&b.pages.length)return Promise.resolve(b);const S={queryKey:e.queryKey,pageParam:E,direction:w?"backward":"forward",meta:e.options.meta};g(S);const _=await y(S),{maxPages:O}=e.options,M=w?m8:h8;return{pages:M(b.pages,_,O),pageParams:M(b.pageParams,E,O)}};if(i&&s.length){const b=i==="backward",E=b?C8:Xx,w={pages:s,pageParams:o},S=E(r,w);a=await v(w,S,b)}else{const b=t??s.length;do{const E=c===0?o[0]??r.initialPageParam:Xx(r,a);if(c>0&&E==null)break;a=await v(a,E),c++}while(c<b)}return a};e.options.persister?e.fetchFn=()=>{var h,g;return(g=(h=e.options).persister)==null?void 0:g.call(h,l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=l}}}function Xx(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function C8(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var On,jo,Uo,Pl,Ml,Bo,Ll,Fl,oC,R8=(oC=class{constructor(t={}){It(this,On);It(this,jo);It(this,Uo);It(this,Pl);It(this,Ml);It(this,Bo);It(this,Ll);It(this,Fl);bt(this,On,t.queryCache||new x8),bt(this,jo,t.mutationCache||new O8),bt(this,Uo,t.defaultOptions||{}),bt(this,Pl,new Map),bt(this,Ml,new Map),bt(this,Bo,0)}mount(){Ap(this,Bo)._++,de(this,Bo)===1&&(bt(this,Ll,n1.subscribe(async t=>{t&&(await this.resumePausedMutations(),de(this,On).onFocus())})),bt(this,Fl,_m.subscribe(async t=>{t&&(await this.resumePausedMutations(),de(this,On).onOnline())})))}unmount(){var t,e;Ap(this,Bo)._--,de(this,Bo)===0&&((t=de(this,Ll))==null||t.call(this),bt(this,Ll,void 0),(e=de(this,Fl))==null||e.call(this),bt(this,Fl,void 0))}isFetching(t){return de(this,On).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return de(this,jo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=de(this,On).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=de(this,On).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(qx(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return de(this,On).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=de(this,On).get(r.queryHash),s=i==null?void 0:i.state.data,o=c8(e,s);if(o!==void 0)return de(this,On).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return br.batch(()=>de(this,On).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=de(this,On).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=de(this,On);br.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=de(this,On),r={type:"active",...t};return br.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=br.batch(()=>de(this,On).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Ti).catch(Ti)}invalidateQueries(t,e={}){return br.batch(()=>{if(de(this,On).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=br.batch(()=>de(this,On).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ti)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ti)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=de(this,On).build(this,e);return n.isStaleByTime(qx(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ti).catch(Ti)}fetchInfiniteQuery(t){return t.behavior=Jx(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ti).catch(Ti)}ensureInfiniteQueryData(t){return t.behavior=Jx(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return _m.isOnline()?de(this,jo).resumePausedMutations():Promise.resolve()}getQueryCache(){return de(this,On)}getMutationCache(){return de(this,jo)}getDefaultOptions(){return de(this,Uo)}setDefaultOptions(t){bt(this,Uo,t)}setQueryDefaults(t,e){de(this,Pl).set(Jd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...de(this,Pl).values()],n={};return e.forEach(r=>{Xd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){de(this,Ml).set(Jd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...de(this,Ml).values()];let n={};return e.forEach(r=>{Xd(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...de(this,Uo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=eE(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===tE&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...de(this,Uo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){de(this,On).clear(),de(this,jo).clear()}},On=new WeakMap,jo=new WeakMap,Uo=new WeakMap,Pl=new WeakMap,Ml=new WeakMap,Bo=new WeakMap,Ll=new WeakMap,Fl=new WeakMap,oC),a1=k.createContext(void 0),whe=t=>{const e=k.useContext(a1);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},D8=({client:t,children:e})=>(k.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),T(a1.Provider,{value:t,children:e}));const Ehe="SYNCING",k8="SUCCESS",She="CONFLICT",xhe="MISSING",A8="ERROR",The="INITIAL_SYNC";var sp=t=>t.type==="checkbox",Ma=t=>t instanceof Date,yr=t=>t==null;const c1=t=>typeof t=="object";var Mn=t=>!yr(t)&&!Array.isArray(t)&&c1(t)&&!Ma(t),l1=t=>Mn(t)&&t.target?sp(t.target)?t.target.checked:t.target.value:t,N8=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,u1=(t,e)=>t.has(N8(e)),P8=t=>{const e=t.constructor&&t.constructor.prototype;return Mn(e)&&e.hasOwnProperty("isPrototypeOf")},nE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Dr(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(nE&&(t instanceof Blob||r))&&(n||Mn(t)))if(e=n?[]:{},!n&&!P8(t))e=t;else for(const i in t)t.hasOwnProperty(i)&&(e[i]=Dr(t[i]));else return t;return e}var ty=t=>Array.isArray(t)?t.filter(Boolean):[],Nn=t=>t===void 0,Me=(t,e,n)=>{if(!e||!Mn(t))return n;const r=ty(e.split(/[,[\].]+?/)).reduce((i,s)=>yr(i)?i:i[s],t);return Nn(r)||r===t?Nn(t[e])?n:t[e]:r},di=t=>typeof t=="boolean",rE=t=>/^\w*$/.test(t),d1=t=>ty(t.replace(/["|']|\]/g,"").split(/\.|\[/)),cn=(t,e,n)=>{let r=-1;const i=rE(e)?[e]:d1(e),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let c=n;if(r!==o){const l=t[a];c=Mn(l)||Array.isArray(l)?l:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;t[a]=c,t=t[a]}return t};const wm={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ni={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},$s={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},M8=Ae.createContext(null),iE=()=>Ae.useContext(M8);var f1=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const s in t)Object.defineProperty(i,s,{get:()=>{const o=s;return e._proxyFormState[o]!==Ni.all&&(e._proxyFormState[o]=!r||Ni.all),n&&(n[o]=!0),t[o]}});return i},kr=t=>Mn(t)&&!Object.keys(t).length,p1=(t,e,n,r)=>{n(t);const{name:i,...s}=t;return kr(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(o=>e[o]===(!r||Ni.all))},vd=t=>Array.isArray(t)?t:[t],h1=(t,e,n)=>!t||!e||t===e||vd(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function sE(t){const e=Ae.useRef(t);e.current=t,Ae.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function L8(t){const e=iE(),{control:n=e.control,disabled:r,name:i,exact:s}=t,[o,a]=Ae.useState(n._formState),c=Ae.useRef(!0),l=Ae.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=Ae.useRef(i);return u.current=i,sE({disabled:r,next:d=>c.current&&h1(u.current,d.name,s)&&p1(d,l.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),Ae.useEffect(()=>(c.current=!0,l.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),Ae.useMemo(()=>f1(o,n,l.current,!1),[o,n])}var ps=t=>typeof t=="string",m1=(t,e,n,r,i)=>ps(t)?(r&&e.watch.add(t),Me(n,t,i)):Array.isArray(t)?t.map(s=>(r&&e.watch.add(s),Me(n,s))):(r&&(e.watchAll=!0),n);function F8(t){const e=iE(),{control:n=e.control,name:r,defaultValue:i,disabled:s,exact:o}=t,a=Ae.useRef(r);a.current=r,sE({disabled:s,subject:n._subjects.values,next:u=>{h1(a.current,u.name,o)&&l(Dr(m1(a.current,n._names,u.values||n._formValues,!1,i)))}});const[c,l]=Ae.useState(n._getWatch(r,i));return Ae.useEffect(()=>n._removeUnmounted()),c}function $8(t){const e=iE(),{name:n,disabled:r,control:i=e.control,shouldUnregister:s}=t,o=u1(i._names.array,n),a=F8({control:i,name:n,defaultValue:Me(i._formValues,n,Me(i._defaultValues,n,t.defaultValue)),exact:!0}),c=L8({control:i,name:n,exact:!0}),l=Ae.useRef(i.register(n,{...t.rules,value:a,...di(t.disabled)?{disabled:t.disabled}:{}})),u=Ae.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Me(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Me(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Me(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Me(c.validatingFields,n)},error:{enumerable:!0,get:()=>Me(c.errors,n)}}),[c,n]),d=Ae.useMemo(()=>({name:n,value:a,...di(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:f=>l.current.onChange({target:{value:l1(f),name:n},type:wm.CHANGE}),onBlur:()=>l.current.onBlur({target:{value:Me(i._formValues,n),name:n},type:wm.BLUR}),ref:f=>{const p=Me(i._fields,n);p&&f&&(p._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:m=>f.setCustomValidity(m),reportValidity:()=>f.reportValidity()})}}),[n,i._formValues,r,c.disabled,a,i._fields]);return Ae.useEffect(()=>{const f=i._options.shouldUnregister||s,p=(m,h)=>{const g=Me(i._fields,m);g&&g._f&&(g._f.mount=h)};if(p(n,!0),f){const m=Dr(Me(i._options.defaultValues,n));cn(i._defaultValues,n,m),Nn(Me(i._formValues,n))&&cn(i._formValues,n,m)}return!o&&i.register(n),()=>{(o?f&&!i._state.action:f)?i.unregister(n):p(n,!1)}},[n,i,o,s]),Ae.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),Ae.useMemo(()=>({field:d,formState:c,fieldState:u}),[d,c,u])}const j8=t=>t.render($8(t));var U8=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},Qx=t=>({isOnSubmit:!t||t===Ni.onSubmit,isOnBlur:t===Ni.onBlur,isOnChange:t===Ni.onChange,isOnAll:t===Ni.all,isOnTouch:t===Ni.onTouched}),eT=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const bd=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const s=Me(t,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(bd(a,e))break}else if(Mn(a)&&bd(a,e))break}}};var B8=(t,e,n)=>{const r=vd(Me(t,n));return cn(r,"root",e[n]),cn(t,n,r),t},oE=t=>t.type==="file",ds=t=>typeof t=="function",Em=t=>{if(!nE)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},$h=t=>ps(t),aE=t=>t.type==="radio",Sm=t=>t instanceof RegExp;const tT={value:!1,isValid:!1},nT={value:!0,isValid:!0};var g1=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Nn(t[0].attributes.value)?Nn(t[0].value)||t[0].value===""?nT:{value:t[0].value,isValid:!0}:nT:tT}return tT};const rT={isValid:!1,value:null};var y1=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,rT):rT;function iT(t,e,n="validate"){if($h(t)||Array.isArray(t)&&t.every($h)||di(t)&&!t)return{type:n,message:$h(t)?t:"",ref:e}}var qc=t=>Mn(t)&&!Sm(t)?t:{value:t,message:""},sT=async(t,e,n,r,i,s)=>{const{ref:o,refs:a,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:y}=t._f,v=Me(n,h);if(!y||e.has(h))return{};const b=a?a[0]:o,E=I=>{i&&b.reportValidity&&(b.setCustomValidity(di(I)?"":I||""),b.reportValidity())},w={},S=aE(o),_=sp(o),O=S||_,M=(g||oE(o))&&Nn(o.value)&&Nn(v)||Em(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,F=U8.bind(null,h,r,w),q=(I,$,x,A=$s.maxLength,P=$s.minLength)=>{const B=I?$:x;w[h]={type:I?A:P,message:B,ref:o,...F(I?A:P,B)}};if(s?!Array.isArray(v)||!v.length:c&&(!O&&(M||yr(v))||di(v)&&!v||_&&!g1(a).isValid||S&&!y1(a).isValid)){const{value:I,message:$}=$h(c)?{value:!!c,message:c}:qc(c);if(I&&(w[h]={type:$s.required,message:$,ref:b,...F($s.required,$)},!r))return E($),w}if(!M&&(!yr(d)||!yr(f))){let I,$;const x=qc(f),A=qc(d);if(!yr(v)&&!isNaN(v)){const P=o.valueAsNumber||v&&+v;yr(x.value)||(I=P>x.value),yr(A.value)||($=P<A.value)}else{const P=o.valueAsDate||new Date(v),B=G=>new Date(new Date().toDateString()+" "+G),J=o.type=="time",L=o.type=="week";ps(x.value)&&v&&(I=J?B(v)>B(x.value):L?v>x.value:P>new Date(x.value)),ps(A.value)&&v&&($=J?B(v)<B(A.value):L?v<A.value:P<new Date(A.value))}if((I||$)&&(q(!!I,x.message,A.message,$s.max,$s.min),!r))return E(w[h].message),w}if((l||u)&&!M&&(ps(v)||s&&Array.isArray(v))){const I=qc(l),$=qc(u),x=!yr(I.value)&&v.length>+I.value,A=!yr($.value)&&v.length<+$.value;if((x||A)&&(q(x,I.message,$.message),!r))return E(w[h].message),w}if(p&&!M&&ps(v)){const{value:I,message:$}=qc(p);if(Sm(I)&&!v.match(I)&&(w[h]={type:$s.pattern,message:$,ref:o,...F($s.pattern,$)},!r))return E($),w}if(m){if(ds(m)){const I=await m(v,n),$=iT(I,b);if($&&(w[h]={...$,...F($s.validate,$.message)},!r))return E($.message),w}else if(Mn(m)){let I={};for(const $ in m){if(!kr(I)&&!r)break;const x=iT(await m[$](v,n),b,$);x&&(I={...x,...F($,x.message)},E(x.message),r&&(w[h]=I))}if(!kr(I)&&(w[h]={ref:b,...I},!r))return w}}return E(!0),w};function z8(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Nn(t)?r++:t[e[r++]];return t}function V8(t){for(const e in t)if(t.hasOwnProperty(e)&&!Nn(t[e]))return!1;return!0}function Vn(t,e){const n=Array.isArray(e)?e:rE(e)?[e]:d1(e),r=n.length===1?t:z8(t,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(Mn(r)&&kr(r)||Array.isArray(r)&&V8(r))&&Vn(t,n.slice(0,-1)),t}var Ev=()=>{let t=[];return{get observers(){return t},next:i=>{for(const s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}},Fb=t=>yr(t)||!c1(t);function Po(t,e){if(Fb(t)||Fb(e))return t===e;if(Ma(t)&&Ma(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const s=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=e[i];if(Ma(s)&&Ma(o)||Mn(s)&&Mn(o)||Array.isArray(s)&&Array.isArray(o)?!Po(s,o):s!==o)return!1}}return!0}var v1=t=>t.type==="select-multiple",H8=t=>aE(t)||sp(t),Sv=t=>Em(t)&&t.isConnected,b1=t=>{for(const e in t)if(ds(t[e]))return!0;return!1};function xm(t,e={}){const n=Array.isArray(t);if(Mn(t)||n)for(const r in t)Array.isArray(t[r])||Mn(t[r])&&!b1(t[r])?(e[r]=Array.isArray(t[r])?[]:{},xm(t[r],e[r])):yr(t[r])||(e[r]=!0);return e}function _1(t,e,n){const r=Array.isArray(t);if(Mn(t)||r)for(const i in t)Array.isArray(t[i])||Mn(t[i])&&!b1(t[i])?Nn(e)||Fb(n[i])?n[i]=Array.isArray(t[i])?xm(t[i],[]):{...xm(t[i])}:_1(t[i],yr(e)?{}:e[i],n[i]):n[i]=!Po(t[i],e[i]);return n}var Uu=(t,e)=>_1(t,e,xm(e)),w1=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Nn(t)?t:e?t===""?NaN:t&&+t:n&&ps(t)?new Date(t):r?r(t):t;function xv(t){const e=t.ref;return oE(e)?e.files:aE(e)?y1(t.refs).value:v1(e)?[...e.selectedOptions].map(({value:n})=>n):sp(e)?g1(t.refs).value:w1(Nn(e.value)?t.ref.value:e.value,t)}var W8=(t,e,n,r)=>{const i={};for(const s of t){const o=Me(e,s);o&&cn(i,s,o._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Bu=t=>Nn(t)?t:Sm(t)?t.source:Mn(t)?Sm(t.value)?t.value.source:t.value:t;const oT="AsyncFunction";var q8=t=>!!t&&!!t.validate&&!!(ds(t.validate)&&t.validate.constructor.name===oT||Mn(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===oT)),G8=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function aT(t,e,n){const r=Me(t,n);if(r||rE(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=Me(e,s),a=Me(t,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:n}}var Z8=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,Y8=(t,e)=>!ty(Me(t,e)).length&&Vn(t,e);const K8={mode:Ni.onSubmit,reValidateMode:Ni.onChange,shouldFocusError:!0};function J8(t={}){let e={...K8,...t},n={submitCount:0,isDirty:!1,isLoading:ds(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=Mn(e.defaultValues)||Mn(e.values)?Dr(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:Dr(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Ev(),array:Ev(),state:Ev()},f=Qx(e.mode),p=Qx(e.reValidateMode),m=e.criteriaMode===Ni.all,h=R=>N=>{clearTimeout(l),l=setTimeout(R,N)},g=async R=>{if(!e.disabled&&(u.isValid||R)){const N=e.resolver?kr((await O()).errors):await F(r,!0);N!==n.isValid&&d.state.next({isValid:N})}},y=(R,N)=>{!e.disabled&&(u.isValidating||u.validatingFields)&&((R||Array.from(a.mount)).forEach(z=>{z&&(N?cn(n.validatingFields,z,N):Vn(n.validatingFields,z))}),d.state.next({validatingFields:n.validatingFields,isValidating:!kr(n.validatingFields)}))},v=(R,N=[],z,X,Y=!0,ee=!0)=>{if(X&&z&&!e.disabled){if(o.action=!0,ee&&Array.isArray(Me(r,R))){const pe=z(Me(r,R),X.argA,X.argB);Y&&cn(r,R,pe)}if(ee&&Array.isArray(Me(n.errors,R))){const pe=z(Me(n.errors,R),X.argA,X.argB);Y&&cn(n.errors,R,pe),Y8(n.errors,R)}if(u.touchedFields&&ee&&Array.isArray(Me(n.touchedFields,R))){const pe=z(Me(n.touchedFields,R),X.argA,X.argB);Y&&cn(n.touchedFields,R,pe)}u.dirtyFields&&(n.dirtyFields=Uu(i,s)),d.state.next({name:R,isDirty:I(R,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else cn(s,R,N)},b=(R,N)=>{cn(n.errors,R,N),d.state.next({errors:n.errors})},E=R=>{n.errors=R,d.state.next({errors:n.errors,isValid:!1})},w=(R,N,z,X)=>{const Y=Me(r,R);if(Y){const ee=Me(s,R,Nn(z)?Me(i,R):z);Nn(ee)||X&&X.defaultChecked||N?cn(s,R,N?ee:xv(Y._f)):A(R,ee),o.mount&&g()}},S=(R,N,z,X,Y)=>{let ee=!1,pe=!1;const he={name:R};if(!e.disabled){const Pe=!!(Me(r,R)&&Me(r,R)._f&&Me(r,R)._f.disabled);if(!z||X){u.isDirty&&(pe=n.isDirty,n.isDirty=he.isDirty=I(),ee=pe!==he.isDirty);const nt=Pe||Po(Me(i,R),N);pe=!!(!Pe&&Me(n.dirtyFields,R)),nt||Pe?Vn(n.dirtyFields,R):cn(n.dirtyFields,R,!0),he.dirtyFields=n.dirtyFields,ee=ee||u.dirtyFields&&pe!==!nt}if(z){const nt=Me(n.touchedFields,R);nt||(cn(n.touchedFields,R,z),he.touchedFields=n.touchedFields,ee=ee||u.touchedFields&&nt!==z)}ee&&Y&&d.state.next(he)}return ee?he:{}},_=(R,N,z,X)=>{const Y=Me(n.errors,R),ee=u.isValid&&di(N)&&n.isValid!==N;if(e.delayError&&z?(c=h(()=>b(R,z)),c(e.delayError)):(clearTimeout(l),c=null,z?cn(n.errors,R,z):Vn(n.errors,R)),(z?!Po(Y,z):Y)||!kr(X)||ee){const pe={...X,...ee&&di(N)?{isValid:N}:{},errors:n.errors,name:R};n={...n,...pe},d.state.next(pe)}},O=async R=>{y(R,!0);const N=await e.resolver(s,e.context,W8(R||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return y(R),N},M=async R=>{const{errors:N}=await O(R);if(R)for(const z of R){const X=Me(N,z);X?cn(n.errors,z,X):Vn(n.errors,z)}else n.errors=N;return N},F=async(R,N,z={valid:!0})=>{for(const X in R){const Y=R[X];if(Y){const{_f:ee,...pe}=Y;if(ee){const he=a.array.has(ee.name),Pe=Y._f&&q8(Y._f);Pe&&u.validatingFields&&y([X],!0);const nt=await sT(Y,a.disabled,s,m,e.shouldUseNativeValidation&&!N,he);if(Pe&&u.validatingFields&&y([X]),nt[ee.name]&&(z.valid=!1,N))break;!N&&(Me(nt,ee.name)?he?B8(n.errors,nt,ee.name):cn(n.errors,ee.name,nt[ee.name]):Vn(n.errors,ee.name))}!kr(pe)&&await F(pe,N,z)}}return z.valid},q=()=>{for(const R of a.unMount){const N=Me(r,R);N&&(N._f.refs?N._f.refs.every(z=>!Sv(z)):!Sv(N._f.ref))&&ce(R)}a.unMount=new Set},I=(R,N)=>!e.disabled&&(R&&N&&cn(s,R,N),!Po(U(),i)),$=(R,N,z)=>m1(R,a,{...o.mount?s:Nn(N)?i:ps(R)?{[R]:N}:N},z,N),x=R=>ty(Me(o.mount?s:i,R,e.shouldUnregister?Me(i,R,[]):[])),A=(R,N,z={})=>{const X=Me(r,R);let Y=N;if(X){const ee=X._f;ee&&(!ee.disabled&&cn(s,R,w1(N,ee)),Y=Em(ee.ref)&&yr(N)?"":N,v1(ee.ref)?[...ee.ref.options].forEach(pe=>pe.selected=Y.includes(pe.value)):ee.refs?sp(ee.ref)?ee.refs.length>1?ee.refs.forEach(pe=>(!pe.defaultChecked||!pe.disabled)&&(pe.checked=Array.isArray(Y)?!!Y.find(he=>he===pe.value):Y===pe.value)):ee.refs[0]&&(ee.refs[0].checked=!!Y):ee.refs.forEach(pe=>pe.checked=pe.value===Y):oE(ee.ref)?ee.ref.value="":(ee.ref.value=Y,ee.ref.type||d.values.next({name:R,values:{...s}})))}(z.shouldDirty||z.shouldTouch)&&S(R,Y,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&G(R)},P=(R,N,z)=>{for(const X in N){const Y=N[X],ee=`${R}.${X}`,pe=Me(r,ee);(a.array.has(R)||Mn(Y)||pe&&!pe._f)&&!Ma(Y)?P(ee,Y,z):A(ee,Y,z)}},B=(R,N,z={})=>{const X=Me(r,R),Y=a.array.has(R),ee=Dr(N);cn(s,R,ee),Y?(d.array.next({name:R,values:{...s}}),(u.isDirty||u.dirtyFields)&&z.shouldDirty&&d.state.next({name:R,dirtyFields:Uu(i,s),isDirty:I(R,ee)})):X&&!X._f&&!yr(ee)?P(R,ee,z):A(R,ee,z),eT(R,a)&&d.state.next({...n}),d.values.next({name:o.mount?R:void 0,values:{...s}})},J=async R=>{o.mount=!0;const N=R.target;let z=N.name,X=!0;const Y=Me(r,z),ee=()=>N.type?xv(Y._f):l1(R),pe=he=>{X=Number.isNaN(he)||Ma(he)&&isNaN(he.getTime())||Po(he,Me(s,z,he))};if(Y){let he,Pe;const nt=ee(),Ze=R.type===wm.BLUR||R.type===wm.FOCUS_OUT,Xt=!G8(Y._f)&&!e.resolver&&!Me(n.errors,z)&&!Y._f.deps||Z8(Ze,Me(n.touchedFields,z),n.isSubmitted,p,f),Gn=eT(z,a,Ze);cn(s,z,nt),Ze?(Y._f.onBlur&&Y._f.onBlur(R),c&&c(0)):Y._f.onChange&&Y._f.onChange(R);const an=S(z,nt,Ze,!1),pr=!kr(an)||Gn;if(!Ze&&d.values.next({name:z,type:R.type,values:{...s}}),Xt)return u.isValid&&(e.mode==="onBlur"&&Ze?g():Ze||g()),pr&&d.state.next({name:z,...Gn?{}:an});if(!Ze&&Gn&&d.state.next({...n}),e.resolver){const{errors:rt}=await O([z]);if(pe(nt),X){const xn=aT(n.errors,r,z),Rr=aT(rt,r,xn.name||z);he=Rr.error,z=Rr.name,Pe=kr(rt)}}else y([z],!0),he=(await sT(Y,a.disabled,s,m,e.shouldUseNativeValidation))[z],y([z]),pe(nt),X&&(he?Pe=!1:u.isValid&&(Pe=await F(r,!0)));X&&(Y._f.deps&&G(Y._f.deps),_(z,Pe,he,an))}},L=(R,N)=>{if(Me(n.errors,N)&&R.focus)return R.focus(),1},G=async(R,N={})=>{let z,X;const Y=vd(R);if(e.resolver){const ee=await M(Nn(R)?R:Y);z=kr(ee),X=R?!Y.some(pe=>Me(ee,pe)):z}else R?(X=(await Promise.all(Y.map(async ee=>{const pe=Me(r,ee);return await F(pe&&pe._f?{[ee]:pe}:pe)}))).every(Boolean),!(!X&&!n.isValid)&&g()):X=z=await F(r);return d.state.next({...!ps(R)||u.isValid&&z!==n.isValid?{}:{name:R},...e.resolver||!R?{isValid:z}:{},errors:n.errors}),N.shouldFocus&&!X&&bd(r,L,R?Y:a.mount),X},U=R=>{const N={...o.mount?s:i};return Nn(R)?N:ps(R)?Me(N,R):R.map(z=>Me(N,z))},C=(R,N)=>({invalid:!!Me((N||n).errors,R),isDirty:!!Me((N||n).dirtyFields,R),error:Me((N||n).errors,R),isValidating:!!Me(n.validatingFields,R),isTouched:!!Me((N||n).touchedFields,R)}),Z=R=>{R&&vd(R).forEach(N=>Vn(n.errors,N)),d.state.next({errors:R?n.errors:{}})},H=(R,N,z)=>{const X=(Me(r,R,{_f:{}})._f||{}).ref,Y=Me(n.errors,R)||{},{ref:ee,message:pe,type:he,...Pe}=Y;cn(n.errors,R,{...Pe,...N,ref:X}),d.state.next({name:R,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&X&&X.focus&&X.focus()},V=(R,N)=>ds(R)?d.values.subscribe({next:z=>R($(void 0,N),z)}):$(R,N,!0),ce=(R,N={})=>{for(const z of R?vd(R):a.mount)a.mount.delete(z),a.array.delete(z),N.keepValue||(Vn(r,z),Vn(s,z)),!N.keepError&&Vn(n.errors,z),!N.keepDirty&&Vn(n.dirtyFields,z),!N.keepTouched&&Vn(n.touchedFields,z),!N.keepIsValidating&&Vn(n.validatingFields,z),!e.shouldUnregister&&!N.keepDefaultValue&&Vn(i,z);d.values.next({values:{...s}}),d.state.next({...n,...N.keepDirty?{isDirty:I()}:{}}),!N.keepIsValid&&g()},le=({disabled:R,name:N,field:z,fields:X})=>{(di(R)&&o.mount||R||a.disabled.has(N))&&(R?a.disabled.add(N):a.disabled.delete(N),S(N,xv(z?z._f:Me(X,N)._f),!1,!1,!0))},ge=(R,N={})=>{let z=Me(r,R);const X=di(N.disabled)||di(e.disabled);return cn(r,R,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:R}},name:R,mount:!0,...N}}),a.mount.add(R),z?le({field:z,disabled:di(N.disabled)?N.disabled:e.disabled,name:R}):w(R,!0,N.value),{...X?{disabled:N.disabled||e.disabled}:{},...e.progressive?{required:!!N.required,min:Bu(N.min),max:Bu(N.max),minLength:Bu(N.minLength),maxLength:Bu(N.maxLength),pattern:Bu(N.pattern)}:{},name:R,onChange:J,onBlur:J,ref:Y=>{if(Y){ge(R,N),z=Me(r,R);const ee=Nn(Y.value)&&Y.querySelectorAll&&Y.querySelectorAll("input,select,textarea")[0]||Y,pe=H8(ee),he=z._f.refs||[];if(pe?he.find(Pe=>Pe===ee):ee===z._f.ref)return;cn(r,R,{_f:{...z._f,...pe?{refs:[...he.filter(Sv),ee,...Array.isArray(Me(i,R))?[{}]:[]],ref:{type:ee.type,name:R}}:{ref:ee}}}),w(R,!1,void 0,ee)}else z=Me(r,R,{}),z._f&&(z._f.mount=!1),(e.shouldUnregister||N.shouldUnregister)&&!(u1(a.array,R)&&o.action)&&a.unMount.add(R)}}},Re=()=>e.shouldFocusError&&bd(r,L,a.mount),Ge=R=>{di(R)&&(d.state.next({disabled:R}),bd(r,(N,z)=>{const X=Me(r,z);X&&(N.disabled=X._f.disabled||R,Array.isArray(X._f.refs)&&X._f.refs.forEach(Y=>{Y.disabled=X._f.disabled||R}))},0,!1))},st=(R,N)=>async z=>{let X;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let Y=Dr(s);if(a.disabled.size)for(const ee of a.disabled)cn(Y,ee,void 0);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:ee,values:pe}=await O();n.errors=ee,Y=pe}else await F(r);if(Vn(n.errors,"root"),kr(n.errors)){d.state.next({errors:{}});try{await R(Y,z)}catch(ee){X=ee}}else N&&await N({...n.errors},z),Re(),setTimeout(Re);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:kr(n.errors)&&!X,submitCount:n.submitCount+1,errors:n.errors}),X)throw X},He=(R,N={})=>{Me(r,R)&&(Nn(N.defaultValue)?B(R,Dr(Me(i,R))):(B(R,N.defaultValue),cn(i,R,Dr(N.defaultValue))),N.keepTouched||Vn(n.touchedFields,R),N.keepDirty||(Vn(n.dirtyFields,R),n.isDirty=N.defaultValue?I(R,Dr(Me(i,R))):I()),N.keepError||(Vn(n.errors,R),u.isValid&&g()),d.state.next({...n}))},gt=(R,N={})=>{const z=R?Dr(R):i,X=Dr(z),Y=kr(R),ee=Y?i:X;if(N.keepDefaultValues||(i=z),!N.keepValues){if(N.keepDirtyValues){const pe=new Set([...a.mount,...Object.keys(Uu(i,s))]);for(const he of Array.from(pe))Me(n.dirtyFields,he)?cn(ee,he,Me(s,he)):B(he,Me(ee,he))}else{if(nE&&Nn(R))for(const pe of a.mount){const he=Me(r,pe);if(he&&he._f){const Pe=Array.isArray(he._f.refs)?he._f.refs[0]:he._f.ref;if(Em(Pe)){const nt=Pe.closest("form");if(nt){nt.reset();break}}}}r={}}s=e.shouldUnregister?N.keepDefaultValues?Dr(i):{}:Dr(ee),d.array.next({values:{...ee}}),d.values.next({values:{...ee}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!N.keepIsValid||!!N.keepDirtyValues,o.watch=!!e.shouldUnregister,d.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:Y?!1:N.keepDirty?n.isDirty:!!(N.keepDefaultValues&&!Po(R,i)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Y?{}:N.keepDirtyValues?N.keepDefaultValues&&s?Uu(i,s):n.dirtyFields:N.keepDefaultValues&&R?Uu(i,R):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},D=(R,N)=>gt(ds(R)?R(s):R,N);return{control:{register:ge,unregister:ce,getFieldState:C,handleSubmit:st,setError:H,_executeSchema:O,_getWatch:$,_getDirty:I,_updateValid:g,_removeUnmounted:q,_updateFieldArray:v,_updateDisabledField:le,_getFieldArray:x,_reset:gt,_resetDefaultValues:()=>ds(e.defaultValues)&&e.defaultValues().then(R=>{D(R,e.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:R=>{n={...n,...R}},_disableForm:Ge,_subjects:d,_proxyFormState:u,_setErrors:E,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(R){o=R},get _defaultValues(){return i},get _names(){return a},set _names(R){a=R},get _formState(){return n},set _formState(R){n=R},get _options(){return e},set _options(R){e={...e,...R}}},trigger:G,register:ge,handleSubmit:st,watch:V,setValue:B,getValues:U,reset:D,resetField:He,clearErrors:Z,unregister:ce,setError:H,setFocus:(R,N={})=>{const z=Me(r,R),X=z&&z._f;if(X){const Y=X.refs?X.refs[0]:X.ref;Y.focus&&(Y.focus(),N.shouldSelect&&ds(Y.select)&&Y.select())}},getFieldState:C}}function cE(t={}){const e=Ae.useRef(void 0),n=Ae.useRef(void 0),[r,i]=Ae.useState({isDirty:!1,isValidating:!1,isLoading:ds(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:ds(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...J8(t),formState:r});const s=e.current.control;return s._options=t,sE({subject:s._subjects.state,next:o=>{p1(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),Ae.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),Ae.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),Ae.useEffect(()=>{t.values&&!Po(t.values,n.current)?(s._reset(t.values,s._options.resetOptions),n.current=t.values,i(o=>({...o}))):s._resetDefaultValues()},[t.values,s]),Ae.useEffect(()=>{t.errors&&s._setErrors(t.errors)},[t.errors,s]),Ae.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),Ae.useEffect(()=>{t.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[t.shouldUnregister,s]),e.current.formState=f1(r,s),e.current}function Tm(t){const{children:e,className:n,...r}=t;return T("label",{...r,className:St("mb-3 block font-semibold text-gray-500",n),children:e})}const rc=fa(function(t,e){const{icon:n,errorMessage:r,isDirty:i,containerClassName:s,inputClassName:o,errorMessageClassName:a,hideErrors:c=!1,...l}=t,u=t.type??"text",d=!!r;return _e("div",{children:[_e("div",{className:St("mb-1 flex gap-2 rounded-xl border border-transparent bg-gray-100 p-3 text-gray-800 placeholder:text-gray-500",d&&"border-red-900",s),children:[n&&T("span",{className:Jf((!i||d)&&"text-slate-200"),children:n}),T("input",{...l,className:St("w-full bg-transparent font-semibold outline-none",o),ref:e,type:u})]}),T("p",{className:St("hidden min-h-4 text-xs text-red-900",d&&"block",c&&"hidden",a),children:r})]})});function X8(t){return Ae.forwardRef(t)}const Q8=X8(function(t,e){const{items:n,value:r,id:i,onChange:s,containerClassName:o,menuClassName:a,itemClassName:c,absolutePositionMenu:l=!1,borderRadius:u="12px"}=t,[d,f]=Qe(!1),p=h(r)??n[0];function m(y){y.disabled||(s(y.value),f(!1))}function h(y){return n.find(v=>v.value===y)}const g=n.filter(y=>y.value!==r);return _e("div",{className:St("bg-gray-100 transition-[border-radius]",l&&"relative",o),"data-open":d,ref:e,style:{borderRadius:d?`${u} ${u} 0 0`:u},children:[_e("div",{className:St("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",a),id:i,onClick:()=>f(!d),children:[T(cT,{...p,className:c}),T(ze,{className:Jf("transition",d?"":"-rotate-90"),name:"ChevronDown"})]}),T("div",{className:St("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",d&&"max-h-screen",l&&"absolute"),style:{borderRadius:`0 0 ${u} ${u}`},children:g.map(y=>T(cT,{...y,className:c,onItemClick:()=>m(y)},y.value))})]})});function cT(t){const{className:e,disabled:n,onItemClick:r,icon:i,displayValue:s,value:o,description:a}=t;return _e("div",{className:St(n?"cursor-not-allowed text-gray-500":"text-gray-800","flex size-full cursor-pointer items-center gap-2 bg-inherit py-3 pl-3 text-start outline-none",e),onClick:r,children:[i,_e("div",{children:[T("p",{className:"capitalize text-inherit",children:s??o.toLowerCase()}),T("p",{className:"text-xs text-inherit",children:a})]})]})}function E1(t){const{control:e,...n}=t;return T(j8,{control:e,name:"sharingType",render:({field:r})=>T(Q8,{...n,...r,id:"sharingType",items:l5})})}function lE(t){const{location:e,className:n,...r}=t,i=u5[e];return _e("div",{...r,className:St("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",n),children:[i.icon,_e("div",{children:[T("p",{children:i.title}),T("p",{className:"text-xs text-slate-200",children:i.description})]})]})}const eH=fa(function(t,e){return _e("label",{className:"relative cursor-pointer items-center",htmlFor:t.id,children:[T("input",{className:"peer sr-only",ref:e,type:"checkbox",value:"",...t}),T("div",{className:"peer h-6 w-11 rounded-full bg-gray-500 after:absolute after:start-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-gray-50 after:transition-all peer-checked:bg-blue-900 peer-checked:after:translate-x-full peer-focus:outline-none"})]})}),uE=fa(function(t,e){return _e("div",{className:"flex items-center rounded-xl bg-gray-100 p-3 text-slate-200",children:[_e("div",{className:"flex-1",children:[T("label",{className:"font-semibold",htmlFor:"availableOffline",children:"Make available offline"}),_e("p",{className:"text-xs text-gray-500",children:["Check this options if you keep a local backup",T("br",{}),"available at all times."]})]}),T(eH,{id:"availableOffline",ref:e,...t})]})});function tH(t){var e;const[n,r]=Qe(!1),[i,s]=Qe(!1),{register:o,handleSubmit:a,control:c,formState:{errors:l}}=cE({defaultValues:{name:"",sharingType:Js,availableOffline:!1}});return _e("form",{onSubmit:a(t.onSubmit),children:[T(Tm,{htmlFor:"driveName",children:"Drive Name"}),T(rc,{...o("name",{required:"Drive name is required"}),errorMessage:(e=l.name)==null?void 0:e.message,icon:T(ze,{name:"Drive"}),placeholder:"Drive name"}),T(Mr,{className:"my-4"}),T(Tm,{htmlFor:"sharingType",children:"Sharing settings"}),T(E1,{control:c}),T(Mr,{className:"my-3"}),T(Bl,{isOpen:i,onOpenChange:()=>s(!i),title:"Upload from device",children:T("div",{className:"mt-3 grid h-[117px] w-full place-items-center rounded-xl bg-gray-200",children:_e("div",{className:"rounded-xl bg-white p-3 text-xs",children:[T(ze,{className:"mr-2 inline-block",name:"ArrowUp",size:20}),"Click or drop folder"]})})}),T(Mr,{className:"my-3"}),_e(Bl,{isOpen:n,onOpenChange:()=>r(!n),title:"Location",children:[T(lE,{location:im}),T(uE,{...o("availableOffline")})]}),T(Mr,{className:"my-3"}),T(Pr,{className:"mb-4 w-full",type:"submit",children:"Create new drive"})]})}function nH(t){return _e("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[T(ze,{className:"text-gray-600",name:"Drive"}),t.driveName]})}function rH(t){const{sharingType:e=to,requestPublicDrive:n}=t,[r,i]=Qe(),[s,o]=Qe(!1),[a,c]=Qe(!0),[l,u]=Qe(!1),[d,f]=Qe(""),[p,m]=Qe(""),[h,g]=Dj(p,500),{register:y,handleSubmit:v,setValue:b}=cE({mode:"onBlur",defaultValues:{availableOffline:(r==null?void 0:r.availableOffline)??!1}});jt(()=>{g(p)},[p]),jt(()=>{if(u(!1),h==="")return;w().catch(console.error);async function w(){try{const{id:S,name:_}=await n(h);i({id:S,name:_,sharingType:e,location:im,availableOffline:!0}),b("availableOffline",!0),c(!0),f("")}catch(S){i(void 0),c(!1),f(S.message)}}},[h,b,e]);function E({availableOffline:w}){r&&t.onSubmit({...r,availableOffline:w,url:h})}return _e("form",{onSubmit:v(E),children:[T(Tm,{htmlFor:"url",children:"Add existing drive"}),l?_e(Zo,{children:[T(nH,{driveName:(r==null?void 0:r.name)??"New drive"}),T(Mr,{className:"my-3"}),_e(Bl,{isOpen:s,onOpenChange:()=>o(!s),title:"Location",children:[T(lE,{location:im}),T(uE,{...y("availableOffline")})]}),T(Mr,{className:"my-3"}),T(Pr,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add drive"})]}):_e(Zo,{children:[T(rc,{errorMessage:d,icon:T(ze,{name:"BrickGlobe"}),onChange:w=>m(w.target.value),placeholder:"Drive URL",required:!0,type:"url",value:p}),T(Mr,{className:"mb-3"}),T(Pr,{className:"mt-4 w-full",color:"light",disabled:!a||p==="",onClick:w=>{w.preventDefault(),u(!0)},type:"button",children:"Confirm URL"})]})]})}const S1=fa(function(t,e){return T(rc,{...t,icon:t.icon??T(ze,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:e})});function iH(t){const{uiDriveNode:e,handleDeleteDrive:n,onCancel:r}=t,[i,s]=Qe(""),o=i===e.name;function a(){o&&n()}return _e("div",{children:[T("p",{className:"mb-2 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"}),T(S1,{icon:T(ze,{name:"Lock"}),onChange:c=>s(c.target.value),placeholder:"Enter drive name...",value:i}),_e("div",{className:"flex gap-3",children:[T(Pr,{className:"w-full",color:"light",onClick:r,children:"Cancel"}),T(Pr,{className:"w-full",color:"red",disabled:!o,onClick:a,children:"Delete"})]})]})}function sH(t){const{uiDriveNode:e,onSubmit:n}=t,{name:r,sharingType:i,availableOffline:s}=e,[o,a]=Qe(!1),[c,l]=Qe(!1),[u,d]=Qe(!1),{register:f,handleSubmit:p,control:m}=cE({mode:"onBlur",defaultValues:{name:r,sharingType:i,availableOffline:s}}),h=i===to?im:i;return _e("form",{onSubmit:p(n),children:[T(S1,{...f("name")}),T(Mr,{className:"my-4"}),T(Tm,{htmlFor:"sharingType",children:"Sharing settings"}),T(E1,{control:m}),T(Mr,{className:"my-3"}),_e(Bl,{isOpen:o,onOpenChange:()=>a(!o),title:"Location",children:[T(lE,{location:h}),T(uE,{...f("availableOffline")})]}),T(Mr,{className:"my-3"}),T(Bl,{isOpen:c,onOpenChange:()=>l(!c),title:"Danger zone",children:_e("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>d(!0),type:"button",children:[T(ze,{name:"Trash"}),"Delete drive"]})}),u&&c?T(iH,{...t,onCancel:()=>d(!1)}):_e(Zo,{children:[T(Mr,{className:"my-3"}),T(Pr,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}var dE="Dialog",[x1,Ihe]=ma(dE),[oH,Zi]=x1(dE),T1=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=k.useRef(null),c=k.useRef(null),[l=!1,u]=ep({prop:r,defaultProp:i,onChange:s});return T(oH,{scope:e,triggerRef:a,contentRef:c,contentId:Fr(),titleId:Fr(),descriptionId:Fr(),open:l,onOpenChange:u,onOpenToggle:k.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};T1.displayName=dE;var I1="DialogTrigger",aH=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Zi(I1,n),s=Ln(e,i.triggerRef);return T(Zt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":hE(i.open),...r,ref:s,onClick:dt(t.onClick,i.onOpenToggle)})});aH.displayName=I1;var fE="DialogPortal",[cH,O1]=x1(fE,{forceMount:void 0}),C1=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=Zi(fE,e);return T(cH,{scope:e,forceMount:n,children:k.Children.map(r,o=>T(bi,{present:n||s.open,children:T(np,{asChild:!0,container:i,children:o})}))})};C1.displayName=fE;var Im="DialogOverlay",R1=k.forwardRef((t,e)=>{const n=O1(Im,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Zi(Im,t.__scopeDialog);return s.modal?T(bi,{present:r||s.open,children:T(lH,{...i,ref:e})}):null});R1.displayName=Im;var lH=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Zi(Im,n);return T(Yg,{as:Xo,allowPinchZoom:!0,shards:[i.contentRef],children:T(Zt.div,{"data-state":hE(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),ic="DialogContent",D1=k.forwardRef((t,e)=>{const n=O1(ic,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Zi(ic,t.__scopeDialog);return T(bi,{present:r||s.open,children:s.modal?T(uH,{...i,ref:e}):T(dH,{...i,ref:e})})});D1.displayName=ic;var uH=k.forwardRef((t,e)=>{const n=Zi(ic,t.__scopeDialog),r=k.useRef(null),i=Ln(e,n.contentRef,r);return k.useEffect(()=>{const s=r.current;if(s)return Uw(s)},[]),T(k1,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:dt(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:dt(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:dt(t.onFocusOutside,s=>s.preventDefault())})}),dH=k.forwardRef((t,e)=>{const n=Zi(ic,t.__scopeDialog),r=k.useRef(!1),i=k.useRef(!1);return T(k1,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,l;(c=t.onInteractOutside)==null||c.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),k1=k.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Zi(ic,n),c=k.useRef(null),l=Ln(e,c);return Pw(),_e(Zo,{children:[T(Wg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:T(tp,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":hE(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),_e(Zo,{children:[T(pH,{titleId:a.titleId}),T(mH,{contentRef:c,descriptionId:a.descriptionId})]})]})}),pE="DialogTitle",A1=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Zi(pE,n);return T(Zt.h2,{id:i.titleId,...r,ref:e})});A1.displayName=pE;var N1="DialogDescription",P1=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Zi(N1,n);return T(Zt.p,{id:i.descriptionId,...r,ref:e})});P1.displayName=N1;var M1="DialogClose",fH=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Zi(M1,n);return T(Zt.button,{type:"button",...r,ref:e,onClick:dt(t.onClick,()=>i.onOpenChange(!1))})});fH.displayName=M1;function hE(t){return t?"open":"closed"}var L1="DialogTitleWarning",[Ohe,F1]=p5(L1,{contentName:ic,titleName:pE,docsSlug:"dialog"}),pH=({titleId:t})=>{const e=F1(L1),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
67
+
68
+ If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
69
+
70
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return k.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},hH="DialogDescriptionWarning",mH=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F1(hH).contentName}}.`;return k.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},$1=T1,j1=C1,U1=R1,B1=D1,gH=A1,yH=P1,vH="VisuallyHidden",z1=k.forwardRef((t,e)=>T(Zt.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));z1.displayName=vH;var V1=z1;function ho(t){const{title:e,open:n,onOpenChange:r,contentProps:i,overlayProps:s,children:o,...a}=t;return T($1,{defaultOpen:n,onOpenChange:r,open:n,children:T(j1,{children:T(U1,{...s,className:St("fixed inset-0 grid place-items-center overflow-y-auto bg-slate-900/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",s==null?void 0:s.className),children:_e(B1,{...a,...i,className:St("bg-white data-[state=closed]:animate-zoom-out data-[state=open]:animate-zoom-in",i==null?void 0:i.className),children:[_e(V1,{children:[T(gH,{children:e||"Modal"}),T(yH,{children:e||"Modal"})]}),o]})})})})}function bH(t){const{open:e,onOpenChange:n,onSubmit:r,modalProps:i,containerProps:s}=t;function o(){n(!1)}return T(ho,{...i,contentProps:{className:"rounded-2xl"},onOpenChange:n,open:e,children:_e("div",{...s,className:St("max-w-[408px] rounded-2xl p-6",s==null?void 0:s.className),children:[_e("div",{className:"flex justify-between",children:[T("h1",{className:"text-xl font-bold",children:"Create new drive "}),T("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:o,tabIndex:-1,children:T(ze,{name:"XmarkLight",size:24})})]}),T(Mr,{className:"my-4"}),T(tH,{onCancel:o,onSubmit:r})]})})}function _H(t){const{open:e,onOpenChange:n,onSubmit:r,sharingType:i,modalProps:s,containerProps:o,requestPublicDrive:a}=t;function c(){n(!1)}return T(ho,{...s,contentProps:{className:"rounded-2xl"},onOpenChange:n,open:e,children:_e("div",{...o,className:St("min-w-[408px] max-w-[408px] rounded-2xl p-6",o==null?void 0:o.className),children:[_e("div",{className:"flex justify-between",children:[T("h1",{className:"text-xl font-bold",children:"Add drive"}),T("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:c,tabIndex:-1,children:T(ze,{name:"XmarkLight",size:24})})]}),T(Mr,{className:"my-4"}),T(rH,{onCancel:c,onSubmit:r,requestPublicDrive:a,sharingType:i})]})})}const lT="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function mE(t){const{body:e,header:n,children:r,onCancel:i,onOpenChange:s,onContinue:o,cancelLabel:a,continueLabel:c,overlayProps:l,contentProps:u,bodyProps:d={},headerProps:f={},containerProps:p={},cancelButtonProps:m={},continueButtonProps:h={},buttonContainerProps:g={},...y}=t;return T(ho,{contentProps:{...u,className:St("rounded-3xl",u==null?void 0:u.className)},onOpenChange:s,overlayProps:{...l,className:l==null?void 0:l.className},...y,children:_e("div",{...fi(p,"w-[400px] p-6 text-slate-300"),children:[T("div",{...fi(f,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),_e("div",{...fi(d,"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200"),children:[e,r]}),_e("div",{...fi(g,"mt-8 flex justify-between gap-3"),children:[T("button",{onClick:i,...fi(m,St(lT,"flex-1 bg-slate-50 text-slate-800")),children:a}),T("button",{onClick:o,...fi(h,St(lT,"flex-1 bg-gray-800 text-gray-50")),children:c})]})]})})}const uT="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all",dT=300;function wH(t){const{onOpenChange:e,onContinue:n,overlayProps:r,contentProps:i,...s}=t,[o,a]=Qe(""),c=()=>{e==null||e(!1),setTimeout(()=>a(""),dT)},l=()=>{n(o),setTimeout(()=>a(""),dT)};return T(ho,{contentProps:{...i,className:St("rounded-3xl",i==null?void 0:i.className)},onOpenChange:e,overlayProps:{...r,className:r==null?void 0:r.className},...s,children:_e("div",{className:"w-[400px] p-6 text-slate-300",children:[T("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),T("div",{className:"my-6",children:T(rc,{icon:T(ze,{name:"BrickGlobe"}),onChange:u=>a(u.target.value),placeholder:"Document name",required:!0,value:o})}),_e("div",{className:"mt-8 flex justify-between gap-3",children:[T("button",{className:St(uT,"flex-1 bg-slate-50 text-slate-800"),onClick:c,children:"Cancel"}),T(Pr,{className:St(uT,"flex-1 bg-gray-800 text-gray-50"),onClick:l,children:"Create"})]})]})})}const EH=t=>{const{inputPlaceholder:e,body:n,driveName:r,...i}=t,[s,o]=Qe("");return T(mE,{bodyProps:{className:"p-0 bg-white my-0"},containerProps:{className:"w-[450px]"},continueButtonProps:{disabled:s!==r,className:s!==r?"bg-red-600 hover:scale-100 cursor-not-allowed active:opacity-100":"bg-red-900"},...i,children:_e("div",{children:[T("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:n}),T("div",{children:T(rc,{hideErrors:!0,icon:T(ze,{name:"Lock"}),onChange:a=>o(a.target.value),placeholder:e,value:s})})]})})};function SH(t){const{onDelete:e,deleteLabel:n,...r}=t;return T(mE,{...r,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:n,onContinue:e})}function xH(t){const{uiDriveNode:e,open:n,onOpenChange:r,onDeleteDrive:i,onRenameDrive:s,onChangeSharingType:o,onChangeAvailableOffline:a,modalProps:c,containerProps:l}=t,u=p=>{p.name!==e.name&&s(e,p.name),p.sharingType!==e.sharingType&&o(e,p.sharingType),p.availableOffline!==e.availableOffline&&a(e,p.availableOffline),r(!1)};function d(){i(e),r(!1)}function f(){r(!1)}return T(ho,{...c,contentProps:{className:"rounded-2xl"},onOpenChange:r,open:n,children:_e("div",{...l,className:St("max-w-[408px] rounded-2xl p-6",l==null?void 0:l.className),children:[_e("div",{className:"flex justify-between",children:[T("h1",{className:"text-xl font-bold",children:"Drive settings"}),T("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:f,tabIndex:-1,children:T(ze,{name:"XmarkLight",size:24})})]}),T(Mr,{className:"my-4"}),T(sH,{handleCancel:f,handleDeleteDrive:d,onSubmit:u,uiDriveNode:e})]})})}const TH="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function H1(t){const{body:e,header:n,children:r,onOpenChange:i,onContinue:s,closeLabel:o,overlayProps:a,contentProps:c,bodyProps:l={},headerProps:u={},containerProps:d={},continueButtonProps:f={},buttonContainerProps:p={},...m}=t,[h,g]=Qe(!0),y=hn(null);return jt(()=>{const v=()=>{const E=y.current;E&&(E.scrollHeight>E.clientHeight?(g(!0),E.addEventListener("scroll",b)):g(!1))},b=()=>{const E=y.current;E&&E.scrollHeight-Math.ceil(E.scrollTop)===E.clientHeight&&g(!1)};return requestAnimationFrame(v),()=>{const E=y.current;E&&E.removeEventListener("scroll",b)}},[]),T(ho,{contentProps:{...c,className:St("rounded-3xl outline-none",c==null?void 0:c.className)},onOpenChange:i,overlayProps:{...a,className:a==null?void 0:a.className},...m,children:_e("div",{...fi(d,"w-[500px] p-6 text-slate-300"),children:[T("div",{...fi(u,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),_e("div",{ref:y,...fi(l,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center text-slate-200"),children:[e,r]}),T("div",{...fi(p,"mt-8 flex justify-between gap-3"),children:T("button",{disabled:h,onClick:s,...fi(f,St(TH,"flex-1 bg-gray-800 text-gray-50",h&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:o})})]})})}var Vt;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Vt||(Vt={}));var $b;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($b||($b={}));const je=Vt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vs=t=>{switch(typeof t){case"undefined":return je.undefined;case"string":return je.string;case"number":return isNaN(t)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(t)?je.array:t===null?je.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?je.promise:typeof Map<"u"&&t instanceof Map?je.map:typeof Set<"u"&&t instanceof Set?je.set:typeof Date<"u"&&t instanceof Date?je.date:je.object;default:return je.unknown}},Ie=Vt.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"]),IH=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class $r 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(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}static assert(e){if(!(e instanceof $r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Vt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}$r.create=t=>new $r(t);const Wl=(t,e)=>{let n;switch(t.code){case Ie.invalid_type:t.received===je.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Vt.jsonStringifyReplacer)}`;break;case Ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${Vt.joinValues(t.keys,", ")}`;break;case Ie.invalid_union:n="Invalid input";break;case Ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Vt.joinValues(t.options)}`;break;case Ie.invalid_enum_value:n=`Invalid enum value. Expected ${Vt.joinValues(t.options)}, received '${t.received}'`;break;case Ie.invalid_arguments:n="Invalid function arguments";break;case Ie.invalid_return_type:n="Invalid function return type";break;case Ie.invalid_date:n="Invalid date";break;case Ie.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}"`:Vt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Ie.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==="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 Ie.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 Ie.custom:n="Invalid input";break;case Ie.invalid_intersection_types:n="Intersection results could not be merged";break;case Ie.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Ie.not_finite:n="Number must be finite";break;default:n=e.defaultError,Vt.assertNever(t)}return{message:n}};let W1=Wl;function OH(t){W1=t}function Om(){return W1}const Cm=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},CH=[];function Le(t,e){const n=Om(),r=Cm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Wl?void 0:Wl].filter(i=>!!i)});t.common.issues.push(r)}class fr{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 mt;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 s=await i.key,o=await i.value;r.push({key:s,value:o})}return fr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return mt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const mt=Object.freeze({status:"aborted"}),ll=t=>({status:"dirty",value:t}),Ir=t=>({status:"valid",value:t}),jb=t=>t.status==="aborted",Ub=t=>t.status==="dirty",sc=t=>t.status==="valid",Qd=t=>typeof Promise<"u"&&t instanceof Promise;function Rm(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function q1(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Je;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Je||(Je={}));var td,nd;class Ts{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||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const fT=(t,e)=>{if(sc(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 $r(t.common.issues);return this._error=n,this._error}}};function wt(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:(o,a)=>{var c,l;const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(c=u??r)!==null&&c!==void 0?c:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(l=u??n)!==null&&l!==void 0?l:a.defaultError}},description:i}}class Ot{get description(){return this._def.description}_getType(e){return Vs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Vs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new fr,ctx:{common:e.parent.common,data:e.data,parsedType:Vs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Qd(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){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)},s=this._parseSync({data:e,path:i.path,parent:i});return fT(i,s)}"~validate"(e){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:i});return sc(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>sc(s)?{value:s.value}:{issues:i.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==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(Qd(i)?i:Promise.resolve(i));return fT(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Ie.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!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 Wi({schema:this,typeName:pt.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 bs.create(this,this._def)}nullable(){return na.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fi.create(this)}promise(){return Gl.create(this,this._def)}or(e){return rf.create([this,e],this._def)}and(e){return sf.create(this,e,this._def)}transform(e){return new Wi({...wt(this._def),schema:this,typeName:pt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new uf({...wt(this._def),innerType:this,defaultValue:n,typeName:pt.ZodDefault})}brand(){return new gE({typeName:pt.ZodBranded,type:this,...wt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new df({...wt(this._def),innerType:this,catchValue:n,typeName:pt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return op.create(this,e)}readonly(){return ff.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const RH=/^c[^\s-]{8,}$/i,DH=/^[0-9a-z]+$/,kH=/^[0-9A-HJKMNP-TV-Z]{26}$/i,AH=/^[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,NH=/^[a-z0-9_-]{21}$/i,PH=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,MH=/^[-+]?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)?)??$/,LH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Tv;const $H=/^(?:(?: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])$/,jH=/^(?:(?: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])$/,UH=/^(([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]))$/,BH=/^(([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])$/,zH=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VH=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G1="((\\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])))",HH=new RegExp(`^${G1}$`);function Z1(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function WH(t){return new RegExp(`^${Z1(t)}$`)}function Y1(t){let e=`${G1}T${Z1(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 qH(t,e){return!!((e==="v4"||!e)&&$H.test(t)||(e==="v6"||!e)&&UH.test(t))}function GH(t,e){if(!PH.test(t))return!1;try{const[n]=t.split("."),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||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function ZH(t,e){return!!((e==="v4"||!e)&&jH.test(t)||(e==="v6"||!e)&&BH.test(t))}class Mi extends Ot{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==je.string){const s=this._getOrReturnCtx(e);return Le(s,{code:Ie.invalid_type,expected:je.string,received:s.parsedType}),mt}const r=new fr;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?Le(i,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Le(i,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")LH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"email",code:Ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Tv||(Tv=new RegExp(FH,"u")),Tv.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"emoji",code:Ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")AH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"uuid",code:Ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")NH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"nanoid",code:Ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")RH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"cuid",code:Ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")DH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"cuid2",code:Ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")kH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"ulid",code:Ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Le(i,{validation:"url",code:Ie.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"regex",code:Ie.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Y1(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?HH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?WH(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?MH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"duration",code:Ie.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?qH(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"ip",code:Ie.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?GH(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"jwt",code:Ie.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?ZH(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"cidr",code:Ie.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?zH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"base64",code:Ie.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?VH.test(e.data)||(i=this._getOrReturnCtx(e,i),Le(i,{validation:"base64url",code:Ie.invalid_string,message:s.message}),r.dirty()):Vt.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Ie.invalid_string,...Je.errToObj(r)})}_addCheck(e){return new Mi({...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){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Je.errToObj(e==null?void 0: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==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Je.errToObj(e==null?void 0: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==null?void 0:n.position,...Je.errToObj(n==null?void 0: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 Mi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Mi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Mi({...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}}Mi.create=t=>{var e;return new Mi({checks:[],typeName:pt.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...wt(t)})};function YH(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Qo extends Ot{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)!==je.number){const s=this._getOrReturnCtx(e);return Le(s,{code:Ie.invalid_type,expected:je.number,received:s.parsedType}),mt}let r;const i=new fr;for(const s of this._def.checks)s.kind==="int"?Vt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?YH(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.not_finite,message:s.message}),i.dirty()):Vt.assertNever(s);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 Qo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new Qo({...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"&&Vt.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)}}Qo.create=t=>new Qo({checks:[],typeName:pt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...wt(t)});class ea extends Ot{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)!==je.bigint)return this._getInvalidInput(e);let r;const i=new fr;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Le(r,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Vt.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Le(n,{code:Ie.invalid_type,expected:je.bigint,received:n.parsedType}),mt}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 ea({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new ea({...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}}ea.create=t=>{var e;return new ea({checks:[],typeName:pt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...wt(t)})};class ef extends Ot{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==je.boolean){const r=this._getOrReturnCtx(e);return Le(r,{code:Ie.invalid_type,expected:je.boolean,received:r.parsedType}),mt}return Ir(e.data)}}ef.create=t=>new ef({typeName:pt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...wt(t)});class oc extends Ot{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==je.date){const s=this._getOrReturnCtx(e);return Le(s,{code:Ie.invalid_type,expected:je.date,received:s.parsedType}),mt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Le(s,{code:Ie.invalid_date}),mt}const r=new fr;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Le(i,{code:Ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Vt.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new oc({...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}}oc.create=t=>new oc({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:pt.ZodDate,...wt(t)});class Dm extends Ot{_parse(e){if(this._getType(e)!==je.symbol){const r=this._getOrReturnCtx(e);return Le(r,{code:Ie.invalid_type,expected:je.symbol,received:r.parsedType}),mt}return Ir(e.data)}}Dm.create=t=>new Dm({typeName:pt.ZodSymbol,...wt(t)});class tf extends Ot{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Le(r,{code:Ie.invalid_type,expected:je.undefined,received:r.parsedType}),mt}return Ir(e.data)}}tf.create=t=>new tf({typeName:pt.ZodUndefined,...wt(t)});class nf extends Ot{_parse(e){if(this._getType(e)!==je.null){const r=this._getOrReturnCtx(e);return Le(r,{code:Ie.invalid_type,expected:je.null,received:r.parsedType}),mt}return Ir(e.data)}}nf.create=t=>new nf({typeName:pt.ZodNull,...wt(t)});class ql extends Ot{constructor(){super(...arguments),this._any=!0}_parse(e){return Ir(e.data)}}ql.create=t=>new ql({typeName:pt.ZodAny,...wt(t)});class Za extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ir(e.data)}}Za.create=t=>new Za({typeName:pt.ZodUnknown,...wt(t)});class io extends Ot{_parse(e){const n=this._getOrReturnCtx(e);return Le(n,{code:Ie.invalid_type,expected:je.never,received:n.parsedType}),mt}}io.create=t=>new io({typeName:pt.ZodNever,...wt(t)});class km extends Ot{_parse(e){if(this._getType(e)!==je.undefined){const r=this._getOrReturnCtx(e);return Le(r,{code:Ie.invalid_type,expected:je.void,received:r.parsedType}),mt}return Ir(e.data)}}km.create=t=>new km({typeName:pt.ZodVoid,...wt(t)});class Fi extends Ot{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==je.array)return Le(n,{code:Ie.invalid_type,expected:je.array,received:n.parsedType}),mt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Le(n,{code:o?Ie.too_big:Ie.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?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&&(Le(n,{code:Ie.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&&(Le(n,{code:Ie.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((o,a)=>i.type._parseAsync(new Ts(n,o,n.path,a)))).then(o=>fr.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new Ts(n,o,n.path,a)));return fr.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Fi({...this._def,minLength:{value:e,message:Je.toString(n)}})}max(e,n){return new Fi({...this._def,maxLength:{value:e,message:Je.toString(n)}})}length(e,n){return new Fi({...this._def,exactLength:{value:e,message:Je.toString(n)}})}nonempty(e){return this.min(1,e)}}Fi.create=(t,e)=>new Fi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:pt.ZodArray,...wt(e)});function el(t){if(t instanceof Sn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=bs.create(el(r))}return new Sn({...t._def,shape:()=>e})}else return t instanceof Fi?new Fi({...t._def,type:el(t.element)}):t instanceof bs?bs.create(el(t.unwrap())):t instanceof na?na.create(el(t.unwrap())):t instanceof Is?Is.create(t.items.map(e=>el(e))):t}class Sn extends Ot{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=Vt.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==je.object){const l=this._getOrReturnCtx(e);return Le(l,{code:Ie.invalid_type,expected:je.object,received:l.parsedType}),mt}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof io&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||a.push(l);const c=[];for(const l of o){const u=s[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ts(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof io){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(Le(i,{code:Ie.unrecognized_keys,keys:a}),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 a){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ts(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=>fr.mergeObjectSync(r,l)):fr.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)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Je.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}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:pt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Sn({...this._def,catchall:e})}pick(e){const n={};return Vt.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Sn({...this._def,shape:()=>n})}omit(e){const n={};return Vt.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Sn({...this._def,shape:()=>n})}deepPartial(){return el(this)}partial(e){const n={};return Vt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new Sn({...this._def,shape:()=>n})}required(e){const n={};return Vt.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof bs;)s=s._def.innerType;n[r]=s}}),new Sn({...this._def,shape:()=>n})}keyof(){return K1(Vt.objectKeys(this.shape))}}Sn.create=(t,e)=>new Sn({shape:()=>t,unknownKeys:"strip",catchall:io.create(),typeName:pt.ZodObject,...wt(e)});Sn.strictCreate=(t,e)=>new Sn({shape:()=>t,unknownKeys:"strict",catchall:io.create(),typeName:pt.ZodObject,...wt(e)});Sn.lazycreate=(t,e)=>new Sn({shape:t,unknownKeys:"strip",catchall:io.create(),typeName:pt.ZodObject,...wt(e)});class rf extends Ot{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new $r(a.ctx.common.issues));return Le(n,{code:Ie.invalid_union,unionErrors:o}),mt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];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"&&!s&&(s={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new $r(c));return Le(n,{code:Ie.invalid_union,unionErrors:a}),mt}}get options(){return this._def.options}}rf.create=(t,e)=>new rf({options:t,typeName:pt.ZodUnion,...wt(e)});const Us=t=>t instanceof af?Us(t.schema):t instanceof Wi?Us(t.innerType()):t instanceof cf?[t.value]:t instanceof ta?t.options:t instanceof lf?Vt.objectValues(t.enum):t instanceof uf?Us(t._def.innerType):t instanceof tf?[void 0]:t instanceof nf?[null]:t instanceof bs?[void 0,...Us(t.unwrap())]:t instanceof na?[null,...Us(t.unwrap())]:t instanceof gE||t instanceof ff?Us(t.unwrap()):t instanceof df?Us(t._def.innerType):[];class ny extends Ot{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.object)return Le(n,{code:Ie.invalid_type,expected:je.object,received:n.parsedType}),mt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Le(n,{code:Ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),mt)}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 s of n){const o=Us(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new ny({typeName:pt.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...wt(r)})}}function Bb(t,e){const n=Vs(t),r=Vs(e);if(t===e)return{valid:!0,data:t};if(n===je.object&&r===je.object){const i=Vt.objectKeys(e),s=Vt.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=Bb(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===je.array&&r===je.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=Bb(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===je.date&&r===je.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class sf extends Ot{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(jb(s)||jb(o))return mt;const a=Bb(s.value,o.value);return a.valid?((Ub(s)||Ub(o))&&n.dirty(),{status:n.value,value:a.data}):(Le(r,{code:Ie.invalid_intersection_types}),mt)};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(([s,o])=>i(s,o)):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}))}}sf.create=(t,e,n)=>new sf({left:t,right:e,typeName:pt.ZodIntersection,...wt(n)});class Is extends Ot{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.array)return Le(r,{code:Ie.invalid_type,expected:je.array,received:r.parsedType}),mt;if(r.data.length<this._def.items.length)return Le(r,{code:Ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),mt;!this._def.rest&&r.data.length>this._def.items.length&&(Le(r,{code:Ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Ts(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>fr.mergeArray(n,o)):fr.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Is({...this._def,rest:e})}}Is.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Is({items:t,typeName:pt.ZodTuple,rest:null,...wt(e)})};class of extends Ot{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!==je.object)return Le(r,{code:Ie.invalid_type,expected:je.object,received:r.parsedType}),mt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new Ts(r,a,r.path,a)),value:o._parse(new Ts(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?fr.mergeObjectAsync(n,i):fr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ot?new of({keyType:e,valueType:n,typeName:pt.ZodRecord,...wt(r)}):new of({keyType:Mi.create(),valueType:e,typeName:pt.ZodRecord,...wt(n)})}}class Am extends Ot{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!==je.map)return Le(r,{code:Ie.invalid_type,expected:je.map,received:r.parsedType}),mt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new Ts(r,a,r.path,[l,"key"])),value:s._parse(new Ts(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return mt;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return mt;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}Am.create=(t,e,n)=>new Am({valueType:e,keyType:t,typeName:pt.ZodMap,...wt(n)});class ac extends Ot{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==je.set)return Le(r,{code:Ie.invalid_type,expected:je.set,received:r.parsedType}),mt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Le(r,{code:Ie.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&&(Le(r,{code:Ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return mt;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>s._parse(new Ts(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new ac({...this._def,minSize:{value:e,message:Je.toString(n)}})}max(e,n){return new ac({...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)}}ac.create=(t,e)=>new ac({valueType:t,minSize:null,maxSize:null,typeName:pt.ZodSet,...wt(e)});class bl extends Ot{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.function)return Le(n,{code:Ie.invalid_type,expected:je.function,received:n.parsedType}),mt;function r(a,c){return Cm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Om(),Wl].filter(l=>!!l),issueData:{code:Ie.invalid_arguments,argumentsError:c}})}function i(a,c){return Cm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Om(),Wl].filter(l=>!!l),issueData:{code:Ie.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Gl){const a=this;return Ir(async function(...c){const l=new $r([]),u=await a._def.args.parseAsync(c,s).catch(p=>{throw l.addIssue(r(c,p)),l}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(p=>{throw l.addIssue(i(d,p)),l})})}else{const a=this;return Ir(function(...c){const l=a._def.args.safeParse(c,s);if(!l.success)throw new $r([r(c,l.error)]);const u=Reflect.apply(o,this,l.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new $r([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new bl({...this._def,args:Is.create(e).rest(Za.create())})}returns(e){return new bl({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new bl({args:e||Is.create([]).rest(Za.create()),returns:n||Za.create(),typeName:pt.ZodFunction,...wt(r)})}}class af extends Ot{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})}}af.create=(t,e)=>new af({getter:t,typeName:pt.ZodLazy,...wt(e)});class cf extends Ot{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Le(n,{received:n.data,code:Ie.invalid_literal,expected:this._def.value}),mt}return{status:"valid",value:e.data}}get value(){return this._def.value}}cf.create=(t,e)=>new cf({value:t,typeName:pt.ZodLiteral,...wt(e)});function K1(t,e){return new ta({values:t,typeName:pt.ZodEnum,...wt(e)})}class ta extends Ot{constructor(){super(...arguments),td.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Le(n,{expected:Vt.joinValues(r),received:n.parsedType,code:Ie.invalid_type}),mt}if(Rm(this,td)||q1(this,td,new Set(this._def.values)),!Rm(this,td).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Le(n,{received:n.data,code:Ie.invalid_enum_value,options:r}),mt}return Ir(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 ta.create(e,{...this._def,...n})}exclude(e,n=this._def){return ta.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}td=new WeakMap;ta.create=K1;class lf extends Ot{constructor(){super(...arguments),nd.set(this,void 0)}_parse(e){const n=Vt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==je.string&&r.parsedType!==je.number){const i=Vt.objectValues(n);return Le(r,{expected:Vt.joinValues(i),received:r.parsedType,code:Ie.invalid_type}),mt}if(Rm(this,nd)||q1(this,nd,new Set(Vt.getValidEnumValues(this._def.values))),!Rm(this,nd).has(e.data)){const i=Vt.objectValues(n);return Le(r,{received:r.data,code:Ie.invalid_enum_value,options:i}),mt}return Ir(e.data)}get enum(){return this._def.values}}nd=new WeakMap;lf.create=(t,e)=>new lf({values:t,typeName:pt.ZodNativeEnum,...wt(e)});class Gl extends Ot{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==je.promise&&n.common.async===!1)return Le(n,{code:Ie.invalid_type,expected:je.promise,received:n.parsedType}),mt;const r=n.parsedType===je.promise?n.data:Promise.resolve(n.data);return Ir(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Gl.create=(t,e)=>new Gl({type:t,typeName:pt.ZodPromise,...wt(e)});class Wi extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Le(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return mt;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?mt:c.status==="dirty"||n.value==="dirty"?ll(c.value):c});{if(n.value==="aborted")return mt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?mt:a.status==="dirty"||n.value==="dirty"?ll(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?mt:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?mt:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!sc(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>sc(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);Vt.assertNever(i)}}Wi.create=(t,e,n)=>new Wi({schema:t,typeName:pt.ZodEffects,effect:e,...wt(n)});Wi.createWithPreprocess=(t,e,n)=>new Wi({schema:e,effect:{type:"preprocess",transform:t},typeName:pt.ZodEffects,...wt(n)});class bs extends Ot{_parse(e){return this._getType(e)===je.undefined?Ir(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}bs.create=(t,e)=>new bs({innerType:t,typeName:pt.ZodOptional,...wt(e)});class na extends Ot{_parse(e){return this._getType(e)===je.null?Ir(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}na.create=(t,e)=>new na({innerType:t,typeName:pt.ZodNullable,...wt(e)});class uf extends Ot{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===je.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}uf.create=(t,e)=>new uf({innerType:t,typeName:pt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...wt(e)});class df extends Ot{_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 Qd(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new $r(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $r(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}df.create=(t,e)=>new df({innerType:t,typeName:pt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...wt(e)});class Nm extends Ot{_parse(e){if(this._getType(e)!==je.nan){const r=this._getOrReturnCtx(e);return Le(r,{code:Ie.invalid_type,expected:je.nan,received:r.parsedType}),mt}return{status:"valid",value:e.data}}}Nm.create=t=>new Nm({typeName:pt.ZodNaN,...wt(t)});const KH=Symbol("zod_brand");class gE extends Ot{_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 op extends Ot{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?mt:s.status==="dirty"?(n.dirty(),ll(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?mt: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 op({in:e,out:n,typeName:pt.ZodPipeline})}}class ff extends Ot{_parse(e){const n=this._def.innerType._parse(e),r=i=>(sc(i)&&(i.value=Object.freeze(i.value)),i);return Qd(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}ff.create=(t,e)=>new ff({innerType:t,typeName:pt.ZodReadonly,...wt(e)});function J1(t,e={},n){return t?ql.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):ql.create()}const JH={object:Sn.lazycreate};var pt;(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"})(pt||(pt={}));const XH=(t,e={message:`Input not instance of ${t.name}`})=>J1(n=>n instanceof t,e),ka=Mi.create,X1=Qo.create,QH=Nm.create,eW=ea.create,Q1=ef.create,tW=oc.create,nW=Dm.create,rW=tf.create,iW=nf.create,sW=ql.create,oW=Za.create,aW=io.create,cW=km.create,lW=Fi.create,ek=Sn.create,uW=Sn.strictCreate,dW=rf.create,fW=ny.create,pW=sf.create,hW=Is.create,zb=of.create,mW=Am.create,gW=ac.create,yW=bl.create,vW=af.create,bW=cf.create,_W=ta.create,wW=lf.create,EW=Gl.create,pT=Wi.create,SW=bs.create,xW=na.create,TW=Wi.createWithPreprocess,IW=op.create,OW=()=>ka().optional(),CW=()=>X1().optional(),RW=()=>Q1().optional(),DW={string:t=>Mi.create({...t,coerce:!0}),number:t=>Qo.create({...t,coerce:!0}),boolean:t=>ef.create({...t,coerce:!0}),bigint:t=>ea.create({...t,coerce:!0}),date:t=>oc.create({...t,coerce:!0})},kW=mt;var ae=Object.freeze({__proto__:null,defaultErrorMap:Wl,setErrorMap:OH,getErrorMap:Om,makeIssue:Cm,EMPTY_PATH:CH,addIssueToContext:Le,ParseStatus:fr,INVALID:mt,DIRTY:ll,OK:Ir,isAborted:jb,isDirty:Ub,isValid:sc,isAsync:Qd,get util(){return Vt},get objectUtil(){return $b},ZodParsedType:je,getParsedType:Vs,ZodType:Ot,datetimeRegex:Y1,ZodString:Mi,ZodNumber:Qo,ZodBigInt:ea,ZodBoolean:ef,ZodDate:oc,ZodSymbol:Dm,ZodUndefined:tf,ZodNull:nf,ZodAny:ql,ZodUnknown:Za,ZodNever:io,ZodVoid:km,ZodArray:Fi,ZodObject:Sn,ZodUnion:rf,ZodDiscriminatedUnion:ny,ZodIntersection:sf,ZodTuple:Is,ZodRecord:of,ZodMap:Am,ZodSet:ac,ZodFunction:bl,ZodLazy:af,ZodLiteral:cf,ZodEnum:ta,ZodNativeEnum:lf,ZodPromise:Gl,ZodEffects:Wi,ZodTransformer:Wi,ZodOptional:bs,ZodNullable:na,ZodDefault:uf,ZodCatch:df,ZodNaN:Nm,BRAND:KH,ZodBranded:gE,ZodPipeline:op,ZodReadonly:ff,custom:J1,Schema:Ot,ZodSchema:Ot,late:JH,get ZodFirstPartyTypeKind(){return pt},coerce:DW,any:sW,array:lW,bigint:eW,boolean:Q1,date:tW,discriminatedUnion:fW,effect:pT,enum:_W,function:yW,instanceof:XH,intersection:pW,lazy:vW,literal:bW,map:mW,nan:QH,nativeEnum:wW,never:aW,null:iW,nullable:xW,number:X1,object:ek,oboolean:RW,onumber:CW,optional:SW,ostring:OW,pipeline:IW,preprocess:TW,promise:EW,record:zb,set:gW,strictObject:uW,string:ka,symbol:nW,transformer:pT,tuple:hW,undefined:rW,union:dW,unknown:oW,void:cW,NEVER:kW,ZodIssueCode:Ie,quotelessJson:IH,ZodError:$r});const Vb=["@powerhousedao/design-system","document-drive","document-model","document-model-libs"],AW=ek({version:ka({message:"Missing version field in package.json"}),dependencies:zb(ka(),ka()).nullable(),devDependencies:zb(ka(),ka()).nullable()}).refine(t=>t.dependencies!=null||t.devDependencies!=null,"package.json must have either dependencies or devDependencies").transform(t=>{const e={...t.dependencies,...t.devDependencies},n=Vb.filter(r=>!e[r]||typeof e[r]!="string");return n.length>0?(console.error("Missing or invalid dependencies:",n,"Available dependencies:",Object.keys(e)),!1):{version:t.version,dependencies:Object.fromEntries(Vb.map(r=>[r,e[r]]))}});function NW(t){const e=AW.safeParse(t);return e.success?e.data:(console.error("Package.json validation failed:",e.error.format()),!1)}function PW(t){const[e,n]=Qe(!1),{packageJson:r}=t,i=NW(r);return i?T(Bl,{isOpen:e,onOpenChange:()=>n(!e),title:`App version: ${i.version}`,toggleClassName:"text-gray-900 text-sm",children:T("ul",{className:"text-gray-600 text-sm",children:Vb.map(s=>_e("li",{className:"my-1 flex justify-between pr-1",children:[_e("span",{children:[s.replace("@powerhousedao/",""),":"]}),T("span",{className:"font-normal",children:i.dependencies[s]})]},s))})}):(console.error("Failed to validate package.json data"),null)}function MW(t){const{packageJson:e}=t;return _e("div",{className:"bg-white p-3",children:[T("h2",{className:"font-semibold",children:"About"}),T("p",{className:"text-sm font-normal text-gray-600",children:"Connect is the hub for your most important documents and processes translated into software. Easily capture data in a structured way with Connect."}),T("div",{className:"my-4",children:T(PW,{packageJson:e})})]})}const LW=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),FW=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),$W=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),jW=/[^\p{L}\d]+/giu,hT="$1\0$2",mT="";function tk(t){let e=t.trim();e=e.replace(LW,hT).replace(FW,hT),e=e.replace(jW,"\0");let n=0,r=e.length;for(;e.charAt(n)==="\0";)n++;if(n===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(n,r).split(/\0/g)}function UW(t){const e=tk(t);for(let n=0;n<e.length;n++){const r=e[n],i=$W.exec(r);if(i){const s=i.index+(i[1]??i[2]).length;e.splice(n,1,r.slice(0,s),r.slice(s))}}return e}function nk(t,e){const[n,r,i]=sk(t,e),s=rk(e==null?void 0:e.locale),o=ik(e==null?void 0:e.locale),a=zW(s,o);return n+r.map(a).join("")+i}function gT(t,e){const[n,r,i]=sk(t,e),s=rk(e==null?void 0:e.locale),o=ik(e==null?void 0:e.locale);return n+r.map(BW(s,o)).join(" ")+i}function rk(t){return e=>e.toLocaleLowerCase(t)}function ik(t){return e=>e.toLocaleUpperCase(t)}function BW(t,e){return n=>`${e(n[0])}${t(n.slice(1))}`}function zW(t,e){return(n,r)=>{const i=n[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(n.slice(1))}}function sk(t,e={}){const n=e.split??(e.separateNumbers?UW:tk),r=e.prefixCharacters??mT,i=e.suffixCharacters??mT;let s=0,o=t.length;for(;s<t.length;){const a=t.charAt(s);if(!r.includes(a))break;s++}for(;o>s;){const a=o-1,c=t.charAt(a);if(!i.includes(c))break;o=a}return[t.slice(0,s),n(t.slice(s,o)),t.slice(o)]}function ok(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=ok(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function hs(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=ok(t))&&(r&&(r+=" "),r+=e);return r}function Ht(...t){return St(hs(t))}function VW(t){const{className:e,...n}=t;return _e("div",{className:Ht("h-full rounded-lg bg-white p-3",e),children:[T("h2",{className:"mb-4 font-semibold",children:"Modify Drives"}),T(HW,{...n}),T("h2",{className:"my-4 font-semibold",children:"Local Storage"}),T(GW,{...n})]})}function HW(t){const{className:e,...n}=t;return T("div",{className:e,children:T(WW,{...n})})}function WW(t){const{className:e,...n}=t;return T("div",{className:e,children:t.drives.map(r=>T(qW,{drive:r,...n},r.id))})}function qW(t){const{drive:e,className:n,onDeleteDrive:r}=t,[i,s]=Qe(!1),o=T(ze,{name:"Hdd",size:16,className:"flex-none"}),a=T(ze,{name:"Server",size:16,className:"flex-none"}),c="icon"in e&&e.icon?T("img",{alt:"drive icon",className:"size-4 flex-none object-contain",src:e.icon}):T(ze,{name:"M",size:16,className:"flex-none"});function l(){return e.sharingType===to?c:e.sharingType===$l?a:o}const u=l();return _e("div",{className:Ht("mb-4 flex w-96 items-center gap-2 rounded-md border border-gray-200 bg-gray-50 px-3 py-2 shadow-sm last-of-type:mb-0",n),children:[u,_e("div",{children:[T("span",{className:"block text-sm font-medium leading-[18px]",children:gT(e.name)}),_e("div",{className:"flex items-baseline gap-x-2 leading-[18px]",children:[_e("span",{className:"text-sm text-gray-600",children:[gT(e.sharingType)," App"]}),_e("a",{className:"group flex items-center gap-x-2 text-sm text-slate-500 transition-colors hover:text-[#9896FF]",children:["By Powerhouse",T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",className:"size-4 text-gray-400 transition-colors group-hover:text-inherit",children:T("path",{d:"M7.99365 11.9939C9.46632 11.9939 10.6603 10.7999 10.6603 9.32722V7.32722C10.6603 6.95922 10.3617 6.66056 9.99365 6.66056C9.62565 6.66056 9.32699 6.95922 9.32699 7.32722V9.32722C9.32699 10.0639 8.73032 10.6606 7.99365 10.6606H2.66032C1.92365 10.6606 1.32699 10.0639 1.32699 9.32722V3.99389C1.32699 3.25723 1.92365 2.66056 2.66032 2.66056H4.66032C5.02832 2.66056 5.32699 2.36189 5.32699 1.99389C5.32699 1.6259 5.02832 1.32723 4.66032 1.32723H2.66032C1.18765 1.32723 -0.00634766 2.52123 -0.00634766 3.99389V9.32722C-0.00634766 10.7999 1.18765 11.9939 2.66032 11.9939H7.99365ZM5.32699 7.32722C5.49765 7.32722 5.67565 7.26989 5.80632 7.13989L10.1396 2.80656L11.9937 4.66056V-0.00610352H7.32699L9.18099 1.8479L4.84766 6.18123C4.58766 6.4419 4.58766 6.87922 4.84766 7.13989C4.97832 7.26989 5.15632 7.32722 5.32699 7.32722Z",fill:"currentColor"})})]})]})]}),T(DD,{items:[{id:"delete-drive",label:"Delete",icon:T(ze,{name:"Trash"}),className:"text-red-900"}],onItemClick:d=>{d==="delete-drive"&&r(e)},onOpenChange:s,open:i,children:T("button",{className:"group ml-auto flex-none",onClick:d=>{d.stopPropagation(),s(!0)},children:T(ze,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots",size:16})})})]})}function GW(t){const{onClearStorage:e}=t;return T("div",{children:_e("button",{className:"flex items-center gap-x-2 rounded-md border border-gray-300 bg-transparent px-3 py-1 text-sm font-medium text-red-900 transition-colors hover:bg-gray-100",onClick:e,children:["Clear Storage ",T(ze,{name:"Trash",size:16})]})})}var yT=1,ZW=.9,YW=.8,KW=.17,Iv=.1,Ov=.999,JW=.9999,XW=.99,QW=/[\\\/_+.#"@\[\(\{&]/,eq=/[\\\/_+.#"@\[\(\{&]/g,tq=/[\s-]/,ak=/[\s-]/g;function Hb(t,e,n,r,i,s,o){if(s===e.length)return i===t.length?yT:XW;var a=`${i},${s}`;if(o[a]!==void 0)return o[a];for(var c=r.charAt(s),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Hb(t,e,n,r,l+1,s+1,o),d>u&&(l===i?d*=yT:QW.test(t.charAt(l-1))?(d*=YW,p=t.slice(i,l-1).match(eq),p&&i>0&&(d*=Math.pow(Ov,p.length))):tq.test(t.charAt(l-1))?(d*=ZW,m=t.slice(i,l-1).match(ak),m&&i>0&&(d*=Math.pow(Ov,m.length))):(d*=KW,i>0&&(d*=Math.pow(Ov,l-i))),t.charAt(l)!==e.charAt(s)&&(d*=JW)),(d<Iv&&n.charAt(l-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(l-1)!==r.charAt(s))&&(f=Hb(t,e,n,r,l+1,s+2,o),f*Iv>d&&(d=f*Iv)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[a]=u,u}function vT(t){return t.toLowerCase().replace(ak," ")}function nq(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Hb(t,e,vT(t),vT(e),0,0,{})}var zu='[cmdk-group=""]',Cv='[cmdk-group-items=""]',rq='[cmdk-group-heading=""]',yE='[cmdk-item=""]',bT=`${yE}:not([aria-disabled="true"])`,Wb="cmdk-item-select",Aa="data-value",iq=(t,e,n)=>nq(t,e,n),ck=k.createContext(void 0),ap=()=>k.useContext(ck),lk=k.createContext(void 0),vE=()=>k.useContext(lk),uk=k.createContext(void 0),dk=k.forwardRef((t,e)=>{let n=tl(()=>{var C,Z;return{search:"",value:(Z=(C=t.value)!=null?C:t.defaultValue)!=null?Z:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=tl(()=>new Set),i=tl(()=>new Map),s=tl(()=>new Map),o=tl(()=>new Set),a=fk(t),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...y}=t,v=Fr(),b=Fr(),E=Fr(),w=k.useRef(null),S=mq();cc(()=>{if(u!==void 0){let C=u.trim();n.current.value=C,_.emit()}},[u]),cc(()=>{S(6,$)},[]);let _=k.useMemo(()=>({subscribe:C=>(o.current.add(C),()=>o.current.delete(C)),snapshot:()=>n.current,setState:(C,Z,H)=>{var V,ce,le;if(!Object.is(n.current[C],Z)){if(n.current[C]=Z,C==="search")I(),F(),S(1,q);else if(C==="value"&&(H||S(5,$),((V=a.current)==null?void 0:V.value)!==void 0)){let ge=Z??"";(le=(ce=a.current).onValueChange)==null||le.call(ce,ge);return}_.emit()}},emit:()=>{o.current.forEach(C=>C())}}),[]),O=k.useMemo(()=>({value:(C,Z,H)=>{var V;Z!==((V=s.current.get(C))==null?void 0:V.value)&&(s.current.set(C,{value:Z,keywords:H}),n.current.filtered.items.set(C,M(Z,H)),S(2,()=>{F(),_.emit()}))},item:(C,Z)=>(r.current.add(C),Z&&(i.current.has(Z)?i.current.get(Z).add(C):i.current.set(Z,new Set([C]))),S(3,()=>{I(),F(),n.current.value||q(),_.emit()}),()=>{s.current.delete(C),r.current.delete(C),n.current.filtered.items.delete(C);let H=x();S(4,()=>{I(),(H==null?void 0:H.getAttribute("id"))===C&&q(),_.emit()})}),group:C=>(i.current.has(C)||i.current.set(C,new Set),()=>{s.current.delete(C),i.current.delete(C)}),filter:()=>a.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:v,inputId:E,labelId:b,listInnerRef:w}),[]);function M(C,Z){var H,V;let ce=(V=(H=a.current)==null?void 0:H.filter)!=null?V:iq;return C?ce(C,n.current.search,Z):0}function F(){if(!n.current.search||a.current.shouldFilter===!1)return;let C=n.current.filtered.items,Z=[];n.current.filtered.groups.forEach(V=>{let ce=i.current.get(V),le=0;ce.forEach(ge=>{let Re=C.get(ge);le=Math.max(Re,le)}),Z.push([V,le])});let H=w.current;A().sort((V,ce)=>{var le,ge;let Re=V.getAttribute("id"),Ge=ce.getAttribute("id");return((le=C.get(Ge))!=null?le:0)-((ge=C.get(Re))!=null?ge:0)}).forEach(V=>{let ce=V.closest(Cv);ce?ce.appendChild(V.parentElement===ce?V:V.closest(`${Cv} > *`)):H.appendChild(V.parentElement===H?V:V.closest(`${Cv} > *`))}),Z.sort((V,ce)=>ce[1]-V[1]).forEach(V=>{var ce;let le=(ce=w.current)==null?void 0:ce.querySelector(`${zu}[${Aa}="${encodeURIComponent(V[0])}"]`);le==null||le.parentElement.appendChild(le)})}function q(){let C=A().find(H=>H.getAttribute("aria-disabled")!=="true"),Z=C==null?void 0:C.getAttribute(Aa);_.setState("value",Z||void 0)}function I(){var C,Z,H,V;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let le of r.current){let ge=(Z=(C=s.current.get(le))==null?void 0:C.value)!=null?Z:"",Re=(V=(H=s.current.get(le))==null?void 0:H.keywords)!=null?V:[],Ge=M(ge,Re);n.current.filtered.items.set(le,Ge),Ge>0&&ce++}for(let[le,ge]of i.current)for(let Re of ge)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ce}function $(){var C,Z,H;let V=x();V&&(((C=V.parentElement)==null?void 0:C.firstChild)===V&&((H=(Z=V.closest(zu))==null?void 0:Z.querySelector(rq))==null||H.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function x(){var C;return(C=w.current)==null?void 0:C.querySelector(`${yE}[aria-selected="true"]`)}function A(){var C;return Array.from(((C=w.current)==null?void 0:C.querySelectorAll(bT))||[])}function P(C){let Z=A()[C];Z&&_.setState("value",Z.getAttribute(Aa))}function B(C){var Z;let H=x(),V=A(),ce=V.findIndex(ge=>ge===H),le=V[ce+C];(Z=a.current)!=null&&Z.loop&&(le=ce+C<0?V[V.length-1]:ce+C===V.length?V[0]:V[ce+C]),le&&_.setState("value",le.getAttribute(Aa))}function J(C){let Z=x(),H=Z==null?void 0:Z.closest(zu),V;for(;H&&!V;)H=C>0?pq(H,zu):hq(H,zu),V=H==null?void 0:H.querySelector(bT);V?_.setState("value",V.getAttribute(Aa)):B(C)}let L=()=>P(A().length-1),G=C=>{C.preventDefault(),C.metaKey?L():C.altKey?J(1):B(1)},U=C=>{C.preventDefault(),C.metaKey?P(0):C.altKey?J(-1):B(-1)};return k.createElement(Zt.div,{ref:e,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:C=>{var Z;if((Z=y.onKeyDown)==null||Z.call(y,C),!C.defaultPrevented)switch(C.key){case"n":case"j":{g&&C.ctrlKey&&G(C);break}case"ArrowDown":{G(C);break}case"p":case"k":{g&&C.ctrlKey&&U(C);break}case"ArrowUp":{U(C);break}case"Home":{C.preventDefault(),P(0);break}case"End":{C.preventDefault(),L();break}case"Enter":if(!C.nativeEvent.isComposing&&C.keyCode!==229){C.preventDefault();let H=x();if(H){let V=new Event(Wb);H.dispatchEvent(V)}}}}},k.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:yq},c),ry(t,C=>k.createElement(lk.Provider,{value:_},k.createElement(ck.Provider,{value:O},C))))}),sq=k.forwardRef((t,e)=>{var n,r;let i=Fr(),s=k.useRef(null),o=k.useContext(uk),a=ap(),c=fk(t),l=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;cc(()=>{if(!l)return a.item(i,o==null?void 0:o.id)},[l]);let u=pk(i,s,[t.value,t.children,s],t.keywords),d=vE(),f=ra(S=>S.value&&S.value===u.current),p=ra(S=>l||a.filter()===!1?!0:S.search?S.filtered.items.get(i)>0:!0);k.useEffect(()=>{let S=s.current;if(!(!S||t.disabled))return S.addEventListener(Wb,m),()=>S.removeEventListener(Wb,m)},[p,t.onSelect,t.disabled]);function m(){var S,_;h(),(_=(S=c.current).onSelect)==null||_.call(S,u.current)}function h(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:y,onSelect:v,forceMount:b,keywords:E,...w}=t;return k.createElement(Zt.div,{ref:pf([s,e]),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||a.getDisablePointerSelection()?void 0:h,onClick:g?void 0:m},t.children)}),oq=k.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...s}=t,o=Fr(),a=k.useRef(null),c=k.useRef(null),l=Fr(),u=ap(),d=ra(p=>i||u.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);cc(()=>u.group(o),[]),pk(o,a,[t.value,t.heading,c]);let f=k.useMemo(()=>({id:o,forceMount:i}),[i]);return k.createElement(Zt.div,{ref:pf([a,e]),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&k.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),ry(t,p=>k.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},k.createElement(uk.Provider,{value:f},p))))}),aq=k.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=k.useRef(null),s=ra(o=>!o.search);return!n&&!s?null:k.createElement(Zt.div,{ref:pf([i,e]),...r,"cmdk-separator":"",role:"separator"})}),cq=k.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,s=vE(),o=ra(u=>u.search),a=ra(u=>u.value),c=ap(),l=k.useMemo(()=>{var u;let d=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${yE}[${Aa}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return k.useEffect(()=>{t.value!=null&&s.setState("search",t.value)},[t.value]),k.createElement(Zt.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:i?t.value:o,onChange:u=>{i||s.setState("search",u.target.value),n==null||n(u.target.value)}})}),lq=k.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,s=k.useRef(null),o=k.useRef(null),a=ap();return k.useEffect(()=>{if(o.current&&s.current){let c=o.current,l=s.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let f=c.offsetHeight;l.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return d.observe(c),()=>{cancelAnimationFrame(u),d.unobserve(c)}}},[]),k.createElement(Zt.div,{ref:pf([s,e]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},ry(t,c=>k.createElement("div",{ref:pf([o,a.listInnerRef]),"cmdk-list-sizer":""},c)))}),uq=k.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:s,container:o,...a}=t;return k.createElement($1,{open:n,onOpenChange:r},k.createElement(j1,{container:o},k.createElement(U1,{"cmdk-overlay":"",className:i}),k.createElement(B1,{"aria-label":t.label,"cmdk-dialog":"",className:s},k.createElement(dk,{ref:e,...a}))))}),dq=k.forwardRef((t,e)=>ra(n=>n.filtered.count===0)?k.createElement(Zt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),fq=k.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...s}=t;return k.createElement(Zt.div,{ref:e,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ry(t,o=>k.createElement("div",{"aria-hidden":!0},o)))}),zr=Object.assign(dk,{List:lq,Item:sq,Input:cq,Group:oq,Separator:aq,Dialog:uq,Empty:dq,Loading:fq});function pq(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function hq(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function fk(t){let e=k.useRef(t);return cc(()=>{e.current=t}),e}var cc=typeof window>"u"?k.useEffect:k.useLayoutEffect;function tl(t){let e=k.useRef();return e.current===void 0&&(e.current=t()),e}function pf(t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function ra(t){let e=vE(),n=()=>t(e.snapshot());return a8.useSyncExternalStore(e.subscribe,n,n)}function pk(t,e,n,r=[]){let i=k.useRef(),s=ap();return cc(()=>{var o;let a=(()=>{var l;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(l=u.current.textContent)==null?void 0:l.trim():i.current}})(),c=r.map(l=>l.trim());s.value(t,a,c),(o=e.current)==null||o.setAttribute(Aa,a),i.current=a}),i}var mq=()=>{let[t,e]=k.useState(),n=tl(()=>new Map);return cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function gq(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function ry({asChild:t,children:e},n){return t&&k.isValidElement(e)?k.cloneElement(gq(e),{ref:e.ref},n(e.props.children)):n(e)}var yq={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const hk=Ae.forwardRef(({className:t,...e},n)=>T(zr,{ref:n,className:Ht("flex size-full flex-col rounded [&_[cmdk-label]]:hidden",t),...e}));hk.displayName=zr.displayName;const mk=Ae.forwardRef(({wrapperClassName:t,className:e,...n},r)=>_e("div",{className:Ht("group relative flex items-center border-b","border-b-gray-300 dark:border-b-gray-900","hover:border-b-gray-300 dark:hover:border-b-gray-800","hover:bg-gray-100 dark:hover:bg-gray-900","focus-within:border-b-gray-300 dark:focus-within:border-b-gray-800","focus-within:bg-gray-100 dark:focus-within:bg-gray-900",t),"cmdk-input-wrapper":"",children:[T(ze,{name:"Search",size:16,className:Ht("pointer-events-none absolute left-2 top-3.5 text-gray-500 dark:text-gray-700","group-hover:text-gray-700 dark:group-hover:text-gray-500","group-focus-within:!text-gray-900 dark:group-focus-within:!text-gray-50")}),T(zr.Input,{ref:r,className:Ht("flex w-full bg-transparent pb-2 pl-8 pr-3 pt-3 text-[14px] font-normal leading-5 outline-none","placeholder:text-gray-500 dark:placeholder:text-gray-700","group-hover:placeholder:text-gray-700 dark:group-hover:placeholder:text-gray-500","group-focus-within:placeholder:!text-gray-700 dark:group-focus-within:placeholder:!text-gray-300","disabled:cursor-not-allowed",e),...n})]}));mk.displayName=zr.Input.displayName;const gk=Ae.forwardRef(({className:t,...e},n)=>T(zr.List,{ref:n,className:Ht("max-h-[300px] overflow-y-auto overflow-x-hidden","focus:outline-none","scrollbar-thin scrollbar-gutter-stable","scrollbar-track-transparent","scrollbar-thumb-gray-300 hover:scrollbar-thumb-gray-300","dark:scrollbar-thumb-charcoal-700 dark:hover:scrollbar-thumb-charcoal-700","scrollbar-thumb-rounded-md",t),...e}));gk.displayName=zr.List.displayName;const vq=Ae.forwardRef((t,e)=>T(zr.Loading,{ref:e,...t}));vq.displayName=zr.Loading.displayName;const yk=Ae.forwardRef((t,e)=>T(zr.Empty,{ref:e,...t}));yk.displayName=zr.Empty.displayName;const qb=Ae.forwardRef(({className:t,...e},n)=>T(zr.Group,{ref:n,className:Ht("overflow-hidden px-0.5 py-1","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e}));qb.displayName=zr.Group.displayName;const Gb=Ae.forwardRef(({className:t,...e},n)=>T(zr.Item,{ref:n,className:Ht("relative flex select-none items-center justify-between","h-8 gap-2 rounded-md py-1.5 pl-1.5 pr-2.5","text-[14px] leading-4 outline-none","border-y-2 border-white dark:border-slate-700","data-[disabled=true]:pointer-events-none","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...e}));Gb.displayName=zr.Item.displayName;const _T=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,wT=hs,bq=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return wT(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const f=_T(u)||_T(d);return i[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[h,g]=m;return Array.isArray(g)?g.includes({...s,...a}[h]):{...s,...a}[h]===g})?[...l,d,f]:l},[]);return wT(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},_q=bq(Ht("inline-flex items-center justify-center gap-2","whitespace-nowrap rounded-md text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:pointer-events-none","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"),{variants:{variant:{default:"",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),wq=Ae.forwardRef(({variant:t,className:e,asChild:n=!1,...r},i)=>T(n?Xo:"button",{className:Ht(_q({variant:t,className:e})),ref:i,...r}));var bE="Popover",[vk,Che]=ma(bE,[yu]),cp=yu(),[Eq,ga]=vk(bE),bk=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=cp(e),c=k.useRef(null),[l,u]=k.useState(!1),[d=!1,f]=ep({prop:r,defaultProp:i,onChange:s});return T(Fw,{...a,children:T(Eq,{scope:e,contentId:Fr(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:k.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:l,onCustomAnchorAdd:k.useCallback(()=>u(!0),[]),onCustomAnchorRemove:k.useCallback(()=>u(!1),[]),modal:o,children:n})})};bk.displayName=bE;var _k="PopoverAnchor",Sq=k.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=ga(_k,n),s=cp(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return k.useEffect(()=>(o(),()=>a()),[o,a]),T(qg,{...s,...r,ref:e})});Sq.displayName=_k;var wk="PopoverTrigger",Ek=k.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=ga(wk,n),s=cp(n),o=Ln(e,i.triggerRef),a=T(Zt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ok(i.open),...r,ref:o,onClick:dt(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:T(qg,{asChild:!0,...s,children:a})});Ek.displayName=wk;var _E="PopoverPortal",[xq,Tq]=vk(_E,{forceMount:void 0}),Sk=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=ga(_E,e);return T(xq,{scope:e,forceMount:n,children:T(bi,{present:n||s.open,children:T(np,{asChild:!0,container:i,children:r})})})};Sk.displayName=_E;var Zl="PopoverContent",xk=k.forwardRef((t,e)=>{const n=Tq(Zl,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=ga(Zl,t.__scopePopover);return T(bi,{present:r||s.open,children:s.modal?T(Iq,{...i,ref:e}):T(Oq,{...i,ref:e})})});xk.displayName=Zl;var Iq=k.forwardRef((t,e)=>{const n=ga(Zl,t.__scopePopover),r=k.useRef(null),i=Ln(e,r),s=k.useRef(!1);return k.useEffect(()=>{const o=r.current;if(o)return Uw(o)},[]),T(Yg,{as:Xo,allowPinchZoom:!0,children:T(Tk,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:dt(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:dt(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:dt(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Oq=k.forwardRef((t,e)=>{const n=ga(Zl,t.__scopePopover),r=k.useRef(!1),i=k.useRef(!1);return T(Tk,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,l;(c=t.onInteractOutside)==null||c.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Tk=k.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=t,f=ga(Zl,n),p=cp(n);return Pw(),T(Wg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:T(tp,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:T($w,{"data-state":Ok(f.open),role:"dialog",id:f.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ik="PopoverClose",Cq=k.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=ga(Ik,n);return T(Zt.button,{type:"button",...r,ref:e,onClick:dt(t.onClick,()=>i.onOpenChange(!1))})});Cq.displayName=Ik;var Rq="PopoverArrow",Dq=k.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=cp(n);return T(jw,{...i,...r,ref:e})});Dq.displayName=Rq;function Ok(t){return t?"open":"closed"}var kq=bk,Aq=Ek,Nq=Sk,Pq=xk;const Mq=kq,Lq=Aq,Fq=Ae.forwardRef(({align:t="center",sideOffset:e=4,className:n,...r},i)=>T(Nq,{children:T(Pq,{align:t,sideOffset:e,className:Ht(["data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","w-72 z-50 rounded-md border p-3 shadow-none outline-none"],n),ref:i,...r})}));function $q({options:t=[],multiple:e=!1,defaultValue:n,value:r,onChange:i,onBlur:s}){const o=hn(!1),a=hn(null),[c,l]=Qe(!1),[u,d]=Qe(()=>{const v=r??n??[];return v===""?[]:Array.isArray(v)?v:[v]});jt(()=>{if(o.current){o.current=!1;return}const v=r??n??[];d(v===""?[]:Array.isArray(v)?v:[v])},[r]);const f=xe(v=>{l(v)},[]),p=xe(v=>{o.current=!0;let b;e?b=u.includes(v)?u.filter(E=>E!==v):[...u,v]:(b=u[0]===v?[]:[v],l(!1)),d(b),i==null||i(e?b:b[0]??"")},[e,u,t,i]),m=xe(()=>{o.current=!0,d([]),i==null||i(e?[]:"")},[e,i]),h=xe(()=>{o.current=!0;const v=t.filter(E=>!E.disabled).map(E=>E.value),b=u.length===v.length?[]:v;d(b),i==null||i(e?b:b[0])},[t,u,e,i]),[g,y]=Qe(!1);return jt(()=>{!c&&g&&(s==null||s({target:{}})),c&&y(!0)},[c,g,s]),jt(()=>{if(!e&&u.length>1){o.current=!0,d([u[0]]),i==null||i(u[0]);return}u.length>0&&(o.current=!0,i==null||i(e?[u[0]]:u[0]))},[e]),{selectedValues:u,isPopoverOpen:c,commandListRef:a,toggleOption:p,handleClear:m,toggleAll:h,handleOpenChange:f}}const jq=({selectedValues:t,options:e=[],multiple:n,searchable:r,placeholder:i,handleClear:s})=>{const o=a=>typeof a=="string"?T(ze,{name:a,size:16}):a&&T(a,{className:"size-4"});return t.length===0?_e("div",{className:Ht("mx-auto flex w-full items-center",i?"justify-between":"justify-end"),children:[i&&T("span",{className:"text-[14px] font-normal leading-5 text-gray-600 dark:text-gray-500",children:i}),r?T(ze,{name:"CaretSort",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"}):T(ze,{name:"ChevronDown",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"})]}):_e("div",{className:"flex w-full items-center justify-between gap-2",children:[T("div",{className:Ht("max-w-full truncate text-gray-900 dark:text-gray-50",!n&&"flex items-center gap-2"),children:t.map((a,c)=>{const l=e.find(u=>u.value===a);return n?T("span",{className:Ht("text-[14px] font-normal leading-5",c!==t.length-1&&"mr-1"),children:c!==t.length-1?`${l==null?void 0:l.label},`:l==null?void 0:l.label},a):_e(Ae.Fragment,{children:[o(l==null?void 0:l.icon),T("span",{className:"truncate text-[14px] font-normal leading-5",children:l==null?void 0:l.label})]},a)})}),_e("div",{className:"flex items-center justify-between gap-2",children:[n&&t.length>0&&T("div",{onClick:a=>{a.preventDefault(),a.stopPropagation(),s()},className:"size-4 p-0",children:T(ze,{name:"XmarkLight",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"})}),r?T(ze,{name:"CaretSort",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"}):T(ze,{name:"ChevronDown",size:16,className:"cursor-pointer text-gray-700 dark:text-gray-400"})]})]})},Uq=t=>typeof t=="string"?T(ze,{name:t,size:16,className:Ht("text-gray-700 dark:text-gray-400")}):t&&T(t,{className:Ht("size-4","text-gray-700 dark:text-gray-400")}),Bq=({searchable:t,commandListRef:e,multiple:n,selectedValues:r,selectionIcon:i,selectionIconPosition:s,options:o=[],toggleAll:a,toggleOption:c})=>{const l=o.filter(f=>!f.disabled),u=o.some(f=>f.icon),d=ra(f=>f.search);return jt(()=>{var f;(f=e.current)==null||f.scrollTo({top:0,behavior:"instant"})},[e,d]),_e(Zo,{children:[t&&T(mk,{placeholder:"Search...",wrapperClassName:"rounded-t",className:"text-gray-900 dark:text-gray-50"}),_e(gk,{ref:e,tabIndex:t?void 0:0,children:[T(yk,{className:"p-4 text-center text-[14px] font-normal leading-5 text-gray-700 dark:text-gray-400",children:"No results found."}),n&&d===""&&T(qb,{className:"pb-0",children:T(Gb,{value:"select-all",onSelect:a,disabled:!1,className:Ht("cursor-pointer","data-[selected=true]:bg-gray-100 dark:data-[selected=true]:bg-gray-900"),role:"option","aria-selected":r.length===l.length,children:_e("div",{className:"flex w-full items-center gap-2",children:[i==="auto"&&T("div",{className:Ht("flex size-4 items-center justify-center rounded border","border-gray-700 dark:border-gray-400",r.length===l.length&&"bg-gray-900 text-slate-50 dark:bg-gray-400 dark:text-black"),children:r.length===l.length&&T(ze,{name:"Checkmark",size:16})}),i==="checkmark"&&!(s==="right"&&u)&&T("div",{className:"size-4",children:s==="left"&&r.length===l.length&&T(ze,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})}),T("span",{className:"text-[14px] font-semibold leading-4 text-gray-900 dark:text-gray-50",children:r.length===l.length?"Deselect All":"Select All"}),i==="checkmark"&&s==="right"&&T("div",{className:"ml-auto size-4",children:r.length===l.length&&T(ze,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})})]})})}),T(qb,{className:n&&d===""?"pt-0":void 0,children:o.map(f=>{const p=r.includes(f.value);return _e(Gb,{value:f.label,onSelect:()=>!f.disabled&&c(f.value),disabled:f.disabled,className:Ht("cursor-pointer","data-[selected=true]:bg-gray-100 dark:data-[selected=true]:bg-gray-900",f.disabled&&"!pointer-events-auto cursor-not-allowed hover:bg-transparent dark:hover:bg-transparent"),role:"option","aria-selected":p,children:[i==="auto"&&(n?T("div",{className:Ht("flex size-4 items-center justify-center rounded border","border-gray-700 dark:border-gray-400",p&&"bg-gray-900 text-slate-50 dark:bg-gray-400 dark:text-black"),children:p&&T(ze,{name:"Checkmark",size:16})}):T("div",{className:Ht("relative size-4 rounded-full border",p?"border-gray-900 dark:border-gray-400":"border-gray-800 dark:border-gray-400","bg-transparent dark:bg-transparent"),children:p&&T("div",{className:"absolute left-1/2 top-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-gray-900 dark:bg-gray-400"})})),i==="checkmark"&&!(s==="right"&&u)&&T("div",{className:"size-4",children:s==="left"&&p&&T(ze,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})}),Uq(f.icon),T("span",{className:Ht("flex-1 truncate text-[14px] font-medium leading-4","text-gray-700 dark:text-gray-500",f.disabled&&"text-gray-600 dark:text-gray-600"),children:f.label}),i==="checkmark"&&s==="right"&&T("div",{className:"size-4",children:p&&T(ze,{name:"Checkmark",size:16,className:"text-gray-900 dark:text-gray-50"})})]},f.value)})})]})]})},zq=({children:t})=>T("div",{className:"flex flex-col gap-2",children:t});var[iy,Rhe]=ma("Tooltip",[yu]),sy=yu(),Ck="TooltipProvider",Vq=700,Zb="tooltip.open",[Hq,wE]=iy(Ck),Rk=t=>{const{__scopeTooltip:e,delayDuration:n=Vq,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,[o,a]=k.useState(!0),c=k.useRef(!1),l=k.useRef(0);return k.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),T(Hq,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:k.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:k.useCallback(u=>{c.current=u},[]),disableHoverableContent:i,children:s})};Rk.displayName=Ck;var oy="Tooltip",[Wq,lp]=iy(oy),Dk=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,c=wE(oy,t.__scopeTooltip),l=sy(e),[u,d]=k.useState(null),f=Fr(),p=k.useRef(0),m=o??c.disableHoverableContent,h=a??c.delayDuration,g=k.useRef(!1),[y=!1,v]=ep({prop:r,defaultProp:i,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zb))):c.onClose(),s==null||s(_)}}),b=k.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),w=k.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=k.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return k.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),T(Fw,{...l,children:T(Wq,{scope:e,contentId:f,open:y,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:k.useCallback(()=>{c.isOpenDelayed?S():E()},[c.isOpenDelayed,S,E]),onTriggerLeave:k.useCallback(()=>{m?w():(window.clearTimeout(p.current),p.current=0)},[w,m]),onOpen:E,onClose:w,disableHoverableContent:m,children:n})})};Dk.displayName=oy;var Yb="TooltipTrigger",kk=k.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=lp(Yb,n),s=wE(Yb,n),o=sy(n),a=k.useRef(null),c=Ln(e,a,i.onTriggerChange),l=k.useRef(!1),u=k.useRef(!1),d=k.useCallback(()=>l.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),T(qg,{asChild:!0,...o,children:T(Zt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:dt(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:dt(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:dt(t.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:dt(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:dt(t.onBlur,i.onClose),onClick:dt(t.onClick,i.onClose)})})});kk.displayName=Yb;var EE="TooltipPortal",[qq,Gq]=iy(EE,{forceMount:void 0}),Ak=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,s=lp(EE,e);return T(qq,{scope:e,forceMount:n,children:T(bi,{present:n||s.open,children:T(np,{asChild:!0,container:i,children:r})})})};Ak.displayName=EE;var Yl="TooltipContent",Nk=k.forwardRef((t,e)=>{const n=Gq(Yl,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=lp(Yl,t.__scopeTooltip);return T(bi,{present:r||o.open,children:o.disableHoverableContent?T(Pk,{side:i,...s,ref:e}):T(Zq,{side:i,...s,ref:e})})}),Zq=k.forwardRef((t,e)=>{const n=lp(Yl,t.__scopeTooltip),r=wE(Yl,t.__scopeTooltip),i=k.useRef(null),s=Ln(e,i),[o,a]=k.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=k.useCallback(()=>{a(null),d(!1)},[d]),p=k.useCallback((m,h)=>{const g=m.currentTarget,y={x:m.clientX,y:m.clientY},v=Xq(y,g.getBoundingClientRect()),b=Qq(y,v),E=eG(h.getBoundingClientRect()),w=nG([...b,...E]);a(w),d(!0)},[d]);return k.useEffect(()=>()=>f(),[f]),k.useEffect(()=>{if(c&&u){const m=g=>p(g,u),h=g=>p(g,c);return c.addEventListener("pointerleave",m),u.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",h)}}},[c,u,p,f]),k.useEffect(()=>{if(o){const m=h=>{const g=h.target,y={x:h.clientX,y:h.clientY},v=(c==null?void 0:c.contains(g))||(u==null?void 0:u.contains(g)),b=!tG(y,o);v?f():b&&(f(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,u,o,l,f]),T(Pk,{...t,ref:s})}),[Yq,Kq]=iy(oy,{isInside:!1}),Pk=k.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,c=lp(Yl,n),l=sy(n),{onClose:u}=c;return k.useEffect(()=>(document.addEventListener(Zb,u),()=>document.removeEventListener(Zb,u)),[u]),k.useEffect(()=>{if(c.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),T(tp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:_e($w,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[T(wR,{children:r}),T(Yq,{scope:n,isInside:!0,children:T(V1,{id:c.contentId,role:"tooltip",children:i||r})})]})})});Nk.displayName=Yl;var Mk="TooltipArrow",Jq=k.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=sy(n);return Kq(Mk,n).isInside?null:T(jw,{...i,...r,ref:e})});Jq.displayName=Mk;function Xq(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Qq(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function eG(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function tG(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,c=e[s].y,l=e[o].x,u=e[o].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(i=!i)}return i}function nG(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),rG(e)}function rG(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var iG=Rk,sG=Dk,oG=kk,aG=Ak,cG=Nk;const lG=k.forwardRef(({children:t,className:e,...n},r)=>T(cG,{ref:r,...n,className:Ht("z-50 overflow-hidden rounded-md text-sm","border border-gray-200 bg-white text-gray-900 dark:border-gray-900 dark:bg-slate-900 dark:text-gray-200","px-3 py-1.5 shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",e),children:t})),uG=({content:t,children:e,triggerAsChild:n=!1,delayDuration:r=0,...i})=>{const{open:s,defaultOpen:o,onOpenChange:a,...c}=i;return _e(sG,{defaultOpen:o,delayDuration:r,onOpenChange:a,open:s,children:[T(oG,{asChild:n,type:n?void 0:"button",children:e}),T(aG,{children:T(lG,{sideOffset:3,...c,children:t})})]})},dG=({children:t,required:e,disabled:n,description:r,hasError:i,inline:s,className:o,...a})=>{const c=Ht("inline-flex items-center text-sm font-medium",s?"leading-[22px]":"leading-4",`text-gray-900 ${s?"dark:text-gray-400":"dark:text-gray-50"}`,i&&"group-hover:!text-red-900 dark:group-hover:!text-red-900",i&&s&&"text-red-800 dark:text-red-800",i&&!s&&"text-red-900 dark:text-red-900",n&&`cursor-not-allowed text-gray-700 ${s?"dark:text-gray-600":"dark:text-gray-300"}`,s?!n&&"group-hover:text-gray-900 dark:group-hover:text-slate-50":"mb-[3px]",o);if(!t)return null;const l={...a};return _e("label",{className:c,...l,children:[t,e&&T("span",{className:Ht("ml-1 text-gray-800 group-hover:text-gray-900 dark:text-gray-400 dark:group-hover:text-slate-50",i&&`${s?"!text-red-800":"!text-red-900"} group-hover:!text-red-900`),children:"*"}),r&&T(iG,{children:T(uG,{content:r,children:T(ze,{name:"CircleInfo",size:16,className:Ht("ml-1 cursor-pointer text-gray-600 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-500",n&&"text-gray-500")})})})]})},fG=({children:t,as:e,className:n})=>T(e??"p",{className:Ht("font-sans text-sm font-normal leading-5 text-gray-600 dark:text-gray-500",n),children:t}),pG="p",ET=({children:t,type:e="info",as:n,className:r,...i})=>{const s=n||pG,o=St("mb-0 inline-flex items-center text-xs font-medium",{error:"text-red-900 dark:text-red-900",info:"text-blue-900 dark:text-blue-900",warning:"text-yellow-900 dark:text-yellow-900"}[e],r);return T(s,{"data-type":e,className:o,...i,children:t})},ST=({messages:t,type:e="info",className:n,...r})=>{if(t.length===0)return null;if(t.length===1)return T(ET,{type:e,...r,children:t[0]});const i={error:"before:bg-red-900 dark:before:bg-red-900",info:"before:bg-blue-900 dark:before:bg-blue-900",warning:"before:bg-orange-900 dark:before:bg-orange-900"};return T("ul",{className:Ht("flex flex-col gap-1",n),...r,children:t.map(s=>T(ET,{as:"li",type:e,className:Ht("relative pl-4","before:absolute before:left-0 before:top-[0.4em] before:size-2 before:rounded-full",i[e]),children:s},s))})},Lk=Ae.forwardRef(({options:t=[],defaultValue:e,value:n,onChange:r,onBlur:i,id:s,name:o,label:a,required:c,disabled:l,errors:u=[],warnings:d=[],multiple:f,selectionIcon:p="auto",selectionIconPosition:m="left",searchable:h,description:g,placeholder:y,className:v,...b},E)=>{var w;const S=a$(),_=s??`${S}-select`,{selectedValues:O,isPopoverOpen:M,commandListRef:F,toggleOption:q,handleClear:I,toggleAll:$,handleOpenChange:x}=$q({options:t,multiple:f,defaultValue:e,value:n,onChange:r,onBlur:i}),A=xe(P=>{M||i==null||i(P)},[i,M]);return _e(zq,{children:[a&&T(dG,{htmlFor:_,required:c,disabled:l,hasError:u.length>0,inline:!1,onClick:P=>{var B;P.preventDefault(),(B=P.target.control)==null||B.focus()},children:a}),_e(Mq,{open:M,onOpenChange:x,children:[T(Lq,{asChild:!0,children:T(wq,{id:_,name:o,type:"button",role:"combobox",onBlur:A,disabled:l,"aria-invalid":u.length>0,"aria-label":a?void 0:f?"Multi select":"Select","aria-required":c,"aria-expanded":M,className:Ht("flex h-9 w-full items-center justify-between px-3 py-2","dark:border-charcoal-700 dark:bg-charcoal-900 rounded-md border border-gray-300 bg-white","hover:border-gray-300 hover:bg-gray-100","dark:hover:border-charcoal-700 dark:hover:bg-charcoal-800","dark:focus:ring-charcoal-300 focus:outline-none focus:ring-1 focus:ring-gray-900 focus:ring-offset-0","dark:focus-visible:ring-charcoal-300 focus-visible:ring-1 focus-visible:ring-gray-900 focus-visible:ring-offset-0",l&&["!pointer-events-auto cursor-not-allowed","dark:hover:border-charcoal-700 dark:hover:bg-charcoal-900 hover:border-gray-300 hover:bg-white"],v),...b,ref:E,children:T(jq,{selectedValues:O,options:t,multiple:f,searchable:h,placeholder:y,handleClear:I})})}),T(Fq,{align:"start",className:Ht("w-[--radix-popover-trigger-width] p-0","border-gray-300 bg-white dark:border-slate-500 dark:bg-slate-700","rounded shadow-[1px_4px_15px_0px_rgba(74,88,115,0.25)] dark:shadow-[1px_4px_15.3px_0px_#141921]"),children:T(hk,{defaultValue:!f&&O[0]?(w=t.find(P=>P.value===O[0]))==null?void 0:w.label:void 0,children:T(Bq,{searchable:h,commandListRef:F,multiple:f,selectedValues:O,selectionIcon:p,selectionIconPosition:m,options:t,toggleAll:$,toggleOption:q})})})]}),g&&T(fG,{children:g}),d.length>0&&T(ST,{messages:d,type:"warning"}),u.length>0&&T(ST,{messages:u,type:"error"})]})});function hG(t){const{className:e,...n}=t;return T("div",{className:St("rounded-lg p-3",e),children:T(mG,{...n})})}function mG(t){const{documentModelEditor:e,setDocumentModelEditor:n,documentModelEditorOptions:r,className:i}=t;return _e("div",{children:[T("h3",{className:"mb-4 font-semibold text-gray-900",children:"Default Editor Selection"}),T(Lk,{className:St("min-w-36 max-w-fit",i),name:"default-editor",required:!0,value:e,options:r,multiple:!1,onChange:s=>n(s)})]})}const gG=Ht("flex h-9 w-full rounded-md text-sm font-normal leading-5 text-gray-900 dark:text-gray-50","dark:border-charcoal-700 dark:bg-charcoal-900 border border-gray-300 bg-white","px-3 py-2","font-sans placeholder:text-gray-500 dark:placeholder:text-gray-600","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-900 focus-visible:ring-offset-0 focus-visible:ring-offset-white","dark:focus-visible:ring-charcoal-300 dark:focus-visible:ring-offset-charcoal-900 dark:focus:bg-charcoal-900 focus:bg-gray-50","disabled:cursor-not-allowed","disabled:border-gray-300 disabled:bg-white disabled:text-gray-700","disabled:dark:border-charcoal-800 disabled:dark:bg-charcoal-900 disabled:dark:text-gray-300"),yG=k.forwardRef(({className:t,type:e,...n},r)=>T("input",{type:e,className:Ht(gG,t),ref:r,...n})),vG=t=>{const{onInstall:e,className:n}=t,[r,i]=Qe(""),[s,o]=Qe(!1),[a,c]=Qe(),l=xe(()=>{const f=e(r);f?(o(!0),f.then(()=>i("")).catch(c).finally(()=>o(!1))):(i(""),c(void 0))},[e,r]),u=xe(f=>{i(f.target.value)},[]),d=a?typeof a=="string"?a:a instanceof Error?a.message:a:" ";return _e("div",{className:n,children:[T("h3",{className:"mb-4 font-semibold text-gray-900",children:"Install Package"}),_e("div",{className:"flex items-center gap-4",children:[T(yG,{name:"package",className:"max-w-xs text-gray-700",value:r,onChange:u,onSubmit:l,disabled:s}),T(Pr,{className:"h-9 rounded-md text-sm",onClick:l,disabled:s,children:"Install"})]}),T("p",{className:"mb-3 ml-2 h-3 text-sm text-red-800",children:d})]})},Qp=({label:t,value:e})=>_e("div",{className:"flex items-start gap-2 text-sm",children:[_e("p",{className:"text-gray-600",children:[t,":"]}),T("p",{className:"text-gray-600",children:e})]}),bG=t=>{const{package:{name:e,description:n,category:r,publisher:i,publisherUrl:s,modules:o,id:a,removable:c},mutable:l,onUninstall:u,className:d}=t,[f,p]=Qe(!1);return _e("li",{className:St("relative flex flex-col items-start rounded-md border border-gray-200 p-3 text-sm leading-5 shadow-sm",d),children:[T("h3",{className:"font-semibold text-gray-900",children:e}),T(Qp,{label:"Description",value:n}),T(Qp,{label:"Category",value:r}),T(Qp,{label:"Publisher",value:i}),T(Qp,{label:"Publisher URL",value:T("a",{className:"underline",href:s,children:s})}),T("p",{className:"text-sm text-gray-600",children:"Modules included:"}),T("ul",{className:"list-disc pl-5",children:o.map(m=>T("li",{children:T("span",{className:"text-gray-600",children:m})},m))}),l&&c&&T(DD,{items:[{id:"uninstall",label:"Uninstall",icon:T(ze,{name:"Trash"}),className:"text-red-900"}],onItemClick:m=>{m==="uninstall"&&u(a)},onOpenChange:p,open:f,children:T("button",{className:"group absolute right-3 top-3",onClick:m=>{m.stopPropagation(),p(!0)},children:T(ze,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots"})})})]})},_G=t=>{const{className:e,packages:n,onUninstall:r,mutable:i,...s}=t,o=xe(a=>{r(a)},[r]);return _e("div",{...s,className:St("flex flex-col items-stretch overflow-hidden",e),children:[T("h3",{className:"mb-4 font-semibold text-gray-900",children:"Installed Packages"}),T("div",{className:"flex-1 overflow-y-auto pr-2",children:T("ul",{className:"flex flex-col items-stretch gap-4 pr-2",children:n.map(a=>T(bG,{package:a,onUninstall:o,mutable:i},a.id))})})]})},wG=t=>{const{reactorOptions:e,reactor:n,onReactorChange:r,...i}=t,s=xe(o=>{r(Array.isArray(o)?o.at(-1):o)},[r]);return _e("div",{...i,children:[T("h3",{className:"mb-4 font-semibold text-gray-900",children:"Select Reactor"}),T(Lk,{className:"min-w-36 max-w-fit",name:"reactor",required:!0,value:n,options:e,multiple:!1,onChange:s})]})},EG=t=>{const{className:e,reactorOptions:n,reactor:r,onReactorChange:i,onInstall:s,packages:o,onUninstall:a,mutable:c,...l}=t;return _e("div",{...l,className:St("flex h-full flex-1 flex-col rounded-lg p-3",e),children:[T(wG,{reactor:r,reactorOptions:n,onReactorChange:i,className:"mb-4"}),c&&T(vG,{onInstall:s}),T(_G,{packages:o,onUninstall:a,mutable:c})]})};function SG(t){var e,n;const{title:r,overlayProps:i,contentProps:s,onOpenChange:o,tabs:a,defaultTab:c,...l}=t,[u,d]=Qe(c??((e=a.at(0))==null?void 0:e.id)),f=a.map(m=>T("button",{type:"button",onClick:()=>d(m.id),children:_e("div",{className:St("flex h-9 w-48 cursor-pointer items-center gap-x-2 rounded-md pl-3 hover:bg-slate-50",u===m.id?"bg-slate-50":"bg-transparent"),children:[m.icon,T("span",{children:m.label})]})},m.id)),p=(n=a.find(m=>m.id===u))==null?void 0:n.content;return _e(ho,{contentProps:{...s,className:St("min-h-full w-full max-w-4xl rounded-xl",s==null?void 0:s.className),style:{...s==null?void 0:s.style,boxShadow:"0px 0px 16px 4px rgba(0, 0, 0, 0.04), 0px 33px 32px -16px rgba(0, 0, 0, 0.10)"}},onOpenChange:o,overlayProps:{...i,className:St("py-28",i==null?void 0:i.className)},...l,children:[_e("div",{className:"flex justify-between border-b border-slate-50 p-4",children:[T("h1",{className:"text-center text-xl font-semibold",children:r}),T("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none",onClick:()=>o==null?void 0:o(!1),children:T(ze,{name:"XmarkLight",size:24})})]}),_e("div",{className:"flex flex-1 overflow-hidden",children:[T("div",{className:"flex flex-col gap-y-1 p-3 pt-6",children:f}),T("div",{className:"m-6 flex h-full flex-1 flex-col overflow-hidden rounded-lg border border-slate-50",children:typeof p=="function"?T(p,{}):p})]})]})}const xT="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function xG(t){const{body:e,header:n,onOpenChange:r,onContinue:i,cancelLabel:s,continueLabel:o,overlayProps:a,contentProps:c,...l}=t;return T(ho,{contentProps:{...c,className:St("rounded-3xl",c==null?void 0:c.className)},onOpenChange:r,overlayProps:{...a,className:a==null?void 0:a.className},...l,children:_e("div",{className:"w-[400px] p-6 text-slate-300",children:[T("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:n}),T("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:e}),_e("div",{className:"mt-8 flex justify-between gap-3",children:[T("button",{className:St(xT,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>r==null?void 0:r(!1),children:s}),T("button",{className:St(xT,"flex-1 bg-gray-800 text-gray-50"),onClick:i,children:o})]})]})})}function zo(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Fk={exports:{}};/*!
71
+
72
+ JSZip v3.10.1 - A JavaScript class for generating and reading zip files
73
+ <http://stuartk.com/jszip>
74
+
75
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
76
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
77
+
78
+ JSZip uses the library pako released under the MIT license :
79
+ https://github.com/nodeca/pako/blob/main/LICENSE
80
+ */(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(l,u){if(!i[l]){if(!r[l]){var d=typeof zo=="function"&&zo;if(!u&&d)return d(l,!0);if(a)return a(l,!0);var f=new Error("Cannot find module '"+l+"'");throw f.code="MODULE_NOT_FOUND",f}var p=i[l]={exports:{}};r[l][0].call(p.exports,function(m){var h=r[l][1][m];return o(h||m)},p,p.exports,n,r,i,s)}return i[l].exports}for(var a=typeof zo=="function"&&zo,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(n,r,i){var s=n("./utils"),o=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(c){for(var l,u,d,f,p,m,h,g=[],y=0,v=c.length,b=v,E=s.getTypeOf(c)!=="string";y<c.length;)b=v-y,d=E?(l=c[y++],u=y<v?c[y++]:0,y<v?c[y++]:0):(l=c.charCodeAt(y++),u=y<v?c.charCodeAt(y++):0,y<v?c.charCodeAt(y++):0),f=l>>2,p=(3&l)<<4|u>>4,m=1<b?(15&u)<<2|d>>6:64,h=2<b?63&d:64,g.push(a.charAt(f)+a.charAt(p)+a.charAt(m)+a.charAt(h));return g.join("")},i.decode=function(c){var l,u,d,f,p,m,h=0,g=0,y="data:";if(c.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");var v,b=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===a.charAt(64)&&b--,c.charAt(c.length-2)===a.charAt(64)&&b--,b%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=o.uint8array?new Uint8Array(0|b):new Array(0|b);h<c.length;)l=a.indexOf(c.charAt(h++))<<2|(f=a.indexOf(c.charAt(h++)))>>4,u=(15&f)<<4|(p=a.indexOf(c.charAt(h++)))>>2,d=(3&p)<<6|(m=a.indexOf(c.charAt(h++))),v[g++]=l,p!==64&&(v[g++]=u),m!==64&&(v[g++]=d);return v}},{"./support":30,"./utils":32}],2:[function(n,r,i){var s=n("./external"),o=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function l(u,d,f,p,m){this.compressedSize=u,this.uncompressedSize=d,this.crc32=f,this.compression=p,this.compressedContent=m}l.prototype={getContentWorker:function(){var u=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(u,d,f){return u.pipe(new a).pipe(new c("uncompressedSize")).pipe(d.compressWorker(f)).pipe(new c("compressedSize")).withStreamInfo("compression",d)},r.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var s=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var s=n("./utils"),o=function(){for(var a,c=[],l=0;l<256;l++){a=l;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;c[l]=a}return c}();r.exports=function(a,c){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(l,u,d,f){var p=o,m=f+d;l^=-1;for(var h=f;h<m;h++)l=l>>>8^p[255&(l^u[h])];return-1^l}(0|c,a,a.length,0):function(l,u,d,f){var p=o,m=f+d;l^=-1;for(var h=f;h<m;h++)l=l>>>8^p[255&(l^u.charCodeAt(h))];return-1^l}(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),l=s?"uint8array":"array";function u(d,f){c.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=f,this.meta={}}i.magic="\b\0",a.inherits(u,c),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(l,d.data),!1)},u.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(f){d.push({data:f,meta:d.meta})}},i.compressWorker=function(d){return new u("Deflate",d)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function s(p,m){var h,g="";for(h=0;h<m;h++)g+=String.fromCharCode(255&p),p>>>=8;return g}function o(p,m,h,g,y,v){var b,E,w=p.file,S=p.compression,_=v!==l.utf8encode,O=a.transformTo("string",v(w.name)),M=a.transformTo("string",l.utf8encode(w.name)),F=w.comment,q=a.transformTo("string",v(F)),I=a.transformTo("string",l.utf8encode(F)),$=M.length!==w.name.length,x=I.length!==F.length,A="",P="",B="",J=w.dir,L=w.date,G={crc32:0,compressedSize:0,uncompressedSize:0};m&&!h||(G.crc32=p.crc32,G.compressedSize=p.compressedSize,G.uncompressedSize=p.uncompressedSize);var U=0;m&&(U|=8),_||!$&&!x||(U|=2048);var C=0,Z=0;J&&(C|=16),y==="UNIX"?(Z=798,C|=function(V,ce){var le=V;return V||(le=ce?16893:33204),(65535&le)<<16}(w.unixPermissions,J)):(Z=20,C|=function(V){return 63&(V||0)}(w.dosPermissions)),b=L.getUTCHours(),b<<=6,b|=L.getUTCMinutes(),b<<=5,b|=L.getUTCSeconds()/2,E=L.getUTCFullYear()-1980,E<<=4,E|=L.getUTCMonth()+1,E<<=5,E|=L.getUTCDate(),$&&(P=s(1,1)+s(u(O),4)+M,A+="up"+s(P.length,2)+P),x&&(B=s(1,1)+s(u(q),4)+I,A+="uc"+s(B.length,2)+B);var H="";return H+=`
81
+ \0`,H+=s(U,2),H+=S.magic,H+=s(b,2),H+=s(E,2),H+=s(G.crc32,4),H+=s(G.compressedSize,4),H+=s(G.uncompressedSize,4),H+=s(O.length,2),H+=s(A.length,2),{fileRecord:d.LOCAL_FILE_HEADER+H+O+A,dirRecord:d.CENTRAL_FILE_HEADER+s(Z,2)+H+s(q.length,2)+"\0\0\0\0"+s(C,4)+s(g,4)+O+A+q}}var a=n("../utils"),c=n("../stream/GenericWorker"),l=n("../utf8"),u=n("../crc32"),d=n("../signature");function f(p,m,h,g){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=h,this.encodeFileName=g,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(f,c),f.prototype.push=function(p){var m=p.meta.percent||0,h=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,c.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:h?(m+100*(h-g-1))/h:100}}))},f.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var m=this.streamFiles&&!p.file.dir;if(m){var h=o(p,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(p){this.accumulate=!1;var m=this.streamFiles&&!p.file.dir,h=o(p,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),m)this.push({data:function(g){return d.DATA_DESCRIPTOR+s(g.crc32,4)+s(g.compressedSize,4)+s(g.uncompressedSize,4)}(p),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var p=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var h=this.bytesWritten-p,g=function(y,v,b,E,w){var S=a.transformTo("string",w(E));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(y,2)+s(y,2)+s(v,4)+s(b,4)+s(S.length,2)+S}(this.dirRecords.length,h,p,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(p){this._sources.push(p);var m=this;return p.on("data",function(h){m.processChunk(h)}),p.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),p.on("error",function(h){m.error(h)}),this},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(p){var m=this._sources;if(!c.prototype.error.call(this,p))return!1;for(var h=0;h<m.length;h++)try{m[h].error(p)}catch{}return!0},f.prototype.lock=function(){c.prototype.lock.call(this);for(var p=this._sources,m=0;m<p.length;m++)p[m].lock()},r.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var s=n("../compressions"),o=n("./ZipFileWorker");i.generateWorker=function(a,c,l){var u=new o(c.streamFiles,l,c.platform,c.encodeFileName),d=0;try{a.forEach(function(f,p){d++;var m=function(v,b){var E=v||b,w=s[E];if(!w)throw new Error(E+" is not a valid compression method !");return w}(p.options.compression,c.compression),h=p.options.compressionOptions||c.compressionOptions||{},g=p.dir,y=p.date;p._compressWorker(m,h).withStreamInfo("file",{name:f,dir:g,date:y,comment:p.comment||"",unixPermissions:p.unixPermissions,dosPermissions:p.dosPermissions}).pipe(u)}),u.entriesCount=d}catch(f){u.error(f)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new s;for(var a in this)typeof this[a]!="function"&&(o[a]=this[a]);return o}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(o,a){return new s().loadAsync(o,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var s=n("./utils"),o=n("./external"),a=n("./utf8"),c=n("./zipEntries"),l=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function d(f){return new o.Promise(function(p,m){var h=f.decompressed.getContentWorker().pipe(new l);h.on("error",function(g){m(g)}).on("end",function(){h.streamInfo.crc32!==f.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):p()}).resume()})}r.exports=function(f,p){var m=this;return p=s.extend(p||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(f)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",f,!0,p.optimizedBinaryString,p.base64).then(function(h){var g=new c(p);return g.load(h),g}).then(function(h){var g=[o.Promise.resolve(h)],y=h.files;if(p.checkCRC32)for(var v=0;v<y.length;v++)g.push(d(y[v]));return o.Promise.all(g)}).then(function(h){for(var g=h.shift(),y=g.files,v=0;v<y.length;v++){var b=y[v],E=b.fileNameStr,w=s.resolve(b.fileNameStr);m.file(w,b.decompressed,{binary:!0,optimizedBinaryString:!0,date:b.date,dir:b.dir,comment:b.fileCommentStr.length?b.fileCommentStr:null,unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions,createFolders:p.createFolders}),b.dir||(m.file(w).unsafeOriginalName=E)}return g.zipComment.length&&(m.comment=g.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var s=n("../utils"),o=n("../stream/GenericWorker");function a(c,l){o.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(l)}s.inherits(a,o),a.prototype._bindStream=function(c){var l=this;(this._stream=c).pause(),c.on("data",function(u){l.push({data:u,meta:{percent:0}})}).on("error",function(u){l.isPaused?this.generatedError=u:l.error(u)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},a.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var s=n("readable-stream").Readable;function o(a,c,l){s.call(this,c),this._helper=a;var u=this;a.on("data",function(d,f){u.push(d)||u._helper.pause(),l&&l(f)}).on("error",function(d){u.emit("error",d)}).on("end",function(){u.push(null)})}n("../utils").inherits(o,s),o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,o);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,o)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var o=new Buffer(s);return o.fill(0),o},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,i){function s(w,S,_){var O,M=a.getTypeOf(S),F=a.extend(_||{},u);F.date=F.date||new Date,F.compression!==null&&(F.compression=F.compression.toUpperCase()),typeof F.unixPermissions=="string"&&(F.unixPermissions=parseInt(F.unixPermissions,8)),F.unixPermissions&&16384&F.unixPermissions&&(F.dir=!0),F.dosPermissions&&16&F.dosPermissions&&(F.dir=!0),F.dir&&(w=y(w)),F.createFolders&&(O=g(w))&&v.call(this,O,!0);var q=M==="string"&&F.binary===!1&&F.base64===!1;_&&_.binary!==void 0||(F.binary=!q),(S instanceof d&&S.uncompressedSize===0||F.dir||!S||S.length===0)&&(F.base64=!1,F.binary=!0,S="",F.compression="STORE",M="string");var I=null;I=S instanceof d||S instanceof c?S:m.isNode&&m.isStream(S)?new h(w,S):a.prepareContent(w,S,F.binary,F.optimizedBinaryString,F.base64);var $=new f(w,I,F);this.files[w]=$}var o=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),l=n("./stream/StreamHelper"),u=n("./defaults"),d=n("./compressedObject"),f=n("./zipObject"),p=n("./generate"),m=n("./nodejsUtils"),h=n("./nodejs/NodejsStreamInputAdapter"),g=function(w){w.slice(-1)==="/"&&(w=w.substring(0,w.length-1));var S=w.lastIndexOf("/");return 0<S?w.substring(0,S):""},y=function(w){return w.slice(-1)!=="/"&&(w+="/"),w},v=function(w,S){return S=S!==void 0?S:u.createFolders,w=y(w),this.files[w]||s.call(this,w,null,{dir:!0,createFolders:S}),this.files[w]};function b(w){return Object.prototype.toString.call(w)==="[object RegExp]"}var E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(w){var S,_,O;for(S in this.files)O=this.files[S],(_=S.slice(this.root.length,S.length))&&S.slice(0,this.root.length)===this.root&&w(_,O)},filter:function(w){var S=[];return this.forEach(function(_,O){w(_,O)&&S.push(O)}),S},file:function(w,S,_){if(arguments.length!==1)return w=this.root+w,s.call(this,w,S,_),this;if(b(w)){var O=w;return this.filter(function(F,q){return!q.dir&&O.test(F)})}var M=this.files[this.root+w];return M&&!M.dir?M:null},folder:function(w){if(!w)return this;if(b(w))return this.filter(function(M,F){return F.dir&&w.test(M)});var S=this.root+w,_=v.call(this,S),O=this.clone();return O.root=_.name,O},remove:function(w){w=this.root+w;var S=this.files[w];if(S||(w.slice(-1)!=="/"&&(w+="/"),S=this.files[w]),S&&!S.dir)delete this.files[w];else for(var _=this.filter(function(M,F){return F.name.slice(0,w.length)===w}),O=0;O<_.length;O++)delete this.files[_[O].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(w){var S,_={};try{if((_=a.extend(w||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=_.type.toLowerCase(),_.compression=_.compression.toUpperCase(),_.type==="binarystring"&&(_.type="string"),!_.type)throw new Error("No output type specified.");a.checkSupport(_.type),_.platform!=="darwin"&&_.platform!=="freebsd"&&_.platform!=="linux"&&_.platform!=="sunos"||(_.platform="UNIX"),_.platform==="win32"&&(_.platform="DOS");var O=_.comment||this.comment||"";S=p.generateWorker(this,_,O)}catch(M){(S=new c("error")).error(M)}return new l(S,_.type||"string",_.mimeType)},generateAsync:function(w,S){return this.generateInternalStream(w).accumulate(S)},generateNodeStream:function(w,S){return(w=w||{}).type||(w.type="nodebuffer"),this.generateInternalStream(w).toNodejsStream(S)}};r.exports=E},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data[this.zero+a]},o.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),l=a.charCodeAt(1),u=a.charCodeAt(2),d=a.charCodeAt(3),f=this.length-4;0<=f;--f)if(this.data[f]===c&&this.data[f+1]===l&&this.data[f+2]===u&&this.data[f+3]===d)return f-this.zero;return-1},o.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),l=a.charCodeAt(1),u=a.charCodeAt(2),d=a.charCodeAt(3),f=this.readData(4);return c===f[0]&&l===f[1]&&u===f[2]&&d===f[3]},o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var s=n("../utils");function o(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,l=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)l=(l<<8)+this.byteAt(c);return this.index+=a,l},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=o},{"../utils":32}],19:[function(n,r,i){var s=n("./Uint8ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var s=n("./ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var s=n("../utils"),o=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),l=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(d){var f=s.getTypeOf(d);return s.checkSupport(f),f!=="string"||o.uint8array?f==="nodebuffer"?new l(d):o.uint8array?new u(s.transformTo("uint8array",d)):new a(s.transformTo("array",d)):new c(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var s=n("./GenericWorker"),o=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var s=n("./GenericWorker"),o=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,o),a.prototype.processChunk=function(c){if(c){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+c.data.length}o.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(u){l.dataIsReady=!0,l.data=u,l.max=u&&u.length||0,l.type=s.getTypeOf(u),l.isPaused||l._tickAndRepeat()},function(u){l.error(u)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,l);break;case"uint8array":c=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":c=this.data.slice(this.index,l)}return this.index=l,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var c=0;c<this._listeners[o].length;c++)this._listeners[o][c].call(this,a)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var a=this;return o.on("data",function(c){a.processChunk(c)}),o.on("end",function(){a.end()}),o.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,a){return this.extraStreamInfo[o]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=s},{}],29:[function(n,r,i){var s=n("../utils"),o=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),l=n("../support"),u=n("../external"),d=null;if(l.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function f(m,h){return new u.Promise(function(g,y){var v=[],b=m._internalType,E=m._outputType,w=m._mimeType;m.on("data",function(S,_){v.push(S),h&&h(_)}).on("error",function(S){v=[],y(S)}).on("end",function(){try{var S=function(_,O,M){switch(_){case"blob":return s.newBlob(s.transformTo("arraybuffer",O),M);case"base64":return c.encode(O);default:return s.transformTo(_,O)}}(E,function(_,O){var M,F=0,q=null,I=0;for(M=0;M<O.length;M++)I+=O[M].length;switch(_){case"string":return O.join("");case"array":return Array.prototype.concat.apply([],O);case"uint8array":for(q=new Uint8Array(I),M=0;M<O.length;M++)q.set(O[M],F),F+=O[M].length;return q;case"nodebuffer":return Buffer.concat(O);default:throw new Error("concat : unsupported type '"+_+"'")}}(b,v),w);g(S)}catch(_){y(_)}v=[]}).resume()})}function p(m,h,g){var y=h;switch(h){case"blob":case"arraybuffer":y="uint8array";break;case"base64":y="string"}try{this._internalType=y,this._outputType=h,this._mimeType=g,s.checkSupport(y),this._worker=m.pipe(new o(y)),m.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}p.prototype={accumulate:function(m){return f(this,m)},on:function(m,h){var g=this;return m==="data"?this._worker.on(m,function(y){h.call(g,y.data,y.meta)}):this._worker.on(m,function(){s.delay(h,arguments,g)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},m)}},r.exports=p},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var s=n("./utils"),o=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),l=new Array(256),u=0;u<256;u++)l[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;l[254]=l[254]=1;function d(){c.call(this,"utf-8 decode"),this.leftOver=null}function f(){c.call(this,"utf-8 encode")}i.utf8encode=function(p){return o.nodebuffer?a.newBufferFrom(p,"utf-8"):function(m){var h,g,y,v,b,E=m.length,w=0;for(v=0;v<E;v++)(64512&(g=m.charCodeAt(v)))==55296&&v+1<E&&(64512&(y=m.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),w+=g<128?1:g<2048?2:g<65536?3:4;for(h=o.uint8array?new Uint8Array(w):new Array(w),v=b=0;b<w;v++)(64512&(g=m.charCodeAt(v)))==55296&&v+1<E&&(64512&(y=m.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(y-56320),v++),g<128?h[b++]=g:(g<2048?h[b++]=192|g>>>6:(g<65536?h[b++]=224|g>>>12:(h[b++]=240|g>>>18,h[b++]=128|g>>>12&63),h[b++]=128|g>>>6&63),h[b++]=128|63&g);return h}(p)},i.utf8decode=function(p){return o.nodebuffer?s.transformTo("nodebuffer",p).toString("utf-8"):function(m){var h,g,y,v,b=m.length,E=new Array(2*b);for(h=g=0;h<b;)if((y=m[h++])<128)E[g++]=y;else if(4<(v=l[y]))E[g++]=65533,h+=v-1;else{for(y&=v===2?31:v===3?15:7;1<v&&h<b;)y=y<<6|63&m[h++],v--;1<v?E[g++]=65533:y<65536?E[g++]=y:(y-=65536,E[g++]=55296|y>>10&1023,E[g++]=56320|1023&y)}return E.length!==g&&(E.subarray?E=E.subarray(0,g):E.length=g),s.applyFromCharCode(E)}(p=s.transformTo(o.uint8array?"uint8array":"array",p))},s.inherits(d,c),d.prototype.processChunk=function(p){var m=s.transformTo(o.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var h=m;(m=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),m.set(h,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var g=function(v,b){var E;for((b=b||v.length)>v.length&&(b=v.length),E=b-1;0<=E&&(192&v[E])==128;)E--;return E<0||E===0?b:E+l[v[E]]>b?E:b}(m),y=m;g!==m.length&&(o.uint8array?(y=m.subarray(0,g),this.leftOver=m.subarray(g,m.length)):(y=m.slice(0,g),this.leftOver=m.slice(g,m.length))),this.push({data:i.utf8decode(y),meta:p.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,s.inherits(f,c),f.prototype.processChunk=function(p){this.push({data:i.utf8encode(p.data),meta:p.meta})},i.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var s=n("./support"),o=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function l(h){return h}function u(h,g){for(var y=0;y<h.length;++y)g[y]=255&h.charCodeAt(y);return g}n("setimmediate"),i.newBlob=function(h,g){i.checkSupport("blob");try{return new Blob([h],{type:g})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(h),y.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(h,g,y){var v=[],b=0,E=h.length;if(E<=y)return String.fromCharCode.apply(null,h);for(;b<E;)g==="array"||g==="nodebuffer"?v.push(String.fromCharCode.apply(null,h.slice(b,Math.min(b+y,E)))):v.push(String.fromCharCode.apply(null,h.subarray(b,Math.min(b+y,E)))),b+=y;return v.join("")},stringifyByChar:function(h){for(var g="",y=0;y<h.length;y++)g+=String.fromCharCode(h[y]);return g},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function f(h){var g=65536,y=i.getTypeOf(h),v=!0;if(y==="uint8array"?v=d.applyCanBeUsed.uint8array:y==="nodebuffer"&&(v=d.applyCanBeUsed.nodebuffer),v)for(;1<g;)try{return d.stringifyByChunk(h,y,g)}catch{g=Math.floor(g/2)}return d.stringifyByChar(h)}function p(h,g){for(var y=0;y<h.length;y++)g[y]=h[y];return g}i.applyFromCharCode=f;var m={};m.string={string:l,array:function(h){return u(h,new Array(h.length))},arraybuffer:function(h){return m.string.uint8array(h).buffer},uint8array:function(h){return u(h,new Uint8Array(h.length))},nodebuffer:function(h){return u(h,a.allocBuffer(h.length))}},m.array={string:f,array:l,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(h)}},m.arraybuffer={string:function(h){return f(new Uint8Array(h))},array:function(h){return p(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:l,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return a.newBufferFrom(new Uint8Array(h))}},m.uint8array={string:f,array:function(h){return p(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:l,nodebuffer:function(h){return a.newBufferFrom(h)}},m.nodebuffer={string:f,array:function(h){return p(h,new Array(h.length))},arraybuffer:function(h){return m.nodebuffer.uint8array(h).buffer},uint8array:function(h){return p(h,new Uint8Array(h.length))},nodebuffer:l},i.transformTo=function(h,g){if(g=g||"",!h)return g;i.checkSupport(h);var y=i.getTypeOf(g);return m[y][h](g)},i.resolve=function(h){for(var g=h.split("/"),y=[],v=0;v<g.length;v++){var b=g[v];b==="."||b===""&&v!==0&&v!==g.length-1||(b===".."?y.pop():y.push(b))}return y.join("/")},i.getTypeOf=function(h){return typeof h=="string"?"string":Object.prototype.toString.call(h)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(h)?"nodebuffer":s.uint8array&&h instanceof Uint8Array?"uint8array":s.arraybuffer&&h instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(h){if(!s[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(h){var g,y,v="";for(y=0;y<(h||"").length;y++)v+="\\x"+((g=h.charCodeAt(y))<16?"0":"")+g.toString(16).toUpperCase();return v},i.delay=function(h,g,y){setImmediate(function(){h.apply(y||null,g||[])})},i.inherits=function(h,g){function y(){}y.prototype=g.prototype,h.prototype=new y},i.extend=function(){var h,g,y={};for(h=0;h<arguments.length;h++)for(g in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],g)&&y[g]===void 0&&(y[g]=arguments[h][g]);return y},i.prepareContent=function(h,g,y,v,b){return c.Promise.resolve(g).then(function(E){return s.blob&&(E instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(E))!==-1)&&typeof FileReader<"u"?new c.Promise(function(w,S){var _=new FileReader;_.onload=function(O){w(O.target.result)},_.onerror=function(O){S(O.target.error)},_.readAsArrayBuffer(E)}):E}).then(function(E){var w=i.getTypeOf(E);return w?(w==="arraybuffer"?E=i.transformTo("uint8array",E):w==="string"&&(b?E=o.decode(E):y&&v!==!0&&(E=function(S){return u(S,s.uint8array?new Uint8Array(S.length):new Array(S.length))}(E))),E):c.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,i){var s=n("./reader/readerFor"),o=n("./utils"),a=n("./signature"),c=n("./zipEntry"),l=n("./support");function u(d){this.files=[],this.loadOptions=d}u.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var f=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(f)+", expected "+o.pretty(d)+")")}},isSignature:function(d,f){var p=this.reader.index;this.reader.setIndex(d);var m=this.reader.readString(4)===f;return this.reader.setIndex(p),m},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),f=l.uint8array?"uint8array":"array",p=o.transformTo(f,d);this.zipComment=this.loadOptions.decodeFileName(p)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,f,p,m=this.zip64EndOfCentralSize-44;0<m;)d=this.reader.readInt(2),f=this.reader.readInt(4),p=this.reader.readData(f),this.zip64ExtensibleData[d]={id:d,length:f,value:p}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,f;for(d=0;d<this.files.length;d++)f=this.files[d],this.reader.setIndex(f.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),f.readLocalPart(this.reader),f.handleUTF8(),f.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var f=d;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var p=this.centralDirOffset+this.centralDirSize;this.zip64&&(p+=20,p+=12+this.zip64EndOfCentralSize);var m=f-p;if(0<m)this.isSignature(f,a.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(d){this.reader=s(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,i){var s=n("./reader/readerFor"),o=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),l=n("./utf8"),u=n("./compressions"),d=n("./support");function f(p,m){this.options=p,this.loadOptions=m}f.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(p){var m,h;if(p.skip(22),this.fileNameLength=p.readInt(2),h=p.readInt(2),this.fileName=p.readData(this.fileNameLength),p.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((m=function(g){for(var y in u)if(Object.prototype.hasOwnProperty.call(u,y)&&u[y].magic===g)return u[y];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,m,p.readData(this.compressedSize))},readCentralPart:function(p){this.versionMadeBy=p.readInt(2),p.skip(2),this.bitFlag=p.readInt(2),this.compressionMethod=p.readString(2),this.date=p.readDate(),this.crc32=p.readInt(4),this.compressedSize=p.readInt(4),this.uncompressedSize=p.readInt(4);var m=p.readInt(2);if(this.extraFieldsLength=p.readInt(2),this.fileCommentLength=p.readInt(2),this.diskNumberStart=p.readInt(2),this.internalFileAttributes=p.readInt(2),this.externalFileAttributes=p.readInt(4),this.localHeaderOffset=p.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");p.skip(m),this.readExtraFields(p),this.parseZIP64ExtraField(p),this.fileComment=p.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var p=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var m,h,g,y=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4<y;)m=p.readInt(2),h=p.readInt(2),g=p.readData(h),this.extraFields[m]={id:m,length:h,value:g};p.setIndex(y)},handleUTF8:function(){var p=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var h=o.transformTo(p,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var y=o.transformTo(p,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(y)}}},findExtraFieldUnicodePath:function(){var p=this.extraFields[28789];if(p){var m=s(p.value);return m.readInt(1)!==1||c(this.fileName)!==m.readInt(4)?null:l.utf8decode(m.readData(p.length-5))}return null},findExtraFieldUnicodeComment:function(){var p=this.extraFields[25461];if(p){var m=s(p.value);return m.readInt(1)!==1||c(this.fileComment)!==m.readInt(4)?null:l.utf8decode(m.readData(p.length-5))}return null}},r.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function s(m,h,g){this.name=m,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=h,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var o=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),l=n("./compressedObject"),u=n("./stream/GenericWorker");s.prototype={internalStream:function(m){var h=null,g="string";try{if(!m)throw new Error("No output type specified.");var y=(g=m.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),h=this._decompressWorker();var v=!this._dataBinary;v&&!y&&(h=h.pipe(new c.Utf8EncodeWorker)),!v&&y&&(h=h.pipe(new c.Utf8DecodeWorker))}catch(b){(h=new u("error")).error(b)}return new o(h,g,"")},async:function(m,h){return this.internalStream(m).accumulate(h)},nodeStream:function(m,h){return this.internalStream(m||"nodebuffer").toNodejsStream(h)},_compressWorker:function(m,h){if(this._data instanceof l&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new c.Utf8EncodeWorker)),l.createWorkerFrom(g,m,h)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},p=0;p<d.length;p++)s.prototype[d[p]]=f;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(s){var o,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var l=0,u=new c(m),d=s.document.createTextNode("");u.observe(d,{characterData:!0}),o=function(){d.data=l=++l%2}}else if(s.setImmediate||s.MessageChannel===void 0)o="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var h=s.document.createElement("script");h.onreadystatechange=function(){m(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},s.document.documentElement.appendChild(h)}:function(){setTimeout(m,0)};else{var f=new s.MessageChannel;f.port1.onmessage=m,o=function(){f.port2.postMessage(0)}}var p=[];function m(){var h,g;a=!0;for(var y=p.length;y;){for(g=p,p=[],h=-1;++h<y;)g[h]();y=p.length}a=!1}r.exports=function(h){p.push(h)!==1||a||o()}}).call(this,typeof dr<"u"?dr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var s=n("immediate");function o(){}var a={},c=["REJECTED"],l=["FULFILLED"],u=["PENDING"];function d(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,y!==o&&h(this,y)}function f(y,v,b){this.promise=y,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof b=="function"&&(this.onRejected=b,this.callRejected=this.otherCallRejected)}function p(y,v,b){s(function(){var E;try{E=v(b)}catch(w){return a.reject(y,w)}E===y?a.reject(y,new TypeError("Cannot resolve promise with itself")):a.resolve(y,E)})}function m(y){var v=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof v=="function")return function(){v.apply(y,arguments)}}function h(y,v){var b=!1;function E(_){b||(b=!0,a.reject(y,_))}function w(_){b||(b=!0,a.resolve(y,_))}var S=g(function(){v(w,E)});S.status==="error"&&E(S.value)}function g(y,v){var b={};try{b.value=y(v),b.status="success"}catch(E){b.status="error",b.value=E}return b}(r.exports=d).prototype.finally=function(y){if(typeof y!="function")return this;var v=this.constructor;return this.then(function(b){return v.resolve(y()).then(function(){return b})},function(b){return v.resolve(y()).then(function(){throw b})})},d.prototype.catch=function(y){return this.then(null,y)},d.prototype.then=function(y,v){if(typeof y!="function"&&this.state===l||typeof v!="function"&&this.state===c)return this;var b=new this.constructor(o);return this.state!==u?p(b,this.state===l?y:v,this.outcome):this.queue.push(new f(b,y,v)),b},f.prototype.callFulfilled=function(y){a.resolve(this.promise,y)},f.prototype.otherCallFulfilled=function(y){p(this.promise,this.onFulfilled,y)},f.prototype.callRejected=function(y){a.reject(this.promise,y)},f.prototype.otherCallRejected=function(y){p(this.promise,this.onRejected,y)},a.resolve=function(y,v){var b=g(m,v);if(b.status==="error")return a.reject(y,b.value);var E=b.value;if(E)h(y,E);else{y.state=l,y.outcome=v;for(var w=-1,S=y.queue.length;++w<S;)y.queue[w].callFulfilled(v)}return y},a.reject=function(y,v){y.state=c,y.outcome=v;for(var b=-1,E=y.queue.length;++b<E;)y.queue[b].callRejected(v);return y},d.resolve=function(y){return y instanceof this?y:a.resolve(new this(o),y)},d.reject=function(y){var v=new this(o);return a.reject(v,y)},d.all=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=y.length,E=!1;if(!b)return this.resolve([]);for(var w=new Array(b),S=0,_=-1,O=new this(o);++_<b;)M(y[_],_);return O;function M(F,q){v.resolve(F).then(function(I){w[q]=I,++S!==b||E||(E=!0,a.resolve(O,w))},function(I){E||(E=!0,a.reject(O,I))})}},d.race=function(y){var v=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=y.length,E=!1;if(!b)return this.resolve([]);for(var w=-1,S=new this(o);++w<b;)_=y[w],v.resolve(_).then(function(O){E||(E=!0,a.resolve(S,O))},function(O){E||(E=!0,a.reject(S,O))});var _;return S}},{immediate:36}],38:[function(n,r,i){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var s=n("./zlib/deflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),l=n("./zlib/zstream"),u=Object.prototype.toString,d=0,f=-1,p=0,m=8;function h(y){if(!(this instanceof h))return new h(y);this.options=o.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},y||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var b=s.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(b!==d)throw new Error(c[b]);if(v.header&&s.deflateSetHeader(this.strm,v.header),v.dictionary){var E;if(E=typeof v.dictionary=="string"?a.string2buf(v.dictionary):u.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(b=s.deflateSetDictionary(this.strm,E))!==d)throw new Error(c[b]);this._dict_set=!0}}function g(y,v){var b=new h(v);if(b.push(y,!0),b.err)throw b.msg||c[b.err];return b.result}h.prototype.push=function(y,v){var b,E,w=this.strm,S=this.options.chunkSize;if(this.ended)return!1;E=v===~~v?v:v===!0?4:0,typeof y=="string"?w.input=a.string2buf(y):u.call(y)==="[object ArrayBuffer]"?w.input=new Uint8Array(y):w.input=y,w.next_in=0,w.avail_in=w.input.length;do{if(w.avail_out===0&&(w.output=new o.Buf8(S),w.next_out=0,w.avail_out=S),(b=s.deflate(w,E))!==1&&b!==d)return this.onEnd(b),!(this.ended=!0);w.avail_out!==0&&(w.avail_in!==0||E!==4&&E!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(o.shrinkBuf(w.output,w.next_out))):this.onData(o.shrinkBuf(w.output,w.next_out)))}while((0<w.avail_in||w.avail_out===0)&&b!==1);return E===4?(b=s.deflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===d):E!==2||(this.onEnd(d),!(w.avail_out=0))},h.prototype.onData=function(y){this.chunks.push(y)},h.prototype.onEnd=function(y){y===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},i.Deflate=h,i.deflate=g,i.deflateRaw=function(y,v){return(v=v||{}).raw=!0,g(y,v)},i.gzip=function(y,v){return(v=v||{}).gzip=!0,g(y,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,i){var s=n("./zlib/inflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),l=n("./zlib/messages"),u=n("./zlib/zstream"),d=n("./zlib/gzheader"),f=Object.prototype.toString;function p(h){if(!(this instanceof p))return new p(h);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},h||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||h&&h.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&!(15&g.windowBits)&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var y=s.inflateInit2(this.strm,g.windowBits);if(y!==c.Z_OK)throw new Error(l[y]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function m(h,g){var y=new p(g);if(y.push(h,!0),y.err)throw y.msg||l[y.err];return y.result}p.prototype.push=function(h,g){var y,v,b,E,w,S,_=this.strm,O=this.options.chunkSize,M=this.options.dictionary,F=!1;if(this.ended)return!1;v=g===~~g?g:g===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof h=="string"?_.input=a.binstring2buf(h):f.call(h)==="[object ArrayBuffer]"?_.input=new Uint8Array(h):_.input=h,_.next_in=0,_.avail_in=_.input.length;do{if(_.avail_out===0&&(_.output=new o.Buf8(O),_.next_out=0,_.avail_out=O),(y=s.inflate(_,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&M&&(S=typeof M=="string"?a.string2buf(M):f.call(M)==="[object ArrayBuffer]"?new Uint8Array(M):M,y=s.inflateSetDictionary(this.strm,S)),y===c.Z_BUF_ERROR&&F===!0&&(y=c.Z_OK,F=!1),y!==c.Z_STREAM_END&&y!==c.Z_OK)return this.onEnd(y),!(this.ended=!0);_.next_out&&(_.avail_out!==0&&y!==c.Z_STREAM_END&&(_.avail_in!==0||v!==c.Z_FINISH&&v!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(b=a.utf8border(_.output,_.next_out),E=_.next_out-b,w=a.buf2string(_.output,b),_.next_out=E,_.avail_out=O-E,E&&o.arraySet(_.output,_.output,b,E,0),this.onData(w)):this.onData(o.shrinkBuf(_.output,_.next_out)))),_.avail_in===0&&_.avail_out===0&&(F=!0)}while((0<_.avail_in||_.avail_out===0)&&y!==c.Z_STREAM_END);return y===c.Z_STREAM_END&&(v=c.Z_FINISH),v===c.Z_FINISH?(y=s.inflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===c.Z_OK):v!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(_.avail_out=0))},p.prototype.onData=function(h){this.chunks.push(h)},p.prototype.onEnd=function(h){h===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},i.Inflate=p,i.inflate=m,i.inflateRaw=function(h,g){return(g=g||{}).raw=!0,m(h,g)},i.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(c){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var u=l.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var d in u)u.hasOwnProperty(d)&&(c[d]=u[d])}}return c},i.shrinkBuf=function(c,l){return c.length===l?c:c.subarray?c.subarray(0,l):(c.length=l,c)};var o={arraySet:function(c,l,u,d,f){if(l.subarray&&c.subarray)c.set(l.subarray(u,u+d),f);else for(var p=0;p<d;p++)c[f+p]=l[u+p]},flattenChunks:function(c){var l,u,d,f,p,m;for(l=d=0,u=c.length;l<u;l++)d+=c[l].length;for(m=new Uint8Array(d),l=f=0,u=c.length;l<u;l++)p=c[l],m.set(p,f),f+=p.length;return m}},a={arraySet:function(c,l,u,d,f){for(var p=0;p<d;p++)c[f+p]=l[u+p]},flattenChunks:function(c){return[].concat.apply([],c)}};i.setTyped=function(c){c?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(s)},{}],42:[function(n,r,i){var s=n("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),l=0;l<256;l++)c[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function u(d,f){if(f<65537&&(d.subarray&&a||!d.subarray&&o))return String.fromCharCode.apply(null,s.shrinkBuf(d,f));for(var p="",m=0;m<f;m++)p+=String.fromCharCode(d[m]);return p}c[254]=c[254]=1,i.string2buf=function(d){var f,p,m,h,g,y=d.length,v=0;for(h=0;h<y;h++)(64512&(p=d.charCodeAt(h)))==55296&&h+1<y&&(64512&(m=d.charCodeAt(h+1)))==56320&&(p=65536+(p-55296<<10)+(m-56320),h++),v+=p<128?1:p<2048?2:p<65536?3:4;for(f=new s.Buf8(v),h=g=0;g<v;h++)(64512&(p=d.charCodeAt(h)))==55296&&h+1<y&&(64512&(m=d.charCodeAt(h+1)))==56320&&(p=65536+(p-55296<<10)+(m-56320),h++),p<128?f[g++]=p:(p<2048?f[g++]=192|p>>>6:(p<65536?f[g++]=224|p>>>12:(f[g++]=240|p>>>18,f[g++]=128|p>>>12&63),f[g++]=128|p>>>6&63),f[g++]=128|63&p);return f},i.buf2binstring=function(d){return u(d,d.length)},i.binstring2buf=function(d){for(var f=new s.Buf8(d.length),p=0,m=f.length;p<m;p++)f[p]=d.charCodeAt(p);return f},i.buf2string=function(d,f){var p,m,h,g,y=f||d.length,v=new Array(2*y);for(p=m=0;p<y;)if((h=d[p++])<128)v[m++]=h;else if(4<(g=c[h]))v[m++]=65533,p+=g-1;else{for(h&=g===2?31:g===3?15:7;1<g&&p<y;)h=h<<6|63&d[p++],g--;1<g?v[m++]=65533:h<65536?v[m++]=h:(h-=65536,v[m++]=55296|h>>10&1023,v[m++]=56320|1023&h)}return u(v,m)},i.utf8border=function(d,f){var p;for((f=f||d.length)>d.length&&(f=d.length),p=f-1;0<=p&&(192&d[p])==128;)p--;return p<0||p===0?f:p+c[d[p]]>f?p:f}},{"./common":41}],43:[function(n,r,i){r.exports=function(s,o,a,c){for(var l=65535&s|0,u=s>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;u=u+(l=l+o[c++]|0)|0,--d;);l%=65521,u%=65521}return l|u<<16|0}},{}],44:[function(n,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,i){var s=function(){for(var o,a=[],c=0;c<256;c++){o=c;for(var l=0;l<8;l++)o=1&o?3988292384^o>>>1:o>>>1;a[c]=o}return a}();r.exports=function(o,a,c,l){var u=s,d=l+c;o^=-1;for(var f=l;f<d;f++)o=o>>>8^u[255&(o^a[f])];return-1^o}},{}],46:[function(n,r,i){var s,o=n("../utils/common"),a=n("./trees"),c=n("./adler32"),l=n("./crc32"),u=n("./messages"),d=0,f=4,p=0,m=-2,h=-1,g=4,y=2,v=8,b=9,E=286,w=30,S=19,_=2*E+1,O=15,M=3,F=258,q=F+M+1,I=42,$=113,x=1,A=2,P=3,B=4;function J(D,me){return D.msg=u[me],me}function L(D){return(D<<1)-(4<D?9:0)}function G(D){for(var me=D.length;0<=--me;)D[me]=0}function U(D){var me=D.state,ue=me.pending;ue>D.avail_out&&(ue=D.avail_out),ue!==0&&(o.arraySet(D.output,me.pending_buf,me.pending_out,ue,D.next_out),D.next_out+=ue,me.pending_out+=ue,D.total_out+=ue,D.avail_out-=ue,me.pending-=ue,me.pending===0&&(me.pending_out=0))}function C(D,me){a._tr_flush_block(D,0<=D.block_start?D.block_start:-1,D.strstart-D.block_start,me),D.block_start=D.strstart,U(D.strm)}function Z(D,me){D.pending_buf[D.pending++]=me}function H(D,me){D.pending_buf[D.pending++]=me>>>8&255,D.pending_buf[D.pending++]=255&me}function V(D,me){var ue,K,R=D.max_chain_length,N=D.strstart,z=D.prev_length,X=D.nice_match,Y=D.strstart>D.w_size-q?D.strstart-(D.w_size-q):0,ee=D.window,pe=D.w_mask,he=D.prev,Pe=D.strstart+F,nt=ee[N+z-1],Ze=ee[N+z];D.prev_length>=D.good_match&&(R>>=2),X>D.lookahead&&(X=D.lookahead);do if(ee[(ue=me)+z]===Ze&&ee[ue+z-1]===nt&&ee[ue]===ee[N]&&ee[++ue]===ee[N+1]){N+=2,ue++;do;while(ee[++N]===ee[++ue]&&ee[++N]===ee[++ue]&&ee[++N]===ee[++ue]&&ee[++N]===ee[++ue]&&ee[++N]===ee[++ue]&&ee[++N]===ee[++ue]&&ee[++N]===ee[++ue]&&ee[++N]===ee[++ue]&&N<Pe);if(K=F-(Pe-N),N=Pe-F,z<K){if(D.match_start=me,X<=(z=K))break;nt=ee[N+z-1],Ze=ee[N+z]}}while((me=he[me&pe])>Y&&--R!=0);return z<=D.lookahead?z:D.lookahead}function ce(D){var me,ue,K,R,N,z,X,Y,ee,pe,he=D.w_size;do{if(R=D.window_size-D.lookahead-D.strstart,D.strstart>=he+(he-q)){for(o.arraySet(D.window,D.window,he,he,0),D.match_start-=he,D.strstart-=he,D.block_start-=he,me=ue=D.hash_size;K=D.head[--me],D.head[me]=he<=K?K-he:0,--ue;);for(me=ue=he;K=D.prev[--me],D.prev[me]=he<=K?K-he:0,--ue;);R+=he}if(D.strm.avail_in===0)break;if(z=D.strm,X=D.window,Y=D.strstart+D.lookahead,ee=R,pe=void 0,pe=z.avail_in,ee<pe&&(pe=ee),ue=pe===0?0:(z.avail_in-=pe,o.arraySet(X,z.input,z.next_in,pe,Y),z.state.wrap===1?z.adler=c(z.adler,X,pe,Y):z.state.wrap===2&&(z.adler=l(z.adler,X,pe,Y)),z.next_in+=pe,z.total_in+=pe,pe),D.lookahead+=ue,D.lookahead+D.insert>=M)for(N=D.strstart-D.insert,D.ins_h=D.window[N],D.ins_h=(D.ins_h<<D.hash_shift^D.window[N+1])&D.hash_mask;D.insert&&(D.ins_h=(D.ins_h<<D.hash_shift^D.window[N+M-1])&D.hash_mask,D.prev[N&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=N,N++,D.insert--,!(D.lookahead+D.insert<M)););}while(D.lookahead<q&&D.strm.avail_in!==0)}function le(D,me){for(var ue,K;;){if(D.lookahead<q){if(ce(D),D.lookahead<q&&me===d)return x;if(D.lookahead===0)break}if(ue=0,D.lookahead>=M&&(D.ins_h=(D.ins_h<<D.hash_shift^D.window[D.strstart+M-1])&D.hash_mask,ue=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart),ue!==0&&D.strstart-ue<=D.w_size-q&&(D.match_length=V(D,ue)),D.match_length>=M)if(K=a._tr_tally(D,D.strstart-D.match_start,D.match_length-M),D.lookahead-=D.match_length,D.match_length<=D.max_lazy_match&&D.lookahead>=M){for(D.match_length--;D.strstart++,D.ins_h=(D.ins_h<<D.hash_shift^D.window[D.strstart+M-1])&D.hash_mask,ue=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart,--D.match_length!=0;);D.strstart++}else D.strstart+=D.match_length,D.match_length=0,D.ins_h=D.window[D.strstart],D.ins_h=(D.ins_h<<D.hash_shift^D.window[D.strstart+1])&D.hash_mask;else K=a._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++;if(K&&(C(D,!1),D.strm.avail_out===0))return x}return D.insert=D.strstart<M-1?D.strstart:M-1,me===f?(C(D,!0),D.strm.avail_out===0?P:B):D.last_lit&&(C(D,!1),D.strm.avail_out===0)?x:A}function ge(D,me){for(var ue,K,R;;){if(D.lookahead<q){if(ce(D),D.lookahead<q&&me===d)return x;if(D.lookahead===0)break}if(ue=0,D.lookahead>=M&&(D.ins_h=(D.ins_h<<D.hash_shift^D.window[D.strstart+M-1])&D.hash_mask,ue=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart),D.prev_length=D.match_length,D.prev_match=D.match_start,D.match_length=M-1,ue!==0&&D.prev_length<D.max_lazy_match&&D.strstart-ue<=D.w_size-q&&(D.match_length=V(D,ue),D.match_length<=5&&(D.strategy===1||D.match_length===M&&4096<D.strstart-D.match_start)&&(D.match_length=M-1)),D.prev_length>=M&&D.match_length<=D.prev_length){for(R=D.strstart+D.lookahead-M,K=a._tr_tally(D,D.strstart-1-D.prev_match,D.prev_length-M),D.lookahead-=D.prev_length-1,D.prev_length-=2;++D.strstart<=R&&(D.ins_h=(D.ins_h<<D.hash_shift^D.window[D.strstart+M-1])&D.hash_mask,ue=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart),--D.prev_length!=0;);if(D.match_available=0,D.match_length=M-1,D.strstart++,K&&(C(D,!1),D.strm.avail_out===0))return x}else if(D.match_available){if((K=a._tr_tally(D,0,D.window[D.strstart-1]))&&C(D,!1),D.strstart++,D.lookahead--,D.strm.avail_out===0)return x}else D.match_available=1,D.strstart++,D.lookahead--}return D.match_available&&(K=a._tr_tally(D,0,D.window[D.strstart-1]),D.match_available=0),D.insert=D.strstart<M-1?D.strstart:M-1,me===f?(C(D,!0),D.strm.avail_out===0?P:B):D.last_lit&&(C(D,!1),D.strm.avail_out===0)?x:A}function Re(D,me,ue,K,R){this.good_length=D,this.max_lazy=me,this.nice_length=ue,this.max_chain=K,this.func=R}function Ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*_),this.dyn_dtree=new o.Buf16(2*(2*w+1)),this.bl_tree=new o.Buf16(2*(2*S+1)),G(this.dyn_ltree),G(this.dyn_dtree),G(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(O+1),this.heap=new o.Buf16(2*E+1),G(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*E+1),G(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function st(D){var me;return D&&D.state?(D.total_in=D.total_out=0,D.data_type=y,(me=D.state).pending=0,me.pending_out=0,me.wrap<0&&(me.wrap=-me.wrap),me.status=me.wrap?I:$,D.adler=me.wrap===2?0:1,me.last_flush=d,a._tr_init(me),p):J(D,m)}function He(D){var me=st(D);return me===p&&function(ue){ue.window_size=2*ue.w_size,G(ue.head),ue.max_lazy_match=s[ue.level].max_lazy,ue.good_match=s[ue.level].good_length,ue.nice_match=s[ue.level].nice_length,ue.max_chain_length=s[ue.level].max_chain,ue.strstart=0,ue.block_start=0,ue.lookahead=0,ue.insert=0,ue.match_length=ue.prev_length=M-1,ue.match_available=0,ue.ins_h=0}(D.state),me}function gt(D,me,ue,K,R,N){if(!D)return m;var z=1;if(me===h&&(me=6),K<0?(z=0,K=-K):15<K&&(z=2,K-=16),R<1||b<R||ue!==v||K<8||15<K||me<0||9<me||N<0||g<N)return J(D,m);K===8&&(K=9);var X=new Ge;return(D.state=X).strm=D,X.wrap=z,X.gzhead=null,X.w_bits=K,X.w_size=1<<X.w_bits,X.w_mask=X.w_size-1,X.hash_bits=R+7,X.hash_size=1<<X.hash_bits,X.hash_mask=X.hash_size-1,X.hash_shift=~~((X.hash_bits+M-1)/M),X.window=new o.Buf8(2*X.w_size),X.head=new o.Buf16(X.hash_size),X.prev=new o.Buf16(X.w_size),X.lit_bufsize=1<<R+6,X.pending_buf_size=4*X.lit_bufsize,X.pending_buf=new o.Buf8(X.pending_buf_size),X.d_buf=1*X.lit_bufsize,X.l_buf=3*X.lit_bufsize,X.level=me,X.strategy=N,X.method=ue,He(D)}s=[new Re(0,0,0,0,function(D,me){var ue=65535;for(ue>D.pending_buf_size-5&&(ue=D.pending_buf_size-5);;){if(D.lookahead<=1){if(ce(D),D.lookahead===0&&me===d)return x;if(D.lookahead===0)break}D.strstart+=D.lookahead,D.lookahead=0;var K=D.block_start+ue;if((D.strstart===0||D.strstart>=K)&&(D.lookahead=D.strstart-K,D.strstart=K,C(D,!1),D.strm.avail_out===0)||D.strstart-D.block_start>=D.w_size-q&&(C(D,!1),D.strm.avail_out===0))return x}return D.insert=0,me===f?(C(D,!0),D.strm.avail_out===0?P:B):(D.strstart>D.block_start&&(C(D,!1),D.strm.avail_out),x)}),new Re(4,4,8,4,le),new Re(4,5,16,8,le),new Re(4,6,32,32,le),new Re(4,4,16,16,ge),new Re(8,16,32,32,ge),new Re(8,16,128,128,ge),new Re(8,32,128,256,ge),new Re(32,128,258,1024,ge),new Re(32,258,258,4096,ge)],i.deflateInit=function(D,me){return gt(D,me,v,15,8,0)},i.deflateInit2=gt,i.deflateReset=He,i.deflateResetKeep=st,i.deflateSetHeader=function(D,me){return D&&D.state?D.state.wrap!==2?m:(D.state.gzhead=me,p):m},i.deflate=function(D,me){var ue,K,R,N;if(!D||!D.state||5<me||me<0)return D?J(D,m):m;if(K=D.state,!D.output||!D.input&&D.avail_in!==0||K.status===666&&me!==f)return J(D,D.avail_out===0?-5:m);if(K.strm=D,ue=K.last_flush,K.last_flush=me,K.status===I)if(K.wrap===2)D.adler=0,Z(K,31),Z(K,139),Z(K,8),K.gzhead?(Z(K,(K.gzhead.text?1:0)+(K.gzhead.hcrc?2:0)+(K.gzhead.extra?4:0)+(K.gzhead.name?8:0)+(K.gzhead.comment?16:0)),Z(K,255&K.gzhead.time),Z(K,K.gzhead.time>>8&255),Z(K,K.gzhead.time>>16&255),Z(K,K.gzhead.time>>24&255),Z(K,K.level===9?2:2<=K.strategy||K.level<2?4:0),Z(K,255&K.gzhead.os),K.gzhead.extra&&K.gzhead.extra.length&&(Z(K,255&K.gzhead.extra.length),Z(K,K.gzhead.extra.length>>8&255)),K.gzhead.hcrc&&(D.adler=l(D.adler,K.pending_buf,K.pending,0)),K.gzindex=0,K.status=69):(Z(K,0),Z(K,0),Z(K,0),Z(K,0),Z(K,0),Z(K,K.level===9?2:2<=K.strategy||K.level<2?4:0),Z(K,3),K.status=$);else{var z=v+(K.w_bits-8<<4)<<8;z|=(2<=K.strategy||K.level<2?0:K.level<6?1:K.level===6?2:3)<<6,K.strstart!==0&&(z|=32),z+=31-z%31,K.status=$,H(K,z),K.strstart!==0&&(H(K,D.adler>>>16),H(K,65535&D.adler)),D.adler=1}if(K.status===69)if(K.gzhead.extra){for(R=K.pending;K.gzindex<(65535&K.gzhead.extra.length)&&(K.pending!==K.pending_buf_size||(K.gzhead.hcrc&&K.pending>R&&(D.adler=l(D.adler,K.pending_buf,K.pending-R,R)),U(D),R=K.pending,K.pending!==K.pending_buf_size));)Z(K,255&K.gzhead.extra[K.gzindex]),K.gzindex++;K.gzhead.hcrc&&K.pending>R&&(D.adler=l(D.adler,K.pending_buf,K.pending-R,R)),K.gzindex===K.gzhead.extra.length&&(K.gzindex=0,K.status=73)}else K.status=73;if(K.status===73)if(K.gzhead.name){R=K.pending;do{if(K.pending===K.pending_buf_size&&(K.gzhead.hcrc&&K.pending>R&&(D.adler=l(D.adler,K.pending_buf,K.pending-R,R)),U(D),R=K.pending,K.pending===K.pending_buf_size)){N=1;break}N=K.gzindex<K.gzhead.name.length?255&K.gzhead.name.charCodeAt(K.gzindex++):0,Z(K,N)}while(N!==0);K.gzhead.hcrc&&K.pending>R&&(D.adler=l(D.adler,K.pending_buf,K.pending-R,R)),N===0&&(K.gzindex=0,K.status=91)}else K.status=91;if(K.status===91)if(K.gzhead.comment){R=K.pending;do{if(K.pending===K.pending_buf_size&&(K.gzhead.hcrc&&K.pending>R&&(D.adler=l(D.adler,K.pending_buf,K.pending-R,R)),U(D),R=K.pending,K.pending===K.pending_buf_size)){N=1;break}N=K.gzindex<K.gzhead.comment.length?255&K.gzhead.comment.charCodeAt(K.gzindex++):0,Z(K,N)}while(N!==0);K.gzhead.hcrc&&K.pending>R&&(D.adler=l(D.adler,K.pending_buf,K.pending-R,R)),N===0&&(K.status=103)}else K.status=103;if(K.status===103&&(K.gzhead.hcrc?(K.pending+2>K.pending_buf_size&&U(D),K.pending+2<=K.pending_buf_size&&(Z(K,255&D.adler),Z(K,D.adler>>8&255),D.adler=0,K.status=$)):K.status=$),K.pending!==0){if(U(D),D.avail_out===0)return K.last_flush=-1,p}else if(D.avail_in===0&&L(me)<=L(ue)&&me!==f)return J(D,-5);if(K.status===666&&D.avail_in!==0)return J(D,-5);if(D.avail_in!==0||K.lookahead!==0||me!==d&&K.status!==666){var X=K.strategy===2?function(Y,ee){for(var pe;;){if(Y.lookahead===0&&(ce(Y),Y.lookahead===0)){if(ee===d)return x;break}if(Y.match_length=0,pe=a._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++,pe&&(C(Y,!1),Y.strm.avail_out===0))return x}return Y.insert=0,ee===f?(C(Y,!0),Y.strm.avail_out===0?P:B):Y.last_lit&&(C(Y,!1),Y.strm.avail_out===0)?x:A}(K,me):K.strategy===3?function(Y,ee){for(var pe,he,Pe,nt,Ze=Y.window;;){if(Y.lookahead<=F){if(ce(Y),Y.lookahead<=F&&ee===d)return x;if(Y.lookahead===0)break}if(Y.match_length=0,Y.lookahead>=M&&0<Y.strstart&&(he=Ze[Pe=Y.strstart-1])===Ze[++Pe]&&he===Ze[++Pe]&&he===Ze[++Pe]){nt=Y.strstart+F;do;while(he===Ze[++Pe]&&he===Ze[++Pe]&&he===Ze[++Pe]&&he===Ze[++Pe]&&he===Ze[++Pe]&&he===Ze[++Pe]&&he===Ze[++Pe]&&he===Ze[++Pe]&&Pe<nt);Y.match_length=F-(nt-Pe),Y.match_length>Y.lookahead&&(Y.match_length=Y.lookahead)}if(Y.match_length>=M?(pe=a._tr_tally(Y,1,Y.match_length-M),Y.lookahead-=Y.match_length,Y.strstart+=Y.match_length,Y.match_length=0):(pe=a._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++),pe&&(C(Y,!1),Y.strm.avail_out===0))return x}return Y.insert=0,ee===f?(C(Y,!0),Y.strm.avail_out===0?P:B):Y.last_lit&&(C(Y,!1),Y.strm.avail_out===0)?x:A}(K,me):s[K.level].func(K,me);if(X!==P&&X!==B||(K.status=666),X===x||X===P)return D.avail_out===0&&(K.last_flush=-1),p;if(X===A&&(me===1?a._tr_align(K):me!==5&&(a._tr_stored_block(K,0,0,!1),me===3&&(G(K.head),K.lookahead===0&&(K.strstart=0,K.block_start=0,K.insert=0))),U(D),D.avail_out===0))return K.last_flush=-1,p}return me!==f?p:K.wrap<=0?1:(K.wrap===2?(Z(K,255&D.adler),Z(K,D.adler>>8&255),Z(K,D.adler>>16&255),Z(K,D.adler>>24&255),Z(K,255&D.total_in),Z(K,D.total_in>>8&255),Z(K,D.total_in>>16&255),Z(K,D.total_in>>24&255)):(H(K,D.adler>>>16),H(K,65535&D.adler)),U(D),0<K.wrap&&(K.wrap=-K.wrap),K.pending!==0?p:1)},i.deflateEnd=function(D){var me;return D&&D.state?(me=D.state.status)!==I&&me!==69&&me!==73&&me!==91&&me!==103&&me!==$&&me!==666?J(D,m):(D.state=null,me===$?J(D,-3):p):m},i.deflateSetDictionary=function(D,me){var ue,K,R,N,z,X,Y,ee,pe=me.length;if(!D||!D.state||(N=(ue=D.state).wrap)===2||N===1&&ue.status!==I||ue.lookahead)return m;for(N===1&&(D.adler=c(D.adler,me,pe,0)),ue.wrap=0,pe>=ue.w_size&&(N===0&&(G(ue.head),ue.strstart=0,ue.block_start=0,ue.insert=0),ee=new o.Buf8(ue.w_size),o.arraySet(ee,me,pe-ue.w_size,ue.w_size,0),me=ee,pe=ue.w_size),z=D.avail_in,X=D.next_in,Y=D.input,D.avail_in=pe,D.next_in=0,D.input=me,ce(ue);ue.lookahead>=M;){for(K=ue.strstart,R=ue.lookahead-(M-1);ue.ins_h=(ue.ins_h<<ue.hash_shift^ue.window[K+M-1])&ue.hash_mask,ue.prev[K&ue.w_mask]=ue.head[ue.ins_h],ue.head[ue.ins_h]=K,K++,--R;);ue.strstart=K,ue.lookahead=M-1,ce(ue)}return ue.strstart+=ue.lookahead,ue.block_start=ue.strstart,ue.insert=ue.lookahead,ue.lookahead=0,ue.match_length=ue.prev_length=M-1,ue.match_available=0,D.next_in=X,D.input=Y,D.avail_in=z,ue.wrap=N,p},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,i){r.exports=function(s,o){var a,c,l,u,d,f,p,m,h,g,y,v,b,E,w,S,_,O,M,F,q,I,$,x,A;a=s.state,c=s.next_in,x=s.input,l=c+(s.avail_in-5),u=s.next_out,A=s.output,d=u-(o-s.avail_out),f=u+(s.avail_out-257),p=a.dmax,m=a.wsize,h=a.whave,g=a.wnext,y=a.window,v=a.hold,b=a.bits,E=a.lencode,w=a.distcode,S=(1<<a.lenbits)-1,_=(1<<a.distbits)-1;e:do{b<15&&(v+=x[c++]<<b,b+=8,v+=x[c++]<<b,b+=8),O=E[v&S];t:for(;;){if(v>>>=M=O>>>24,b-=M,(M=O>>>16&255)===0)A[u++]=65535&O;else{if(!(16&M)){if(!(64&M)){O=E[(65535&O)+(v&(1<<M)-1)];continue t}if(32&M){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}F=65535&O,(M&=15)&&(b<M&&(v+=x[c++]<<b,b+=8),F+=v&(1<<M)-1,v>>>=M,b-=M),b<15&&(v+=x[c++]<<b,b+=8,v+=x[c++]<<b,b+=8),O=w[v&_];n:for(;;){if(v>>>=M=O>>>24,b-=M,!(16&(M=O>>>16&255))){if(!(64&M)){O=w[(65535&O)+(v&(1<<M)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(q=65535&O,b<(M&=15)&&(v+=x[c++]<<b,(b+=8)<M&&(v+=x[c++]<<b,b+=8)),p<(q+=v&(1<<M)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=M,b-=M,(M=u-d)<q){if(h<(M=q-M)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if($=y,(I=0)===g){if(I+=m-M,M<F){for(F-=M;A[u++]=y[I++],--M;);I=u-q,$=A}}else if(g<M){if(I+=m+g-M,(M-=g)<F){for(F-=M;A[u++]=y[I++],--M;);if(I=0,g<F){for(F-=M=g;A[u++]=y[I++],--M;);I=u-q,$=A}}}else if(I+=g-M,M<F){for(F-=M;A[u++]=y[I++],--M;);I=u-q,$=A}for(;2<F;)A[u++]=$[I++],A[u++]=$[I++],A[u++]=$[I++],F-=3;F&&(A[u++]=$[I++],1<F&&(A[u++]=$[I++]))}else{for(I=u-q;A[u++]=A[I++],A[u++]=A[I++],A[u++]=A[I++],2<(F-=3););F&&(A[u++]=A[I++],1<F&&(A[u++]=A[I++]))}break}}break}}while(c<l&&u<f);c-=F=b>>3,v&=(1<<(b-=F<<3))-1,s.next_in=c,s.next_out=u,s.avail_in=c<l?l-c+5:5-(c-l),s.avail_out=u<f?f-u+257:257-(u-f),a.hold=v,a.bits=b}},{}],49:[function(n,r,i){var s=n("../utils/common"),o=n("./adler32"),a=n("./crc32"),c=n("./inffast"),l=n("./inftrees"),u=1,d=2,f=0,p=-2,m=1,h=852,g=592;function y(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(I){var $;return I&&I.state?($=I.state,I.total_in=I.total_out=$.total=0,I.msg="",$.wrap&&(I.adler=1&$.wrap),$.mode=m,$.last=0,$.havedict=0,$.dmax=32768,$.head=null,$.hold=0,$.bits=0,$.lencode=$.lendyn=new s.Buf32(h),$.distcode=$.distdyn=new s.Buf32(g),$.sane=1,$.back=-1,f):p}function E(I){var $;return I&&I.state?(($=I.state).wsize=0,$.whave=0,$.wnext=0,b(I)):p}function w(I,$){var x,A;return I&&I.state?(A=I.state,$<0?(x=0,$=-$):(x=1+($>>4),$<48&&($&=15)),$&&($<8||15<$)?p:(A.window!==null&&A.wbits!==$&&(A.window=null),A.wrap=x,A.wbits=$,E(I))):p}function S(I,$){var x,A;return I?(A=new v,(I.state=A).window=null,(x=w(I,$))!==f&&(I.state=null),x):p}var _,O,M=!0;function F(I){if(M){var $;for(_=new s.Buf32(512),O=new s.Buf32(32),$=0;$<144;)I.lens[$++]=8;for(;$<256;)I.lens[$++]=9;for(;$<280;)I.lens[$++]=7;for(;$<288;)I.lens[$++]=8;for(l(u,I.lens,0,288,_,0,I.work,{bits:9}),$=0;$<32;)I.lens[$++]=5;l(d,I.lens,0,32,O,0,I.work,{bits:5}),M=!1}I.lencode=_,I.lenbits=9,I.distcode=O,I.distbits=5}function q(I,$,x,A){var P,B=I.state;return B.window===null&&(B.wsize=1<<B.wbits,B.wnext=0,B.whave=0,B.window=new s.Buf8(B.wsize)),A>=B.wsize?(s.arraySet(B.window,$,x-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(A<(P=B.wsize-B.wnext)&&(P=A),s.arraySet(B.window,$,x-A,P,B.wnext),(A-=P)?(s.arraySet(B.window,$,x-A,A,0),B.wnext=A,B.whave=B.wsize):(B.wnext+=P,B.wnext===B.wsize&&(B.wnext=0),B.whave<B.wsize&&(B.whave+=P))),0}i.inflateReset=E,i.inflateReset2=w,i.inflateResetKeep=b,i.inflateInit=function(I){return S(I,15)},i.inflateInit2=S,i.inflate=function(I,$){var x,A,P,B,J,L,G,U,C,Z,H,V,ce,le,ge,Re,Ge,st,He,gt,D,me,ue,K,R=0,N=new s.Buf8(4),z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return p;(x=I.state).mode===12&&(x.mode=13),J=I.next_out,P=I.output,G=I.avail_out,B=I.next_in,A=I.input,L=I.avail_in,U=x.hold,C=x.bits,Z=L,H=G,me=f;e:for(;;)switch(x.mode){case m:if(x.wrap===0){x.mode=13;break}for(;C<16;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(2&x.wrap&&U===35615){N[x.check=0]=255&U,N[1]=U>>>8&255,x.check=a(x.check,N,2,0),C=U=0,x.mode=2;break}if(x.flags=0,x.head&&(x.head.done=!1),!(1&x.wrap)||(((255&U)<<8)+(U>>8))%31){I.msg="incorrect header check",x.mode=30;break}if((15&U)!=8){I.msg="unknown compression method",x.mode=30;break}if(C-=4,D=8+(15&(U>>>=4)),x.wbits===0)x.wbits=D;else if(D>x.wbits){I.msg="invalid window size",x.mode=30;break}x.dmax=1<<D,I.adler=x.check=1,x.mode=512&U?10:12,C=U=0;break;case 2:for(;C<16;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(x.flags=U,(255&x.flags)!=8){I.msg="unknown compression method",x.mode=30;break}if(57344&x.flags){I.msg="unknown header flags set",x.mode=30;break}x.head&&(x.head.text=U>>8&1),512&x.flags&&(N[0]=255&U,N[1]=U>>>8&255,x.check=a(x.check,N,2,0)),C=U=0,x.mode=3;case 3:for(;C<32;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}x.head&&(x.head.time=U),512&x.flags&&(N[0]=255&U,N[1]=U>>>8&255,N[2]=U>>>16&255,N[3]=U>>>24&255,x.check=a(x.check,N,4,0)),C=U=0,x.mode=4;case 4:for(;C<16;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}x.head&&(x.head.xflags=255&U,x.head.os=U>>8),512&x.flags&&(N[0]=255&U,N[1]=U>>>8&255,x.check=a(x.check,N,2,0)),C=U=0,x.mode=5;case 5:if(1024&x.flags){for(;C<16;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}x.length=U,x.head&&(x.head.extra_len=U),512&x.flags&&(N[0]=255&U,N[1]=U>>>8&255,x.check=a(x.check,N,2,0)),C=U=0}else x.head&&(x.head.extra=null);x.mode=6;case 6:if(1024&x.flags&&(L<(V=x.length)&&(V=L),V&&(x.head&&(D=x.head.extra_len-x.length,x.head.extra||(x.head.extra=new Array(x.head.extra_len)),s.arraySet(x.head.extra,A,B,V,D)),512&x.flags&&(x.check=a(x.check,A,V,B)),L-=V,B+=V,x.length-=V),x.length))break e;x.length=0,x.mode=7;case 7:if(2048&x.flags){if(L===0)break e;for(V=0;D=A[B+V++],x.head&&D&&x.length<65536&&(x.head.name+=String.fromCharCode(D)),D&&V<L;);if(512&x.flags&&(x.check=a(x.check,A,V,B)),L-=V,B+=V,D)break e}else x.head&&(x.head.name=null);x.length=0,x.mode=8;case 8:if(4096&x.flags){if(L===0)break e;for(V=0;D=A[B+V++],x.head&&D&&x.length<65536&&(x.head.comment+=String.fromCharCode(D)),D&&V<L;);if(512&x.flags&&(x.check=a(x.check,A,V,B)),L-=V,B+=V,D)break e}else x.head&&(x.head.comment=null);x.mode=9;case 9:if(512&x.flags){for(;C<16;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(U!==(65535&x.check)){I.msg="header crc mismatch",x.mode=30;break}C=U=0}x.head&&(x.head.hcrc=x.flags>>9&1,x.head.done=!0),I.adler=x.check=0,x.mode=12;break;case 10:for(;C<32;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}I.adler=x.check=y(U),C=U=0,x.mode=11;case 11:if(x.havedict===0)return I.next_out=J,I.avail_out=G,I.next_in=B,I.avail_in=L,x.hold=U,x.bits=C,2;I.adler=x.check=1,x.mode=12;case 12:if($===5||$===6)break e;case 13:if(x.last){U>>>=7&C,C-=7&C,x.mode=27;break}for(;C<3;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}switch(x.last=1&U,C-=1,3&(U>>>=1)){case 0:x.mode=14;break;case 1:if(F(x),x.mode=20,$!==6)break;U>>>=2,C-=2;break e;case 2:x.mode=17;break;case 3:I.msg="invalid block type",x.mode=30}U>>>=2,C-=2;break;case 14:for(U>>>=7&C,C-=7&C;C<32;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if((65535&U)!=(U>>>16^65535)){I.msg="invalid stored block lengths",x.mode=30;break}if(x.length=65535&U,C=U=0,x.mode=15,$===6)break e;case 15:x.mode=16;case 16:if(V=x.length){if(L<V&&(V=L),G<V&&(V=G),V===0)break e;s.arraySet(P,A,B,V,J),L-=V,B+=V,G-=V,J+=V,x.length-=V;break}x.mode=12;break;case 17:for(;C<14;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(x.nlen=257+(31&U),U>>>=5,C-=5,x.ndist=1+(31&U),U>>>=5,C-=5,x.ncode=4+(15&U),U>>>=4,C-=4,286<x.nlen||30<x.ndist){I.msg="too many length or distance symbols",x.mode=30;break}x.have=0,x.mode=18;case 18:for(;x.have<x.ncode;){for(;C<3;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}x.lens[z[x.have++]]=7&U,U>>>=3,C-=3}for(;x.have<19;)x.lens[z[x.have++]]=0;if(x.lencode=x.lendyn,x.lenbits=7,ue={bits:x.lenbits},me=l(0,x.lens,0,19,x.lencode,0,x.work,ue),x.lenbits=ue.bits,me){I.msg="invalid code lengths set",x.mode=30;break}x.have=0,x.mode=19;case 19:for(;x.have<x.nlen+x.ndist;){for(;Re=(R=x.lencode[U&(1<<x.lenbits)-1])>>>16&255,Ge=65535&R,!((ge=R>>>24)<=C);){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(Ge<16)U>>>=ge,C-=ge,x.lens[x.have++]=Ge;else{if(Ge===16){for(K=ge+2;C<K;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(U>>>=ge,C-=ge,x.have===0){I.msg="invalid bit length repeat",x.mode=30;break}D=x.lens[x.have-1],V=3+(3&U),U>>>=2,C-=2}else if(Ge===17){for(K=ge+3;C<K;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}C-=ge,D=0,V=3+(7&(U>>>=ge)),U>>>=3,C-=3}else{for(K=ge+7;C<K;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}C-=ge,D=0,V=11+(127&(U>>>=ge)),U>>>=7,C-=7}if(x.have+V>x.nlen+x.ndist){I.msg="invalid bit length repeat",x.mode=30;break}for(;V--;)x.lens[x.have++]=D}}if(x.mode===30)break;if(x.lens[256]===0){I.msg="invalid code -- missing end-of-block",x.mode=30;break}if(x.lenbits=9,ue={bits:x.lenbits},me=l(u,x.lens,0,x.nlen,x.lencode,0,x.work,ue),x.lenbits=ue.bits,me){I.msg="invalid literal/lengths set",x.mode=30;break}if(x.distbits=6,x.distcode=x.distdyn,ue={bits:x.distbits},me=l(d,x.lens,x.nlen,x.ndist,x.distcode,0,x.work,ue),x.distbits=ue.bits,me){I.msg="invalid distances set",x.mode=30;break}if(x.mode=20,$===6)break e;case 20:x.mode=21;case 21:if(6<=L&&258<=G){I.next_out=J,I.avail_out=G,I.next_in=B,I.avail_in=L,x.hold=U,x.bits=C,c(I,H),J=I.next_out,P=I.output,G=I.avail_out,B=I.next_in,A=I.input,L=I.avail_in,U=x.hold,C=x.bits,x.mode===12&&(x.back=-1);break}for(x.back=0;Re=(R=x.lencode[U&(1<<x.lenbits)-1])>>>16&255,Ge=65535&R,!((ge=R>>>24)<=C);){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(Re&&!(240&Re)){for(st=ge,He=Re,gt=Ge;Re=(R=x.lencode[gt+((U&(1<<st+He)-1)>>st)])>>>16&255,Ge=65535&R,!(st+(ge=R>>>24)<=C);){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}U>>>=st,C-=st,x.back+=st}if(U>>>=ge,C-=ge,x.back+=ge,x.length=Ge,Re===0){x.mode=26;break}if(32&Re){x.back=-1,x.mode=12;break}if(64&Re){I.msg="invalid literal/length code",x.mode=30;break}x.extra=15&Re,x.mode=22;case 22:if(x.extra){for(K=x.extra;C<K;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}x.length+=U&(1<<x.extra)-1,U>>>=x.extra,C-=x.extra,x.back+=x.extra}x.was=x.length,x.mode=23;case 23:for(;Re=(R=x.distcode[U&(1<<x.distbits)-1])>>>16&255,Ge=65535&R,!((ge=R>>>24)<=C);){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(!(240&Re)){for(st=ge,He=Re,gt=Ge;Re=(R=x.distcode[gt+((U&(1<<st+He)-1)>>st)])>>>16&255,Ge=65535&R,!(st+(ge=R>>>24)<=C);){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}U>>>=st,C-=st,x.back+=st}if(U>>>=ge,C-=ge,x.back+=ge,64&Re){I.msg="invalid distance code",x.mode=30;break}x.offset=Ge,x.extra=15&Re,x.mode=24;case 24:if(x.extra){for(K=x.extra;C<K;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}x.offset+=U&(1<<x.extra)-1,U>>>=x.extra,C-=x.extra,x.back+=x.extra}if(x.offset>x.dmax){I.msg="invalid distance too far back",x.mode=30;break}x.mode=25;case 25:if(G===0)break e;if(V=H-G,x.offset>V){if((V=x.offset-V)>x.whave&&x.sane){I.msg="invalid distance too far back",x.mode=30;break}ce=V>x.wnext?(V-=x.wnext,x.wsize-V):x.wnext-V,V>x.length&&(V=x.length),le=x.window}else le=P,ce=J-x.offset,V=x.length;for(G<V&&(V=G),G-=V,x.length-=V;P[J++]=le[ce++],--V;);x.length===0&&(x.mode=21);break;case 26:if(G===0)break e;P[J++]=x.length,G--,x.mode=21;break;case 27:if(x.wrap){for(;C<32;){if(L===0)break e;L--,U|=A[B++]<<C,C+=8}if(H-=G,I.total_out+=H,x.total+=H,H&&(I.adler=x.check=x.flags?a(x.check,P,H,J-H):o(x.check,P,H,J-H)),H=G,(x.flags?U:y(U))!==x.check){I.msg="incorrect data check",x.mode=30;break}C=U=0}x.mode=28;case 28:if(x.wrap&&x.flags){for(;C<32;){if(L===0)break e;L--,U+=A[B++]<<C,C+=8}if(U!==(4294967295&x.total)){I.msg="incorrect length check",x.mode=30;break}C=U=0}x.mode=29;case 29:me=1;break e;case 30:me=-3;break e;case 31:return-4;case 32:default:return p}return I.next_out=J,I.avail_out=G,I.next_in=B,I.avail_in=L,x.hold=U,x.bits=C,(x.wsize||H!==I.avail_out&&x.mode<30&&(x.mode<27||$!==4))&&q(I,I.output,I.next_out,H-I.avail_out)?(x.mode=31,-4):(Z-=I.avail_in,H-=I.avail_out,I.total_in+=Z,I.total_out+=H,x.total+=H,x.wrap&&H&&(I.adler=x.check=x.flags?a(x.check,P,H,I.next_out-H):o(x.check,P,H,I.next_out-H)),I.data_type=x.bits+(x.last?64:0)+(x.mode===12?128:0)+(x.mode===20||x.mode===15?256:0),(Z==0&&H===0||$===4)&&me===f&&(me=-5),me)},i.inflateEnd=function(I){if(!I||!I.state)return p;var $=I.state;return $.window&&($.window=null),I.state=null,f},i.inflateGetHeader=function(I,$){var x;return I&&I.state&&2&(x=I.state).wrap?((x.head=$).done=!1,f):p},i.inflateSetDictionary=function(I,$){var x,A=$.length;return I&&I.state?(x=I.state).wrap!==0&&x.mode!==11?p:x.mode===11&&o(1,$,A,0)!==x.check?-3:q(I,$,A,A)?(x.mode=31,-4):(x.havedict=1,f):p},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var s=n("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,d,f,p,m,h,g,y){var v,b,E,w,S,_,O,M,F,q=y.bits,I=0,$=0,x=0,A=0,P=0,B=0,J=0,L=0,G=0,U=0,C=null,Z=0,H=new s.Buf16(16),V=new s.Buf16(16),ce=null,le=0;for(I=0;I<=15;I++)H[I]=0;for($=0;$<p;$++)H[d[f+$]]++;for(P=q,A=15;1<=A&&H[A]===0;A--);if(A<P&&(P=A),A===0)return m[h++]=20971520,m[h++]=20971520,y.bits=1,0;for(x=1;x<A&&H[x]===0;x++);for(P<x&&(P=x),I=L=1;I<=15;I++)if(L<<=1,(L-=H[I])<0)return-1;if(0<L&&(u===0||A!==1))return-1;for(V[1]=0,I=1;I<15;I++)V[I+1]=V[I]+H[I];for($=0;$<p;$++)d[f+$]!==0&&(g[V[d[f+$]]++]=$);if(_=u===0?(C=ce=g,19):u===1?(C=o,Z-=257,ce=a,le-=257,256):(C=c,ce=l,-1),I=x,S=h,J=$=U=0,E=-1,w=(G=1<<(B=P))-1,u===1&&852<G||u===2&&592<G)return 1;for(;;){for(O=I-J,F=g[$]<_?(M=0,g[$]):g[$]>_?(M=ce[le+g[$]],C[Z+g[$]]):(M=96,0),v=1<<I-J,x=b=1<<B;m[S+(U>>J)+(b-=v)]=O<<24|M<<16|F|0,b!==0;);for(v=1<<I-1;U&v;)v>>=1;if(v!==0?(U&=v-1,U+=v):U=0,$++,--H[I]==0){if(I===A)break;I=d[f+g[$]]}if(P<I&&(U&w)!==E){for(J===0&&(J=P),S+=x,L=1<<(B=I-J);B+J<A&&!((L-=H[B+J])<=0);)B++,L<<=1;if(G+=1<<B,u===1&&852<G||u===2&&592<G)return 1;m[E=U&w]=P<<24|B<<16|S-h|0}}return U!==0&&(m[S+U]=I-J<<24|64<<16|0),y.bits=P,0}},{"../utils/common":41}],51:[function(n,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,i){var s=n("../utils/common"),o=0,a=1;function c(R){for(var N=R.length;0<=--N;)R[N]=0}var l=0,u=29,d=256,f=d+1+u,p=30,m=19,h=2*f+1,g=15,y=16,v=7,b=256,E=16,w=17,S=18,_=[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],O=[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],M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],q=new Array(2*(f+2));c(q);var I=new Array(2*p);c(I);var $=new Array(512);c($);var x=new Array(256);c(x);var A=new Array(u);c(A);var P,B,J,L=new Array(p);function G(R,N,z,X,Y){this.static_tree=R,this.extra_bits=N,this.extra_base=z,this.elems=X,this.max_length=Y,this.has_stree=R&&R.length}function U(R,N){this.dyn_tree=R,this.max_code=0,this.stat_desc=N}function C(R){return R<256?$[R]:$[256+(R>>>7)]}function Z(R,N){R.pending_buf[R.pending++]=255&N,R.pending_buf[R.pending++]=N>>>8&255}function H(R,N,z){R.bi_valid>y-z?(R.bi_buf|=N<<R.bi_valid&65535,Z(R,R.bi_buf),R.bi_buf=N>>y-R.bi_valid,R.bi_valid+=z-y):(R.bi_buf|=N<<R.bi_valid&65535,R.bi_valid+=z)}function V(R,N,z){H(R,z[2*N],z[2*N+1])}function ce(R,N){for(var z=0;z|=1&R,R>>>=1,z<<=1,0<--N;);return z>>>1}function le(R,N,z){var X,Y,ee=new Array(g+1),pe=0;for(X=1;X<=g;X++)ee[X]=pe=pe+z[X-1]<<1;for(Y=0;Y<=N;Y++){var he=R[2*Y+1];he!==0&&(R[2*Y]=ce(ee[he]++,he))}}function ge(R){var N;for(N=0;N<f;N++)R.dyn_ltree[2*N]=0;for(N=0;N<p;N++)R.dyn_dtree[2*N]=0;for(N=0;N<m;N++)R.bl_tree[2*N]=0;R.dyn_ltree[2*b]=1,R.opt_len=R.static_len=0,R.last_lit=R.matches=0}function Re(R){8<R.bi_valid?Z(R,R.bi_buf):0<R.bi_valid&&(R.pending_buf[R.pending++]=R.bi_buf),R.bi_buf=0,R.bi_valid=0}function Ge(R,N,z,X){var Y=2*N,ee=2*z;return R[Y]<R[ee]||R[Y]===R[ee]&&X[N]<=X[z]}function st(R,N,z){for(var X=R.heap[z],Y=z<<1;Y<=R.heap_len&&(Y<R.heap_len&&Ge(N,R.heap[Y+1],R.heap[Y],R.depth)&&Y++,!Ge(N,X,R.heap[Y],R.depth));)R.heap[z]=R.heap[Y],z=Y,Y<<=1;R.heap[z]=X}function He(R,N,z){var X,Y,ee,pe,he=0;if(R.last_lit!==0)for(;X=R.pending_buf[R.d_buf+2*he]<<8|R.pending_buf[R.d_buf+2*he+1],Y=R.pending_buf[R.l_buf+he],he++,X===0?V(R,Y,N):(V(R,(ee=x[Y])+d+1,N),(pe=_[ee])!==0&&H(R,Y-=A[ee],pe),V(R,ee=C(--X),z),(pe=O[ee])!==0&&H(R,X-=L[ee],pe)),he<R.last_lit;);V(R,b,N)}function gt(R,N){var z,X,Y,ee=N.dyn_tree,pe=N.stat_desc.static_tree,he=N.stat_desc.has_stree,Pe=N.stat_desc.elems,nt=-1;for(R.heap_len=0,R.heap_max=h,z=0;z<Pe;z++)ee[2*z]!==0?(R.heap[++R.heap_len]=nt=z,R.depth[z]=0):ee[2*z+1]=0;for(;R.heap_len<2;)ee[2*(Y=R.heap[++R.heap_len]=nt<2?++nt:0)]=1,R.depth[Y]=0,R.opt_len--,he&&(R.static_len-=pe[2*Y+1]);for(N.max_code=nt,z=R.heap_len>>1;1<=z;z--)st(R,ee,z);for(Y=Pe;z=R.heap[1],R.heap[1]=R.heap[R.heap_len--],st(R,ee,1),X=R.heap[1],R.heap[--R.heap_max]=z,R.heap[--R.heap_max]=X,ee[2*Y]=ee[2*z]+ee[2*X],R.depth[Y]=(R.depth[z]>=R.depth[X]?R.depth[z]:R.depth[X])+1,ee[2*z+1]=ee[2*X+1]=Y,R.heap[1]=Y++,st(R,ee,1),2<=R.heap_len;);R.heap[--R.heap_max]=R.heap[1],function(Ze,Xt){var Gn,an,pr,rt,xn,Rr,ar=Xt.dyn_tree,go=Xt.max_code,wa=Xt.stat_desc.static_tree,yo=Xt.stat_desc.has_stree,Vr=Xt.stat_desc.extra_bits,vo=Xt.stat_desc.extra_base,wi=Xt.stat_desc.max_length,Ns=0;for(rt=0;rt<=g;rt++)Ze.bl_count[rt]=0;for(ar[2*Ze.heap[Ze.heap_max]+1]=0,Gn=Ze.heap_max+1;Gn<h;Gn++)wi<(rt=ar[2*ar[2*(an=Ze.heap[Gn])+1]+1]+1)&&(rt=wi,Ns++),ar[2*an+1]=rt,go<an||(Ze.bl_count[rt]++,xn=0,vo<=an&&(xn=Vr[an-vo]),Rr=ar[2*an],Ze.opt_len+=Rr*(rt+xn),yo&&(Ze.static_len+=Rr*(wa[2*an+1]+xn)));if(Ns!==0){do{for(rt=wi-1;Ze.bl_count[rt]===0;)rt--;Ze.bl_count[rt]--,Ze.bl_count[rt+1]+=2,Ze.bl_count[wi]--,Ns-=2}while(0<Ns);for(rt=wi;rt!==0;rt--)for(an=Ze.bl_count[rt];an!==0;)go<(pr=Ze.heap[--Gn])||(ar[2*pr+1]!==rt&&(Ze.opt_len+=(rt-ar[2*pr+1])*ar[2*pr],ar[2*pr+1]=rt),an--)}}(R,N),le(ee,nt,R.bl_count)}function D(R,N,z){var X,Y,ee=-1,pe=N[1],he=0,Pe=7,nt=4;for(pe===0&&(Pe=138,nt=3),N[2*(z+1)+1]=65535,X=0;X<=z;X++)Y=pe,pe=N[2*(X+1)+1],++he<Pe&&Y===pe||(he<nt?R.bl_tree[2*Y]+=he:Y!==0?(Y!==ee&&R.bl_tree[2*Y]++,R.bl_tree[2*E]++):he<=10?R.bl_tree[2*w]++:R.bl_tree[2*S]++,ee=Y,nt=(he=0)===pe?(Pe=138,3):Y===pe?(Pe=6,3):(Pe=7,4))}function me(R,N,z){var X,Y,ee=-1,pe=N[1],he=0,Pe=7,nt=4;for(pe===0&&(Pe=138,nt=3),X=0;X<=z;X++)if(Y=pe,pe=N[2*(X+1)+1],!(++he<Pe&&Y===pe)){if(he<nt)for(;V(R,Y,R.bl_tree),--he!=0;);else Y!==0?(Y!==ee&&(V(R,Y,R.bl_tree),he--),V(R,E,R.bl_tree),H(R,he-3,2)):he<=10?(V(R,w,R.bl_tree),H(R,he-3,3)):(V(R,S,R.bl_tree),H(R,he-11,7));ee=Y,nt=(he=0)===pe?(Pe=138,3):Y===pe?(Pe=6,3):(Pe=7,4)}}c(L);var ue=!1;function K(R,N,z,X){H(R,(l<<1)+(X?1:0),3),function(Y,ee,pe,he){Re(Y),Z(Y,pe),Z(Y,~pe),s.arraySet(Y.pending_buf,Y.window,ee,pe,Y.pending),Y.pending+=pe}(R,N,z)}i._tr_init=function(R){ue||(function(){var N,z,X,Y,ee,pe=new Array(g+1);for(Y=X=0;Y<u-1;Y++)for(A[Y]=X,N=0;N<1<<_[Y];N++)x[X++]=Y;for(x[X-1]=Y,Y=ee=0;Y<16;Y++)for(L[Y]=ee,N=0;N<1<<O[Y];N++)$[ee++]=Y;for(ee>>=7;Y<p;Y++)for(L[Y]=ee<<7,N=0;N<1<<O[Y]-7;N++)$[256+ee++]=Y;for(z=0;z<=g;z++)pe[z]=0;for(N=0;N<=143;)q[2*N+1]=8,N++,pe[8]++;for(;N<=255;)q[2*N+1]=9,N++,pe[9]++;for(;N<=279;)q[2*N+1]=7,N++,pe[7]++;for(;N<=287;)q[2*N+1]=8,N++,pe[8]++;for(le(q,f+1,pe),N=0;N<p;N++)I[2*N+1]=5,I[2*N]=ce(N,5);P=new G(q,_,d+1,f,g),B=new G(I,O,0,p,g),J=new G(new Array(0),M,0,m,v)}(),ue=!0),R.l_desc=new U(R.dyn_ltree,P),R.d_desc=new U(R.dyn_dtree,B),R.bl_desc=new U(R.bl_tree,J),R.bi_buf=0,R.bi_valid=0,ge(R)},i._tr_stored_block=K,i._tr_flush_block=function(R,N,z,X){var Y,ee,pe=0;0<R.level?(R.strm.data_type===2&&(R.strm.data_type=function(he){var Pe,nt=4093624447;for(Pe=0;Pe<=31;Pe++,nt>>>=1)if(1&nt&&he.dyn_ltree[2*Pe]!==0)return o;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return a;for(Pe=32;Pe<d;Pe++)if(he.dyn_ltree[2*Pe]!==0)return a;return o}(R)),gt(R,R.l_desc),gt(R,R.d_desc),pe=function(he){var Pe;for(D(he,he.dyn_ltree,he.l_desc.max_code),D(he,he.dyn_dtree,he.d_desc.max_code),gt(he,he.bl_desc),Pe=m-1;3<=Pe&&he.bl_tree[2*F[Pe]+1]===0;Pe--);return he.opt_len+=3*(Pe+1)+5+5+4,Pe}(R),Y=R.opt_len+3+7>>>3,(ee=R.static_len+3+7>>>3)<=Y&&(Y=ee)):Y=ee=z+5,z+4<=Y&&N!==-1?K(R,N,z,X):R.strategy===4||ee===Y?(H(R,2+(X?1:0),3),He(R,q,I)):(H(R,4+(X?1:0),3),function(he,Pe,nt,Ze){var Xt;for(H(he,Pe-257,5),H(he,nt-1,5),H(he,Ze-4,4),Xt=0;Xt<Ze;Xt++)H(he,he.bl_tree[2*F[Xt]+1],3);me(he,he.dyn_ltree,Pe-1),me(he,he.dyn_dtree,nt-1)}(R,R.l_desc.max_code+1,R.d_desc.max_code+1,pe+1),He(R,R.dyn_ltree,R.dyn_dtree)),ge(R),X&&Re(R)},i._tr_tally=function(R,N,z){return R.pending_buf[R.d_buf+2*R.last_lit]=N>>>8&255,R.pending_buf[R.d_buf+2*R.last_lit+1]=255&N,R.pending_buf[R.l_buf+R.last_lit]=255&z,R.last_lit++,N===0?R.dyn_ltree[2*z]++:(R.matches++,N--,R.dyn_ltree[2*(x[z]+d+1)]++,R.dyn_dtree[2*C(N)]++),R.last_lit===R.lit_bufsize-1},i._tr_align=function(R){H(R,2,3),V(R,b,q),function(N){N.bi_valid===16?(Z(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):8<=N.bi_valid&&(N.pending_buf[N.pending++]=255&N.bi_buf,N.bi_buf>>=8,N.bi_valid-=8)}(R)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(s){(function(o,a){if(!o.setImmediate){var c,l,u,d,f=1,p={},m=!1,h=o.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(o);g=g&&g.setTimeout?g:o,c={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){v(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,w=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=w,E}}()?(d="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",b,!1):o.attachEvent("onmessage",b),function(E){o.postMessage(d+E,"*")}):o.MessageChannel?((u=new MessageChannel).port1.onmessage=function(E){v(E.data)},function(E){u.port2.postMessage(E)}):h&&"onreadystatechange"in h.createElement("script")?(l=h.documentElement,function(E){var w=h.createElement("script");w.onreadystatechange=function(){v(E),w.onreadystatechange=null,l.removeChild(w),w=null},l.appendChild(w)}):function(E){setTimeout(v,0,E)},g.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var w=new Array(arguments.length-1),S=0;S<w.length;S++)w[S]=arguments[S+1];var _={callback:E,args:w};return p[f]=_,c(f),f++},g.clearImmediate=y}function y(E){delete p[E]}function v(E){if(m)setTimeout(v,0,E);else{var w=p[E];if(w){m=!0;try{(function(S){var _=S.callback,O=S.args;switch(O.length){case 0:_();break;case 1:_(O[0]);break;case 2:_(O[0],O[1]);break;case 3:_(O[0],O[1],O[2]);break;default:_.apply(a,O)}})(w)}finally{y(E),m=!1}}}}function b(E){E.source===o&&typeof E.data=="string"&&E.data.indexOf(d)===0&&v(+E.data.slice(d.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof dr<"u"?dr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Fk);var TG=Fk.exports;const $k=pa(TG),An={Remove:"remove",Replace:"replace",Add:"add"},jk=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),IG=Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),jh=Symbol.iterator,Qr={mutable:"mutable",immutable:"immutable"},SE={};function _d(t,e){return t instanceof Map?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function TT(t,e){if(e in t){let n=Reflect.getPrototypeOf(t);for(;n;){const r=Reflect.getOwnPropertyDescriptor(n,e);if(r)return r;n=Reflect.getPrototypeOf(n)}}}function xE(t){return Object.getPrototypeOf(t)===Set.prototype}function TE(t){return Object.getPrototypeOf(t)===Map.prototype}function Gr(t){var e;return(e=t.copy)!==null&&e!==void 0?e:t.original}function lc(t){return!!Ft(t)}function Ft(t){return typeof t!="object"?null:t==null?void 0:t[jk]}function IE(t){var e;const n=Ft(t);return n?(e=n.copy)!==null&&e!==void 0?e:n.original:t}function qi(t,e){if(!t||typeof t!="object")return!1;let n;return Object.getPrototypeOf(t)===Object.prototype||Array.isArray(t)||t instanceof Map||t instanceof Set||!!(e!=null&&e.mark)&&((n=e.mark(t,Qr))===Qr.immutable||typeof n=="function")}function Uk(t,e=[]){if(Object.hasOwnProperty.call(t,"key")){const n=t.parent.copy,r=Ft(so(n,t.key));if(r!==null&&(r==null?void 0:r.original)!==t.original)return null;const i=t.parent.type===3,s=i?Array.from(t.parent.setMap.keys()).indexOf(t.key):t.key;if(!(i&&n.size>s||_d(n,s)))return null;e.push(s)}if(t.parent)return Uk(t.parent,e);e.reverse();try{OG(t.copy,e)}catch{return null}return e}function Cc(t){return Array.isArray(t)?1:t instanceof Map?2:t instanceof Set?3:0}function so(t,e){return Cc(t)===2?t.get(e):t[e]}function up(t,e,n){Cc(t)===2?t.set(e,n):t[e]=n}function Rv(t,e){const n=Ft(t);return(n?Gr(n):t)[e]}function Qs(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function Kb(t){if(t)for(;t.finalities.revoke.length>0;)t.finalities.revoke.pop()()}function La(t,e){return e?t:[""].concat(t).map(n=>{const r=`${n}`;return r.indexOf("/")===-1&&r.indexOf("~")===-1?r:r.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function OG(t,e){for(let n=0;n<e.length-1;n+=1){const r=e[n];if(t=so(Cc(t)===3?Array.from(t):t,r),typeof t!="object")throw new Error(`Cannot resolve patch at '${e.join("/")}'.`)}return t}function CG(t){const e=Object.create(Object.getPrototypeOf(t));return Reflect.ownKeys(t).forEach(n=>{let r=Reflect.getOwnPropertyDescriptor(t,n);if(r.enumerable&&r.configurable&&r.writable){e[n]=t[n];return}r.writable||(r.writable=!0,r.configurable=!0),(r.get||r.set)&&(r={configurable:!0,writable:!0,enumerable:r.enumerable,value:t[n]}),Reflect.defineProperty(e,n,r)}),e}const RG=Object.prototype.propertyIsEnumerable;function Bk(t,e){let n;if(Array.isArray(t))return Array.prototype.concat.call(t);if(t instanceof Set){if(!xE(t)){const r=Object.getPrototypeOf(t).constructor;return new r(t.values())}return Set.prototype.difference?Set.prototype.difference.call(t,new Set):new Set(t.values())}else if(t instanceof Map){if(!TE(t)){const r=Object.getPrototypeOf(t).constructor;return new r(t)}return new Map(t)}else if(e!=null&&e.mark&&(n=e.mark(t,Qr),n!==void 0)&&n!==Qr.mutable){if(n===Qr.immutable)return CG(t);if(typeof n=="function"){if(e.enablePatches||e.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return n()}throw new Error(`Unsupported mark result: ${n}`)}else if(typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i]}),Object.getOwnPropertySymbols(t).forEach(i=>{RG.call(t,i)&&(r[i]=t[i])}),r}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function _r(t){t.copy||(t.copy=Bk(t.original,t.options))}function rd(t){if(!qi(t))return IE(t);if(Array.isArray(t))return t.map(rd);if(t instanceof Map){const n=Array.from(t.entries()).map(([r,i])=>[r,rd(i)]);if(!TE(t)){const r=Object.getPrototypeOf(t).constructor;return new r(n)}return new Map(n)}if(t instanceof Set){const n=Array.from(t).map(rd);if(!xE(t)){const r=Object.getPrototypeOf(t).constructor;return new r(n)}return new Set(n)}const e=Object.create(Object.getPrototypeOf(t));for(const n in t)e[n]=rd(t[n]);return e}function Uh(t){return lc(t)?rd(t):t}function _s(t){var e;t.assignedMap=(e=t.assignedMap)!==null&&e!==void 0?e:new Map,t.operated||(t.operated=!0,t.parent&&_s(t.parent))}function IT(){throw new Error("Cannot modify frozen object")}function nl(t,e,n,r,i){{n=n??new WeakMap,r=r??[],i=i??[];const o=n.has(t)?n.get(t):t;if(r.length>0){const a=r.indexOf(o);if(o&&typeof o=="object"&&a!==-1)throw r[0]===o?new Error("Forbids circular reference"):new Error(`Forbids circular reference: ~/${i.slice(0,a).map((c,l)=>{if(typeof c=="symbol")return`[${c.toString()}]`;const u=r[l];return typeof c=="object"&&(u instanceof Map||u instanceof Set)?Array.from(u.keys()).indexOf(c):c}).join("/")}`);r.push(o),i.push(e)}else r.push(o)}if(Object.isFrozen(t)||lc(t)){r.pop(),i.pop();return}switch(Cc(t)){case 2:for(const[a,c]of t)nl(a,a,n,r,i),nl(c,a,n,r,i);t.set=t.clear=t.delete=IT;break;case 3:for(const a of t)nl(a,a,n,r,i);t.add=t.clear=t.delete=IT;break;case 1:Object.freeze(t);let o=0;for(const a of t)nl(a,o,n,r,i),o+=1;break;default:Object.freeze(t),Object.keys(t).forEach(a=>{const c=t[a];nl(c,a,n,r,i)})}r.pop(),i.pop()}function OE(t,e){const n=Cc(t);if(n===0)Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)});else if(n===1){let r=0;for(const i of t)e(r,i,t),r+=1}else t.forEach((r,i)=>e(i,r,t))}function zk(t,e,n){if(lc(t)||!qi(t,n)||e.has(t)||Object.isFrozen(t))return;const r=t instanceof Set,i=r?new Map:void 0;if(e.add(t),OE(t,(s,o)=>{var a;if(lc(o)){const c=Ft(o);_r(c);const l=!((a=c.assignedMap)===null||a===void 0)&&a.size||c.operated?c.copy:c.original;up(r?i:t,s,l)}else zk(o,e,n)}),i){const s=t,o=Array.from(s);s.clear(),o.forEach(a=>{s.add(i.has(a)?i.get(a):a)})}}function DG(t,e){const n=t.type===3?t.setMap:t.copy;t.finalities.revoke.length>1&&t.assignedMap.get(e)&&n&&zk(so(n,e),t.finalities.handledSet,t.options)}function Jb(t){t.type===3&&t.copy&&(t.copy.clear(),t.setMap.forEach(e=>{t.copy.add(IE(e))}))}function Xb(t,e,n,r){if(t.operated&&t.assignedMap&&t.assignedMap.size>0&&!t.finalized){if(n&&r){const s=Uk(t);s&&e(t,s,n,r)}t.finalized=!0}}function CE(t,e,n,r){const i=Ft(n);i&&(i.callbacks||(i.callbacks=[]),i.callbacks.push((s,o)=>{var a;const c=t.type===3?t.setMap:t.copy;if(Qs(so(c,e),n)){let l=i.original;i.copy&&(l=i.copy),Jb(t),Xb(t,r,s,o),t.options.enableAutoFreeze&&(t.options.updatedValues=(a=t.options.updatedValues)!==null&&a!==void 0?a:new WeakMap,t.options.updatedValues.set(l,i.original)),up(c,e,l)}}),t.options.enableAutoFreeze&&i.finalities!==t.finalities&&(t.options.enableAutoFreeze=!1)),qi(n,t.options)&&t.finalities.draft.push(()=>{const s=t.type===3?t.setMap:t.copy;Qs(so(s,e),n)&&DG(t,e)})}function kG(t,e,n,r,i){let{original:s,assignedMap:o,options:a}=t,c=t.copy;c.length<s.length&&([s,c]=[c,s],[n,r]=[r,n]);for(let l=0;l<s.length;l+=1)if(o.get(l.toString())&&c[l]!==s[l]){const u=e.concat([l]),d=La(u,i);n.push({op:An.Replace,path:d,value:Uh(c[l])}),r.push({op:An.Replace,path:d,value:Uh(s[l])})}for(let l=s.length;l<c.length;l+=1){const u=e.concat([l]),d=La(u,i);n.push({op:An.Add,path:d,value:Uh(c[l])})}if(s.length<c.length){const{arrayLengthAssignment:l=!0}=a.enablePatches;if(l){const u=e.concat(["length"]),d=La(u,i);r.push({op:An.Replace,path:d,value:s.length})}else for(let u=c.length;s.length<u;u-=1){const d=e.concat([u-1]),f=La(d,i);r.push({op:An.Remove,path:f})}}}function AG({original:t,copy:e,assignedMap:n},r,i,s,o){n.forEach((a,c)=>{const l=so(t,c),u=Uh(so(e,c)),d=a?_d(t,c)?An.Replace:An.Add:An.Remove;if(Qs(l,u)&&d===An.Replace)return;const f=r.concat(c),p=La(f,o);i.push(d===An.Remove?{op:d,path:p}:{op:d,path:p,value:u}),s.push(d===An.Add?{op:An.Remove,path:p}:d===An.Remove?{op:An.Add,path:p,value:l}:{op:An.Replace,path:p,value:l})})}function NG({original:t,copy:e},n,r,i,s){let o=0;t.forEach(a=>{if(!e.has(a)){const c=n.concat([o]),l=La(c,s);r.push({op:An.Remove,path:l,value:a}),i.unshift({op:An.Add,path:l,value:a})}o+=1}),o=0,e.forEach(a=>{if(!t.has(a)){const c=n.concat([o]),l=La(c,s);r.push({op:An.Add,path:l,value:a}),i.unshift({op:An.Remove,path:l,value:a})}o+=1})}function hf(t,e,n,r){const{pathAsArray:i=!0}=t.options.enablePatches;switch(t.type){case 0:case 2:return AG(t,e,n,r,i);case 1:return kG(t,e,n,r,i);case 3:return NG(t,e,n,r,i)}}let Qb=!1;const Pm=(t,e,n=!1)=>{if(typeof t=="object"&&t!==null&&(!qi(t,e)||n)&&!Qb)throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")};function PG(t){Qb=!0;let e;try{e=t()}finally{Qb=!1}return e}const e_={get size(){return Gr(Ft(this)).size},has(t){return Gr(Ft(this)).has(t)},set(t,e){const n=Ft(this),r=Gr(n);return(!r.has(t)||!Qs(r.get(t),e))&&(_r(n),_s(n),n.assignedMap.set(t,!0),n.copy.set(t,e),CE(n,t,e,hf)),this},delete(t){if(!this.has(t))return!1;const e=Ft(this);return _r(e),_s(e),e.original.has(t)?e.assignedMap.set(t,!1):e.assignedMap.delete(t),e.copy.delete(t),!0},clear(){const t=Ft(this);if(this.size){_r(t),_s(t),t.assignedMap=new Map;for(const[e]of t.original)t.assignedMap.set(e,!1);t.copy.clear()}},forEach(t,e){const n=Ft(this);Gr(n).forEach((r,i)=>{t.call(e,this.get(i),i,this)})},get(t){var e,n;const r=Ft(this),i=Gr(r).get(t),s=((n=(e=r.options).mark)===null||n===void 0?void 0:n.call(e,i,Qr))===Qr.mutable;if(r.options.strict&&Pm(i,r.options,s),s||r.finalized||!qi(i,r.options)||i!==r.original.get(t))return i;const o=SE.createDraft({original:i,parentDraft:r,key:t,finalities:r.finalities,options:r.options});return _r(r),r.copy.set(t,o),o},keys(){return Gr(Ft(this)).keys()},values(){const t=this.keys();return{[jh]:()=>this.values(),next:()=>{const e=t.next();return e.done?e:{done:!1,value:this.get(e.value)}}}},entries(){const t=this.keys();return{[jh]:()=>this.entries(),next:()=>{const e=t.next();if(e.done)return e;const n=this.get(e.value);return{done:!1,value:[e.value,n]}}}},[jh](){return this.entries()}},MG=Reflect.ownKeys(e_),OT=(t,e,{isValuesIterator:n})=>()=>{var r,i;const s=e.next();if(s.done)return s;const o=s.value;let a=t.setMap.get(o);const c=Ft(a),l=((i=(r=t.options).mark)===null||i===void 0?void 0:i.call(r,a,Qr))===Qr.mutable;if(t.options.strict&&Pm(o,t.options,l),!l&&!c&&qi(o,t.options)&&!t.finalized&&t.original.has(o)){const u=SE.createDraft({original:o,parentDraft:t,key:o,finalities:t.finalities,options:t.options});t.setMap.set(o,u),a=u}else c&&(a=c.proxy);return{done:!1,value:n?a:[a,a]}},Mm={get size(){return Ft(this).setMap.size},has(t){const e=Ft(this);if(e.setMap.has(t))return!0;_r(e);const n=Ft(t);return!!(n&&e.setMap.has(n.original))},add(t){const e=Ft(this);return this.has(t)||(_r(e),_s(e),e.assignedMap.set(t,!0),e.setMap.set(t,t),CE(e,t,t,hf)),this},delete(t){if(!this.has(t))return!1;const e=Ft(this);_r(e),_s(e);const n=Ft(t);return n&&e.setMap.has(n.original)?(e.assignedMap.set(n.original,!1),e.setMap.delete(n.original)):(!n&&e.setMap.has(t)?e.assignedMap.set(t,!1):e.assignedMap.delete(t),e.setMap.delete(t))},clear(){if(!this.size)return;const t=Ft(this);_r(t),_s(t);for(const e of t.original)t.assignedMap.set(e,!1);t.setMap.clear()},values(){const t=Ft(this);_r(t);const e=t.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:OT(t,e,{isValuesIterator:!0})}},entries(){const t=Ft(this);_r(t);const e=t.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:OT(t,e,{isValuesIterator:!1})}},keys(){return this.values()},[jh](){return this.values()},forEach(t,e){const n=this.values();let r=n.next();for(;!r.done;)t.call(e,r.value,r.value,this),r=n.next()}};Set.prototype.difference&&Object.assign(Mm,{intersection(t){return Set.prototype.intersection.call(new Set(this.values()),t)},union(t){return Set.prototype.union.call(new Set(this.values()),t)},difference(t){return Set.prototype.difference.call(new Set(this.values()),t)},symmetricDifference(t){return Set.prototype.symmetricDifference.call(new Set(this.values()),t)},isSubsetOf(t){return Set.prototype.isSubsetOf.call(new Set(this.values()),t)},isSupersetOf(t){return Set.prototype.isSupersetOf.call(new Set(this.values()),t)},isDisjointFrom(t){return Set.prototype.isDisjointFrom.call(new Set(this.values()),t)}});const LG=Reflect.ownKeys(Mm),Vk=new WeakSet,Hk={get(t,e,n){var r,i;const s=(r=t.copy)===null||r===void 0?void 0:r[e];if(s&&Vk.has(s))return s;if(e===jk)return t;let o;if(t.options.mark){const l=e==="size"&&(t.original instanceof Map||t.original instanceof Set)?Reflect.get(t.original,e):Reflect.get(t.original,e,n);if(o=t.options.mark(l,Qr),o===Qr.mutable)return t.options.strict&&Pm(l,t.options,!0),l}const a=Gr(t);if(a instanceof Map&&MG.includes(e)){if(e==="size")return Object.getOwnPropertyDescriptor(e_,"size").get.call(t.proxy);const l=e_[e];if(l)return l.bind(t.proxy)}if(a instanceof Set&&LG.includes(e)){if(e==="size")return Object.getOwnPropertyDescriptor(Mm,"size").get.call(t.proxy);const l=Mm[e];if(l)return l.bind(t.proxy)}if(!_d(a,e)){const l=TT(a,e);return l?"value"in l?l.value:(i=l.get)===null||i===void 0?void 0:i.call(t.proxy):void 0}const c=a[e];if(t.options.strict&&Pm(c,t.options),t.finalized||!qi(c,t.options))return c;if(c===Rv(t.original,e)){if(_r(t),t.copy[e]=RE({original:t.original[e],parentDraft:t,key:t.type===1?Number(e):e,finalities:t.finalities,options:t.options}),typeof o=="function"){const l=Ft(t.copy[e]);return _r(l),_s(l),l.copy}return t.copy[e]}return c},set(t,e,n){var r;if(t.type===3||t.type===2)throw new Error("Map/Set draft does not support any property assignment.");let i;if(t.type===1&&e!=="length"&&!(Number.isInteger(i=Number(e))&&i>=0&&(e===0||i===0||String(i)===String(e))))throw new Error("Only supports setting array indices and the 'length' property.");const s=TT(Gr(t),e);if(s!=null&&s.set)return s.set.call(t.proxy,n),!0;const o=Rv(Gr(t),e),a=Ft(o);return a&&Qs(a.original,n)?(t.copy[e]=n,t.assignedMap=(r=t.assignedMap)!==null&&r!==void 0?r:new Map,t.assignedMap.set(e,!1),!0):(Qs(n,o)&&(n!==void 0||_d(t.original,e))||(_r(t),_s(t),_d(t.original,e)&&Qs(n,t.original[e])?t.assignedMap.delete(e):t.assignedMap.set(e,!0),t.copy[e]=n,CE(t,e,n,hf)),!0)},has(t,e){return e in Gr(t)},ownKeys(t){return Reflect.ownKeys(Gr(t))},getOwnPropertyDescriptor(t,e){const n=Gr(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},getPrototypeOf(t){return Reflect.getPrototypeOf(t.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(t,e){var n;return t.type===1?Hk.set.call(this,t,e,void 0,t.proxy):(Rv(t.original,e)!==void 0||e in t.original?(_r(t),_s(t),t.assignedMap.set(e,!1)):(t.assignedMap=(n=t.assignedMap)!==null&&n!==void 0?n:new Map,t.assignedMap.delete(e)),t.copy&&delete t.copy[e],!0)}};function RE(t){const{original:e,parentDraft:n,key:r,finalities:i,options:s}=t,o=Cc(e),a={type:o,finalized:!1,parent:n,original:e,copy:null,proxy:null,finalities:i,options:s,setMap:o===3?new Map(e.entries()):void 0};(r||"key"in t)&&(a.key=r);const{proxy:c,revoke:l}=Proxy.revocable(o===1?Object.assign([],a):a,Hk);if(i.revoke.push(l),Vk.add(c),a.proxy=c,n){const u=n;u.finalities.draft.push((d,f)=>{var p,m;const h=Ft(c);let g=u.type===3?u.setMap:u.copy;const y=so(g,r),v=Ft(y);if(v){let b=v.original;v.operated&&(b=IE(y)),Jb(v),Xb(v,hf,d,f),u.options.enableAutoFreeze&&(u.options.updatedValues=(p=u.options.updatedValues)!==null&&p!==void 0?p:new WeakMap,u.options.updatedValues.set(b,v.original)),up(g,r,b)}(m=h.callbacks)===null||m===void 0||m.forEach(b=>{b(d,f)})})}else{const u=Ft(c);u.finalities.draft.push((d,f)=>{Jb(u),Xb(u,hf,d,f)})}return c}SE.createDraft=RE;function FG(t,e,n,r,i){var s;const o=Ft(t),a=(s=o==null?void 0:o.original)!==null&&s!==void 0?s:t,c=!!e.length;if(o!=null&&o.operated)for(;o.finalities.draft.length>0;)o.finalities.draft.pop()(n,r);const l=c?e[0]:o?o.operated?o.copy:o.original:t;return o&&Kb(o),i&&nl(l,l,o==null?void 0:o.options.updatedValues),[l,n&&c?[{op:An.Replace,path:[],value:e[0]}]:n,r&&c?[{op:An.Replace,path:[],value:a}]:r]}function $G(t,e){var n;const r={draft:[],revoke:[],handledSet:new WeakSet};let i,s;e.enablePatches&&(i=[],s=[]);const a=((n=e.mark)===null||n===void 0?void 0:n.call(e,t,Qr))===Qr.mutable||!qi(t,e)?t:RE({original:t,parentDraft:null,finalities:r,options:e});return[a,(c=[])=>{const[l,u,d]=FG(a,c,i,s,e.enableAutoFreeze);return e.enablePatches?[l,u,d]:l}]}function t_(t){const{rootDraft:e,value:n,useRawReturn:r=!1,isRoot:i=!0}=t;OE(n,(s,o,a)=>{const c=Ft(o);if(c&&e&&c.finalities===e.finalities){t.isContainDraft=!0;const l=c.original;if(a instanceof Set){const u=Array.from(a);a.clear(),u.forEach(d=>a.add(s===d?l:d))}else up(a,s,l)}else typeof o=="object"&&o!==null&&(t.value=o,t.isRoot=!1,t_(t))}),i&&(t.isContainDraft||console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."),r&&console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."))}function Wk(t){var e;const n=Ft(t);if(!qi(t,n==null?void 0:n.options))return t;const r=Cc(t);if(n&&!n.operated)return n.original;let i;function s(){i=r===2?TE(t)?new Map(t):new(Object.getPrototypeOf(t)).constructor(t):r===3?Array.from(n.setMap.values()):Bk(t,n==null?void 0:n.options)}if(n){n.finalized=!0;try{s()}finally{n.finalized=!1}}else i=t;if(OE(i,(o,a)=>{if(n&&Qs(so(n.original,o),a))return;const c=Wk(a);c!==a&&(i===t&&s(),up(i,o,c))}),r===3){const o=(e=n==null?void 0:n.original)!==null&&e!==void 0?e:i;return xE(o)?new Set(i):new(Object.getPrototypeOf(o)).constructor(i)}return i}function CT(t){if(!lc(t))throw new Error(`current() is only used for Draft, parameter: ${t}`);return Wk(t)}const jG=t=>function e(n,r,i){var s,o,a;if(typeof n=="function"&&typeof r!="function")return function(w,...S){return e(w,_=>n.call(this,_,...S),r)};const c=n,l=r;let u=i;if(typeof r!="function"&&(u=r),u!==void 0&&Object.prototype.toString.call(u)!=="[object Object]")throw new Error(`Invalid options: ${u}, 'options' should be an object.`);u=Object.assign(Object.assign({},t),u);const d=lc(c)?CT(c):c,f=Array.isArray(u.mark)?(w,S)=>{for(const _ of u.mark){if(typeof _!="function")throw new Error(`Invalid mark: ${_}, 'mark' should be a function.`);const O=_(w,S);if(O)return O}}:u.mark,p=(s=u.enablePatches)!==null&&s!==void 0?s:!1,m=(o=u.strict)!==null&&o!==void 0?o:!1,g={enableAutoFreeze:(a=u.enableAutoFreeze)!==null&&a!==void 0?a:!1,mark:f,strict:m,enablePatches:p};if(!qi(d,g)&&typeof d=="object"&&d!==null)throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");const[y,v]=$G(d,g);if(typeof r!="function"){if(!qi(d,g))throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");return[y,v]}let b;try{b=l(y)}catch(w){throw Kb(Ft(y)),w}const E=w=>{const S=Ft(y);if(!lc(w)){if(w!==void 0&&!Qs(w,y)&&(S!=null&&S.operated))throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");const O=w==null?void 0:w[IG];if(O){const M=O[0];return g.strict&&typeof w=="object"&&w!==null&&t_({rootDraft:S,value:w,useRawReturn:!0}),v([M])}if(w!==void 0)return typeof w=="object"&&w!==null&&t_({rootDraft:S,value:w}),v([w])}if(w===y||w===void 0)return v([]);const _=Ft(w);if(g===_.options){if(_.operated)throw new Error("Cannot return a modified child draft.");return v([CT(w)])}return v([w])};return b instanceof Promise?b.then(E,w=>{throw Kb(Ft(y)),w}):E(b)},DE=jG();Object.prototype.constructor.toString();var UG=Object.defineProperty,BG=(t,e,n)=>e in t?UG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qk=(t,e,n)=>BG(t,typeof e!="symbol"?e+"":e,n);const zG=t=>t!=null;ae.any().refine(t=>zG(t));const VG=ae.enum(["LOAD_STATE"]),HG=ae.enum(["PRUNE"]),WG=ae.enum(["REDO"]),qG=ae.enum(["SET_NAME"]),GG=ae.enum(["UNDO"]);function ay(){return ae.literal("global").or(ae.literal("local"))}function ZG(){return ae.union([YG(),JG(),XG(),QG(),e7()])}function YG(){return ae.object({input:ae.lazy(()=>Gk()),type:VG,scope:ay()})}function Gk(){return ae.object({operations:ae.number(),state:ae.lazy(()=>KG())})}function KG(){return ae.object({data:ae.unknown().nullish(),name:ae.string()})}function JG(){return ae.object({input:ae.lazy(()=>Zk()),type:HG,scope:ay()})}function Zk(){return ae.object({end:ae.number().nullish(),start:ae.number().nullish()})}const Yk=ae.number;function XG(){return ae.object({input:Yk(),type:WG,scope:ay()})}const Kk=ae.string;function QG(){return ae.object({input:Kk(),type:qG,scope:ae.literal("global")})}const Jk=ae.number;function e7(){return ae.object({input:Jk(),type:GG,scope:ay()})}function t7(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var eh={exports:{}},RT;function n7(){return RT||(RT=1,function(t,e){const{hasOwnProperty:n}=Object.prototype,r=y();r.configure=y,r.stringify=r,r.default=r,e.stringify=r,e.configure=y,t.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(v){return v.length<5e3&&!i.test(v)?`"${v}"`:JSON.stringify(v)}function o(v,b){if(v.length>200||b)return v.sort(b);for(let E=1;E<v.length;E++){const w=v[E];let S=E;for(;S!==0&&v[S-1]>w;)v[S]=v[S-1],S--;v[S]=w}return v}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(v){return a.call(v)!==void 0&&v.length!==0}function l(v,b,E){v.length<E&&(E=v.length);const w=b===","?"":" ";let S=`"0":${w}${v[0]}`;for(let _=1;_<E;_++)S+=`${b}"${_}":${w}${v[_]}`;return S}function u(v){if(n.call(v,"circularValue")){const b=v.circularValue;if(typeof b=="string")return`"${b}"`;if(b==null)return b;if(b===Error||b===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(v){let b;if(n.call(v,"deterministic")&&(b=v.deterministic,typeof b!="boolean"&&typeof b!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return b===void 0?!0:b}function f(v,b){let E;if(n.call(v,b)&&(E=v[b],typeof E!="boolean"))throw new TypeError(`The "${b}" argument must be of type boolean`);return E===void 0?!0:E}function p(v,b){let E;if(n.call(v,b)){if(E=v[b],typeof E!="number")throw new TypeError(`The "${b}" argument must be of type number`);if(!Number.isInteger(E))throw new TypeError(`The "${b}" argument must be an integer`);if(E<1)throw new RangeError(`The "${b}" argument must be >= 1`)}return E===void 0?1/0:E}function m(v){return v===1?"1 item":`${v} items`}function h(v){const b=new Set;for(const E of v)(typeof E=="string"||typeof E=="number")&&b.add(String(E));return b}function g(v){if(n.call(v,"strict")){const b=v.strict;if(typeof b!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(b)return E=>{let w=`Object can not safely be stringified. Received type ${typeof E}`;throw typeof E!="function"&&(w+=` (${E.toString()})`),new Error(w)}}}function y(v){v={...v};const b=g(v);b&&(v.bigint===void 0&&(v.bigint=!1),"circularValue"in v||(v.circularValue=Error));const E=u(v),w=f(v,"bigint"),S=d(v),_=typeof S=="function"?S:void 0,O=p(v,"maximumDepth"),M=p(v,"maximumBreadth");function F(A,P,B,J,L,G){let U=P[A];switch(typeof U=="object"&&U!==null&&typeof U.toJSON=="function"&&(U=U.toJSON(A)),U=J.call(P,A,U),typeof U){case"string":return s(U);case"object":{if(U===null)return"null";if(B.indexOf(U)!==-1)return E;let C="",Z=",";const H=G;if(Array.isArray(U)){if(U.length===0)return"[]";if(O<B.length+1)return'"[Array]"';B.push(U),L!==""&&(G+=L,C+=`
82
+ ${G}`,Z=`,
83
+ ${G}`);const Ge=Math.min(U.length,M);let st=0;for(;st<Ge-1;st++){const gt=F(String(st),U,B,J,L,G);C+=gt!==void 0?gt:"null",C+=Z}const He=F(String(st),U,B,J,L,G);if(C+=He!==void 0?He:"null",U.length-1>M){const gt=U.length-M-1;C+=`${Z}"... ${m(gt)} not stringified"`}return L!==""&&(C+=`
84
+ ${H}`),B.pop(),`[${C}]`}let V=Object.keys(U);const ce=V.length;if(ce===0)return"{}";if(O<B.length+1)return'"[Object]"';let le="",ge="";L!==""&&(G+=L,Z=`,
85
+ ${G}`,le=" ");const Re=Math.min(ce,M);S&&!c(U)&&(V=o(V,_)),B.push(U);for(let Ge=0;Ge<Re;Ge++){const st=V[Ge],He=F(st,U,B,J,L,G);He!==void 0&&(C+=`${ge}${s(st)}:${le}${He}`,ge=Z)}if(ce>M){const Ge=ce-M;C+=`${ge}"...":${le}"${m(Ge)} not stringified"`,ge=Z}return L!==""&&ge.length>1&&(C=`
86
+ ${G}${C}
87
+ ${H}`),B.pop(),`{${C}}`}case"number":return isFinite(U)?String(U):b?b(U):"null";case"boolean":return U===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(U);default:return b?b(U):void 0}}function q(A,P,B,J,L,G){switch(typeof P=="object"&&P!==null&&typeof P.toJSON=="function"&&(P=P.toJSON(A)),typeof P){case"string":return s(P);case"object":{if(P===null)return"null";if(B.indexOf(P)!==-1)return E;const U=G;let C="",Z=",";if(Array.isArray(P)){if(P.length===0)return"[]";if(O<B.length+1)return'"[Array]"';B.push(P),L!==""&&(G+=L,C+=`
88
+ ${G}`,Z=`,
89
+ ${G}`);const ce=Math.min(P.length,M);let le=0;for(;le<ce-1;le++){const Re=q(String(le),P[le],B,J,L,G);C+=Re!==void 0?Re:"null",C+=Z}const ge=q(String(le),P[le],B,J,L,G);if(C+=ge!==void 0?ge:"null",P.length-1>M){const Re=P.length-M-1;C+=`${Z}"... ${m(Re)} not stringified"`}return L!==""&&(C+=`
90
+ ${U}`),B.pop(),`[${C}]`}B.push(P);let H="";L!==""&&(G+=L,Z=`,
91
+ ${G}`,H=" ");let V="";for(const ce of J){const le=q(ce,P[ce],B,J,L,G);le!==void 0&&(C+=`${V}${s(ce)}:${H}${le}`,V=Z)}return L!==""&&V.length>1&&(C=`
92
+ ${G}${C}
93
+ ${U}`),B.pop(),`{${C}}`}case"number":return isFinite(P)?String(P):b?b(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(P);default:return b?b(P):void 0}}function I(A,P,B,J,L){switch(typeof P){case"string":return s(P);case"object":{if(P===null)return"null";if(typeof P.toJSON=="function"){if(P=P.toJSON(A),typeof P!="object")return I(A,P,B,J,L);if(P===null)return"null"}if(B.indexOf(P)!==-1)return E;const G=L;if(Array.isArray(P)){if(P.length===0)return"[]";if(O<B.length+1)return'"[Array]"';B.push(P),L+=J;let le=`
94
+ ${L}`;const ge=`,
95
+ ${L}`,Re=Math.min(P.length,M);let Ge=0;for(;Ge<Re-1;Ge++){const He=I(String(Ge),P[Ge],B,J,L);le+=He!==void 0?He:"null",le+=ge}const st=I(String(Ge),P[Ge],B,J,L);if(le+=st!==void 0?st:"null",P.length-1>M){const He=P.length-M-1;le+=`${ge}"... ${m(He)} not stringified"`}return le+=`
96
+ ${G}`,B.pop(),`[${le}]`}let U=Object.keys(P);const C=U.length;if(C===0)return"{}";if(O<B.length+1)return'"[Object]"';L+=J;const Z=`,
97
+ ${L}`;let H="",V="",ce=Math.min(C,M);c(P)&&(H+=l(P,Z,M),U=U.slice(P.length),ce-=P.length,V=Z),S&&(U=o(U,_)),B.push(P);for(let le=0;le<ce;le++){const ge=U[le],Re=I(ge,P[ge],B,J,L);Re!==void 0&&(H+=`${V}${s(ge)}: ${Re}`,V=Z)}if(C>M){const le=C-M;H+=`${V}"...": "${m(le)} not stringified"`,V=Z}return V!==""&&(H=`
98
+ ${L}${H}
99
+ ${G}`),B.pop(),`{${H}}`}case"number":return isFinite(P)?String(P):b?b(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(P);default:return b?b(P):void 0}}function $(A,P,B){switch(typeof P){case"string":return s(P);case"object":{if(P===null)return"null";if(typeof P.toJSON=="function"){if(P=P.toJSON(A),typeof P!="object")return $(A,P,B);if(P===null)return"null"}if(B.indexOf(P)!==-1)return E;let J="";const L=P.length!==void 0;if(L&&Array.isArray(P)){if(P.length===0)return"[]";if(O<B.length+1)return'"[Array]"';B.push(P);const H=Math.min(P.length,M);let V=0;for(;V<H-1;V++){const le=$(String(V),P[V],B);J+=le!==void 0?le:"null",J+=","}const ce=$(String(V),P[V],B);if(J+=ce!==void 0?ce:"null",P.length-1>M){const le=P.length-M-1;J+=`,"... ${m(le)} not stringified"`}return B.pop(),`[${J}]`}let G=Object.keys(P);const U=G.length;if(U===0)return"{}";if(O<B.length+1)return'"[Object]"';let C="",Z=Math.min(U,M);L&&c(P)&&(J+=l(P,",",M),G=G.slice(P.length),Z-=P.length,C=","),S&&(G=o(G,_)),B.push(P);for(let H=0;H<Z;H++){const V=G[H],ce=$(V,P[V],B);ce!==void 0&&(J+=`${C}${s(V)}:${ce}`,C=",")}if(U>M){const H=U-M;J+=`${C}"...":"${m(H)} not stringified"`}return B.pop(),`{${J}}`}case"number":return isFinite(P)?String(P):b?b(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(w)return String(P);default:return b?b(P):void 0}}function x(A,P,B){if(arguments.length>1){let J="";if(typeof B=="number"?J=" ".repeat(Math.min(B,10)):typeof B=="string"&&(J=B.slice(0,10)),P!=null){if(typeof P=="function")return F("",{"":A},[],P,J,"");if(Array.isArray(P))return q("",A,[],h(P),J,"")}if(J.length!==0)return I("",A,[],J,"")}return $("",A,[])}return x}}(eh,eh.exports)),eh.exports}var r7=n7();const uc=t7(r7);uc.configure;const i7=[1518500249,1859775393,-1894007588,-899497514];function s7(t){return new o7}class o7{constructor(){this.A=1732584193,this.B=-271733879,this.C=-1732584194,this.D=271733878,this.E=-1009589776,this._size=0,this._sp=0,(!th||Vu>=8e3)&&(th=new ArrayBuffer(8e3),Vu=0),this._byte=new Uint8Array(th,Vu,80),this._word=new Int32Array(th,Vu,20),Vu+=80}update(e){if(typeof e=="string")return this._utf8(e);if(e==null)throw new TypeError("Invalid type: "+typeof e);const n=e.byteOffset,r=e.byteLength;let i=r/64|0,s=0;if(i&&!(n&3)&&!(this._size%64)){const a=new Int32Array(e.buffer,n,i*16);for(;i--;)this._int32(a,s>>2),s+=64;this._size+=s}if(e.BYTES_PER_ELEMENT!==1&&e.buffer){const a=new Uint8Array(e.buffer,n+s,r-s);return this._uint8(a)}return s===r?this:this._uint8(e,s)}_uint8(e,n){const{_byte:r,_word:i}=this,s=e.length;for(n=n|0;n<s;){const o=this._size%64;let a=o;for(;n<s&&a<64;)r[a++]=e[n++];a>=64&&this._int32(i),this._size+=a-o}return this}_utf8(e){const{_byte:n,_word:r}=this,i=e.length;let s=this._sp;for(let o=0;o<i;){const a=this._size%64;let c=a;for(;o<i&&c<64;){let l=e.charCodeAt(o++)|0;l<128?n[c++]=l:l<2048?(n[c++]=192|l>>>6,n[c++]=128|l&63):l<55296||l>57343?(n[c++]=224|l>>>12,n[c++]=128|l>>>6&63,n[c++]=128|l&63):s?(l=((s&1023)<<10)+(l&1023)+65536,n[c++]=240|l>>>18,n[c++]=128|l>>>12&63,n[c++]=128|l>>>6&63,n[c++]=128|l&63,s=0):s=l}c>=64&&(this._int32(r),r[0]=r[16]),this._size+=c-a}return this._sp=s,this}_int32(e,n){let{A:r,B:i,C:s,D:o,E:a}=this,c=0;for(n=n|0;c<16;)xa[c++]=So(e[n++]);for(c=16;c<80;c++)xa[c]=l7(xa[c-3]^xa[c-8]^xa[c-14]^xa[c-16]);for(c=0;c<80;c++){const l=c/20|0,u=u7(r)+f7(l,i,s,o)+a+xa[c]+i7[l]|0;a=o,o=s,s=d7(i),i=r,r=u}this.A=r+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=o+this.D|0,this.E=a+this.E|0}digest(e){const{_byte:n,_word:r}=this;let i=this._size%64|0;for(n[i++]=128;i&3;)n[i++]=0;if(i>>=2,i>14){for(;i<16;)r[i++]=0;i=0,this._int32(r)}for(;i<16;)r[i++]=0;const s=this._size*8,o=(s&4294967295)>>>0,a=(s-o)/4294967296;return a&&(r[14]=So(a)),o&&(r[15]=So(o)),this._int32(r),e==="hex"?this._hex():this._bin()}_hex(){const{A:e,B:n,C:r,D:i,E:s}=this;return Hu(e)+Hu(n)+Hu(r)+Hu(i)+Hu(s)}_bin(){const{A:e,B:n,C:r,D:i,E:s,_byte:o,_word:a}=this;return a[0]=So(e),a[1]=So(n),a[2]=So(r),a[3]=So(i),a[4]=So(s),o.slice(0,20)}}const xa=new Int32Array(80);let th,Vu=0;const Hu=t=>(t+4294967296).toString(16).substr(-8),a7=t=>t<<24&4278190080|t<<8&16711680|t>>8&65280|t>>24&255,c7=t=>t,So=p7()?c7:a7,l7=t=>t<<1|t>>>31,u7=t=>t<<5|t>>>27,d7=t=>t<<30|t>>>2;function f7(t,e,n,r){return t===0?e&n|~e&r:t===2?e&n|e&r|n&r:e^n^r}function p7(){return new Uint8Array(new Uint16Array([65279]).buffer)[0]===254}const kE=new Error("File system not available.");function h7(){if(!crypto.randomUUID)throw new Error("generateUUID is not available in unsecure contexts.");return crypto.randomUUID()}function m7(t,e,n){throw kE}function Xk(t){throw kE}function g7(t){throw kE}const y7=async t=>Xk(),dp=(t,e="sha1")=>{if(!["sha1"].includes(e))throw new Error("Hashing algorithm not supported: Available: sha1");const n=b7(t);return v7(n)};function v7(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function b7(t,e="sha1"){if(!["sha1"].includes(e))throw new Error("Hashing algorithm not supported: Available: sha1");return s7().update(t).digest()}function AE(t){if(t&&t.toString()!=="UUIDv4")throw new Error(`Id generation method not supported: "${t.toString()}"`);return h7()}function Qk(t){return(new Date(t).getTime()/1e3).toFixed(0)}function eA({documentId:t,signer:e,operation:n,previousStateHash:r}){const{timestamp:i,scope:s,id:o,type:a}=n;return[Qk(i),e.app.key,dp([t,s,o,a,uc(n.input)].join("")),r]}const _7=new TextEncoder;function NE(t){const e=t.join(""),n=`Signed Operation:
100
+ `+e.length.toString();return _7.encode(n+e)}function tA(t){const e=ArrayBuffer.isView(t)?t:new Uint8Array(t);return Array.prototype.map.call(e,n=>("00"+n.toString(16)).slice(-2)).join("")}function nA(t){var e;return new Uint8Array(((e=t.match(/[\da-f]{2}/gi))==null?void 0:e.map(function(n){return parseInt(n,16)}))??[])}async function rA(t,e){const n=eA(t),r=NE(n),i=await e(r);return[...n,`0x${tA(i)}`]}async function w7(t,e,n,r,i){var s,o;const a=e(n,t,void 0,{reuseHash:!0,reuseOperationResultingState:!0}),c=a.operations[t.scope].at(-1);if(!c)throw new Error("Action was not applied");const l=((s=a.operations[t.scope].at(-2))==null?void 0:s.hash)??"",u=await rA({...r,operation:c,previousStateHash:l},i);return{...c,context:{...c.context,signer:{...(o=c.context)==null?void 0:o.signer,...r.signer,signatures:[...r.signer.signatures??[],u]}}}}async function E7(t,e,n){const r=e.app.key,i=t.slice(0,4),s=nA(t[4]),o=NE(i);return n(r,s,o)}class PE extends Error{constructor(e){super(),qk(this,"data"),this.name="InvalidActionInputError",this.data=e,this.message=this.message||`Invalid action input: ${JSON.stringify(e,null,2)}`}}class iA extends PE{constructor(e){super(e),qk(this,"issues"),this.issues=e,this.name="InvalidActionInputZodError"}}const sA={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(sA);var li=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)},rl,id,Ca;class S7{constructor(...e){rl.set(this,new Map),id.set(this,new Map),Ca.set(this,new Map);for(const n of e)this.define(n)}define(e,n=!1){for(let[r,i]of Object.entries(e)){r=r.toLowerCase(),i=i.map(a=>a.toLowerCase()),li(this,Ca,"f").has(r)||li(this,Ca,"f").set(r,new Set);const s=li(this,Ca,"f").get(r);let o=!0;for(let a of i){const c=a.startsWith("*");if(a=c?a.slice(1):a,s==null||s.add(a),o&&li(this,id,"f").set(r,a),o=!1,c)continue;const l=li(this,rl,"f").get(a);if(l&&l!=r&&!n)throw new Error(`"${r} -> ${a}" conflicts with "${l} -> ${a}". Pass \`force=true\` to override this definition.`);li(this,rl,"f").set(a,r)}}return this}getType(e){if(typeof e!="string")return null;const n=e.replace(/^.*[/\\]/,"").toLowerCase(),r=n.replace(/^.*\./,"").toLowerCase(),i=n.length<e.length;return!(r.length<n.length-1)&&i?null:li(this,rl,"f").get(r)??null}getExtension(e){var n;return typeof e!="string"?null:(e=(n=e==null?void 0:e.split)==null?void 0:n.call(e,";")[0],(e&&li(this,id,"f").get(e.trim().toLowerCase()))??null)}getAllExtensions(e){return typeof e!="string"?null:li(this,Ca,"f").get(e.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of li(this,Ca,"f").values())Object.freeze(e);return this}_getTestState(){return{types:li(this,rl,"f"),extensions:li(this,id,"f")}}}rl=new WeakMap,id=new WeakMap,Ca=new WeakMap;const x7=new S7(sA)._freeze();function oA(t){const e=[],n=Object.keys(t);for(const r of n){const i=t[r].sort((o,a)=>o.index-a.index);let s=-1;for(let o=0;o<i.length;o++)s=s+1+i[o].skip,i[o].index!==s&&e.push({message:`Invalid operation index ${i[o].index} at position ${o}`,details:{position:o,operation:i[o],scope:i[o].scope}})}return e}var aA=(t=>(t.UNEXPECTED_INDEX="UNEXPECTED_INDEX",t))(aA||{}),cA=(t=>(t.DUPLICATED_INDEX="DUPLICATED_INDEX",t.MISSING_INDEX="MISSING_INDEX",t))(cA||{});function ME(t){const e=[];let n=-1;for(const r of t){const i=r.index-r.skip;i!==n+1&&e.push({operation:{index:r.index,skip:r.skip},issue:"UNEXPECTED_INDEX",category:i>n+1?"MISSING_INDEX":"DUPLICATED_INDEX",message:`Expected index ${n+1} with skip 0 or equivalent, got index ${r.index} with skip ${r.skip}`}),n=r.index}return e}function $i(t){var e,n,r;const i=[];let s=t.length-1;for(;s>-1;){i.unshift(t[s]);const o=(((e=t[s])==null?void 0:e.index)||0)-(((n=t[s])==null?void 0:n.skip)||0)-1;let a=s-1;for(;a>-1&&(((r=t[a])==null?void 0:r.index)||0)>o;)a--;s=a}return i}function T7(t){const e=[...t],n=e[e.length-1];return n&&(n.type==="NOOP"?e.push({...n,index:n.index,type:"NOOP",skip:FE(t)}):e.push({type:"NOOP",index:n.index+1,timestamp:new Date().toISOString(),input:{},skip:1,scope:n.scope,hash:n.hash})),e}function gi(t){return t.slice().sort((e,n)=>e.skip-n.skip).sort((e,n)=>e.index-n.index)}const I7=(t,e,n)=>[...e,...n].sort((r,i)=>new Date(r.timestamp).getTime()-new Date(i.timestamp).getTime()).map((r,i)=>({...r,index:t.index+i,skip:i===0?t.skip:0})),O7=(t,e,n)=>[...e,...n].sort((r,i)=>new Date(r.timestamp).getTime()-new Date(i.timestamp).getTime()).sort((r,i)=>r.index-i.index).map((r,i)=>({...r,index:t.index+i,skip:i===0?t.skip:0}));function LE(t,e){return uc(t)===uc(e)}function C7(t,e){const n=$i(gi(t.slice())),r=$i(gi(e.slice()));if(n.length<1)return[r,[]];const i=[];let s=!1;for(;r.length>0;){const o=r[0];let a=n.shift();for(;a&&lA(a,o);)i.push(a),a=n.shift();if(a?s||(LE(a,o)?(r.shift(),i.push(a)):(n.unshift(a),s=!0)):s=!0,s){let c=r.shift();for(;c;)i.push(c),c=r.shift()}}if(!s){let o=n.shift();for(;o;)i.push(o),o=n.shift()}return[$i(i),n]}function lA(t,e){return t.index<e.index||t.index===e.index&&t.id===e.id&&t.skip<e.skip}function uA(t,e){const n=[],r=[],i=[],s=Math.max(t.length,e.length);let o=!1;for(let a=0;a<s;a++){const c=t[a],l=e[a];c&&l?!o&&LE(c,l)?n.push(c):(o=!0,r.push(c),i.push(l)):c?r.push(c):l&&i.push(l)}return[n,r,i]}function R7(t,e,n){const[r,i,s]=uA($i(t),$i(e)),o=Dv(r),a=1+Math.max(o,Dv(i),Dv(s)),c=fA(s,i),l=n({index:a,skip:a-(o+1)},i,c);return r.concat(l)}function Dv(t){const e=t[t.length-1];return e?e.index:-1}function FE(t){var e,n,r;if(t.length<1)return-1;const i=$i(t);let s=(((e=i[i.length-1])==null?void 0:e.skip)||0)+1;return i.length>1&&(s+=((n=i[i.length-2])==null?void 0:n.skip)||0),(((r=i[i.length-1])==null?void 0:r.index)||-1)<s?-1:s}const D7=t=>ME($i(gi(t))),k7=t=>t.reduce((n,r)=>{var i;return n[r.scope]||(n[r.scope]=[]),(i=n[r.scope])==null||i.push(r),n},{}),A7=(t,e)=>{var n;const r={integrityIssues:[],validOperations:[],invalidOperations:[],duplicatedOperations:[]},i=gi(t),s=gi(e),o=ME([...i,...s]),c=(n=[...o.filter(l=>l.category==="MISSING_INDEX")].sort((l,u)=>u.operation.index-l.operation.index).pop())==null?void 0:n.operation;for(const l of s){if(c&&l.index>=c.index){r.invalidOperations.push(l);continue}if(o.some(d=>d.operation.index===l.index&&d.operation.skip===l.skip&&d.category==="DUPLICATED_INDEX")){r.duplicatedOperations.push(l);continue}r.validOperations.push(l)}return r.integrityIssues.push(...o),r};function N7(t,e){return t.filter(n=>!e.some(r=>n.type==="NOOP"&&n.skip===0&&n.index===r.index||n.index===r.index&&n.skip===r.skip&&n.scope===r.scope&&n.hash===r.hash&&n.type===r.type))}function dA(t,e){const[n]=gi(t).slice(-1),r=(n==null?void 0:n.index)??-1,i=r+1,s={...e,index:e.index??i};if(s.index<r)throw new Error(`The skip header operation index must be greater than or equal to ${r}`);return($i(gi([...t,s]))||[]).slice(0,-1)}function mf(t){return{...Object.entries(t).reduce((n,r)=>{const[i,s]=r;return{...n,[i]:$i(gi(s))}},{})}}function fA(t,e){return t.filter(n=>n.id?!e.some(r=>r.id===n.id):!0)}function pA(t){return t?Object.entries(t).reduce((n,[r,i])=>({...n,[r]:i.map(s=>{const{resultingState:o,...a}=s;return a})}),{}):{}}function hA(t,e){return t.filter(n=>!e.some(r=>n.index===r.index))}const P7=Object.freeze(Object.defineProperty({__proto__:null,IntegrityIssueSubType:cA,IntegrityIssueType:aA,addUndo:T7,attachBranch:C7,checkCleanedOperationsIntegrity:ME,checkOperationsIntegrity:D7,diffOperations:hA,filterDocumentOperationsResultingState:pA,filterDuplicatedOperations:fA,garbageCollect:$i,garbageCollectDocumentOperations:mf,groupOperationsByScope:k7,merge:R7,nextSkipNumber:FE,operationsAreEqual:LE,precedes:lA,prepareOperations:A7,removeExistingOperations:N7,reshuffleByTimestamp:I7,reshuffleByTimestampAndIndex:O7,skipHeaderOperations:dA,sortOperations:gi,split:uA},Symbol.toStringTag,{value:"Module"})),$E=async t=>{const e=new $k,{name:n,revision:r,documentType:i,created:s,lastModified:o}=t,a={name:n,revision:r,documentType:i,created:s,lastModified:o};return e.file("header.json",JSON.stringify(a,null,2)),e.file("state.json",JSON.stringify(t.initialState||{},null,2)),e.file("current-state.json",JSON.stringify(t.state||{},null,2)),e.file("operations.json",JSON.stringify(pA(t.operations),null,2)),t.attachments&&Object.keys(t.attachments).forEach(l=>{const{data:u,...d}=t.attachments[l];e.file(l,u,{base64:!0,createFolders:!0,comment:JSON.stringify(d)})}),e},jE=async(t,e,n,r)=>{await(await $E(t)).generateAsync({type:"uint8array",streamFiles:!0});const s=r??t.name,o=`.${n}.zip`;return m7(e,s.endsWith(o)?s:`${s}${o}`)},mA=async(t,e)=>{const r=await(await $E(t)).generateAsync({type:"blob"}),i=await e.createWritable();await i.write(r),await i.close()},Lm=async(t,e,n)=>{const r=Xk();return UE(r,e,n)},UE=async(t,e,n)=>{const r=new $k;return await r.loadAsync(t),M7(r,e,n)};async function M7(t,e,n){const r=t.file("state.json");if(!r)throw new Error("Initial state not found");const i=await r.async("string"),s=JSON.parse(i),o=t.file("header.json");let a;o&&(a=JSON.parse(await o.async("string")));const c=t.file("operations.json");if(!c)throw new Error("Operations history not found");const l=JSON.parse(await c.async("string")),u=mf(l),d=oA(u);if(d.length){const p=d.map(m=>m.message);throw new Error(p.join(`
101
+ `))}let f=HE(s,u,e,void 0,a,{},n);return a&&(f={...f,...a}),f}function gA(t){const e=t.replace(/^.*\./,"")||void 0,n=t.replace(/^.*[/\\]/,"")||void 0;return{extension:e,fileName:n}}async function L7(t){const{buffer:e,mimeType:n="application/octet-stream"}=await g7(),r=gA(t),i=e.toString("base64");return{data:i,hash:dp(i),mimeType:n,...r}}async function F7(t){const e=await y7(),n=x7.getType(t)||"application/octet-stream",r=gA(t),i=e.toString("base64");return{data:i,hash:dp(i),mimeType:n,...r}}function $7(t,e){return{...t,name:e}}function j7(t,e,n){const{scope:r,input:i}=e;return DE({document:t,action:e,skip:n,reuseLastOperationIndex:!1},o=>{const a=[...t.operations[r]],c=gi(a);o.action=AA(r);const l=c.at(-1);let u=(l==null?void 0:l.index)??-1;const d=(l==null?void 0:l.type)!=="NOOP";d?u=u+1:o.reuseLastOperationIndex=!0;const f=d?[...c,{index:u,skip:0}]:c;if(o.skip=FE(f),l&&o.skip>l.skip+1&&(o.skip=o.skip+1),o.skip<0)throw new Error("Cannot undo: you can't undo more operations than the ones in the scope history")})}function U7(t,e,n){const{scope:r,input:i}=e;return DE({document:t,action:e,skip:n,reuseLastOperationIndex:!1},o=>{if(o.skip>0)throw new Error("Cannot redo: skip value from reducer cannot be used with REDO action");if(i>1)throw new Error("Cannot redo: you can only redo one operation at a time");if(i<1)throw new Error("Invalid REDO action: invalid redo input value");if(o.document.clipboard.length<1)throw new Error("Cannot redo: no operations in the clipboard");const a=o.document.clipboard.findLastIndex(l=>l.scope===r);if(a<0)throw new Error(`Cannot redo: no operations in clipboard for scope "${r}"`);const c=o.document.clipboard.splice(a,1)[0];o.action={type:c.type,scope:c.scope,input:c.input}})}function B7(t,e,n){const{scope:r}=e,i=t.operations[r];let{input:{start:s,end:o}}=e;s=s||0,o=o||i.length;const a=i.slice(s,o),c=i.slice(0,s),l=i.slice(o),u=gf(t.initialState,{...t.operations,[r]:c.concat(a)},n),{name:d,state:f}=u,p=c.length,m=c.length?c[c.length-1].timestamp:l.length?l[0].timestamp:new Date().toISOString();return gf(t.initialState,{...t.operations,[r]:[...c,{...WE({name:d,state:f},a.length),timestamp:m,index:p,hash:dc({state:f},"global")},...l.map((h,g)=>({...h,index:p+g+1}))]},n)}function z7(t,e){return{...t,name:e.name,state:e.state??{global:{},local:{}}}}const yA="SET_NAME",Rc="UNDO",_u="REDO",fp="PRUNE",vA="LOAD_STATE",V7="NOOP";function H7(t,e){let n;return"index"in e?n={...e}:n=t.operations[e.scope].at(-1),((n==null?void 0:n.index)??-1)+1}function bA(t,e){return{...t,revision:{...t.revision,[e.scope]:H7(t,e)},lastModified:OA(t)}}function W7(t,e,n=0,r=!1){if([Rc,_u,fp].includes(e.type))return t;const{scope:i}=e,s=t.operations[i].slice();let o;const a=s.at(-1),c=(a==null?void 0:a.index)??-1;let l=r?c:c+1,u=new Date().toISOString();if("index"in e){if(e.index-n>l)throw new Error(`Missing operations: expected ${l} with skip 0 or equivalent, got index ${e.index} with skip ${n}`);l=e.index,o=e.id,u=e.timestamp}else o="id"in e?e.id:AE();return s.push({...e,id:o,index:l,timestamp:u,hash:"",scope:i,skip:n,error:void 0}),{...t,operations:{...t.operations,[i]:s}}}function _A(t,e,n=0,r=!1){let i=W7(t,e,n,r);return i=bA(i,e),i}function wA(t,e,n){switch(ZG().parse(e),e.type){case yA:return $7(t,e.input);case fp:return B7(t,e,n);case vA:return z7(t,e.input.state);default:return t}}function q7(t,e,n){switch(e.type){case Rc:return j7(t,e,n);case _u:return U7(t,e,n);default:return{document:t,action:e,skip:n,reuseLastOperationIndex:!1}}}function EA(t,e,n,r,i=!1,s=cy){const o=e.scope,a=t.operations[o].at(-1);if(!a)return t;const c=mf({...t.operations,[o]:dA(t.operations[o],a)});let l;const u=c[o].at(-1);if(i&&(u!=null&&u.resultingState))l=s(u.resultingState);else{const{state:d}=gf(t.initialState,c,n,void 0,void 0,void 0,void 0,{reuseHash:!0,reuseOperationResultingState:i,operationResultingStateParser:s});l=d[o]}return{...t,state:{...t.state,[o]:l},operations:mf({...t.operations})}}function G7(t,e,n,r=!1,i=cy){const s=[...t.operations[e]],o=gi(s);o.pop();const a=mf({...t.operations}),c=[...a[e]],l=hA($i(o),c),u=gf(t.initialState,a,n,void 0,void 0,void 0,void 0,{reuseHash:!0,reuseOperationResultingState:r,operationResultingStateParser:i}),d=gi([...t.clipboard,...l].filter(f=>f.type!=="NOOP")).reverse();return{...u,clipboard:d}}function SA(t,e,n,r,i={}){const{skip:s,ignoreSkipOperations:o=!1,reuseHash:a=!1,reuseOperationResultingState:c=!1,operationResultingStateParser:l}=i;let u={...e},d=s||0,f={...t},p=!1;const m=!o&&(d>0||"index"in u&&u.skip>0);if(xA(u)){const{skip:b,action:E,document:w,reuseLastOperationIndex:S}=q7(t,u,d);u=E,d=b,f=w,p=S}else f={...f,clipboard:[]};if(Kl(u)&&(f=wA(f,u,n)),f=_A(f,u,d,p),TA(e))return G7(f,e.scope,n);if(m&&(f=EA(f,u,n,d,c,l)),f=DE(f,b=>{try{const E=n(b.state,u,r);E&&PG(()=>{b.state=E})}catch(E){const w=f.operations[u.scope].length-1;b.operations[u.scope][w].error=E.message,b.operations[u.scope][w].skip=0,m&&(b.state={...t.state},b.operations={...t.operations,[u.scope]:[...t.operations[u.scope],{...b.operations[u.scope][w]}]})}}),[Rc,_u,fp].includes(u.type))return f;const g=u.scope||"global",y=a&&Object.prototype.hasOwnProperty.call(u,"hash")?u.hash:dc(f,g),v=f.operations[g].at(-1);return v&&(v.hash=y,c&&(v.resultingState=f.state[g]),!Kl(u)&&u.attachments&&u.attachments.forEach(b=>{const{hash:E,...w}=b;f.attachments[E]={...w}})),f}function Z7(t,e,n,r,i={}){const{skip:s,ignoreSkipOperations:o=!1,reuseHash:a=!1,reuseOperationResultingState:c=!1,operationResultingStateParser:l}=i,u={...e},d=s||0;let f={...t};const p=!o&&(d>0||"index"in u&&u.skip>0);Kl(u)&&(f=wA(f,u,n)),f=_A(f,u,d),p&&(f=EA(f,u,n,d,c,l));try{const y=n(f.state,u,r);y&&(f.state=y)}catch(y){const v=f.operations[u.scope].length-1;f.operations[u.scope][v].error=y.message,f.operations[u.scope][v].skip=0,p&&(f.state={...t.state},f.operations={...t.operations,[u.scope]:[...t.operations[u.scope],{...f.operations[u.scope][v]}]})}if([Rc,_u,fp].includes(u.type))return f;const m=u.scope||"global",h=a&&Object.prototype.hasOwnProperty.call(u,"hash")?u.hash:dc(f,m),g=f.operations[m].at(-1);return g&&(g.hash=h,c&&(g.resultingState=f.state[m]),!Kl(u)&&u.attachments&&u.attachments.forEach(y=>{const{hash:v,...b}=y;f.attachments[v]={...b}})),f}function Y7(t){return t.type===V7&&t.skip!==void 0&&t.skip>0&&t.hash!==void 0}function xA(t){return[Rc,_u].includes(t.type)}function TA(t){return t.type===Rc}function Kl(t){return[yA,Rc,_u,fp,vA].includes(t.type)}function ft(t,e,n,r,i="global"){if(!t)throw new Error("Empty action type");if(typeof t!="string")throw new Error(`Invalid action type: ${JSON.stringify(t)}`);const s={type:t,input:e,scope:i};n&&(s.attachments=n);try{r==null||r().parse(s.input)}catch(o){throw o instanceof $r?new iA(o.issues):new PE(o)}return s}function BE(t,e=SA){return(n,r,i,s)=>e(n,r,t,i,s)}function K7(t,e=Z7){return(n,r,i,s)=>e(n,r,t,i,s)}const zE=(t,e)=>({name:"",documentType:"",revision:{global:0,local:0},created:new Date().toISOString(),lastModified:new Date().toISOString(),attachments:{},...t,state:(e==null?void 0:e(t==null?void 0:t.state))??(t==null?void 0:t.state)??{global:{},local:{}}}),VE=(t,e)=>{const n=zE(t,e);return{...n,initialState:n,operations:{global:[],local:[]},clipboard:[]}},dc=(t,e="global")=>dp(uc(t.state[e]||"")),J7=(t,e=1e3)=>{const n=Math.random()*e;return dp(`${(t??new Date).toISOString()}${n}`)};function sd(t){return Object.freeze(t)}function X7(t,e){const n=[...t];let r=e||0,i=n.length>0?n[n.length-1].index:0;const s=[];for(const o of n.reverse()){if(r>0){const l=i-o.index;r-=l}if(r<0)throw new Error("Invalid operation index, missing operations");const a={ignore:r>0,operation:o},c=o.skip>0?o.skip+1:0;if(c>0&&c>r){const l=c-r;r=r+l}i=o.index,s.push(a)}return s.reverse()}function IA(t){return Object.values(t).flatMap(e=>e).sort((e,n)=>new Date(e.timestamp).getTime()-new Date(n.timestamp).getTime())}function Q7(t){return Object.values(t).flatMap(e=>e).sort((e,n)=>new Date(e.operation.timestamp).getTime()-new Date(n.operation.timestamp).getTime())}function OA(t){var e;return((e=IA(t.operations).at(-1))==null?void 0:e.timestamp)||t.initialState.lastModified}function gf(t,e,n,r,i,s=SA,o={},a){const c=BE(n,s);return HE(t,e,c,r,i,o,a)}function HE(t,e,n,r,i,s={},o){const{checkHashes:a=!0,reuseOperationResultingState:c,operationResultingStateParser:l=cy}=o||{};let u=t;const d=[],f={global:[],local:[]};if(c)for(const[y,v]of Object.entries(e)){const b=v.findLastIndex(w=>!!w.resultingState);if(b<0){d.push(...v);continue}const E=v[b];try{const w=l(E.resultingState);u={...u,state:{...u.state,[y]:w}},f[y].push(...v.slice(0,b+1)),d.push(...v.slice(b+1))}catch{d.push(...v)}}else d.push(...Object.values(e).flat());const p=VE(u);p.initialState=t,p.operations=f;let m=p;if(d.length)m=d.reduce((y,v)=>n(y,v,r,{skip:v.skip,ignoreSkipOperations:!0,reuseHash:!a}),p);else for(const y of Object.values(f)){const v=y.at(-1);v&&(m=bA(m,v))}if(!a)for(const y of Object.keys(m.state))for(let v=d.length-1;v>=0;v--){const b=d[v];if(b.scope===y){if(b.hash!==dc(m,y))throw new Error(`Hash mismatch for scope ${y}`);break}}const h=Object.keys(m.operations).reduce((y,v)=>{const b=v;return{...y,[b]:[...m.operations[b].map((E,w)=>{var S;return{...E,timestamp:((S=e[b][w])==null?void 0:S.timestamp)??E.timestamp}})]}},{global:[],local:[]}),g=Object.values(h).reduce((y,v)=>{const b=v.at(-1);return b&&b.timestamp>y&&(y=b.timestamp),y},t.lastModified);return{...m,operations:h,lastModified:g}}function eZ(t,e){return uc(t)===uc(e)}function cy(t){const e=typeof t;if(e==="string")return JSON.parse(t);if(e==="object")return t;throw new Error(`Providing resulting state is of type: ${e}`)}const CA=t=>ft("SET_NAME",t,void 0,Kk,void 0),RA=(t=1,e="global")=>ft("UNDO",t,void 0,Jk,e),DA=(t=1,e="global")=>ft("REDO",t,void 0,Yk,e),kA=(t,e,n="global")=>ft("PRUNE",{start:t,end:e},void 0,Zk,n),WE=(t,e)=>ft("LOAD_STATE",{state:t,operations:e},void 0,Gk),AA=(t="global")=>ft("NOOP",{},void 0,void 0,t),qE=Object.freeze(Object.defineProperty({__proto__:null,loadState:WE,noop:AA,prune:kA,redo:DA,setName:CA,undo:RA},Symbol.toStringTag,{value:"Module"}));var tZ=Object.defineProperty,nZ=(t,e,n)=>e in t?tZ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,kv=(t,e,n)=>nZ(t,typeof e!="symbol"?e+"":e,n);class ii{constructor(e,n,r){kv(this,"_document"),kv(this,"_reducer"),kv(this,"_signalDispatch"),this._reducer=e,this._document=n,this._signalDispatch=r}dispatch(e,n){return this._document=this._reducer(this._document,e,this._signalDispatch,n),this}saveToFile(e,n,r){return jE(this._document,e,n,r)}async loadFromFile(e){this._document=await Lm(e,this._reducer)}static async stateFromFile(e,n){return await Lm(e,n)}get state(){return sd(this._document.state)}get operations(){return sd(this._document.operations)}get name(){return this._document.name}get documentType(){return this._document.documentType}get created(){return this._document.created}get lastModified(){return this._document.lastModified}get revision(){return this._document.revision.global}getRevision(e){return this._document.revision[e]}get initialState(){return sd(this._document.initialState)}toDocument(){return sd(this._document)}getAttachment(e){return this._document.attachments[e]}setName(e){return this.dispatch(CA(e)),this}undo(e){return this.dispatch(RA(e)),this}redo(e){return this.dispatch(DA(e)),this}prune(e,n){return this.dispatch(kA(e,n)),this}loadState(e,n){return this.dispatch(WE(e,n)),this}}function GE(t,e){e.forEach(n=>{Object.getOwnPropertyNames(n.prototype).forEach(r=>{Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))})})}const Gt=Object.freeze(Object.defineProperty({__proto__:null,InvalidActionInputError:PE,InvalidActionInputZodError:iA,ab2hex:tA,buildOperationSignature:rA,buildOperationSignatureMessage:NE,buildOperationSignatureParams:eA,buildSignedOperation:w7,createAction:ft,createDocument:VE,createExtendedState:zE,createReducer:BE,createUnsafeReducer:K7,createZip:$E,documentHelpers:P7,generateId:AE,getDocumentLastModified:OA,getLocalFile:F7,getRemoteFile:L7,getUnixTimestamp:Qk,hashDocument:dc,hashKey:J7,hex2ab:nA,isBaseAction:Kl,isNoopOperation:Y7,isSameDocument:eZ,isUndo:TA,isUndoRedo:xA,loadFromFile:Lm,loadFromInput:UE,mapSkippedOperations:X7,parseResultingState:cy,readOnly:sd,replayDocument:HE,replayOperations:gf,saveToFile:jE,saveToFileHandle:mA,sortMappedOperations:Q7,sortOperations:IA,validateOperations:oA,verifyOperationSignature:E7},Symbol.toStringTag,{value:"Module"})),yf=t=>typeof t=="number"&&!isNaN(t),Ya=t=>typeof t=="string",Yr=t=>typeof t=="function",Bh=t=>Ya(t)||Yr(t)?t:null,n_=t=>gs(t)||Ya(t)||Yr(t)||yf(t);function rZ(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=t;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,n)})})}function ly(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:s=300}=t;return function(o){let{children:a,position:c,preventExitTransition:l,done:u,nodeRef:d,isIn:f,playToast:p}=o;const m=r?`${e}--${c}`:e,h=r?`${n}--${c}`:n,g=hn(0);return Kf(()=>{const y=d.current,v=m.split(" "),b=E=>{E.target===d.current&&(p(),y.removeEventListener("animationend",b),y.removeEventListener("animationcancel",b),g.current===0&&E.type!=="animationcancel"&&y.classList.remove(...v))};y.classList.add(...v),y.addEventListener("animationend",b),y.addEventListener("animationcancel",b)},[]),jt(()=>{const y=d.current,v=()=>{y.removeEventListener("animationend",v),i?rZ(y,u,s):u()};f||(l?v():(g.current=1,y.className+=` ${h}`,y.addEventListener("animationend",v)))},[f]),Ae.createElement(Ae.Fragment,null,a)}}function DT(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const wr=new Map;let vf=[];const r_=new Set,iZ=t=>r_.forEach(e=>e(t)),NA=()=>wr.size>0;function PA(t,e){var n;if(e)return!((n=wr.get(e))==null||!n.isToastActive(t));let r=!1;return wr.forEach(i=>{i.isToastActive(t)&&(r=!0)}),r}function MA(t,e){n_(t)&&(NA()||vf.push({content:t,options:e}),wr.forEach(n=>{n.buildToast(t,e)}))}function kT(t,e){wr.forEach(n=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===n.id&&n.toggle(t,e==null?void 0:e.id):n.toggle(t,e==null?void 0:e.id)})}function sZ(t){const{subscribe:e,getSnapshot:n,setProps:r}=hn(function(s){const o=s.containerId||1;return{subscribe(a){const c=function(u,d,f){let p=1,m=0,h=[],g=[],y=[],v=d;const b=new Map,E=new Set,w=()=>{y=Array.from(b.values()),E.forEach(O=>O())},S=O=>{g=O==null?[]:g.filter(M=>M!==O),w()},_=O=>{const{toastId:M,onOpen:F,updateId:q,children:I}=O.props,$=q==null;O.staleId&&b.delete(O.staleId),b.set(M,O),g=[...g,O.props.toastId].filter(x=>x!==O.staleId),w(),f(DT(O,$?"added":"updated")),$&&Yr(F)&&F(gs(I)&&I.props)};return{id:u,props:v,observe:O=>(E.add(O),()=>E.delete(O)),toggle:(O,M)=>{b.forEach(F=>{M!=null&&M!==F.props.toastId||Yr(F.toggle)&&F.toggle(O)})},removeToast:S,toasts:b,clearQueue:()=>{m-=h.length,h=[]},buildToast:(O,M)=>{if((C=>{let{containerId:Z,toastId:H,updateId:V}=C;const ce=Z?Z!==u:u!==1,le=b.has(H)&&V==null;return ce||le})(M))return;const{toastId:F,updateId:q,data:I,staleId:$,delay:x}=M,A=()=>{S(F)},P=q==null;P&&m++;const B={...v,style:v.toastStyle,key:p++,...Object.fromEntries(Object.entries(M).filter(C=>{let[Z,H]=C;return H!=null})),toastId:F,updateId:q,data:I,closeToast:A,isIn:!1,className:Bh(M.className||v.toastClassName),bodyClassName:Bh(M.bodyClassName||v.bodyClassName),progressClassName:Bh(M.progressClassName||v.progressClassName),autoClose:!M.isLoading&&(J=M.autoClose,L=v.autoClose,J===!1||yf(J)&&J>0?J:L),deleteToast(){const C=b.get(F),{onClose:Z,children:H}=C.props;Yr(Z)&&Z(gs(H)&&H.props),f(DT(C,"removed")),b.delete(F),m--,m<0&&(m=0),h.length>0?_(h.shift()):w()}};var J,L;B.closeButton=v.closeButton,M.closeButton===!1||n_(M.closeButton)?B.closeButton=M.closeButton:M.closeButton===!0&&(B.closeButton=!n_(v.closeButton)||v.closeButton);let G=O;gs(O)&&!Ya(O.type)?G=rm(O,{closeToast:A,toastProps:B,data:I}):Yr(O)&&(G=O({closeToast:A,toastProps:B,data:I}));const U={content:G,props:B,staleId:$};v.limit&&v.limit>0&&m>v.limit&&P?h.push(U):yf(x)?setTimeout(()=>{_(U)},x):_(U)},setProps(O){v=O},setToggle:(O,M)=>{b.get(O).toggle=M},isToastActive:O=>g.some(M=>M===O),getSnapshot:()=>y}}(o,s,iZ);wr.set(o,c);const l=c.observe(a);return vf.forEach(u=>MA(u.content,u.options)),vf=[],()=>{l(),wr.delete(o)}},setProps(a){var c;(c=wr.get(o))==null||c.setProps(a)},getSnapshot(){var a;return(a=wr.get(o))==null?void 0:a.getSnapshot()}}}(t)).current;r(t);const i=c$(e,n,n);return{getToastToRender:function(s){if(!i)return[];const o=new Map;return t.newestOnTop&&i.reverse(),i.forEach(a=>{const{position:c}=a.props;o.has(c)||o.set(c,[]),o.get(c).push(a)}),Array.from(o,a=>s(a[0],a[1]))},isToastActive:PA,count:i==null?void 0:i.length}}function oZ(t){const[e,n]=Qe(!1),[r,i]=Qe(!1),s=hn(null),o=hn({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:c,closeToast:l,onClick:u,closeOnClick:d}=t;var f,p;function m(){n(!0)}function h(){n(!1)}function g(b){const E=s.current;o.canDrag&&E&&(o.didMove=!0,e&&h(),o.delta=t.draggableDirection==="x"?b.clientX-o.start:b.clientY-o.start,o.start!==b.clientX&&(o.canCloseOnClick=!1),E.style.transform=`translate3d(${t.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,E.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function y(){document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",y);const b=s.current;if(o.canDrag&&o.didMove&&b){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),t.closeToast(),void t.collapseAll();b.style.transition="transform 0.2s, opacity 0.2s",b.style.removeProperty("transform"),b.style.removeProperty("opacity")}}(p=wr.get((f={id:t.toastId,containerId:t.containerId,fn:n}).containerId||1))==null||p.setToggle(f.id,f.fn),jt(()=>{if(t.pauseOnFocusLoss)return document.hasFocus()||h(),window.addEventListener("focus",m),window.addEventListener("blur",h),()=>{window.removeEventListener("focus",m),window.removeEventListener("blur",h)}},[t.pauseOnFocusLoss]);const v={onPointerDown:function(b){if(t.draggable===!0||t.draggable===b.pointerType){o.didMove=!1,document.addEventListener("pointermove",g),document.addEventListener("pointerup",y);const E=s.current;o.canCloseOnClick=!0,o.canDrag=!0,E.style.transition="none",t.draggableDirection==="x"?(o.start=b.clientX,o.removalDistance=E.offsetWidth*(t.draggablePercent/100)):(o.start=b.clientY,o.removalDistance=E.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent)/100)}},onPointerUp:function(b){const{top:E,bottom:w,left:S,right:_}=s.current.getBoundingClientRect();b.nativeEvent.type!=="touchend"&&t.pauseOnHover&&b.clientX>=S&&b.clientX<=_&&b.clientY>=E&&b.clientY<=w?h():m()}};return a&&c&&(v.onMouseEnter=h,t.stacked||(v.onMouseLeave=m)),d&&(v.onClick=b=>{u&&u(b),o.canCloseOnClick&&l()}),{playToast:m,pauseToast:h,isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:v}}function aZ(t){let{delay:e,isRunning:n,closeToast:r,type:i="default",hide:s,className:o,style:a,controlledProgress:c,progress:l,rtl:u,isIn:d,theme:f}=t;const p=s||c&&l===0,m={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused"};c&&(m.transform=`scaleX(${l})`);const h=hs("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":u}),g=Yr(o)?o({rtl:u,type:i,defaultClassName:h}):hs(h,o),y={[c&&l>=1?"onTransitionEnd":"onAnimationEnd"]:c&&l<1?null:()=>{d&&r()}};return Ae.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},Ae.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${i}`}),Ae.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:g,style:m,...y}))}let cZ=1;const LA=()=>""+cZ++;function lZ(t){return t&&(Ya(t.toastId)||yf(t.toastId))?t.toastId:LA()}function wd(t,e){return MA(t,e),e.toastId}function Fm(t,e){return{...e,type:e&&e.type||t,toastId:lZ(e)}}function nh(t){return(e,n)=>wd(e,Fm(t,n))}function fn(t,e){return wd(t,Fm("default",e))}fn.loading=(t,e)=>wd(t,Fm("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),fn.promise=function(t,e,n){let r,{pending:i,error:s,success:o}=e;i&&(r=Ya(i)?fn.loading(i,n):fn.loading(i.render,{...n,...i}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(u,d,f)=>{if(d==null)return void fn.dismiss(r);const p={type:u,...a,...n,data:f},m=Ya(d)?{render:d}:d;return r?fn.update(r,{...p,...m}):fn(m.render,{...p,...m}),f},l=Yr(t)?t():t;return l.then(u=>c("success",o,u)).catch(u=>c("error",s,u)),l},fn.success=nh("success"),fn.info=nh("info"),fn.error=nh("error"),fn.warning=nh("warning"),fn.warn=fn.warning,fn.dark=(t,e)=>wd(t,Fm("default",{theme:"dark",...e})),fn.dismiss=function(t){(function(e){var n;if(NA()){if(e==null||Ya(n=e)||yf(n))wr.forEach(r=>{r.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const r=wr.get(e.containerId);r?r.removeToast(e.id):wr.forEach(i=>{i.removeToast(e.id)})}}else vf=vf.filter(r=>e!=null&&r.options.toastId!==e)})(t)},fn.clearWaitingQueue=function(t){t===void 0&&(t={}),wr.forEach(e=>{!e.props.limit||t.containerId&&e.id!==t.containerId||e.clearQueue()})},fn.isActive=PA,fn.update=function(t,e){e===void 0&&(e={});const n=((r,i)=>{var s;let{containerId:o}=i;return(s=wr.get(o||1))==null?void 0:s.toasts.get(r)})(t,e);if(n){const{props:r,content:i}=n,s={delay:100,...r,...e,toastId:e.toastId||t,updateId:LA()};s.toastId!==t&&(s.staleId=t);const o=s.render||i;delete s.render,wd(o,s)}},fn.done=t=>{fn.update(t,{progress:1})},fn.onChange=function(t){return r_.add(t),()=>{r_.delete(t)}},fn.play=t=>kT(!0,t),fn.pause=t=>kT(!1,t);const uZ=typeof window<"u"?Kf:jt,rh=t=>{let{theme:e,type:n,isLoading:r,...i}=t;return Ae.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...i})},Av={info:function(t){return Ae.createElement(rh,{...t},Ae.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return Ae.createElement(rh,{...t},Ae.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return Ae.createElement(rh,{...t},Ae.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return Ae.createElement(rh,{...t},Ae.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Ae.createElement("div",{className:"Toastify__spinner"})}},dZ=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:s}=oZ(t),{closeButton:o,children:a,autoClose:c,onClick:l,type:u,hideProgressBar:d,closeToast:f,transition:p,position:m,className:h,style:g,bodyClassName:y,bodyStyle:v,progressClassName:b,progressStyle:E,updateId:w,role:S,progress:_,rtl:O,toastId:M,deleteToast:F,isIn:q,isLoading:I,closeOnClick:$,theme:x}=t,A=hs("Toastify__toast",`Toastify__toast-theme--${x}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":O},{"Toastify__toast--close-on-click":$}),P=Yr(h)?h({rtl:O,position:m,type:u,defaultClassName:A}):hs(A,h),B=function(U){let{theme:C,type:Z,isLoading:H,icon:V}=U,ce=null;const le={theme:C,type:Z};return V===!1||(Yr(V)?ce=V({...le,isLoading:H}):gs(V)?ce=rm(V,le):H?ce=Av.spinner():(ge=>ge in Av)(Z)&&(ce=Av[Z](le))),ce}(t),J=!!_||!c,L={closeToast:f,type:u,theme:x};let G=null;return o===!1||(G=Yr(o)?o(L):gs(o)?rm(o,L):function(U){let{closeToast:C,theme:Z,ariaLabel:H="close"}=U;return Ae.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Z}`,type:"button",onClick:V=>{V.stopPropagation(),C(V)},"aria-label":H},Ae.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Ae.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(L)),Ae.createElement(p,{isIn:q,done:F,position:m,preventExitTransition:n,nodeRef:r,playToast:s},Ae.createElement("div",{id:M,onClick:l,"data-in":q,className:P,...i,style:g,ref:r},Ae.createElement("div",{...q&&{role:S},className:Yr(y)?y({type:u}):hs("Toastify__toast-body",y),style:v},B!=null&&Ae.createElement("div",{className:hs("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},B),Ae.createElement("div",null,a)),G,Ae.createElement(aZ,{...w&&!J?{key:`pb-${w}`}:{},rtl:O,theme:x,delay:c,isRunning:e,isIn:q,closeToast:f,hide:d,type:u,style:E,className:b,controlledProgress:J,progress:_||0})))},uy=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},fZ=ly(uy("bounce",!0));ly(uy("slide",!0));ly(uy("zoom"));ly(uy("flip"));const pZ={position:"top-right",transition:fZ,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function hZ(t){let e={...pZ,...t};const n=t.stacked,[r,i]=Qe(!0),s=hn(null),{getToastToRender:o,isToastActive:a,count:c}=sZ(e),{className:l,style:u,rtl:d,containerId:f}=e;function p(h){const g=hs("Toastify__toast-container",`Toastify__toast-container--${h}`,{"Toastify__toast-container--rtl":d});return Yr(l)?l({position:h,rtl:d,defaultClassName:g}):hs(g,Bh(l))}function m(){n&&(i(!0),fn.play())}return uZ(()=>{if(n){var h;const g=s.current.querySelectorAll('[data-in="true"]'),y=12,v=(h=e.position)==null?void 0:h.includes("top");let b=0,E=0;Array.from(g).reverse().forEach((w,S)=>{const _=w;_.classList.add("Toastify__toast--stacked"),S>0&&(_.dataset.collapsed=`${r}`),_.dataset.pos||(_.dataset.pos=v?"top":"bot");const O=b*(r?.2:1)+(r?0:y*S);_.style.setProperty("--y",`${v?O:-1*O}px`),_.style.setProperty("--g",`${y}`),_.style.setProperty("--s",""+(1-(r?E:0))),b+=_.offsetHeight,E+=.025})}},[r,c,n]),Ae.createElement("div",{ref:s,className:"Toastify",id:f,onMouseEnter:()=>{n&&(i(!1),fn.pause())},onMouseLeave:m},o((h,g)=>{const y=g.length?{...u}:{...u,pointerEvents:"none"};return Ae.createElement("div",{className:p(h),style:y,key:`container-${h}`},g.map(v=>{let{content:b,props:E}=v;return Ae.createElement(dZ,{...E,stacked:n,collapseAll:m,isIn:a(E.toastId,E.containerId),style:E.style,key:`toast-${E.key}`},b)}))}))}function mZ(t){return t==="connect-success"||t==="connect-warning"||t==="connect-loading"||t==="connect-deleted"}function gZ(t){if(mZ(t)){const e={};switch(t){case"connect-success":e.type="success",e.icon=T(ze,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":e.type="warning",e.icon=T(ze,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":e.type="default",e.icon=T(ze,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":e.type="error",e.icon=T(ze,{className:"text-red-800",name:"TrashFill",size:24});break}return e}return{type:t}}function ih(t,e){const{type:n="default",...r}=e||{},i=gZ(n);return fn(t,{...i,...r})}const yZ=({closeToast:t})=>T("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:t,children:T(ze,{name:"XmarkLight",size:16})}),vZ=t=>T(hZ,{closeButton:yZ,...t}),bZ={driveNodes:[],selectedNode:null,selectedNodePath:[],selectedDriveNode:null,selectedParentNode:null,setDriveNodes:()=>{},setSelectedNode:()=>{},getNodeById:()=>null,getParentNode:()=>null,getIsSelected:()=>!1,getIsInSelectedNodePath:()=>!1,getSiblings:()=>[]},FA=fu(bZ),_Z=({children:t})=>{const[e,n]=Qe([]),[r,i]=Qe(null),[s,o]=Qe([]),[a,c]=Qe(null),[l,u]=Qe(null),d=xe((_,O)=>{if(!(O!=null&&O.length))return null;for(const M of O){if(M.id===_)return M;const F=M.nodeMap[_];if(F)return F}return null},[]),f=xe(_=>d(_,e),[d,e]),p=xe((_,O)=>!_||!(O!=null&&O.length)?null:_.kind===qr?_:O.find(M=>M.id===_.driveId)??null,[]),m=xe((_,O)=>{if(!(O!=null&&O.length)||_.kind===qr)return null;const M=d(_.parentFolder,O);if(!M)return null;if(M.kind===sr)throw new Error(`Parent node ${_.parentFolder} is a file, not a folder`);return M},[d]),h=xe(_=>m(_,e),[m,e]),g=xe((_,O)=>!_||!(O!=null&&O.length)?null:_.kind===sr?m(_,O):_,[m]),y=xe((_,O)=>{const M=[],F=O.find(I=>I.id===_.driveId);let q=_;for(;q;)M.push(q),q=q.parentFolder===(F==null?void 0:F.id)?F:q.parentFolder?F==null?void 0:F.nodeMap[q.parentFolder]:void 0;return M.reverse()},[]),v=xe(_=>{if(!_)return;if(i(_),c(p(_,e)),u(g(_,e)),_.kind===qr){o([_]);return}const O=y(_,e);o(O)},[e,y,p,g]),b=xe(_=>r===_,[r]),E=xe(_=>_.kind===sr?!1:s.includes(_),[s]),w=xe(_=>{if(_.kind===qr)return console.warn("Drive nodes do not have siblings, as they are top-level nodes"),[];const O=m(_,e);return(O==null?void 0:O.children)??[]},[m,e]);jt(()=>{if(!r)return;const _=d(r.id,e);_&&v(_)},[e,d,r,v]);const S=En(()=>({driveNodes:e,selectedNode:r,selectedNodePath:s,selectedDriveNode:a,selectedParentNode:l,getNodeById:f,getParentNode:h,setDriveNodes:n,setSelectedNode:v,getIsSelected:b,getIsInSelectedNodePath:E,getSiblings:w}),[e,r,s,a,l,f,h,v,b,E,w]);return T(FA.Provider,{value:S,children:t})},wZ=()=>da(FA),AT=_9({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),EZ=G9({chains:[AT],transports:{[AT.id]:O9()}}),SZ=new R8;function xZ(t){const{children:e,wagmiProviderProps:n,queryClientProviderProps:r}=t,{config:i=EZ,...s}=n??{},{client:o=SZ,...a}=r??{};return T(J9,{config:i,...s,children:T(D8,{client:o,...a,children:e})})}let TZ=0;function rn(t,e){const n=`atom${++TZ}`,r={toString(){return n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=IZ,r.write=OZ),e&&(r.write=e),r}function IZ(t){return t(this)}function OZ(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const NT=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,PT=t=>"init"in t,MT=t=>!!t.write,$m=new WeakMap,i_=t=>{var e;return s_(t)&&!((e=$m.get(t))!=null&&e[1])},CZ=(t,e)=>{const n=$m.get(t);n&&(n[1]=!0,n[0].forEach(r=>r(e)))},RZ=t=>{if($m.has(t))return;const e=[new Set,!1];$m.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},s_=t=>typeof(t==null?void 0:t.then)=="function",LT=t=>"v"in t||"e"in t,sh=t=>{if("e"in t)throw t.e;return t.v},$A=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},DZ=(t,e,n,r)=>{var i;e.d.set(n,r.n),i_(e.v)&&$A(t,e.v,r),(i=r.m)==null||i.t.add(t)},kZ=Symbol.for("JOTAI.EXPERIMENTAL.FLUSHSTOREHOOK"),jA=(...t)=>{const[e,n,r,i,s,o]=t,a=q=>{let I=e(q);return I||(I={d:new Map,p:new Set,n:0},n(q,I),s==null||s(q,F)),I},c=new WeakMap,l=new Map,u=new Set,d=new Set,f=()=>{var q;const I=[],$=x=>{try{x()}catch(A){I.push(A)}};do{(q=F[kZ])==null||q.call(F);const x=new Set,A=x.add.bind(x);l.forEach(P=>{var B;return(B=P.m)==null?void 0:B.l.forEach(A)}),l.clear(),u.forEach(A),u.clear(),d.forEach(A),d.clear(),x.forEach($),l.size&&v()}while(l.size||u.size||d.size);if(I.length)throw I[0]},p=(q,I,$)=>{const x="v"in I,A=I.v,P=i_(I.v)?I.v:null;if(s_($)){RZ($);for(const B of I.d.keys())$A(q,$,a(B));I.v=$}else I.v=$;delete I.e,(!x||!Object.is(A,I.v))&&(++I.n,P&&CZ(P,$))},m=q=>{var I;const $=a(q);if(LT($)&&($.m&&c.get(q)!==$.n||Array.from($.d).every(([G,U])=>m(G).n===U)))return $;$.d.clear();let x=!0;const A=()=>{$.m&&(w(q,$),v(),f())},P=G=>{if(NT(q,G)){const C=a(G);if(!LT(C))if(PT(G))p(G,C,G.init);else throw new Error("no atom init");return sh(C)}const U=m(G);try{return sh(U)}finally{DZ(q,$,G,U),x||A()}};let B,J;const L={get signal(){return B||(B=new AbortController),B.signal},get setSelf(){return!J&&MT(q)&&(J=(...G)=>{if(!x)return E(q,...G)}),J}};try{const G=r(q,P,L);return p(q,$,G),s_(G)&&((I=G.onCancel)==null||I.call(G,()=>B==null?void 0:B.abort()),G.then(A,A)),$}catch(G){return delete $.v,$.e=G,++$.n,$}finally{x=!1}},h=q=>sh(m(q)),g=q=>{var I;const $=new Map;for(const x of((I=q.m)==null?void 0:I.t)||[]){const A=a(x);A.m&&$.set(x,A)}for(const x of q.p)$.set(x,a(x));return $},y=q=>{const I=[q];for(;I.length;){const $=I.pop();for(const[x,A]of g($))c.has(x)||(c.set(x,A.n),I.push(A))}},v=()=>{var q;const I=[],$=new WeakSet,x=new WeakSet,A=Array.from(l);for(;A.length;){const[P,B]=A[A.length-1];if(x.has(P)){A.pop();continue}if($.has(P)){c.get(P)===B.n?I.push([P,B,B.n]):(c.delete(P),l.set(P,B)),x.add(P),A.pop();continue}$.add(P);for(const[J,L]of g(B))$.has(J)||A.push([J,L])}for(let P=I.length-1;P>=0;--P){const[B,J,L]=I[P];let G=!1;for(const U of J.d.keys())if(U!==B&&l.has(U)){G=!0;break}G&&(m(B),w(B,J),L!==J.n&&(l.set(B,J),(q=J.u)==null||q.call(J))),c.delete(B)}},b=(q,...I)=>{let $=!0;const x=P=>sh(m(P)),A=(P,...B)=>{var J;const L=a(P);try{if(NT(q,P)){if(!PT(P))throw new Error("atom not writable");const G=L.n,U=B[0];p(P,L,U),w(P,L),G!==L.n&&(l.set(P,L),(J=L.u)==null||J.call(L),y(L));return}else return b(P,...B)}finally{$||(v(),f())}};try{return i(q,x,A,...I)}finally{$=!1}},E=(q,...I)=>{try{return b(q,...I)}finally{v(),f()}},w=(q,I)=>{var $;if(I.m&&!i_(I.v)){for(const[x,A]of I.d)if(!I.m.d.has(x)){const P=a(x);S(x,P).t.add(q),I.m.d.add(x),A!==P.n&&(l.set(x,P),($=P.u)==null||$.call(P),y(P))}for(const x of I.m.d||[])if(!I.d.has(x)){I.m.d.delete(x);const A=_(x,a(x));A==null||A.t.delete(q)}}},S=(q,I)=>{var $;if(!I.m){m(q);for(const x of I.d.keys())S(x,a(x)).t.add(q);if(I.m={l:new Set,d:new Set(I.d.keys()),t:new Set},($=I.h)==null||$.call(I),MT(q)){const x=I.m,A=()=>{let P=!0;const B=(...J)=>{try{return b(q,...J)}finally{P||(v(),f())}};try{const J=o(q,B);J&&(x.u=()=>{P=!0;try{J()}finally{P=!1}})}finally{P=!1}};d.add(A)}}return I.m},_=(q,I)=>{var $;if(I.m&&!I.m.l.size&&!Array.from(I.m.t).some(x=>{var A;return(A=a(x).m)==null?void 0:A.d.has(q)})){const x=I.m.u;x&&u.add(x),delete I.m,($=I.h)==null||$.call(I);for(const A of I.d.keys()){const P=_(A,a(A));P==null||P.t.delete(q)}return}return I.m},F={get:h,set:E,sub:(q,I)=>{const $=a(q),A=S(q,$).l;return A.add(I),f(),()=>{A.delete(I),_(q,$),f()}},unstable_derive:q=>jA(...q(...t))};return F},ZE=()=>{const t=new WeakMap;return jA(n=>t.get(n),(n,r)=>t.set(n,r).get(n),(n,...r)=>n.read(...r),(n,...r)=>n.write(...r),(n,...r)=>{var i;return(i=n.unstable_onInit)==null?void 0:i.call(n,...r)},(n,...r)=>{var i;return(i=n.onMount)==null?void 0:i.call(n,...r)})};let Nv;const UA=()=>(Nv||(Nv=ZE()),Nv),BA=fu(void 0),zA=t=>da(BA)||UA(),AZ=({children:t,store:e})=>{const n=hn(void 0);return!e&&!n.current&&(n.current=ZE()),qa(BA.Provider,{value:e||n.current},t)},VA=t=>typeof(t==null?void 0:t.then)=="function",NZ=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},PZ=Ae.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(NZ(t),t)}),Pv=new WeakMap,MZ=t=>{let e=Pv.get(t);return e||(e=new Promise((n,r)=>{let i=t;const s=c=>l=>{i===c&&n(l)},o=c=>l=>{i===c&&r(l)},a=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(l=>{VA(l)?(Pv.set(l,e),i=l,l.then(s(l),o(l)),a(l)):n(l)})};t.then(s(t),o(t)),a(t)}),Pv.set(t,e)),e};function Dc(t,e){const n=zA(),[[r,i,s],o]=l$(l=>{const u=n.get(t);return Object.is(l[0],u)&&l[1]===n&&l[2]===t?l:[u,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;if((i!==n||s!==t)&&(o(),a=n.get(t)),jt(()=>{const l=n.sub(t,()=>{o()});return o(),l},[n,t,void 0]),u$(a),VA(a)){const l=MZ(a);return PZ(l)}return a}function HA(t,e){const n=zA();return xe((...i)=>n.set(t,...i),[n,t])}function yi(t,e){return[Dc(t),HA(t)]}const LZ=Symbol("");function FZ(t,e){let n=null;const r=new Map,i=new Set,s=a=>{let c;if(c=r.get(a),c!==void 0)if(n!=null&&n(c[1],a))s.remove(a);else return c[0];const l=t(a);return r.set(a,[l,Date.now()]),o("CREATE",a,l),l};function o(a,c,l){for(const u of i)u({type:a,param:c,atom:l})}return s.unstable_listen=a=>(i.add(a),()=>{i.delete(a)}),s.getParams=()=>r.keys(),s.remove=a=>{{if(!r.has(a))return;const[c]=r.get(a);r.delete(a),o("REMOVE",a,c)}},s.setShouldRemove=a=>{if(n=a,!!n)for(const[c,[l,u]]of r)n(u,c)&&(r.delete(c),o("REMOVE",c,l))},s}const $Z=t=>typeof(t==null?void 0:t.then)=="function";function jZ(t=()=>{try{return window.localStorage}catch{return}},e){var n;let r,i;const s={getItem:(c,l)=>{var u,d;const f=m=>{if(m=m||"",r!==m){try{i=JSON.parse(m,e==null?void 0:e.reviver)}catch{return l}r=m}return i},p=(d=(u=t())==null?void 0:u.getItem(c))!=null?d:null;return $Z(p)?p.then(f):f(p)},setItem:(c,l)=>{var u;return(u=t())==null?void 0:u.setItem(c,JSON.stringify(l,void 0))},removeItem:c=>{var l;return(l=t())==null?void 0:l.removeItem(c)}},o=c=>(l,u,d)=>c(l,f=>{let p;try{p=JSON.parse(f||"")}catch{p=d}u(p)});let a;try{a=(n=t())==null?void 0:n.subscribe}catch{}return!a&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(a=(c,l)=>{if(!(t()instanceof window.Storage))return()=>{};const u=d=>{d.storageArea===t()&&d.key===c&&l(d.newValue)};return window.addEventListener("storage",u),()=>{window.removeEventListener("storage",u)}}),a&&(s.subscribe=o(a)),s}const UZ=jZ();function WA(t,e,n=UZ,r){const i=rn(e);return i.onMount=o=>{o(n.getItem(t,e));let a;return n.subscribe&&(a=n.subscribe(t,o,e)),a},rn(o=>o(i),(o,a,c)=>{const l=typeof c=="function"?c(o(i)):c;return l===LZ?(a(i,e),n.removeItem(t)):l instanceof Promise?l.then(u=>(a(i,u),n.setItem(t,u))):(a(i,l),n.setItem(t,l))})}const Mv=new WeakMap,BZ=(t,e)=>(Mv.has(e)?Mv:Mv.set(e,t())).get(e),zZ=t=>t instanceof Promise,FT={state:"loading"};function Dhe(t){return BZ(()=>{const e=new WeakMap,n=rn(0),r=rn((i,{setSelf:s})=>{i(n);let o;try{o=i(t)}catch(u){return{state:"hasError",error:u}}if(!zZ(o))return{state:"hasData",data:o};const a=o,c=e.get(a);if(c)return c;a.then(u=>{e.set(a,{state:"hasData",data:u}),s()},u=>{e.set(a,{state:"hasError",error:u}),s()});const l=e.get(a);return l||(e.set(a,FT),FT)},(i,s)=>{s(n,o=>o+1)});return rn(i=>i(r))},t)}const $T=(t,e,n)=>(e.has(n)?e:e.set(n,t())).get(n),VZ=new WeakMap,HZ=(t,e,n)=>{const r=$T(()=>new WeakMap,VZ,e);return $T(t,r,n)},WZ=t=>t instanceof Promise,qZ=()=>{};function qA(t,e=qZ){return HZ(()=>{const n=new WeakMap,r=new WeakMap,i=rn(0),s=rn((o,{setSelf:a})=>{o(i);const c=o(s),l=o(t);if(!WZ(l))return{v:l};if(l!==(c==null?void 0:c.p)&&l.then(u=>{r.set(l,u),a()},u=>{n.set(l,u),a()}),n.has(l))throw n.get(l);return r.has(l)?{p:l,v:r.get(l)}:c&&"v"in c?{p:l,f:e(c.v),v:c.v}:{p:l,f:e()}},(o,a)=>{a(i,c=>c+1)});return s.init=void 0,rn(o=>{const a=o(s);return"f"in a?a.f:a.v},(o,a,...c)=>a(t,...c))},t,e)}function YE(t){const e=rn(void 0);return delete e.init,Object.defineProperty(e,"init",{get(){return t()}}),e}const od=Ai.routerBasename,pp=(t,e,n,r)=>WA(`${od}:${t}`,e,void 0),GZ=(t,e,n)=>WA(t,e,{getItem(r,i){const s=localStorage.getItem(`${od}:${r}`);return s?JSON.parse(s):i},setItem(r,i){localStorage.setItem(`${od}:${r}`,JSON.stringify(i)),n(i)},removeItem(r){localStorage.removeItem(`${od}:${r}`)},subscribe(r,i){if(typeof window.addEventListener>"u")return()=>null;function s(o){o.storageArea===localStorage&&o.key===`${od}:${r}`&&i(o.newValue??"")}return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)}}),ZZ="acceptedCookies",YZ=pp(ZZ,{analytics:!1,marketing:!1,functional:!1}),KE=()=>yi(YZ),KZ="display-cookie-banner",JZ=pp(KZ,!0),XZ=()=>yi(JZ);function QZ(t){const{open:e,onAddLocalDrive:n,onClose:r}=t;async function i(s){await n(s),r()}return T(bH,{open:e,onSubmit:i,onOpenChange:s=>{if(!s)return r()}})}function Jt(t,e){if(!!!t)throw new Error(e)}function fc(t){return typeof t=="object"&&t!==null}function ji(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const eY=/\r\n|[\n\r]/g;function o_(t,e){let n=0,r=1;for(const i of t.body.matchAll(eY)){if(typeof i.index=="number"||ji(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function tY(t){return GA(t.source,o_(t.source,t.start))}function GA(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,c=e.column+a,l=`${t.name}:${o}:${c}
102
+ `,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){const f=Math.floor(c/80),p=c%80,m=[];for(let h=0;h<d.length;h+=80)m.push(d.slice(h,h+80));return l+jT([[`${o} |`,m[0]],...m.slice(1,f+1).map(h=>["|",h]),["|","^".padStart(p)],["|",m[f+1]]])}return l+jT([[`${o-1} |`,u[i-1]],[`${o} |`,d],["|","^".padStart(c)],[`${o+1} |`,u[i+1]]])}function jT(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
103
+ `)}function nY(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class Ce extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:c,path:l,originalError:u,extensions:d}=nY(n);super(e),this.name="GraphQLError",this.path=l??void 0,this.originalError=u??void 0,this.nodes=UT(Array.isArray(o)?o:o?[o]:void 0);const f=UT((r=this.nodes)===null||r===void 0?void 0:r.map(m=>m.loc).filter(m=>m!=null));this.source=a??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=c??(f==null?void 0:f.map(m=>m.start)),this.locations=c&&a?c.map(m=>o_(a,m)):f==null?void 0:f.map(m=>o_(m.source,m.start));const p=fc(u==null?void 0:u.extensions)?u==null?void 0:u.extensions:void 0;this.extensions=(s=d??p)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Ce):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
104
+
105
+ `+tY(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
106
+
107
+ `+GA(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function UT(t){return t===void 0||t.length===0?void 0:t}function Yn(t,e,n){return new Ce(`Syntax Error: ${n}`,{source:t,positions:[e]})}class rY{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class ZA{constructor(e,n,r,i,s,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const YA={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},iY=new Set(Object.keys(YA));function BT(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&iY.has(e)}var pi;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(pi||(pi={}));var ct;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(ct||(ct={}));var ne;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(ne||(ne={}));function a_(t){return t===9||t===32}function bf(t){return t>=48&&t<=57}function KA(t){return t>=97&&t<=122||t>=65&&t<=90}function JE(t){return KA(t)||t===95}function JA(t){return KA(t)||bf(t)||t===95}function sY(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var s;const a=t[o],c=oY(a);c!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&c<n&&(n=c))}return t.map((o,a)=>a===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function oY(t){let e=0;for(;e<t.length&&a_(t.charCodeAt(e));)++e;return e}function aY(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(p=>p.length===0||a_(p.charCodeAt(0))),o=n.endsWith('\\"""'),a=t.endsWith('"')&&!o,c=t.endsWith("\\"),l=a||c,u=!i||t.length>70||l||s||o;let d="";const f=i&&a_(t.charCodeAt(0));return(u&&!f||s)&&(d+=`
108
+ `),d+=n,(u||l)&&(d+=`
109
+ `),'"""'+d+'"""'}var we;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(we||(we={}));class cY{constructor(e){const n=new ZA(we.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==we.EOF)do if(e.next)e=e.next;else{const n=uY(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===we.COMMENT);return e}}function lY(t){return t===we.BANG||t===we.DOLLAR||t===we.AMP||t===we.PAREN_L||t===we.PAREN_R||t===we.SPREAD||t===we.COLON||t===we.EQUALS||t===we.AT||t===we.BRACKET_L||t===we.BRACKET_R||t===we.BRACE_L||t===we.PIPE||t===we.BRACE_R}function wu(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function dy(t,e){return XA(t.charCodeAt(e))&&QA(t.charCodeAt(e+1))}function XA(t){return t>=55296&&t<=56319}function QA(t){return t>=56320&&t<=57343}function pc(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return we.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function jn(t,e,n,r,i){const s=t.line,o=1+n-t.lineStart;return new ZA(e,n,r,s,o,i)}function uY(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return dY(t,i);case 33:return jn(t,we.BANG,i,i+1);case 36:return jn(t,we.DOLLAR,i,i+1);case 38:return jn(t,we.AMP,i,i+1);case 40:return jn(t,we.PAREN_L,i,i+1);case 41:return jn(t,we.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return jn(t,we.SPREAD,i,i+3);break;case 58:return jn(t,we.COLON,i,i+1);case 61:return jn(t,we.EQUALS,i,i+1);case 64:return jn(t,we.AT,i,i+1);case 91:return jn(t,we.BRACKET_L,i,i+1);case 93:return jn(t,we.BRACKET_R,i,i+1);case 123:return jn(t,we.BRACE_L,i,i+1);case 124:return jn(t,we.PIPE,i,i+1);case 125:return jn(t,we.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?yY(t,i):pY(t,i)}if(bf(s)||s===45)return fY(t,i,s);if(JE(s))return vY(t,i);throw Yn(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:wu(s)||dy(n,i)?`Unexpected character: ${pc(t,i)}.`:`Invalid character: ${pc(t,i)}.`)}return jn(t,we.EOF,r,r)}function dY(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(wu(s))++i;else if(dy(n,i))i+=2;else break}return jn(t,we.COMMENT,e,i,n.slice(e+1,i))}function fY(t,e,n){const r=t.source.body;let i=e,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),bf(s))throw Yn(t.source,i,`Invalid number, unexpected digit after 0: ${pc(t,i)}.`)}else i=Lv(t,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=Lv(t,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=Lv(t,i,s),s=r.charCodeAt(i)),s===46||JE(s))throw Yn(t.source,i,`Invalid number, expected digit but got: ${pc(t,i)}.`);return jn(t,o?we.FLOAT:we.INT,e,i,r.slice(e,i))}function Lv(t,e,n){if(!bf(n))throw Yn(t.source,e,`Invalid number, expected digit but got: ${pc(t,e)}.`);const r=t.source.body;let i=e+1;for(;bf(r.charCodeAt(i));)++i;return i}function pY(t,e){const n=t.source.body,r=n.length;let i=e+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),jn(t,we.STRING,e,i+1,o);if(a===92){o+=n.slice(s,i);const c=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?hY(t,i):mY(t,i):gY(t,i);o+=c.value,i+=c.size,s=i;continue}if(a===10||a===13)break;if(wu(a))++i;else if(dy(n,i))i+=2;else throw Yn(t.source,i,`Invalid character within String: ${pc(t,i)}.`)}throw Yn(t.source,i,"Unterminated string.")}function hY(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(e+i++);if(s===125){if(i<5||!wu(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|ad(s),r<0)break}throw Yn(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function mY(t,e){const n=t.source.body,r=zT(n,e+2);if(wu(r))return{value:String.fromCodePoint(r),size:6};if(XA(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=zT(n,e+8);if(QA(i))return{value:String.fromCodePoint(r,i),size:12}}throw Yn(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function zT(t,e){return ad(t.charCodeAt(e))<<12|ad(t.charCodeAt(e+1))<<8|ad(t.charCodeAt(e+2))<<4|ad(t.charCodeAt(e+3))}function ad(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function gY(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
110
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Yn(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function yY(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,s=e+3,o=s,a="";const c=[];for(;s<r;){const l=n.charCodeAt(s);if(l===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),c.push(a);const u=jn(t,we.BLOCK_STRING,e,s+3,sY(c).join(`
111
+ `));return t.line+=c.length-1,t.lineStart=i,u}if(l===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(l===10||l===13){a+=n.slice(o,s),c.push(a),l===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(wu(l))++s;else if(dy(n,s))s+=2;else throw Yn(t.source,s,`Invalid character within String: ${pc(t,s)}.`)}throw Yn(t.source,s,"Unterminated string.")}function vY(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const s=n.charCodeAt(i);if(JA(s))++i;else break}return jn(t,we.NAME,e,i,n.slice(e,i))}const bY=10,eN=2;function it(t){return fy(t,[])}function fy(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return _Y(t,e);default:return String(t)}}function _Y(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(wY(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:fy(r,n)}else if(Array.isArray(t))return SY(t,n);return EY(t,n)}function wY(t){return typeof t.toJSON=="function"}function EY(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>eN?"["+xY(t)+"]":"{ "+n.map(([i,s])=>i+": "+fy(s,e)).join(", ")+" }"}function SY(t,e){if(t.length===0)return"[]";if(e.length>eN)return"[Array]";const n=Math.min(bY,t.length),r=t.length-n,i=[];for(let s=0;s<n;++s)i.push(fy(t[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function xY(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const TY=globalThis.process&&!0,Ds=TY?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===s){const o=it(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
112
+
113
+ Ensure that there is only one instance of "graphql" in the node_modules
114
+ directory. If different versions of "graphql" are the dependencies of other
115
+ relied on modules, use "resolutions" to ensure only one version is installed.
116
+
117
+ https://yarnpkg.com/en/docs/selective-version-resolutions
118
+
119
+ Duplicate "graphql" modules cannot be used at the same time since different
120
+ versions may have different capabilities and behavior. The data from one
121
+ version used in the function from another could produce confusing and
122
+ spurious results.`)}}return!1};class tN{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||Jt(!1,`Body must be a string. Received: ${it(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||Jt(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Jt(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function IY(t){return Ds(t,tN)}function nN(t,e){const n=new OY(t,e),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}class OY{constructor(e,n={}){const r=IY(e)?e:new tN(e);this._lexer=new cY(r),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(we.NAME);return this.node(e,{kind:ne.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:ne.DOCUMENT,definitions:this.many(we.SOF,this.parseDefinition,we.EOF)})}parseDefinition(){if(this.peek(we.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===we.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Yn(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(we.BRACE_L))return this.node(e,{kind:ne.OPERATION_DEFINITION,operation:pi.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(we.NAME)&&(r=this.parseName()),this.node(e,{kind:ne.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(we.NAME);switch(e.value){case"query":return pi.QUERY;case"mutation":return pi.MUTATION;case"subscription":return pi.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(we.PAREN_L,this.parseVariableDefinition,we.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ne.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(we.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(we.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(we.DOLLAR),this.node(e,{kind:ne.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ne.SELECTION_SET,selections:this.many(we.BRACE_L,this.parseSelection,we.BRACE_R)})}parseSelection(){return this.peek(we.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(we.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:ne.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(we.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(we.PAREN_L,n,we.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(we.COLON),this.node(n,{kind:ne.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(we.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(we.NAME)?this.node(e,{kind:ne.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:ne.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case we.BRACKET_L:return this.parseList(e);case we.BRACE_L:return this.parseObject(e);case we.INT:return this.advanceLexer(),this.node(n,{kind:ne.INT,value:n.value});case we.FLOAT:return this.advanceLexer(),this.node(n,{kind:ne.FLOAT,value:n.value});case we.STRING:case we.BLOCK_STRING:return this.parseStringLiteral();case we.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:ne.BOOLEAN,value:!0});case"false":return this.node(n,{kind:ne.BOOLEAN,value:!1});case"null":return this.node(n,{kind:ne.NULL});default:return this.node(n,{kind:ne.ENUM,value:n.value})}case we.DOLLAR:if(e)if(this.expectToken(we.DOLLAR),this._lexer.token.kind===we.NAME){const r=this._lexer.token.value;throw Yn(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:ne.STRING,value:e.value,block:e.kind===we.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:ne.LIST,values:this.any(we.BRACKET_L,n,we.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:ne.OBJECT,fields:this.any(we.BRACE_L,n,we.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(we.COLON),this.node(n,{kind:ne.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(we.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(we.AT),this.node(n,{kind:ne.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(we.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(we.BRACKET_R),n=this.node(e,{kind:ne.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(we.BANG)?this.node(e,{kind:ne.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:ne.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(we.STRING)||this.peek(we.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(we.BRACE_L,this.parseOperationTypeDefinition,we.BRACE_R);return this.node(e,{kind:ne.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(we.COLON);const r=this.parseNamedType();return this.node(e,{kind:ne.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ne.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(we.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(we.BRACE_L,this.parseFieldDefinition,we.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(we.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:ne.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(we.PAREN_L,this.parseInputValueDef,we.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(we.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(we.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:ne.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:ne.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:ne.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(we.EQUALS)?this.delimitedMany(we.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:ne.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(we.BRACE_L,this.parseEnumValueDefinition,we.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:ne.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Yn(this._lexer.source,this._lexer.token.start,`${oh(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(we.BRACE_L,this.parseInputValueDef,we.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===we.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(we.BRACE_L,this.parseOperationTypeDefinition,we.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:ne.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:ne.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ne.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:ne.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:ne.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(we.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:ne.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(we.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(ct,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new rY(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw Yn(this._lexer.source,n.start,`Expected ${rN(e)}, found ${oh(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===we.NAME&&n.value===e)this.advanceLexer();else throw Yn(this._lexer.source,n.start,`Expected "${e}", found ${oh(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===we.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return Yn(this._lexer.source,n.start,`Unexpected ${oh(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(n.kind!==we.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw Yn(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function oh(t){const e=t.value;return rN(t.kind)+(e!=null?` "${e}"`:"")}function rN(t){return lY(t)?`"${t}"`:t}const CY=5;function ia(t,e){const[n,r]=e?[t,e]:[void 0,t];let i=" Did you mean ";n&&(i+=n+" ");const s=r.map(c=>`"${c}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}const o=s.slice(0,CY),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function VT(t){return t}function hc(t,e){const n=Object.create(null);for(const r of t)n[e(r)]=r;return n}function XE(t,e,n){const r=Object.create(null);for(const i of t)r[e(i)]=n(i);return r}function Gs(t,e){const n=Object.create(null);for(const r of Object.keys(t))n[r]=e(t[r],r);return n}function QE(t,e){let n=0,r=0;for(;n<t.length&&r<e.length;){let i=t.charCodeAt(n),s=e.charCodeAt(r);if(ah(i)&&ah(s)){let o=0;do++n,o=o*10+i-c_,i=t.charCodeAt(n);while(ah(i)&&o>0);let a=0;do++r,a=a*10+s-c_,s=e.charCodeAt(r);while(ah(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++n,++r}}return t.length-e.length}const c_=48,RY=57;function ah(t){return!isNaN(t)&&c_<=t&&t<=RY}function kc(t,e){const n=Object.create(null),r=new DY(t),i=Math.floor(t.length*.4)+1;for(const s of e){const o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{const a=n[s]-n[o];return a!==0?a:QE(s,o)})}class DY{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=HT(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const r=e.toLowerCase();if(this._inputLowerCase===r)return 1;let i=HT(r),s=this._inputArray;if(i.length<s.length){const u=i;i=s,s=u}const o=i.length,a=s.length;if(o-a>n)return;const c=this._rows;for(let u=0;u<=a;u++)c[0][u]=u;for(let u=1;u<=o;u++){const d=c[(u-1)%3],f=c[u%3];let p=f[0]=u;for(let m=1;m<=a;m++){const h=i[u-1]===s[m-1]?0:1;let g=Math.min(d[m]+1,f[m-1]+1,d[m-1]+h);if(u>1&&m>1&&i[u-1]===s[m-2]&&i[u-2]===s[m-1]){const y=c[(u-2)%3][m-2];g=Math.min(g,y+1)}g<p&&(p=g),f[m]=g}if(p>n)return}const l=c[o%3][a];return l<=n?l:void 0}}function HT(t){const e=t.length,n=new Array(e);for(let r=0;r<e;++r)n[r]=t.charCodeAt(r);return n}function _i(t){if(t==null)return Object.create(null);if(Object.getPrototypeOf(t)===null)return t;const e=Object.create(null);for(const[n,r]of Object.entries(t))e[n]=r;return e}function kY(t){return`"${t.replace(AY,NY)}"`}const AY=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function NY(t){return PY[t.charCodeAt(0)]}const PY=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],cd=Object.freeze({});function iN(t,e,n=YA){const r=new Map;for(const y of Object.values(ne))r.set(y,sN(e,y));let i,s=Array.isArray(t),o=[t],a=-1,c=[],l=t,u,d;const f=[],p=[];do{a++;const y=a===o.length,v=y&&c.length!==0;if(y){if(u=p.length===0?void 0:f[f.length-1],l=d,d=p.pop(),v)if(s){l=l.slice();let E=0;for(const[w,S]of c){const _=w-E;S===null?(l.splice(_,1),E++):l[_]=S}}else{l=Object.defineProperties({},Object.getOwnPropertyDescriptors(l));for(const[E,w]of c)l[E]=w}a=i.index,o=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(d){if(u=s?a:o[a],l=d[u],l==null)continue;f.push(u)}let b;if(!Array.isArray(l)){var m,h;BT(l)||Jt(!1,`Invalid AST Node: ${it(l)}.`);const E=y?(m=r.get(l.kind))===null||m===void 0?void 0:m.leave:(h=r.get(l.kind))===null||h===void 0?void 0:h.enter;if(b=E==null?void 0:E.call(e,l,u,d,f,p),b===cd)break;if(b===!1){if(!y){f.pop();continue}}else if(b!==void 0&&(c.push([u,b]),!y))if(BT(b))l=b;else{f.pop();continue}}if(b===void 0&&v&&c.push([u,l]),y)f.pop();else{var g;i={inArray:s,index:a,keys:o,edits:c,prev:i},s=Array.isArray(l),o=s?l:(g=n[l.kind])!==null&&g!==void 0?g:[],a=-1,c=[],d&&p.push(d),d=l}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function MY(t){const e=new Array(t.length).fill(null),n=Object.create(null);for(const r of Object.values(ne)){let i=!1;const s=new Array(t.length).fill(void 0),o=new Array(t.length).fill(void 0);for(let c=0;c<t.length;++c){const{enter:l,leave:u}=sN(t[c],r);i||(i=l!=null||u!=null),s[c]=l,o[c]=u}if(!i)continue;const a={enter(...c){const l=c[0];for(let d=0;d<t.length;d++)if(e[d]===null){var u;const f=(u=s[d])===null||u===void 0?void 0:u.apply(t[d],c);if(f===!1)e[d]=l;else if(f===cd)e[d]=cd;else if(f!==void 0)return f}},leave(...c){const l=c[0];for(let d=0;d<t.length;d++)if(e[d]===null){var u;const f=(u=o[d])===null||u===void 0?void 0:u.apply(t[d],c);if(f===cd)e[d]=cd;else if(f!==void 0&&f!==!1)return f}else e[d]===l&&(e[d]=null)}};n[r]=a}return n}function sN(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function qn(t){return iN(t,FY)}const LY=80,FY={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>qe(t.definitions,`
123
+
124
+ `)},OperationDefinition:{leave(t){const e=Lt("(",qe(t.variableDefinitions,", "),")"),n=qe([t.operation,qe([t.name,e]),qe(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+Lt(" = ",n)+Lt(" ",qe(r," "))},SelectionSet:{leave:({selections:t})=>Ei(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const s=Lt("",t,": ")+e;let o=s+Lt("(",qe(n,", "),")");return o.length>LY&&(o=s+Lt(`(
125
+ `,zh(qe(n,`
126
+ `)),`
127
+ )`)),qe([o,qe(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+Lt(" ",qe(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>qe(["...",Lt("on ",t),qe(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${Lt("(",qe(n,", "),")")} on ${e} ${Lt("",qe(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?aY(t):kY(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+qe(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+qe(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+Lt("(",qe(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>Lt("",t,`
128
+ `)+qe(["schema",qe(e," "),Ei(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>Lt("",t,`
129
+ `)+qe(["scalar",e,qe(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Lt("",t,`
130
+ `)+qe(["type",e,Lt("implements ",qe(n," & ")),qe(r," "),Ei(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>Lt("",t,`
131
+ `)+e+(WT(n)?Lt(`(
132
+ `,zh(qe(n,`
133
+ `)),`
134
+ )`):Lt("(",qe(n,", "),")"))+": "+r+Lt(" ",qe(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>Lt("",t,`
135
+ `)+qe([e+": "+n,Lt("= ",r),qe(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Lt("",t,`
136
+ `)+qe(["interface",e,Lt("implements ",qe(n," & ")),qe(r," "),Ei(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>Lt("",t,`
137
+ `)+qe(["union",e,qe(n," "),Lt("= ",qe(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>Lt("",t,`
138
+ `)+qe(["enum",e,qe(n," "),Ei(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>Lt("",t,`
139
+ `)+qe([e,qe(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>Lt("",t,`
140
+ `)+qe(["input",e,qe(n," "),Ei(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>Lt("",t,`
141
+ `)+"directive @"+e+(WT(n)?Lt(`(
142
+ `,zh(qe(n,`
143
+ `)),`
144
+ )`):Lt("(",qe(n,", "),")"))+(r?" repeatable":"")+" on "+qe(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>qe(["extend schema",qe(t," "),Ei(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>qe(["extend scalar",t,qe(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>qe(["extend type",t,Lt("implements ",qe(e," & ")),qe(n," "),Ei(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>qe(["extend interface",t,Lt("implements ",qe(e," & ")),qe(n," "),Ei(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>qe(["extend union",t,qe(e," "),Lt("= ",qe(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>qe(["extend enum",t,qe(e," "),Ei(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>qe(["extend input",t,qe(e," "),Ei(n)]," ")}};function qe(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function Ei(t){return Lt(`{
145
+ `,zh(qe(t,`
146
+ `)),`
147
+ }`)}function Lt(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function zh(t){return Lt(" ",t.replace(/\n/g,`
148
+ `))}function WT(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
149
+ `)))!==null&&e!==void 0?e:!1}function l_(t,e){switch(t.kind){case ne.NULL:return null;case ne.INT:return parseInt(t.value,10);case ne.FLOAT:return parseFloat(t.value);case ne.STRING:case ne.ENUM:case ne.BOOLEAN:return t.value;case ne.LIST:return t.values.map(n=>l_(n,e));case ne.OBJECT:return XE(t.fields,n=>n.name.value,n=>l_(n.value,e));case ne.VARIABLE:return e==null?void 0:e[t.name.value]}}function Yi(t){if(t!=null||Jt(!1,"Must provide name."),typeof t=="string"||Jt(!1,"Expected name to be a string."),t.length===0)throw new Ce("Expected name to be a non-empty string.");for(let e=1;e<t.length;++e)if(!JA(t.charCodeAt(e)))throw new Ce(`Names must only contain [_a-zA-Z0-9] but "${t}" does not.`);if(!JE(t.charCodeAt(0)))throw new Ce(`Names must start with [_a-zA-Z] but "${t}" does not.`);return t}function $Y(t){if(t==="true"||t==="false"||t==="null")throw new Ce(`Enum values cannot be named: ${t}`);return Yi(t)}function eS(t){return Eu(t)||Tr(t)||Jn(t)||oo(t)||ao(t)||ei(t)||ti(t)||gn(t)}function Eu(t){return Ds(t,co)}function Tr(t){return Ds(t,mi)}function Jn(t){return Ds(t,u_)}function oo(t){return Ds(t,wl)}function ao(t){return Ds(t,wf)}function ei(t){return Ds(t,d_)}function ti(t){return Ds(t,Er)}function gn(t){return Ds(t,At)}function oN(t){return Eu(t)||ao(t)||ei(t)||aN(t)&&oN(t.ofType)}function Jl(t){return Eu(t)||ao(t)}function _f(t){return Tr(t)||Jn(t)||oo(t)}function Ka(t){return Jn(t)||oo(t)}class Er{constructor(e){eS(e)||Jt(!1,`Expected ${it(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class At{constructor(e){jY(e)||Jt(!1,`Expected ${it(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function aN(t){return ti(t)||gn(t)}function jY(t){return eS(t)&&!gn(t)}function UY(t){if(t)return gn(t)?t.ofType:t}function mc(t){if(t){let e=t;for(;aN(e);)e=e.ofType;return e}}function cN(t){return typeof t=="function"?t():t}function lN(t){return typeof t=="function"?t():t}class co{constructor(e){var n,r,i,s;const o=(n=e.parseValue)!==null&&n!==void 0?n:VT;this.name=Yi(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=(r=e.serialize)!==null&&r!==void 0?r:VT,this.parseValue=o,this.parseLiteral=(i=e.parseLiteral)!==null&&i!==void 0?i:(a,c)=>o(l_(a,c)),this.extensions=_i(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(s=e.extensionASTNodes)!==null&&s!==void 0?s:[],e.specifiedByURL==null||typeof e.specifiedByURL=="string"||Jt(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${it(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize=="function"||Jt(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue=="function"&&typeof e.parseLiteral=="function"||Jt(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class mi{constructor(e){var n;this.name=Yi(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=_i(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>dN(e),this._interfaces=()=>uN(e),e.isTypeOf==null||typeof e.isTypeOf=="function"||Jt(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${it(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:pN(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function uN(t){var e;const n=cN((e=t.interfaces)!==null&&e!==void 0?e:[]);return Array.isArray(n)||Jt(!1,`${t.name} interfaces must be an Array or a function which returns an Array.`),n}function dN(t){const e=lN(t.fields);return _l(e)||Jt(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),Gs(e,(n,r)=>{var i;_l(n)||Jt(!1,`${t.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||Jt(!1,`${t.name}.${r} field resolver must be a function if provided, but got: ${it(n.resolve)}.`);const s=(i=n.args)!==null&&i!==void 0?i:{};return _l(s)||Jt(!1,`${t.name}.${r} args must be an object with argument names as keys.`),{name:Yi(r),description:n.description,type:n.type,args:fN(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:_i(n.extensions),astNode:n.astNode}})}function fN(t){return Object.entries(t).map(([e,n])=>({name:Yi(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:_i(n.extensions),astNode:n.astNode}))}function _l(t){return fc(t)&&!Array.isArray(t)}function pN(t){return Gs(t,e=>({description:e.description,type:e.type,args:hN(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function hN(t){return XE(t,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function mN(t){return gn(t.type)&&t.defaultValue===void 0}class u_{constructor(e){var n;this.name=Yi(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=_i(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=dN.bind(void 0,e),this._interfaces=uN.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Jt(!1,`${this.name} must provide "resolveType" as a function, but got: ${it(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:pN(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class wl{constructor(e){var n;this.name=Yi(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=_i(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=BY.bind(void 0,e),e.resolveType==null||typeof e.resolveType=="function"||Jt(!1,`${this.name} must provide "resolveType" as a function, but got: ${it(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function BY(t){const e=cN(t.types);return Array.isArray(e)||Jt(!1,`Must provide Array of types or a function which returns such an array for Union ${t.name}.`),e}class wf{constructor(e){var n;this.name=Yi(e.name),this.description=e.description,this.extensions=_i(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=typeof e.values=="function"?e.values:qT(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=qT(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=hc(this.getValues(),n=>n.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(r=>[r.value,r])));const n=this._valueLookup.get(e);if(n===void 0)throw new Ce(`Enum "${this.name}" cannot represent value: ${it(e)}`);return n.name}parseValue(e){if(typeof e!="string"){const r=it(e);throw new Ce(`Enum "${this.name}" cannot represent non-string value: ${r}.`+ch(this,r))}const n=this.getValue(e);if(n==null)throw new Ce(`Value "${e}" does not exist in "${this.name}" enum.`+ch(this,e));return n.value}parseLiteral(e,n){if(e.kind!==ne.ENUM){const i=qn(e);throw new Ce(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+ch(this,i),{nodes:e})}const r=this.getValue(e.value);if(r==null){const i=qn(e);throw new Ce(`Value "${i}" does not exist in "${this.name}" enum.`+ch(this,i),{nodes:e})}return r.value}toConfig(){const e=XE(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ch(t,e){const n=t.getValues().map(i=>i.name),r=kc(e,n);return ia("the enum value",r)}function qT(t,e){return _l(e)||Jt(!1,`${t} values must be an object with value names as keys.`),Object.entries(e).map(([n,r])=>(_l(r)||Jt(!1,`${t}.${n} must refer to an object with a "value" key representing an internal value but got: ${it(r)}.`),{name:$Y(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:_i(r.extensions),astNode:r.astNode}))}class d_{constructor(e){var n,r;this.name=Yi(e.name),this.description=e.description,this.extensions=_i(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this.isOneOf=(r=e.isOneOf)!==null&&r!==void 0?r:!1,this._fields=zY.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const e=Gs(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function zY(t){const e=lN(t.fields);return _l(e)||Jt(!1,`${t.name} fields must be an object with field names as keys or a function which returns such an object.`),Gs(e,(n,r)=>(!("resolve"in n)||Jt(!1,`${t.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:Yi(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:_i(n.extensions),astNode:n.astNode}))}function VY(t){return gn(t.type)&&t.defaultValue===void 0}function Ed(t,e,n){return e===n?!0:gn(n)?gn(e)?Ed(t,e.ofType,n.ofType):!1:gn(e)?Ed(t,e.ofType,n):ti(n)?ti(e)?Ed(t,e.ofType,n.ofType):!1:ti(e)?!1:Ka(n)&&(Jn(e)||Tr(e))&&t.isSubType(n,e)}function GT(t,e,n){return e===n?!0:Ka(e)?Ka(n)?t.getPossibleTypes(e).some(r=>t.isSubType(n,r)):t.isSubType(e,n):Ka(n)?t.isSubType(n,e):!1}const Fv=2147483647,$v=-2147483648,HY=new co({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(t){const e=hp(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isInteger(n))throw new Ce(`Int cannot represent non-integer value: ${it(e)}`);if(n>Fv||n<$v)throw new Ce("Int cannot represent non 32-bit signed integer value: "+it(e));return n},parseValue(t){if(typeof t!="number"||!Number.isInteger(t))throw new Ce(`Int cannot represent non-integer value: ${it(t)}`);if(t>Fv||t<$v)throw new Ce(`Int cannot represent non 32-bit signed integer value: ${t}`);return t},parseLiteral(t){if(t.kind!==ne.INT)throw new Ce(`Int cannot represent non-integer value: ${qn(t)}`,{nodes:t});const e=parseInt(t.value,10);if(e>Fv||e<$v)throw new Ce(`Int cannot represent non 32-bit signed integer value: ${t.value}`,{nodes:t});return e}}),WY=new co({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(t){const e=hp(t);if(typeof e=="boolean")return e?1:0;let n=e;if(typeof e=="string"&&e!==""&&(n=Number(e)),typeof n!="number"||!Number.isFinite(n))throw new Ce(`Float cannot represent non numeric value: ${it(e)}`);return n},parseValue(t){if(typeof t!="number"||!Number.isFinite(t))throw new Ce(`Float cannot represent non numeric value: ${it(t)}`);return t},parseLiteral(t){if(t.kind!==ne.FLOAT&&t.kind!==ne.INT)throw new Ce(`Float cannot represent non numeric value: ${qn(t)}`,t);return parseFloat(t.value)}}),Pn=new co({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(t){const e=hp(t);if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"&&Number.isFinite(e))return e.toString();throw new Ce(`String cannot represent value: ${it(t)}`)},parseValue(t){if(typeof t!="string")throw new Ce(`String cannot represent a non string value: ${it(t)}`);return t},parseLiteral(t){if(t.kind!==ne.STRING)throw new Ce(`String cannot represent a non string value: ${qn(t)}`,{nodes:t});return t.value}}),Kr=new co({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(t){const e=hp(t);if(typeof e=="boolean")return e;if(Number.isFinite(e))return e!==0;throw new Ce(`Boolean cannot represent a non boolean value: ${it(e)}`)},parseValue(t){if(typeof t!="boolean")throw new Ce(`Boolean cannot represent a non boolean value: ${it(t)}`);return t},parseLiteral(t){if(t.kind!==ne.BOOLEAN)throw new Ce(`Boolean cannot represent a non boolean value: ${qn(t)}`,{nodes:t});return t.value}}),gN=new co({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(t){const e=hp(t);if(typeof e=="string")return e;if(Number.isInteger(e))return String(e);throw new Ce(`ID cannot represent value: ${it(t)}`)},parseValue(t){if(typeof t=="string")return t;if(typeof t=="number"&&Number.isInteger(t))return t.toString();throw new Ce(`ID cannot represent value: ${it(t)}`)},parseLiteral(t){if(t.kind!==ne.STRING&&t.kind!==ne.INT)throw new Ce("ID cannot represent a non-string and non-integer value: "+qn(t),{nodes:t});return t.value}}),tS=Object.freeze([Pn,HY,WY,Kr,gN]);function qY(t){return tS.some(({name:e})=>t.name===e)}function hp(t){if(fc(t)){if(typeof t.valueOf=="function"){const e=t.valueOf();if(!fc(e))return e}if(typeof t.toJSON=="function")return t.toJSON()}return t}function GY(t){return Ds(t,sa)}class sa{constructor(e){var n,r;this.name=Yi(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=(n=e.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=_i(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||Jt(!1,`@${e.name} locations must be an Array.`);const i=(r=e.args)!==null&&r!==void 0?r:{};fc(i)&&!Array.isArray(i)||Jt(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=fN(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:hN(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const yN=new sa({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[ct.FIELD,ct.FRAGMENT_SPREAD,ct.INLINE_FRAGMENT],args:{if:{type:new At(Kr),description:"Included when true."}}}),vN=new sa({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[ct.FIELD,ct.FRAGMENT_SPREAD,ct.INLINE_FRAGMENT],args:{if:{type:new At(Kr),description:"Skipped when true."}}}),ZY="No longer supported",bN=new sa({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[ct.FIELD_DEFINITION,ct.ARGUMENT_DEFINITION,ct.INPUT_FIELD_DEFINITION,ct.ENUM_VALUE],args:{reason:{type:Pn,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:ZY}}}),_N=new sa({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[ct.SCALAR],args:{url:{type:new At(Pn),description:"The URL that specifies the behavior of this scalar."}}}),wN=new sa({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[ct.INPUT_OBJECT],args:{}}),Su=Object.freeze([yN,vN,bN,_N,wN]);function YY(t){return typeof t=="object"&&typeof(t==null?void 0:t[Symbol.iterator])=="function"}function ld(t,e){if(gn(e)){const n=ld(t,e.ofType);return(n==null?void 0:n.kind)===ne.NULL?null:n}if(t===null)return{kind:ne.NULL};if(t===void 0)return null;if(ti(e)){const n=e.ofType;if(YY(t)){const r=[];for(const i of t){const s=ld(i,n);s!=null&&r.push(s)}return{kind:ne.LIST,values:r}}return ld(t,n)}if(ei(e)){if(!fc(t))return null;const n=[];for(const r of Object.values(e.getFields())){const i=ld(t[r.name],r.type);i&&n.push({kind:ne.OBJECT_FIELD,name:{kind:ne.NAME,value:r.name},value:i})}return{kind:ne.OBJECT,fields:n}}if(Jl(e)){const n=e.serialize(t);if(n==null)return null;if(typeof n=="boolean")return{kind:ne.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const r=String(n);return ZT.test(r)?{kind:ne.INT,value:r}:{kind:ne.FLOAT,value:r}}if(typeof n=="string")return ao(e)?{kind:ne.ENUM,value:n}:e===gN&&ZT.test(n)?{kind:ne.INT,value:n}:{kind:ne.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${it(n)}.`)}ji(!1,"Unexpected input type: "+it(e))}const ZT=/^-?(?:0|[1-9][0-9]*)$/,nS=new mi({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Pn,resolve:t=>t.description},types:{description:"A list of all types supported by this server.",type:new At(new Er(new At(Li))),resolve(t){return Object.values(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new At(Li),resolve:t=>t.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Li,resolve:t=>t.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Li,resolve:t=>t.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new At(new Er(new At(EN))),resolve:t=>t.getDirectives()}})}),EN=new mi({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
150
+
151
+ In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new At(Pn),resolve:t=>t.name},description:{type:Pn,resolve:t=>t.description},isRepeatable:{type:new At(Kr),resolve:t=>t.isRepeatable},locations:{type:new At(new Er(new At(SN))),resolve:t=>t.locations},args:{type:new At(new Er(new At(py))),args:{includeDeprecated:{type:Kr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}}})}),SN=new wf({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:ct.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:ct.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:ct.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:ct.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:ct.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:ct.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:ct.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:ct.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:ct.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:ct.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:ct.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:ct.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:ct.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:ct.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:ct.UNION,description:"Location adjacent to a union definition."},ENUM:{value:ct.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:ct.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:ct.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:ct.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Li=new mi({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new At(IN),resolve(t){if(Eu(t))return Zn.SCALAR;if(Tr(t))return Zn.OBJECT;if(Jn(t))return Zn.INTERFACE;if(oo(t))return Zn.UNION;if(ao(t))return Zn.ENUM;if(ei(t))return Zn.INPUT_OBJECT;if(ti(t))return Zn.LIST;if(gn(t))return Zn.NON_NULL;ji(!1,`Unexpected type: "${it(t)}".`)}},name:{type:Pn,resolve:t=>"name"in t?t.name:void 0},description:{type:Pn,resolve:t=>"description"in t?t.description:void 0},specifiedByURL:{type:Pn,resolve:t=>"specifiedByURL"in t?t.specifiedByURL:void 0},fields:{type:new Er(new At(xN)),args:{includeDeprecated:{type:Kr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(Tr(t)||Jn(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new Er(new At(Li)),resolve(t){if(Tr(t)||Jn(t))return t.getInterfaces()}},possibleTypes:{type:new Er(new At(Li)),resolve(t,e,n,{schema:r}){if(Ka(t))return r.getPossibleTypes(t)}},enumValues:{type:new Er(new At(TN)),args:{includeDeprecated:{type:Kr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(ao(t)){const n=t.getValues();return e?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new Er(new At(py)),args:{includeDeprecated:{type:Kr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){if(ei(t)){const n=Object.values(t.getFields());return e?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Li,resolve:t=>"ofType"in t?t.ofType:void 0},isOneOf:{type:Kr,resolve:t=>{if(ei(t))return t.isOneOf}}})}),xN=new mi({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new At(Pn),resolve:t=>t.name},description:{type:Pn,resolve:t=>t.description},args:{type:new At(new Er(new At(py))),args:{includeDeprecated:{type:Kr,defaultValue:!1}},resolve(t,{includeDeprecated:e}){return e?t.args:t.args.filter(n=>n.deprecationReason==null)}},type:{type:new At(Li),resolve:t=>t.type},isDeprecated:{type:new At(Kr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Pn,resolve:t=>t.deprecationReason}})}),py=new mi({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new At(Pn),resolve:t=>t.name},description:{type:Pn,resolve:t=>t.description},type:{type:new At(Li),resolve:t=>t.type},defaultValue:{type:Pn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(t){const{type:e,defaultValue:n}=t,r=ld(n,e);return r?qn(r):null}},isDeprecated:{type:new At(Kr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Pn,resolve:t=>t.deprecationReason}})}),TN=new mi({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new At(Pn),resolve:t=>t.name},description:{type:Pn,resolve:t=>t.description},isDeprecated:{type:new At(Kr),resolve:t=>t.deprecationReason!=null},deprecationReason:{type:Pn,resolve:t=>t.deprecationReason}})});var Zn;(function(t){t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.INPUT_OBJECT="INPUT_OBJECT",t.LIST="LIST",t.NON_NULL="NON_NULL"})(Zn||(Zn={}));const IN=new wf({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Zn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Zn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Zn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Zn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Zn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Zn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Zn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Zn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new At(nS);new At(Pn);new At(Pn);const rS=Object.freeze([nS,EN,SN,Li,xN,py,TN,IN]);function KY(t){return rS.some(({name:e})=>t.name===e)}class JY{constructor(e){var n,r;this.__validationErrors=e.assumeValid===!0?[]:void 0,fc(e)||Jt(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||Jt(!1,`"types" must be Array if provided but got: ${it(e.types)}.`),!e.directives||Array.isArray(e.directives)||Jt(!1,`"directives" must be Array if provided but got: ${it(e.directives)}.`),this.description=e.description,this.extensions=_i(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=(n=e.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=(r=e.directives)!==null&&r!==void 0?r:Su;const i=new Set(e.types);if(e.types!=null)for(const s of e.types)i.delete(s),Di(s,i);this._queryType!=null&&Di(this._queryType,i),this._mutationType!=null&&Di(this._mutationType,i),this._subscriptionType!=null&&Di(this._subscriptionType,i);for(const s of this._directives)if(GY(s))for(const o of s.args)Di(o.type,i);Di(nS,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of i){if(s==null)continue;const o=s.name;if(o||Jt(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,Jn(s)){for(const a of s.getInterfaces())if(Jn(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.interfaces.push(s)}}else if(Tr(s)){for(const a of s.getInterfaces())if(Jn(a)){let c=this._implementationsMap[a.name];c===void 0&&(c=this._implementationsMap[a.name]={objects:[],interfaces:[]}),c.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case pi.QUERY:return this.getQueryType();case pi.MUTATION:return this.getMutationType();case pi.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return oo(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const n=this._implementationsMap[e.name];return n??{objects:[],interfaces:[]}}isSubType(e,n){let r=this._subTypeMap[e.name];if(r===void 0){if(r=Object.create(null),oo(e))for(const i of e.getTypes())r[i.name]=!0;else{const i=this.getImplementations(e);for(const s of i.objects)r[s.name]=!0;for(const s of i.interfaces)r[s.name]=!0}this._subTypeMap[e.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(n=>n.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Di(t,e){const n=mc(t);if(!e.has(n)){if(e.add(n),oo(n))for(const r of n.getTypes())Di(r,e);else if(Tr(n)||Jn(n)){for(const r of n.getInterfaces())Di(r,e);for(const r of Object.values(n.getFields())){Di(r.type,e);for(const i of r.args)Di(i.type,e)}}else if(ei(n))for(const r of Object.values(n.getFields()))Di(r.type,e)}return e}function Os(t,e){switch(e.kind){case ne.LIST_TYPE:{const n=Os(t,e.type);return n&&new Er(n)}case ne.NON_NULL_TYPE:{const n=Os(t,e.type);return n&&new At(n)}case ne.NAMED_TYPE:return t.getType(e.name.value)}}function XY(t){return t.kind===ne.OPERATION_DEFINITION||t.kind===ne.FRAGMENT_DEFINITION}function QY(t){return t.kind===ne.SCHEMA_DEFINITION||mp(t)||t.kind===ne.DIRECTIVE_DEFINITION}function mp(t){return t.kind===ne.SCALAR_TYPE_DEFINITION||t.kind===ne.OBJECT_TYPE_DEFINITION||t.kind===ne.INTERFACE_TYPE_DEFINITION||t.kind===ne.UNION_TYPE_DEFINITION||t.kind===ne.ENUM_TYPE_DEFINITION||t.kind===ne.INPUT_OBJECT_TYPE_DEFINITION}function eK(t){return t.kind===ne.SCHEMA_EXTENSION||iS(t)}function iS(t){return t.kind===ne.SCALAR_TYPE_EXTENSION||t.kind===ne.OBJECT_TYPE_EXTENSION||t.kind===ne.INTERFACE_TYPE_EXTENSION||t.kind===ne.UNION_TYPE_EXTENSION||t.kind===ne.ENUM_TYPE_EXTENSION||t.kind===ne.INPUT_OBJECT_TYPE_EXTENSION}function tK(t){return{Document(e){for(const n of e.definitions)if(!XY(n)){const r=n.kind===ne.SCHEMA_DEFINITION||n.kind===ne.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';t.reportError(new Ce(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function nK(t){return{Field(e){const n=t.getParentType();if(n&&!t.getFieldDef()){const i=t.getSchema(),s=e.name.value;let o=ia("to use an inline fragment on",rK(i,n,s));o===""&&(o=ia(iK(n,s))),t.reportError(new Ce(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:e}))}}}}function rK(t,e,n){if(!Ka(e))return[];const r=new Set,i=Object.create(null);for(const o of t.getPossibleTypes(e))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{const c=i[a.name]-i[o.name];return c!==0?c:Jn(o)&&t.isSubType(o,a)?-1:Jn(a)&&t.isSubType(a,o)?1:QE(o.name,a.name)}).map(o=>o.name)}function iK(t,e){if(Tr(t)||Jn(t)){const n=Object.keys(t.getFields());return kc(e,n)}return[]}function sK(t){return{InlineFragment(e){const n=e.typeCondition;if(n){const r=Os(t.getSchema(),n);if(r&&!_f(r)){const i=qn(n);t.reportError(new Ce(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(e){const n=Os(t.getSchema(),e.typeCondition);if(n&&!_f(n)){const r=qn(e.typeCondition);t.reportError(new Ce(`Fragment "${e.name.value}" cannot condition on non composite type "${r}".`,{nodes:e.typeCondition}))}}}}function oK(t){return{...ON(t),Argument(e){const n=t.getArgument(),r=t.getFieldDef(),i=t.getParentType();if(!n&&r&&i){const s=e.name.value,o=r.args.map(c=>c.name),a=kc(s,o);t.reportError(new Ce(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+ia(a),{nodes:e}))}}}}function ON(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():Su;for(const o of r)e[o.name]=o.args.map(a=>a.name);const i=t.getDocument().definitions;for(const o of i)if(o.kind===ne.DIRECTIVE_DEFINITION){var s;const a=(s=o.arguments)!==null&&s!==void 0?s:[];e[o.name.value]=a.map(c=>c.name.value)}return{Directive(o){const a=o.name.value,c=e[a];if(o.arguments&&c)for(const l of o.arguments){const u=l.name.value;if(!c.includes(u)){const d=kc(u,c);t.reportError(new Ce(`Unknown argument "${u}" on directive "@${a}".`+ia(d),{nodes:l}))}}return!1}}}function CN(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():Su;for(const s of r)e[s.name]=s.locations;const i=t.getDocument().definitions;for(const s of i)s.kind===ne.DIRECTIVE_DEFINITION&&(e[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,c,l){const u=s.name.value,d=e[u];if(!d){t.reportError(new Ce(`Unknown directive "@${u}".`,{nodes:s}));return}const f=aK(l);f&&!d.includes(f)&&t.reportError(new Ce(`Directive "@${u}" may not be used on ${f}.`,{nodes:s}))}}}function aK(t){const e=t[t.length-1];switch("kind"in e||ji(!1),e.kind){case ne.OPERATION_DEFINITION:return cK(e.operation);case ne.FIELD:return ct.FIELD;case ne.FRAGMENT_SPREAD:return ct.FRAGMENT_SPREAD;case ne.INLINE_FRAGMENT:return ct.INLINE_FRAGMENT;case ne.FRAGMENT_DEFINITION:return ct.FRAGMENT_DEFINITION;case ne.VARIABLE_DEFINITION:return ct.VARIABLE_DEFINITION;case ne.SCHEMA_DEFINITION:case ne.SCHEMA_EXTENSION:return ct.SCHEMA;case ne.SCALAR_TYPE_DEFINITION:case ne.SCALAR_TYPE_EXTENSION:return ct.SCALAR;case ne.OBJECT_TYPE_DEFINITION:case ne.OBJECT_TYPE_EXTENSION:return ct.OBJECT;case ne.FIELD_DEFINITION:return ct.FIELD_DEFINITION;case ne.INTERFACE_TYPE_DEFINITION:case ne.INTERFACE_TYPE_EXTENSION:return ct.INTERFACE;case ne.UNION_TYPE_DEFINITION:case ne.UNION_TYPE_EXTENSION:return ct.UNION;case ne.ENUM_TYPE_DEFINITION:case ne.ENUM_TYPE_EXTENSION:return ct.ENUM;case ne.ENUM_VALUE_DEFINITION:return ct.ENUM_VALUE;case ne.INPUT_OBJECT_TYPE_DEFINITION:case ne.INPUT_OBJECT_TYPE_EXTENSION:return ct.INPUT_OBJECT;case ne.INPUT_VALUE_DEFINITION:{const n=t[t.length-3];return"kind"in n||ji(!1),n.kind===ne.INPUT_OBJECT_TYPE_DEFINITION?ct.INPUT_FIELD_DEFINITION:ct.ARGUMENT_DEFINITION}default:ji(!1,"Unexpected kind: "+it(e.kind))}}function cK(t){switch(t){case pi.QUERY:return ct.QUERY;case pi.MUTATION:return ct.MUTATION;case pi.SUBSCRIPTION:return ct.SUBSCRIPTION}}function lK(t){return{FragmentSpread(e){const n=e.name.value;t.getFragment(n)||t.reportError(new Ce(`Unknown fragment "${n}".`,{nodes:e.name}))}}}function RN(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);for(const s of t.getDocument().definitions)mp(s)&&(r[s.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,c,l){const u=s.name.value;if(!n[u]&&!r[u]){var d;const f=(d=l[2])!==null&&d!==void 0?d:a,p=f!=null&&uK(f);if(p&&YT.includes(u))return;const m=kc(u,p?YT.concat(i):i);t.reportError(new Ce(`Unknown type "${u}".`+ia(m),{nodes:s}))}}}}const YT=[...tS,...rS].map(t=>t.name);function uK(t){return"kind"in t&&(QY(t)||eK(t))}function dK(t){let e=0;return{Document(n){e=n.definitions.filter(r=>r.kind===ne.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&e>1&&t.reportError(new Ce("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function fK(t){var e,n,r;const i=t.getSchema(),s=(e=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&e!==void 0?e:i==null?void 0:i.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(s){t.reportError(new Ce("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&t.reportError(new Ce("Must provide only one schema definition.",{nodes:a})),++o}}}const pK=3;function hK(t){function e(n,r=Object.create(null),i=0){if(n.kind===ne.FRAGMENT_SPREAD){const s=n.name.value;if(r[s]===!0)return!1;const o=t.getFragment(s);if(!o)return!1;try{return r[s]=!0,e(o,r,i)}finally{r[s]=void 0}}if(n.kind===ne.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(i++,i>=pK))return!0;if("selectionSet"in n&&n.selectionSet){for(const s of n.selectionSet.selections)if(e(s,r,i))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&e(n))return t.reportError(new Ce("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function mK(t){const e=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(e[s.name.value])return;const o=s.name.value;e[o]=!0;const a=t.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(const c of a){const l=c.name.value,u=r[l];if(n.push(c),u===void 0){const d=t.getFragment(l);d&&i(d)}else{const d=n.slice(u),f=d.slice(0,-1).map(p=>'"'+p.name.value+'"').join(", ");t.reportError(new Ce(`Cannot spread fragment "${l}" within itself`+(f!==""?` via ${f}.`:"."),{nodes:d}))}n.pop()}r[o]=void 0}}}function gK(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i}of r){const s=i.name.value;e[s]!==!0&&t.reportError(new Ce(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){e[n.variable.name.value]=!0}}}function yK(t){const e=[],n=[];return{OperationDefinition(r){return e.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){const r=Object.create(null);for(const i of e)for(const s of t.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(const i of n){const s=i.name.value;r[s]!==!0&&t.reportError(new Ce(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}function vK(t){let e=[];return{OperationDefinition:{enter(){e=[]},leave(n){const r=Object.create(null),i=t.getRecursiveVariableUsages(n);for(const{node:s}of i)r[s.name.value]=!0;for(const s of e){const o=s.variable.name.value;r[o]!==!0&&t.reportError(new Ce(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){e.push(n)}}}function sS(t){switch(t.kind){case ne.OBJECT:return{...t,fields:bK(t.fields)};case ne.LIST:return{...t,values:t.values.map(sS)};case ne.INT:case ne.FLOAT:case ne.STRING:case ne.BOOLEAN:case ne.NULL:case ne.ENUM:case ne.VARIABLE:return t}}function bK(t){return t.map(e=>({...e,value:sS(e.value)})).sort((e,n)=>QE(e.name.value,n.name.value))}function DN(t){return Array.isArray(t)?t.map(([e,n])=>`subfields "${e}" conflict because `+DN(n)).join(" and "):t}function _K(t){const e=new NN,n=new IK,r=new Map;return{SelectionSet(i){const s=wK(t,r,e,n,t.getParentType(),i);for(const[[o,a],c,l]of s){const u=DN(a);t.reportError(new Ce(`Fields "${o}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function wK(t,e,n,r,i,s){const o=[],[a,c]=Bm(t,e,i,s);if(SK(t,o,e,n,r,a),c.length!==0)for(let l=0;l<c.length;l++){jm(t,o,e,n,r,!1,a,c[l]);for(let u=l+1;u<c.length;u++)Um(t,o,e,n,r,!1,c[l],c[u])}return o}function jm(t,e,n,r,i,s,o,a){if(r.has(o,a,s))return;r.add(o,a,s);const c=t.getFragment(a);if(!c)return;const[l,u]=p_(t,n,c);if(o!==l){oS(t,e,n,r,i,s,o,l);for(const d of u)jm(t,e,n,r,i,s,o,d)}}function Um(t,e,n,r,i,s,o,a){if(o===a||i.has(o,a,s))return;i.add(o,a,s);const c=t.getFragment(o),l=t.getFragment(a);if(!c||!l)return;const[u,d]=p_(t,n,c),[f,p]=p_(t,n,l);oS(t,e,n,r,i,s,u,f);for(const m of p)Um(t,e,n,r,i,s,o,m);for(const m of d)Um(t,e,n,r,i,s,m,a)}function EK(t,e,n,r,i,s,o,a,c){const l=[],[u,d]=Bm(t,e,s,o),[f,p]=Bm(t,e,a,c);oS(t,l,e,n,r,i,u,f);for(const m of p)jm(t,l,e,n,r,i,u,m);for(const m of d)jm(t,l,e,n,r,i,f,m);for(const m of d)for(const h of p)Um(t,l,e,n,r,i,m,h);return l}function SK(t,e,n,r,i,s){for(const[o,a]of Object.entries(s))if(a.length>1)for(let c=0;c<a.length;c++)for(let l=c+1;l<a.length;l++){const u=kN(t,n,r,i,!1,o,a[c],a[l]);u&&e.push(u)}}function oS(t,e,n,r,i,s,o,a){for(const[c,l]of Object.entries(o)){const u=a[c];if(u)for(const d of l)for(const f of u){const p=kN(t,n,r,i,s,c,d,f);p&&e.push(p)}}}function kN(t,e,n,r,i,s,o,a){const[c,l,u]=o,[d,f,p]=a,m=i||c!==d&&Tr(c)&&Tr(d);if(!m){const b=l.name.value,E=f.name.value;if(b!==E)return[[s,`"${b}" and "${E}" are different fields`],[l],[f]];if(!xK(l,f))return[[s,"they have differing arguments"],[l],[f]]}const h=u==null?void 0:u.type,g=p==null?void 0:p.type;if(h&&g&&f_(h,g))return[[s,`they return conflicting types "${it(h)}" and "${it(g)}"`],[l],[f]];const y=l.selectionSet,v=f.selectionSet;if(y&&v){const b=EK(t,e,n,r,m,mc(h),y,mc(g),v);return TK(b,s,l,f)}}function xK(t,e){const n=t.arguments,r=e.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;const i=new Map(r.map(({name:s,value:o})=>[s.value,o]));return n.every(s=>{const o=s.value,a=i.get(s.name.value);return a===void 0?!1:KT(o)===KT(a)})}function KT(t){return qn(sS(t))}function f_(t,e){return ti(t)?ti(e)?f_(t.ofType,e.ofType):!0:ti(e)?!0:gn(t)?gn(e)?f_(t.ofType,e.ofType):!0:gn(e)?!0:Jl(t)||Jl(e)?t!==e:!1}function Bm(t,e,n,r){const i=e.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);AN(t,n,r,s,o);const a=[s,Object.keys(o)];return e.set(r,a),a}function p_(t,e,n){const r=e.get(n.selectionSet);if(r)return r;const i=Os(t.getSchema(),n.typeCondition);return Bm(t,e,i,n.selectionSet)}function AN(t,e,n,r,i){for(const s of n.selections)switch(s.kind){case ne.FIELD:{const o=s.name.value;let a;(Tr(e)||Jn(e))&&(a=e.getFields()[o]);const c=s.alias?s.alias.value:o;r[c]||(r[c]=[]),r[c].push([e,s,a]);break}case ne.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case ne.INLINE_FRAGMENT:{const o=s.typeCondition,a=o?Os(t.getSchema(),o):e;AN(t,a,s.selectionSet,r,i);break}}}function TK(t,e,n,r){if(t.length>0)return[[e,t.map(([i])=>i)],[n,...t.map(([,i])=>i).flat()],[r,...t.map(([,,i])=>i).flat()]]}class NN{constructor(){this._data=new Map}has(e,n,r){var i;const s=(i=this._data.get(e))===null||i===void 0?void 0:i.get(n);return s===void 0?!1:r?!0:r===s}add(e,n,r){const i=this._data.get(e);i===void 0?this._data.set(e,new Map([[n,r]])):i.set(n,r)}}class IK{constructor(){this._orderedPairSet=new NN}has(e,n,r){return e<n?this._orderedPairSet.has(e,n,r):this._orderedPairSet.has(n,e,r)}add(e,n,r){e<n?this._orderedPairSet.add(e,n,r):this._orderedPairSet.add(n,e,r)}}function OK(t){return{InlineFragment(e){const n=t.getType(),r=t.getParentType();if(_f(n)&&_f(r)&&!GT(t.getSchema(),n,r)){const i=it(r),s=it(n);t.reportError(new Ce(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:e}))}},FragmentSpread(e){const n=e.name.value,r=CK(t,n),i=t.getParentType();if(r&&i&&!GT(t.getSchema(),r,i)){const s=it(i),o=it(r);t.reportError(new Ce(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:e}))}}}}function CK(t,e){const n=t.getFragment(e);if(n){const r=Os(t.getSchema(),n.typeCondition);if(_f(r))return r}}function RK(t){const e=t.getSchema(),n=Object.create(null);for(const i of t.getDocument().definitions)mp(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){const s=i.name.value,o=n[s],a=e==null?void 0:e.getType(s);let c;if(o?c=DK[o.kind]:a&&(c=kK(a)),c){if(c!==i.kind){const l=AK(i.kind);t.reportError(new Ce(`Cannot extend non-${l} type "${s}".`,{nodes:o?[o,i]:i}))}}else{const l=Object.keys({...n,...e==null?void 0:e.getTypeMap()}),u=kc(s,l);t.reportError(new Ce(`Cannot extend type "${s}" because it is not defined.`+ia(u),{nodes:i.name}))}}}const DK={[ne.SCALAR_TYPE_DEFINITION]:ne.SCALAR_TYPE_EXTENSION,[ne.OBJECT_TYPE_DEFINITION]:ne.OBJECT_TYPE_EXTENSION,[ne.INTERFACE_TYPE_DEFINITION]:ne.INTERFACE_TYPE_EXTENSION,[ne.UNION_TYPE_DEFINITION]:ne.UNION_TYPE_EXTENSION,[ne.ENUM_TYPE_DEFINITION]:ne.ENUM_TYPE_EXTENSION,[ne.INPUT_OBJECT_TYPE_DEFINITION]:ne.INPUT_OBJECT_TYPE_EXTENSION};function kK(t){if(Eu(t))return ne.SCALAR_TYPE_EXTENSION;if(Tr(t))return ne.OBJECT_TYPE_EXTENSION;if(Jn(t))return ne.INTERFACE_TYPE_EXTENSION;if(oo(t))return ne.UNION_TYPE_EXTENSION;if(ao(t))return ne.ENUM_TYPE_EXTENSION;if(ei(t))return ne.INPUT_OBJECT_TYPE_EXTENSION;ji(!1,"Unexpected type: "+it(t))}function AK(t){switch(t){case ne.SCALAR_TYPE_EXTENSION:return"scalar";case ne.OBJECT_TYPE_EXTENSION:return"object";case ne.INTERFACE_TYPE_EXTENSION:return"interface";case ne.UNION_TYPE_EXTENSION:return"union";case ne.ENUM_TYPE_EXTENSION:return"enum";case ne.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:ji(!1,"Unexpected kind: "+it(t))}}function NK(t){return{...PN(t),Field:{leave(e){var n;const r=t.getFieldDef();if(!r)return!1;const i=new Set((n=e.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(const s of r.args)if(!i.has(s.name)&&mN(s)){const o=it(s.type);t.reportError(new Ce(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:e}))}}}}}function PN(t){var e;const n=Object.create(null),r=t.getSchema(),i=(e=r==null?void 0:r.getDirectives())!==null&&e!==void 0?e:Su;for(const a of i)n[a.name]=hc(a.args.filter(mN),c=>c.name);const s=t.getDocument().definitions;for(const a of s)if(a.kind===ne.DIRECTIVE_DEFINITION){var o;const c=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=hc(c.filter(PK),l=>l.name.value)}return{Directive:{leave(a){const c=a.name.value,l=n[c];if(l){var u;const d=(u=a.arguments)!==null&&u!==void 0?u:[],f=new Set(d.map(p=>p.name.value));for(const[p,m]of Object.entries(l))if(!f.has(p)){const h=eS(m.type)?it(m.type):qn(m.type);t.reportError(new Ce(`Directive "@${c}" argument "${p}" of type "${h}" is required, but it was not provided.`,{nodes:a}))}}}}}}function PK(t){return t.type.kind===ne.NON_NULL_TYPE&&t.defaultValue==null}function MK(t){return{Field(e){const n=t.getType(),r=e.selectionSet;if(n)if(Jl(mc(n))){if(r){const i=e.name.value,s=it(n);t.reportError(new Ce(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(r){if(r.selections.length===0){const i=e.name.value,s=it(n);t.reportError(new Ce(`Field "${i}" of type "${s}" must have at least one field selected.`,{nodes:e}))}}else{const i=e.name.value,s=it(n);t.reportError(new Ce(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:e}))}}}}function Fa(t,e,n){if(t){if(t.kind===ne.VARIABLE){const r=t.name.value;if(n==null||n[r]===void 0)return;const i=n[r];return i===null&&gn(e)?void 0:i}if(gn(e))return t.kind===ne.NULL?void 0:Fa(t,e.ofType,n);if(t.kind===ne.NULL)return null;if(ti(e)){const r=e.ofType;if(t.kind===ne.LIST){const s=[];for(const o of t.values)if(JT(o,n)){if(gn(r))return;s.push(null)}else{const a=Fa(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=Fa(t,r,n);return i===void 0?void 0:[i]}if(ei(e)){if(t.kind!==ne.OBJECT)return;const r=Object.create(null),i=hc(t.fields,s=>s.name.value);for(const s of Object.values(e.getFields())){const o=i[s.name];if(!o||JT(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(gn(s.type))return;continue}const a=Fa(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}if(e.isOneOf){const s=Object.keys(r);if(s.length!==1||r[s[0]]===null)return}return r}if(Jl(e)){let r;try{r=e.parseLiteral(t,n)}catch{return}return r===void 0?void 0:r}ji(!1,"Unexpected input type: "+it(e))}}function JT(t,e){return t.kind===ne.VARIABLE&&(e==null||e[t.name.value]===void 0)}function LK(t,e,n){var r;const i={},s=(r=e.arguments)!==null&&r!==void 0?r:[],o=hc(s,a=>a.name.value);for(const a of t.args){const c=a.name,l=a.type,u=o[c];if(!u){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(gn(l))throw new Ce(`Argument "${c}" of required type "${it(l)}" was not provided.`,{nodes:e});continue}const d=u.value;let f=d.kind===ne.NULL;if(d.kind===ne.VARIABLE){const m=d.name.value;if(n==null||!FK(n,m)){if(a.defaultValue!==void 0)i[c]=a.defaultValue;else if(gn(l))throw new Ce(`Argument "${c}" of required type "${it(l)}" was provided the variable "$${m}" which was not provided a runtime value.`,{nodes:d});continue}f=n[m]==null}if(f&&gn(l))throw new Ce(`Argument "${c}" of non-null type "${it(l)}" must not be null.`,{nodes:d});const p=Fa(d,l,n);if(p===void 0)throw new Ce(`Argument "${c}" has invalid value ${qn(d)}.`,{nodes:d});i[c]=p}return i}function Ef(t,e,n){var r;const i=(r=e.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===t.name);if(i)return LK(t,i,n)}function FK(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function $K(t,e,n,r,i){const s=new Map;return h_(t,e,n,r,i,s,new Set),s}function h_(t,e,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case ne.FIELD:{if(!jv(n,a))continue;const c=jK(a),l=s.get(c);l!==void 0?l.push(a):s.set(c,[a]);break}case ne.INLINE_FRAGMENT:{if(!jv(n,a)||!XT(t,a,r))continue;h_(t,e,n,r,a.selectionSet,s,o);break}case ne.FRAGMENT_SPREAD:{const c=a.name.value;if(o.has(c)||!jv(n,a))continue;o.add(c);const l=e[c];if(!l||!XT(t,l,r))continue;h_(t,e,n,r,l.selectionSet,s,o);break}}}function jv(t,e){const n=Ef(vN,e,t);if((n==null?void 0:n.if)===!0)return!1;const r=Ef(yN,e,t);return(r==null?void 0:r.if)!==!1}function XT(t,e,n){const r=e.typeCondition;if(!r)return!0;const i=Os(t,r);return i===n?!0:Ka(i)?t.isSubType(i,n):!1}function jK(t){return t.alias?t.alias.value:t.name.value}function UK(t){return{OperationDefinition(e){if(e.operation==="subscription"){const n=t.getSchema(),r=n.getSubscriptionType();if(r){const i=e.name?e.name.value:null,s=Object.create(null),o=t.getDocument(),a=Object.create(null);for(const l of o.definitions)l.kind===ne.FRAGMENT_DEFINITION&&(a[l.name.value]=l);const c=$K(n,a,s,r,e.selectionSet);if(c.size>1){const d=[...c.values()].slice(1).flat();t.reportError(new Ce(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:d}))}for(const l of c.values())l[0].name.value.startsWith("__")&&t.reportError(new Ce(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:l}))}}}}}function aS(t,e){const n=new Map;for(const r of t){const i=e(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}function BK(t){return{DirectiveDefinition(r){var i;const s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:e,InterfaceTypeExtension:e,ObjectTypeDefinition:e,ObjectTypeExtension:e};function e(r){var i;const s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(const c of o){var a;const l=c.name.value,u=(a=c.arguments)!==null&&a!==void 0?a:[];n(`${s}.${l}`,u)}return!1}function n(r,i){const s=aS(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new Ce(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function MN(t){return{Field:e,Directive:e};function e(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=aS(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&t.reportError(new Ce(`There can be only one argument named "${o}".`,{nodes:a.map(c=>c.name)}))}}function zK(t){const e=Object.create(null),n=t.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n!=null&&n.getDirective(i)){t.reportError(new Ce(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return e[i]?t.reportError(new Ce(`There can be only one directive named "@${i}".`,{nodes:[e[i],r.name]})):e[i]=r.name,!1}}}function LN(t){const e=Object.create(null),n=t.getSchema(),r=n?n.getDirectives():Su;for(const a of r)e[a.name]=!a.isRepeatable;const i=t.getDocument().definitions;for(const a of i)a.kind===ne.DIRECTIVE_DEFINITION&&(e[a.name.value]=!a.repeatable);const s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let c;if(a.kind===ne.SCHEMA_DEFINITION||a.kind===ne.SCHEMA_EXTENSION)c=s;else if(mp(a)||iS(a)){const l=a.name.value;c=o[l],c===void 0&&(o[l]=c=Object.create(null))}else c=Object.create(null);for(const l of a.directives){const u=l.name.value;e[u]&&(c[u]?t.reportError(new Ce(`The directive "@${u}" can only be used once at this location.`,{nodes:[c[u],l]})):c[u]=l)}}}}function VK(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const c=(o=s.values)!==null&&o!==void 0?o:[],l=r[a];for(const u of c){const d=u.name.value,f=n[a];ao(f)&&f.getValue(d)?t.reportError(new Ce(`Enum value "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:u.name})):l[d]?t.reportError(new Ce(`Enum value "${a}.${d}" can only be defined once.`,{nodes:[l[d],u.name]})):l[d]=u.name}return!1}}function HK(t){const e=t.getSchema(),n=e?e.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const c=(o=s.fields)!==null&&o!==void 0?o:[],l=r[a];for(const u of c){const d=u.name.value;WK(n[a],d)?t.reportError(new Ce(`Field "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:u.name})):l[d]?t.reportError(new Ce(`Field "${a}.${d}" can only be defined once.`,{nodes:[l[d],u.name]})):l[d]=u.name}return!1}}function WK(t,e){return Tr(t)||Jn(t)||ei(t)?t.getFields()[e]!=null:!1}function qK(t){const e=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return e[r]?t.reportError(new Ce(`There can be only one fragment named "${r}".`,{nodes:[e[r],n.name]})):e[r]=n.name,!1}}}function FN(t){const e=[];let n=Object.create(null);return{ObjectValue:{enter(){e.push(n),n=Object.create(null)},leave(){const r=e.pop();r||ji(!1),n=r}},ObjectField(r){const i=r.name.value;n[i]?t.reportError(new Ce(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}function GK(t){const e=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(e[r.value]?t.reportError(new Ce(`There can be only one operation named "${r.value}".`,{nodes:[e[r.value],r]})):e[r.value]=r),!1},FragmentDefinition:()=>!1}}function ZK(t){const e=t.getSchema(),n=Object.create(null),r=e?{query:e.getQueryType(),mutation:e.getMutationType(),subscription:e.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;const a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(const c of a){const l=c.operation,u=n[l];r[l]?t.reportError(new Ce(`Type for ${l} already defined in the schema. It cannot be redefined.`,{nodes:c})):u?t.reportError(new Ce(`There can be only one ${l} type in schema.`,{nodes:[u,c]})):n[l]=c}return!1}}function YK(t){const e=Object.create(null),n=t.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){const s=i.name.value;if(n!=null&&n.getType(s)){t.reportError(new Ce(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return e[s]?t.reportError(new Ce(`There can be only one type named "${s}".`,{nodes:[e[s],i.name]})):e[s]=i.name,!1}}function KK(t){return{OperationDefinition(e){var n;const r=(n=e.variableDefinitions)!==null&&n!==void 0?n:[],i=aS(r,s=>s.variable.name.value);for(const[s,o]of i)o.length>1&&t.reportError(new Ce(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}function JK(t){let e={};return{OperationDefinition:{enter(){e={}}},VariableDefinition(n){e[n.variable.name.value]=n},ListValue(n){const r=UY(t.getParentInputType());if(!ti(r))return Ta(t,n),!1},ObjectValue(n){const r=mc(t.getInputType());if(!ei(r))return Ta(t,n),!1;const i=hc(n.fields,s=>s.name.value);for(const s of Object.values(r.getFields()))if(!i[s.name]&&VY(s)){const a=it(s.type);t.reportError(new Ce(`Field "${r.name}.${s.name}" of required type "${a}" was not provided.`,{nodes:n}))}r.isOneOf&&XK(t,n,r,i,e)},ObjectField(n){const r=mc(t.getParentInputType());if(!t.getInputType()&&ei(r)){const s=kc(n.name.value,Object.keys(r.getFields()));t.reportError(new Ce(`Field "${n.name.value}" is not defined by type "${r.name}".`+ia(s),{nodes:n}))}},NullValue(n){const r=t.getInputType();gn(r)&&t.reportError(new Ce(`Expected value of type "${it(r)}", found ${qn(n)}.`,{nodes:n}))},EnumValue:n=>Ta(t,n),IntValue:n=>Ta(t,n),FloatValue:n=>Ta(t,n),StringValue:n=>Ta(t,n),BooleanValue:n=>Ta(t,n)}}function Ta(t,e){const n=t.getInputType();if(!n)return;const r=mc(n);if(!Jl(r)){const i=it(n);t.reportError(new Ce(`Expected value of type "${i}", found ${qn(e)}.`,{nodes:e}));return}try{if(r.parseLiteral(e,void 0)===void 0){const s=it(n);t.reportError(new Ce(`Expected value of type "${s}", found ${qn(e)}.`,{nodes:e}))}}catch(i){const s=it(n);i instanceof Ce?t.reportError(i):t.reportError(new Ce(`Expected value of type "${s}", found ${qn(e)}; `+i.message,{nodes:e,originalError:i}))}}function XK(t,e,n,r,i){var s;const o=Object.keys(r);if(o.length!==1){t.reportError(new Ce(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[e]}));return}const c=(s=r[o[0]])===null||s===void 0?void 0:s.value,l=!c||c.kind===ne.NULL,u=(c==null?void 0:c.kind)===ne.VARIABLE;if(l){t.reportError(new Ce(`Field "${n.name}.${o[0]}" must be non-null.`,{nodes:[e]}));return}if(u){const d=c.name.value;i[d].type.kind!==ne.NON_NULL_TYPE&&t.reportError(new Ce(`Variable "${d}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[e]}))}}function QK(t){return{VariableDefinition(e){const n=Os(t.getSchema(),e.type);if(n!==void 0&&!oN(n)){const r=e.variable.name.value,i=qn(e.type);t.reportError(new Ce(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:e.type}))}}}}function eJ(t){let e=Object.create(null);return{OperationDefinition:{enter(){e=Object.create(null)},leave(n){const r=t.getRecursiveVariableUsages(n);for(const{node:i,type:s,defaultValue:o}of r){const a=i.name.value,c=e[a];if(c&&s){const l=t.getSchema(),u=Os(l,c.type);if(u&&!tJ(l,u,c.defaultValue,s,o)){const d=it(u),f=it(s);t.reportError(new Ce(`Variable "$${a}" of type "${d}" used in position expecting type "${f}".`,{nodes:[c,i]}))}}}}},VariableDefinition(n){e[n.variable.name.value]=n}}}function tJ(t,e,n,r,i){if(gn(r)&&!gn(e)){if(!(n!=null&&n.kind!==ne.NULL)&&!(i!==void 0))return!1;const a=r.ofType;return Ed(t,e,a)}return Ed(t,e,r)}const nJ=Object.freeze([hK]);Object.freeze([tK,GK,dK,UK,RN,sK,QK,MK,nK,qK,lK,yK,OK,mK,KK,gK,vK,CN,LN,oK,MN,JK,NK,eJ,_K,FN,...nJ]);const rJ=Object.freeze([fK,ZK,YK,VK,HK,BK,zK,RN,CN,LN,RK,ON,MN,FN,PN]);class iJ{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const r of this.getDocument().definitions)r.kind===ne.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const r=[e];let i;for(;i=r.pop();)for(const s of i.selections)s.kind===ne.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const r=Object.create(null),i=[e.selectionSet];let s;for(;s=i.pop();)for(const o of this.getFragmentSpreads(s)){const a=o.name.value;if(r[a]!==!0){r[a]=!0;const c=this.getFragment(a);c&&(n.push(c),i.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}class sJ extends iJ{constructor(e,n,r){super(e,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}function oJ(t,e,n=rJ){const r=[],i=new sJ(t,e,o=>{r.push(o)}),s=n.map(o=>o(i));return iN(t,MY(s)),r}function aJ(t){const e=oJ(t);if(e.length!==0)throw new Error(e.map(n=>n.message).join(`
152
+
153
+ `))}function cJ(t,e,n){var r,i,s,o;const a=[],c=Object.create(null),l=[];let u;const d=[];for(const C of e.definitions)if(C.kind===ne.SCHEMA_DEFINITION)u=C;else if(C.kind===ne.SCHEMA_EXTENSION)d.push(C);else if(mp(C))a.push(C);else if(iS(C)){const Z=C.name.value,H=c[Z];c[Z]=H?H.concat([C]):[C]}else C.kind===ne.DIRECTIVE_DEFINITION&&l.push(C);if(Object.keys(c).length===0&&a.length===0&&l.length===0&&d.length===0&&u==null)return t;const f=Object.create(null);for(const C of t.types)f[C.name]=v(C);for(const C of a){var p;const Z=C.name.value;f[Z]=(p=QT[Z])!==null&&p!==void 0?p:U(C)}const m={query:t.query&&g(t.query),mutation:t.mutation&&g(t.mutation),subscription:t.subscription&&g(t.subscription),...u&&q([u]),...q(d)};return{description:(r=u)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value,...m,types:Object.values(f),directives:[...t.directives.map(y),...l.map(x)],extensions:Object.create(null),astNode:(s=u)!==null&&s!==void 0?s:t.astNode,extensionASTNodes:t.extensionASTNodes.concat(d),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1};function h(C){return ti(C)?new Er(h(C.ofType)):gn(C)?new At(h(C.ofType)):g(C)}function g(C){return f[C.name]}function y(C){const Z=C.toConfig();return new sa({...Z,args:Gs(Z.args,F)})}function v(C){if(KY(C)||qY(C))return C;if(Eu(C))return w(C);if(Tr(C))return S(C);if(Jn(C))return _(C);if(oo(C))return O(C);if(ao(C))return E(C);if(ei(C))return b(C);ji(!1,"Unexpected type: "+it(C))}function b(C){var Z;const H=C.toConfig(),V=(Z=c[H.name])!==null&&Z!==void 0?Z:[];return new d_({...H,fields:()=>({...Gs(H.fields,ce=>({...ce,type:h(ce.type)})),...B(V)}),extensionASTNodes:H.extensionASTNodes.concat(V)})}function E(C){var Z;const H=C.toConfig(),V=(Z=c[C.name])!==null&&Z!==void 0?Z:[];return new wf({...H,values:{...H.values,...J(V)},extensionASTNodes:H.extensionASTNodes.concat(V)})}function w(C){var Z;const H=C.toConfig(),V=(Z=c[H.name])!==null&&Z!==void 0?Z:[];let ce=H.specifiedByURL;for(const ge of V){var le;ce=(le=eI(ge))!==null&&le!==void 0?le:ce}return new co({...H,specifiedByURL:ce,extensionASTNodes:H.extensionASTNodes.concat(V)})}function S(C){var Z;const H=C.toConfig(),V=(Z=c[H.name])!==null&&Z!==void 0?Z:[];return new mi({...H,interfaces:()=>[...C.getInterfaces().map(g),...L(V)],fields:()=>({...Gs(H.fields,M),...A(V)}),extensionASTNodes:H.extensionASTNodes.concat(V)})}function _(C){var Z;const H=C.toConfig(),V=(Z=c[H.name])!==null&&Z!==void 0?Z:[];return new u_({...H,interfaces:()=>[...C.getInterfaces().map(g),...L(V)],fields:()=>({...Gs(H.fields,M),...A(V)}),extensionASTNodes:H.extensionASTNodes.concat(V)})}function O(C){var Z;const H=C.toConfig(),V=(Z=c[H.name])!==null&&Z!==void 0?Z:[];return new wl({...H,types:()=>[...C.getTypes().map(g),...G(V)],extensionASTNodes:H.extensionASTNodes.concat(V)})}function M(C){return{...C,type:h(C.type),args:C.args&&Gs(C.args,F)}}function F(C){return{...C,type:h(C.type)}}function q(C){const Z={};for(const V of C){var H;const ce=(H=V.operationTypes)!==null&&H!==void 0?H:[];for(const le of ce)Z[le.operation]=I(le.type)}return Z}function I(C){var Z;const H=C.name.value,V=(Z=QT[H])!==null&&Z!==void 0?Z:f[H];if(V===void 0)throw new Error(`Unknown type: "${H}".`);return V}function $(C){return C.kind===ne.LIST_TYPE?new Er($(C.type)):C.kind===ne.NON_NULL_TYPE?new At($(C.type)):I(C)}function x(C){var Z;return new sa({name:C.name.value,description:(Z=C.description)===null||Z===void 0?void 0:Z.value,locations:C.locations.map(({value:H})=>H),isRepeatable:C.repeatable,args:P(C.arguments),astNode:C})}function A(C){const Z=Object.create(null);for(const ce of C){var H;const le=(H=ce.fields)!==null&&H!==void 0?H:[];for(const ge of le){var V;Z[ge.name.value]={type:$(ge.type),description:(V=ge.description)===null||V===void 0?void 0:V.value,args:P(ge.arguments),deprecationReason:lh(ge),astNode:ge}}}return Z}function P(C){const Z=C??[],H=Object.create(null);for(const ce of Z){var V;const le=$(ce.type);H[ce.name.value]={type:le,description:(V=ce.description)===null||V===void 0?void 0:V.value,defaultValue:Fa(ce.defaultValue,le),deprecationReason:lh(ce),astNode:ce}}return H}function B(C){const Z=Object.create(null);for(const ce of C){var H;const le=(H=ce.fields)!==null&&H!==void 0?H:[];for(const ge of le){var V;const Re=$(ge.type);Z[ge.name.value]={type:Re,description:(V=ge.description)===null||V===void 0?void 0:V.value,defaultValue:Fa(ge.defaultValue,Re),deprecationReason:lh(ge),astNode:ge}}}return Z}function J(C){const Z=Object.create(null);for(const ce of C){var H;const le=(H=ce.values)!==null&&H!==void 0?H:[];for(const ge of le){var V;Z[ge.name.value]={description:(V=ge.description)===null||V===void 0?void 0:V.value,deprecationReason:lh(ge),astNode:ge}}}return Z}function L(C){return C.flatMap(Z=>{var H,V;return(H=(V=Z.interfaces)===null||V===void 0?void 0:V.map(I))!==null&&H!==void 0?H:[]})}function G(C){return C.flatMap(Z=>{var H,V;return(H=(V=Z.types)===null||V===void 0?void 0:V.map(I))!==null&&H!==void 0?H:[]})}function U(C){var Z;const H=C.name.value,V=(Z=c[H])!==null&&Z!==void 0?Z:[];switch(C.kind){case ne.OBJECT_TYPE_DEFINITION:{var ce;const He=[C,...V];return new mi({name:H,description:(ce=C.description)===null||ce===void 0?void 0:ce.value,interfaces:()=>L(He),fields:()=>A(He),astNode:C,extensionASTNodes:V})}case ne.INTERFACE_TYPE_DEFINITION:{var le;const He=[C,...V];return new u_({name:H,description:(le=C.description)===null||le===void 0?void 0:le.value,interfaces:()=>L(He),fields:()=>A(He),astNode:C,extensionASTNodes:V})}case ne.ENUM_TYPE_DEFINITION:{var ge;const He=[C,...V];return new wf({name:H,description:(ge=C.description)===null||ge===void 0?void 0:ge.value,values:J(He),astNode:C,extensionASTNodes:V})}case ne.UNION_TYPE_DEFINITION:{var Re;const He=[C,...V];return new wl({name:H,description:(Re=C.description)===null||Re===void 0?void 0:Re.value,types:()=>G(He),astNode:C,extensionASTNodes:V})}case ne.SCALAR_TYPE_DEFINITION:{var Ge;return new co({name:H,description:(Ge=C.description)===null||Ge===void 0?void 0:Ge.value,specifiedByURL:eI(C),astNode:C,extensionASTNodes:V})}case ne.INPUT_OBJECT_TYPE_DEFINITION:{var st;const He=[C,...V];return new d_({name:H,description:(st=C.description)===null||st===void 0?void 0:st.value,fields:()=>B(He),astNode:C,extensionASTNodes:V,isOneOf:lJ(C)})}}}}const QT=hc([...tS,...rS],t=>t.name);function lh(t){const e=Ef(bN,t);return e==null?void 0:e.reason}function eI(t){const e=Ef(_N,t);return e==null?void 0:e.url}function lJ(t){return!!Ef(wN,t)}function uJ(t,e){t!=null&&t.kind===ne.DOCUMENT||Jt(!1,"Must provide valid Document AST."),(e==null?void 0:e.assumeValid)!==!0&&(e==null?void 0:e.assumeValidSDL)!==!0&&aJ(t);const r=cJ({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},t,e);if(r.astNode==null)for(const s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}const i=[...r.directives,...Su.filter(s=>r.directives.every(o=>o.name!==s.name))];return new JY({...r,directives:i})}function dJ(t,e){const n=nN(t,{noLocation:void 0,allowLegacyFragmentVariables:void 0});return uJ(n,{assumeValidSDL:void 0,assumeValid:void 0})}const cS=JSON,fJ=t=>t.toUpperCase(),pJ=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},hJ=(t,e,n)=>t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0},mJ=(t,e,n)=>t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0},gJ=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0},tI=t=>{var r,i;let e;const n=t.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(e=(i=(r=n[0])==null?void 0:r.name)==null?void 0:i.value),e},Uv=t=>{if(typeof t=="string"){let n;try{const r=nN(t);n=tI(r)}catch{}return{query:t,operationName:n}}const e=tI(t);return{query:qn(t),operationName:e}};class El extends Error{constructor(e,n){const r=`${El.extractMessage(e)}: ${JSON.stringify({response:e,request:n})}`;super(r),Object.setPrototypeOf(this,El.prototype),this.response=e,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,El)}static extractMessage(e){var n,r;return((r=(n=e.errors)==null?void 0:n[0])==null?void 0:r.message)??`GraphQL Error (Code: ${e.status})`}}var m_={exports:{}};(function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof dr<"u"&&dr,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof dr<"u"&&dr||{},c={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 l(A){return A&&DataView.prototype.isPrototypeOf(A)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(A){return A&&u.indexOf(Object.prototype.toString.call(A))>-1};function f(A){if(typeof A!="string"&&(A=String(A)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(A)||A==="")throw new TypeError('Invalid character in header field name: "'+A+'"');return A.toLowerCase()}function p(A){return typeof A!="string"&&(A=String(A)),A}function m(A){var P={next:function(){var B=A.shift();return{done:B===void 0,value:B}}};return c.iterable&&(P[Symbol.iterator]=function(){return P}),P}function h(A){this.map={},A instanceof h?A.forEach(function(P,B){this.append(B,P)},this):Array.isArray(A)?A.forEach(function(P){if(P.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+P.length);this.append(P[0],P[1])},this):A&&Object.getOwnPropertyNames(A).forEach(function(P){this.append(P,A[P])},this)}h.prototype.append=function(A,P){A=f(A),P=p(P);var B=this.map[A];this.map[A]=B?B+", "+P:P},h.prototype.delete=function(A){delete this.map[f(A)]},h.prototype.get=function(A){return A=f(A),this.has(A)?this.map[A]:null},h.prototype.has=function(A){return this.map.hasOwnProperty(f(A))},h.prototype.set=function(A,P){this.map[f(A)]=p(P)},h.prototype.forEach=function(A,P){for(var B in this.map)this.map.hasOwnProperty(B)&&A.call(P,this.map[B],B,this)},h.prototype.keys=function(){var A=[];return this.forEach(function(P,B){A.push(B)}),m(A)},h.prototype.values=function(){var A=[];return this.forEach(function(P){A.push(P)}),m(A)},h.prototype.entries=function(){var A=[];return this.forEach(function(P,B){A.push([B,P])}),m(A)},c.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);function g(A){if(!A._noBody){if(A.bodyUsed)return Promise.reject(new TypeError("Already read"));A.bodyUsed=!0}}function y(A){return new Promise(function(P,B){A.onload=function(){P(A.result)},A.onerror=function(){B(A.error)}})}function v(A){var P=new FileReader,B=y(P);return P.readAsArrayBuffer(A),B}function b(A){var P=new FileReader,B=y(P),J=/charset=([A-Za-z0-9_-]+)/.exec(A.type),L=J?J[1]:"utf-8";return P.readAsText(A,L),B}function E(A){for(var P=new Uint8Array(A),B=new Array(P.length),J=0;J<P.length;J++)B[J]=String.fromCharCode(P[J]);return B.join("")}function w(A){if(A.slice)return A.slice(0);var P=new Uint8Array(A.byteLength);return P.set(new Uint8Array(A)),P.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(A){this.bodyUsed=this.bodyUsed,this._bodyInit=A,A?typeof A=="string"?this._bodyText=A:c.blob&&Blob.prototype.isPrototypeOf(A)?this._bodyBlob=A:c.formData&&FormData.prototype.isPrototypeOf(A)?this._bodyFormData=A:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)?this._bodyText=A.toString():c.arrayBuffer&&c.blob&&l(A)?(this._bodyArrayBuffer=w(A.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(A)||d(A))?this._bodyArrayBuffer=w(A):this._bodyText=A=Object.prototype.toString.call(A):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof A=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var A=g(this);if(A)return A;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(){if(this._bodyArrayBuffer){var A=g(this);return A||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(v);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var A=g(this);if(A)return A;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function O(A){var P=A.toUpperCase();return _.indexOf(P)>-1?P:A}function M(A,P){if(!(this instanceof M))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var B=P.body;if(A instanceof M){if(A.bodyUsed)throw new TypeError("Already read");this.url=A.url,this.credentials=A.credentials,P.headers||(this.headers=new h(A.headers)),this.method=A.method,this.mode=A.mode,this.signal=A.signal,!B&&A._bodyInit!=null&&(B=A._bodyInit,A.bodyUsed=!0)}else this.url=String(A);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new h(P.headers)),this.method=O(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal||function(){if("AbortController"in a){var G=new AbortController;return G.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&B)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(B),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var J=/([?&])_=[^&]*/;if(J.test(this.url))this.url=this.url.replace(J,"$1_="+new Date().getTime());else{var L=/\?/;this.url+=(L.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}M.prototype.clone=function(){return new M(this,{body:this._bodyInit})};function F(A){var P=new FormData;return A.trim().split("&").forEach(function(B){if(B){var J=B.split("="),L=J.shift().replace(/\+/g," "),G=J.join("=").replace(/\+/g," ");P.append(decodeURIComponent(L),decodeURIComponent(G))}}),P}function q(A){var P=new h,B=A.replace(/\r?\n[\t ]+/g," ");return B.split("\r").map(function(J){return J.indexOf(`
154
+ `)===0?J.substr(1,J.length):J}).forEach(function(J){var L=J.split(":"),G=L.shift().trim();if(G){var U=L.join(":").trim();try{P.append(G,U)}catch(C){console.warn("Response "+C.message)}}}),P}S.call(M.prototype);function I(A,P){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=P.statusText===void 0?"":""+P.statusText,this.headers=new h(P.headers),this.url=P.url||"",this._initBody(A)}S.call(I.prototype),I.prototype.clone=function(){return new I(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},I.error=function(){var A=new I(null,{status:200,statusText:""});return A.ok=!1,A.status=0,A.type="error",A};var $=[301,302,303,307,308];I.redirect=function(A,P){if($.indexOf(P)===-1)throw new RangeError("Invalid status code");return new I(null,{status:P,headers:{location:A}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(P,B){this.message=P,this.name=B;var J=Error(P);this.stack=J.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function x(A,P){return new Promise(function(B,J){var L=new M(A,P);if(L.signal&&L.signal.aborted)return J(new o.DOMException("Aborted","AbortError"));var G=new XMLHttpRequest;function U(){G.abort()}G.onload=function(){var H={statusText:G.statusText,headers:q(G.getAllResponseHeaders()||"")};L.url.indexOf("file://")===0&&(G.status<200||G.status>599)?H.status=200:H.status=G.status,H.url="responseURL"in G?G.responseURL:H.headers.get("X-Request-URL");var V="response"in G?G.response:G.responseText;setTimeout(function(){B(new I(V,H))},0)},G.onerror=function(){setTimeout(function(){J(new TypeError("Network request failed"))},0)},G.ontimeout=function(){setTimeout(function(){J(new TypeError("Network request timed out"))},0)},G.onabort=function(){setTimeout(function(){J(new o.DOMException("Aborted","AbortError"))},0)};function C(H){try{return H===""&&a.location.href?a.location.href:H}catch{return H}}if(G.open(L.method,C(L.url),!0),L.credentials==="include"?G.withCredentials=!0:L.credentials==="omit"&&(G.withCredentials=!1),"responseType"in G&&(c.blob?G.responseType="blob":c.arrayBuffer&&(G.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof h||a.Headers&&P.headers instanceof a.Headers)){var Z=[];Object.getOwnPropertyNames(P.headers).forEach(function(H){Z.push(f(H)),G.setRequestHeader(H,p(P.headers[H]))}),L.headers.forEach(function(H,V){Z.indexOf(V)===-1&&G.setRequestHeader(V,H)})}else L.headers.forEach(function(H,V){G.setRequestHeader(V,H)});L.signal&&(L.signal.addEventListener("abort",U),G.onreadystatechange=function(){G.readyState===4&&L.signal.removeEventListener("abort",U)}),G.send(typeof L._bodyInit>"u"?null:L._bodyInit)})}return x.polyfill=!0,a.fetch||(a.fetch=x,a.Headers=h,a.Request=M,a.Response=I),o.Headers=h,o.Request=M,o.Response=I,o.fetch=x,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n: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})(m_,m_.exports);var zm=m_.exports;const Vh=pa(zm),yJ=m$({__proto__:null,default:Vh},[zm]),Gc=t=>{let e={};return t&&(typeof Headers<"u"&&t instanceof Headers||yJ&&zm.Headers&&t instanceof zm.Headers?e=pJ(t):Array.isArray(t)?t.forEach(([n,r])=>{n&&r!==void 0&&(e[n]=r)}):e=t),e},nI=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),vJ=t=>{if(!Array.isArray(t.query)){const r=t,i=[`query=${encodeURIComponent(nI(r.query))}`];return t.variables&&i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`),r.operationName&&i.push(`operationName=${encodeURIComponent(r.operationName)}`),i.join("&")}if(typeof t.variables<"u"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");const e=t,n=t.query.reduce((r,i,s)=>(r.push({query:nI(i),variables:e.variables?e.jsonSerializer.stringify(e.variables[s]):void 0}),r),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`},bJ=t=>async e=>{const{url:n,query:r,variables:i,operationName:s,fetch:o,fetchOptions:a,middleware:c}=e,l={...e.headers};let u="",d;t==="POST"?(d=wJ(r,i,s,a.jsonSerializer),typeof d=="string"&&(l["Content-Type"]="application/json")):u=vJ({query:r,variables:i,operationName:s,jsonSerializer:a.jsonSerializer??cS});const f={method:t,headers:l,body:d,...a};let p=n,m=f;if(c){const h=await Promise.resolve(c({...f,url:n,operationName:s,variables:i})),{url:g,...y}=h;p=g,m=y}return u&&(p=`${p}?${u}`),await o(p,m)};class _J{constructor(e,n={}){this.url=e,this.requestConfig=n,this.rawRequest=async(...r)=>{const[i,s,o]=r,a=mJ(i,s,o),{headers:c,fetch:l=Vh,method:u="POST",requestMiddleware:d,responseMiddleware:f,...p}=this.requestConfig,{url:m}=this;a.signal!==void 0&&(p.signal=a.signal);const{operationName:h}=Uv(a.query);return Bv({url:m,query:a.query,variables:a.variables,headers:{...Gc(zv(c)),...Gc(a.requestHeaders)},operationName:h,fetch:l,method:u,fetchOptions:p,middleware:d}).then(g=>(f&&f(g),g)).catch(g=>{throw f&&f(g),g})}}async request(e,...n){const[r,i]=n,s=hJ(e,r,i),{headers:o,fetch:a=Vh,method:c="POST",requestMiddleware:l,responseMiddleware:u,...d}=this.requestConfig,{url:f}=this;s.signal!==void 0&&(d.signal=s.signal);const{query:p,operationName:m}=Uv(s.document);return Bv({url:f,query:p,variables:s.variables,headers:{...Gc(zv(o)),...Gc(s.requestHeaders)},operationName:m,fetch:a,method:c,fetchOptions:d,middleware:l}).then(h=>(u&&u(h),h.data)).catch(h=>{throw u&&u(h),h})}batchRequests(e,n){const r=gJ(e,n),{headers:i,...s}=this.requestConfig;r.signal!==void 0&&(s.signal=r.signal);const o=r.documents.map(({document:c})=>Uv(c).query),a=r.documents.map(({variables:c})=>c);return Bv({url:this.url,query:o,variables:a,headers:{...Gc(zv(i)),...Gc(r.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Vh,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(c=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c.data)).catch(c=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(c),c})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,n){const{headers:r}=this.requestConfig;return r?r[e]=n:this.requestConfig.headers={[e]:n},this}setEndpoint(e){return this.url=e,this}}const Bv=async t=>{const{query:e,variables:n,fetchOptions:r}=t,i=bJ(fJ(t.method??"post")),s=Array.isArray(t.query),o=await i(t),a=await EJ(o,r.jsonSerializer??cS),c=Array.isArray(a)?!a.some(({data:u})=>!u):!!a.data,l=Array.isArray(a)||!a.errors||Array.isArray(a.errors)&&!a.errors.length||r.errorPolicy==="all"||r.errorPolicy==="ignore";if(o.ok&&l&&c){const{errors:u,...d}=(Array.isArray(a),a),f=r.errorPolicy==="ignore"?d:a;return{...s?{data:f}:f,headers:o.headers,status:o.status}}else{const u=typeof a=="string"?{error:a}:a;throw new El({...u,status:o.status,headers:o.headers},{query:e,variables:n})}},wJ=(t,e,n,r)=>{const i=r??cS;if(!Array.isArray(t))return i.stringify({query:t,variables:e,operationName:n});if(typeof e<"u"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");const s=t.reduce((o,a,c)=>(o.push({query:a,variables:e?e[c]:void 0}),o),[]);return i.stringify(s)},EJ=async(t,e)=>{let n;return t.headers.forEach((r,i)=>{i.toLowerCase()==="content-type"&&(n=r)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},zv=t=>typeof t=="function"?t():t,Sl=(t,...e)=>t.reduce((n,r,i)=>`${n}${r}${i in e?String(e[i]):""}`,"");var ss;class SJ{constructor(){It(this,ss,console);Ke(this,"log",(...e)=>de(this,ss).log(...e));Ke(this,"info",(...e)=>de(this,ss).info(...e));Ke(this,"warn",(...e)=>de(this,ss).warn(...e));Ke(this,"error",(...e)=>de(this,ss).error(...e));Ke(this,"debug",(...e)=>de(this,ss).debug(...e));Ke(this,"trace",(...e)=>de(this,ss).trace(...e));this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.trace=this.trace.bind(this)}set logger(e){bt(this,ss,e)}}ss=new WeakMap;const $N=new SJ,Tt=$N,xJ=t=>$N.logger=t;async function xl(...t){const[e,...n]=t,r=new _J(e,{fetch}),{errors:i,...s}=await r.request(...n),o={...s};return i!=null&&i.length&&(o.errors=i.map(({message:a,...c})=>new Ce(a,c))),o}function Hh(t){return t instanceof mi?Object.entries(t.getFields()).map(([e,n])=>{const r=n.type instanceof At?n.type.ofType:n.type;if(r instanceof mi||r instanceof wl)return`${e} { ${Hh(r)} }`;if(r instanceof Er){const i=r.ofType instanceof At?r.ofType.ofType:r.ofType;if(i instanceof co)return e;if(i instanceof mi||i instanceof wl)return`${e} { ${Hh(i)} }`;throw new Error(`List item type ${i.toString()} is not handled`)}return e}).join(" "):t instanceof wl?t.getTypes().map(e=>`... on ${e.name} { ${Hh(e)} }`).join(" "):""}function TJ(t,e){const n=nk(t.name),r=t.specifications.at(-1);if(!r)throw new Error("No document model specification found");const i=`${r.state.global.schema} type Query { ${n}: ${n}State }`,o=dJ(i).getQueryType();if(!o)throw new Error("No query type found");const c=o.getFields()[n];if(!c)throw new Error("No state query found");return Hh(c.type)}async function $a(t){var n,r;let e;try{const i=await xl(t,Sl`
155
+ query getDrive {
156
+ drive {
157
+ id
158
+ name
159
+ icon
160
+ slug
161
+ }
162
+ }
163
+ `);if((n=i.errors)!=null&&n.length||!i.drive)throw((r=i.errors)==null?void 0:r.at(0))??new Error("Drive not found");e=i.drive}catch(i){throw Tt.error(i),new Error("Couldn't find drive info")}return e}async function rI(t,e,n){const{documentModel:r,utils:i}=n,s=TJ(r),o=nk(r.name),a=await xl(t,Sl`
164
+ query ($id: String!) {
165
+ document(id: $id) {
166
+ id
167
+ name
168
+ created
169
+ documentType
170
+ lastModified
171
+ revision
172
+ operations {
173
+ id
174
+ error
175
+ hash
176
+ index
177
+ skip
178
+ timestamp
179
+ type
180
+ inputText
181
+ context {
182
+ signer {
183
+ user {
184
+ address
185
+ networkId
186
+ chainId
187
+ }
188
+ app {
189
+ name
190
+ key
191
+ }
192
+ signatures
193
+ }
194
+ }
195
+ }
196
+ ... on ${o} {
197
+ state {
198
+ ${s}
199
+ }
200
+ initialState {
201
+ ${s}
202
+ }
203
+ }
204
+ }
205
+ }
206
+ `,{id:e}),c=a.document?{...a.document,revision:{global:a.document.revision,local:0},state:i.createState({global:a.document.state}),operations:{global:a.document.operations.map(({inputText:l,...u})=>({...u,error:u.error??void 0,scope:"global",input:JSON.parse(l)})),local:[]},attachments:{},initialState:i.createExtendedState({created:a.document.created,lastModified:a.document.created,state:i.createState({global:a.document.initialState})}),clipboard:[]}:null;return{...a,document:c}}function IJ(t){const{open:e,groupSharingType:n,onAddRemoteDrive:r,onClose:i}=t;async function s(o){await r(o),i()}return T(_H,{open:e,onSubmit:s,sharingType:n,onOpenChange:o=>{if(!o)return i()},requestPublicDrive:$a})}const OJ=t=>{const{open:e,onClose:n,onCancel:r,title:i,body:s,cancelLabel:o,continueLabel:a,onContinue:c}=t;return T(mE,{open:e,onCancel:()=>r(n),header:i,body:s,cancelLabel:o,continueLabel:a,onContinue:()=>c(n),onOpenChange:l=>{if(!l)return n()}})},CJ=t=>{const{open:e,onClose:n}=t,{t:r}=ha();return T(H1,{open:e,header:r("modals.cookiesPolicy.title"),body:T(mC,{i18nKey:"modals.cookiesPolicy.body",components:{subtitle:T("h2",{className:"mb-4 text-lg font-bold"}),p:T("p",{className:"mb-2"}),list:T("ul",{className:"mb-4 list-disc pl-6"}),bullet:T("li",{})}}),bodyProps:{className:"text-left"},closeLabel:"Close",onContinue:()=>n(),overlayProps:{style:{zIndex:1e4}}})};var RJ=Object.defineProperty,DJ=(t,e,n)=>e in t?RJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,kJ=(t,e,n)=>DJ(t,e+"",n),Wt;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Wt||(Wt={}));var g_;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(g_||(g_={}));const Ue=Wt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hs=t=>{switch(typeof t){case"undefined":return Ue.undefined;case"string":return Ue.string;case"number":return isNaN(t)?Ue.nan:Ue.number;case"boolean":return Ue.boolean;case"function":return Ue.function;case"bigint":return Ue.bigint;case"symbol":return Ue.symbol;case"object":return Array.isArray(t)?Ue.array:t===null?Ue.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ue.promise:typeof Map<"u"&&t instanceof Map?Ue.map:typeof Set<"u"&&t instanceof Set?Ue.set:typeof Date<"u"&&t instanceof Date?Ue.date:Ue.object;default:return Ue.unknown}},Oe=Wt.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"]),AJ=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");let Ui=class jN 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(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}static assert(e){if(!(e instanceof jN))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Wt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Ui.create=t=>new Ui(t);const Xl=(t,e)=>{let n;switch(t.code){case Oe.invalid_type:t.received===Ue.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Oe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Wt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:n=`Unrecognized key(s) in object: ${Wt.joinValues(t.keys,", ")}`;break;case Oe.invalid_union:n="Invalid input";break;case Oe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Wt.joinValues(t.options)}`;break;case Oe.invalid_enum_value:n=`Invalid enum value. Expected ${Wt.joinValues(t.options)}, received '${t.received}'`;break;case Oe.invalid_arguments:n="Invalid function arguments";break;case Oe.invalid_return_type:n="Invalid function return type";break;case Oe.invalid_date:n="Invalid date";break;case Oe.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}"`:Wt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Oe.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==="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 Oe.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 Oe.custom:n="Invalid input";break;case Oe.invalid_intersection_types:n="Intersection results could not be merged";break;case Oe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Oe.not_finite:n="Number must be finite";break;default:n=e.defaultError,Wt.assertNever(t)}return{message:n}};let UN=Xl;function NJ(t){UN=t}function Vm(){return UN}const Hm=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},PJ=[];function Fe(t,e){const n=Vm(),r=Hm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Xl?void 0:Xl].filter(i=>!!i)});t.common.issues.push(r)}let Ur=class BN{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 yt;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 s=await i.key,o=await i.value;r.push({key:s,value:o})}return BN.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return yt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}};const yt=Object.freeze({status:"aborted"}),Wm=t=>({status:"dirty",value:t}),Or=t=>({status:"valid",value:t}),y_=t=>t.status==="aborted",v_=t=>t.status==="dirty",gc=t=>t.status==="valid",Sf=t=>typeof Promise<"u"&&t instanceof Promise;function qm(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function zN(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var Xe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Xe||(Xe={}));var ud,dd;let Cs=class{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||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const iI=(t,e)=>{if(gc(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 Ui(t.common.issues);return this._error=n,this._error}}};function Et(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)=>{var a,c;const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:(a=l??r)!==null&&a!==void 0?a:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(c=l??n)!==null&&c!==void 0?c:o.defaultError}},description:i}}class Ct{get description(){return this._def.description}_getType(e){return Hs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Hs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ur,ctx:{common:e.parent.common,data:e.data,parsedType:Hs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Sf(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){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hs(e)},s=this._parseSync({data:e,path:i.path,parent:i});return iI(i,s)}"~validate"(e){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hs(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:i});return gc(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((r=(n=s==null?void 0:s.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(s=>gc(s)?{value:s.value}:{issues:i.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==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hs(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(Sf(i)?i:Promise.resolve(i));return iI(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Oe.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!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 Gi({schema:this,typeName:ht.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 ws.create(this,this._def)}nullable(){return aa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yc.create(this)}promise(){return tu.create(this,this._def)}or(e){return Df.create([this,e],this._def)}and(e){return kf.create(this,e,this._def)}transform(e){return new Gi({...Et(this._def),schema:this,typeName:ht.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Mf({...Et(this._def),innerType:this,defaultValue:n,typeName:ht.ZodDefault})}brand(){return new lS({typeName:ht.ZodBranded,type:this,...Et(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Lf({...Et(this._def),innerType:this,catchValue:n,typeName:ht.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return uS.create(this,e)}readonly(){return Ff.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const MJ=/^c[^\s-]{8,}$/i,LJ=/^[0-9a-z]+$/,FJ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$J=/^[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,jJ=/^[a-z0-9_-]{21}$/i,UJ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BJ=/^[-+]?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)?)??$/,zJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,VJ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vv;const HJ=/^(?:(?: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])$/,WJ=/^(?:(?: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])$/,qJ=/^(([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]))$/,GJ=/^(([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])$/,ZJ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YJ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,VN="((\\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])))",KJ=new RegExp(`^${VN}$`);function HN(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function JJ(t){return new RegExp(`^${HN(t)}$`)}function WN(t){let e=`${VN}T${HN(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 XJ(t,e){return!!((e==="v4"||!e)&&HJ.test(t)||(e==="v6"||!e)&&qJ.test(t))}function QJ(t,e){if(!UJ.test(t))return!1;try{const[n]=t.split("."),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||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function eX(t,e){return!!((e==="v4"||!e)&&WJ.test(t)||(e==="v6"||!e)&&GJ.test(t))}let Ql=class fd extends Ct{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ue.string){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_type,expected:Ue.string,received:i.parsedType}),yt}const n=new Ur;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(r=this._getOrReturnCtx(e,r),s?Fe(r,{code:Oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Fe(r,{code:Oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")zJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"email",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Vv||(Vv=new RegExp(VJ,"u")),Vv.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"emoji",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")$J.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"uuid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")jJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"nanoid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")MJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"cuid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")LJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"cuid2",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")FJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"ulid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Fe(r,{validation:"url",code:Oe.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"regex",code:Oe.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?WN(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?KJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?JJ(i).test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?BJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"duration",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?XJ(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"ip",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?QJ(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"jwt",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?eX(e.data,i.version)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"cidr",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ZJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"base64",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?YJ.test(e.data)||(r=this._getOrReturnCtx(e,r),Fe(r,{validation:"base64url",code:Oe.invalid_string,message:i.message}),n.dirty()):Wt.assertNever(i);return{status:n.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Oe.invalid_string,...Xe.errToObj(r)})}_addCheck(e){return new fd({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Xe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Xe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Xe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Xe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Xe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Xe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Xe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Xe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Xe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Xe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Xe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Xe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Xe.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...Xe.errToObj(e==null?void 0: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==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Xe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Xe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Xe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Xe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Xe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Xe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Xe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Xe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Xe.errToObj(n)})}nonempty(e){return this.min(1,Xe.errToObj(e))}trim(){return new fd({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fd({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fd({...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}};Ql.create=t=>{var e;return new Ql({checks:[],typeName:ht.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Et(t)})};function tX(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}let xf=class b_ extends Ct{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)!==Ue.number){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_type,expected:Ue.number,received:i.parsedType}),yt}let n;const r=new Ur;for(const i of this._def.checks)i.kind==="int"?Wt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?tX(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.not_finite,message:i.message}),r.dirty()):Wt.assertNever(i);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Xe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Xe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Xe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Xe.toString(n))}setLimit(e,n,r,i){return new b_({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Xe.toString(i)}]})}_addCheck(e){return new b_({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Xe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Xe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Xe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Xe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Xe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Xe.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"&&Wt.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)}};xf.create=t=>new xf({checks:[],typeName:ht.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Et(t)});let Tf=class __ extends Ct{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)!==Ue.bigint)return this._getInvalidInput(e);let n;const r=new Ur;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):Wt.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.bigint,received:n.parsedType}),yt}gte(e,n){return this.setLimit("min",e,!0,Xe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Xe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Xe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Xe.toString(n))}setLimit(e,n,r,i){return new __({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Xe.toString(i)}]})}_addCheck(e){return new __({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Xe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Xe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Xe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Xe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Xe.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}};Tf.create=t=>{var e;return new Tf({checks:[],typeName:ht.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Et(t)})};let If=class extends Ct{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ue.boolean){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.boolean,received:n.parsedType}),yt}return Or(e.data)}};If.create=t=>new If({typeName:ht.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Et(t)});let Of=class qN extends Ct{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ue.date){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_type,expected:Ue.date,received:i.parsedType}),yt}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_date}),yt}const n=new Ur;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),Fe(r,{code:Oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Wt.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qN({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Xe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Xe.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}};Of.create=t=>new Of({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ht.ZodDate,...Et(t)});let Gm=class extends Ct{_parse(e){if(this._getType(e)!==Ue.symbol){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.symbol,received:n.parsedType}),yt}return Or(e.data)}};Gm.create=t=>new Gm({typeName:ht.ZodSymbol,...Et(t)});let Cf=class extends Ct{_parse(e){if(this._getType(e)!==Ue.undefined){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.undefined,received:n.parsedType}),yt}return Or(e.data)}};Cf.create=t=>new Cf({typeName:ht.ZodUndefined,...Et(t)});let Rf=class extends Ct{_parse(e){if(this._getType(e)!==Ue.null){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.null,received:n.parsedType}),yt}return Or(e.data)}};Rf.create=t=>new Rf({typeName:ht.ZodNull,...Et(t)});class eu extends Ct{constructor(){super(...arguments),this._any=!0}_parse(e){return Or(e.data)}}eu.create=t=>new eu({typeName:ht.ZodAny,...Et(t)});let Ja=class extends Ct{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Or(e.data)}};Ja.create=t=>new Ja({typeName:ht.ZodUnknown,...Et(t)});let lo=class extends Ct{_parse(e){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.never,received:n.parsedType}),yt}};lo.create=t=>new lo({typeName:ht.ZodNever,...Et(t)});let Zm=class extends Ct{_parse(e){if(this._getType(e)!==Ue.undefined){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.void,received:n.parsedType}),yt}return Or(e.data)}};Zm.create=t=>new Zm({typeName:ht.ZodVoid,...Et(t)});let yc=class Wh extends Ct{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ue.array)return Fe(n,{code:Oe.invalid_type,expected:Ue.array,received:n.parsedType}),yt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Fe(n,{code:o?Oe.too_big:Oe.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?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&&(Fe(n,{code:Oe.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&&(Fe(n,{code:Oe.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((o,a)=>i.type._parseAsync(new Cs(n,o,n.path,a)))).then(o=>Ur.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new Cs(n,o,n.path,a)));return Ur.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Wh({...this._def,minLength:{value:e,message:Xe.toString(n)}})}max(e,n){return new Wh({...this._def,maxLength:{value:e,message:Xe.toString(n)}})}length(e,n){return new Wh({...this._def,exactLength:{value:e,message:Xe.toString(n)}})}nonempty(e){return this.min(1,e)}};yc.create=(t,e)=>new yc({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ht.ZodArray,...Et(e)});function il(t){if(t instanceof vi){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ws.create(il(r))}return new vi({...t._def,shape:()=>e})}else return t instanceof yc?new yc({...t._def,type:il(t.element)}):t instanceof ws?ws.create(il(t.unwrap())):t instanceof aa?aa.create(il(t.unwrap())):t instanceof oa?oa.create(t.items.map(e=>il(e))):t}let vi=class Si extends Ct{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=Wt.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Ue.object){const c=this._getOrReturnCtx(e);return Fe(c,{code:Oe.invalid_type,expected:Ue.object,received:c.parsedType}),yt}const{status:n,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof lo&&this._def.unknownKeys==="strip"))for(const c in r.data)s.includes(c)||o.push(c);const a=[];for(const c of s){const l=i[c],u=r.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Cs(r,u,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof lo){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of o)a.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict")o.length>0&&(Fe(r,{code:Oe.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of o){const u=r.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Cs(r,u,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of a){const u=await l.key,d=await l.value;c.push({key:u,value:d,alwaysSet:l.alwaysSet})}return c}).then(c=>Ur.mergeObjectSync(n,c)):Ur.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Xe.errToObj,new Si({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Xe.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Si({...this._def,unknownKeys:"strip"})}passthrough(){return new Si({...this._def,unknownKeys:"passthrough"})}extend(e){return new Si({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Si({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ht.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Si({...this._def,catchall:e})}pick(e){const n={};return Wt.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Si({...this._def,shape:()=>n})}omit(e){const n={};return Wt.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Si({...this._def,shape:()=>n})}deepPartial(){return il(this)}partial(e){const n={};return Wt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new Si({...this._def,shape:()=>n})}required(e){const n={};return Wt.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ws;)i=i._def.innerType;n[r]=i}}),new Si({...this._def,shape:()=>n})}keyof(){return XN(Wt.objectKeys(this.shape))}};vi.create=(t,e)=>new vi({shape:()=>t,unknownKeys:"strip",catchall:lo.create(),typeName:ht.ZodObject,...Et(e)});vi.strictCreate=(t,e)=>new vi({shape:()=>t,unknownKeys:"strict",catchall:lo.create(),typeName:ht.ZodObject,...Et(e)});vi.lazycreate=(t,e)=>new vi({shape:t,unknownKeys:"strip",catchall:lo.create(),typeName:ht.ZodObject,...Et(e)});let Df=class extends Ct{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Ui(a.ctx.common.issues));return Fe(n,{code:Oe.invalid_union,unionErrors:o}),yt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];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"&&!s&&(s={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Ui(c));return Fe(n,{code:Oe.invalid_union,unionErrors:a}),yt}}get options(){return this._def.options}};Df.create=(t,e)=>new Df({options:t,typeName:ht.ZodUnion,...Et(e)});const Oo=t=>t instanceof Af?Oo(t.schema):t instanceof Gi?Oo(t.innerType()):t instanceof Nf?[t.value]:t instanceof gp?t.options:t instanceof Pf?Wt.objectValues(t.enum):t instanceof Mf?Oo(t._def.innerType):t instanceof Cf?[void 0]:t instanceof Rf?[null]:t instanceof ws?[void 0,...Oo(t.unwrap())]:t instanceof aa?[null,...Oo(t.unwrap())]:t instanceof lS||t instanceof Ff?Oo(t.unwrap()):t instanceof Lf?Oo(t._def.innerType):[];let GN=class ZN extends Ct{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ue.object)return Fe(n,{code:Oe.invalid_type,expected:Ue.object,received:n.parsedType}),yt;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Fe(n,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),yt)}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 s of n){const o=Oo(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new ZN({typeName:ht.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Et(r)})}};function w_(t,e){const n=Hs(t),r=Hs(e);if(t===e)return{valid:!0,data:t};if(n===Ue.object&&r===Ue.object){const i=Wt.objectKeys(e),s=Wt.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=w_(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===Ue.array&&r===Ue.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=w_(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Ue.date&&r===Ue.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}let kf=class extends Ct{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,o)=>{if(y_(s)||y_(o))return yt;const a=w_(s.value,o.value);return a.valid?((v_(s)||v_(o))&&n.dirty(),{status:n.value,value:a.data}):(Fe(r,{code:Oe.invalid_intersection_types}),yt)};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(([s,o])=>i(s,o)):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}))}};kf.create=(t,e,n)=>new kf({left:t,right:e,typeName:ht.ZodIntersection,...Et(n)});let oa=class YN extends Ct{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ue.array)return Fe(r,{code:Oe.invalid_type,expected:Ue.array,received:r.parsedType}),yt;if(r.data.length<this._def.items.length)return Fe(r,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),yt;!this._def.rest&&r.data.length>this._def.items.length&&(Fe(r,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Cs(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Ur.mergeArray(n,s)):Ur.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new YN({...this._def,rest:e})}};oa.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oa({items:t,typeName:ht.ZodTuple,rest:null,...Et(e)})};let KN=class E_ extends Ct{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!==Ue.object)return Fe(r,{code:Oe.invalid_type,expected:Ue.object,received:r.parsedType}),yt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new Cs(r,a,r.path,a)),value:o._parse(new Cs(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Ur.mergeObjectAsync(n,i):Ur.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ct?new E_({keyType:e,valueType:n,typeName:ht.ZodRecord,...Et(r)}):new E_({keyType:Ql.create(),valueType:e,typeName:ht.ZodRecord,...Et(n)})}},Ym=class extends Ct{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!==Ue.map)return Fe(r,{code:Oe.invalid_type,expected:Ue.map,received:r.parsedType}),yt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new Cs(r,a,r.path,[l,"key"])),value:s._parse(new Cs(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return yt;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return yt;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}};Ym.create=(t,e,n)=>new Ym({valueType:e,keyType:t,typeName:ht.ZodMap,...Et(n)});let Km=class S_ extends Ct{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ue.set)return Fe(r,{code:Oe.invalid_type,expected:Ue.set,received:r.parsedType}),yt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Fe(r,{code:Oe.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&&(Fe(r,{code:Oe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return yt;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>s._parse(new Cs(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new S_({...this._def,minSize:{value:e,message:Xe.toString(n)}})}max(e,n){return new S_({...this._def,maxSize:{value:e,message:Xe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Km.create=(t,e)=>new Km({valueType:t,minSize:null,maxSize:null,typeName:ht.ZodSet,...Et(e)});let JN=class qh extends Ct{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ue.function)return Fe(n,{code:Oe.invalid_type,expected:Ue.function,received:n.parsedType}),yt;function r(a,c){return Hm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Vm(),Xl].filter(l=>!!l),issueData:{code:Oe.invalid_arguments,argumentsError:c}})}function i(a,c){return Hm({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Vm(),Xl].filter(l=>!!l),issueData:{code:Oe.invalid_return_type,returnTypeError:c}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof tu){const a=this;return Or(async function(...c){const l=new Ui([]),u=await a._def.args.parseAsync(c,s).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{const a=this;return Or(function(...c){const l=a._def.args.safeParse(c,s);if(!l.success)throw new Ui([r(c,l.error)]);const u=Reflect.apply(o,this,l.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new Ui([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qh({...this._def,args:oa.create(e).rest(Ja.create())})}returns(e){return new qh({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new qh({args:e||oa.create([]).rest(Ja.create()),returns:n||Ja.create(),typeName:ht.ZodFunction,...Et(r)})}},Af=class extends Ct{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})}};Af.create=(t,e)=>new Af({getter:t,typeName:ht.ZodLazy,...Et(e)});let Nf=class extends Ct{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Fe(n,{received:n.data,code:Oe.invalid_literal,expected:this._def.value}),yt}return{status:"valid",value:e.data}}get value(){return this._def.value}};Nf.create=(t,e)=>new Nf({value:t,typeName:ht.ZodLiteral,...Et(e)});function XN(t,e){return new gp({values:t,typeName:ht.ZodEnum,...Et(e)})}let gp=class x_ extends Ct{constructor(){super(...arguments),ud.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Fe(n,{expected:Wt.joinValues(r),received:n.parsedType,code:Oe.invalid_type}),yt}if(qm(this,ud)||zN(this,ud,new Set(this._def.values)),!qm(this,ud).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Fe(n,{received:n.data,code:Oe.invalid_enum_value,options:r}),yt}return Or(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 x_.create(e,{...this._def,...n})}exclude(e,n=this._def){return x_.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};ud=new WeakMap;gp.create=XN;let Pf=class extends Ct{constructor(){super(...arguments),dd.set(this,void 0)}_parse(e){const n=Wt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ue.string&&r.parsedType!==Ue.number){const i=Wt.objectValues(n);return Fe(r,{expected:Wt.joinValues(i),received:r.parsedType,code:Oe.invalid_type}),yt}if(qm(this,dd)||zN(this,dd,new Set(Wt.getValidEnumValues(this._def.values))),!qm(this,dd).has(e.data)){const i=Wt.objectValues(n);return Fe(r,{received:r.data,code:Oe.invalid_enum_value,options:i}),yt}return Or(e.data)}get enum(){return this._def.values}};dd=new WeakMap;Pf.create=(t,e)=>new Pf({values:t,typeName:ht.ZodNativeEnum,...Et(e)});let tu=class extends Ct{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ue.promise&&n.common.async===!1)return Fe(n,{code:Oe.invalid_type,expected:Ue.promise,received:n.parsedType}),yt;const r=n.parsedType===Ue.promise?n.data:Promise.resolve(n.data);return Or(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};tu.create=(t,e)=>new tu({type:t,typeName:ht.ZodPromise,...Et(e)});let Gi=class extends Ct{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ht.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Fe(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return yt;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?yt:c.status==="dirty"||n.value==="dirty"?Wm(c.value):c});{if(n.value==="aborted")return yt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?yt:a.status==="dirty"||n.value==="dirty"?Wm(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?yt:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?yt:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!gc(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>gc(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);Wt.assertNever(i)}};Gi.create=(t,e,n)=>new Gi({schema:t,typeName:ht.ZodEffects,effect:e,...Et(n)});Gi.createWithPreprocess=(t,e,n)=>new Gi({schema:e,effect:{type:"preprocess",transform:t},typeName:ht.ZodEffects,...Et(n)});let ws=class extends Ct{_parse(e){return this._getType(e)===Ue.undefined?Or(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ws.create=(t,e)=>new ws({innerType:t,typeName:ht.ZodOptional,...Et(e)});let aa=class extends Ct{_parse(e){return this._getType(e)===Ue.null?Or(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};aa.create=(t,e)=>new aa({innerType:t,typeName:ht.ZodNullable,...Et(e)});let Mf=class extends Ct{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ue.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Mf.create=(t,e)=>new Mf({innerType:t,typeName:ht.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Et(e)});let Lf=class extends Ct{_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 Sf(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ui(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ui(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Lf.create=(t,e)=>new Lf({innerType:t,typeName:ht.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Et(e)});let Jm=class extends Ct{_parse(e){if(this._getType(e)!==Ue.nan){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:Ue.nan,received:n.parsedType}),yt}return{status:"valid",value:e.data}}};Jm.create=t=>new Jm({typeName:ht.ZodNaN,...Et(t)});const nX=Symbol("zod_brand");let lS=class extends Ct{_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}},uS=class QN extends Ct{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?yt:i.status==="dirty"?(n.dirty(),Wm(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?yt: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 QN({in:e,out:n,typeName:ht.ZodPipeline})}},Ff=class extends Ct{_parse(e){const n=this._def.innerType._parse(e),r=i=>(gc(i)&&(i.value=Object.freeze(i.value)),i);return Sf(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Ff.create=(t,e)=>new Ff({innerType:t,typeName:ht.ZodReadonly,...Et(e)});function eP(t,e={},n){return t?eu.create().superRefine((r,i)=>{var s,o;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):eu.create()}const rX={object:vi.lazycreate};var ht;(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"})(ht||(ht={}));const iX=(t,e={message:`Input not instance of ${t.name}`})=>eP(n=>n instanceof t,e),tP=Ql.create,nP=xf.create,sX=Jm.create,oX=Tf.create,rP=If.create,aX=Of.create,cX=Gm.create,lX=Cf.create,uX=Rf.create,dX=eu.create,fX=Ja.create,pX=lo.create,hX=Zm.create,mX=yc.create,gX=vi.create,yX=vi.strictCreate,vX=Df.create,bX=GN.create,_X=kf.create,wX=oa.create,EX=KN.create,SX=Ym.create,xX=Km.create,TX=JN.create,IX=Af.create,OX=Nf.create,CX=gp.create,RX=Pf.create,DX=tu.create,sI=Gi.create,kX=ws.create,AX=aa.create,NX=Gi.createWithPreprocess,PX=uS.create,MX=()=>tP().optional(),LX=()=>nP().optional(),FX=()=>rP().optional(),$X={string:t=>Ql.create({...t,coerce:!0}),number:t=>xf.create({...t,coerce:!0}),boolean:t=>If.create({...t,coerce:!0}),bigint:t=>Tf.create({...t,coerce:!0}),date:t=>Of.create({...t,coerce:!0})},jX=yt;var ve=Object.freeze({__proto__:null,defaultErrorMap:Xl,setErrorMap:NJ,getErrorMap:Vm,makeIssue:Hm,EMPTY_PATH:PJ,addIssueToContext:Fe,ParseStatus:Ur,INVALID:yt,DIRTY:Wm,OK:Or,isAborted:y_,isDirty:v_,isValid:gc,isAsync:Sf,get util(){return Wt},get objectUtil(){return g_},ZodParsedType:Ue,getParsedType:Hs,ZodType:Ct,datetimeRegex:WN,ZodString:Ql,ZodNumber:xf,ZodBigInt:Tf,ZodBoolean:If,ZodDate:Of,ZodSymbol:Gm,ZodUndefined:Cf,ZodNull:Rf,ZodAny:eu,ZodUnknown:Ja,ZodNever:lo,ZodVoid:Zm,ZodArray:yc,ZodObject:vi,ZodUnion:Df,ZodDiscriminatedUnion:GN,ZodIntersection:kf,ZodTuple:oa,ZodRecord:KN,ZodMap:Ym,ZodSet:Km,ZodFunction:JN,ZodLazy:Af,ZodLiteral:Nf,ZodEnum:gp,ZodNativeEnum:Pf,ZodPromise:tu,ZodEffects:Gi,ZodTransformer:Gi,ZodOptional:ws,ZodNullable:aa,ZodDefault:Mf,ZodCatch:Lf,ZodNaN:Jm,BRAND:nX,ZodBranded:lS,ZodPipeline:uS,ZodReadonly:Ff,custom:eP,Schema:Ct,ZodSchema:Ct,late:rX,get ZodFirstPartyTypeKind(){return ht},coerce:$X,any:dX,array:mX,bigint:oX,boolean:rP,date:aX,discriminatedUnion:bX,effect:sI,enum:CX,function:TX,instanceof:iX,intersection:_X,lazy:IX,literal:OX,map:SX,nan:sX,nativeEnum:RX,never:pX,null:uX,nullable:AX,number:nP,object:gX,oboolean:FX,onumber:LX,optional:kX,ostring:MX,pipeline:PX,preprocess:NX,promise:DX,record:EX,set:xX,strictObject:yX,string:tP,symbol:cX,transformer:sI,tuple:wX,undefined:lX,union:vX,unknown:fX,void:hX,NEVER:jX,ZodIssueCode:Oe,quotelessJson:AJ,ZodError:Ui});const UX=t=>t!=null;ve.any().refine(t=>UX(t));function iP(){return ve.object({end:ve.string()})}function sP(){return ve.object({id:ve.string()})}function oP(){return ve.object({ownerId:ve.string()})}function aP(){return ve.object({ownerType:ve.string()})}function cP(){return ve.object({period:ve.string()})}function lP(){return ve.object({start:ve.string()})}const Zc={setIdOperation(t,e){t.id=e.input.id},setOwnerIdOperation(t,e){t.ownerId=e.input.ownerId},setOwnerTypeOperation(t,e){t.ownerType=e.input.ownerType},setPeriodOperation(t,e){t.period=e.input.period},setStartOperation(t,e){t.start=e.input.start},setEndOperation(t,e){t.end=e.input.end}},BX=(t,e,n)=>{if(Gt.isBaseAction(e))return t;switch(e.type){case"SET_ID":sP().parse(e.input),Zc.setIdOperation(t[e.scope],e,n);break;case"SET_OWNER_ID":oP().parse(e.input),Zc.setOwnerIdOperation(t[e.scope],e,n);break;case"SET_OWNER_TYPE":aP().parse(e.input),Zc.setOwnerTypeOperation(t[e.scope],e,n);break;case"SET_PERIOD":cP().parse(e.input),Zc.setPeriodOperation(t[e.scope],e,n);break;case"SET_START":lP().parse(e.input),Zc.setStartOperation(t[e.scope],e,n);break;case"SET_END":iP().parse(e.input),Zc.setEndOperation(t[e.scope],e,n);break;default:return t}},T_=Gt.createReducer(BX),zX={id:"",ownerId:"",ownerType:"",period:"",start:"",end:"",actualsComparison:[],snapshotAccount:[]},VX={},Sd={fileExtension:"phas",createState(t){return{global:{...zX,...t==null?void 0:t.global},local:{...VX,...t==null?void 0:t.local}}},createExtendedState(t){return Gt.createExtendedState({...t,documentType:"powerhouse/account-snapshot"},Sd.createState)},createDocument(t){return Gt.createDocument(Sd.createExtendedState(t),Sd.createState)},saveToFile(t,e,n){return Gt.saveToFile(t,e,"phas",n)},saveToFileHandle(t,e){return Gt.saveToFileHandle(t,e)},loadFromFile(t){return Gt.loadFromFile(t,T_)},loadFromInput(t){return Gt.loadFromInput(t,T_)}},{createAction:xu}=Gt,uP=t=>xu("SET_ID",{...t},void 0,sP,"global"),dP=t=>xu("SET_OWNER_ID",{...t},void 0,oP,"global"),fP=t=>xu("SET_OWNER_TYPE",{...t},void 0,aP,"global"),pP=t=>xu("SET_PERIOD",{...t},void 0,cP,"global"),hP=t=>xu("SET_START",{...t},void 0,lP,"global"),mP=t=>xu("SET_END",{...t},void 0,iP,"global");class HX extends ii{setId(e){return this.dispatch(uP(e))}setOwnerId(e){return this.dispatch(dP(e))}setOwnerType(e){return this.dispatch(fP(e))}setPeriod(e){return this.dispatch(pP(e))}setStart(e){return this.dispatch(hP(e))}setEnd(e){return this.dispatch(mP(e))}}const gP=class yP extends ii{constructor(e,n){super(T_,Sd.createDocument(e),n)}saveToFile(e,n){return super.saveToFile(e,yP.fileExtension,n)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const n=new this;return await n.loadFromFile(e),n}};kJ(gP,"fileExtension","phas");let WX=gP;GE(WX,[HX]);const qX=Object.freeze(Object.defineProperty({__proto__:null,setEnd:mP,setId:uP,setOwnerId:dP,setOwnerType:fP,setPeriod:pP,setStart:hP},Symbol.toStringTag,{value:"Module"})),GX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));({...Sd,...GX});({...qE,...qX});var ZX=Object.defineProperty,YX=(t,e,n)=>e in t?ZX(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,KX=(t,e,n)=>YX(t,e+"",n);const hy={id:"powerhouse/document-drive",name:"DocumentDrive",extension:"phdd",description:"",author:{name:"Powerhouse Inc",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],state:{global:{schema:`type FolderNode {
207
+ id: String!
208
+ name: String!
209
+ kind: String!
210
+ parentFolder: String
211
+ }
212
+
213
+ type SynchronizationUnit {
214
+ syncId: ID!
215
+ scope: String!
216
+ branch: String!
217
+ }
218
+
219
+ type FileNode {
220
+ id: String!
221
+ name: String!
222
+ kind: String!
223
+ documentType: String!
224
+ parentFolder: String
225
+ synchronizationUnits: [SynchronizationUnit!]!
226
+ }
227
+
228
+ union Node = FolderNode | FileNode
229
+
230
+ type DocumentDriveState {
231
+ id: ID!
232
+ name: String!
233
+ nodes: [Node!]!
234
+ icon: String
235
+ slug: String
236
+ }`,initialValue:'"{\\"id\\":\\"\\",\\"name\\":\\"\\",\\"nodes\\":[],\\"icon\\":null,\\"slug\\":null}"',examples:[]},local:{schema:`type ListenerFilter {
237
+ documentType: [String!]!
238
+ documentId: [ID!]
239
+ scope: [String!]
240
+ branch: [String!]
241
+ }
242
+
243
+ enum TransmitterType {
244
+ Internal,
245
+ SwitchboardPush,
246
+ PullResponder,
247
+ SecureConnect,
248
+ MatrixConnect,
249
+ RESTWebhook
250
+ }
251
+
252
+ type ListenerCallInfo {
253
+ transmitterType: TransmitterType
254
+ name: String
255
+ data: String
256
+ }
257
+
258
+ type Listener {
259
+ listenerId: ID!
260
+ label: String
261
+ block: Boolean!
262
+ system: Boolean!
263
+ filter: ListenerFilter!
264
+ callInfo: ListenerCallInfo
265
+ }
266
+
267
+ enum TriggerType {
268
+ PullResponder
269
+ }
270
+
271
+ type PullResponderTriggerData {
272
+ listenerId: ID!
273
+ url: String!
274
+ interval: String!
275
+ }
276
+
277
+ union TriggerData = PullResponderTriggerData
278
+
279
+ type Trigger {
280
+ id: ID!
281
+ type: TriggerType!
282
+ data: TriggerData
283
+ }
284
+
285
+ type DocumentDriveLocalState{
286
+ sharingType: String
287
+ listeners: [Listener!]!
288
+ triggers: [Trigger!]!
289
+ availableOffline: Boolean!
290
+ }`,initialValue:'"{ \\"listeners\\": [], \\"triggers\\": [], \\"sharingType\\": \\"private\\", \\"availableOffline\\": false}"',examples:[]}},modules:[{id:"GRzuvv78tBvmB6ciitokLfonNHA=",name:"Node",description:"",operations:[{id:"7xiTdxonc9yEASR8sfV/KnbSV10=",name:"ADD_FILE",description:"",schema:`input AddFileInput {
291
+ id: ID!
292
+ name: String!
293
+ documentType: String!
294
+ parentFolder: ID
295
+ synchronizationUnits: [SynchronizationUnit!]!
296
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"4lzNMMKKdIAtEU6i12xLgi9hp+U=",name:"ADD_FOLDER",description:"",schema:`input AddFolderInput {
297
+ id: ID!
298
+ name: String!
299
+ parentFolder: ID
300
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"53jH2/3TWTTcgCJiv2C+BmuC6i0=",name:"DELETE_NODE",description:"",schema:`input DeleteNodeInput {
301
+ id: ID!
302
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"pNn+Y1/HVq/GNMk7t0u3g3gtMLE=",name:"UPDATE_FILE",description:"",schema:`input UpdateFileInput {
303
+ id: ID!
304
+ parentFolder: ID
305
+ name: String
306
+ documentType: String
307
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"P0x1M8Mnt+Q/+9nggkwgVbfybsc=",name:"UPDATE_NODE",description:"",schema:`input UpdateNodeInput {
308
+ id: ID!
309
+ parentFolder: ID
310
+ name: String
311
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"vnQ7OB5b3wGLgjhbgJqAIpA+JLE=",name:"COPY_NODE",description:"",schema:`input CopyNodeInput {
312
+ srcId: ID!
313
+ targetId: ID!
314
+ targetName: String
315
+ targetParentFolder: ID
316
+ synchronizationUnits: [SynchronizationUnit!]
317
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"VNyiD/sNGzk6k9A1Qe7s8dmrJxA=",name:"MOVE_NODE",description:"",schema:`input MoveNodeInput {
318
+ srcFolder: ID!
319
+ targetParentFolder: ID
320
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"}]},{id:"0dHwHlxOM9x0vMZ+gLnKxf2qTEo=",name:"Drive",description:"",operations:[{id:"qGCiPGpTt/cyz3HzyrBn92z1dsU=",name:"SET_DRIVE_NAME",description:"",schema:`input SetDriveNameInput {
321
+ name: String!
322
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"qGCiPGpTt/cyz3HzyrBn92z30dsU=",name:"SET_DRIVE_ICON",description:"",schema:`input SetDriveIconInput {
323
+ icon: String!
324
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"global"},{id:"qGCiPGpTt/cyz3HzyrBn92z2dsU=",name:"SET_SHARING_TYPE",description:"",schema:`input SetSharingTypeInput {
325
+ type: String!
326
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z3dsU=",name:"SET_AVAILABLE_OFFLINE",description:"",schema:`input SetAvailableOfflineInput {
327
+ availableOffline: Boolean!
328
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z9dsU=",name:"ADD_LISTENER",description:"",schema:`input AddListenerInput {
329
+ listener: Listener!
330
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z10dsU=",name:"REMOVE_LISTENER",description:"",schema:`input RemoveListenerInput {
331
+ listenerId: String!
332
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z20dsU=",name:"ADD_TRIGGER",description:"",schema:`input AddTriggerInput {
333
+ trigger: Trigger!
334
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"local"},{id:"qGCiPGpTt/cyz3HzyrBn92z30dsU=",name:"REMOVE_TRIGGER",description:"",schema:`input RemoveTriggerInput {
335
+ triggerId: String!
336
+ }`,template:"",reducer:"",errors:[],examples:[],scope:"local"}]}]}]},vP=t=>t!=null,JX=ve.any().refine(t=>vP(t)),bP=ve.enum(["Internal","MatrixConnect","PullResponder","RESTWebhook","SecureConnect","SwitchboardPush"]),_P=ve.enum(["PullResponder"]);function dS(){return ve.object({document:ve.unknown().nullish(),documentType:ve.string(),id:ve.string(),name:ve.string(),parentFolder:ve.string().nullish(),synchronizationUnits:ve.array(my())})}function fS(){return ve.object({id:ve.string(),name:ve.string(),parentFolder:ve.string().nullish()})}function pS(){return ve.object({listener:yS()})}function hS(){return ve.object({trigger:TS()})}function mS(){return ve.object({srcId:ve.string(),synchronizationUnits:ve.array(my()).nullish(),targetId:ve.string(),targetName:ve.string().nullish(),targetParentFolder:ve.string().nullish()})}function gS(){return ve.object({id:ve.string()})}function XX(){return ve.object({__typename:ve.literal("DocumentDriveLocalState").optional(),availableOffline:ve.boolean(),listeners:ve.array(yS()),sharingType:ve.string().nullable(),triggers:ve.array(TS())})}function QX(){return ve.object({__typename:ve.literal("DocumentDriveState").optional(),icon:ve.string().nullable(),id:ve.string(),name:ve.string(),nodes:ve.array(TP()),slug:ve.string().nullable()})}function wP(){return ve.object({__typename:ve.literal("FileNode").optional(),documentType:ve.string(),id:ve.string(),kind:ve.string(),name:ve.string(),parentFolder:ve.string().nullable(),synchronizationUnits:ve.array(my())})}function EP(){return ve.object({__typename:ve.literal("FolderNode").optional(),id:ve.string(),kind:ve.string(),name:ve.string(),parentFolder:ve.string().nullable()})}function yS(){return ve.object({__typename:ve.literal("Listener").optional(),block:ve.boolean(),callInfo:SP().nullable(),filter:xP(),label:ve.string().nullable(),listenerId:ve.string(),system:ve.boolean()})}function SP(){return ve.object({__typename:ve.literal("ListenerCallInfo").optional(),data:ve.string().nullable(),name:ve.string().nullable(),transmitterType:bP.nullable()})}function xP(){return ve.object({__typename:ve.literal("ListenerFilter").optional(),branch:ve.array(ve.string()).nullable(),documentId:ve.array(ve.string()).nullable(),documentType:ve.array(ve.string()),scope:ve.array(ve.string()).nullable()})}function vS(){return ve.object({srcFolder:ve.string(),targetParentFolder:ve.string().nullish()})}function TP(){return ve.union([wP(),EP()])}function IP(){return ve.object({__typename:ve.literal("PullResponderTriggerData").optional(),interval:ve.string(),listenerId:ve.string(),url:ve.string()})}function bS(){return ve.object({listenerId:ve.string()})}function _S(){return ve.object({triggerId:ve.string()})}function wS(){return ve.object({availableOffline:ve.boolean()})}function ES(){return ve.object({icon:ve.string()})}function SS(){return ve.object({name:ve.string()})}function xS(){return ve.object({type:ve.string()})}function my(){return ve.object({__typename:ve.literal("SynchronizationUnit").optional(),branch:ve.string(),scope:ve.string(),syncId:ve.string()})}function TS(){return ve.object({__typename:ve.literal("Trigger").optional(),data:OP().nullable(),id:ve.string(),type:_P})}function OP(){return IP()}function IS(){return ve.object({documentType:ve.string().nullish(),id:ve.string(),name:ve.string().nullish(),parentFolder:ve.string().nullish()})}function OS(){return ve.object({id:ve.string(),name:ve.string().nullish(),parentFolder:ve.string().nullish()})}const eQ=Object.freeze(Object.defineProperty({__proto__:null,AddFileInputSchema:dS,AddFolderInputSchema:fS,AddListenerInputSchema:pS,AddTriggerInputSchema:hS,CopyNodeInputSchema:mS,DeleteNodeInputSchema:gS,DocumentDriveLocalStateSchema:XX,DocumentDriveStateSchema:QX,FileNodeSchema:wP,FolderNodeSchema:EP,ListenerCallInfoSchema:SP,ListenerFilterSchema:xP,ListenerSchema:yS,MoveNodeInputSchema:vS,NodeSchema:TP,PullResponderTriggerDataSchema:IP,RemoveListenerInputSchema:bS,RemoveTriggerInputSchema:_S,SetAvailableOfflineInputSchema:wS,SetDriveIconInputSchema:ES,SetDriveNameInputSchema:SS,SetSharingTypeInputSchema:xS,SynchronizationUnitSchema:my,TransmitterTypeSchema:bP,TriggerDataSchema:OP,TriggerSchema:TS,TriggerTypeSchema:_P,UpdateFileInputSchema:IS,UpdateNodeInputSchema:OS,definedNonNullAnySchema:JX,isDefinedNonNullAny:vP},Symbol.toStringTag,{value:"Module"})),Ia={addFileOperation(t,e,n){if(t.nodes.find(a=>a.id===e.input.id))throw new Error(`Node with id ${e.input.id} already exists!`);const r=Ro({nodes:t.nodes,srcName:e.input.name,targetParentFolder:e.input.parentFolder||null}),i=e.input.synchronizationUnits,s=i.find(a=>!!t.nodes.find(c=>Lr(c)&&c.synchronizationUnits.find(l=>l.syncId===a.syncId)));if(s)throw new Error(`A synchronization unit with Id ${s.syncId} already exists`);const o={id:e.input.id,name:r,kind:"file",parentFolder:e.input.parentFolder??null,synchronizationUnits:i,documentType:e.input.documentType};t.nodes.push(o),n==null||n({type:"CREATE_CHILD_DOCUMENT",input:{id:e.input.id,documentType:e.input.documentType,synchronizationUnits:i,document:e.input.document}})},addFolderOperation(t,e){if(t.nodes.find(r=>r.id===e.input.id))throw new Error(`Node with id ${e.input.id} already exists!`);const n=Ro({nodes:t.nodes,srcName:e.input.name,targetParentFolder:e.input.parentFolder||null});t.nodes.push({...e.input,name:n,kind:"folder",parentFolder:e.input.parentFolder??null})},deleteNodeOperation(t,e,n){const r=t.nodes.find(s=>s.id===e.input.id);if(!r)throw new Error(`Node with id ${e.input.id} not found`);const i=nu(r,t.nodes);t.nodes=t.nodes.filter(s=>s.id!==e.input.id&&!i.find(o=>o.id===s.id)),[r,...i].filter(s=>Lr(s)).forEach(s=>{n==null||n({type:"DELETE_CHILD_DOCUMENT",input:{id:s.id}})})},updateFileOperation(t,e){t.nodes=t.nodes.map(n=>n.id===e.input.id?{...n,name:Ro({nodes:t.nodes,srcName:e.input.name??n.name,targetParentFolder:e.input.parentFolder||null}),documentType:e.input.documentType??n.documentType}:n)},updateNodeOperation(t,e){t.nodes=t.nodes.map(n=>n.id===e.input.id?{...n,name:Ro({nodes:t.nodes,srcName:e.input.name??n.name,targetParentFolder:e.input.parentFolder||null}),parentFolder:e.input.parentFolder===null?null:n.parentFolder}:n)},copyNodeOperation(t,e,n){const r=t.nodes.find(a=>a.id===e.input.srcId);if(!r)throw new Error(`Node with id ${e.input.srcId} not found`);if(t.nodes.find(a=>a.id===e.input.targetId))throw new Error(`Node with id ${e.input.targetId} already exists`);const i=Ro({nodes:t.nodes,srcName:e.input.targetName||r.name,targetParentFolder:e.input.targetParentFolder||null}),s={...r,name:i,id:e.input.targetId,parentFolder:e.input.targetParentFolder||null},o=Lr(s);if(o){const a=e.input.synchronizationUnits;if(!e.input.synchronizationUnits)throw new Error("Synchronization units were not provided");const c=a.find(l=>!!t.nodes.find(u=>Lr(u)&&u.synchronizationUnits.find(d=>d.syncId===l.syncId)));if(c)throw new Error(`A synchronization unit with Id ${c.syncId} already exists`);s.synchronizationUnits=a}t.nodes.push(s),o&&(n==null||n({type:"COPY_CHILD_DOCUMENT",input:{id:e.input.srcId,newId:e.input.targetId,synchronizationUnits:s.synchronizationUnits}}))},moveNodeOperation(t,e){if(e.input.srcFolder===e.input.targetParentFolder)throw new Error("Circular Reference Error: Attempting to move a node to its current parent folder");const n=t.nodes.find(i=>i.id===e.input.srcFolder);if(!n)throw new Error(`Node with id ${e.input.srcFolder} not found`);const r=Ro({nodes:t.nodes,srcName:n.name,targetParentFolder:e.input.targetParentFolder||null});if(gy(n)&&nu(n,t.nodes).find(i=>i.id===e.input.targetParentFolder))throw new Error("Circular Reference Error: Cannot move a folder to one of its descendants");t.nodes=t.nodes.map(i=>i.id===e.input.srcFolder?{...i,name:r,parentFolder:e.input.targetParentFolder||null}:i)}},xo={setDriveNameOperation(t,e,n){t.name=e.input.name},setDriveIconOperation(t,e,n){t.icon=e.input.icon},setSharingTypeOperation(t,e,n){t.sharingType=e.input.type},setAvailableOfflineOperation(t,e,n){t.availableOffline=e.input.availableOffline},addListenerOperation(t,e,n){if(t.listeners.find(r=>r.listenerId===e.input.listener.listenerId))throw new Error(`A listener with Id: ${e.input.listener.listenerId} already exists`);t.listeners.push(e.input.listener)},removeListenerOperation(t,e,n){t.listeners=t.listeners.filter(r=>r.listenerId!==e.input.listenerId)},addTriggerOperation(t,e,n){if(t.triggers.find(r=>r.id===e.input.trigger.id))throw new Error(`A trigger with Id: ${e.input.trigger.id} already exists`);t.triggers.push(e.input.trigger)},removeTriggerOperation(t,e,n){t.triggers=t.triggers.filter(r=>r.id!==e.input.triggerId)}},tQ=(t,e,n)=>{if(Gt.isBaseAction(e))return t;switch(e.type){case"ADD_FILE":dS().parse(e.input),Ia.addFileOperation(t[e.scope],e,n);break;case"ADD_FOLDER":fS().parse(e.input),Ia.addFolderOperation(t[e.scope],e,n);break;case"DELETE_NODE":gS().parse(e.input),Ia.deleteNodeOperation(t[e.scope],e,n);break;case"UPDATE_FILE":IS().parse(e.input),Ia.updateFileOperation(t[e.scope],e,n);break;case"UPDATE_NODE":OS().parse(e.input),Ia.updateNodeOperation(t[e.scope],e,n);break;case"COPY_NODE":mS().parse(e.input),Ia.copyNodeOperation(t[e.scope],e,n);break;case"MOVE_NODE":vS().parse(e.input),Ia.moveNodeOperation(t[e.scope],e,n);break;case"SET_DRIVE_NAME":SS().parse(e.input),xo.setDriveNameOperation(t[e.scope],e,n);break;case"SET_DRIVE_ICON":ES().parse(e.input),xo.setDriveIconOperation(t[e.scope],e,n);break;case"SET_SHARING_TYPE":xS().parse(e.input),xo.setSharingTypeOperation(t[e.scope],e,n);break;case"SET_AVAILABLE_OFFLINE":wS().parse(e.input),xo.setAvailableOfflineOperation(t[e.scope],e,n);break;case"ADD_LISTENER":pS().parse(e.input),xo.addListenerOperation(t[e.scope],e,n);break;case"REMOVE_LISTENER":bS().parse(e.input),xo.removeListenerOperation(t[e.scope],e,n);break;case"ADD_TRIGGER":hS().parse(e.input),xo.addTriggerOperation(t[e.scope],e,n);break;case"REMOVE_TRIGGER":_S().parse(e.input),xo.removeTriggerOperation(t[e.scope],e,n);break;default:return t}},vc=Gt.createReducer(tQ),nQ={id:"",name:"",nodes:[],icon:null,slug:null},rQ={listeners:[],triggers:[],sharingType:"private",availableOffline:!1},xd={fileExtension:"phdd",createState(t){return{global:{...nQ,...t==null?void 0:t.global},local:{...rQ,...t==null?void 0:t.local}}},createExtendedState(t){return Gt.createExtendedState({...t,documentType:"powerhouse/document-drive"},xd.createState)},createDocument(t){return Gt.createDocument(xd.createExtendedState(t),xd.createState)},saveToFile(t,e,n){return Gt.saveToFile(t,e,"phdd",n)},saveToFileHandle(t,e){return Gt.saveToFileHandle(t,e)},loadFromFile(t){return Gt.loadFromFile(t,vc)},loadFromInput(t){return Gt.loadFromInput(t,vc)}},{createAction:Ac}=Gt,CS=t=>Ac("ADD_FILE",{...t},void 0,dS,"global"),CP=t=>Ac("ADD_FOLDER",{...t},void 0,fS,"global"),RP=t=>Ac("DELETE_NODE",{...t},void 0,gS,"global"),DP=t=>Ac("UPDATE_FILE",{...t},void 0,IS,"global"),kP=t=>Ac("UPDATE_NODE",{...t},void 0,OS,"global"),RS=t=>Ac("COPY_NODE",{...t},void 0,mS,"global"),AP=t=>Ac("MOVE_NODE",{...t},void 0,vS,"global");class iQ extends ii{addFile(e){return this.dispatch(CS(e))}addFolder(e){return this.dispatch(CP(e))}deleteNode(e){return this.dispatch(RP(e))}updateFile(e){return this.dispatch(DP(e))}updateNode(e){return this.dispatch(kP(e))}copyNode(e){return this.dispatch(RS(e))}moveNode(e){return this.dispatch(AP(e))}}const{createAction:ya}=Gt,NP=t=>ya("SET_DRIVE_NAME",{...t},void 0,SS,"global"),PP=t=>ya("SET_DRIVE_ICON",{...t},void 0,ES,"global"),MP=t=>ya("SET_SHARING_TYPE",{...t},void 0,xS,"local"),LP=t=>ya("SET_AVAILABLE_OFFLINE",{...t},void 0,wS,"local"),FP=t=>ya("ADD_LISTENER",{...t},void 0,pS,"local"),$P=t=>ya("REMOVE_LISTENER",{...t},void 0,bS,"local"),jP=t=>ya("ADD_TRIGGER",{...t},void 0,hS,"local"),UP=t=>ya("REMOVE_TRIGGER",{...t},void 0,_S,"local");class sQ extends ii{setDriveName(e){return this.dispatch(NP(e))}setDriveIcon(e){return this.dispatch(PP(e))}setSharingType(e){return this.dispatch(MP(e))}setAvailableOffline(e){return this.dispatch(LP(e))}addListener(e){return this.dispatch(FP(e))}removeListener(e){return this.dispatch($P(e))}addTrigger(e){return this.dispatch(jP(e))}removeTrigger(e){return this.dispatch(UP(e))}}const BP=class zP extends ii{constructor(e,n){super(vc,xd.createDocument(e),n)}saveToFile(e,n){return super.saveToFile(e,zP.fileExtension,n)}loadFromFile(e){return super.loadFromFile(e)}static async fromFile(e){const n=new this;return await n.loadFromFile(e),n}};KX(BP,"fileExtension","phdd");let DS=BP;GE(DS,[iQ,sQ]);const oQ=Object.freeze(Object.defineProperty({__proto__:null,addFile:CS,addFolder:CP,addListener:FP,addTrigger:jP,copyNode:RS,deleteNode:RP,moveNode:AP,removeListener:$P,removeTrigger:UP,setAvailableOffline:LP,setDriveIcon:PP,setDriveName:NP,setSharingType:MP,updateFile:DP,updateNode:kP},Symbol.toStringTag,{value:"Module"}));var er=[];for(var Hv=0;Hv<256;++Hv)er.push((Hv+256).toString(16).slice(1));function aQ(t,e=0){return(er[t[e+0]]+er[t[e+1]]+er[t[e+2]]+er[t[e+3]]+"-"+er[t[e+4]]+er[t[e+5]]+"-"+er[t[e+6]]+er[t[e+7]]+"-"+er[t[e+8]]+er[t[e+9]]+"-"+er[t[e+10]]+er[t[e+11]]+er[t[e+12]]+er[t[e+13]]+er[t[e+14]]+er[t[e+15]]).toLowerCase()}var uh,cQ=new Uint8Array(16);function lQ(){if(!uh&&(uh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!uh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return uh(cQ)}var uQ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const oI={randomUUID:uQ};function dQ(t,e,n){if(oI.randomUUID&&!t)return oI.randomUUID();t=t||{};var r=t.random||(t.rng||lQ)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,aQ(r)}function Lr(t){return t.kind==="file"}function gy(t){return t.kind==="folder"}function kS(t,e){if(t.parentFolder){const n=e.find(r=>r.id===t.parentFolder);if(!n)throw new Error(`Parent node with id ${t.parentFolder} not found`);return[n,...kS(n,e)]}else return[]}function nu(t,e){const n=e.filter(i=>i.parentFolder===t.id),r=n.map(i=>nu(i,e));return[...n,...r.flat()]}function VP(t,e,n){const r=n.find(a=>a.id===t.srcId);if(!r)throw new Error(`Node with id ${t.srcId} not found`);const i=[{...r,name:t.targetName||r.name,parentFolder:t.targetParentFolder||null},...nu(r,n)],s={};t.targetParentFolder&&(s[t.targetParentFolder]=t.targetParentFolder);const o=a=>{let c=s[a];if(!c){const l=a;c=e(a),s[l]=c}return c};return i.map(a=>({srcId:a.id,targetId:o(a.id),targetName:a.name,targetParentFolder:a.parentFolder?o(a.parentFolder):null,synchronizationUnits:Lr(a)?a.synchronizationUnits.map(c=>({...c,syncId:yp(n)})):void 0}))}function yp(t){let e="";for(;!e||t.find(n=>Lr(n)&&n.synchronizationUnits.find(r=>r.syncId===e));)e=dQ();return e}function AS(t,e,n="main"){return e.map(r=>({scope:r,branch:n,syncId:yp(t.nodes)}))}function NS(t,e,n){return CS({...e,synchronizationUnits:AS(t,n)})}function HP(t,e){const n=t.nodes.find(i=>i.id===e.srcId);if(!n)throw new Error(`Node with id ${e.srcId} not found`);let r;return Lr(n)&&(r=n.synchronizationUnits.map(i=>({...i,syncId:yp(t.nodes)}))),RS({...e,synchronizationUnits:r})}function PS(t,e){let n=0;const r=new RegExp(`^${MS(e)} \\(copy\\)(?: (\\d+))?$`);for(const i of t){const s=i.match(r);if(s){const o=s[1]?parseInt(s[1],10):1;o>n&&(n=o)}}return n+1}function MS(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ro(t){const{nodes:e,targetParentFolder:n,srcName:r}=t,i=e.filter(s=>n===""?s.parentFolder===null:s.parentFolder===n).map(s=>s.name);return i.includes(r)?`${r} (copy) ${PS(i,r)}`:r}const fQ=Object.freeze(Object.defineProperty({__proto__:null,escapeRegExp:MS,generateAddNodeAction:NS,generateCopyNodeAction:HP,generateNodesCopy:VP,generateSynchronizationUnitId:yp,generateSynchronizationUnits:AS,getAncestors:kS,getDescendants:nu,getNextCopyNumber:PS,handleTargetNameCollisions:Ro,isFileNode:Lr,isFolderNode:gy},Symbol.toStringTag,{value:"Module"})),WP=DS,$f={...xd,...fQ},rr={...qE,...oQ},qP={Document:WP,reducer:vc,actions:rr,utils:$f,documentModel:hy},pQ=Object.freeze(Object.defineProperty({__proto__:null,Document:WP,DocumentDrive:DS,actions:rr,documentModel:hy,escapeRegExp:MS,generateAddNodeAction:NS,generateCopyNodeAction:HP,generateNodesCopy:VP,generateSynchronizationUnitId:yp,generateSynchronizationUnits:AS,getAncestors:kS,getDescendants:nu,getNextCopyNumber:PS,handleTargetNameCollisions:Ro,isFileNode:Lr,isFolderNode:gy,module:qP,reducer:vc,utils:$f,z:eQ},Symbol.toStringTag,{value:"Module"}));let GP=()=>({emit(t,...e){for(let n=this.events[t]||[],r=0,i=n.length;r<i;r++)n[r](...e)},events:{},on(t,e){var n;return((n=this.events)[t]||(n[t]=[])).push(e),()=>{var r;this.events[t]=(r=this.events[t])==null?void 0:r.filter(i=>e!==i)}}});class ZP{constructor(){Ke(this,"cache",new Map)}async setDocument(e,n,r){var a;const i=r.operations.global.map(c=>(delete c.resultingState,c)),s=r.operations.local.map(c=>(delete c.resultingState,c)),o={...r,operations:{global:i,local:s}};return this.cache.has(e)||this.cache.set(e,new Map),(a=this.cache.get(e))==null||a.set(n,o),!0}async deleteDocument(e,n){var r;return((r=this.cache.get(e))==null?void 0:r.delete(n))??!1}async getDocument(e,n){var r;return(r=this.cache.get(e))==null?void 0:r.get(n)}}class hQ extends Error{constructor(e,n){super(`Document model "${e}" not found`,{cause:n}),this.id=e}}class Nr extends Error{constructor(n,r,i,s){super(i,{cause:s??r});Ke(this,"status");Ke(this,"operation");this.status=n,this.operation=r}}class mQ extends Nr{constructor(e,n){super("CONFLICT",n,`Conflicting operation on index ${n.index}`,{existingOperation:e,newOperation:n})}}class gQ extends Error{constructor(n){super(`Drive already exists. ID: ${n}`);Ke(this,"driveId");this.driveId=n}}class Td extends Error{constructor(n){super(`Drive with id ${n} not found`);Ke(this,"driveId");this.driveId=n}}class YP extends Error{constructor(n,r){super(n);Ke(this,"syncUnitId");this.syncUnitId=r}}var jf;(t=>{t.useMessageChannel=typeof MessageChannel>"u"?new Error("MessageChannel is not supported"):r=>{const i=new AbortController,s=i.signal,o=new MessageChannel;return o.port1.postMessage(null),o.port2.addEventListener("message",()=>{r(),o.port1.close(),o.port2.close()},{once:!0,signal:s}),o.port2.start(),()=>i.abort()},t.usePostMessage=(()=>{const r=typeof window=="object"&&window||typeof global=="object"&&global||typeof self=="object"&&self;if(!r)return new Error("No global object found");const i=r;if(!i.postMessage||!i.addEventListener||i.importScripts)return new Error("postMessage is not supported");let s=0;const o=new Map;function a(){return s===9007199254740991?0:++s}const c="com.usePostMessage"+Math.random();return i.addEventListener("message",l=>{const u=l;if(typeof u.data!="string"||u.source!==i||!u.data.startsWith(c))return;const d=u.data.split(":").at(1);if(d===void 0)return;const f=+d,p=o.get(f);p&&(p(),o.delete(f))},!1),l=>{const u=a();return o.set(u,l),i.postMessage(c+":"+u,{targetOrigin:"*"}),()=>{o.delete(u)}}})(),t.useSetImmediate=typeof window<"u"?new Error("setImmediate is not supported on the browser"):typeof setImmediate>"u"?new Error("setImmediate is not supported"):r=>{const i=setImmediate(r);return()=>clearImmediate(i)},t.useSetTimeout=r=>{const i=setTimeout(r,0);return()=>clearTimeout(i)};function e(r){return t.useSetImmediate instanceof Error?t.useMessageChannel instanceof Error?t.usePostMessage instanceof Error?(0,t.useSetTimeout)(r):(0,t.usePostMessage)(r):(0,t.useMessageChannel)(r):(0,t.useSetImmediate)(r)}t.runAsap=e;function n(r,i=e){if(i instanceof Error)throw new Error("queueMethod is not supported",{cause:i});return new Promise((s,o)=>{i(()=>{r().then(s).catch(o)})})}t.runAsapAsync=n})(jf||(jf={}));const yQ=jf.runAsap,vQ=jf.runAsapAsync;function Ra(t){return t.documentType===hy.id}function Xm(t,e){const n=Object.keys(t).reduce((i,s)=>{var a;const o=s;return i[o]=((a=t[o].at(-1))==null?void 0:a.index)??0,i},{}),r=e.find(i=>i.index<(n[i.scope]??0));if(r)throw new Nr("ERROR",r,`Tried to add operation with index ${r.index} and document is at index ${n[r.scope]}`);return e.sort((i,s)=>i.index-s.index).reduce((i,s)=>{const o=i[s.scope]||[];return{...i,[s.scope]:[...o,s]}},t)}function LS(){return AE()}function bQ(t,e){return new Date(t)<new Date(e)}function Gh(t){return"operations"in t}function _Q(t){return"actions"in t}class wQ{constructor(e){Ke(this,"id");Ke(this,"blocked",!1);Ke(this,"deleted",!1);Ke(this,"items",[]);Ke(this,"dependencies",new Array);this.id=e}async setDeleted(e){this.deleted=e}async isDeleted(){return this.deleted}async addJob(e){return this.items.push(e),Promise.resolve()}async getNextJob(){const e=this.items.shift();return Promise.resolve(e)}async amountOfJobs(){return Promise.resolve(this.items.length)}getId(){return this.id}async setBlocked(e){this.blocked=e}async isBlocked(){return this.blocked}async getJobs(){return this.items}async addDependencies(e){this.dependencies.find(n=>n.jobId===e.jobId)||this.dependencies.push(e),this.isBlocked()||this.setBlocked(!0)}async removeDependencies(e){this.dependencies=this.dependencies.filter(n=>n.jobId!==e.jobId&&n.driveId!==e.driveId),this.dependencies.length===0&&await this.setBlocked(!1)}}class KP{constructor(e=3,n=0){Ke(this,"emitter",GP());Ke(this,"ticker",0);Ke(this,"queues",[]);Ke(this,"workers");Ke(this,"timeout");Ke(this,"delegate");this.workers=e,this.timeout=n}async init(e,n){this.delegate=e;for(let r=0;r<this.workers;r++)setTimeout(()=>this.processNextJob.bind(this)().catch(n),100*r);return Promise.resolve()}async addJob(e){if(!this.delegate)throw new Error("No server delegate defined");const n=LS(),r=this.getQueue(e.driveId,e.documentId);if(await r.isDeleted())throw new Error("Queue is deleted");if(e.documentId&&!await this.delegate.checkDocumentExists(e.driveId,e.documentId)&&!await r.isBlocked()){await r.setBlocked(!0);const l=await this.getQueue(e.driveId).getJobs();for(const u of l)(Gh(u)?u.operations:u.actions).find(p=>{const m=p.input;return p.type==="ADD_FILE"&&m.id===e.documentId})&&await r.addDependencies(u)}const s=Gh(e)?e.operations:e.actions,o=s.filter(c=>c.type==="ADD_FILE");for(const c of o){const l=c.input;await this.getQueue(e.driveId,l.id).addDependencies({jobId:n,...e})}const a=s.filter(c=>c.type==="DELETE_NODE");for(const c of a){const l=c.input;await this.getQueue(e.driveId,l.id).setDeleted(!0)}return await r.addJob({jobId:n,...e}),n}getQueue(e,n){const r=this.getQueueId(e,n);let i=this.queues.find(s=>s.getId()===r);return i||(i=new wQ(r),this.queues.push(i)),i}removeQueue(e,n){const r=this.getQueueId(e,n);this.queues=this.queues.filter(i=>i.getId()!==r),this.emit("queueRemoved",r)}getQueueByIndex(e){const n=this.queues[e];return n||null}getQueues(){return this.queues.map(e=>e.getId())}retryNextJob(e){const n=e!==void 0?e:this.timeout;(n>0?i=>setTimeout(i,n):yQ)(()=>this.processNextJob())}async findFirstNonEmptyQueue(e){const n=this.queues.length;for(let r=0;r<n;r++){const i=(e+r)%n,s=this.queues[i];if(s&&await s.amountOfJobs()>0)return i}return null}async processNextJob(){if(!this.delegate)throw new Error("No server delegate defined");if(this.queues.length===0){this.retryNextJob();return}const e=this.queues[this.ticker];if(!e){this.ticker=0,this.retryNextJob();return}if(await e.amountOfJobs()===0){const s=await this.findFirstNonEmptyQueue(this.ticker);s!==null?(this.ticker=s,this.retryNextJob(0)):this.retryNextJob();return}if(this.ticker=this.ticker===this.queues.length-1?0:this.ticker+1,await e.isBlocked()){this.retryNextJob();return}await e.setBlocked(!0);const i=await e.getNextJob();if(!i){this.retryNextJob();return}try{const s=await this.delegate.processJob(i),a=(Gh(i)?i.operations:i.actions).filter(c=>c.type==="ADD_FILE");if(a.length>0)for(const c of a)await this.getQueue(i.driveId,c.input.id).removeDependencies(i);this.emit("jobCompleted",i,s)}catch(s){Tt.error("job failed",s),this.emit("jobFailed",i,s)}finally{await e.setBlocked(!1),this.retryNextJob(0)}}emit(e,...n){this.emitter.emit(e,...n)}on(e,n){return this.emitter.on(e,n)}getQueueId(e,n){return`queue:${e}${n?`:${n}`:""}`}}class yy extends Error{}class Da extends yy{constructor(e){super(`Read drive ${e} not found.`)}}class EQ extends yy{constructor(e){super(`Read drive with slug ${e} not found.`)}}class aI extends yy{constructor(e,n){super(`Document with id ${n} not found on read drive ${e}.`)}}var Yf,Ci,xc,I_,JP;class SQ{constructor(e){It(this,xc);It(this,Yf);It(this,Ci,new Map);bt(this,Yf,e)}async fetchDrive(e){const n=de(this,Ci).get(e);if(!n)return new Da(e);const r=await this.fetchDocument(e,e,hy.id);if(r instanceof Error)return r;const i={...r,readContext:n.context};return n.drive=i,i}async fetchDocument(e,n,r){const i=de(this,Ci).get(e);if(!i)return new Da(e);let s;try{s=de(this,Yf).call(this,r)}catch(l){return new hQ(r,l)}const{url:o}=i.context,{errors:a,document:c}=await rI(o,n,s);if(a){const l=un(this,xc,I_).call(this,a,e,n);if(l instanceof yy)return l;if(l)throw l}return c||new aI(e,n)}async addReadDrive(e,n){const{id:r}=(n==null?void 0:n.expectedDriveInfo)??await $a(e),i=await un(this,xc,JP).call(this,r,e);if(i instanceof Error)throw i;if(!i)throw new Error(`Drive "${r}" not found at ${e}`);de(this,Ci).set(r,{drive:i,context:{...n,url:e}})}async getReadDrives(){return Promise.resolve([...de(this,Ci).keys()])}async getReadDrive(e){const n=de(this,Ci).get(e);return Promise.resolve(n?{...n.drive,readContext:n.context}:new Da(e))}async getReadDriveBySlug(e){const n=[...de(this,Ci).values()].find(({drive:r})=>r.state.global.slug===e);return Promise.resolve(n?{...n.drive,readContext:n.context}:new EQ(e))}getReadDriveContext(e){var n;return Promise.resolve(((n=de(this,Ci).get(e))==null?void 0:n.context)??new Da(e))}deleteReadDrive(e){const n=de(this,Ci).delete(e);return Promise.resolve(n?void 0:new Da(e))}}Yf=new WeakMap,Ci=new WeakMap,xc=new WeakSet,I_=function(e,n,r){for(const s of e){if(s.message===`Drive with id ${n} not found`)return new Da(n);if(r&&s.message===`Document with id ${r} not found`)return new aI(n,r)}const i=e.at(0);if(i)return i},JP=async function(e,n){const{errors:r,document:i}=await rI(n,e,pQ);return(r?un(this,xc,I_).call(this,r,e):void 0)||i};function xQ(t){var e,n,r,Zh,Yh,o;return o=class extends t{constructor(...l){super(...l);It(this,r);It(this,e);It(this,n,new Set);bt(this,e,new SQ(this.getDocumentModel.bind(this))),un(this,r,Zh).call(this).then(u=>{u.length&&un(this,r,Yh).call(this,u,"add")}).catch(Tt.error)}getReadDrives(){return de(this,e).getReadDrives()}getReadDrive(l){return de(this,e).getReadDrive(l)}getReadDriveBySlug(l){return de(this,e).getReadDriveBySlug(l)}getReadDriveContext(l){return de(this,e).getReadDriveContext(l)}async addReadDrive(l,u){await de(this,e).addReadDrive(l,u),un(this,r,Yh).call(this,await un(this,r,Zh).call(this),"add")}fetchDrive(l){return de(this,e).fetchDrive(l)}fetchDocument(l,u,d){return de(this,e).fetchDocument(l,u,d)}async deleteReadDrive(l){const u=await de(this,e).deleteReadDrive(l);if(u)return u;un(this,r,Yh).call(this,await un(this,r,Zh).call(this),"delete")}async migrateReadDrive(l,u){const d=await this.getReadDriveContext(l);if(d instanceof Error)return d;const{url:f,...p}=d;try{return await this.addRemoteDrive(f,u)}catch(m){throw Tt.error(m),await this.addReadDrive(d.url,p),m}}onReadDrivesUpdate(l){return de(this,n).add(l),Promise.resolve(()=>de(this,n).delete(l))}},e=new WeakMap,n=new WeakMap,r=new WeakSet,Zh=async function(){const l=await this.getReadDrives();return(await Promise.all(l.map(d=>this.getReadDrive(d)))).filter(d=>!(d instanceof Error))},Yh=function(l,u){de(this,n).forEach(d=>d(l,u))},o}class TQ{constructor(){Ke(this,"documents");Ke(this,"drives");Ke(this,"slugToDriveId",{});this.documents={},this.drives={}}checkDocumentExists(e,n){var r;return Promise.resolve(((r=this.documents[e])==null?void 0:r[n])!==void 0)}async getDocuments(e){return Object.keys(this.documents[e]??{})}async getDocument(e,n){const r=this.documents[e];if(!r)throw new Td(e);const i=r[n];if(!i)throw new Error(`Document with id ${n} not found`);return i}async saveDocument(e,n,r){this.documents[e]=this.documents[e]??{},this.documents[e][n]=r}async clearStorage(){this.documents={},this.drives={}}async createDocument(e,n,r){this.documents[e]=this.documents[e]??{};const{operations:i,initialState:s,name:o,revision:a,documentType:c,created:l,lastModified:u,clipboard:d,state:f}=r;this.documents[e][n]={operations:i,initialState:s,name:o,revision:a,documentType:c,created:l,lastModified:u,clipboard:d,state:f}}async addDocumentOperations(e,n,r,i){const s=await this.getDocument(e,n);if(!s)throw new Error(`Document with id ${n} not found`);const o=Xm(s.operations,r);this.documents[e][n]={...s,...i,operations:o}}async deleteDocument(e,n){if(!this.documents[e])throw new Td(e);delete this.documents[e][n]}async getDrives(){return Object.keys(this.drives)}async getDrive(e){const n=this.drives[e];if(!n)throw new Td(e);return n}async getDriveBySlug(e){const n=this.slugToDriveId[e];if(!n)throw new Error(`Drive with slug ${e} not found`);return this.getDrive(n)}async createDrive(e,n){this.drives[e]=n,this.documents[e]={};const{slug:r}=n.initialState.state.global;r&&(this.slugToDriveId[r]=e)}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=Xm(i.operations,n);this.drives[e]={...i,...r,operations:s}}async deleteDrive(e){delete this.documents[e],delete this.drives[e]}async getSynchronizationUnitsRevision(e){return(await Promise.allSettled(e.map(async r=>{try{const i=await(r.documentId?this.getDocument(r.driveId,r.documentId):this.getDrive(r.driveId));if(!i)return;const s=i.operations[r.scope].at(-1);if(s)return{driveId:r.driveId,documentId:r.documentId,scope:r.scope,branch:r.branch,lastUpdated:s.timestamp,revision:s.index}}catch{return}}))).reduce((r,i)=>(i.status==="fulfilled"&&i.value!==void 0&&r.push(i.value),r),[])}}function IQ(t){return typeof t.getReadDrives=="function"}class OQ{constructor(e,n,r){Ke(this,"defaultRemoteDrives",new Map);Ke(this,"removeOldRemoteDrivesConfig");if(this.server=e,this.delegate=n,r!=null&&r.defaultDrives.remoteDrives)for(const i of r.defaultDrives.remoteDrives)this.defaultRemoteDrives.set(i.url,{...i,status:"PENDING"});this.removeOldRemoteDrivesConfig=(r==null?void 0:r.defaultDrives.removeOldRemoteDrives)||{strategy:"preserve-all"}}getDefaultRemoteDrives(){return new Map(JSON.parse(JSON.stringify(Array.from(this.defaultRemoteDrives))))}async deleteDriveById(e){try{await this.server.deleteDrive(e)}catch(n){n instanceof Td||Tt.error(n)}}async preserveDrivesById(e,n,r="detach"){const i=n.map(a=>this.server.getDrive(a)),o=(await Promise.all(i)).filter(a=>a.state.local.listeners.length>0||a.state.local.triggers.length>0).filter(a=>!e.includes(a.state.global.id)).map(a=>a.state.global.id);r==="detach"?await this.detachDrivesById(o):await this.removeDrivesById(o)}async removeDrivesById(e){for(const n of e)await this.deleteDriveById(n)}async detachDrivesById(e){const n=e.map(r=>this.delegate.detachDrive(r));await Promise.all(n)}async removeOldremoteDrives(){const e=await this.server.getDrives();switch(this.removeOldRemoteDrivesConfig.strategy){case"preserve-by-id-and-detach":case"preserve-by-id":{const n=this.removeOldRemoteDrivesConfig.strategy==="preserve-by-id-and-detach"?"detach":"remove";await this.preserveDrivesById(this.removeOldRemoteDrivesConfig.ids,e,n);break}case"preserve-by-url-and-detach":case"preserve-by-url":{const n=this.removeOldRemoteDrivesConfig.strategy==="preserve-by-url-and-detach"?"detach":"remove",r=this.removeOldRemoteDrivesConfig.urls.map(s=>$a(s)),i=(await Promise.all(r)).map(s=>s.id);await this.preserveDrivesById(i,e,n);break}case"remove-by-id":{const n=this.removeOldRemoteDrivesConfig.ids.filter(r=>e.includes(r));await this.removeDrivesById(n);break}case"remove-by-url":{const n=this.removeOldRemoteDrivesConfig.urls.map(s=>$a(s)),i=(await Promise.all(n)).map(s=>s.id).filter(s=>e.includes(s));await this.removeDrivesById(i);break}case"remove-all":{const n=e.map(s=>this.server.getDrive(s)),i=(await Promise.all(n)).filter(s=>s.state.local.listeners.length>0||s.state.local.triggers.length>0).map(s=>s.state.global.id);await this.removeDrivesById(i);break}case"detach-by-id":{const r=this.removeOldRemoteDrivesConfig.ids.filter(i=>e.includes(i)).map(i=>this.delegate.detachDrive(i));await Promise.all(r);break}case"detach-by-url":{const n=this.removeOldRemoteDrivesConfig.urls.map(o=>$a(o)),s=(await Promise.all(n)).map(o=>o.id).filter(o=>e.includes(o)).map(o=>this.delegate.detachDrive(o));await Promise.all(s);break}}}async setAllDefaultDrivesAccessLevel(e){const n=this.defaultRemoteDrives.values();for(const r of n)await this.setDefaultDriveAccessLevel(r.url,e)}async setDefaultDriveAccessLevel(e,n){const r=this.defaultRemoteDrives.get(e);if(r&&r.options.accessLevel!==n){const i={...r,options:{...r.options,accessLevel:n}};this.defaultRemoteDrives.set(e,i),await this.initializeDefaultRemoteDrives([i])}}async initializeDefaultRemoteDrives(e=Array.from(this.defaultRemoteDrives.values())){const n=await this.server.getDrives(),r=IQ(this.server)?this.server:void 0,i=await(r==null?void 0:r.getReadDrives());for(const s of e){let o={...s};try{const a=s.metadata??await $a(s.url);o={...s,metadata:a},this.defaultRemoteDrives.set(s.url,o);const c=n.includes(a.id),l=i==null?void 0:i.includes(a.id),u=s.options.accessLevel!==void 0,d=r&&s.options.accessLevel==="READ",f=d?l:c;if(u&&(d?c:l))try{await(d?this.server.deleteDrive(a.id):r==null?void 0:r.deleteReadDrive(a.id))}catch(m){Tt.error(m)}if(f){o.status="ALREADY_ADDED",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ALREADY_ADDED",this.defaultRemoteDrives,o,a.id,a.name);continue}o.status="ADDING",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ADDING",this.defaultRemoteDrives,o),!u&&r||d?await r.addReadDrive(s.url,{...s.options,expectedDriveInfo:a}):await this.server.addRemoteDrive(s.url,{...s.options,expectedDriveInfo:a}),o.status="SUCCESS",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("SUCCESS",this.defaultRemoteDrives,o,a.id,a.name)}catch(a){o.status="ERROR",this.defaultRemoteDrives.set(s.url,o),this.delegate.emit("ERROR",this.defaultRemoteDrives,o,void 0,void 0,a)}}}}const{attachBranch:CQ,garbageCollect:RQ,groupOperationsByScope:DQ,merge:kQ,split:tme,precedes:AQ,removeExistingOperations:NQ,reshuffleByTimestamp:PQ,sortOperations:MQ,addUndo:nme,checkOperationsIntegrity:rme,checkCleanedOperationsIntegrity:ime,reshuffleByTimestampAndIndex:sme,nextSkipNumber:ome,prepareOperations:ame,IntegrityIssueSubType:cme,IntegrityIssueType:lme}=Gt.documentHelpers,O_={sequentialUpdates:!0};function LQ(t,e=250){let n;return(r,...i)=>(n&&clearTimeout(n),new Promise((s,o)=>{r?t(...i).then(s).catch(o):n=setTimeout(()=>{t(...i).then(s).catch(o)},e)}))}const Eg=class Eg{constructor(e,n=new Map,r=O_){Ke(this,"driveServer");Ke(this,"listenerStateByDriveId",new Map);Ke(this,"options");Ke(this,"triggerUpdate",LQ(this._triggerUpdate.bind(this),Eg.LISTENER_UPDATE_DELAY));this.driveServer=e,this.listenerStateByDriveId=n,this.options={...O_,...r}}async initialize(e){typeof window<"u"&&window.addEventListener("online",()=>{this.triggerUpdate(!1,{type:"local"},e).catch(n=>{Tt.error("Non handled error updating listeners",n)})})}driveHasListeners(e){return this.listenerStateByDriveId.has(e)}async setListener(e,n){if(e!==n.driveId)throw new Error("Drive ID mismatch");let r;try{r=this.getListenerState(e,n.listenerId)}catch{r={}}this.setListenerState(e,n.listenerId,{...r,block:n.block,driveId:n.driveId,pendingTimeout:"0",listener:n,listenerStatus:"CREATED",syncUnits:new Map}),this.triggerUpdate(!0,{type:"local"})}async removeListener(e,n){const r=this.listenerStateByDriveId.get(e);return r?Promise.resolve(r.delete(n)):!1}async removeSyncUnits(e,n){const r=this.listenerStateByDriveId.get(e);if(r){for(const[,i]of r)for(const s of n)i.syncUnits.delete(s.syncId);return Promise.resolve()}}async updateSynchronizationRevisions(e,n,r,i,s,o=!1){const a=this.listenerStateByDriveId.get(e);if(!a)return[];const c=[];for(const[,l]of a){if(c.find(d=>d.listenerId===l.listener.listenerId))continue;const u=l.listener.transmitter;if(u!=null&&u.transmit)for(const d of n){if(!this._checkFilter(l.listener.filter,d))continue;const f=l.syncUnits.get(d.syncId);if(!f||f.listenerRev<d.revision){c.push(l.listener);break}}}return c.length?(i==null||i(c),this.triggerUpdate(o,r,s)):[]}async updateListenerRevision(e,n,r,i){const s=this.listenerStateByDriveId.get(n);if(!s)return;const o=s.get(e);if(!o)return;const a=new Date().toISOString(),c=o.syncUnits.get(r);return c?(c.listenerRev=i,c.lastUpdated=a):o.syncUnits.set(r,{listenerRev:i,lastUpdated:a}),Promise.resolve()}async _triggerUpdate(e,n){var i;const r=[];for(const[s,o]of this.listenerStateByDriveId)for(const[a,c]of o){const l=c.listener.transmitter;if(!(l!=null&&l.transmit))continue;const u=await this.getListenerSyncUnits(s,c.listener.listenerId),d=[],f=u.map(p=>async()=>{const m=c.syncUnits.get(p.syncId);if(m&&m.listenerRev>=p.revision)return;const h=[];try{const g=await this.driveServer.getOperationData(s,p.syncId,{fromRevision:m==null?void 0:m.listenerRev});h.push(...g)}catch(g){Tt.error(g)}h.length&&d.push({driveId:s,documentId:p.documentId,branch:p.branch,operations:h,scope:p.scope})});if(this.options.sequentialUpdates)for(const p of f)await p();else await Promise.all(f.map(p=>p()));if(d.length!=0){c.pendingTimeout=new Date(new Date().getTime()/1e3+300).toISOString(),c.listenerStatus="PENDING";try{const p=await l.transmit(d,e);c.pendingTimeout="0",c.listenerStatus="PENDING";const m=new Date().toISOString();for(const h of p){const g=u.find(y=>h.documentId===y.documentId&&h.scope===y.scope&&h.branch===y.branch);g?c.syncUnits.set(g.syncId,{lastUpdated:m,listenerRev:h.revision}):Tt.warn(`Received revision for untracked unit for listener ${c.listener.listenerId}`,h)}for(const h of p){const g=h.status==="ERROR";if((i=h.error)!=null&&i.includes("Missing operations")){const y=await this._triggerUpdate(e,n);r.push(...y)}else if(r.push({listenerId:c.listener.listenerId,listenerRevisions:p}),g)throw new Nr(h.status,void 0,h.error,h.error)}c.listenerStatus="SUCCESS"}catch(p){n==null||n(p,s,c),c.listenerStatus=p instanceof Nr?p.status:"ERROR"}}}return r}_checkFilter(e,n){const{branch:r,documentId:i,scope:s,documentType:o}=n;return!!((!e.branch||e.branch.includes(r)||e.branch.includes("*"))&&(!e.documentId||e.documentId.includes(i)||e.documentId.includes("*"))&&(!e.scope||e.scope.includes(s)||e.scope.includes("*"))&&(!e.documentType||e.documentType.includes(o)||e.documentType.includes("*")))}getListenerSyncUnits(e,n,r){var o;const i=(o=this.listenerStateByDriveId.get(e))==null?void 0:o.get(n);if(!i)return[];const s=i.listener.filter;return this.driveServer.getSynchronizationUnits(e,s.documentId??["*"],s.scope??["*"],s.branch??["*"],s.documentType??["*"],r)}getListenerSyncUnitIds(e,n){var s;const r=(s=this.listenerStateByDriveId.get(e))==null?void 0:s.get(n);if(!r)return Promise.resolve([]);const i=r.listener.filter;return this.driveServer.getSynchronizationUnitsIds(e,i.documentId??["*"],i.scope??["*"],i.branch??["*"],i.documentType??["*"])}async removeDrive(e){var r,i;const n=this.listenerStateByDriveId.get(e);if(n){this.listenerStateByDriveId.delete(e);for(const[s,o]of n)try{await((i=(r=o.listener.transmitter)==null?void 0:r.disconnect)==null?void 0:i.call(r))}catch(a){Tt.error(a)}}}async getStrands(e,n,r){const i=this.getListenerState(e,n),s=[],o=await this.driveServer.getDrive(e),a=await this.getListenerSyncUnits(e,n,o),c=r==null?void 0:r.limit;let l=0;const u=a.map(d=>async()=>{if(c&&l>=c||d.revision<0)return;const f=i.syncUnits.get(d.syncId);if(f&&f.listenerRev>=d.revision)return;const{documentId:p,driveId:m,scope:h,branch:g}=d;try{const y=await this.driveServer.getOperationData(m,d.syncId,{since:r==null?void 0:r.since,fromRevision:(r==null?void 0:r.fromRevision)??(f==null?void 0:f.listenerRev),limit:c?c-l:void 0},o);if(!y.length)return;l+=y.length,s.push({driveId:m,documentId:p,scope:h,branch:g,operations:y})}catch(y){Tt.error(y);return}});if(this.options.sequentialUpdates)for(const d of u)await d();else await Promise.all(u.map(d=>d()));return s}getListenerState(e,n){let r=this.listenerStateByDriveId.get(e);r||(r=new Map,this.listenerStateByDriveId.set(e,r));const i=r.get(n);if(!i)throw new Error("Listener not found");return i}setListenerState(e,n,r){let i=this.listenerStateByDriveId.get(e);i||(i=new Map,this.listenerStateByDriveId.set(e,i)),i.set(n,r)}};Ke(Eg,"LISTENER_UPDATE_DELAY",250);let C_=Eg;var Sg,QP;class XP{constructor(e,n){It(this,Sg);Ke(this,"drive");Ke(this,"listener");Ke(this,"receiver");this.listener=e,this.drive=n}async transmit(e,n){var i;if(!this.receiver)return[];const r=[];for(const s of e){const o=await un(this,Sg,QP).call(this,s),a=((i=o.at(-1))==null?void 0:i.state)??{};r.push({...s,operations:o,state:a})}try{return await this.receiver.onStrands(r),e.map(({operations:s,...o})=>{var a;return{...o,status:"SUCCESS",revision:((a=s.at(s.length-1))==null?void 0:a.index)??-1}})}catch(s){return Tt.error(s),e.map(({operations:o,...a})=>{var c;return{...a,status:"ERROR",revision:(((c=o.at(0))==null?void 0:c.index)??0)-1}})}}setReceiver(e){this.receiver=e}async disconnect(){var e;await((e=this.receiver)==null?void 0:e.onDisconnect())}getListener(){return this.listener}}Sg=new WeakSet,QP=async function(e){const n=[],r=new Map,i=async s=>{const o=r.get(s);if(o)return o;const a={revisions:{[e.scope]:s},checkHashes:!1},c=await(e.documentId?this.drive.getDocument(e.driveId,e.documentId,a):this.drive.getDrive(e.driveId,a));return s<0?r.set(s,c.initialState.state[e.scope]):r.set(s,c.state[e.scope]),r.get(s)};for(const s of e.operations)n.push({...s,state:await i(s.index),previousState:await i(s.index-1)});return n};class Zs{constructor(e,n){Ke(this,"listener");Ke(this,"manager");this.listener=e,this.manager=n}getStrands(e){return this.manager.getStrands(this.listener.driveId,this.listener.listenerId,e)}disconnect(){return Promise.resolve()}async processAcknowledge(e,n,r){const i=await this.manager.getListenerSyncUnitIds(e,n);let s=!0;for(const o of r){const a=i.find(c=>c.scope===o.scope&&c.branch===o.branch&&c.driveId===o.driveId&&c.documentId==o.documentId);if(!a){Tt.warn("Unknown sync unit was acknowledged",o),s=!1;continue}await this.manager.updateListenerRevision(n,e,a.syncId,o.revision)}return s}static async registerPullResponder(e,n,r){var o;const i=await xl(n,Sl`
337
+ mutation registerPullResponderListener($filter: InputListenerFilter!) {
338
+ registerPullResponderListener(filter: $filter) {
339
+ listenerId
340
+ }
341
+ }
342
+ `,{filter:r}),s=(o=i.errors)==null?void 0:o.at(0);if(s)throw s;if(!i.registerPullResponderListener)throw new Error("Error registering listener");return i.registerPullResponderListener.listenerId}static async pullStrands(e,n,r,i){var a;const s=await xl(n,Sl`
343
+ query strands($listenerId: ID!) {
344
+ system {
345
+ sync {
346
+ strands(listenerId: $listenerId) {
347
+ driveId
348
+ documentId
349
+ scope
350
+ branch
351
+ operations {
352
+ id
353
+ timestamp
354
+ skip
355
+ type
356
+ input
357
+ hash
358
+ index
359
+ context {
360
+ signer {
361
+ user {
362
+ address
363
+ networkId
364
+ chainId
365
+ }
366
+ app {
367
+ name
368
+ key
369
+ }
370
+ signatures
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+ }
377
+ }
378
+ `,{listenerId:r}),o=(a=s.errors)==null?void 0:a.at(0);if(o)throw o;return s.system?s.system.sync.strands.map(c=>({...c,operations:c.operations.map(l=>({...l,input:JSON.parse(l.input)}))})):[]}static async acknowledgeStrands(e,n,r,i){var a;const s=await xl(n,Sl`
379
+ mutation acknowledge(
380
+ $listenerId: String!
381
+ $revisions: [ListenerRevisionInput]
382
+ ) {
383
+ acknowledge(listenerId: $listenerId, revisions: $revisions)
384
+ }
385
+ `,{listenerId:r,revisions:i}),o=(a=s.errors)==null?void 0:a.at(0);if(o)throw o;if(s.acknowledge===null)throw new Error("Error acknowledging strands");return s.acknowledge}static async executePull(e,n,r,i,s,o){var a;try{const{url:c,listenerId:l}=n.data,u=await Zs.pullStrands(e,c,l);if(!u.length){s==null||s([]);return}const d=[];for(const f of u){const p=f.operations.map(h=>({...h,scope:f.scope,branch:f.branch}));let m;try{const h=await r(f,{type:"trigger",trigger:n});if(h.error)throw h.error}catch(h){m=h,i(m)}d.push({branch:f.branch,documentId:f.documentId||"",driveId:f.driveId,revision:((a=p.pop())==null?void 0:a.index)??-1,scope:f.scope,status:m?m instanceof Nr?m.status:"ERROR":"SUCCESS",error:m})}s==null||s(d),await Zs.acknowledgeStrands(e,c,l,d.map(f=>{const{error:p,...m}=f;return m})).then(f=>o==null?void 0:o(f)).catch(f=>Tt.error("ACK error",f))}catch(c){i(c)}}static setupPull(e,n,r,i,s,o){const{interval:a}=n.data;let c=KQ;if(a)try{const f=parseInt(a);f&&(c=f)}catch{}let l=!1,u;return(async()=>{for(;!l;)await this.executePull(e,n,r,i,s,o),await new Promise(f=>{u=setTimeout(f,c)})})().catch(Tt.error),()=>{l=!0,u!==void 0&&clearTimeout(u)}}static async createPullResponderTrigger(e,n,r){const{pullFilter:i,pullInterval:s}=r,o=await Zs.registerPullResponder(e,n,i??{documentId:["*"],documentType:["*"],branch:["*"],scope:["*"]});return{id:LS(),type:"PullResponder",data:{url:n,listenerId:o,interval:(s==null?void 0:s.toString())??""}}}static isPullResponderTrigger(e){return e.type==="PullResponder"}}var FQ={space:"",cycles:!1,replacer:(t,e)=>e,stringify:JSON.stringify},Nc={isArray:Array.isArray,assign:Object.assign,isObject:t=>typeof t=="object",isFunction:t=>typeof t=="function",isBoolean:t=>typeof t=="boolean",isRegex:t=>t instanceof RegExp,keys:Object.keys};const Wu=FQ,$Q=Nc.isFunction,jQ=Nc.isBoolean,UQ=Nc.isObject,BQ=Nc.isArray,zQ=Nc.isRegex,VQ=Nc.assign,HQ=Nc.keys;function WQ(t){return t==null?t:zQ(t)?t.toString():t.toJSON?t.toJSON():t}function qQ(t,e){e=e||VQ({},Wu),$Q(e)&&(e={compare:e});const n=e.space||Wu.space,r=jQ(e.cycles)?e.cycles:Wu.cycles,i=e.replacer||Wu.replacer,s=e.stringify||Wu.stringify,o=e.compare&&function(c){return function(l){return function(u,d){const f={key:u,value:l[u]},p={key:d,value:l[d]};return c(f,p)}}}(e.compare);r||s(t);const a=[];return function c(l,u,d,f){const p=n?`
386
+ `+new Array(f+1).join(n):"",m=n?": ":":";if(d=WQ(d),d=i.call(l,u,d),d!==void 0){if(!UQ(d)||d===null)return s(d);if(BQ(d)){const h=[];for(let g=0;g<d.length;g++){const y=c(d,g,d[g],f+1)||s(null);h.push(p+n+y)}return"["+h.join(",")+p+"]"}else{if(r){if(a.indexOf(d)!==-1)return s("[Circular]");a.push(d)}const h=HQ(d).sort(o&&o(d)),g=[];for(let y=0;y<h.length;y++){const v=h[y],b=c(d,v,d[v],f+1);if(!b)continue;const E=s(v)+m+b;g.push(p+n+E)}return a.splice(a.indexOf(d),1),"{"+g.join(",")+p+"}"}}}({"":t},"",t,0)}var GQ=qQ;const ZQ=pa(GQ);class YQ{constructor(e){Ke(this,"targetURL");this.targetURL=e}async transmit(e,n){var r;if(n.type==="trigger"&&((r=n.trigger.data)==null?void 0:r.url)===this.targetURL)return e.map(i=>{var s;return{driveId:i.driveId,documentId:i.documentId,scope:i.scope,branch:i.branch,status:"SUCCESS",revision:((s=i.operations.at(-1))==null?void 0:s.index)??-1}});try{const{pushUpdates:i}=await xl(this.targetURL,Sl`
387
+ mutation pushUpdates($strands: [InputStrandUpdate!]) {
388
+ pushUpdates(strands: $strands) {
389
+ driveId
390
+ documentId
391
+ scope
392
+ branch
393
+ status
394
+ revision
395
+ error
396
+ }
397
+ }
398
+ `,{strands:e.map(s=>({...s,operations:s.operations.map(o=>({...o,input:ZQ(o.input)}))}))});if(!i)throw new Error("Couldn't update listener revision");return i}catch(i){throw Tt.error(i),i}return[]}}function cI(t,e){return e?Object.keys(t).reduce((n,r)=>{const i=e[r];return i!==void 0&&(n[r]=t[r].filter(s=>s.index<=i)),n},{global:[],local:[]}):t}function Wv(t,e){return!e||Object.entries(e).find(([n,r])=>{const i=t.operations[n].at(-1);return r===-1?i!==void 0:(i==null?void 0:i.index)!==r})===void 0}const KQ=5e3;class JQ{constructor(e){Ke(this,"listenerManager");this.listenerManager=e}instance(e,n,r){switch(e){case"SwitchboardPush":return new YQ(n.callInfo.data);case"Internal":return new XP(n,r);default:return new Zs(n,this.listenerManager)}}}class XQ{constructor(e,n=new TQ,r=new ZP,i=new KP,s){Ke(this,"emitter",GP());Ke(this,"cache");Ke(this,"documentModels");Ke(this,"storage");Ke(this,"transmitterFactory");Ke(this,"listenerManager");Ke(this,"triggerMap",new Map);Ke(this,"syncStatus",new Map);Ke(this,"queueManager");Ke(this,"initializePromise");Ke(this,"defaultDrivesManager");Ke(this,"options");Ke(this,"defaultDrivesManagerDelegate",{detachDrive:this.detachDrive.bind(this),emit:(...e)=>this.emit("defaultRemoteDrive",...e)});Ke(this,"queueDelegate",{checkDocumentExists:(e,n)=>this.storage.checkDocumentExists(e,n),processOperationJob:async({driveId:e,documentId:n,operations:r,options:i})=>n?this.addOperations(e,n,r,i):this.addDriveOperations(e,r,i),processActionJob:async({driveId:e,documentId:n,actions:r,options:i})=>n?this.addActions(e,n,r,i):this.addDriveActions(e,r,i),processJob:async e=>{if(Gh(e))return this.queueDelegate.processOperationJob(e);if(_Q(e))return this.queueDelegate.processActionJob(e);throw new Error("Unknown job type",e)}});var o,a;this.options={...s,defaultDrives:{...s==null?void 0:s.defaultDrives},listenerManager:{...O_,...s==null?void 0:s.listenerManager},taskQueueMethod:(s==null?void 0:s.taskQueueMethod)===void 0?jf.runAsap:s.taskQueueMethod},this.listenerManager=new C_(this,void 0,this.options.listenerManager),this.transmitterFactory=new JQ(this.listenerManager),this.documentModels=e,this.storage=n,this.cache=r,this.queueManager=i,this.defaultDrivesManager=new OQ(this,this.defaultDrivesManagerDelegate,s),(a=(o=this.storage).setStorageDelegate)==null||a.call(o,{getCachedOperations:async(c,l)=>{try{const u=await this.cache.getDocument(c,l);return u==null?void 0:u.operations}catch(u){Tt.error(u);return}}}),this.initializePromise=this._initialize()}setDocumentModels(e){this.documentModels=[...e],this.emit("documentModels",[...e])}initializeDefaultRemoteDrives(){return this.defaultDrivesManager.initializeDefaultRemoteDrives()}getDefaultRemoteDrives(){return this.defaultDrivesManager.getDefaultRemoteDrives()}setDefaultDriveAccessLevel(e,n){return this.defaultDrivesManager.setDefaultDriveAccessLevel(e,n)}setAllDefaultDrivesAccessLevel(e){return this.defaultDrivesManager.setAllDefaultDrivesAccessLevel(e)}getOperationSource(e){return e.type==="local"?"push":"pull"}getCombinedSyncUnitStatus(e){if(!e.pull&&!e.push||e.pull==="INITIAL_SYNC")return"INITIAL_SYNC";if(e.push==="INITIAL_SYNC")return e.pull||"INITIAL_SYNC";const n=["ERROR","MISSING","CONFLICT","SYNCING","SUCCESS"];return Object.values(e).sort((i,s)=>n.indexOf(i)-n.indexOf(s))[0]}initSyncStatus(e,n){const r=Object.entries(n).reduce((i,[s,o])=>({...i,[s]:o!=="SYNCING"?o:"INITIAL_SYNC"}),{});this.syncStatus.set(e,r),this.emit("syncStatus",e,this.getCombinedSyncUnitStatus(r),void 0,r)}async initializeDriveSyncStatus(e,n){const r=await this.getSynchronizationUnitsIds(e),i={pull:n.state.local.triggers.length>0?"INITIAL_SYNC":void 0,push:n.state.local.listeners.length>0?"SUCCESS":void 0};if(!i.pull&&!i.push)return;const s=[e,...r.map(o=>o.syncId)];for(const o of s)this.initSyncStatus(o,i)}updateSyncUnitStatus(e,n,r){if(n===null){this.syncStatus.delete(e);return}const i=this.syncStatus.get(e);if(!i){this.initSyncStatus(e,n);return}if(Object.entries(n).some(([o,a])=>i[o]!==a)){const o=Object.entries(n).reduce((l,[u,d])=>({...l,[u]:l[u]==="INITIAL_SYNC"&&d==="SYNCING"?"INITIAL_SYNC":d}),i),a=this.getCombinedSyncUnitStatus(i),c=this.getCombinedSyncUnitStatus(o);this.syncStatus.set(e,o),a!==c&&this.emit("syncStatus",e,this.getCombinedSyncUnitStatus(o),r,o)}}async saveStrand(e,n){const r=e.operations.map(s=>({...s,scope:e.scope,branch:e.branch})),i=await(e.documentId?this.queueOperations(e.driveId,e.documentId,r,{source:n}):this.queueDriveOperations(e.driveId,r,{source:n}));if(i.status==="ERROR"){const s=e.documentId!==""?(await this.getSynchronizationUnitsIds(e.driveId,[e.documentId],[e.scope],[e.branch])).map(a=>a.syncId):[e.driveId],o=this.getOperationSource(n);for(const a of s)this.updateSyncUnitStatus(a,{[o]:i.status},i.error)}return this.emit("strandUpdate",e),i}handleListenerError(e,n,r){Tt.error(`Listener ${r.listener.label??r.listener.listenerId} error:`,e);const i=e instanceof Nr?e.status:"ERROR";this.updateSyncUnitStatus(n,{push:i},e)}shouldSyncRemoteDrive(e){return e.state.local.availableOffline&&e.state.local.triggers.length>0}async startSyncRemoteDrive(e){const n=await this.getDrive(e);let r=this.triggerMap.get(e);const i=await this.getSynchronizationUnitsIds(e,void 0,void 0,void 0,void 0,n);for(const s of n.state.local.triggers)if(!(r!=null&&r.get(s.id))){r||(r=new Map),this.updateSyncUnitStatus(e,{pull:"SYNCING"});for(const o of i)this.updateSyncUnitStatus(o.syncId,{pull:"SYNCING"});if(Zs.isPullResponderTrigger(s)){let o=!0;const a=Zs.setupPull(e,s,this.saveStrand.bind(this),c=>{const l=c instanceof Nr?c.status:"ERROR";this.updateSyncUnitStatus(e,{pull:l},c),c instanceof El&&this.emit("clientStrandsError",e,s,c.response.status,c.message)},c=>{const l=c.filter(d=>d.status!=="SUCCESS");l.length<1&&this.updateSyncUnitStatus(e,{pull:"SUCCESS"});const u=c.filter(d=>d.documentId!=="").map(d=>d.documentId);if(this.getSynchronizationUnitsIds(e,u).then(d=>{for(const f of d){const p=l.find(m=>m.documentId===f.documentId);p?this.updateSyncUnitStatus(f.syncId,{pull:p.status},p.error):this.updateSyncUnitStatus(f.syncId,{pull:"SUCCESS"})}}).catch(console.error),o){o=!1;const d=n.state.local.listeners.find(f=>{var p;return s.data.url===((p=f.callInfo)==null?void 0:p.data)});d&&this.getSynchronizationUnitsRevision(e,i).then(f=>{for(const p of f)this.listenerManager.updateListenerRevision(d.listenerId,e,p.syncId,p.revision).catch(Tt.error)}).catch(Tt.error)}});r.set(s.id,a),this.triggerMap.set(e,r)}}}async stopSyncRemoteDrive(e){const r=(await this.getSynchronizationUnitsIds(e)).filter(s=>s.documentId!=="").map(s=>s.syncId),i=this.triggerMap.get(e);i==null||i.forEach(s=>s()),this.updateSyncUnitStatus(e,null);for(const s of r)this.updateSyncUnitStatus(s,null);return this.triggerMap.delete(e)}initialize(){return this.initializePromise}async _initialize(){await this.listenerManager.initialize(this.handleListenerError),await this.queueManager.init(this.queueDelegate,r=>{Tt.error("Error initializing queue manager",r),e.push(r)});try{await this.defaultDrivesManager.removeOldremoteDrives()}catch(r){Tt.error(r)}const e=[],n=await this.getDrives();for(const r of n)await this._initializeDrive(r).catch(i=>{Tt.error(`Error initializing drive ${r}`,i),e.push(i)});return this.options.defaultDrives.loadOnInit!==!1&&await this.defaultDrivesManager.initializeDefaultRemoteDrives(),e.length===0?null:e}async _initializeDrive(e){var r;const n=await this.getDrive(e);await this.initializeDriveSyncStatus(e,n),this.shouldSyncRemoteDrive(n)&&await this.startSyncRemoteDrive(e);for(const i of n.state.local.listeners){const s=this.transmitterFactory.instance(((r=i.callInfo)==null?void 0:r.transmitterType)??"",i,this);await this.listenerManager.setListener(e,{block:i.block,driveId:n.state.global.id,filter:{branch:i.filter.branch??[],documentId:i.filter.documentId??[],documentType:i.filter.documentType,scope:i.filter.scope??[]},listenerId:i.listenerId,system:i.system,label:i.label??"",transmitter:s})}}async getSynchronizationUnits(e,n,r,i,s,o){const a=o||await this.getDrive(e),c=await this.getSynchronizationUnitsIds(e,n,r,i,s,a);return this.getSynchronizationUnitsRevision(e,c,a)}async getSynchronizationUnitsRevision(e,n,r){const i=r||await this.getDrive(e),s=await this.storage.getSynchronizationUnitsRevision(n),o=n.map(a=>({...a,lastUpdated:i.created,revision:-1}));for(const a of s){const c=o.find(l=>a.driveId===l.driveId&&a.documentId===l.documentId&&a.scope===l.scope&&a.branch===l.branch);c&&(c.revision=a.revision,c.lastUpdated=a.lastUpdated)}return o}async getSynchronizationUnitsIds(e,n,r,i,s,o){const c=(o??await this.getDrive(e)).state.global.nodes.filter(u=>Lr(u)&&(!(n!=null&&n.length)||n.includes(u.id)||n.includes("*"))&&(!(s!=null&&s.length)||s.includes(u.documentType)||s.includes("*")));(!n||n.includes("*")||n.includes(""))&&(!(s!=null&&s.length)||s.includes("powerhouse/document-drive")||s.includes("*"))&&c.unshift({id:"",documentType:"powerhouse/document-drive",synchronizationUnits:[{syncId:"0",scope:"global",branch:"main"}]});const l=[];for(const u of c){const d=r!=null&&r.length||i!=null&&i.length?u.synchronizationUnits.filter(f=>(!(r!=null&&r.length)||r.includes(f.scope)||r.includes("*"))&&(!(i!=null&&i.length)||i.includes(f.branch)||i.includes("*"))):u.synchronizationUnits;d.length&&l.push(...d.map(f=>({driveId:e,documentId:u.id,syncId:f.syncId,documentType:u.documentType,scope:f.scope,branch:f.branch})))}return l}async getSynchronizationUnitIdInfo(e,n,r){const s=(r||await this.getDrive(e)).state.global.nodes.find(a=>Lr(a)&&a.synchronizationUnits.find(c=>c.syncId===n));if(!s||!Lr(s))return;const o=s.synchronizationUnits.find(a=>a.syncId===n);if(o)return{syncId:n,scope:o.scope,branch:o.branch,driveId:e,documentId:s.id,documentType:s.documentType}}async getSynchronizationUnit(e,n,r){const i=await this.getSynchronizationUnitIdInfo(e,n,r);if(!i)return;const{scope:s,branch:o,documentId:a,documentType:c}=i,l=await this.getDocument(e,a),u=l.operations[s]??[],d=u[u.length-1];return{syncId:n,scope:s,branch:o,driveId:e,documentId:a,documentType:c,lastUpdated:(d==null?void 0:d.timestamp)??l.lastModified,revision:(d==null?void 0:d.index)??0}}async getOperationData(e,n,r,i){const s=n==="0"?{documentId:"",scope:"global"}:await this.getSynchronizationUnitIdInfo(e,n,i);if(!s)throw new Error(`Invalid Sync Id ${n} in drive ${e}`);const c=((n==="0"?i||await this.getDrive(e):await this.getDocument(e,s.documentId)).operations[s.scope]??[]).filter(u=>Object.keys(r).length===0||(r.since===void 0||bQ(r.since,u.timestamp))&&(r.fromRevision===void 0||u.index>r.fromRevision));return(r.limit?c.slice(0,r.limit):c).map(u=>({hash:u.hash,index:u.index,timestamp:u.timestamp,type:u.type,input:u.input,skip:u.skip,context:u.context,id:u.id}))}getDocumentModel(e){const n=this.documentModels.find(r=>r.documentModel.id===e);if(!n)throw new Error(`Document type ${e} not supported`);return n}getDocumentModels(){return[...this.documentModels]}async addDrive(e){const n=e.global.id||LS();if(!n)throw new Error("Invalid Drive Id");if((await this.storage.getDrives()).includes(n))throw new gQ(n);const i=$f.createDocument({state:e});return await this.storage.createDrive(n,i),e.global.slug&&await this.cache.deleteDocument("drives-slug",e.global.slug),await this._initializeDrive(n),this.emit("driveAdded",i),i}async addRemoteDrive(e,n){const{id:r,name:i,slug:s,icon:o}=n.expectedDriveInfo||await $a(e),{pullFilter:a,pullInterval:c,availableOffline:l,sharingType:u,listeners:d,triggers:f}=n,p=await Zs.createPullResponderTrigger(r,e,{pullFilter:a,pullInterval:c});return await this.addDrive({global:{id:r,name:i,slug:s,icon:o??null},local:{triggers:[...f,p],listeners:d,availableOffline:l,sharingType:u}})}async registerPullResponderTrigger(e,n,r){return await Zs.createPullResponderTrigger(e,n,r)}async deleteDrive(e){(await Promise.allSettled([this.stopSyncRemoteDrive(e),this.listenerManager.removeDrive(e),this.cache.deleteDocument("drives",e),this.storage.deleteDrive(e)])).forEach(r=>{if(r.status==="rejected")throw r.reason})}getDrives(){return this.storage.getDrives()}async getDrive(e,n){let r;try{const o=await this.cache.getDocument("drives",e);if(o&&Ra(o)&&(r=o,Wv(r,n==null?void 0:n.revisions)))return r}catch(o){Tt.error("Error getting drive from cache",o)}const i=r??await this.storage.getDrive(e),s=this._buildDocument(i,n);if(Ra(s))return n!=null&&n.revisions||this.cache.setDocument("drives",e,s).catch(Tt.error),s;throw new Error(`Document with id ${e} is not a Document Drive`)}async getDriveBySlug(e,n){try{const s=await this.cache.getDocument("drives-slug",e);if(s&&Ra(s))return s}catch(s){Tt.error("Error getting drive from cache",s)}const r=await this.storage.getDriveBySlug(e),i=this._buildDocument(r,n);if(Ra(i))return this.cache.setDocument("drives-slug",e,i).catch(Tt.error),i;throw new Error(`Document with slug ${e} is not a Document Drive`)}async getDocument(e,n,r){let i;try{if(i=await this.cache.getDocument(e,n),i&&Wv(i,r==null?void 0:r.revisions))return i}catch(a){Tt.error("Error getting document from cache",a)}const s=i??await this.storage.getDocument(e,n),o=this._buildDocument(s,r);return r!=null&&r.revisions||this.cache.setDocument(e,n,o).catch(Tt.error),o}getDocuments(e){return this.storage.getDocuments(e)}async createDocument(e,n){let r;if(n.document){if(n.documentType!==n.document.documentType)throw new Error(`Provided document is not ${n.documentType}`);r=this._buildDocument(n.document).state}const i=n.document??this.getDocumentModel(n.documentType).utils.createDocument(),s={name:i.name,revision:i.revision,documentType:i.documentType,created:i.created,lastModified:i.lastModified,operations:{global:[],local:[]},initialState:i.initialState,clipboard:[],state:r??i.state};await this.storage.createDocument(e,n.id,s);for(const a of n.synchronizationUnits)this.initSyncStatus(a.syncId,{pull:this.triggerMap.get(e)?"INITIAL_SYNC":void 0,push:this.listenerManager.driveHasListeners(e)?"SUCCESS":void 0});const o=Object.values(i.operations).flat();return o.length&&(Ra(i)?await this.storage.addDriveOperations(e,o,i):await this.storage.addDocumentOperations(e,n.id,o,i)),i}async deleteDocument(e,n){try{const r=await this.getSynchronizationUnitsIds(e,[n]);for(const i of r)this.updateSyncUnitStatus(i.syncId,null);await this.listenerManager.removeSyncUnits(e,r)}catch(r){Tt.warn("Error deleting document",r)}return await this.cache.deleteDocument(e,n),this.storage.deleteDocument(e,n)}async _processOperations(e,n,r,i){const s=[],o=[],a=await this._addDocumentResultingStage(r,e,n);let c=this._buildDocument(a),l;const u=DQ(i);for(const d of Object.keys(u)){const f=r.operations[d],p=NQ(u[d]||[],f);if(p.length<1)continue;const m=RQ(MQ(f)),[h,g]=CQ(m,p),v=(g.length<1?h:kQ(m,h,PQ)).filter(b=>m.length<1||AQ(m[m.length-1],b));for(const b of v){let E=!1;if(g.length>0){const w=i.find(S=>S.hash===b.hash);E=!w||w.index!==b.index||w.skip!==b.skip}try{const w=this.options.taskQueueMethod,S=()=>this._performOperation(e,n,c,b,E),_=await(w?vQ(S,w):S());c=_.document,o.push(..._.signals),s.push(_.operation)}catch(w){l=w instanceof Nr?w:new Nr("ERROR",b,w.message,w.cause);break}}}return{document:c,operationsApplied:s,signals:o,error:l}}async _addDocumentResultingStage(e,n,r,i){var a,c,l,u;const s=(i==null?void 0:i.revisions)!==void 0?cI(e.operations,i.revisions):e.operations,o=Gt.documentHelpers.garbageCollectDocumentOperations(s);for(const d of Object.keys(o)){const f=o[d].at(-1);f&&!f.resultingState&&(f.resultingState=await(r?(c=(a=this.storage).getOperationResultingState)==null?void 0:c.call(a,n,r,f.index,f.scope,"main"):(u=(l=this.storage).getDriveOperationResultingState)==null?void 0:u.call(l,n,f.index,f.scope,"main")))}return{...e,operations:o}}_buildDocument(e,n){if(e.state&&(!n||n.checkHashes===!1)&&Wv(e,n==null?void 0:n.revisions))return e;const r=this.getDocumentModel(e.documentType),i=(n==null?void 0:n.revisions)!==void 0?cI(e.operations,n.revisions):e.operations,s=Gt.documentHelpers.garbageCollectDocumentOperations(i);return Gt.replayDocument(e.initialState,s,r.reducer,void 0,e,void 0,{...n,checkHashes:(n==null?void 0:n.checkHashes)??!0,reuseOperationResultingState:(n==null?void 0:n.checkHashes)??!0})}async _performOperation(e,n,r,i,s=!1){var h,g,y,v;const o=this.getDocumentModel(r.documentType),a=[];let c=r;const l=i.scope,d=Gt.documentHelpers.garbageCollectDocumentOperations({...r.operations,[l]:Gt.documentHelpers.skipHeaderOperations(r.operations[l],i)})[l].at(-1);d&&!d.resultingState&&(d.resultingState=await(n?(g=(h=this.storage).getOperationResultingState)==null?void 0:g.call(h,e,n,d.index,d.scope,"main"):(v=(y=this.storage).getDriveOperationResultingState)==null?void 0:v.call(y,e,d.index,d.scope,"main")));const f=[];c=o.reducer(c,i,b=>{let E;switch(b.type){case"CREATE_CHILD_DOCUMENT":E=()=>this.createDocument(e,b.input);break;case"DELETE_CHILD_DOCUMENT":E=()=>this.deleteDocument(e,b.input.id);break;case"COPY_CHILD_DOCUMENT":E=()=>this.getDocument(e,b.input.id).then(w=>this.createDocument(e,{id:b.input.newId,documentType:w.documentType,document:w,synchronizationUnits:b.input.synchronizationUnits}));break}E&&f.push(()=>E().then(w=>({signal:b,result:w})))},{skip:i.skip,reuseOperationResultingState:!0});const m=c.operations[i.scope].filter(b=>b.index==i.index&&b.skip==i.skip).at(0);if(!m)throw new Nr("ERROR",i,`Operation with index ${i.index}:${i.skip} was not applied.`);if(!m.error&&m.hash!==i.hash&&!s)throw new mQ(i,m);for(const b of f){const E=await b();a.push(E)}return{document:c,signals:a,operation:m}}addOperation(e,n,r,i){return this.addOperations(e,n,[r],i)}async _addOperations(e,n,r){if(this.storage.addDocumentOperationsWithTransaction)await this.storage.addDocumentOperationsWithTransaction(e,n,r);else{const i=await this.storage.getDocument(e,n),s=await r(i);s.operations.length>0&&await this.storage.addDocumentOperations(e,n,s.operations,s.header)}}queueOperation(e,n,r,i){return this.queueOperations(e,n,[r],i)}async resultIfExistingOperations(e,n,r){try{const i=await this.getDocument(e,n);return r.find(o=>!o.id||!i.operations[o.scope].find(a=>a.id===o.id&&a.index===o.index&&a.type===o.type&&a.hash===o.hash))?void 0:{status:"SUCCESS",document:i,operations:r,signals:[]}}catch(i){i.message.includes(`Document with id ${n} not found`)||console.error(i);return}}async queueOperations(e,n,r,i){const s=await this.resultIfExistingOperations(e,n,r);if(s)return s;try{const o=await this.queueManager.addJob({driveId:e,documentId:n,operations:r,options:i});return new Promise((a,c)=>{const l=this.queueManager.on("jobCompleted",(d,f)=>{d.jobId===o&&(l(),u(),a(f))}),u=this.queueManager.on("jobFailed",(d,f)=>{d.jobId===o&&(l(),u(),c(f))})})}catch(o){throw Tt.error("Error adding job",o),o}}async queueAction(e,n,r,i){return this.queueActions(e,n,[r],i)}async queueActions(e,n,r,i){try{const s=await this.queueManager.addJob({driveId:e,documentId:n,actions:r,options:i});return new Promise((o,a)=>{const c=this.queueManager.on("jobCompleted",(u,d)=>{u.jobId===s&&(c(),l(),o(d))}),l=this.queueManager.on("jobFailed",(u,d)=>{u.jobId===s&&(c(),l(),a(d))})})}catch(s){throw Tt.error("Error adding job",s),s}}async queueDriveAction(e,n,r){return this.queueDriveActions(e,[n],r)}async queueDriveActions(e,n,r){try{const i=await this.queueManager.addJob({driveId:e,actions:n,options:r});return new Promise((s,o)=>{const a=this.queueManager.on("jobCompleted",(l,u)=>{l.jobId===i&&(a(),c(),s(u))}),c=this.queueManager.on("jobFailed",(l,u)=>{l.jobId===i&&(a(),c(),o(u))})})}catch(i){throw Tt.error("Error adding drive job",i),i}}async addOperations(e,n,r,i){const s=await this.resultIfExistingOperations(e,n,r);if(s)return s;let o;const a=[],c=[];let l;try{await this._addOperations(e,n,async g=>{const y=await this._processOperations(e,n,g,r);if(!y.document)throw Tt.error("Invalid document"),y.error??new Error("Invalid document");return o=y.document,l=y.error,c.push(...y.signals),a.push(...y.operationsApplied),{operations:y.operationsApplied,header:y.document,newState:o.state}}),o&&this.cache.setDocument(e,n,o).catch(Tt.error);const{scopes:u,branches:d}=a.reduce((g,y)=>(g.scopes.includes(y.scope)||g.scopes.push(y.scope),g),{scopes:[],branches:["main"]}),f=await this.getSynchronizationUnits(e,[n],u,d),m=a.find(g=>!r.find(y=>y.id===g.id&&y.index===g.index&&y.skip===g.skip&&y.hash===g.hash))?{type:"local"}:(i==null?void 0:i.source)??{type:"local"},h=this.getOperationSource(m);if(this.listenerManager.updateSynchronizationRevisions(e,f,m,()=>{this.updateSyncUnitStatus(e,{[h]:"SYNCING"});for(const g of f)this.updateSyncUnitStatus(g.syncId,{[h]:"SYNCING"})},this.handleListenerError.bind(this),(i==null?void 0:i.forceSync)??m.type==="local").then(g=>{g.length&&this.updateSyncUnitStatus(e,{[h]:"SUCCESS"});for(const y of f)this.updateSyncUnitStatus(y.syncId,{[h]:"SUCCESS"})}).catch(g=>{Tt.error("Non handled error updating sync revision",g),this.updateSyncUnitStatus(e,{[h]:"ERROR"},g);for(const y of f)this.updateSyncUnitStatus(y.syncId,{[h]:"ERROR"},g)}),l)throw l;return{status:"SUCCESS",document:o,operations:a,signals:c}}catch(u){const d=u instanceof Nr?u:new Nr("ERROR",void 0,u.message,u.cause);return{status:d.status,error:d,document:o,operations:a,signals:c}}}addDriveOperation(e,n,r){return this.addDriveOperations(e,[n],r)}async clearStorage(){var e,n;for(const r of await this.getDrives())await this.deleteDrive(r);await((n=(e=this.storage).clearStorage)==null?void 0:n.call(e))}async _addDriveOperations(e,n){if(this.storage.addDriveOperationsWithTransaction)return this.storage.addDriveOperationsWithTransaction(e,n);{const r=await this.storage.getDrive(e),i=await n(r);return i.operations.length>0&&await this.storage.addDriveOperations(e,i.operations,i.header),i}}queueDriveOperation(e,n,r){return this.queueDriveOperations(e,[n],r)}async resultIfExistingDriveOperations(e,n){try{const r=await this.getDrive(e);return n.find(s=>!s.id||!r.operations[s.scope].find(o=>o.id===s.id&&o.index===s.index&&o.type===s.type&&o.hash===s.hash))?void 0:{status:"SUCCESS",document:r,operations:n,signals:[]}}catch(r){console.error(r);return}}async queueDriveOperations(e,n,r){const i=await this.resultIfExistingDriveOperations(e,n);if(i)return i;try{const s=await this.queueManager.addJob({driveId:e,operations:n,options:r});return new Promise((o,a)=>{const c=this.queueManager.on("jobCompleted",(u,d)=>{u.jobId===s&&(c(),l(),o(d))}),l=this.queueManager.on("jobFailed",(u,d)=>{u.jobId===s&&(c(),l(),a(d))})})}catch(s){throw Tt.error("Error adding drive job",s),s}}async addDriveOperations(e,n,r){var l,u,d,f;let i;const s=[],o=[];let a;const c=await this.resultIfExistingDriveOperations(e,n);if(c)return c;try{if(await this._addDriveOperations(e,async m=>{const h=await this._processOperations(e,void 0,m,n.slice());return i=h.document,s.push(...h.operationsApplied),o.push(...h.signals),a=h.error,{operations:h.operationsApplied,header:h.document}}),!i||!Ra(i))throw a??new Error("Invalid Document Drive document");this.cache.setDocument("drives",e,i).catch(Tt.error);for(const m of s)switch(m.type){case"ADD_LISTENER":{const h=m.input.listener,g=this.transmitterFactory.instance(((l=h.callInfo)==null?void 0:l.transmitterType)??"",h,this),y={...h,driveId:e,label:h.label??"",system:h.system??!1,filter:{branch:h.filter.branch??[],documentId:h.filter.documentId??[],documentType:h.filter.documentType??[],scope:h.filter.scope??[]},callInfo:{data:((u=h.callInfo)==null?void 0:u.data)??"",name:((d=h.callInfo)==null?void 0:d.name)??"PullResponder",transmitterType:((f=h.callInfo)==null?void 0:f.transmitterType)??"PullResponder"},transmitter:g};await this.addListener(e,y);break}case"REMOVE_LISTENER":{await this.removeListener(e,m);break}}const p=s.filter(m=>m.scope==="global").slice().pop();if(p){const h=s.find(y=>!n.find(v=>v.id===y.id&&v.index===y.index&&v.skip===y.skip&&v.hash===y.hash))?{type:"local"}:(r==null?void 0:r.source)??{type:"local"},g=this.getOperationSource(h);this.listenerManager.updateSynchronizationRevisions(e,[{syncId:"0",driveId:e,documentId:"",scope:"global",branch:"main",documentType:"powerhouse/document-drive",lastUpdated:p.timestamp,revision:p.index}],h,()=>{this.updateSyncUnitStatus(e,{[g]:"SYNCING"})},this.handleListenerError.bind(this),(r==null?void 0:r.forceSync)??h.type==="local").then(y=>{y.length&&this.updateSyncUnitStatus(e,{[g]:"SUCCESS"})}).catch(y=>{Tt.error("Non handled error updating sync revision",y),this.updateSyncUnitStatus(e,{[g]:"ERROR"},y)})}if(this.shouldSyncRemoteDrive(i)?this.startSyncRemoteDrive(i.state.global.id):this.stopSyncRemoteDrive(i.state.global.id),a)throw a;return{status:"SUCCESS",document:i,operations:s,signals:o}}catch(p){const m=p instanceof Nr?p:new Nr("ERROR",void 0,p.message,p.cause);return{status:m.status,error:m,document:i,operations:s,signals:o}}}_buildOperations(e,n){const r=[],{reducer:i}=this.getDocumentModel(e.documentType);for(const s of n){e=i(e,s);const o=e.operations[s.scope].slice().pop();if(!o)throw new Error("Error creating operations");r.push(o)}return r}async addAction(e,n,r,i){return this.addActions(e,n,[r],i)}async addActions(e,n,r,i){const s=await this.getDocument(e,n),o=this._buildOperations(s,r);return this.addOperations(e,n,o,i)}async addDriveAction(e,n,r){return this.addDriveActions(e,[n],r)}async addDriveActions(e,n,r){const i=await this.getDrive(e),s=this._buildOperations(i,n);return await this.addDriveOperations(e,s,r)}async detachDrive(e){const n=await this.getDrive(e),r=n.state.local.listeners||[],i=n.state.local.triggers||[];for(const s of r)await this.addDriveAction(e,rr.removeListener({listenerId:s.listenerId}));for(const s of i)await this.addDriveAction(e,rr.removeTrigger({triggerId:s.id}));await this.addDriveAction(e,rr.setSharingType({type:"LOCAL"}))}async addListener(e,n){await this.listenerManager.setListener(e,n)}async addInternalListener(e,n,r){const i={callInfo:{data:"",name:"Interal",transmitterType:"Internal"},system:!0,...r};await this.addDriveAction(e,rr.addListener({listener:i}));const s=await this.getTransmitter(e,r.listenerId);if(!s)throw Tt.error("Internal listener not found"),new Error("Internal listener not found");if(!(s instanceof XP))throw Tt.error("Listener is not an internal transmitter"),new Error("Listener is not an internal transmitter");return s.setReceiver(n),s}async removeListener(e,n){const{listenerId:r}=n.input;await this.listenerManager.removeListener(e,r)}async getTransmitter(e,n){const r=await this.listenerManager.getListenerState(e,n);return r==null?void 0:r.listener.transmitter}getListener(e,n){let r;try{r=this.listenerManager.getListenerState(e,n)}catch{return Promise.resolve(void 0)}return Promise.resolve(r)}getSyncStatus(e){const n=this.syncStatus.get(e);return n?this.getCombinedSyncUnitStatus(n):new YP(`Sync status not found for syncUnitId: ${e}`,e)}on(e,n){return this.emitter.on(e,n)}emit(e,...n){return this.emitter.emit(e,...n)}}const QQ=xQ(XQ),eM=Object.prototype.toString;function Tl(t){switch(eM.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return uo(t,Error)}}function Tu(t,e){return eM.call(t)===`[object ${e}]`}function FS(t){return Tu(t,"ErrorEvent")}function lI(t){return Tu(t,"DOMError")}function eee(t){return Tu(t,"DOMException")}function Es(t){return Tu(t,"String")}function $S(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function jS(t){return t===null||$S(t)||typeof t!="object"&&typeof t!="function"}function bc(t){return Tu(t,"Object")}function vy(t){return typeof Event<"u"&&uo(t,Event)}function tee(t){return typeof Element<"u"&&uo(t,Element)}function nee(t){return Tu(t,"RegExp")}function by(t){return!!(t&&t.then&&typeof t.then=="function")}function ree(t){return bc(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function tM(t){return typeof t=="number"&&t!==t}function uo(t,e){try{return t instanceof e}catch{return!1}}function nM(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Il(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Qm(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{nM(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function iee(t,e,n=!1){return Es(t)?nee(e)?e.test(t):Es(e)?n?t===e:t.includes(e):!1:!1}function Iu(t,e=[],n=!1){return e.some(r=>iee(t,r,n))}function see(t,e,n=250,r,i,s,o){if(!s.exception||!s.exception.values||!o||!uo(o.originalException,Error))return;const a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;a&&(s.exception.values=oee(R_(t,e,i,o.originalException,r,s.exception.values,a,0),n))}function R_(t,e,n,r,i,s,o,a){if(s.length>=n+1)return s;let c=[...s];if(uo(r[i],Error)){uI(o,a);const l=t(e,r[i]),u=c.length;dI(l,i,u,a),c=R_(t,e,n,r[i],i,[l,...c],l,u)}return Array.isArray(r.errors)&&r.errors.forEach((l,u)=>{if(uo(l,Error)){uI(o,a);const d=t(e,l),f=c.length;dI(d,`errors[${u}]`,f,a),c=R_(t,e,n,l,i,[d,...c],d,f)}}),c}function uI(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function dI(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function oee(t,e){return t.map(n=>(n.value&&(n.value=Il(n.value,e)),n))}function dh(t){return t&&t.Math==Math?t:void 0}const $t=typeof globalThis=="object"&&dh(globalThis)||typeof window=="object"&&dh(window)||typeof self=="object"&&dh(self)||typeof global=="object"&&dh(global)||function(){return this}()||{};function US(){return $t}function rM(t,e,n){const r=n||$t,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const Ol=US(),aee=80;function ca(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,o=0;const a=" > ",c=a.length;let l;const u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||aee;for(;n&&s++<r&&(l=cee(n,u),!(l==="html"||s>1&&o+i.length*c+l.length>=d));)i.push(l),o+=l.length,n=n.parentNode;return i.reverse().join(a)}catch{return"<unknown>"}}function cee(t,e){const n=t,r=[];let i,s,o,a,c;if(!n||!n.tagName)return"";if(Ol.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const l=e&&e.length?e.filter(d=>n.getAttribute(d)).map(d=>[d,n.getAttribute(d)]):null;if(l&&l.length)l.forEach(d=>{r.push(`[${d[0]}="${d[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Es(i))for(s=i.split(/\s+/),c=0;c<s.length;c++)r.push(`.${s[c]}`);const u=["aria-label","type","name","title","alt"];for(c=0;c<u.length;c++)o=u[c],a=n.getAttribute(o),a&&r.push(`[${o}="${a}"]`);return r.join("")}function lee(){try{return Ol.document.location.href}catch{return""}}function uee(t){return Ol.document&&Ol.document.querySelector?Ol.document.querySelector(t):null}function iM(t){if(!Ol.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement&&e.dataset.sentryComponent)return e.dataset.sentryComponent;e=e.parentNode}return null}const Ou=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,dee="Sentry Logger ",eg=["debug","info","warn","error","log","assert","trace"],tg={};function _c(t){if(!("console"in $t))return t();const e=$t.console,n={},r=Object.keys(tg);r.forEach(i=>{const s=tg[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function fee(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Ou?eg.forEach(n=>{e[n]=(...r)=>{t&&_c(()=>{$t.console[n](`${dee}[${n}]:`,...r)})}}):eg.forEach(n=>{e[n]=()=>{}}),e}const ye=fee(),pee=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function hee(t){return t==="http"||t==="https"}function Cu(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function mee(t){const e=pee.exec(t);if(!e){_c(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,i="",s,o="",a]=e.slice(1);let c="",l=a;const u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){const d=l.match(/^\d+/);d&&(l=d[0])}return sM({host:s,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function sM(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function gee(t){if(!Ou)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(ye.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?hee(r)?e&&isNaN(parseInt(e,10))?(ye.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(ye.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(ye.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function yee(t){const e=typeof t=="string"?mee(t):sM(t);if(!(!e||!gee(e)))return e}class fs extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function Kn(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&oM(i,r),t[e]=i}function la(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Ou&&ye.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function oM(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,la(t,"__sentry_original__",e)}catch{}}function BS(t){return t.__sentry_original__}function vee(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function aM(t){if(Tl(t))return{message:t.message,name:t.name,stack:t.stack,...pI(t)};if(vy(t)){const e={type:t.type,target:fI(t.target),currentTarget:fI(t.currentTarget),...pI(t)};return typeof CustomEvent<"u"&&uo(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function fI(t){try{return tee(t)?ca(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function pI(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function bee(t,e=40){const n=Object.keys(aM(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Il(n[0],e);for(let r=n.length;r>0;r--){const i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:Il(i,e)}return""}function xr(t){return D_(t,new Map)}function D_(t,e){if(_ee(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))typeof t[i]<"u"&&(r[i]=D_(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(D_(i,e))}),r}return t}function _ee(t){if(!bc(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const cM=50,hI=/\(error: (.*)\)/,mI=/captureMessage|captureException/;function lM(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{const i=[],s=n.split(`
399
+ `);for(let o=r;o<s.length;o++){const a=s[o];if(a.length>1024)continue;const c=hI.test(a)?a.replace(hI,"$1"):a;if(!c.match(/\S*Error: /)){for(const l of e){const u=l(c);if(u){i.push(u);break}}if(i.length>=cM)break}}return Eee(i)}}function wee(t){return Array.isArray(t)?lM(...t):t}function Eee(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),mI.test(e[e.length-1].function||"")&&(e.pop(),mI.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,cM).map(n=>({...n,filename:n.filename||e[e.length-1].filename,function:n.function||"?"}))}const qv="<anonymous>";function fo(t){try{return!t||typeof t!="function"?qv:t.name||qv}catch{return qv}}const Kh={},gI={};function Pc(t,e){Kh[t]=Kh[t]||[],Kh[t].push(e)}function Mc(t,e){gI[t]||(e(),gI[t]=!0)}function Bi(t,e){const n=t&&Kh[t];if(n)for(const r of n)try{r(e)}catch(i){Ou&&ye.error(`Error while triggering instrumentation handler.
400
+ Type: ${t}
401
+ Name: ${fo(r)}
402
+ Error:`,i)}}function uM(t){const e="console";Pc(e,t),Mc(e,See)}function See(){"console"in $t&&eg.forEach(function(t){t in $t.console&&Kn($t.console,t,function(e){return tg[t]=e,function(...n){Bi("console",{args:n,level:t});const i=tg[t];i&&i.apply($t.console,n)}})})}function Rn(){const t=$t,e=t.crypto||t.msCrypto;let n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function dM(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Mo(t){const{message:e,event_id:n}=t;if(e)return e;const r=dM(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function k_(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function wc(t,e){const n=dM(t);if(!n)return;const r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...e},e&&"data"in e){const s={...i&&i.data,...e.data};n.mechanism.data=s}}function yI(t){if(t&&t.__sentry_captured__)return!0;try{la(t,"__sentry_captured__",!0)}catch{}return!1}function fM(t){return Array.isArray(t)?t:[t]}const sl=$t,xee=1e3;let vI,A_,N_;function pM(t){const e="dom";Pc(e,t),Mc(e,Tee)}function Tee(){if(!sl.document)return;const t=Bi.bind(null,"dom"),e=bI(t,!0);sl.document.addEventListener("click",e,!1),sl.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=sl[n]&&sl[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Kn(r,"addEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},u=l[s]=l[s]||{refCount:0};if(!u.handler){const d=bI(t);u.handler=d,i.call(this,s,d,a)}u.refCount++}catch{}return i.call(this,s,o,a)}}),Kn(r,"removeEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this,l=c.__sentry_instrumentation_handlers__||{},u=l[s];u&&(u.refCount--,u.refCount<=0&&(i.call(this,s,u.handler,a),u.handler=void 0,delete l[s]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,a)}}))})}function Iee(t){if(t.type!==A_)return!1;try{if(!t.target||t.target._sentryId!==N_)return!1}catch{}return!0}function Oee(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function bI(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Cee(n);if(Oee(n.type,r))return;la(n,"_sentryCaptured",!0),r&&!r._sentryId&&la(r,"_sentryId",Rn());const i=n.type==="keypress"?"input":n.type;Iee(n)||(t({event:n,name:i,global:e}),A_=n.type,N_=r?r._sentryId:void 0),clearTimeout(vI),vI=sl.setTimeout(()=>{N_=void 0,A_=void 0},xee)}}function Cee(t){try{return t.target}catch{return null}}const P_=US();function hM(){if(!("fetch"in P_))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function M_(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function mM(){if(typeof EdgeRuntime=="string")return!0;if(!hM())return!1;if(M_(P_.fetch))return!0;let t=!1;const e=P_.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=M_(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){Ou&&ye.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function _y(t){const e="fetch";Pc(e,t),Mc(e,Ree)}function Ree(){mM()&&Kn($t,"fetch",function(t){return function(...e){const{method:n,url:r}=Dee(e),i={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Bi("fetch",{...i}),t.apply($t,e).then(s=>{const o={...i,endTimestamp:Date.now(),response:s};return Bi("fetch",o),s},s=>{const o={...i,endTimestamp:Date.now(),error:s};throw Bi("fetch",o),s})}})}function L_(t,e){return!!t&&typeof t=="object"&&!!t[e]}function _I(t){return typeof t=="string"?t:t?L_(t,"url")?t.url:t.toString?t.toString():"":""}function Dee(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:_I(n),method:L_(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:_I(e),method:L_(e,"method")?String(e.method).toUpperCase():"GET"}}let fh=null;function gM(t){const e="error";Pc(e,t),Mc(e,kee)}function kee(){fh=$t.onerror,$t.onerror=function(t,e,n,r,i){return Bi("error",{column:r,error:i,line:n,msg:t,url:e}),fh&&!fh.__SENTRY_LOADER__?fh.apply(this,arguments):!1},$t.onerror.__SENTRY_INSTRUMENTED__=!0}let ph=null;function yM(t){const e="unhandledrejection";Pc(e,t),Mc(e,Aee)}function Aee(){ph=$t.onunhandledrejection,$t.onunhandledrejection=function(t){return Bi("unhandledrejection",t),ph&&!ph.__SENTRY_LOADER__?ph.apply(this,arguments):!0},$t.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const hh=US();function Nee(){const t=hh.chrome,e=t&&t.app&&t.app.runtime,n="history"in hh&&!!hh.history.pushState&&!!hh.history.replaceState;return!e&&n}const qu=$t;let mh;function wy(t){const e="history";Pc(e,t),Mc(e,Pee)}function Pee(){if(!Nee())return;const t=qu.onpopstate;qu.onpopstate=function(...n){const r=qu.location.href,i=mh;if(mh=r,Bi("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=mh,o=String(i);mh=o,Bi("history",{from:s,to:o})}return n.apply(this,r)}}Kn(qu.history,"pushState",e),Kn(qu.history,"replaceState",e)}const Mee=$t,Ys="__sentry_xhr_v3__";function Ey(t){const e="xhr";Pc(e,t),Mc(e,Lee)}function Lee(){if(!Mee.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;Kn(t,"open",function(e){return function(...n){const r=Date.now(),i=Es(n[0])?n[0].toUpperCase():void 0,s=Fee(n[1]);if(!i||!s)return e.apply(this,n);this[Ys]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const a=this[Ys];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}const c={args:[i,s],endTimestamp:Date.now(),startTimestamp:r,xhr:this};Bi("xhr",c)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Kn(this,"onreadystatechange",function(a){return function(...c){return o(),a.apply(this,c)}}):this.addEventListener("readystatechange",o),Kn(this,"setRequestHeader",function(a){return function(...c){const[l,u]=c,d=this[Ys];return d&&Es(l)&&Es(u)&&(d.request_headers[l.toLowerCase()]=u),a.apply(this,c)}}),e.apply(this,n)}}),Kn(t,"send",function(e){return function(...n){const r=this[Ys];if(!r)return e.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const i={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return Bi("xhr",i),e.apply(this,n)}})}function Fee(t){if(Es(t))return t;try{return t.toString()}catch{}}function $ee(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function jee(){return"npm"}function Uee(){return!$ee()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function wI(){return typeof window<"u"&&(!Uee()||Bee())}function Bee(){return $t.process!==void 0&&$t.process.type==="renderer"}function zee(){const t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let s=0;s<e.length;s++)if(e[s]===i)return!0;return e.push(i),!1}function r(i){if(t)e.delete(i);else for(let s=0;s<e.length;s++)if(e[s]===i){e.splice(s,1);break}}return[n,r]}function ki(t,e=100,n=1/0){try{return F_("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function vM(t,e=3,n=100*1024){const r=ki(t,e);return qee(r)>n?vM(t,e-1,n):r}function F_(t,e,n=1/0,r=1/0,i=zee()){const[s,o]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&!tM(e))return e;const a=Vee(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(e))return"[Circular ~]";const l=e;if(l&&typeof l.toJSON=="function")try{const p=l.toJSON();return F_("",p,c-1,r,i)}catch{}const u=Array.isArray(e)?[]:{};let d=0;const f=aM(e);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(d>=r){u[p]="[MaxProperties ~]";break}const m=f[p];u[p]=F_(p,m,c-1,r,i),d++}return o(e),u}function Vee(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(nM(e))return"[VueViewModel]";if(ree(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${fo(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=Hee(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Hee(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function Wee(t){return~-encodeURI(t).split(/%..|./).length}function qee(t){return Wee(JSON.stringify(t))}var zs;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(zs||(zs={}));function ru(t){return new Zr(e=>{e(t)})}function zS(t){return new Zr((e,n)=>{n(t)})}class Zr{constructor(e){Zr.prototype.__init.call(this),Zr.prototype.__init2.call(this),Zr.prototype.__init3.call(this),Zr.prototype.__init4.call(this),this._state=zs.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new Zr((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Zr((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(zs.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(zs.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===zs.PENDING){if(by(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===zs.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===zs.RESOLVED&&n[1](this._value),this._state===zs.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Gee(t){const e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function i(o){if(!n())return zS(new fs("Not adding Promise because buffer limit was reached."));const a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function s(o){return new Zr((a,c)=>{let l=e.length;if(!l)return a(!0);const u=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(d=>{ru(d).then(()=>{--l||(clearTimeout(u),a(!0))},c)})})}return{$:e,add:i,drain:s}}function Xa(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const Zee=["fatal","error","warning","log","info","debug"];function bM(t){return t==="warn"?"warning":Zee.includes(t)?t:"log"}const _M=1e3;function vp(){return Date.now()/_M}function Yee(){const{performance:t}=$t;if(!t||!t.now)return vp;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/_M}const bp=Yee(),ni=(()=>{const{performance:t}=$t;if(!t||!t.now)return;const e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,o=t.timing&&t.timing.navigationStart,c=typeof o=="number"?Math.abs(o+n-r):e,l=c<e;return s||l?i<=c?t.timeOrigin:o:r})(),$_="baggage",wM="sentry-",Kee=/^sentry-/,Jee=8192;function Xee(t){if(!Es(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,i)=>{const s=EI(i);for(const o of Object.keys(s))r[o]=s[o];return r},{});else{if(!t)return;e=EI(t)}const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(Kee)){const o=i.slice(wM.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function EM(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,i])=>(i&&(n[`${wM}${r}`]=i),n),{});return Qee(e)}function EI(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function Qee(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],i)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=i===0?s:`${e},${s}`;return o.length>Jee?(Ou&&ye.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const ete=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function tte(t){if(!t)return;const e=t.match(ete);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function nte(t,e){const n=tte(t),r=Xee(e),{traceId:i,parentSpanId:s,parentSampled:o}=n||{};return n?{traceId:i||Rn(),parentSpanId:s||Rn().substring(16),spanId:Rn().substring(16),sampled:o,dsc:r||{}}:{traceId:i||Rn(),spanId:Rn().substring(16)}}function VS(t=Rn(),e=Rn().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function va(t,e=[]){return[t,e]}function rte(t,e){const[n,r]=t;return[n,[...r,e]]}function SI(t,e){const n=t[1];for(const r of n){const i=r[0].type;if(e(r,i))return!0}return!1}function j_(t,e){return(e||new TextEncoder).encode(t)}function ite(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(o){typeof i=="string"?i=typeof o=="string"?i+o:[j_(i,e),o]:i.push(typeof o=="string"?j_(o,e):o)}for(const o of r){const[a,c]=o;if(s(`
403
+ ${JSON.stringify(a)}
404
+ `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(ki(c))}s(l)}}return typeof i=="string"?i:ste(i)}function ste(t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function ote(t,e){const n=typeof t.data=="string"?j_(t.data,e):t.data;return[xr({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const ate={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function xI(t){return ate[t]}function HS(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function SM(t,e,n,r){const i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:Cu(r)},...i&&{trace:xr({...i})}}}function cte(t,e,n){const r=[{type:"client_report"},{timestamp:vp(),discarded_events:t}];return va(e?{dsn:e}:{},[r])}const lte=60*1e3;function ute(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?lte:r-e}function dte(t,e){return t[e]||t.all||0}function xM(t,e,n=Date.now()){return dte(t,e)>n}function TM(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,l,,,u]=a.split(":",5),d=parseInt(c,10),f=(isNaN(d)?60:d)*1e3;if(!l)i.all=r+f;else for(const p of l.split(";"))p==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(i[p]=r+f):i[p]=r+f}else o?i.all=r+ute(o,r):e===429&&(i.all=r+60*1e3);return i}function fte(t,e){return t??e()}function Gv(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const ot=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Sy="production";function WS(){return rM("globalEventProcessors",()=>[])}function pte(t){WS().push(t)}function ng(t,e,n,r=0){return new Zr((i,s)=>{const o=t[r];if(e===null||typeof o!="function")i(e);else{const a=o({...e},n);ot&&o.id&&a===null&&ye.log(`Event processor "${o.id}" dropped event`),by(a)?a.then(c=>ng(t,c,n,r+1).then(i)).then(null,s):ng(t,a,n,r+1).then(i).then(null,s)}})}function IM(t){const e=bp(),n={sid:Rn(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>hte(n)};return t&&Ec(n,t),n}function Ec(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||bp(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Rn()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function OM(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),Ec(t,n)}function hte(t){return xr({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}const mte=0,CM=1;function qS(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:i,parent_span_id:s,status:o,tags:a,origin:c}=Fn(t);return xr({data:r,op:i,parent_span_id:s,span_id:e,status:o,tags:a,trace_id:n,origin:c})}function xy(t){const{traceId:e,spanId:n}=t.spanContext(),r=GS(t);return VS(e,n,r)}function Ty(t){return typeof t=="number"?TI(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?TI(t.getTime()):bp()}function TI(t){return t>9999999999?t/1e3:t}function Fn(t){return gte(t)?t.getSpanJSON():typeof t.toJSON=="function"?t.toJSON():{}}function gte(t){return typeof t.getSpanJSON=="function"}function GS(t){const{traceFlags:e}=t.spanContext();return!!(e&CM)}function RM(t,e,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||Rn(),timestamp:e.timestamp||vp()},l=n.integrations||t.integrations.map(g=>g.name);yte(c,t),_te(c,l),e.type===void 0&&vte(c,t.stackParser);const u=Ete(r,n.captureContext);n.mechanism&&wc(c,n.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],f=Mte().getScopeData();if(s){const g=s.getScopeData();DI(f,g)}if(u){const g=u.getScopeData();DI(f,g)}const p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),NM(c,f);const m=[...d,...WS(),...f.eventProcessors];return ng(m,c,n).then(g=>(g&&bte(g),typeof o=="number"&&o>0?wte(g,o,a):g))}function yte(t,e){const{environment:n,release:r,dist:i,maxValueLength:s=250}=e;"environment"in t||(t.environment="environment"in e?n:Sy),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&i!==void 0&&(t.dist=i),t.message&&(t.message=Il(t.message,s));const o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=Il(o.value,s));const a=t.request;a&&a.url&&(a.url=Il(a.url,s))}const II=new WeakMap;function vte(t,e){const n=$t._sentryDebugIds;if(!n)return;let r;const i=II.get(e);i?r=i:(r=new Map,II.set(e,r));const s=Object.keys(n).reduce((o,a)=>{let c;const l=r.get(a);l?c=l:(c=e(a),r.set(a,c));for(let u=c.length-1;u>=0;u--){const d=c[u];if(d.filename){o[d.filename]=n[a];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=s[a.filename])})})}catch{}}function bte(t){const e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function _te(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function wte(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:ki(i.data,e,n)}}))},...t.user&&{user:ki(t.user,e,n)},...t.contexts&&{contexts:ki(t.contexts,e,n)},...t.extra&&{extra:ki(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=ki(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>{const s=Fn(i).data;return s&&(i.data=ki(s,e,n)),i})),r}function Ete(t,e){if(!e)return t;const n=t?t.clone():new eo;return n.update(e),n}function Ste(t){if(t)return xte(t)?{captureContext:t}:Ite(t)?{captureContext:t}:t}function xte(t){return t instanceof eo||typeof t=="function"}const Tte=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function Ite(t){return Object.keys(t).some(e=>Tte.includes(e))}function _p(t,e){return or().captureException(t,Ste(e))}function OI(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return or().captureMessage(t,n,r)}function Iy(t,e){return or().captureEvent(t,e)}function ua(t,e){or().addBreadcrumb(t,e)}function Ote(t,e){or().setContext(t,e)}function Cte(t){or().setUser(t)}function DM(...t){const e=or();if(t.length===2){const[n,r]=t;return n?e.withScope(()=>(e.getStackTop().scope=n,r(n))):e.withScope(r)}return e.withScope(t[0])}function Ut(){return or().getClient()}function si(){return or().getScope()}function CI(t){const e=Ut(),n=ba(),r=si(),{release:i,environment:s=Sy}=e&&e.getOptions()||{},{userAgent:o}=$t.navigator||{},a=IM({release:i,environment:s,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...t}),c=n.getSession();return c&&c.status==="ok"&&Ec(c,{status:"exited"}),kM(),n.setSession(a),r.setSession(a),a}function kM(){const t=ba(),e=si(),n=e.getSession()||t.getSession();n&&OM(n),AM(),t.setSession(),e.setSession()}function AM(){const t=ba(),e=si(),n=Ut(),r=e.getSession()||t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function RI(t=!1){if(t){kM();return}AM()}function rg(t){return t.transaction}function Oy(t,e,n){const r=e.getOptions(),{publicKey:i}=e.getDsn()||{},{segment:s}=n&&n.getUser()||{},o=xr({environment:r.environment||Sy,release:r.release,user_segment:s,public_key:i,trace_id:t});return e.emit&&e.emit("createDsc",o),o}function iu(t){const e=Ut();if(!e)return{};const n=Oy(Fn(t).trace_id||"",e,si()),r=rg(t);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:s,source:o}=r.metadata;s!=null&&(n.sample_rate=`${s}`);const a=Fn(r);return o&&o!=="url"&&(n.transaction=a.description),n.sampled=String(GS(r)),e.emit&&e.emit("createDsc",n),n}function NM(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;Rte(t,e),r&&Ate(t,r),Nte(t,n),Dte(t,i),kte(t,s)}function DI(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:l,eventProcessors:u,attachments:d,propagationContext:f,transactionName:p,span:m}=e;Gu(t,"extra",n),Gu(t,"tags",r),Gu(t,"user",i),Gu(t,"contexts",s),Gu(t,"sdkProcessingMetadata",a),o&&(t.level=o),p&&(t.transactionName=p),m&&(t.span=m),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),l.length&&(t.fingerprint=[...t.fingerprint,...l]),u.length&&(t.eventProcessors=[...t.eventProcessors,...u]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...f}}function Gu(t,e,n){if(n&&Object.keys(n).length){t[e]={...t[e]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[e][r]=n[r])}}function Rte(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=e,c=xr(n);c&&Object.keys(c).length&&(t.extra={...c,...t.extra});const l=xr(r);l&&Object.keys(l).length&&(t.tags={...l,...t.tags});const u=xr(i);u&&Object.keys(u).length&&(t.user={...u,...t.user});const d=xr(s);d&&Object.keys(d).length&&(t.contexts={...d,...t.contexts}),o&&(t.level=o),a&&(t.transaction=a)}function Dte(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function kte(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function Ate(t,e){t.contexts={trace:qS(e),...t.contexts};const n=rg(e);if(n){t.sdkProcessingMetadata={dynamicSamplingContext:iu(e),...t.sdkProcessingMetadata};const r=Fn(n).description;r&&(t.tags={transaction:r,...t.tags})}}function Nte(t,e){t.fingerprint=t.fingerprint?fM(t.fingerprint):[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}const Pte=100;let Zv;class eo{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=kI()}static clone(e){return e?e.clone():new eo}clone(){const e=new eo;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Ec(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e;if(n instanceof eo){const r=n.getScopeData();this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&Object.keys(r.user).length&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint.length&&(this._fingerprint=r.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),r.propagationContext&&(this._propagationContext=r.propagationContext)}else if(bc(n)){const r=e;this._tags={...this._tags,...r.tags},this._extra={...this._extra,...r.extra},this._contexts={...this._contexts,...r.contexts},r.user&&(this._user=r.user),r.level&&(this._level=r.level),r.fingerprint&&(this._fingerprint=r.fingerprint),r.requestSession&&(this._requestSession=r.requestSession),r.propagationContext&&(this._propagationContext=r.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=kI(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:Pte;if(r<=0)return this;const i={timestamp:vp(),...e},s=this._breadcrumbs;return s.push(i),this._breadcrumbs=s.length>r?s.slice(-r):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:n,_contexts:r,_tags:i,_extra:s,_user:o,_level:a,_fingerprint:c,_eventProcessors:l,_propagationContext:u,_sdkProcessingMetadata:d,_transactionName:f,_span:p}=this;return{breadcrumbs:e,attachments:n,contexts:r,tags:i,extra:s,user:o,level:a,fingerprint:c||[],eventProcessors:l,propagationContext:u,sdkProcessingMetadata:d,transactionName:f,span:p}}applyToEvent(e,n={},r=[]){NM(e,this.getScopeData());const i=[...r,...WS(),...this._eventProcessors];return ng(i,e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:Rn();if(!this._client)return ye.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:Rn();if(!this._client)return ye.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Rn();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(ye.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Mte(){return Zv||(Zv=new eo),Zv}function kI(){return{traceId:Rn(),spanId:Rn().substring(16)}}const U_="7.120.3",PM=parseFloat(U_),Lte=100;class MM{constructor(e,n,r,i=PM){this._version=i;let s;n?s=n:(s=new eo,s.setClient(e));let o;r?o=r:(o=new eo,o.setClient(e)),this._stack=[{scope:s}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const n=this.getStackTop();n.client=e,n.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const n=this.pushScope();let r;try{r=e(n)}catch(i){throw this.popScope(),i}return by(r)?r.then(i=>(this.popScope(),i),i=>{throw this.popScope(),i}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Rn(),i=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:Rn(),s=new Error(e);return this.getScope().captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Rn();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=Lte}=i.getOptions&&i.getOptions()||{};if(o<=0)return;const c={timestamp:vp(),...e},l=s?_c(()=>s(c,n)):c;l!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",l,n),r.addBreadcrumb(l,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n),this.getIsolationScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n),this.getIsolationScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n),this.getIsolationScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=AI(this);try{e(this)}finally{AI(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return ot&&ye.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return ot&&!r&&(this.getClient()?ye.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
405
+ Sentry.addTracingExtensions();
406
+ Sentry.init({...});
407
+ `):ye.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&OM(r),this._sendSessionUpdate(),n.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=Sy}=r&&r.getOptions()||{},{userAgent:o}=$t.navigator||{},a=IM({release:i,environment:s,user:n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&Ec(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(e,...n){const i=wp().__SENTRY__;if(i&&i.extensions&&typeof i.extensions[e]=="function")return i.extensions[e].apply(this,n);ot&&ye.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function wp(){return $t.__SENTRY__=$t.__SENTRY__||{extensions:{},hub:void 0},$t}function AI(t){const e=wp(),n=B_(e);return LM(e,t),n}function or(){const t=wp();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Fte(t)}function ba(){return or().getIsolationScope()}function Fte(t=wp()){return(!$te(t)||B_(t).isOlderThan(PM))&&LM(t,new MM),B_(t)}function $te(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function B_(t){return rM("hub",()=>new MM,t)}function LM(t,e){if(!t)return!1;const n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}function Lc(t){return or().getScope().getTransaction()}let NI=!1;function jte(){NI||(NI=!0,gM(z_),yM(z_))}function z_(){const t=Lc();if(t){const e="internal_error";ot&&ye.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}z_.tag="sentry_tracingErrorCallback";var PI;(function(t){const e="ok";t.Ok=e;const n="deadline_exceeded";t.DeadlineExceeded=n;const r="unauthenticated";t.Unauthenticated=r;const i="permission_denied";t.PermissionDenied=i;const s="not_found";t.NotFound=s;const o="resource_exhausted";t.ResourceExhausted=o;const a="invalid_argument";t.InvalidArgument=a;const c="unimplemented";t.Unimplemented=c;const l="unavailable";t.Unavailable=l;const u="internal_error";t.InternalError=u;const d="unknown_error";t.UnknownError=d;const f="cancelled";t.Cancelled=f;const p="already_exists";t.AlreadyExists=p;const m="failed_precondition";t.FailedPrecondition=m;const h="aborted";t.Aborted=h;const g="out_of_range";t.OutOfRange=g;const y="data_loss";t.DataLoss=y})(PI||(PI={}));function Ute(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function ZS(t,e){t.setTag("http.status_code",String(e)),t.setData("http.response.status_code",e);const n=Ute(e);n!=="unknown_error"&&t.setStatus(n)}function Ru(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Ut(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function FM(t){if(!Ru())return;const e=zte(t),n=or(),r=t.scope?t.scope.getSpan():YS();if(t.onlyIfParent&&!r)return;const o=(t.scope||si()).clone();return Bte(n,{parentSpan:r,spanContext:e,forceTransaction:t.forceTransaction,scope:o})}function YS(){return si().getSpan()}function Bte(t,{parentSpan:e,spanContext:n,forceTransaction:r,scope:i}){if(!Ru())return;const s=ba();let o;if(e&&!r)o=e.startChild(n);else if(e){const a=iu(e),{traceId:c,spanId:l}=e.spanContext(),u=GS(e);o=t.startTransaction({traceId:c,parentSpanId:l,parentSampled:u,...n,metadata:{dynamicSamplingContext:a,...n.metadata}})}else{const{traceId:a,dsc:c,parentSpanId:l,sampled:u}={...s.getPropagationContext(),...i.getPropagationContext()};o=t.startTransaction({traceId:a,parentSpanId:l,parentSampled:u,...n,metadata:{dynamicSamplingContext:c,...n.metadata}})}return i.setSpan(o),Vte(o,i,s),o}function zte(t){if(t.startTime){const e={...t};return e.startTimestamp=Ty(t.startTime),delete e.startTime,e}return t}const $M="_sentryScope",jM="_sentryIsolationScope";function Vte(t,e,n){t&&(la(t,jM,n),la(t,$M,e))}function Hte(t){return{scope:t[$M],isolationScope:t[jM]}}const Ss="sentry.source",ul="sentry.sample_rate",pd="sentry.op",ja="sentry.origin",Wte="profile_id";class UM{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class Cy{constructor(e={}){this._traceId=e.traceId||Rn(),this._spanId=e.spanId||Rn().substring(16),this._startTime=e.startTimestamp||bp(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[ja]:e.origin||"manual",[pd]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime!==void 0&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[pd]}set op(e){this.setAttribute(pd,e)}get origin(){return this._attributes[ja]}set origin(e){this.setAttribute(ja,e)}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?CM:mte}}startChild(e){const n=new Cy({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n);const r=rg(this);if(n.transaction=r,ot&&r){const i=e&&e.op||"< unknown op >",s=Fn(n).description||"< unknown name >",o=r.spanContext().spanId,a=`[Tracing] Starting '${i}' span on transaction '${s}' (${o}).`;ye.log(a),this._logMessage=a}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},this}setAttribute(e,n){n===void 0?delete this._attributes[e]:this._attributes[e]=n}setAttributes(e){Object.keys(e).forEach(n=>this.setAttribute(n,e[n]))}setStatus(e){return this._status=e,this}setHttpStatus(e){return ZS(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return this._status==="ok"}finish(e){return this.end(e)}end(e){if(this._endTime)return;const n=rg(this);if(ot&&n&&n.spanContext().spanId!==this._spanId){const r=this._logMessage;r&&ye.log(r.replace("Starting","Finishing"))}this._endTime=Ty(e)}toTraceparent(){return xy(this)}toContext(){return xr({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return qS(this)}getSpanJSON(){return xr({data:this._getData(),description:this._name,op:this._attributes[pd],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ja],_metrics_summary:void 0,profile_id:this._attributes[Wte],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:n}=this,r=Object.keys(e).length>0,i=Object.keys(n).length>0;if(!(!r&&!i))return r&&i?{...e,...n}:r?e:n}}class BM extends Cy{constructor(e,n){super(e),this._contexts={},this._hub=n||or(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const r=this._metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[Ss]&&{source:this._attributes[Ss]},...this._attributes[ul]&&{sampleRate:this._attributes[ul]}}}set metadata(e){this._metadata=e}setName(e,n="custom"){this._name=e,this.setAttribute(Ss,n)}updateName(e){return this._name=e,this}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new UM(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const n=Ty(e),r=this._finishTransaction(n);if(r)return this._hub.captureEvent(r)}toContext(){const e=super.toContext();return xr({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return iu(this)}setHub(e){this._hub=e}getProfileId(){if(this._contexts!==void 0&&this._contexts.profile!==void 0)return this._contexts.profile.profile_id}_finishTransaction(e){if(this._endTime!==void 0)return;this._name||(ot&&ye.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this._sampled!==!0){ot&&ye.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}const r=this.spanRecorder?this.spanRecorder.spans.filter(u=>u!==this&&Fn(u).timestamp):[];if(this._trimEnd&&r.length>0){const u=r.map(d=>Fn(d).timestamp).filter(Boolean);this._endTime=u.reduce((d,f)=>d>f?d:f)}const{scope:i,isolationScope:s}=Hte(this),{metadata:o}=this,{source:a}=o,c={contexts:{...this._contexts,trace:qS(this)},spans:r,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...o,capturedSpanScope:i,capturedSpanIsolationScope:s,...xr({dynamicSamplingContext:iu(this)})},_metrics_summary:void 0,...a&&{transaction_info:{source:a}}};return Object.keys(this._measurements).length>0&&(ot&&ye.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),c.measurements=this._measurements),ot&&ye.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),c}}const Jh={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},qte="finishReason",Yc=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Gte extends UM{constructor(e,n,r,i){super(i),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){if(e.spanContext().spanId!==this.transactionSpanId){const n=e.end;e.end=(...r)=>(this._popActivity(e.spanContext().spanId),n.apply(e,r)),Fn(e).timestamp===void 0&&this._pushActivity(e.spanContext().spanId)}super.add(e)}}class Zte extends BM{constructor(e,n,r=Jh.idleTimeout,i=Jh.finalTimeout,s=Jh.heartbeatInterval,o=!1,a=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=i,this._heartbeatInterval=s,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Yc[4],this._autoFinishAllowed=!a,o&&(ot&&ye.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),n.getScope().setSpan(this)),a||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Yc[3],this.end())},this._finalTimeout)}end(e){const n=Ty(e);if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setAttribute(qte,this._finishReason),this.spanRecorder){ot&&ye.log("[Tracing] finishing IdleTransaction",new Date(n*1e3).toISOString(),this.op);for(const r of this._beforeFinishCallbacks)r(this,n);this.spanRecorder.spans=this.spanRecorder.spans.filter(r=>{if(r.spanContext().spanId===this.spanContext().spanId)return!0;Fn(r).timestamp||(r.setStatus("cancelled"),r.end(n),ot&&ye.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(r,void 0,2)));const{start_timestamp:i,timestamp:s}=Fn(r),o=i&&i<n,a=(this._finalTimeout+this._idleTimeout)/1e3,c=s&&i&&s-i<a;if(ot){const l=JSON.stringify(r,void 0,2);o?c||ye.log("[Tracing] discarding Span since it finished after Transaction final timeout",l):ye.log("[Tracing] discarding Span since it happened after Transaction was finished",l)}return o&&c}),ot&&ye.log("[Tracing] flushing IdleTransaction")}else ot&&ye.log("[Tracing] No active IdleTransaction");if(this._onScope){const r=this._idleHub.getScope();r.getTransaction()===this&&r.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const n=i=>{this._finished||this._pushActivity(i)},r=i=>{this._finished||this._popActivity(i)};this.spanRecorder=new Gte(n,r,this.spanContext().spanId,e),ot&&ye.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Yc[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(ot&&ye.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Yc[1],this.end(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),ot&&ye.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,ot&&ye.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(ot&&ye.log(`[Tracing] popActivity ${e}`),delete this.activities[e],ot&&ye.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const n=bp();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=Yc[5],this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(ot&&ye.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Yc[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){ot&&ye.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function zM(t,e,n){if(!Ru(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setAttribute(ul,Number(t.sampled)),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setAttribute(ul,Number(r))):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setAttribute(ul,Number(r))):(r=1,t.setAttribute(ul,r)),VM(r)?r?(t.sampled=Math.random()<r,t.sampled?(ot&&ye.log(`[Tracing] starting ${t.op} transaction - ${Fn(t).description}`),t):(ot&&ye.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):(ot&&ye.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):(ot&&ye.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function VM(t){return tM(t)||!(typeof t=="number"||typeof t=="boolean")?(ot&&ye.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?(ot&&ye.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function Yte(){const e=this.getScope().getSpan();return e?{"sentry-trace":xy(e)}:{}}function Kte(t,e){const n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=t.instrumenter||"sentry";i!==s&&(ot&&ye.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter.
408
+ The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),t.sampled=!1);let o=new BM(t,this);return o=zM(o,r,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...e}),o.isRecording()&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function HM(t,e,n,r,i,s,o,a=!1){const c=t.getClient(),l=c&&c.getOptions()||{};let u=new Zte(e,t,n,r,o,i,a);return u=zM(u,l,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...s}),u.isRecording()&&u.initSpanRecorder(l._experiments&&l._experiments.maxSpans),c&&c.emit&&c.emit("startTransaction",u),u}function Jte(){const t=wp();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=Kte),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=Yte),jte())}function Xte(t,e,n){const r=Lc();r&&r.setMeasurement(t,e,n)}function Qte(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function ene(t,e,n,r){const i=HS(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&e&&{dsn:Cu(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return va(s,[o])}function tne(t,e,n,r){const i=HS(n),s=t.type&&t.type!=="replay_event"?t.type:"event";Qte(t,n&&n.sdk);const o=SM(t,i,r,e);return delete t.sdkProcessingMetadata,va(o,[[{type:s},t]])}const nne="7";function rne(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function ine(t){return`${rne(t)}${t.projectId}/envelope/`}function sne(t,e){return vee({sentry_key:t.publicKey,sentry_version:nne,...e&&{sentry_client:`${e.name}/${e.version}`}})}function one(t,e={}){const n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${ine(t)}?${sne(t,r)}`}const MI=[];function ane(t){const e={};return t.forEach(n=>{const{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function cne(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=fM(n(e)):r=e;const i=ane(r),s=une(i,o=>o.name==="Debug");if(s!==-1){const[o]=i.splice(s,1);i.push(o)}return i}function lne(t,e){const n={};return e.forEach(r=>{r&&WM(t,r,n)}),n}function LI(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function WM(t,e,n){if(n[e.name]){ot&&ye.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,MI.indexOf(e.name)===-1&&(e.setupOnce(pte,or),MI.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),t.on&&typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,o)=>r(s,o,t),{id:e.name});t.addEventProcessor(i)}ot&&ye.log(`Integration installed: ${e.name}`)}function une(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}function Ki(t,e){return Object.assign(function(...r){return e(...r)},{id:t})}function dne(t){let e="";for(const n of t){const r=Object.entries(n.tags),i=r.length>0?`|#${r.map(([s,o])=>`${s}:${o}`).join(",")}`:"";e+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${i}|T${n.timestamp}
409
+ `}return e}function fne(t,e,n,r){const i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&e&&(i.dsn=Cu(e));const s=pne(t);return va(i,[s])}function pne(t){const e=dne(t);return[{type:"statsd",length:e.length},e]}const FI="Not capturing exception because it's already been captured.";class hne{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=yee(e.dsn):ot&&ye.warn("No DSN provided, client will not send events."),this._dsn){const n=one(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(yI(e)){ot&&ye.log(FI);return}let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const o=$S(e)?e:String(e),a=jS(e)?this.eventFromMessage(o,n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&yI(n.originalException)){ot&&ye.log(FI);return}let i=n&&n.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,n,o||r).then(a=>{i=a})),i}captureSession(e){typeof e.release!="string"?ot&&ye.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ec(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):ru(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return ot&&ye.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const n=this._integrations[e.name];WM(this,e,this._integrations),n||LI(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=tne(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=rte(r,ote(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=ene(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=typeof r=="number"?r:1,s=`${e}:${n}`;ot&&ye.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}captureAggregateMetrics(e){ot&&ye.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const n=fne(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=lne(this,e),LI(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(Ec(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Zr(n=>{let r=0;const i=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=i,e&&r>=e&&(clearInterval(s),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i=ba()){const s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit("preprocessEvent",e,n),RM(s,e,n,r,this,i).then(a=>{if(a===null)return a;const c={...i.getPropagationContext(),...r?r.getPropagationContext():void 0};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:u,spanId:d,parentSpanId:f,dsc:p}=c;a.contexts={trace:{trace_id:u,span_id:d,parent_span_id:f},...a.contexts};const m=p||Oy(u,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:m,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(ot){const s=i;s.logLevel==="log"?ye.log(s.message):ye.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,o=GM(e),a=qM(e),c=e.type||"error",l=`before send for type \`${c}\``;if(a&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),zS(new fs(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const u=c==="replay_event"?"replay":c,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,f).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",u,e),new fs("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return p;const h=gne(i,p,n);return mne(h,l)}).then(p=>{if(p===null){if(this.recordDroppedEvent("before_send",u,e),o){const y=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw new fs(`${l} returned \`null\`, will not send event.`,"log")}const m=r&&r.getSession();if(!o&&m&&this._updateSessionFromEvent(m,p),o){const g=p.sdkProcessingMetadata&&p.sdkProcessingMetadata.spanCountBeforeProcessing||0,y=p.spans?p.spans.length:0,v=g-y;v>0&&this.recordDroppedEvent("before_send","span",v)}const h=p.transaction_info;if(o&&h&&p.transaction!==e.transaction){const g="custom";p.transaction_info={...h,source:g}}return this.sendEvent(p,n),p}).then(null,p=>{throw p instanceof fs?p:(this.captureException(p,{data:{__sentry__:!0},originalException:p}),new fs(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
410
+ Reason: ${p}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{ot&&ye.error("Error while sending event:",n)});ot&&ye.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function mne(t,e){const n=`${e} must return \`null\` or a valid event.`;if(by(t))return t.then(r=>{if(!bc(r)&&r!==null)throw new fs(n);return r},r=>{throw new fs(`${e} rejected with ${r}`)});if(!bc(t)&&t!==null)throw new fs(n);return t}function gne(t,e,n){const{beforeSend:r,beforeSendTransaction:i}=t;if(qM(e)&&r)return r(e,n);if(GM(e)&&i){if(e.spans){const s=e.spans.length;e.sdkProcessingMetadata={...e.sdkProcessingMetadata,spanCountBeforeProcessing:s}}return i(e,n)}return e}function qM(t){return t.type===void 0}function GM(t){return t.type==="transaction"}function yne(t){const e=Ut();!e||!e.addEventProcessor||e.addEventProcessor(t)}function vne(t,e){e.debug===!0&&(ot?ye.enable():_c(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),si().update(e.initialScope);const r=new t(e);bne(r),_ne(r)}function bne(t){const n=or().getStackTop();n.client=t,n.scope.setClient(t)}function _ne(t){t.init?t.init():t.setupIntegrations&&t.setupIntegrations()}const wne=30;function ZM(t,e,n=Gee(t.bufferSize||wne)){let r={};const i=o=>n.drain(o);function s(o){const a=[];if(SI(o,(d,f)=>{const p=xI(f);if(xM(r,p)){const m=$I(d,f);t.recordDroppedEvent("ratelimit_backoff",p,m)}else a.push(d)}),a.length===0)return ru();const c=va(o[0],a),l=d=>{SI(c,(f,p)=>{const m=$I(f,p);t.recordDroppedEvent(d,xI(p),m)})},u=()=>e({body:ite(c,t.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&ot&&ye.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=TM(r,d),d),d=>{throw l("network_error"),d});return n.add(u).then(d=>d,d=>{if(d instanceof fs)return ot&&ye.error("Skipped sending event because buffer is full."),l("queue_overflow"),ru();throw d})}return s.__sentry__baseTransport__=!0,{send:s,flush:i}}function $I(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}function Ene(t,e){const n={sent_at:new Date().toISOString()};e&&(n.dsn=Cu(e));const r=t.map(Sne);return va(n,r)}function Sne(t){return[{type:"span"},t]}function YM(t,e){const n=e&&Ine(e)?e.getClient():e,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return Tne(t,r)||xne(t,i)}function xne(t,e){return e?jI(t)===jI(e):!1}function Tne(t,e){return e?t.includes(e.host):!1}function jI(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function Ine(t){return t.getClient!==void 0}function KM(t,e,n=[e],r="npm"){const i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:U_})),version:U_}),t._metadata=i}const One=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Cne=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],JM="InboundFilters",Rne=(t={})=>({name:JM,setupOnce(){},processEvent(e,n,r){const i=r.getOptions(),s=Dne(t,i);return kne(e,s)?null:e}}),XM=Rne;Ki(JM,XM);function Dne(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:One],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:Cne],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function kne(t,e){return e.ignoreInternal&&Fne(t)?(ot&&ye.warn(`Event dropped due to being internal Sentry Error.
411
+ Event: ${Mo(t)}`),!0):Ane(t,e.ignoreErrors)?(ot&&ye.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
412
+ Event: ${Mo(t)}`),!0):Nne(t,e.ignoreTransactions)?(ot&&ye.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
413
+ Event: ${Mo(t)}`),!0):Pne(t,e.denyUrls)?(ot&&ye.warn(`Event dropped due to being matched by \`denyUrls\` option.
414
+ Event: ${Mo(t)}.
415
+ Url: ${ig(t)}`),!0):Mne(t,e.allowUrls)?!1:(ot&&ye.warn(`Event dropped due to not being matched by \`allowUrls\` option.
416
+ Event: ${Mo(t)}.
417
+ Url: ${ig(t)}`),!0)}function Ane(t,e){return t.type||!e||!e.length?!1:Lne(t).some(n=>Iu(n,e))}function Nne(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?Iu(n,e):!1}function Pne(t,e){if(!e||!e.length)return!1;const n=ig(t);return n?Iu(n,e):!1}function Mne(t,e){if(!e||!e.length)return!0;const n=ig(t);return n?Iu(n,e):!0}function Lne(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),ot&&e.length===0&&ye.error(`Could not extract message for event ${Mo(t)}`),e}function Fne(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function $ne(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function ig(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?$ne(e):null}catch{return ot&&ye.error(`Cannot extract url for event ${Mo(t)}`),null}}let UI;const QM="FunctionToString",BI=new WeakMap,jne=()=>({name:QM,setupOnce(){UI=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=BS(this),n=BI.has(Ut())&&e!==void 0?e:this;return UI.apply(n,t)}}catch{}},setup(t){BI.set(t,!0)}}),eL=jne;Ki(QM,eL);const wn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_t=$t;function Une(){_t.document?_t.document.addEventListener("visibilitychange",()=>{const t=Lc();if(_t.document.hidden&&t){const e="cancelled",{op:n,status:r}=Fn(t);wn&&ye.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.end()}}):wn&&ye.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Ep=(t,e,n)=>{let r,i;return s=>{e.value>=0&&(s||n)&&(i=e.value-(r||0),(i||r===void 0)&&(r=e.value,e.delta=i,t(e)))}},Bne=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,zne=()=>{const t=_t.performance.timing,e=_t.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},Ry=()=>_t.__WEB_VITALS_POLYFILL__?_t.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||zne()):_t.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],KS=()=>{const t=Ry();return t&&t.activationStart||0},Sp=(t,e)=>{const n=Ry();let r="navigate";return n&&(_t.document&&_t.document.prerendering||KS()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:Bne(),navigationType:r}},Du=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(i=>{e(i.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},xp=(t,e)=>{const n=r=>{(r.type==="pagehide"||_t.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};_t.document&&(addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0))},Vne=(t,e={})=>{const n=Sp("CLS",0);let r,i=0,s=[];const o=c=>{c.forEach(l=>{if(!l.hadRecentInput){const u=s[0],d=s[s.length-1];i&&s.length!==0&&l.startTime-d.startTime<1e3&&l.startTime-u.startTime<5e3?(i+=l.value,s.push(l)):(i=l.value,s=[l]),i>n.value&&(n.value=i,n.entries=s,r&&r())}})},a=Du("layout-shift",o);if(a){r=Ep(t,n,e.reportAllChanges);const c=()=>{o(a.takeRecords()),r(!0)};return xp(c),c}};let sg=-1;const Hne=()=>{_t.document&&_t.document.visibilityState&&(sg=_t.document.visibilityState==="hidden"&&!_t.document.prerendering?0:1/0)},Wne=()=>{xp(({timeStamp:t})=>{sg=t},!0)},JS=()=>(sg<0&&(Hne(),Wne()),{get firstHiddenTime(){return sg}}),qne=t=>{const e=JS(),n=Sp("FID");let r;const i=a=>{a.startTime<e.firstHiddenTime&&(n.value=a.processingStart-a.startTime,n.entries.push(a),r(!0))},s=a=>{a.forEach(i)},o=Du("first-input",s);r=Ep(t,n),o&&xp(()=>{s(o.takeRecords()),o.disconnect()},!0)};let tL=0,Yv=1/0,gh=0;const Gne=t=>{t.forEach(e=>{e.interactionId&&(Yv=Math.min(Yv,e.interactionId),gh=Math.max(gh,e.interactionId),tL=gh?(gh-Yv)/7+1:0)})};let V_;const Zne=()=>V_?tL:performance.interactionCount||0,Yne=()=>{"interactionCount"in performance||V_||(V_=Du("event",Gne,{type:"event",buffered:!0,durationThreshold:0}))},nL=()=>Zne(),zI=10,Ws=[],Kv={},VI=t=>{const e=Ws[Ws.length-1],n=Kv[t.interactionId];if(n||Ws.length<zI||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};Kv[r.id]=r,Ws.push(r)}Ws.sort((r,i)=>i.latency-r.latency),Ws.splice(zI).forEach(r=>{delete Kv[r.id]})}},Kne=()=>{const t=Math.min(Ws.length-1,Math.floor(nL()/50));return Ws[t]},Jne=(t,e)=>{e=e||{},Yne();const n=Sp("INP");let r;const i=o=>{o.forEach(c=>{c.interactionId&&VI(c),c.entryType==="first-input"&&!Ws.some(u=>u.entries.some(d=>c.duration===d.duration&&c.startTime===d.startTime))&&VI(c)});const a=Kne();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,r())},s=Du("event",i,{durationThreshold:e.durationThreshold||40});r=Ep(t,n,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),xp(()=>{i(s.takeRecords()),n.value<0&&nL()>0&&(n.value=0,n.entries=[]),r(!0)}))},HI={},Xne=t=>{const e=JS(),n=Sp("LCP");let r;const i=o=>{const a=o[o.length-1];if(a){const c=Math.max(a.startTime-KS(),0);c<e.firstHiddenTime&&(n.value=c,n.entries=[a],r())}},s=Du("largest-contentful-paint",i);if(s){r=Ep(t,n);const o=()=>{HI[n.id]||(i(s.takeRecords()),s.disconnect(),HI[n.id]=!0,r(!0))};return["keydown","click"].forEach(a=>{_t.document&&addEventListener(a,o,{once:!0,capture:!0})}),xp(o,!0),o}},H_=t=>{_t.document&&(_t.document.prerendering?addEventListener("prerenderingchange",()=>H_(t),!0):_t.document.readyState!=="complete"?addEventListener("load",()=>H_(t),!0):setTimeout(t,0))},Qne=(t,e)=>{e=e||{};const n=Sp("TTFB"),r=Ep(t,n,e.reportAllChanges);H_(()=>{const i=Ry();if(i){if(n.value=Math.max(i.responseStart-KS(),0),n.value<0||n.value>performance.now())return;n.entries=[i],r(!0)}})},Id={},og={};let rL,iL,sL,oL,aL;function ere(t,e=!1){return Tp("cls",t,ire,rL,e)}function cL(t,e=!1){return Tp("lcp",t,ore,sL,e)}function tre(t){return Tp("ttfb",t,are,oL)}function nre(t){return Tp("fid",t,sre,iL)}function rre(t){return Tp("inp",t,cre,aL)}function su(t,e){return lL(t,e),og[t]||(lre(t),og[t]=!0),uL(t,e)}function ku(t,e){const n=Id[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(i){wn&&ye.error(`Error while triggering instrumentation handler.
418
+ Type: ${t}
419
+ Name: ${fo(r)}
420
+ Error:`,i)}}function ire(){return Vne(t=>{ku("cls",{metric:t}),rL=t},{reportAllChanges:!0})}function sre(){return qne(t=>{ku("fid",{metric:t}),iL=t})}function ore(){return Xne(t=>{ku("lcp",{metric:t}),sL=t})}function are(){return Qne(t=>{ku("ttfb",{metric:t}),oL=t})}function cre(){return Jne(t=>{ku("inp",{metric:t}),aL=t})}function Tp(t,e,n,r,i=!1){lL(t,e);let s;return og[t]||(s=n(),og[t]=!0),r&&e({metric:r}),uL(t,e,i?s:void 0)}function lre(t){const e={};t==="event"&&(e.durationThreshold=0),Du(t,n=>{ku(t,{entries:n})},e)}function lL(t,e){Id[t]=Id[t]||[],Id[t].push(e)}function uL(t,e,n){return()=>{n&&n();const r=Id[t];if(!r)return;const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}function Jv(t){return typeof t=="number"&&isFinite(t)}function ou(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const ure=2147483647;function Wn(t){return t/1e3}function XS(){return _t.addEventListener&&_t.performance}let WI=0,Cn={},ts,Od;function dre(){const t=XS();if(t&&ni){t.mark&&_t.performance.mark("sentry-tracing-init");const e=yre(),n=mre(),r=gre(),i=vre();return()=>{e(),n(),r(),i()}}return()=>{}}function fre(){su("longtask",({entries:t})=>{for(const e of t){const n=Lc();if(!n)return;const r=Wn(ni+e.startTime),i=Wn(e.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function pre(){su("event",({entries:t})=>{for(const e of t){const n=Lc();if(!n)return;if(e.name==="click"){const r=Wn(ni+e.startTime),i=Wn(e.duration),s={description:ca(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i},o=iM(e.target);o&&(s.attributes={"ui.component_name":o}),n.startChild(s)}}})}function hre(t,e){if(XS()&&ni){const r=bre(t,e);return()=>{r()}}return()=>{}}function mre(){return ere(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(wn&&ye.log("[Measurements] Adding CLS"),Cn.cls={value:t.value,unit:""},Od=e)},!0)}function gre(){return cL(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(wn&&ye.log("[Measurements] Adding LCP"),Cn.lcp={value:t.value,unit:"millisecond"},ts=e)},!0)}function yre(){return nre(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=Wn(ni),r=Wn(e.startTime);wn&&ye.log("[Measurements] Adding FID"),Cn.fid={value:t.value,unit:"millisecond"},Cn["mark.fid"]={value:n+r,unit:"second"}})}function vre(){return tre(({metric:t})=>{t.entries[t.entries.length-1]&&(wn&&ye.log("[Measurements] Adding TTFB"),Cn.ttfb={value:t.value,unit:"millisecond"})})}const qI={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function bre(t,e){return rre(({metric:n})=>{if(n.value===void 0)return;const r=n.entries.find(b=>b.duration===n.value&&qI[b.name]!==void 0),i=Ut();if(!r||!i)return;const s=qI[r.name],o=i.getOptions(),a=Wn(ni+r.startTime),c=Wn(n.value),l=r.interactionId!==void 0?t[r.interactionId]:void 0;if(l===void 0)return;const{routeName:u,parentContext:d,activeTransaction:f,user:p,replayId:m}=l,h=p!==void 0?p.email||p.id||p.ip_address:void 0,g=f!==void 0?f.getProfileId():void 0,y=new Cy({startTimestamp:a,endTimestamp:a+c,op:`ui.interaction.${s}`,name:ca(r.target),attributes:{release:o.release,environment:o.environment,transaction:u,...h!==void 0&&h!==""?{user:h}:{},...g!==void 0?{profile_id:g}:{},...m!==void 0?{replay_id:m}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),v=Cre(d,o,e);if(v&&Math.random()<v){const b=y?Ene([y],i.getDsn()):void 0,E=i&&i.getTransport();E&&b&&E.send(b).then(null,w=>{wn&&ye.error("Error while sending interaction:",w)});return}})}function _re(t){const e=XS();if(!e||!_t.performance.getEntries||!ni)return;wn&&ye.log("[Tracing] Adding & adjusting spans using Performance API");const n=Wn(ni),r=e.getEntries(),{op:i,start_timestamp:s}=Fn(t);if(r.slice(WI).forEach(o=>{const a=Wn(o.startTime),c=Wn(o.duration);if(!(t.op==="navigation"&&s&&n+a<s))switch(o.entryType){case"navigation":{Ere(t,o,n);break}case"mark":case"paint":case"measure":{wre(t,o,a,c,n);const l=JS(),u=o.startTime<l.firstHiddenTime;o.name==="first-paint"&&u&&(wn&&ye.log("[Measurements] Adding FP"),Cn.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&u&&(wn&&ye.log("[Measurements] Adding FCP"),Cn.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{xre(t,o,o.name,a,c,n);break}}}),WI=Math.max(r.length-1,0),Tre(t),i==="pageload"){Ore(Cn),["fcp","fp","lcp"].forEach(a=>{if(!Cn[a]||!s||n>=s)return;const c=Cn[a].value,l=n+Wn(c),u=Math.abs((l-s)*1e3),d=u-c;wn&&ye.log(`[Measurements] Normalized ${a} from ${c} to ${u} (${d})`),Cn[a].value=u});const o=Cn["mark.fid"];o&&Cn.fid&&(ou(t,{description:"first input delay",endTimestamp:o.value+Wn(Cn.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete Cn["mark.fid"]),"fcp"in Cn||delete Cn.cls,Object.keys(Cn).forEach(a=>{Xte(a,Cn[a].value,Cn[a].unit)}),Ire(t)}ts=void 0,Od=void 0,Cn={}}function wre(t,e,n,r,i){const s=i+n,o=s+r;return ou(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function Ere(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{yh(t,e,r,n)}),yh(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),yh(t,e,"fetch",n,"cache","domainLookupStart"),yh(t,e,"domainLookup",n,"DNS"),Sre(t,e,n)}function yh(t,e,n,r,i,s){const o=s?e[s]:e[`${n}End`],a=e[`${n}Start`];!a||!o||ou(t,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+Wn(a),endTimestamp:r+Wn(o)})}function Sre(t,e,n){e.responseEnd&&(ou(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+Wn(e.requestStart),endTimestamp:n+Wn(e.responseEnd)}),ou(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+Wn(e.responseStart),endTimestamp:n+Wn(e.responseEnd)}))}function xre(t,e,n,r,i,s){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const o=Xa(n),a={};Xv(a,e,"transferSize","http.response_transfer_size"),Xv(a,e,"encodedBodySize","http.response_content_length"),Xv(a,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(a["resource.render_blocking_status"]=e.renderBlockingStatus),o.protocol&&(a["url.scheme"]=o.protocol.split(":").pop()),o.host&&(a["server.address"]=o.host),a["url.same_origin"]=n.includes(_t.location.origin);const c=s+r,l=c+i;ou(t,{description:n.replace(_t.location.origin,""),endTimestamp:l,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:c,data:a})}function Tre(t){const e=_t.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),Jv(n.rtt)&&(Cn["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Jv(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),Jv(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function Ire(t){ts&&(wn&&ye.log("[Measurements] Adding LCP Data"),ts.element&&t.setTag("lcp.element",ca(ts.element)),ts.id&&t.setTag("lcp.id",ts.id),ts.url&&t.setTag("lcp.url",ts.url.trim().slice(0,200)),t.setTag("lcp.size",ts.size)),Od&&Od.sources&&(wn&&ye.log("[Measurements] Adding CLS Data"),Od.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,ca(e.node))))}function Xv(t,e,n,r){const i=e[n];i!=null&&i<ure&&(t[r]=i)}function Ore(t){const e=Ry();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(wn&&ye.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}function Cre(t,e,n){if(!Ru(e))return!1;let r;return t!==void 0&&typeof e.tracesSampler=="function"?r=e.tracesSampler({transactionContext:t,name:t.name,parentSampled:t.parentSampled,attributes:{...t.data,...t.attributes},location:_t.location}):t!==void 0&&t.sampled!==void 0?r=t.sampled:typeof e.tracesSampleRate<"u"?r=e.tracesSampleRate:r=1,VM(r)?r===!0?n:r===!1?0:r*n:(wn&&ye.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1)}function Rre(t,e,n,r,i="auto.http.browser"){if(!Ru()||!t.fetchData)return;const s=e(t.fetchData.url);if(t.endTimestamp&&s){const p=t.fetchData.__span;if(!p)return;const m=r[p];m&&(Are(m,t),delete r[p]);return}const o=si(),a=Ut(),{method:c,url:l}=t.fetchData,u=kre(l),d=u?Xa(u).host:void 0,f=s?FM({name:`${c} ${l}`,onlyIfParent:!0,attributes:{url:l,type:"fetch","http.method":c,"http.url":u,"server.address":d,[ja]:i},op:"http.client"}):void 0;if(f&&(t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f),n(t.fetchData.url)&&a){const p=t.args[0];t.args[1]=t.args[1]||{};const m=t.args[1];m.headers=Dre(p,a,o,m,f)}return f}function Dre(t,e,n,r,i){const s=i||n.getSpan(),o=ba(),{traceId:a,spanId:c,sampled:l,dsc:u}={...o.getPropagationContext(),...n.getPropagationContext()},d=s?xy(s):VS(a,c,l),f=EM(u||(s?iu(s):Oy(a,e,n))),p=r.headers||(typeof Request<"u"&&uo(t,Request)?t.headers:void 0);if(p)if(typeof Headers<"u"&&uo(p,Headers)){const m=new Headers(p);return m.append("sentry-trace",d),f&&m.append($_,f),m}else if(Array.isArray(p)){const m=[...p,["sentry-trace",d]];return f&&m.push([$_,f]),m}else{const m="baggage"in p?p.baggage:void 0,h=[];return Array.isArray(m)?h.push(...m):m&&h.push(m),f&&h.push(f),{...p,"sentry-trace":d,baggage:h.length>0?h.join(","):void 0}}else return{"sentry-trace":d,baggage:f}}function kre(t){try{return new URL(t).href}catch{return}}function Are(t,e){if(e.response){ZS(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus("internal_error");t.end()}const W_=["localhost",/^\/(?!\/)/],q_={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:W_,tracePropagationTargets:W_};function Nre(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o}={traceFetch:q_.traceFetch,traceXHR:q_.traceXHR,...t},a=typeof s=="function"?s:u=>!0,c=u=>Fre(u,r||i),l={};e&&_y(u=>{const d=Rre(u,a,c,l);if(d){const f=dL(u.fetchData.url),p=f?Xa(f).host:void 0;d.setAttributes({"http.url":f,"server.address":p})}o&&d&&GI(d)}),n&&Ey(u=>{const d=$re(u,a,c,l);o&&d&&GI(d)})}function Pre(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function GI(t){const{url:e}=Fn(t).data||{};if(!e||typeof e!="string")return;const n=su("resource",({entries:r})=>{r.forEach(i=>{Pre(i)&&i.name.endsWith(e)&&(Lre(i).forEach(o=>t.setAttribute(...o)),setTimeout(n))})})}function Mre(t){let e="unknown",n="unknown",r="";for(const i of t){if(i==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(i))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=i}return r===t&&(e=r),{name:e,version:n}}function Qi(t=0){return((ni||performance.timeOrigin)+t)/1e3}function Lre(t){const{name:e,version:n}=Mre(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),ni?[...r,["http.request.redirect_start",Qi(t.redirectStart)],["http.request.fetch_start",Qi(t.fetchStart)],["http.request.domain_lookup_start",Qi(t.domainLookupStart)],["http.request.domain_lookup_end",Qi(t.domainLookupEnd)],["http.request.connect_start",Qi(t.connectStart)],["http.request.secure_connection_start",Qi(t.secureConnectionStart)],["http.request.connection_end",Qi(t.connectEnd)],["http.request.request_start",Qi(t.requestStart)],["http.request.response_start",Qi(t.responseStart)],["http.request.response_end",Qi(t.responseEnd)]]:r}function Fre(t,e){return Iu(t,e||W_)}function $re(t,e,n,r){const i=t.xhr,s=i&&i[Ys];if(!Ru()||!i||i.__sentry_own_request__||!s)return;const o=e(s.url);if(t.endTimestamp&&o){const p=i.__sentry_xhr_span_id__;if(!p)return;const m=r[p];m&&s.status_code!==void 0&&(ZS(m,s.status_code),m.end(),delete r[p]);return}const a=si(),c=ba(),l=dL(s.url),u=l?Xa(l).host:void 0,d=o?FM({name:`${s.method} ${s.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":s.method,"http.url":l,url:s.url,"server.address":u,[ja]:"auto.http.browser"},op:"http.client"}):void 0;d&&(i.__sentry_xhr_span_id__=d.spanContext().spanId,r[i.__sentry_xhr_span_id__]=d);const f=Ut();if(i.setRequestHeader&&n(s.url)&&f){const{traceId:p,spanId:m,sampled:h,dsc:g}={...c.getPropagationContext(),...a.getPropagationContext()},y=d?xy(d):VS(p,m,h),v=EM(g||(d?iu(d):Oy(p,f,a)));jre(i,y,v)}return d}function jre(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader($_,n)}catch{}}function dL(t){try{return new URL(t,_t.location.origin).href}catch{return}}const Ure="BrowserTracing",Bre={...Jh,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...q_},zre=(t={})=>{const e=wn?!!(t.tracePropagationTargets||t.tracingOrigins):!1;Jte(),!t.tracePropagationTargets&&t.tracingOrigins&&(t.tracePropagationTargets=t.tracingOrigins);const n={...Bre,...t},r=dre(),i={};n.enableInp&&hre(i,n.interactionsSampleRate),n.enableLongTask&&fre(),n._experiments.enableInteractions&&pre();const s={name:void 0,context:void 0};function o(a){const c=or(),{beforeStartSpan:l,idleTimeout:u,finalTimeout:d,heartbeatInterval:f}=n,p=a.op==="pageload";let m;if(p){const v=p?ZI("sentry-trace"):"",b=p?ZI("baggage"):void 0,{traceId:E,dsc:w,parentSpanId:S,sampled:_}=nte(v,b);m={traceId:E,parentSpanId:S,parentSampled:_,...a,metadata:{...a.metadata,dynamicSamplingContext:w},trimEnd:!0}}else m={trimEnd:!0,...a};const h=l?l(m):m;h.metadata=h.name!==m.name?{...h.metadata,source:"custom"}:h.metadata,s.name=h.name,s.context=h,h.sampled===!1&&wn&&ye.log(`[Tracing] Will not send ${h.op} transaction because of beforeNavigate.`),wn&&ye.log(`[Tracing] Starting ${h.op} transaction on scope`);const{location:g}=_t,y=HM(c,h,u,d,!0,{location:g},f,p);return p&&_t.document&&(_t.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(_t.document.readyState)&&y.sendAutoFinishSignal()}),["interactive","complete"].includes(_t.document.readyState)&&y.sendAutoFinishSignal()),y.registerBeforeFinishCallback(v=>{r(),_re(v)}),y}return{name:Ure,setupOnce:()=>{},afterAllSetup(a){const c=a.getOptions(),{markBackgroundSpan:l,traceFetch:u,traceXHR:d,shouldCreateSpanForRequest:f,enableHTTPTimings:p,_experiments:m}=n,h=c&&c.tracePropagationTargets,g=h||n.tracePropagationTargets;wn&&e&&h&&ye.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.");let y,v=_t.location&&_t.location.href;if(a.on&&(a.on("startNavigationSpan",b=>{y&&(wn&&ye.log(`[Tracing] Finishing current transaction with op: ${Fn(y).op}`),y.end()),y=o({op:"navigation",...b})}),a.on("startPageLoadSpan",b=>{y&&(wn&&ye.log(`[Tracing] Finishing current transaction with op: ${Fn(y).op}`),y.end()),y=o({op:"pageload",...b})})),n.instrumentPageLoad&&a.emit&&_t.location){const b={name:_t.location.pathname,startTimestamp:ni?ni/1e3:void 0,origin:"auto.pageload.browser",attributes:{[Ss]:"url"}};fL(a,b)}n.instrumentNavigation&&a.emit&&_t.location&&wy(({to:b,from:E})=>{if(E===void 0&&v&&v.indexOf(b)!==-1){v=void 0;return}if(E!==b){v=void 0;const w={name:_t.location.pathname,origin:"auto.navigation.browser",attributes:{[Ss]:"url"}};Vre(a,w)}}),l&&Une(),m.enableInteractions&&Hre(n,s),n.enableInp&&qre(i,s),Nre({traceFetch:u,traceXHR:d,tracePropagationTargets:g,shouldCreateSpanForRequest:f,enableHTTPTimings:p})},options:n}};function fL(t,e){if(!t.emit)return;t.emit("startPageLoadSpan",e);const n=YS();return(n&&Fn(n).op)==="pageload"?n:void 0}function Vre(t,e){if(!t.emit)return;t.emit("startNavigationSpan",e);const n=YS();return(n&&Fn(n).op)==="navigation"?n:void 0}function ZI(t){const e=uee(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function Hre(t,e){let n;const r=()=>{const{idleTimeout:i,finalTimeout:s,heartbeatInterval:o}=t,a="ui.action.click",c=Lc();if(c&&c.op&&["navigation","pageload"].includes(c.op)){wn&&ye.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(n&&(n.setFinishReason("interactionInterrupted"),n.end(),n=void 0),!e.name){wn&&ye.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}const{location:l}=_t,u={name:e.name,op:a,trimEnd:!0,data:{[Ss]:e.context?Gre(e.context):"url"}};n=HM(or(),u,i,s,!0,{location:l},o)};["click"].forEach(i=>{_t.document&&addEventListener(i,r,{once:!1,capture:!0})})}function Wre(t){return"duration"in t}const YI=10;function qre(t,e){const n=({entries:r})=>{const i=Ut(),s=i!==void 0&&i.getIntegrationByName!==void 0?i.getIntegrationByName("Replay"):void 0,o=s!==void 0?s.getReplayId():void 0,a=Lc(),c=si(),l=c!==void 0?c.getUser():void 0;r.forEach(u=>{if(Wre(u)){const d=u.interactionId;if(d===void 0)return;const f=t[d],p=u.duration,m=u.startTime,h=Object.keys(t),g=h.length>0?h.reduce((y,v)=>t[y].duration<t[v].duration?y:v):void 0;if(u.entryType==="first-input"&&h.map(v=>t[v]).some(v=>v.duration===p&&v.startTime===m)||!d)return;if(f)f.duration=Math.max(f.duration,p);else if(h.length<YI||g===void 0||p>t[g].duration){const y=e.name,v=e.context;y&&v&&(g&&Object.keys(t).length>=YI&&delete t[g],t[d]={routeName:y,duration:p,parentContext:v,user:l,activeTransaction:a,replayId:o,startTime:m})}}})};su("event",n),su("first-input",n)}function Gre(t){const e=t.attributes&&t.attributes[Ss],n=t.data&&t.data[Ss],r=t.metadata&&t.metadata.source;return e||n||r}const nn=$t;let G_=0;function pL(){return G_>0}function Zre(){G_++,setTimeout(()=>{G_--})}function au(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(BS(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{const s=i.map(o=>au(o,e));return t.apply(this,s)}catch(s){throw Zre(),DM(o=>{o.addEventProcessor(a=>(e.mechanism&&(k_(a,void 0),wc(a,e.mechanism)),a.extra={...a.extra,arguments:i},a)),_p(s)}),s}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}oM(r,t),la(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const Ks=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function hL(t,e){const n=QS(t,e),r={type:e&&e.name,value:Xre(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Yre(t,e,n,r){const i=Ut(),s=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:vy(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:tie(e,{isUnhandledRejection:r})}]},extra:{__serialized__:vM(e,s)}};if(n){const a=QS(t,n);a.length&&(o.exception.values[0].stacktrace={frames:a})}return o}function Qv(t,e){return{exception:{values:[hL(t,e)]}}}function QS(t,e){const n=e.stacktrace||e.stack||"",r=Jre(e);try{return t(n,r)}catch{}return[]}const Kre=/Minified React error #\d+;/i;function Jre(t){if(t){if(typeof t.framesToPop=="number")return t.framesToPop;if(Kre.test(t.message))return 1}return 0}function Xre(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Qre(t,e,n,r){const i=n&&n.syntheticException||void 0,s=e0(t,e,i,r);return wc(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),ru(s)}function eie(t,e,n="info",r,i){const s=r&&r.syntheticException||void 0,o=Z_(t,e,s,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),ru(o)}function e0(t,e,n,r,i){let s;if(FS(e)&&e.error)return Qv(t,e.error);if(lI(e)||eee(e)){const o=e;if("stack"in e)s=Qv(t,e);else{const a=o.name||(lI(o)?"DOMError":"DOMException"),c=o.message?`${a}: ${o.message}`:a;s=Z_(t,c,n,r),k_(s,c)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return Tl(e)?Qv(t,e):bc(e)||vy(e)?(s=Yre(t,e,n,i),wc(s,{synthetic:!0}),s):(s=Z_(t,e,n,r),k_(s,`${e}`),wc(s,{synthetic:!0}),s)}function Z_(t,e,n,r){const i={};if(r&&n){const s=QS(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if($S(e)){const{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function tie(t,{isUnhandledRejection:e}){const n=bee(t),r=e?"promise rejection":"exception";return FS(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:vy(t)?`Event \`${nie(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function nie(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function rie(t,{metadata:e,tunnel:n,dsn:r}){const i={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Cu(r)}},s=iie(t);return va(i,[s])}function iie(t){return[{type:"user_report"},t]}class sie extends hne{constructor(e){const n=nn.SENTRY_SDK_SOURCE||jee();KM(e,"browser",["browser"],n),super(e),e.sendClientReports&&nn.document&&nn.document.addEventListener("visibilitychange",()=>{nn.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return Qre(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return eie(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){Ks&&ye.warn("SDK not enabled, will not capture user feedback.");return}const n=rie(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){Ks&&ye.log("No outcomes to send");return}if(!this._dsn){Ks&&ye.log("No dsn provided, will not send outcomes");return}Ks&&ye.log("Sending outcomes:",e);const n=cte(e,this._options.tunnel&&Cu(this._dsn));this._sendEnvelope(n)}}let hd;function oie(){if(hd)return hd;if(M_(nn.fetch))return hd=nn.fetch.bind(nn);const t=nn.document;let e=nn.fetch;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){Ks&&ye.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return hd=e.bind(nn)}function aie(){hd=void 0}function cie(t,e=oie()){let n=0,r=0;function i(s){const o=s.body.length;n+=o,r++;const a={body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=o,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return aie(),n-=o,r--,zS(c)}}return ZM(t,i)}const lie=4;function uie(t){function e(n){return new Zr((r,i)=>{const s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===lie&&r({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",t.url);for(const o in t.headers)Object.prototype.hasOwnProperty.call(t.headers,o)&&s.setRequestHeader(o,t.headers[o]);s.send(n.body)})}return ZM(t,e)}const Dy="?",die=30,fie=40,pie=50;function t0(t,e,n,r){const i={filename:t,function:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const hie=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mie=/\((\S*)(?::(\d+))(?::(\d+))\)/,gie=t=>{const e=hie.exec(t);if(e){if(e[2]&&e[2].indexOf("eval")===0){const s=mie.exec(e[2]);s&&(e[2]=s[1],e[3]=s[2],e[4]=s[3])}const[r,i]=mL(e[1]||Dy,e[2]);return t0(i,r,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},yie=[die,gie],vie=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bie=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_ie=t=>{const e=vie.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=bie.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let r=e[3],i=e[1]||Dy;return[i,r]=mL(i,r),t0(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},wie=[pie,_ie],Eie=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Sie=t=>{const e=Eie.exec(t);return e?t0(e[2],e[1]||Dy,+e[3],e[4]?+e[4]:void 0):void 0},xie=[fie,Sie],Tie=[yie,wie,xie],Iie=lM(...Tie),mL=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Dy,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},vh=1024,gL="Breadcrumbs",Oie=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:gL,setupOnce(){},setup(n){e.console&&uM(Die(n)),e.dom&&pM(Rie(n,e.dom)),e.xhr&&Ey(kie(n)),e.fetch&&_y(Aie(n)),e.history&&wy(Nie(n)),e.sentry&&n.on&&n.on("beforeSendEvent",Cie(n))}}},yL=Oie;Ki(gL,yL);function Cie(t){return function(n){Ut()===t&&ua({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Mo(n)},{event:n})}}function Rie(t,e){return function(r){if(Ut()!==t)return;let i,s,o=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>vh&&(Ks&&ye.warn(`\`dom.maxStringLength\` cannot exceed ${vh}, but a value of ${a} was configured. Sentry will use ${vh} instead.`),a=vh),typeof o=="string"&&(o=[o]);try{const l=r.event,u=Pie(l)?l.target:l;i=ca(u,{keyAttrs:o,maxStringLength:a}),s=iM(u)}catch{i="<unknown>"}if(i.length===0)return;const c={category:`ui.${r.name}`,message:i};s&&(c.data={"ui.component_name":s}),ua(c,{event:r.event,name:r.name,global:r.global})}}function Die(t){return function(n){if(Ut()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:bM(n.level),message:Qm(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Qm(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ua(r,{input:n.args,level:n.level})}}function kie(t){return function(n){if(Ut()!==t)return;const{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[Ys];if(!r||!i||!s)return;const{method:o,url:a,status_code:c,body:l}=s,u={method:o,url:a,status_code:c},d={xhr:n.xhr,input:l,startTimestamp:r,endTimestamp:i};ua({category:"xhr",data:u,type:"http"},d)}}function Aie(t){return function(n){if(Ut()!==t)return;const{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i};ua({category:"fetch",data:s,level:"error",type:"http"},o)}else{const s=n.response,o={...n.fetchData,status_code:s&&s.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:i};ua({category:"fetch",data:o,type:"http"},a)}}}function Nie(t){return function(n){if(Ut()!==t)return;let r=n.from,i=n.to;const s=Xa(nn.location.href);let o=r?Xa(r):void 0;const a=Xa(i);(!o||!o.path)&&(o=s),s.protocol===a.protocol&&s.host===a.host&&(i=a.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),ua({category:"navigation",data:{from:r,to:i}})}}function Pie(t){return!!t&&!!t.target}const vL="Dedupe",Mie=()=>{let t;return{name:vL,setupOnce(){},processEvent(e){if(e.type)return e;try{if(Lie(e,t))return Ks&&ye.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},bL=Mie;Ki(vL,bL);function Lie(t,e){return e?!!(Fie(t,e)||$ie(t,e)):!1}function Fie(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!wL(t,e)||!_L(t,e))}function $ie(t,e){const n=KI(e),r=KI(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!wL(t,e)||!_L(t,e))}function _L(t,e){let n=JI(t),r=JI(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){const s=r[i],o=n[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function wL(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function KI(t){return t.exception&&t.exception.values&&t.exception.values[0]}function JI(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const EL="GlobalHandlers",jie=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:EL,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(Uie(n),XI("onerror")),e.onunhandledrejection&&(Bie(n),XI("onunhandledrejection"))}}},SL=jie;Ki(EL,SL);function Uie(t){gM(e=>{const{stackParser:n,attachStacktrace:r}=TL();if(Ut()!==t||pL())return;const{msg:i,url:s,line:o,column:a,error:c}=e,l=c===void 0&&Es(i)?Hie(i,s,o,a):xL(e0(n,c||i,void 0,r,!1),s,o,a);l.level="error",Iy(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function Bie(t){yM(e=>{const{stackParser:n,attachStacktrace:r}=TL();if(Ut()!==t||pL())return;const i=zie(e),s=jS(i)?Vie(i):e0(n,i,void 0,r,!0);s.level="error",Iy(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function zie(t){if(jS(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return t}function Vie(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function Hie(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=FS(t)?t.message:t,o="Error";const a=s.match(i);return a&&(o=a[1],s=a[2]),xL({exception:{values:[{type:o,value:s}]}},e,n,r)}function xL(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=Es(e)&&e.length>0?e:lee();return c.length===0&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),t}function XI(t){Ks&&ye.log(`Global Handler attached: ${t}`)}function TL(){const t=Ut();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const IL="HttpContext",Wie=()=>({name:IL,setupOnce(){},preprocessEvent(t){if(!nn.navigator&&!nn.location&&!nn.document)return;const e=t.request&&t.request.url||nn.location&&nn.location.href,{referrer:n}=nn.document||{},{userAgent:r}=nn.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),OL=Wie;Ki(IL,OL);const qie="cause",Gie=5,CL="LinkedErrors",Zie=(t={})=>{const e=t.limit||Gie,n=t.key||qie;return{name:CL,setupOnce(){},preprocessEvent(r,i,s){const o=s.getOptions();see(hL,o.stackParser,o.maxValueLength,n,e,r,i)}}},RL=Zie;Ki(CL,RL);const Yie=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],DL="TryCatch",Kie=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:DL,setupOnce(){e.setTimeout&&Kn(nn,"setTimeout",QI),e.setInterval&&Kn(nn,"setInterval",QI),e.requestAnimationFrame&&Kn(nn,"requestAnimationFrame",Jie),e.XMLHttpRequest&&"XMLHttpRequest"in nn&&Kn(XMLHttpRequest.prototype,"send",Xie);const n=e.eventTarget;n&&(Array.isArray(n)?n:Yie).forEach(Qie)}}},kL=Kie;Ki(DL,kL);function QI(t){return function(...e){const n=e[0];return e[0]=au(n,{mechanism:{data:{function:fo(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Jie(t){return function(e){return t.apply(this,[au(e,{mechanism:{data:{function:"requestAnimationFrame",handler:fo(t)},handled:!1,type:"instrument"}})])}}function Xie(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&Kn(n,i,function(s){const o={mechanism:{data:{function:i,handler:fo(s)},handled:!1,type:"instrument"}},a=BS(s);return a&&(o.mechanism.data.handler=fo(a)),au(s,o)})}),t.apply(this,e)}}function Qie(t){const e=nn,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Kn(n,"addEventListener",function(r){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=au(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:fo(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,au(s,{mechanism:{data:{function:"addEventListener",handler:fo(s),target:t},handled:!1,type:"instrument"}}),o])}}),Kn(n,"removeEventListener",function(r){return function(i,s,o){const a=s;try{const c=a&&a.__sentry_wrapped__;c&&r.call(this,i,c,o)}catch{}return r.call(this,i,a,o)}}))}const ese=[XM(),eL(),kL(),yL(),SL(),RL(),bL(),OL()];function tse(t){return[...ese]}function nse(t={}){t.defaultIntegrations===void 0&&(t.defaultIntegrations=tse()),t.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(t.release=__SENTRY_RELEASE__),nn.SENTRY_RELEASE&&nn.SENTRY_RELEASE.id&&(t.release=nn.SENTRY_RELEASE.id)),t.autoSessionTracking===void 0&&(t.autoSessionTracking=!0),t.sendClientReports===void 0&&(t.sendClientReports=!0);const e={...t,stackParser:wee(t.stackParser||Iie),integrations:cne(t),transport:t.transport||(hM()?cie:uie)};vne(sie,e),t.autoSessionTracking&&rse()}function rse(){if(typeof nn.document>"u"){Ks&&ye.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}CI({ignoreDuration:!0}),RI(),wy(({from:t,to:e})=>{t!==void 0&&t!==e&&(CI({ignoreDuration:!0}),RI())})}const pn=$t,n0="sentryReplaySession",ise="replay_event",r0="Unable to send Replay",sse=3e5,ose=9e5,ase=5e3,cse=5500,lse=6e4,use=5e3,dse=3,eO=15e4,bh=5e3,fse=3e3,pse=300,i0=2e7,hse=4999,mse=15e3,tO=36e5;function gse(t,e){return t??e()}function ag(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}var Hn;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(Hn||(Hn={}));function yse(t){return t.nodeType===t.ELEMENT_NODE}function Cd(t){const e=ag([t,"optionalAccess",n=>n.host]);return ag([e,"optionalAccess",n=>n.shadowRoot])===t}function Rd(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function vse(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function bse(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function cg(t){try{const e=t.rules||t.cssRules;return e?vse(Array.from(e,AL).join("")):null}catch{return null}}function AL(t){let e;if(wse(t))try{e=cg(t.styleSheet)||bse(t)}catch{}else if(Ese(t)&&t.selectorText.includes(":"))return _se(t.cssText);return e||t.cssText}function _se(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function wse(t){return"styleSheet"in t}function Ese(t){return"selectorText"in t}class NL{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const n=ag([this,"access",r=>r.getMeta,"call",r=>r(e),"optionalAccess",r=>r.id]);return gse(n,()=>-1)}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Sse(){return new NL}function ky({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function Uf({isMasked:t,element:e,value:n,maskInputFn:r}){let i=n||"";return t?(r&&(i=r(i,e)),"*".repeat(i.length)):i}function cu(t){return t.toLowerCase()}function Y_(t){return t.toUpperCase()}const nO="__rrweb_original__";function xse(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let r=0;r<t.width;r+=n)for(let i=0;i<t.height;i+=n){const s=e.getImageData,o=nO in s?s[nO]:s;if(new Uint32Array(o.call(e,r,i,Math.min(n,t.width-r),Math.min(n,t.height-i)).data.buffer).some(c=>c!==0))return!1}return!0}function s0(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?cu(e):null}function lg(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}let Tse=1;const Ise=new RegExp("[^a-z0-9-_:]"),Bf=-2;function o0(){return Tse++}function Ose(t){if(t instanceof HTMLFormElement)return"form";const e=cu(t.tagName);return Ise.test(e)?"div":e}function Cse(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let Kc,rO;const Rse=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Dse=/^(?:[a-z+]+:)?\/\//i,kse=/^www\..*/i,Ase=/^(data:)([^,]*),(.*)/i;function ug(t,e){return(t||"").replace(Rse,(n,r,i,s,o,a)=>{const c=i||o||a,l=r||s||"";if(!c)return n;if(Dse.test(c)||kse.test(c))return`url(${l}${c}${l})`;if(Ase.test(c))return`url(${l}${c}${l})`;if(c[0]==="/")return`url(${l}${Cse(e)+c}${l})`;const u=e.split("/"),d=c.split("/");u.pop();for(const f of d)f!=="."&&(f===".."?u.pop():u.push(f));return`url(${l}${u.join("/")}${l})`})}const Nse=/^[^ \t\n\r\u000c]+/,Pse=/^[, \t\n\r\u000c]+/;function Mse(t,e){if(e.trim()==="")return e;let n=0;function r(s){let o;const a=s.exec(e.substring(n));return a?(o=a[0],n+=o.length,o):""}const i=[];for(;r(Pse),!(n>=e.length);){let s=r(Nse);if(s.slice(-1)===",")s=dl(t,s.substring(0,s.length-1)),i.push(s);else{let o="";s=dl(t,s);let a=!1;for(;;){const c=e.charAt(n);if(c===""){i.push((s+o).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,i.push((s+o).trim());break}else c==="("&&(a=!0);o+=c,n+=1}}}return i.join(", ")}function dl(t,e){if(!e||e.trim()==="")return e;const n=t.createElement("a");return n.href=e,n.href}function Lse(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function a0(){const t=document.createElement("a");return t.href="",t.href}function PL(t,e,n,r,i,s){return r&&(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?dl(t,r):n==="srcset"?Mse(t,r):n==="style"?ug(r,a0()):e==="object"&&n==="data"?dl(t,r):typeof s=="function"?s(n,r,i):r)}function ML(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function Fse(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(n)return t.matches(n)}catch{}return!1}function $se(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}function Ua(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Ua(t.parentNode,e,n,r+1)}function fl(t,e){return n=>{const r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if($se(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function lu(t,e,n,r,i,s){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const l=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(l))return!0}let a=-1,c=-1;if(s){if(c=Ua(o,fl(r,i)),c<0)return!0;a=Ua(o,fl(e,n),c>=0?c:1/0)}else{if(a=Ua(o,fl(e,n)),a<0)return!1;c=Ua(o,fl(r,i),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!s}catch{}return!!s}function jse(t,e,n){const r=t.contentWindow;if(!r)return;let i=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const a=setTimeout(()=>{i||(e(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||t.src===o||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function Use(t,e,n){let r=!1,i;try{i=t.sheet}catch{return}if(i)return;const s=setTimeout(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{clearTimeout(s),r=!0,e()})}function Bse(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:h,maskInputFn:g,dataURLOptions:y={},inlineImages:v,recordCanvas:b,keepIframeSrcFn:E,newlyAddedElement:w=!1}=e,S=zse(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Hn.Document,childNodes:[],compatMode:t.compatMode}:{type:Hn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Hn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:S};case t.ELEMENT_NODE:return Hse(t,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:y,inlineImages:v,recordCanvas:b,keepIframeSrcFn:E,newlyAddedElement:w,rootId:S,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f});case t.TEXT_NODE:return Vse(t,{maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:h,maskInputOptions:m,maskInputFn:g,rootId:S});case t.CDATA_SECTION_NODE:return{type:Hn.CDATA,textContent:"",rootId:S};case t.COMMENT_NODE:return{type:Hn.Comment,textContent:t.textContent||"",rootId:S};default:return!1}}function zse(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function Vse(t,e){const{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:a,maskInputOptions:c,maskInputFn:l,rootId:u}=e,d=t.parentNode&&t.parentNode.tagName;let f=t.textContent;const p=d==="STYLE"?!0:void 0,m=d==="SCRIPT"?!0:void 0,h=d==="TEXTAREA"?!0:void 0;if(p&&f){try{t.nextSibling||t.previousSibling||ag([t,"access",y=>y.parentNode,"access",y=>y.sheet,"optionalAccess",y=>y.cssRules])&&(f=cg(t.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,t)}f=ug(f,a0())}m&&(f="SCRIPT_PLACEHOLDER");const g=lu(t,r,s,i,o,n);if(!p&&!m&&!h&&f&&g&&(f=a?a(f,t.parentElement):f.replace(/[\S]/g,"*")),h&&f&&(c.textarea||g)&&(f=l?l(f,t.parentNode):f.replace(/[\S]/g,"*")),d==="OPTION"&&f){const y=ky({type:null,tagName:d,maskInputOptions:c});f=Uf({isMasked:lu(t,r,s,i,o,y),element:t,value:f,maskInputFn:l})}return{type:Hn.Text,textContent:f||"",isStyle:p,rootId:u}}function Hse(t,e){const{doc:n,blockClass:r,blockSelector:i,unblockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:h,maskAllText:g,maskTextClass:y,unmaskTextClass:v,maskTextSelector:b,unmaskTextSelector:E}=e,w=Fse(t,r,i,s),S=Ose(t);let _={};const O=t.attributes.length;for(let F=0;F<O;F++){const q=t.attributes[F];q.name&&!ML(S,q.name,q.value)&&(_[q.name]=PL(n,S,cu(q.name),q.value,t,c))}if(S==="link"&&o){const F=Array.from(n.styleSheets).find(I=>I.href===t.href);let q=null;F&&(q=cg(F)),q&&(delete _.rel,delete _.href,_._cssText=ug(q,F.href))}if(S==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const F=cg(t.sheet);F&&(_._cssText=ug(F,a0()))}if(S==="input"||S==="textarea"||S==="select"||S==="option"){const F=t,q=s0(F),I=lg(F,Y_(S),q),$=F.checked;if(q!=="submit"&&q!=="button"&&I){const x=lu(F,y,b,v,E,ky({type:q,tagName:Y_(S),maskInputOptions:a}));_.value=Uf({isMasked:x,element:F,value:I,maskInputFn:l})}$&&(_.checked=$)}if(S==="option"&&(t.selected&&!a.select?_.selected=!0:delete _.selected),S==="canvas"&&f){if(t.__context==="2d")xse(t)||(_.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){const F=t.toDataURL(u.type,u.quality),q=document.createElement("canvas");q.width=t.width,q.height=t.height;const I=q.toDataURL(u.type,u.quality);F!==I&&(_.rr_dataURL=F)}}if(S==="img"&&d){Kc||(Kc=n.createElement("canvas"),rO=Kc.getContext("2d"));const F=t,q=F.crossOrigin;F.crossOrigin="anonymous";const I=()=>{F.removeEventListener("load",I);try{Kc.width=F.naturalWidth,Kc.height=F.naturalHeight,rO.drawImage(F,0,0),_.rr_dataURL=Kc.toDataURL(u.type,u.quality)}catch($){console.warn(`Cannot inline img src=${F.currentSrc}! Error: ${$}`)}q?_.crossOrigin=q:F.removeAttribute("crossorigin")};F.complete&&F.naturalWidth!==0?I():F.addEventListener("load",I)}if((S==="audio"||S==="video")&&(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime),m||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),w){const{width:F,height:q}=t.getBoundingClientRect();_={class:_.class,rr_width:`${F}px`,rr_height:`${q}px`}}S==="iframe"&&!p(_.src)&&(t.contentDocument||(_.rr_src=_.src),delete _.src);let M;try{customElements.get(S)&&(M=!0)}catch{}return{type:Hn.Element,tagName:S,attributes:_,childNodes:[],isSVG:Lse(t)||void 0,needBlock:w,rootId:h,isCustom:M}}function dn(t){return t==null?"":t.toLowerCase()}function Wse(t,e){if(e.comment&&t.type===Hn.Comment)return!0;if(t.type===Hn.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(dn(t.attributes.name).match(/^msapplication-tile(image|color)$/)||dn(t.attributes.name)==="application-name"||dn(t.attributes.rel)==="icon"||dn(t.attributes.rel)==="apple-touch-icon"||dn(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&dn(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(dn(t.attributes.property).match(/^(og|twitter|fb):/)||dn(t.attributes.name).match(/^(og|twitter):/)||dn(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(dn(t.attributes.name)==="robots"||dn(t.attributes.name)==="googlebot"||dn(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(dn(t.attributes.name)==="author"||dn(t.attributes.name)==="generator"||dn(t.attributes.name)==="framework"||dn(t.attributes.name)==="publisher"||dn(t.attributes.name)==="progid"||dn(t.attributes.property).match(/^article:/)||dn(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(dn(t.attributes.name)==="google-site-verification"||dn(t.attributes.name)==="yandex-verification"||dn(t.attributes.name)==="csrf-token"||dn(t.attributes.name)==="p:domain_verify"||dn(t.attributes.name)==="verify-v1"||dn(t.attributes.name)==="verification"||dn(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function pl(t,e){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:h,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b={},inlineImages:E=!1,recordCanvas:w=!1,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:O=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:F=5e3,keepIframeSrcFn:q=()=>!1,newlyAddedElement:I=!1}=e;let{preserveWhiteSpace:$=!0}=e;const x=Bse(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:y,dataURLOptions:b,inlineImages:E,recordCanvas:w,keepIframeSrcFn:q,newlyAddedElement:I});if(!x)return console.warn(t,"not serialized"),null;let A;r.hasNode(t)?A=r.getId(t):Wse(x,v)||!$&&x.type===Hn.Text&&!x.isStyle&&!x.textContent.replace(/^\s+|\s+$/gm,"").length?A=Bf:A=o0();const P=Object.assign(x,{id:A});if(r.add(t,P),A===Bf)return null;S&&S(t);let B=!f;if(P.type===Hn.Element){B=B&&!P.needBlock,delete P.needBlock;const J=t.shadowRoot;J&&Rd(J)&&(P.isShadowHost=!0)}if((P.type===Hn.Document||P.type===Hn.Element)&&B){v.headWhitespace&&P.type===Hn.Element&&P.tagName==="head"&&($=!1);const J={doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:$,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:O,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:q};for(const L of Array.from(t.childNodes)){const G=pl(L,J);G&&P.childNodes.push(G)}if(yse(t)&&t.shadowRoot)for(const L of Array.from(t.shadowRoot.childNodes)){const G=pl(L,J);G&&(Rd(t.shadowRoot)&&(G.isShadow=!0),P.childNodes.push(G))}}return t.parentNode&&Cd(t.parentNode)&&Rd(t.parentNode)&&(P.isShadow=!0),P.type===Hn.Element&&P.tagName==="iframe"&&jse(t,()=>{const J=t.contentDocument;if(J&&_){const L=pl(J,{doc:J,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:$,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:O,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:q});L&&_(t,L)}},O),P.type===Hn.Element&&P.tagName==="link"&&P.attributes.rel==="stylesheet"&&Use(t,()=>{if(M){const J=pl(t,{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:E,recordCanvas:w,preserveWhiteSpace:$,onSerialize:S,onIframeLoad:_,iframeLoadTimeout:O,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:q});J&&M(t,J)}},F),P}function qse(t,e){const{mirror:n=new NL,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:h,maskTextFn:g,maskInputFn:y,slimDOM:v=!1,dataURLOptions:b,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:_,onStylesheetLoad:O,stylesheetLoadTimeout:M,keepIframeSrcFn:F=()=>!1}=e;return pl(t,{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:y,slimDOMOptions:v===!0||v==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:b,inlineImages:f,recordCanvas:p,preserveWhiteSpace:E,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:_,onStylesheetLoad:O,stylesheetLoadTimeout:M,keepIframeSrcFn:F,newlyAddedElement:!1})}function Do(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function Sr(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const ol=`Please stop import mirror directly. Instead of that,\r
421
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
422
+ or you can use record.mirror to access the mirror instance during recording.`;let iO={map:{},getId(){return console.error(ol),-1},getNode(){return console.error(ol),null},removeNodeFromMap(){console.error(ol)},has(){return console.error(ol),!1},reset(){console.error(ol)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(iO=new Proxy(iO,{get(t,e,n){return e==="map"&&console.error(ol),Reflect.get(t,e,n)}}));function zf(t,e,n={}){let r=null,i=0;return function(...s){const o=Date.now();!i&&n.leading===!1&&(i=o);const a=e-(o-i),c=this;a<=0||a>e?(r&&(Qse(r),r=null),i=o,t.apply(c,s)):!r&&n.trailing!==!1&&(r=Ay(()=>{i=n.leading===!1?0:Date.now(),r=null,t.apply(c,s)},a))}}function LL(t,e,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,r?n:{set(o){Ay(()=>{n.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>LL(t,e,s||{},!0)}function c0(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}let dg=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(dg=()=>new Date().getTime());function FL(t){const e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:Do([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||Do([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||Do([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:Do([e,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||Do([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||Do([e,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function $L(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function jL(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function UL(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function Pi(t,e,n,r,i){if(!t)return!1;const s=UL(t);if(!s)return!1;const o=fl(e,n);if(!i){const l=r&&s.matches(r);return o(s)&&!l}const a=Ua(s,o);let c=-1;return a<0?!1:(r&&(c=Ua(s,fl(null,r))),a>-1&&c<0?!0:a<c)}function Gse(t,e){return e.getId(t)!==-1}function eb(t,e){return e.getId(t)===Bf}function BL(t,e){if(Cd(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?BL(t.parentNode,e):!0:!0}function K_(t){return!!t.changedTouches}function Zse(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function zL(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function VL(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function J_(t){return!!Do([t,"optionalAccess",e=>e.shadowRoot])}class Yse{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return fte(this.styleIDMap.get(e),()=>-1)}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function HL(t){let e=null;return Do([t,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function Kse(t){let e=t,n;for(;n=HL(e);)e=n;return e}function Jse(t){const e=t.ownerDocument;if(!e)return!1;const n=Kse(t);return e.contains(n)}function WL(t){const e=t.ownerDocument;return e?e.contains(t)||Jse(t):!1}const sO={};function l0(t){const e=sO[t];if(e)return e;const n=window.document;let r=window[t];if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch{}return sO[t]=r.bind(window)}function Xse(...t){return l0("requestAnimationFrame")(...t)}function Ay(...t){return l0("setTimeout")(...t)}function Qse(...t){return l0("clearTimeout")(...t)}var Dt=(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))(Dt||{}),kt=(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))(kt||{}),hr=(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))(hr||{}),Bs=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Bs||{});function eoe(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}function oO(t){return"__ln"in t}class toe{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=eoe([n,"optionalAccess",i=>i.next])||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&oO(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&oO(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const aO=(t,e)=>`${t}@${e}`;class noe{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new toe,i=c=>{let l=c,u=Bf;for(;u===Bf;)l=l&&l.nextSibling,u=l&&this.mirror.getId(l);return u},s=c=>{if(!c.parentNode||!WL(c))return;const l=Cd(c.parentNode)?this.mirror.getId(HL(c)):this.mirror.getId(c.parentNode),u=i(c);if(l===-1||u===-1)return r.addNode(c);const d=pl(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{zL(f,this.mirror)&&this.iframeManager.addIframe(f),VL(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),J_(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{this.iframeManager.attachIframe(f,p),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)}});d&&(e.push({parentId:l,nextId:u,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)cO(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!lO(this.droppedSet,c)&&!cO(this.removes,c,this.mirror)||lO(this.movedSet,c)?s(c):this.droppedSet.add(c);let o=null;for(;r.length;){let c=null;if(o){const l=this.mirror.getId(o.value.parentNode),u=i(o.value);l!==-1&&u!==-1&&(c=o)}if(!c){let l=r.tail;for(;l;){const u=l;if(l=l.previous,u){const d=this.mirror.getId(u.value.parentNode);if(i(u.value)===-1)continue;if(d!==-1){c=u;break}else{const p=u.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=p.parentNode.host;if(this.mirror.getId(m)!==-1){c=u;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}o=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:l}=c;if(typeof l.style=="string"){const u=JSON.stringify(c.styleDiff),d=JSON.stringify(c._unchangedStyles);u.length<l.style.length&&(u+d).split("var(").length===l.style.split("var(").length&&(l.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:l}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!eb(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!Pi(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:lu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,UL(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=s0(n),a=n.tagName;i=lg(n,a,o);const c=ky({maskInputOptions:this.maskInputOptions,tagName:a,type:o}),l=lu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);i=Uf({isMasked:l,element:n,value:i,maskInputFn:this.maskInputFn})}if(Pi(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||i===e.oldValue)return;let s=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!n.contentDocument)r="rr_src";else return;if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!ML(n.tagName,r)&&(s.attributes[r]=PL(this.doc,cu(n.tagName),cu(r),i,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),l=n.style.getPropertyPriority(a);c!==o.style.getPropertyValue(a)||l!==o.style.getPropertyPriority(a)?l===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,l]:s._unchangedStyles[a]=[c,l]}for(const a of Array.from(o.style))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(Pi(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),i=Cd(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Pi(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||eb(n,this.mirror)||!Gse(n,this.mirror)||(this.addedSet.has(n)?(X_(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||BL(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[aO(r,i)]?X_(this.movedSet,n):this.removes.push({parentId:i,id:r,isShadow:Cd(e.target)&&Rd(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(eb(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[aO(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Pi(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach(r=>this.genAdds(r)),J_(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function X_(t,e){t.delete(e),e.childNodes.forEach(n=>X_(t,n))}function cO(t,e,n){return t.length===0?!1:qL(t,e,n)}function qL(t,e,n){const{parentNode:r}=e;if(!r)return!1;const i=n.getId(r);return t.some(s=>s.id===i)?!0:qL(t,r,n)}function lO(t,e){return t.size===0?!1:GL(t,e)}function GL(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:GL(t,n):!1}let Dd;function roe(t){Dd=t}function ioe(){Dd=void 0}const zt=t=>Dd?(...n)=>{try{return t(...n)}catch(r){if(Dd&&Dd(r)===!0)return()=>{};throw r}}:t;function ls(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}const hl=[];function Ip(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function ZL(t,e){const n=new noe;hl.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver;const i=ls([window,"optionalAccess",o=>o.Zone,"optionalAccess",o=>o.__symbol__,"optionalCall",o=>o("MutationObserver")]);i&&window[i]&&(r=window[i]);const s=new r(zt(o=>{t.onMutation&&t.onMutation(o)===!1||n.processMutations.bind(n)(o)}));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function soe({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],a;const c=zf(zt(d=>{const f=Date.now()-a;t(o.map(p=>(p.timeOffset-=f,p)),d),o=[],a=null}),s),l=zt(zf(zt(d=>{const f=Ip(d),{clientX:p,clientY:m}=K_(d)?d.changedTouches[0]:d;a||(a=dg()),o.push({x:p,y:m,id:r.getId(f),timeOffset:dg()-a}),c(typeof DragEvent<"u"&&d instanceof DragEvent?kt.Drag:d instanceof MouseEvent?kt.MouseMove:kt.TouchMove)}),i,{trailing:!1})),u=[Sr("mousemove",l,n),Sr("touchmove",l,n),Sr("drag",l,n)];return zt(()=>{u.forEach(d=>d())})}function ooe({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[];let l=null;const u=d=>f=>{const p=Ip(f);if(Pi(p,r,i,s,!0))return;let m=null,h=d;if("pointerType"in f){switch(f.pointerType){case"mouse":m=Bs.Mouse;break;case"touch":m=Bs.Touch;break;case"pen":m=Bs.Pen;break}m===Bs.Touch?hr[d]===hr.MouseDown?h="TouchStart":hr[d]===hr.MouseUp&&(h="TouchEnd"):Bs.Pen}else K_(f)&&(m=Bs.Touch);m!==null?(l=m,(h.startsWith("Touch")&&m===Bs.Touch||h.startsWith("Mouse")&&m===Bs.Mouse)&&(m=null)):hr[d]===hr.Click&&(m=l,l=null);const g=K_(f)?f.changedTouches[0]:f;if(!g)return;const y=n.getId(p),{clientX:v,clientY:b}=g;zt(t)({type:hr[h],id:y,x:v,y:b,...m!==null&&{pointerType:m}})};return Object.keys(hr).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&a[d]!==!1).forEach(d=>{let f=cu(d);const p=u(d);if(window.PointerEvent)switch(hr[d]){case hr.MouseDown:case hr.MouseUp:f=f.replace("mouse","pointer");break;case hr.TouchStart:case hr.TouchEnd:return}c.push(Sr(f,p,e))}),zt(()=>{c.forEach(d=>d())})}function YL({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){const a=zt(zf(zt(c=>{const l=Ip(c);if(!l||Pi(l,r,i,s,!0))return;const u=n.getId(l);if(l===e&&e.defaultView){const d=FL(e.defaultView);t({id:u,x:d.left,y:d.top})}else t({id:u,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Sr("scroll",a,e)}function aoe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const i=zt(zf(zt(()=>{const s=$L(),o=jL();(n!==s||r!==o)&&(t({width:Number(o),height:Number(s)}),n=s,r=o)}),200));return Sr("resize",i,e)}const coe=["INPUT","TEXTAREA","SELECT"],uO=new WeakMap;function loe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:h}){function g(_){let O=Ip(_);const M=_.isTrusted,F=O&&Y_(O.tagName);if(F==="OPTION"&&(O=O.parentElement),!O||!F||coe.indexOf(F)<0||Pi(O,r,i,s,!0))return;const q=O;if(q.classList.contains(o)||a&&q.matches(a))return;const I=s0(O);let $=lg(q,F,I),x=!1;const A=ky({maskInputOptions:c,tagName:F,type:I}),P=lu(O,f,m,p,h,A);(I==="radio"||I==="checkbox")&&(x=O.checked),$=Uf({isMasked:P,element:O,value:$,maskInputFn:l}),y(O,d?{text:$,isChecked:x,userTriggered:M}:{text:$,isChecked:x});const B=O.name;I==="radio"&&B&&x&&e.querySelectorAll(`input[type="radio"][name="${B}"]`).forEach(J=>{if(J!==O){const L=Uf({isMasked:P,element:J,value:lg(J,F,I),maskInputFn:l});y(J,d?{text:L,isChecked:!x,userTriggered:!1}:{text:L,isChecked:!x})}})}function y(_,O){const M=uO.get(_);if(!M||M.text!==O.text||M.isChecked!==O.isChecked){uO.set(_,O);const F=n.getId(_);zt(t)({...O,id:F})}}const b=(u.input==="last"?["change"]:["input","change"]).map(_=>Sr(_,zt(g),e)),E=e.defaultView;if(!E)return()=>{b.forEach(_=>_())};const w=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),S=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return w&&w.set&&b.push(...S.map(_=>LL(_[0],_[1],{set(){zt(g)({target:this,isTrusted:!1})}},!1,E))),zt(()=>{b.forEach(_=>_())})}function fg(t){const e=[];function n(r,i){if(_h("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||_h("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||_h("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||_h("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return n(t,e)}function ko(t,e,n){let r,i;return t?(t.ownerNode?r=e.getId(t.ownerNode):i=n.getId(t),{styleId:i,id:r}):{}}function uoe({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:zt((u,d,f)=>{const[p,m]=f,{id:h,styleId:g}=ko(d,e,n.styleMirror);return(h&&h!==-1||g&&g!==-1)&&t({id:h,styleId:g,adds:[{rule:p,index:m}]}),u.apply(d,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:zt((u,d,f)=>{const[p]=f,{id:m,styleId:h}=ko(d,e,n.styleMirror);return(m&&m!==-1||h&&h!==-1)&&t({id:m,styleId:h,removes:[{index:p}]}),u.apply(d,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:zt((u,d,f)=>{const[p]=f,{id:m,styleId:h}=ko(d,e,n.styleMirror);return(m&&m!==-1||h&&h!==-1)&&t({id:m,styleId:h,replace:p}),u.apply(d,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:zt((u,d,f)=>{const[p]=f,{id:m,styleId:h}=ko(d,e,n.styleMirror);return(m&&m!==-1||h&&h!==-1)&&t({id:m,styleId:h,replaceSync:p}),u.apply(d,f)})}));const c={};wh("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(wh("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),wh("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),wh("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([u,d])=>{l[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(l[u].insertRule,{apply:zt((f,p,m)=>{const[h,g]=m,{id:y,styleId:v}=ko(p.parentStyleSheet,e,n.styleMirror);return(y&&y!==-1||v&&v!==-1)&&t({id:y,styleId:v,adds:[{rule:h,index:[...fg(p),g||0]}]}),f.apply(p,m)})}),d.prototype.deleteRule=new Proxy(l[u].deleteRule,{apply:zt((f,p,m)=>{const[h]=m,{id:g,styleId:y}=ko(p.parentStyleSheet,e,n.styleMirror);return(g&&g!==-1||y&&y!==-1)&&t({id:g,styleId:y,removes:[{index:[...fg(p),h]}]}),f.apply(p,m)})})}),zt(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=s,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([u,d])=>{d.prototype.insertRule=l[u].insertRule,d.prototype.deleteRule=l[u].deleteRule})})}function KL({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);const i=n.nodeName==="#document"?ls([n,"access",o=>o.defaultView,"optionalAccess",o=>o.Document]):ls([n,"access",o=>o.ownerDocument,"optionalAccess",o=>o.defaultView,"optionalAccess",o=>o.ShadowRoot]),s=ls([i,"optionalAccess",o=>o.prototype])?Object.getOwnPropertyDescriptor(ls([i,"optionalAccess",o=>o.prototype]),"adoptedStyleSheets"):void 0;return r===null||r===-1||!i||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return ls([s,"access",o=>o.get,"optionalAccess",o=>o.call,"call",o=>o(this)])},set(o){const a=ls([s,"access",c=>c.set,"optionalAccess",c=>c.call,"call",c=>c(this,o)]);if(r!==null&&r!==-1)try{e.adoptStyleSheets(o,r)}catch{}return a}}),zt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function doe({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:zt((a,c,l)=>{const[u,d,f]=l;if(n.has(u))return s.apply(c,[u,d,f]);const{id:p,styleId:m}=ko(ls([c,"access",h=>h.parentRule,"optionalAccess",h=>h.parentStyleSheet]),e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&t({id:p,styleId:m,set:{property:u,value:d,priority:f},index:fg(c.parentRule)}),a.apply(c,l)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:zt((a,c,l)=>{const[u]=l;if(n.has(u))return o.apply(c,[u]);const{id:d,styleId:f}=ko(ls([c,"access",p=>p.parentRule,"optionalAccess",p=>p.parentStyleSheet]),e,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&t({id:d,styleId:f,remove:{property:u},index:fg(c.parentRule)}),a.apply(c,l)})}),zt(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o})}function foe({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:i,sampling:s,doc:o}){const a=zt(l=>zf(zt(u=>{const d=Ip(u);if(!d||Pi(d,e,n,r,!0))return;const{currentTime:f,volume:p,muted:m,playbackRate:h}=d;t({type:l,id:i.getId(d),currentTime:f,volume:p,muted:m,playbackRate:h})}),s.media||500)),c=[Sr("play",a(0),o),Sr("pause",a(1),o),Sr("seeked",a(2),o),Sr("volumechange",a(3),o),Sr("ratechange",a(4),o)];return zt(()=>{c.forEach(l=>l())})}function poe({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(c,l,u){const d=new s(c,l,u);return i.set(d,{family:c,buffer:typeof l!="string",descriptors:u,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),d};const o=c0(e.fonts,"add",function(a){return function(c){return Ay(zt(()=>{const l=i.get(c);l&&(t(l),i.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(o),zt(()=>{r.forEach(a=>a())})}function hoe(t){const{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=t;let a=!0;const c=zt(()=>{const l=e.getSelection();if(!l||a&&ls([l,"optionalAccess",f=>f.isCollapsed]))return;a=l.isCollapsed||!1;const u=[],d=l.rangeCount||0;for(let f=0;f<d;f++){const p=l.getRangeAt(f),{startContainer:m,startOffset:h,endContainer:g,endOffset:y}=p;Pi(m,r,i,s,!0)||Pi(g,r,i,s,!0)||u.push({start:n.getId(m),startOffset:h,end:n.getId(g),endOffset:y})}o({ranges:u})});return c(),Sr("selectionchange",c)}function moe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:c0(n.customElements,"define",function(i){return function(s,o,a){try{e({define:{name:s}})}catch{}return i.apply(this,[s,o,a])}})}function goe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=ZL(t,t.doc),i=soe(t),s=ooe(t),o=YL(t),a=aoe(t,{win:n}),c=loe(t),l=foe(t),u=uoe(t,{win:n}),d=KL(t,t.doc),f=doe(t,{win:n}),p=t.collectFonts?poe(t):()=>{},m=hoe(t),h=moe(t),g=[];for(const y of t.plugins)g.push(y.observer(y.callback,n,y.options));return zt(()=>{hl.forEach(y=>y.reset()),r.disconnect(),i(),s(),o(),a(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(y=>y())})}function _h(t){return typeof window[t]<"u"}function wh(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Q_{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,i){const s=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let a=s.get(n);return a||(a=this.generateIdFn(),s.set(n,a),o.set(a,n)),a}getIds(e,n){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return n.map(s=>this.getId(e,s,r,i))}getRemoteId(e,n,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const s=i.get(n);return s||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}function dO(t){let e,n=t[0],r=1;for(;r<t.length;){const i=t[r],s=t[r+1];if(r+=2,(i==="optionalAccess"||i==="optionalCall")&&n==null)return;i==="access"||i==="optionalAccess"?(e=n,n=s(n)):(i==="call"||i==="optionalCall")&&(n=s((...o)=>n.call(e,...o)),e=void 0)}return n}class yoe{constructor(){this.crossOriginIframeMirror=new Q_(o0),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class voe{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Q_(o0),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Q_(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),dO([this,"access",r=>r.loadListener,"optionalCall",r=>r(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const s=this.transformCrossOriginEvent(i,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case Dt.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:Dt.IncrementalSnapshot,data:{source:kt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Dt.Meta:case Dt.Load:case Dt.DomContentLoaded:return!1;case Dt.Plugin:return n;case Dt.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case Dt.IncrementalSnapshot:switch(n.data.source){case kt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const i=this.crossOriginIframeRootIdMap.get(e);i&&this.patchRootIdOnNode(r.node,i)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case kt.Drag:case kt.TouchMove:case kt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case kt.ViewportResize:return!1;case kt.MediaInteraction:case kt.MouseInteraction:case kt.Scroll:case kt.CanvasMutation:case kt.Input:return this.replaceIds(n.data,e,["id"]),n;case kt.StyleSheetRule:case kt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case kt.Font:return n;case kt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case kt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),dO([n,"access",r=>r.data,"access",r=>r.styles,"optionalAccess",r=>r.forEach,"call",r=>r(i=>{this.replaceStyleIds(i,e,["styleId"])})]),n}}return!1}replace(e,n,r,i){for(const s of i)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=e.getIds(r,n[s]):n[s]=e.getId(r,n[s]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==Hn.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class boe{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class _oe{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Rd(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=ZL({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(YL({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Ay(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(KL({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(c0(e.prototype,"attachShadow",function(i){return function(s){const o=i.call(this,s);return this.shadowRoot&&WL(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class fO{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class woe{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Yse,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},i=[];for(const s of e){let o;this.styleMirror.has(s)?o=this.styleMirror.getId(s):(o=this.styleMirror.add(s),i.push({styleId:o,rules:Array.from(s.rules||CSSRule,(a,c)=>({rule:AL(a),index:c}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Eoe{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){Xse(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==n)}add(e,n){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}let In,pg;const xi=Sse();function Wo(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:s=null,unblockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:h,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,maxCanvasSize:w=null,packFn:S,sampling:_={},dataURLOptions:O={},mousemoveWait:M,recordCanvas:F=!1,recordCrossOriginIframes:q=!1,recordAfter:I=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:$=!1,collectFonts:x=!1,inlineImages:A=!1,plugins:P,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:J=new Set([]),errorHandler:L,onMutation:G,getCanvasManager:U}=t;roe(L);const C=q?window.parent===window:!0;let Z=!1;if(!C)try{window.parent.document&&(Z=!1)}catch{Z=!0}if(C&&!e)throw new Error("emit function is required");M!==void 0&&_.mousemove===void 0&&(_.mousemove=M),xi.reset();const H=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g!==void 0?g:{},V=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};Zse();let ce,le=0;const ge=N=>{for(const z of P||[])z.eventProcessor&&(N=z.eventProcessor(N));return S&&!Z&&(N=S(N)),N};In=(N,z)=>{const X=N;if(X.timestamp=dg(),Gv([hl,"access",Y=>Y[0],"optionalAccess",Y=>Y.isFrozen,"call",Y=>Y()])&&X.type!==Dt.FullSnapshot&&!(X.type===Dt.IncrementalSnapshot&&X.data.source===kt.Mutation)&&hl.forEach(Y=>Y.unfreeze()),C)Gv([e,"optionalCall",Y=>Y(ge(X),z)]);else if(Z){const Y={type:"rrweb",event:ge(X),origin:window.location.origin,isCheckout:z};window.parent.postMessage(Y,"*")}if(X.type===Dt.FullSnapshot)ce=X,le=0;else if(X.type===Dt.IncrementalSnapshot){if(X.data.source===kt.Mutation&&X.data.isAttachIframe)return;le++;const Y=r&&le>=r,ee=n&&ce&&X.timestamp-ce.timestamp>n;(Y||ee)&&R(!0)}};const Re=N=>{In({type:Dt.IncrementalSnapshot,data:{source:kt.Mutation,...N}})},Ge=N=>In({type:Dt.IncrementalSnapshot,data:{source:kt.Scroll,...N}}),st=N=>In({type:Dt.IncrementalSnapshot,data:{source:kt.CanvasMutation,...N}}),He=N=>In({type:Dt.IncrementalSnapshot,data:{source:kt.AdoptedStyleSheet,...N}}),gt=new woe({mutationCb:Re,adoptedStyleSheetCb:He}),D=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new yoe:new voe({mirror:xi,mutationCb:Re,stylesheetManager:gt,recordCrossOriginIframes:q,wrappedEmit:In});for(const N of P||[])N.getMirror&&N.getMirror({nodeMirror:xi,crossOriginIframeMirror:D.crossOriginIframeMirror,crossOriginIframeStyleMirror:D.crossOriginIframeStyleMirror});const me=new Eoe,ue=xoe(U,{mirror:xi,win:window,mutationCb:N=>In({type:Dt.IncrementalSnapshot,data:{source:kt.CanvasMutation,...N}}),recordCanvas:F,blockClass:i,blockSelector:s,unblockSelector:o,maxCanvasSize:w,sampling:_.canvas,dataURLOptions:O,errorHandler:L}),K=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new boe:new _oe({mutationCb:Re,scrollCb:Ge,bypassOptions:{onMutation:G,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:H,dataURLOptions:O,maskAttributeFn:v,maskTextFn:E,maskInputFn:b,recordCanvas:F,inlineImages:A,sampling:_,slimDOMOptions:V,iframeManager:D,stylesheetManager:gt,canvasManager:ue,keepIframeSrcFn:B,processedNodeManager:me},mirror:xi}),R=(N=!1)=>{In({type:Dt.Meta,data:{href:window.location.href,width:jL(),height:$L()}},N),gt.reset(),K.init(),hl.forEach(X=>X.lock());const z=qse(document,{mirror:xi,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:H,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,slimDOM:V,dataURLOptions:O,recordCanvas:F,inlineImages:A,onSerialize:X=>{zL(X,xi)&&D.addIframe(X),VL(X,xi)&&gt.trackLinkElement(X),J_(X)&&K.addShadowRoot(X.shadowRoot,document)},onIframeLoad:(X,Y)=>{D.attachIframe(X,Y),K.observeAttachShadow(X)},onStylesheetLoad:(X,Y)=>{gt.attachLinkElement(X,Y)},keepIframeSrcFn:B});if(!z)return console.warn("Failed to snapshot the document");In({type:Dt.FullSnapshot,data:{node:z,initialOffset:FL(window)}}),hl.forEach(X=>X.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&gt.adoptStyleSheets(document.adoptedStyleSheets,xi.getId(document))};pg=R;try{const N=[],z=Y=>zt(goe)({onMutation:G,mutationCb:Re,mousemoveCb:(ee,pe)=>In({type:Dt.IncrementalSnapshot,data:{source:pe,positions:ee}}),mouseInteractionCb:ee=>In({type:Dt.IncrementalSnapshot,data:{source:kt.MouseInteraction,...ee}}),scrollCb:Ge,viewportResizeCb:ee=>In({type:Dt.IncrementalSnapshot,data:{source:kt.ViewportResize,...ee}}),inputCb:ee=>In({type:Dt.IncrementalSnapshot,data:{source:kt.Input,...ee}}),mediaInteractionCb:ee=>In({type:Dt.IncrementalSnapshot,data:{source:kt.MediaInteraction,...ee}}),styleSheetRuleCb:ee=>In({type:Dt.IncrementalSnapshot,data:{source:kt.StyleSheetRule,...ee}}),styleDeclarationCb:ee=>In({type:Dt.IncrementalSnapshot,data:{source:kt.StyleDeclaration,...ee}}),canvasMutationCb:st,fontCb:ee=>In({type:Dt.IncrementalSnapshot,data:{source:kt.Font,...ee}}),selectionCb:ee=>{In({type:Dt.IncrementalSnapshot,data:{source:kt.Selection,...ee}})},customElementCb:ee=>{In({type:Dt.IncrementalSnapshot,data:{source:kt.CustomElement,...ee}})},blockClass:i,ignoreClass:a,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:H,inlineStylesheet:m,sampling:_,recordCanvas:F,inlineImages:A,userTriggeredOnInput:$,collectFonts:x,doc:Y,maskAttributeFn:v,maskInputFn:b,maskTextFn:E,keepIframeSrcFn:B,blockSelector:s,unblockSelector:o,slimDOMOptions:V,dataURLOptions:O,mirror:xi,iframeManager:D,stylesheetManager:gt,shadowDomManager:K,processedNodeManager:me,canvasManager:ue,ignoreCSSAttributes:J,plugins:Gv([P,"optionalAccess",ee=>ee.filter,"call",ee=>ee(pe=>pe.observer),"optionalAccess",ee=>ee.map,"call",ee=>ee(pe=>({observer:pe.observer,options:pe.options,callback:he=>In({type:Dt.Plugin,data:{plugin:pe.name,payload:he}})}))])||[]},{});D.addLoadListener(Y=>{try{N.push(z(Y.contentDocument))}catch(ee){console.warn(ee)}});const X=()=>{R(),N.push(z(document))};return document.readyState==="interactive"||document.readyState==="complete"?X():(N.push(Sr("DOMContentLoaded",()=>{In({type:Dt.DomContentLoaded,data:{}}),I==="DOMContentLoaded"&&X()})),N.push(Sr("load",()=>{In({type:Dt.Load,data:{}}),I==="load"&&X()},window))),()=>{N.forEach(Y=>Y()),me.destroy(),pg=void 0,ioe()}}catch(N){console.warn(N)}}function Soe(t){if(!pg)throw new Error("please take full snapshot after start recording");pg(t)}Wo.mirror=xi;Wo.takeFullSnapshot=Soe;function xoe(t,e){try{return t?t(e):new fO}catch{return console.warn("Unable to initialize CanvasManager"),new fO}}const Toe=3,Ioe=5;function u0(t){return t>9999999999?t:t*1e3}function tb(t){return t>9999999999?t/1e3:t}function Op(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:Dt.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:ki(e,10,1e3)}}),e.category==="console")))}const Ooe="button,a";function JL(t){return t.closest(Ooe)||t}function XL(t){const e=QL(t);return!e||!(e instanceof Element)?e:JL(e)}function QL(t){return Coe(t)?t.target:t}function Coe(t){return typeof t=="object"&&!!t&&"target"in t}let Ao;function Roe(t){return Ao||(Ao=[],Doe()),Ao.push(t),()=>{const e=Ao?Ao.indexOf(t):-1;e>-1&&Ao.splice(e,1)}}function Doe(){Kn(pn,"open",function(t){return function(...e){if(Ao)try{Ao.forEach(n=>n())}catch{}return t.apply(pn,e)}})}function koe(t,e,n){t.handleClick(e,n)}class Aoe{constructor(e,n,r=Op){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const e=Roe(()=>{this._lastMutation=pO()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(Poe(n,this._ignoreSelector)||!Moe(e))return;const r={timestamp:tb(e.timestamp),clickBreadcrumb:e,clickCount:0,node:n};this._clicks.some(i=>i.node===r.node&&Math.abs(i.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=tb(e)}registerScroll(e=Date.now()){this._lastScroll=tb(e)}registerClick(e){const n=JL(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){const e=[],n=pO();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&e.push(r)});for(const r of e){const i=this._clicks.indexOf(r);i>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(i,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,i=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!r&&!i,{clickCount:o,clickBreadcrumb:a}=e;if(s){const c=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,l=c<this._timeout*1e3?"mutation":"timeout",u={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:pn.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:l,clickCount:o||1}};this._addBreadcrumbEvent(n,u);return}if(o>1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:pn.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const Noe=["A","BUTTON","INPUT"];function Poe(t,e){return!!(!Noe.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function Moe(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function pO(){return Date.now()/1e3}function Loe(t,e){try{if(!Foe(e))return;const{source:n}=e.data;if(n===kt.Mutation&&t.registerMutation(e.timestamp),n===kt.Scroll&&t.registerScroll(e.timestamp),$oe(e)){const{type:r,id:i}=e.data,s=Wo.mirror.getNode(i);s instanceof HTMLElement&&r===hr.Click&&t.registerClick(s)}}catch{}}function Foe(t){return t.type===Toe}function $oe(t){return t.data.source===kt.MouseInteraction}function ms(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var hg;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(hg||(hg={}));const joe=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Uoe(t){const e={};for(const n in t)if(joe.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}const Boe=t=>e=>{if(!t.isEnabled())return;const n=zoe(e);if(!n)return;const r=e.name==="click",i=r?e.event:void 0;r&&t.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&koe(t.clickDetector,n,XL(e.event)),Op(t,n)};function e2(t,e){const n=Wo.mirror.getId(t),r=n&&Wo.mirror.getNode(n),i=r&&Wo.mirror.getMeta(r),s=i&&Hoe(i)?i:null;return{message:e,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(o=>o.type===hg.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:Uoe(s.attributes)}}:{}}}function zoe(t){const{target:e,message:n}=Voe(t);return ms({category:`ui.${t.name}`,...e2(e,n)})}function Voe(t){const e=t.name==="click";let n,r=null;try{r=e?XL(t.event):QL(t.event),n=ca(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function Hoe(t){return t.type===hg.Element}function Woe(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=qoe(e);n&&Op(t,n)}function qoe(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s,target:o}=t;if(!o||Goe(o)||!s)return null;const a=e||r||i,c=s.length===1;if(!a&&c)return null;const l=ca(o,{maxStringLength:200})||"<unknown>",u=e2(o,l);return ms({category:"ui.keyDown",message:l,data:{...u.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:i,key:s}})}function Goe(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}const hO={resource:Xoe,paint:Koe,navigation:Joe};function Zoe(t){return t.map(Yoe).filter(Boolean)}function Yoe(t){return hO[t.entryType]?hO[t.entryType](t):null}function uu(t){return((ni||pn.performance.timeOrigin)+t)/1e3}function Koe(t){const{duration:e,entryType:n,name:r,startTime:i}=t,s=uu(i);return{type:n,name:r,start:s,end:s+e,data:void 0}}function Joe(t){const{entryType:e,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:m,type:h}=t;return i===0?null:{type:`${e}.${h}`,start:uu(p),end:uu(s),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:s,redirectCount:f}}}function Xoe(t){const{entryType:e,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:l}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:uu(s),end:uu(i),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:a}}}function Qoe(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,i=t.value,s=uu(i);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:s,end:s,data:{value:i,size:i,nodeId:r?Wo.mirror.getId(r):void 0}}}function eae(t){function e(i){t.performanceEntries.includes(i)||t.performanceEntries.push(i)}function n({entries:i}){i.forEach(e)}const r=[];return["navigation","paint","resource"].forEach(i=>{r.push(su(i,n))}),r.push(cL(({metric:i})=>{t.replayPerformanceEntries.push(Qoe(i))})),()=>{r.forEach(i=>i())}}const ln=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,tae='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([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]),i=new t([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]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["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"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function nae(){const t=new Blob([tae]);return URL.createObjectURL(t)}function vr(t,e){ln&&(ye.info(t),e&&t2(t))}function Cl(t,e){ln&&(ye.info(t),e&&setTimeout(()=>{t2(t)},0))}function t2(t){ua({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class d0 extends Error{constructor(){super(`Event buffer exceeded maximum size of ${i0}.`)}}class n2{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>i0)throw new d0;this.events.push(e)}finish(){return new Promise(e=>{const n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(n=>n.timestamp).sort()[0];return e?u0(e):null}}class rae{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():n()},{once:!0}),this._worker.addEventListener("error",r=>{n(r)},{once:!0})}),this._ensureReadyPromise)}destroy(){vr("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(e,n){const r=this._getAndIncrementId();return new Promise((i,s)=>{const o=({data:a})=>{const c=a;if(c.method===e&&c.id===r){if(this._worker.removeEventListener("message",o),!c.success){ln&&ye.error("[Replay]",c.response),s(new Error("Error in compression worker"));return}i(c.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:e,arg:n})})}_getAndIncrementId(){return this._id++}}class iae{constructor(e){this._worker=new rae(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const n=u0(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>i0?Promise.reject(new d0):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{ln&&ye.warn('[Replay] Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class sae{constructor(e){this._fallback=new n2,this._compression=new iae(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{vr("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:n}=this._fallback,r=[];for(const i of e)r.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._used=this._compression;try{await Promise.all(r)}catch(i){ln&&ye.warn("[Replay] Failed to add events when switching buffers.",i)}}}function oae({useCompression:t,workerUrl:e}){if(t&&window.Worker){const n=aae(e);if(n)return n}return vr("[Replay] Using simple buffer"),new n2}function aae(t){try{const e=t||cae();if(!e)return;vr(`[Replay] Using compression worker${t?` from ${t}`:""}`);const n=new Worker(e);return new sae(n)}catch{vr("[Replay] Failed to create compression worker")}}function cae(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?nae():""}function f0(){try{return"sessionStorage"in pn&&!!pn.sessionStorage}catch{return!1}}function lae(t){uae(),t.session=void 0}function uae(){if(f0())try{pn.sessionStorage.removeItem(n0)}catch{}}function r2(t){return t===void 0?!1:Math.random()<t}function i2(t){const e=Date.now(),n=t.id||Rn(),r=t.started||e,i=t.lastActivity||e,s=t.segmentId||0,o=t.sampled,a=t.previousSessionId;return{id:n,started:r,lastActivity:i,segmentId:s,sampled:o,previousSessionId:a}}function p0(t){if(f0())try{pn.sessionStorage.setItem(n0,JSON.stringify(t))}catch{}}function dae(t,e){return r2(t)?"session":e?"buffer":!1}function mO({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const i=dae(t,e),s=i2({sampled:i,previousSessionId:r});return n&&p0(s),s}function fae(t){if(!f0())return null;try{const e=pn.sessionStorage.getItem(n0);if(!e)return null;const n=JSON.parse(e);return Cl("[Replay] Loading existing session",t),i2(n)}catch{return null}}function ew(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function s2(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return ew(t.started,e,r)||ew(t.lastActivity,n,r)}function o2(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!s2(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function nb({traceInternals:t,sessionIdleExpire:e,maxReplayDuration:n,previousSessionId:r},i){const s=i.stickySession&&fae(t);return s?o2(s,{sessionIdleExpire:e,maxReplayDuration:n})?(Cl("[Replay] Session in sessionStorage is expired, creating new one..."),mO(i,{previousSessionId:s.id})):s:(Cl("[Replay] Creating new session",t),mO(i,{previousSessionId:r}))}function pae(t){return t.type===Dt.Custom}function h0(t,e,n){return c2(t,e)?(a2(t,e,n),!0):!1}function hae(t,e,n){return c2(t,e)?a2(t,e,n):Promise.resolve(null)}async function a2(t,e,n){if(!t.eventBuffer)return null;try{n&&t.recordingMode==="buffer"&&t.eventBuffer.clear(),n&&(t.eventBuffer.hasCheckout=!0);const r=t.getOptions(),i=mae(e,r.beforeAddRecordingEvent);return i?await t.eventBuffer.addEvent(i):void 0}catch(r){const i=r&&r instanceof d0?"addEventSizeExceeded":"addEvent";ln&&ye.error(r),await t.stop({reason:i});const s=Ut();s&&s.recordDroppedEvent("internal_sdk_error","replay")}}function c2(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=u0(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(vr(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1):!0}function mae(t,e){try{if(typeof e=="function"&&pae(t))return e(t)}catch(n){return ln&&ye.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return t}function m0(t){return!t.type}function tw(t){return t.type==="transaction"}function gae(t){return t.type==="replay_event"}function gO(t){return t.type==="feedback"}function l2(t){const e=bae();return(n,r)=>{if(!t.isEnabled()||!m0(n)&&!tw(n))return;const i=r&&r.statusCode;if(!(e&&(!i||i<200||i>=300))){if(tw(n)){yae(t,n);return}vae(t,n)}}}function yae(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}function vae(t,e){const n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||setTimeout(()=>{t.sendBufferedReplayOrFlush()})}function bae(){const t=Ut();if(!t)return!1;const e=t.getTransport();return e&&e.send.__sentry__baseTransport__||!1}function _ae(t){return e=>{!t.isEnabled()||!m0(e)||wae(t,e)}}function wae(t,e){const n=e.exception&&e.exception.values&&e.exception.values[0].value;if(typeof n=="string"&&(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=ms({category:"replay.hydrate-error"});Op(t,r)}}function Eae(t,e){return t.type||!t.exception||!t.exception.values||!t.exception.values.length?!1:!!(e.originalException&&e.originalException.__rrweb__)}function Sae(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:Dt.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function xae(t,e){return t.recordingMode!=="buffer"||e.message===r0||!e.exception||e.type?!1:r2(t.getOptions().errorSampleRate)}function Tae(t,e=!1){const n=e?l2(t):void 0;return Object.assign((r,i)=>t.isEnabled()?gae(r)?(delete r.breadcrumbs,r):!m0(r)&&!tw(r)&&!gO(r)||!t.checkAndHandleExpiredSession()?r:gO(r)?(t.flush(),r.contexts.feedback.replay_id=t.getSessionId(),Sae(t,r),r):Eae(r,i)&&!t.getOptions()._experiments.captureExceptions?(ln&&ye.log("[Replay] Ignoring error from rrweb internals",r),null):((xae(t,r)||t.recordingMode==="session")&&(r.tags={...r.tags,replayId:t.getSessionId()}),n&&n(r,{statusCode:200}),r):r,{id:"Replay"})}function Ny(t,e){return e.map(({type:n,start:r,end:i,name:s,data:o})=>{const a=t.throttledAddEvent({type:Dt.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:i,data:o}}});return typeof a=="string"?Promise.resolve(null):a})}function Iae(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function Oae(t){return e=>{if(!t.isEnabled())return;const n=Iae(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(Ny(t,[n]),!1)))}}function Cae(t,e){return ln&&t.getOptions()._experiments.traceInternals?!1:YM(e,Ut())}function Py(t,e){t.isEnabled()&&e!==null&&(Cae(t,e.name)||t.addUpdate(()=>(Ny(t,[e]),!0)))}function Rae(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:i}=t;if(!n)return null;const{method:s,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:s,statusCode:i?i.status:void 0}}}function Dae(t){return e=>{if(!t.isEnabled())return;const n=Rae(e);Py(t,n)}}function kae(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,i=r[Ys];if(!e||!n||!i)return null;const{method:s,url:o,status_code:a}=i;return o===void 0?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:s,statusCode:a}}}function Aae(t){return e=>{if(!t.isEnabled())return;const n=kae(e);Py(t,n)}}function My(t,e){if(t)try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=p2(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function u2(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function d2(t){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[p2(t)];if(!t)return[void 0]}catch{return ln&&ye.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return ln&&ye.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function mg(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function f2(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:a,response:c}=e;return{type:t,start:n/1e3,end:r/1e3,name:i,data:xr({method:s,statusCode:o,request:a,response:c})}}function Vf(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function qo(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:i,warnings:s}=Nae(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function nw(t,e){return Object.keys(t).reduce((n,r)=>{const i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=t[r]),n},{})}function p2(t){return new URLSearchParams(t).toString()}function Nae(t){if(!t||typeof t!="string")return{body:t};const e=t.length>eO,n=Pae(t);if(e){const r=t.slice(0,eO);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function Pae(t){const e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function gg(t,e){const n=Mae(t);return Iu(n,e)}function Mae(t,e=pn.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(pn.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function Lae(t,e,n){try{const r=await $ae(t,e,n),i=f2("resource.fetch",r);Py(n.replay,i)}catch(r){ln&&ye.error("[Replay] Failed to capture fetch breadcrumb",r)}}function Fae(t,e,n){const{input:r,response:i}=e,s=r?h2(r):void 0,o=My(s,n.textEncoder),a=i?u2(i.headers.get("content-length")):void 0;o!==void 0&&(t.data.request_body_size=o),a!==void 0&&(t.data.response_body_size=a)}async function $ae(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=e,{url:o,method:a,status_code:c=0,request_body_size:l,response_body_size:u}=t.data,d=gg(o,n.networkDetailAllowUrls)&&!gg(o,n.networkDetailDenyUrls),f=d?jae(n,e.input,l):Vf(l),p=await Uae(d,n,e.response,u);return{startTimestamp:i,endTimestamp:s,url:o,method:a,statusCode:c,request:f,response:p}}function jae({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const i=n?Vae(n,e):{};if(!t)return qo(i,r,void 0);const s=h2(n),[o,a]=d2(s),c=qo(i,r,o);return a?mg(c,a):c}async function Uae(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},i,s){if(!t&&s!==void 0)return Vf(s);const o=i?m2(i.headers,r):{};if(!i||!e&&s!==void 0)return qo(o,s,void 0);const[a,c]=await zae(i),l=Bae(a,{networkCaptureBodies:e,textEncoder:n,responseBodySize:s,captureDetails:t,headers:o});return c?mg(l,c):l}function Bae(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:i,headers:s}){try{const o=t&&t.length&&r===void 0?My(t,n):r;return i?e?qo(s,o,t):qo(s,o,void 0):Vf(o)}catch(o){return ln&&ye.warn("[Replay] Failed to serialize response body",o),qo(s,r,void 0)}}async function zae(t){const e=Hae(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await Wae(e)]}catch(n){return ln&&ye.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function h2(t=[]){if(!(t.length!==2||typeof t[1]!="object"))return t[1].body}function m2(t,e){const n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function Vae(t,e){return t.length===1&&typeof t[0]!="string"?yO(t[0],e):t.length===2?yO(t[1],e):{}}function yO(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?m2(n,e):Array.isArray(n)?{}:nw(n,e):{}}function Hae(t){try{return t.clone()}catch(e){ln&&ye.warn("[Replay] Failed to clone response body",e)}}function Wae(t){return new Promise((e,n)=>{const r=setTimeout(()=>n(new Error("Timeout while trying to read response body")),500);qae(t).then(i=>e(i),i=>n(i)).finally(()=>clearTimeout(r))})}async function qae(t){return await t.text()}async function Gae(t,e,n){try{const r=Yae(t,e,n),i=f2("resource.xhr",r);Py(n.replay,i)}catch(r){ln&&ye.error("[Replay] Failed to capture xhr breadcrumb",r)}}function Zae(t,e,n){const{xhr:r,input:i}=e;if(!r)return;const s=My(i,n.textEncoder),o=r.getResponseHeader("content-length")?u2(r.getResponseHeader("content-length")):Qae(r.response,r.responseType,n.textEncoder);s!==void 0&&(t.data.request_body_size=s),o!==void 0&&(t.data.response_body_size=o)}function Yae(t,e,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:a}=e,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:f}=t.data;if(!c)return null;if(!a||!gg(c,n.networkDetailAllowUrls)||gg(c,n.networkDetailDenyUrls)){const S=Vf(d),_=Vf(f);return{startTimestamp:i,endTimestamp:s,url:c,method:l,statusCode:u,request:S,response:_}}const p=a[Ys],m=p?nw(p.request_headers,n.networkRequestHeaders):{},h=nw(Kae(a),n.networkResponseHeaders),[g,y]=n.networkCaptureBodies?d2(o):[void 0],[v,b]=n.networkCaptureBodies?Jae(a):[void 0],E=qo(m,d,g),w=qo(h,f,v);return{startTimestamp:i,endTimestamp:s,url:c,method:l,statusCode:u,request:y?mg(E,y):E,response:b?mg(w,b):w}}function Kae(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
423
+ `).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i.toLowerCase()]=s,n},{}):{}}function Jae(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return Xae(t.response,t.responseType)}catch(n){e.push(n)}return ln&&ye.warn("[Replay] Failed to get xhr response body",...e),[void 0]}function Xae(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch{return ln&&ye.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return ln&&ye.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Qae(t,e,n){try{const r=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return My(r,n)}catch{return}}function ece(t){const e=Ut();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a}=t.getOptions(),c={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a};e&&e.on?e.on("beforeAddBreadcrumb",(l,u)=>tce(c,l,u)):(_y(Dae(t)),Ey(Aae(t)))}catch{}}function tce(t,e,n){if(e.data)try{nce(e)&&ice(n)&&(Zae(e,n,t),Gae(e,n,t)),rce(e)&&sce(n)&&(Fae(e,n,t),Lae(e,n,t))}catch{ln&&ye.warn("Error when enriching network breadcrumb")}}function nce(t){return t.category==="xhr"}function rce(t){return t.category==="fetch"}function ice(t){return t&&t.xhr}function sce(t){return t&&t.response}let vO=null;function oce(t){return!!t.category}const ace=t=>e=>{if(!t.isEnabled())return;const n=cce(e);n&&Op(t,n)};function cce(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();return vO===e||!e||(vO=e,!oce(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))?null:e.category==="console"?lce(e):ms(e)}function lce(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||e.length===0)return ms(t);let n=!1;const r=e.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>bh?(n=!0,`${i.slice(0,bh)}…`):i;if(typeof i=="object")try{const s=ki(i,7);return JSON.stringify(s).length>bh?(n=!0,`${JSON.stringify(s,null,2).slice(0,bh)}…`):s}catch{}return i});return ms({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function uce(t){const e=si(),n=Ut();e.addScopeListener(ace(t)),pM(Boe(t)),wy(Oae(t)),ece(t);const r=Tae(t,!bO(n));n&&n.addEventProcessor?n.addEventProcessor(r):yne(r),bO(n)&&(n.on("beforeSendEvent",_ae(t)),n.on("afterSendEvent",l2(t)),n.on("createDsc",i=>{const s=t.getSessionId();s&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(i.replay_id=s)}),n.on("startTransaction",i=>{t.lastTransaction=i}),n.on("finishTransaction",i=>{t.lastTransaction=i}),n.on("beforeSendFeedback",(i,s)=>{const o=t.getSessionId();s&&s.includeReplay&&t.isEnabled()&&o&&i.contexts&&i.contexts.feedback&&(i.contexts.feedback.replay_id=o)}))}function bO(t){return!!(t&&t.on)}async function dce(t){try{return Promise.all(Ny(t,[fce(pn.performance.memory)]))}catch{return[]}}function fce(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function pce(t,e,n){let r,i,s;const o=n.maxWait?Math.max(n.maxWait,e):0;function a(){return c(),r=t(),r}function c(){i!==void 0&&clearTimeout(i),s!==void 0&&clearTimeout(s),i=s=void 0}function l(){return i!==void 0||s!==void 0?a():r}function u(){return i&&clearTimeout(i),i=setTimeout(a,e),o&&s===void 0&&(s=setTimeout(a,o)),r}return u.cancel=c,u.flush=l,u}function hce(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){ln&&ye.warn("[Replay] Received replay event after session expired.");return}const i=r||!e;e=!0,t.clickDetector&&Loe(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&i&&t.setInitialState(),!h0(t,n,i))return!0;if(!i)return!1;if(gce(t,i),t.session&&t.session.previousSessionId)return!0;if(t.recordingMode==="buffer"&&t.session&&t.eventBuffer){const s=t.eventBuffer.getEarliestTimestamp();s&&(vr(`[Replay] Updating session start time to earliest event in buffer to ${new Date(s)}`,t.getOptions()._experiments.traceInternals),t.session.started=s,t.getOptions().stickySession&&p0(t.session))}return t.recordingMode==="session"&&t.flush(),!0})}}function mce(t){const e=t.getOptions();return{type:Dt.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function gce(t,e){!e||!t.session||t.session.segmentId!==0||h0(t,mce(t),!1)}function yce(t,e,n,r){return va(SM(t,HS(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function vce({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}
424
+ `;if(typeof t=="string")n=`${r}${t}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+t.length),n.set(s),n.set(t,s.length)}return n}async function bce({client:t,scope:e,replayId:n,event:r}){const i=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,s={event_id:n,integrations:i};t.emit&&t.emit("preprocessEvent",r,s);const o=await RM(t.getOptions(),r,s,e,t,ba());if(!o)return null;o.platform=o.platform||"javascript";const a=t.getSdkMetadata&&t.getSdkMetadata(),{name:c,version:l}=a&&a.sdk||{};return o.sdk={...o.sdk,name:c||"sentry.javascript.unknown",version:l||"0.0.0"},o}async function _ce({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:i,session:s}){const o=vce({recordingData:t,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:l,initialTimestamp:u}=r,d=Ut(),f=si(),p=d&&d.getTransport(),m=d&&d.getDsn();if(!d||!p||!m||!s.sampled)return;const h={type:ise,replay_start_timestamp:u/1e3,timestamp:i/1e3,error_ids:c,trace_ids:l,urls:a,replay_id:e,segment_id:n,replay_type:s.sampled},g=await bce({scope:f,client:d,replayId:e,event:h});if(!g){d.recordDroppedEvent("event_processor","replay",h),vr("An event processor returned `null`, will not send event.");return}delete g.sdkProcessingMetadata;const y=yce(g,o,m,d.getOptions().tunnel);let v;try{v=await p.send(y)}catch(E){const w=new Error(r0);try{w.cause=E}catch{}throw w}if(!v)return v;if(typeof v.statusCode=="number"&&(v.statusCode<200||v.statusCode>=300))throw new g2(v.statusCode);const b=TM({},v);if(xM(b,"replay"))throw new y2(b);return v}class g2 extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class y2 extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function v2(t,e={count:0,interval:use}){const{recordingData:n,options:r}=t;if(n.length)try{return await _ce(t),!0}catch(i){if(i instanceof g2||i instanceof y2)throw i;if(Ote("Replays",{_retryCount:e.count}),ln&&r._experiments&&r._experiments.captureExceptions&&_p(i),e.count>=dse){const s=new Error(`${r0} - max retries exceeded`);try{s.cause=i}catch{}throw s}return e.interval*=++e.count,new Promise((s,o)=>{setTimeout(async()=>{try{await v2(t,e),s(!0)}catch(a){o(a)}},e.interval)})}}const b2="__THROTTLED",wce="__SKIPPED";function Ece(t,e,n){const r=new Map,i=a=>{const c=a-n;r.forEach((l,u)=>{u<c&&r.delete(u)})},s=()=>[...r.values()].reduce((a,c)=>a+c,0);let o=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(i(c),s()>=e){const u=o;return o=!0,u?wce:b2}o=!1;const l=r.get(c)||0;return r.set(c,l+1),t(...a)}}class No{constructor({options:e,recordingOptions:n}){No.prototype.__init.call(this),No.prototype.__init2.call(this),No.prototype.__init3.call(this),No.prototype.__init4.call(this),No.prototype.__init5.call(this),No.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:sse,sessionIdleExpire:ose},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=e,this._debouncedFlush=pce(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ece((o,a)=>hae(this,o,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:i}=this.getOptions(),s=r?{threshold:Math.min(fse,r),timeout:r,scrollTimeout:pse,ignoreSelector:i?i.join(","):""}:void 0;s&&(this.clickDetector=new Aoe(this,s))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:n,sessionSampleRate:r}=this._options;if(!(n<=0&&r<=0)){if(this._initializeSessionForSampling(e),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",Cl(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");Cl("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();const e=nb({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");Cl("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const e=nb({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=Wo({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:lse},emit:hce(this),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(this._isEnabled){this._isEnabled=!1;try{vr(`[Replay] Stopping Replay${n?` triggered by ${n}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,lae(this)}catch(r){this._handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),vr("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),vr("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();vr("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const n=e();this.recordingMode!=="buffer"&&n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&ew(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const e=`${pn.location.pathname}${pn.location.hash}${pn.location.search}`,n=`${pn.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){const r=this._throttledAddEvent(e,n);if(r===b2){const i=ms({category:"replay.throttled"});this.addUpdate(()=>!h0(this,{type:Ioe,timestamp:i.timestamp||0,data:{tag:"breadcrumb",payload:i,metric:!0}}))}return r}getCurrentRoute(){const e=this.lastTransaction||si().getTransaction(),r=(e&&Fn(e).data||{})[Ss];if(!(!e||!r||!["route","custom"].includes(r)))return Fn(e).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=oae({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){ln&&ye.error("[Replay]",e),ln&&this._options._experiments&&this._options._experiments.captureExceptions&&_p(e)}_initializeSessionForSampling(e){const n=this._options.errorSampleRate>0,r=nb({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const e=this.session;return o2(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{pn.document.addEventListener("visibilitychange",this._handleVisibilityChange),pn.addEventListener("blur",this._handleWindowBlur),pn.addEventListener("focus",this._handleWindowFocus),pn.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(uce(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}this._performanceCleanupCallback=eae(this)}_removeListeners(){try{pn.document.removeEventListener("visibilitychange",this._handleVisibilityChange),pn.removeEventListener("blur",this._handleWindowBlur),pn.removeEventListener("focus",this._handleWindowFocus),pn.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{pn.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=ms({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=ms({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{Woe(this,e)}}_doChangeToBackgroundTasks(e){!this.session||s2(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){vr("[Replay] Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:Dt.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){const e=Zoe(this.performanceEntries).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(Ny(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:n}=this;if(!e||!n||e.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){ln&&ye.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await dce(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const r=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await v2({replayId:e,recordingData:s,segmentId:i,eventContext:r,session:this.session,options:this.getOptions(),timestamp:n})}catch(n){this._handleException(n),this.stop({reason:"sendReplay"});const r=Ut();r&&r.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){ln&&ye.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,i=Date.now()-n;this._debouncedFlush.cancel();const s=i<this._options.minReplayDuration,o=i>this._options.maxReplayDuration+5e3;if(s||o){vr(`[Replay] Session duration (${Math.floor(i/1e3)}s) is too ${s?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),s&&this._debouncedFlush();return}const a=this.eventBuffer;if(a&&this.session.segmentId===0&&!a.hasCheckout&&vr("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(c){ln&&ye.error(c)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&p0(this.session)}__init6(){this._onMutationHandler=e=>{const n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=r&&n>r;if(n>i||s){const o=ms({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(o)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function Zu(t,e,n,r){const i=typeof r=="string"?r.split(","):[],s=[...t,...i,...e];return typeof n<"u"&&(typeof n=="string"&&s.push(`.${n}`),_c(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),s.join(",")}function Sce({mask:t,unmask:e,block:n,unblock:r,ignore:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,ignoreClass:l}){const u=['base[href="/"]'],d=Zu(t,[".sentry-mask","[data-sentry-mask]"],a,c),f=Zu(e,[".sentry-unmask","[data-sentry-unmask]"]),p={maskTextSelector:d,unmaskTextSelector:f,blockSelector:Zu(n,[".sentry-block","[data-sentry-block]",...u],s,o),unblockSelector:Zu(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Zu(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],l)};return s instanceof RegExp&&(p.blockClass=s),a instanceof RegExp&&(p.maskTextClass=a),p}function xce({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:i,value:s}){return!r||i.unmaskTextSelector&&t.matches(i.unmaskTextSelector)?s:n.includes(e)||e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s}const _O='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Tce=["content-length","content-type","accept"];let wO=!1;const Ice=t=>new Ly(t);class Ly{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=ase,flushMaxDelay:n=cse,minReplayDuration:r=hse,maxReplayDuration:i=tO,stickySession:s=!0,useCompression:o=!0,workerUrl:a,_experiments:c={},sessionSampleRate:l,errorSampleRate:u,maskAllText:d=!0,maskAllInputs:f=!0,blockAllMedia:p=!0,mutationBreadcrumbLimit:m=750,mutationLimit:h=1e4,slowClickTimeout:g=7e3,slowClickIgnoreSelectors:y=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:b=[],networkCaptureBodies:E=!0,networkRequestHeaders:w=[],networkResponseHeaders:S=[],mask:_=[],maskAttributes:O=["title","placeholder"],unmask:M=[],block:F=[],unblock:q=[],ignore:I=[],maskFn:$,beforeAddRecordingEvent:x,beforeErrorSampling:A,blockClass:P,blockSelector:B,maskInputOptions:J,maskTextClass:L,maskTextSelector:G,ignoreClass:U}={}){this.name=Ly.id;const C=Sce({mask:_,unmask:M,block:F,unblock:q,ignore:I,blockClass:P,blockSelector:B,maskTextClass:L,maskTextSelector:G,ignoreClass:U});if(this._recordingOptions={maskAllInputs:f,maskAllText:d,maskInputOptions:{...J||{},password:!0},maskTextFn:$,maskInputFn:$,maskAttributeFn:(Z,H,V)=>xce({maskAttributes:O,maskAllText:d,privacyOptions:C,key:Z,value:H,el:V}),...C,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Z=>{try{Z.__rrweb__=!0}catch{}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,mse),maxReplayDuration:Math.min(i,tO),stickySession:s,sessionSampleRate:l,errorSampleRate:u,useCompression:o,workerUrl:a,blockAllMedia:p,maskAllInputs:f,maskAllText:d,mutationBreadcrumbLimit:m,mutationLimit:h,slowClickTimeout:g,slowClickIgnoreSelectors:y,networkDetailAllowUrls:v,networkDetailDenyUrls:b,networkCaptureBodies:E,networkRequestHeaders:EO(w),networkResponseHeaders:EO(S),beforeAddRecordingEvent:x,beforeErrorSampling:A,_experiments:c},typeof l=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
425
+ This option is deprecated and will be removed soon.
426
+ Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
427
+ Sentry.init({ replaysSessionSampleRate: ${l} })`),this._initialOptions.sessionSampleRate=l),typeof u=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
428
+ This option is deprecated and will be removed soon.
429
+ Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
430
+ Sentry.init({ replaysOnErrorSampleRate: ${u} })`),this._initialOptions.errorSampleRate=u),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${_O}`:_O),this._isInitialized&&wI())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return wO}set _isInitialized(e){wO=e}setupOnce(){wI()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(e){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(e)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const e=Oce(this._initialOptions);this._replay=new No({options:e,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const n=Ut().getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}Ly.__initStatic();function Oce(t){const e=Ut(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...xr(t)};return n?(t.sessionSampleRate==null&&t.errorSampleRate==null&&n.replaysSessionSampleRate==null&&n.replaysOnErrorSampleRate==null&&_c(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),typeof n.replaysSessionSampleRate=="number"&&(r.sessionSampleRate=n.replaysSessionSampleRate),typeof n.replaysOnErrorSampleRate=="number"&&(r.errorSampleRate=n.replaysOnErrorSampleRate),r):(_c(()=>{console.warn("SDK client is not available.")}),r)}function EO(t){return[...Tce,...t.map(e=>e.toLowerCase())]}const _2="CaptureConsole",Cce=(t={})=>{const e=t.levels||eg;return{name:_2,setupOnce(){},setup(n){"console"in $t&&uM(({args:r,level:i})=>{Ut()!==n||!e.includes(i)||Rce(r,i)})}}},w2=Cce;Ki(_2,w2);function Rce(t,e){const n={level:bM(e),extra:{arguments:t}};DM(r=>{if(r.addEventProcessor(o=>(o.logger="console",wc(o,{handled:!1,type:"console"}),o)),e==="assert"&&t[0]===!1){const o=`Assertion failed: ${Qm(t.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",t.slice(1)),OI(o,n);return}const i=t.find(o=>o instanceof Error);if(e==="error"&&i){_p(i,n);return}const s=Qm(t," ");OI(s,n)})}const Hf=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,E2="ExtraErrorData",Dce=(t={})=>{const e=t.depth||3,n=t.captureErrorCause||!1;return{name:E2,setupOnce(){},processEvent(r,i){return kce(r,i,e,n)}}},S2=Dce;Ki(E2,S2);function kce(t,e={},n,r){if(!e.originalException||!Tl(e.originalException))return t;const i=e.originalException.name||e.originalException.constructor.name,s=Ace(e.originalException,r);if(s){const o={...t.contexts},a=ki(s,n);return bc(a)&&(la(a,"__sentry_skip_normalization__",!0),o[i]=a),{...t,contexts:o}}return t}function Ace(t,e){try{const n=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],r={};for(const i of Object.keys(t)){if(n.indexOf(i)!==-1)continue;const s=t[i];r[i]=Tl(s)?s.toString():s}if(e&&t.cause!==void 0&&(r.cause=Tl(t.cause)?t.cause.toString():t.cause),typeof t.toJSON=="function"){const i=t.toJSON();for(const s of Object.keys(i)){const o=i[s];r[s]=Tl(o)?o.toString():o}}return r}catch(n){Hf&&ye.error("Unable to extract extra data from the Error object:",n)}return null}var x2={exports:{}};/*!
431
+ localForage -- Offline Storage, Improved
432
+ Version 1.10.0
433
+ https://localforage.github.io/localForage
434
+ (c) 2013-2017 Mozilla, Apache License 2.0
435
+ */(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(l,u){if(!i[l]){if(!r[l]){var d=typeof zo=="function"&&zo;if(!u&&d)return d(l,!0);if(a)return a(l,!0);var f=new Error("Cannot find module '"+l+"'");throw f.code="MODULE_NOT_FOUND",f}var p=i[l]={exports:{}};r[l][0].call(p.exports,function(m){var h=r[l][1][m];return o(h||m)},p,p.exports,n,r,i,s)}return i[l].exports}for(var a=typeof zo=="function"&&zo,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(n,r,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var c=0,l=new o(m),u=s.document.createTextNode("");l.observe(u,{characterData:!0}),a=function(){u.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=m,a=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var g=s.document.createElement("script");g.onreadystatechange=function(){m(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},s.document.documentElement.appendChild(g)}:a=function(){setTimeout(m,0)};var f,p=[];function m(){f=!0;for(var g,y,v=p.length;v;){for(y=p,p=[],g=-1;++g<v;)y[g]();v=p.length}f=!1}r.exports=h;function h(g){p.push(g)===1&&!f&&a()}}).call(this,typeof dr<"u"?dr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,r,i){var s=n(1);function o(){}var a={},c=["REJECTED"],l=["FULFILLED"],u=["PENDING"];r.exports=d;function d(w){if(typeof w!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,w!==o&&h(this,w)}d.prototype.catch=function(w){return this.then(null,w)},d.prototype.then=function(w,S){if(typeof w!="function"&&this.state===l||typeof S!="function"&&this.state===c)return this;var _=new this.constructor(o);if(this.state!==u){var O=this.state===l?w:S;p(_,O,this.outcome)}else this.queue.push(new f(_,w,S));return _};function f(w,S,_){this.promise=w,typeof S=="function"&&(this.onFulfilled=S,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(w){a.resolve(this.promise,w)},f.prototype.otherCallFulfilled=function(w){p(this.promise,this.onFulfilled,w)},f.prototype.callRejected=function(w){a.reject(this.promise,w)},f.prototype.otherCallRejected=function(w){p(this.promise,this.onRejected,w)};function p(w,S,_){s(function(){var O;try{O=S(_)}catch(M){return a.reject(w,M)}O===w?a.reject(w,new TypeError("Cannot resolve promise with itself")):a.resolve(w,O)})}a.resolve=function(w,S){var _=g(m,S);if(_.status==="error")return a.reject(w,_.value);var O=_.value;if(O)h(w,O);else{w.state=l,w.outcome=S;for(var M=-1,F=w.queue.length;++M<F;)w.queue[M].callFulfilled(S)}return w},a.reject=function(w,S){w.state=c,w.outcome=S;for(var _=-1,O=w.queue.length;++_<O;)w.queue[_].callRejected(S);return w};function m(w){var S=w&&w.then;if(w&&(typeof w=="object"||typeof w=="function")&&typeof S=="function")return function(){S.apply(w,arguments)}}function h(w,S){var _=!1;function O(I){_||(_=!0,a.reject(w,I))}function M(I){_||(_=!0,a.resolve(w,I))}function F(){S(M,O)}var q=g(F);q.status==="error"&&O(q.value)}function g(w,S){var _={};try{_.value=w(S),_.status="success"}catch(O){_.status="error",_.value=O}return _}d.resolve=y;function y(w){return w instanceof this?w:a.resolve(new this(o),w)}d.reject=v;function v(w){var S=new this(o);return a.reject(S,w)}d.all=b;function b(w){var S=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=w.length,O=!1;if(!_)return this.resolve([]);for(var M=new Array(_),F=0,q=-1,I=new this(o);++q<_;)$(w[q],q);return I;function $(x,A){S.resolve(x).then(P,function(B){O||(O=!0,a.reject(I,B))});function P(B){M[A]=B,++F===_&&!O&&(O=!0,a.resolve(I,M))}}}d.race=E;function E(w){var S=this;if(Object.prototype.toString.call(w)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=w.length,O=!1;if(!_)return this.resolve([]);for(var M=-1,F=new this(o);++M<_;)q(w[M]);return F;function q(I){S.resolve(I).then(function($){O||(O=!0,a.resolve(F,$))},function($){O||(O=!0,a.reject(F,$))})}}},{1:1}],3:[function(n,r,i){(function(s){typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof dr<"u"?dr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,r,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j};function o(j,Q){if(!(j instanceof Q))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=a();function l(){try{if(!c||!c.open)return!1;var j=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),Q=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!j||Q)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function u(j,Q){j=j||[],Q=Q||{};try{return new Blob(j,Q)}catch(re){if(re.name!=="TypeError")throw re;for(var W=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,ie=new W,oe=0;oe<j.length;oe+=1)ie.append(j[oe]);return ie.getBlob(Q.type)}}typeof Promise>"u"&&n(3);var d=Promise;function f(j,Q){Q&&j.then(function(W){Q(null,W)},function(W){Q(W)})}function p(j,Q,W){typeof Q=="function"&&j.then(Q),typeof W=="function"&&j.catch(W)}function m(j){return typeof j!="string"&&(console.warn(j+" used as a key, but it is not a string."),j=String(j)),j}function h(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var g="local-forage-detect-blob-support",y=void 0,v={},b=Object.prototype.toString,E="readonly",w="readwrite";function S(j){for(var Q=j.length,W=new ArrayBuffer(Q),ie=new Uint8Array(W),oe=0;oe<Q;oe++)ie[oe]=j.charCodeAt(oe);return W}function _(j){return new d(function(Q){var W=j.transaction(g,w),ie=u([""]);W.objectStore(g).put(ie,"key"),W.onabort=function(oe){oe.preventDefault(),oe.stopPropagation(),Q(!1)},W.oncomplete=function(){var oe=navigator.userAgent.match(/Chrome\/(\d+)/),re=navigator.userAgent.match(/Edge\//);Q(re||!oe||parseInt(oe[1],10)>=43)}}).catch(function(){return!1})}function O(j){return typeof y=="boolean"?d.resolve(y):_(j).then(function(Q){return y=Q,y})}function M(j){var Q=v[j.name],W={};W.promise=new d(function(ie,oe){W.resolve=ie,W.reject=oe}),Q.deferredOperations.push(W),Q.dbReady?Q.dbReady=Q.dbReady.then(function(){return W.promise}):Q.dbReady=W.promise}function F(j){var Q=v[j.name],W=Q.deferredOperations.pop();if(W)return W.resolve(),W.promise}function q(j,Q){var W=v[j.name],ie=W.deferredOperations.pop();if(ie)return ie.reject(Q),ie.promise}function I(j,Q){return new d(function(W,ie){if(v[j.name]=v[j.name]||C(),j.db)if(Q)M(j),j.db.close();else return W(j.db);var oe=[j.name];Q&&oe.push(j.version);var re=c.open.apply(c,oe);Q&&(re.onupgradeneeded=function(be){var Se=re.result;try{Se.createObjectStore(j.storeName),be.oldVersion<=1&&Se.createObjectStore(g)}catch(De){if(De.name==="ConstraintError")console.warn('The database "'+j.name+'" has been upgraded from version '+be.oldVersion+" to version "+be.newVersion+', but the storage "'+j.storeName+'" already exists.');else throw De}}),re.onerror=function(be){be.preventDefault(),ie(re.error)},re.onsuccess=function(){var be=re.result;be.onversionchange=function(Se){Se.target.close()},W(be),F(j)}})}function $(j){return I(j,!1)}function x(j){return I(j,!0)}function A(j,Q){if(!j.db)return!0;var W=!j.db.objectStoreNames.contains(j.storeName),ie=j.version<j.db.version,oe=j.version>j.db.version;if(ie&&(j.version!==Q&&console.warn('The database "'+j.name+`" can't be downgraded from version `+j.db.version+" to version "+j.version+"."),j.version=j.db.version),oe||W){if(W){var re=j.db.version+1;re>j.version&&(j.version=re)}return!0}return!1}function P(j){return new d(function(Q,W){var ie=new FileReader;ie.onerror=W,ie.onloadend=function(oe){var re=btoa(oe.target.result||"");Q({__local_forage_encoded_blob:!0,data:re,type:j.type})},ie.readAsBinaryString(j)})}function B(j){var Q=S(atob(j.data));return u([Q],{type:j.type})}function J(j){return j&&j.__local_forage_encoded_blob}function L(j){var Q=this,W=Q._initReady().then(function(){var ie=v[Q._dbInfo.name];if(ie&&ie.dbReady)return ie.dbReady});return p(W,j,j),W}function G(j){M(j);for(var Q=v[j.name],W=Q.forages,ie=0;ie<W.length;ie++){var oe=W[ie];oe._dbInfo.db&&(oe._dbInfo.db.close(),oe._dbInfo.db=null)}return j.db=null,$(j).then(function(re){return j.db=re,A(j)?x(j):re}).then(function(re){j.db=Q.db=re;for(var be=0;be<W.length;be++)W[be]._dbInfo.db=re}).catch(function(re){throw q(j,re),re})}function U(j,Q,W,ie){ie===void 0&&(ie=1);try{var oe=j.db.transaction(j.storeName,Q);W(null,oe)}catch(re){if(ie>0&&(!j.db||re.name==="InvalidStateError"||re.name==="NotFoundError"))return d.resolve().then(function(){if(!j.db||re.name==="NotFoundError"&&!j.db.objectStoreNames.contains(j.storeName)&&j.version<=j.db.version)return j.db&&(j.version=j.db.version+1),x(j)}).then(function(){return G(j).then(function(){U(j,Q,W,ie-1)})}).catch(W);W(re)}}function C(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Z(j){var Q=this,W={db:null};if(j)for(var ie in j)W[ie]=j[ie];var oe=v[W.name];oe||(oe=C(),v[W.name]=oe),oe.forages.push(Q),Q._initReady||(Q._initReady=Q.ready,Q.ready=L);var re=[];function be(){return d.resolve()}for(var Se=0;Se<oe.forages.length;Se++){var De=oe.forages[Se];De!==Q&&re.push(De._initReady().catch(be))}var ke=oe.forages.slice(0);return d.all(re).then(function(){return W.db=oe.db,$(W)}).then(function(Ne){return W.db=Ne,A(W,Q._defaultConfig.version)?x(W):Ne}).then(function(Ne){W.db=oe.db=Ne,Q._dbInfo=W;for(var Ye=0;Ye<ke.length;Ye++){var Nt=ke[Ye];Nt!==Q&&(Nt._dbInfo.db=W.db,Nt._dbInfo.version=W.version)}})}function H(j,Q){var W=this;j=m(j);var ie=new d(function(oe,re){W.ready().then(function(){U(W._dbInfo,E,function(be,Se){if(be)return re(be);try{var De=Se.objectStore(W._dbInfo.storeName),ke=De.get(j);ke.onsuccess=function(){var Ne=ke.result;Ne===void 0&&(Ne=null),J(Ne)&&(Ne=B(Ne)),oe(Ne)},ke.onerror=function(){re(ke.error)}}catch(Ne){re(Ne)}})}).catch(re)});return f(ie,Q),ie}function V(j,Q){var W=this,ie=new d(function(oe,re){W.ready().then(function(){U(W._dbInfo,E,function(be,Se){if(be)return re(be);try{var De=Se.objectStore(W._dbInfo.storeName),ke=De.openCursor(),Ne=1;ke.onsuccess=function(){var Ye=ke.result;if(Ye){var Nt=Ye.value;J(Nt)&&(Nt=B(Nt));var Qt=j(Nt,Ye.key,Ne++);Qt!==void 0?oe(Qt):Ye.continue()}else oe()},ke.onerror=function(){re(ke.error)}}catch(Ye){re(Ye)}})}).catch(re)});return f(ie,Q),ie}function ce(j,Q,W){var ie=this;j=m(j);var oe=new d(function(re,be){var Se;ie.ready().then(function(){return Se=ie._dbInfo,b.call(Q)==="[object Blob]"?O(Se.db).then(function(De){return De?Q:P(Q)}):Q}).then(function(De){U(ie._dbInfo,w,function(ke,Ne){if(ke)return be(ke);try{var Ye=Ne.objectStore(ie._dbInfo.storeName);De===null&&(De=void 0);var Nt=Ye.put(De,j);Ne.oncomplete=function(){De===void 0&&(De=null),re(De)},Ne.onabort=Ne.onerror=function(){var Qt=Nt.error?Nt.error:Nt.transaction.error;be(Qt)}}catch(Qt){be(Qt)}})}).catch(be)});return f(oe,W),oe}function le(j,Q){var W=this;j=m(j);var ie=new d(function(oe,re){W.ready().then(function(){U(W._dbInfo,w,function(be,Se){if(be)return re(be);try{var De=Se.objectStore(W._dbInfo.storeName),ke=De.delete(j);Se.oncomplete=function(){oe()},Se.onerror=function(){re(ke.error)},Se.onabort=function(){var Ne=ke.error?ke.error:ke.transaction.error;re(Ne)}}catch(Ne){re(Ne)}})}).catch(re)});return f(ie,Q),ie}function ge(j){var Q=this,W=new d(function(ie,oe){Q.ready().then(function(){U(Q._dbInfo,w,function(re,be){if(re)return oe(re);try{var Se=be.objectStore(Q._dbInfo.storeName),De=Se.clear();be.oncomplete=function(){ie()},be.onabort=be.onerror=function(){var ke=De.error?De.error:De.transaction.error;oe(ke)}}catch(ke){oe(ke)}})}).catch(oe)});return f(W,j),W}function Re(j){var Q=this,W=new d(function(ie,oe){Q.ready().then(function(){U(Q._dbInfo,E,function(re,be){if(re)return oe(re);try{var Se=be.objectStore(Q._dbInfo.storeName),De=Se.count();De.onsuccess=function(){ie(De.result)},De.onerror=function(){oe(De.error)}}catch(ke){oe(ke)}})}).catch(oe)});return f(W,j),W}function Ge(j,Q){var W=this,ie=new d(function(oe,re){if(j<0){oe(null);return}W.ready().then(function(){U(W._dbInfo,E,function(be,Se){if(be)return re(be);try{var De=Se.objectStore(W._dbInfo.storeName),ke=!1,Ne=De.openKeyCursor();Ne.onsuccess=function(){var Ye=Ne.result;if(!Ye){oe(null);return}j===0||ke?oe(Ye.key):(ke=!0,Ye.advance(j))},Ne.onerror=function(){re(Ne.error)}}catch(Ye){re(Ye)}})}).catch(re)});return f(ie,Q),ie}function st(j){var Q=this,W=new d(function(ie,oe){Q.ready().then(function(){U(Q._dbInfo,E,function(re,be){if(re)return oe(re);try{var Se=be.objectStore(Q._dbInfo.storeName),De=Se.openKeyCursor(),ke=[];De.onsuccess=function(){var Ne=De.result;if(!Ne){ie(ke);return}ke.push(Ne.key),Ne.continue()},De.onerror=function(){oe(De.error)}}catch(Ne){oe(Ne)}})}).catch(oe)});return f(W,j),W}function He(j,Q){Q=h.apply(this,arguments);var W=this.config();j=typeof j!="function"&&j||{},j.name||(j.name=j.name||W.name,j.storeName=j.storeName||W.storeName);var ie=this,oe;if(!j.name)oe=d.reject("Invalid arguments");else{var re=j.name===W.name&&ie._dbInfo.db,be=re?d.resolve(ie._dbInfo.db):$(j).then(function(Se){var De=v[j.name],ke=De.forages;De.db=Se;for(var Ne=0;Ne<ke.length;Ne++)ke[Ne]._dbInfo.db=Se;return Se});j.storeName?oe=be.then(function(Se){if(Se.objectStoreNames.contains(j.storeName)){var De=Se.version+1;M(j);var ke=v[j.name],Ne=ke.forages;Se.close();for(var Ye=0;Ye<Ne.length;Ye++){var Nt=Ne[Ye];Nt._dbInfo.db=null,Nt._dbInfo.version=De}var Qt=new d(function(en,$n){var kn=c.open(j.name,De);kn.onerror=function(ci){var Nu=kn.result;Nu.close(),$n(ci)},kn.onupgradeneeded=function(){var ci=kn.result;ci.deleteObjectStore(j.storeName)},kn.onsuccess=function(){var ci=kn.result;ci.close(),en(ci)}});return Qt.then(function(en){ke.db=en;for(var $n=0;$n<Ne.length;$n++){var kn=Ne[$n];kn._dbInfo.db=en,F(kn._dbInfo)}}).catch(function(en){throw(q(j,en)||d.resolve()).catch(function(){}),en})}}):oe=be.then(function(Se){M(j);var De=v[j.name],ke=De.forages;Se.close();for(var Ne=0;Ne<ke.length;Ne++){var Ye=ke[Ne];Ye._dbInfo.db=null}var Nt=new d(function(Qt,en){var $n=c.deleteDatabase(j.name);$n.onerror=function(){var kn=$n.result;kn&&kn.close(),en($n.error)},$n.onblocked=function(){console.warn('dropInstance blocked for database "'+j.name+'" until all open connections are closed')},$n.onsuccess=function(){var kn=$n.result;kn&&kn.close(),Qt(kn)}});return Nt.then(function(Qt){De.db=Qt;for(var en=0;en<ke.length;en++){var $n=ke[en];F($n._dbInfo)}}).catch(function(Qt){throw(q(j,Qt)||d.resolve()).catch(function(){}),Qt})})}return f(oe,Q),oe}var gt={_driver:"asyncStorage",_initStorage:Z,_support:l(),iterate:V,getItem:H,setItem:ce,removeItem:le,clear:ge,length:Re,key:Ge,keys:st,dropInstance:He};function D(){return typeof openDatabase=="function"}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue="~~local_forage_type~",K=/^~~local_forage_type~([^~]+)~/,R="__lfsc__:",N=R.length,z="arbf",X="blob",Y="si08",ee="ui08",pe="uic8",he="si16",Pe="si32",nt="ur16",Ze="ui32",Xt="fl32",Gn="fl64",an=N+z.length,pr=Object.prototype.toString;function rt(j){var Q=j.length*.75,W=j.length,ie,oe=0,re,be,Se,De;j[j.length-1]==="="&&(Q--,j[j.length-2]==="="&&Q--);var ke=new ArrayBuffer(Q),Ne=new Uint8Array(ke);for(ie=0;ie<W;ie+=4)re=me.indexOf(j[ie]),be=me.indexOf(j[ie+1]),Se=me.indexOf(j[ie+2]),De=me.indexOf(j[ie+3]),Ne[oe++]=re<<2|be>>4,Ne[oe++]=(be&15)<<4|Se>>2,Ne[oe++]=(Se&3)<<6|De&63;return ke}function xn(j){var Q=new Uint8Array(j),W="",ie;for(ie=0;ie<Q.length;ie+=3)W+=me[Q[ie]>>2],W+=me[(Q[ie]&3)<<4|Q[ie+1]>>4],W+=me[(Q[ie+1]&15)<<2|Q[ie+2]>>6],W+=me[Q[ie+2]&63];return Q.length%3===2?W=W.substring(0,W.length-1)+"=":Q.length%3===1&&(W=W.substring(0,W.length-2)+"=="),W}function Rr(j,Q){var W="";if(j&&(W=pr.call(j)),j&&(W==="[object ArrayBuffer]"||j.buffer&&pr.call(j.buffer)==="[object ArrayBuffer]")){var ie,oe=R;j instanceof ArrayBuffer?(ie=j,oe+=z):(ie=j.buffer,W==="[object Int8Array]"?oe+=Y:W==="[object Uint8Array]"?oe+=ee:W==="[object Uint8ClampedArray]"?oe+=pe:W==="[object Int16Array]"?oe+=he:W==="[object Uint16Array]"?oe+=nt:W==="[object Int32Array]"?oe+=Pe:W==="[object Uint32Array]"?oe+=Ze:W==="[object Float32Array]"?oe+=Xt:W==="[object Float64Array]"?oe+=Gn:Q(new Error("Failed to get type for BinaryArray"))),Q(oe+xn(ie))}else if(W==="[object Blob]"){var re=new FileReader;re.onload=function(){var be=ue+j.type+"~"+xn(this.result);Q(R+X+be)},re.readAsArrayBuffer(j)}else try{Q(JSON.stringify(j))}catch(be){console.error("Couldn't convert value into a JSON string: ",j),Q(null,be)}}function ar(j){if(j.substring(0,N)!==R)return JSON.parse(j);var Q=j.substring(an),W=j.substring(N,an),ie;if(W===X&&K.test(Q)){var oe=Q.match(K);ie=oe[1],Q=Q.substring(oe[0].length)}var re=rt(Q);switch(W){case z:return re;case X:return u([re],{type:ie});case Y:return new Int8Array(re);case ee:return new Uint8Array(re);case pe:return new Uint8ClampedArray(re);case he:return new Int16Array(re);case nt:return new Uint16Array(re);case Pe:return new Int32Array(re);case Ze:return new Uint32Array(re);case Xt:return new Float32Array(re);case Gn:return new Float64Array(re);default:throw new Error("Unkown type: "+W)}}var go={serialize:Rr,deserialize:ar,stringToBuffer:rt,bufferToString:xn};function wa(j,Q,W,ie){j.executeSql("CREATE TABLE IF NOT EXISTS "+Q.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],W,ie)}function yo(j){var Q=this,W={db:null};if(j)for(var ie in j)W[ie]=typeof j[ie]!="string"?j[ie].toString():j[ie];var oe=new d(function(re,be){try{W.db=openDatabase(W.name,String(W.version),W.description,W.size)}catch(Se){return be(Se)}W.db.transaction(function(Se){wa(Se,W,function(){Q._dbInfo=W,re()},function(De,ke){be(ke)})},be)});return W.serializer=go,oe}function Vr(j,Q,W,ie,oe,re){j.executeSql(W,ie,oe,function(be,Se){Se.code===Se.SYNTAX_ERR?be.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[Q.storeName],function(De,ke){ke.rows.length?re(De,Se):wa(De,Q,function(){De.executeSql(W,ie,oe,re)},re)},re):re(be,Se)},re)}function vo(j,Q){var W=this;j=m(j);var ie=new d(function(oe,re){W.ready().then(function(){var be=W._dbInfo;be.db.transaction(function(Se){Vr(Se,be,"SELECT * FROM "+be.storeName+" WHERE key = ? LIMIT 1",[j],function(De,ke){var Ne=ke.rows.length?ke.rows.item(0).value:null;Ne&&(Ne=be.serializer.deserialize(Ne)),oe(Ne)},function(De,ke){re(ke)})})}).catch(re)});return f(ie,Q),ie}function wi(j,Q){var W=this,ie=new d(function(oe,re){W.ready().then(function(){var be=W._dbInfo;be.db.transaction(function(Se){Vr(Se,be,"SELECT * FROM "+be.storeName,[],function(De,ke){for(var Ne=ke.rows,Ye=Ne.length,Nt=0;Nt<Ye;Nt++){var Qt=Ne.item(Nt),en=Qt.value;if(en&&(en=be.serializer.deserialize(en)),en=j(en,Qt.key,Nt+1),en!==void 0){oe(en);return}}oe()},function(De,ke){re(ke)})})}).catch(re)});return f(ie,Q),ie}function Ns(j,Q,W,ie){var oe=this;j=m(j);var re=new d(function(be,Se){oe.ready().then(function(){Q===void 0&&(Q=null);var De=Q,ke=oe._dbInfo;ke.serializer.serialize(Q,function(Ne,Ye){Ye?Se(Ye):ke.db.transaction(function(Nt){Vr(Nt,ke,"INSERT OR REPLACE INTO "+ke.storeName+" (key, value) VALUES (?, ?)",[j,Ne],function(){be(De)},function(Qt,en){Se(en)})},function(Nt){if(Nt.code===Nt.QUOTA_ERR){if(ie>0){be(Ns.apply(oe,[j,De,W,ie-1]));return}Se(Nt)}})})}).catch(Se)});return f(re,W),re}function Dp(j,Q,W){return Ns.apply(this,[j,Q,W,1])}function By(j,Q){var W=this;j=m(j);var ie=new d(function(oe,re){W.ready().then(function(){var be=W._dbInfo;be.db.transaction(function(Se){Vr(Se,be,"DELETE FROM "+be.storeName+" WHERE key = ?",[j],function(){oe()},function(De,ke){re(ke)})})}).catch(re)});return f(ie,Q),ie}function kp(j){var Q=this,W=new d(function(ie,oe){Q.ready().then(function(){var re=Q._dbInfo;re.db.transaction(function(be){Vr(be,re,"DELETE FROM "+re.storeName,[],function(){ie()},function(Se,De){oe(De)})})}).catch(oe)});return f(W,j),W}function Fc(j){var Q=this,W=new d(function(ie,oe){Q.ready().then(function(){var re=Q._dbInfo;re.db.transaction(function(be){Vr(be,re,"SELECT COUNT(key) as c FROM "+re.storeName,[],function(Se,De){var ke=De.rows.item(0).c;ie(ke)},function(Se,De){oe(De)})})}).catch(oe)});return f(W,j),W}function $c(j,Q){var W=this,ie=new d(function(oe,re){W.ready().then(function(){var be=W._dbInfo;be.db.transaction(function(Se){Vr(Se,be,"SELECT key FROM "+be.storeName+" WHERE id = ? LIMIT 1",[j+1],function(De,ke){var Ne=ke.rows.length?ke.rows.item(0).key:null;oe(Ne)},function(De,ke){re(ke)})})}).catch(re)});return f(ie,Q),ie}function zy(j){var Q=this,W=new d(function(ie,oe){Q.ready().then(function(){var re=Q._dbInfo;re.db.transaction(function(be){Vr(be,re,"SELECT key FROM "+re.storeName,[],function(Se,De){for(var ke=[],Ne=0;Ne<De.rows.length;Ne++)ke.push(De.rows.item(Ne).key);ie(ke)},function(Se,De){oe(De)})})}).catch(oe)});return f(W,j),W}function Vy(j){return new d(function(Q,W){j.transaction(function(ie){ie.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(oe,re){for(var be=[],Se=0;Se<re.rows.length;Se++)be.push(re.rows.item(Se).name);Q({db:j,storeNames:be})},function(oe,re){W(re)})},function(ie){W(ie)})})}function te(j,Q){Q=h.apply(this,arguments);var W=this.config();j=typeof j!="function"&&j||{},j.name||(j.name=j.name||W.name,j.storeName=j.storeName||W.storeName);var ie=this,oe;return j.name?oe=new d(function(re){var be;j.name===W.name?be=ie._dbInfo.db:be=openDatabase(j.name,"","",0),j.storeName?re({db:be,storeNames:[j.storeName]}):re(Vy(be))}).then(function(re){return new d(function(be,Se){re.db.transaction(function(De){function ke(Qt){return new d(function(en,$n){De.executeSql("DROP TABLE IF EXISTS "+Qt,[],function(){en()},function(kn,ci){$n(ci)})})}for(var Ne=[],Ye=0,Nt=re.storeNames.length;Ye<Nt;Ye++)Ne.push(ke(re.storeNames[Ye]));d.all(Ne).then(function(){be()}).catch(function(Qt){Se(Qt)})},function(De){Se(De)})})}):oe=d.reject("Invalid arguments"),f(oe,Q),oe}var se={_driver:"webSQLStorage",_initStorage:yo,_support:D(),iterate:wi,getItem:vo,setItem:Dp,removeItem:By,clear:kp,length:Fc,key:$c,keys:zy,dropInstance:te};function fe(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Ee(j,Q){var W=j.name+"/";return j.storeName!==Q.storeName&&(W+=j.storeName+"/"),W}function $e(){var j="_localforage_support_test";try{return localStorage.setItem(j,!0),localStorage.removeItem(j),!1}catch{return!0}}function et(){return!$e()||localStorage.length>0}function vt(j){var Q=this,W={};if(j)for(var ie in j)W[ie]=j[ie];return W.keyPrefix=Ee(j,Q._defaultConfig),et()?(Q._dbInfo=W,W.serializer=go,d.resolve()):d.reject()}function Ve(j){var Q=this,W=Q.ready().then(function(){for(var ie=Q._dbInfo.keyPrefix,oe=localStorage.length-1;oe>=0;oe--){var re=localStorage.key(oe);re.indexOf(ie)===0&&localStorage.removeItem(re)}});return f(W,j),W}function We(j,Q){var W=this;j=m(j);var ie=W.ready().then(function(){var oe=W._dbInfo,re=localStorage.getItem(oe.keyPrefix+j);return re&&(re=oe.serializer.deserialize(re)),re});return f(ie,Q),ie}function Be(j,Q){var W=this,ie=W.ready().then(function(){for(var oe=W._dbInfo,re=oe.keyPrefix,be=re.length,Se=localStorage.length,De=1,ke=0;ke<Se;ke++){var Ne=localStorage.key(ke);if(Ne.indexOf(re)===0){var Ye=localStorage.getItem(Ne);if(Ye&&(Ye=oe.serializer.deserialize(Ye)),Ye=j(Ye,Ne.substring(be),De++),Ye!==void 0)return Ye}}});return f(ie,Q),ie}function tt(j,Q){var W=this,ie=W.ready().then(function(){var oe=W._dbInfo,re;try{re=localStorage.key(j)}catch{re=null}return re&&(re=re.substring(oe.keyPrefix.length)),re});return f(ie,Q),ie}function Rt(j){var Q=this,W=Q.ready().then(function(){for(var ie=Q._dbInfo,oe=localStorage.length,re=[],be=0;be<oe;be++){var Se=localStorage.key(be);Se.indexOf(ie.keyPrefix)===0&&re.push(Se.substring(ie.keyPrefix.length))}return re});return f(W,j),W}function Mt(j){var Q=this,W=Q.keys().then(function(ie){return ie.length});return f(W,j),W}function zn(j,Q){var W=this;j=m(j);var ie=W.ready().then(function(){var oe=W._dbInfo;localStorage.removeItem(oe.keyPrefix+j)});return f(ie,Q),ie}function on(j,Q,W){var ie=this;j=m(j);var oe=ie.ready().then(function(){Q===void 0&&(Q=null);var re=Q;return new d(function(be,Se){var De=ie._dbInfo;De.serializer.serialize(Q,function(ke,Ne){if(Ne)Se(Ne);else try{localStorage.setItem(De.keyPrefix+j,ke),be(re)}catch(Ye){(Ye.name==="QuotaExceededError"||Ye.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Se(Ye),Se(Ye)}})})});return f(oe,W),oe}function qt(j,Q){if(Q=h.apply(this,arguments),j=typeof j!="function"&&j||{},!j.name){var W=this.config();j.name=j.name||W.name,j.storeName=j.storeName||W.storeName}var ie=this,oe;return j.name?oe=new d(function(re){j.storeName?re(Ee(j,ie._defaultConfig)):re(j.name+"/")}).then(function(re){for(var be=localStorage.length-1;be>=0;be--){var Se=localStorage.key(be);Se.indexOf(re)===0&&localStorage.removeItem(Se)}}):oe=d.reject("Invalid arguments"),f(oe,Q),oe}var yn={_driver:"localStorageWrapper",_initStorage:vt,_support:fe(),iterate:Be,getItem:We,setItem:on,removeItem:zn,clear:Ve,length:Mt,key:tt,keys:Rt,dropInstance:qt},bo=function(Q,W){return Q===W||typeof Q=="number"&&typeof W=="number"&&isNaN(Q)&&isNaN(W)},Ea=function(Q,W){for(var ie=Q.length,oe=0;oe<ie;){if(bo(Q[oe],W))return!0;oe++}return!1},oi=Array.isArray||function(j){return Object.prototype.toString.call(j)==="[object Array]"},cr={},jc={},ai={INDEXEDDB:gt,WEBSQL:se,LOCALSTORAGE:yn},Ps=[ai.INDEXEDDB._driver,ai.WEBSQL._driver,ai.LOCALSTORAGE._driver],Ms=["dropInstance"],_o=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ms),Bt={description:"",driver:Ps.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function vn(j,Q){j[Q]=function(){var W=arguments;return j.ready().then(function(){return j[Q].apply(j,W)})}}function Xi(){for(var j=1;j<arguments.length;j++){var Q=arguments[j];if(Q)for(var W in Q)Q.hasOwnProperty(W)&&(oi(Q[W])?arguments[0][W]=Q[W].slice():arguments[0][W]=Q[W])}return arguments[0]}var Sa=function(){function j(Q){o(this,j);for(var W in ai)if(ai.hasOwnProperty(W)){var ie=ai[W],oe=ie._driver;this[W]=oe,cr[oe]||this.defineDriver(ie)}this._defaultConfig=Xi({},Bt),this._config=Xi({},this._defaultConfig,Q),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return j.prototype.config=function(W){if((typeof W>"u"?"undefined":s(W))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ie in W){if(ie==="storeName"&&(W[ie]=W[ie].replace(/\W/g,"_")),ie==="version"&&typeof W[ie]!="number")return new Error("Database version must be a number.");this._config[ie]=W[ie]}return"driver"in W&&W.driver?this.setDriver(this._config.driver):!0}else return typeof W=="string"?this._config[W]:this._config},j.prototype.defineDriver=function(W,ie,oe){var re=new d(function(be,Se){try{var De=W._driver,ke=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!W._driver){Se(ke);return}for(var Ne=_o.concat("_initStorage"),Ye=0,Nt=Ne.length;Ye<Nt;Ye++){var Qt=Ne[Ye],en=!Ea(Ms,Qt);if((en||W[Qt])&&typeof W[Qt]!="function"){Se(ke);return}}var $n=function(){for(var Nu=function(e$){return function(){var t$=new Error("Method "+e$+" is not implemented by the current driver"),R0=d.reject(t$);return f(R0,arguments[arguments.length-1]),R0}},Hy=0,QF=Ms.length;Hy<QF;Hy++){var Wy=Ms[Hy];W[Wy]||(W[Wy]=Nu(Wy))}};$n();var kn=function(Nu){cr[De]&&console.info("Redefining LocalForage driver: "+De),cr[De]=W,jc[De]=Nu,be()};"_support"in W?W._support&&typeof W._support=="function"?W._support().then(kn,Se):kn(!!W._support):kn(!0)}catch(ci){Se(ci)}});return p(re,ie,oe),re},j.prototype.driver=function(){return this._driver||null},j.prototype.getDriver=function(W,ie,oe){var re=cr[W]?d.resolve(cr[W]):d.reject(new Error("Driver not found."));return p(re,ie,oe),re},j.prototype.getSerializer=function(W){var ie=d.resolve(go);return p(ie,W),ie},j.prototype.ready=function(W){var ie=this,oe=ie._driverSet.then(function(){return ie._ready===null&&(ie._ready=ie._initDriver()),ie._ready});return p(oe,W,W),oe},j.prototype.setDriver=function(W,ie,oe){var re=this;oi(W)||(W=[W]);var be=this._getSupportedDrivers(W);function Se(){re._config.driver=re.driver()}function De(Ye){return re._extend(Ye),Se(),re._ready=re._initStorage(re._config),re._ready}function ke(Ye){return function(){var Nt=0;function Qt(){for(;Nt<Ye.length;){var en=Ye[Nt];return Nt++,re._dbInfo=null,re._ready=null,re.getDriver(en).then(De).catch(Qt)}Se();var $n=new Error("No available storage method found.");return re._driverSet=d.reject($n),re._driverSet}return Qt()}}var Ne=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=Ne.then(function(){var Ye=be[0];return re._dbInfo=null,re._ready=null,re.getDriver(Ye).then(function(Nt){re._driver=Nt._driver,Se(),re._wrapLibraryMethodsWithReady(),re._initDriver=ke(be)})}).catch(function(){Se();var Ye=new Error("No available storage method found.");return re._driverSet=d.reject(Ye),re._driverSet}),p(this._driverSet,ie,oe),this._driverSet},j.prototype.supports=function(W){return!!jc[W]},j.prototype._extend=function(W){Xi(this,W)},j.prototype._getSupportedDrivers=function(W){for(var ie=[],oe=0,re=W.length;oe<re;oe++){var be=W[oe];this.supports(be)&&ie.push(be)}return ie},j.prototype._wrapLibraryMethodsWithReady=function(){for(var W=0,ie=_o.length;W<ie;W++)vn(this,_o[W])},j.prototype.createInstance=function(W){return new j(W)},j}(),Tn=new Sa;r.exports=Tn},{3:3}]},{},[4])(4)})})(x2);var Nce=x2.exports;const SO=pa(Nce),T2="HttpClient",Pce=(t={})=>{const e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:T2,setupOnce(){},setup(n){zce(n,e),Vce(n,e)}}},I2=Pce;Ki(T2,I2);function Mce(t,e,n,r){if(C2(t,n.status,n.url)){const i=Hce(e,r);let s,o,a,c;D2()&&([{headers:s,cookies:a},{headers:o,cookies:c}]=[{cookieHeader:"Cookie",obj:i},{cookieHeader:"Set-Cookie",obj:n}].map(({cookieHeader:u,obj:d})=>{const f=$ce(d.headers);let p;try{const m=f[u]||f[u.toLowerCase()]||void 0;m&&(p=O2(m))}catch{Hf&&ye.log(`Could not extract cookies from header ${u}`)}return{headers:f,cookies:p}}));const l=R2({url:i.url,method:i.method,status:n.status,requestHeaders:s,responseHeaders:o,requestCookies:a,responseCookies:c});Iy(l)}}function Lce(t,e,n,r){if(C2(t,e.status,e.responseURL)){let i,s,o;if(D2()){try{const c=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;c&&(s=O2(c))}catch{Hf&&ye.log("Could not extract cookies from response headers")}try{o=jce(e)}catch{Hf&&ye.log("Could not extract headers from response")}i=r}const a=R2({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:o,responseCookies:s});Iy(a)}}function Fce(t){if(t){const e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function O2(t){return t.split("; ").reduce((e,n)=>{const[r,i]=n.split("=");return e[r]=i,e},{})}function $ce(t){const e={};return t.forEach((n,r)=>{e[r]=n}),e}function jce(t){const e=t.getAllResponseHeaders();return e?e.split(`\r
436
+ `).reduce((n,r)=>{const[i,s]=r.split(": ");return n[i]=s,n},{}):{}}function Uce(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function Bce(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function zce(t,e){mM()&&_y(n=>{if(Ut()!==t)return;const{response:r,args:i}=n,[s,o]=i;r&&Mce(e,s,r,o)})}function Vce(t,e){"XMLHttpRequest"in $t&&Ey(n=>{if(Ut()!==t)return;const r=n.xhr,i=r[Ys];if(!i)return;const{method:s,request_headers:o}=i;try{Lce(e,r,s,o)}catch(a){Hf&&ye.warn("Error while extracting response event form XHR response",a)}})}function C2(t,e,n){return Bce(t.failedRequestStatusCodes,e)&&Uce(t.failedRequestTargets,n)&&!YM(n,Ut())}function R2(t){const e=`HTTP Client Error with status code: ${t.status}`,n={message:e,exception:{values:[{type:"Error",value:e}]},request:{url:t.url,method:t.method,headers:t.requestHeaders,cookies:t.requestCookies},contexts:{response:{status_code:t.status,headers:t.responseHeaders,cookies:t.responseCookies,body_size:Fce(t.responseHeaders)}}};return wc(n,{type:"http.client",handled:!1}),n}function Hce(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function D2(){const t=Ut();return t?!!t.getOptions().sendDefaultPii:!1}function Wce(t){const e={...t};KM(e,"react"),nse(e)}function qce(t){const e=zre({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:i,createRoutesFromChildren:s,matchRoutes:o,stripBasename:a,instrumentPageLoad:c=!0,instrumentNavigation:l=!0}=t;return{...e,afterAllSetup(u){e.afterAllSetup(u);const d=nn.location&&nn.location.pathname;c&&d&&fL(u,{name:d,attributes:{[Ss]:"url",[pd]:"pageload",[ja]:"auto.pageload.react.reactrouter_v6"}})}}}function Gce(...t){let e,n;const r=t.findIndex(i=>i instanceof Error);r?(e=t.at(r),n=t.slice(0,r).concat(t.slice(r+1))):t.length===1?e=t:t.length>1&&(e=t[0],n=t.slice(1)),!(e instanceof TypeError&&e.message==="Failed to fetch"&&!navigator.onLine)&&_p(e,n?{data:n}:void 0)}var os;class Zce{constructor(){It(this,os,console);this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.trace=this.trace.bind(this)}set logger(e){bt(this,os,e)}log(...e){return de(this,os).log(...e)}info(...e){return de(this,os).info(...e)}warn(...e){return de(this,os).warn(...e)}error(...e){return Gce(...e),de(this,os).error(...e)}debug(...e){return de(this,os).debug(...e)}trace(...e){return de(this,os).trace(...e)}}os=new WeakMap;const Bn=new Zce;xJ(Bn);var Yce=Object.defineProperty,Kce=(t,e,n)=>e in t?Yce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Jce=(t,e,n)=>Kce(t,e+"",n),Eh;const Xce=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Qce=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),ele=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),tle=/[^\p{L}\d]+/giu,xO="$1\0$2",TO="";function k2(t){let e=t.trim();e=e.replace(Xce,xO).replace(Qce,xO),e=e.replace(tle,"\0");let n=0,r=e.length;for(;e.charAt(n)==="\0";)n++;if(n===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(n,r).split(/\0/g)}function nle(t){const e=k2(t);for(let n=0;n<e.length;n++){const r=e[n],i=ele.exec(r);if(i){const s=i.index+(i[1]??i[2]).length;e.splice(n,1,r.slice(0,s),r.slice(s))}}return e}function IO(t,e){const[n,r,i]=ole(t,e),s=rle(void 0),o=ile(void 0),a=sle(s,o);return n+r.map(a).join("")+i}function rle(t){return e=>e.toLocaleLowerCase(t)}function ile(t){return e=>e.toLocaleUpperCase(t)}function sle(t,e){return(n,r)=>{const i=n[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(n.slice(1))}}function ole(t,e={}){const n=e.split??(e.separateNumbers?nle:k2),r=e.prefixCharacters??TO,i=e.suffixCharacters??TO;let s=0,o=t.length;for(;s<t.length;){const a=t.charAt(s);if(!r.includes(a))break;s++}for(;o>s;){const a=o-1,c=t.charAt(a);if(!i.includes(c))break;o=a}return[t.slice(0,s),n(t.slice(s,o)),t.slice(o)]}function ale(t,e=!1){const n=[];if(e&&t==="")return n;try{const r=JSON.parse(t);!e&&!Object.keys(r).length&&n.push({message:"Initial state cannot be empty",details:{initialState:t}})}catch{n.push({message:"Invalid initial state",details:{initialState:t}})}return n}function cle(t,e,n="",r=!0){const i=[];if(!r&&!t)return i.push({message:"State schema is required",details:{schema:t}}),i;if(r&&!t)return i;const s=`type ${IO(e)}${IO(n)}State`;return t.includes(s)||i.push({message:`Invalid state schema name. Expected ${s}`,details:{schema:t}}),i}function lle(t){const e=[];t.length||e.push({message:"Modules are required",details:{modules:t}});const n=t.reduce((r,i)=>[...r,...A2(i)],[]);return[...e,...n]}function A2(t){const e=[];t.name||e.push({message:"Module name is required",details:{module:t}}),t.operations.length||e.push({message:"Module operations are required",details:{module:t}});const n=t.operations.reduce((r,i)=>[...r,...N2(i)],[]);return[...e,...n]}function N2(t){const e=[];return t.name||e.push({message:"Operation name is required",details:{operation:t}}),t.schema||e.push({message:"Operation schema is required",details:{operation:t}}),e}const ule=Object.freeze(Object.defineProperty({__proto__:null,validateInitialState:ale,validateModule:A2,validateModuleOperation:N2,validateModules:lle,validateStateSchemaName:cle},Symbol.toStringTag,{value:"Module"})),dle={id:"powerhouse/document-model",name:"DocumentModel",extension:"phdm",description:"The Powerhouse Document Model describes the state and operations of a document type.",author:{name:"Powerhouse",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],modules:[{name:"header",operations:[{name:"SetModelName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelId",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelExtension",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorWebsite",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"versioning",operations:[{name:"AddChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderChangeLogItems",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReleaseNewVersion",schema:null,id:"",description:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"module",operations:[{name:"AddModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModules",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-error",operations:[{name:"AddOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorCode",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationErrors",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-example",operations:[{name:"AddOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation",operations:[{name:"AddOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationReducer",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"MoveOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModuleOperations",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"state",operations:[{name:"SetStateSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetInitialState",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"AddStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderStateExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""}],state:{global:{schema:"",initialValue:`{
437
+ "id": "",
438
+ "name": "",
439
+ "extension": "",
440
+ "description": "",
441
+ "author": {
442
+ "name": "",
443
+ "website": ""
444
+ },
445
+ "specifications": [
446
+ {
447
+ "version": 1,
448
+ "changeLog": [],
449
+ "state": {
450
+ "schema": "",
451
+ "initialValue": "",
452
+ "examples": []
453
+ },
454
+ "modules": []
455
+ }
456
+ ]
457
+ }`,examples:[]},local:{schema:"",initialValue:"{}",examples:[]}}}]},fle=t=>t!=null;ae.any().refine(t=>fle(t));function ple(){return ae.object({__typename:ae.literal("AddChangeLogItemInput").optional(),content:ae.string(),id:ae.string(),insertBefore:ae.string().nullable()})}function hle(){return ae.object({description:ae.string().nullish(),id:ae.string(),name:ae.string()})}function mle(){return ae.object({errorCode:ae.string().nullish(),errorDescription:ae.string().nullish(),errorName:ae.string().nullish(),errorTemplate:ae.string().nullish(),id:ae.string(),operationId:ae.string()})}function gle(){return ae.object({example:ae.string(),id:ae.string(),operationId:ae.string()})}function yle(){return ae.object({description:ae.string().nullish(),id:ae.string(),moduleId:ae.string(),name:ae.string(),reducer:ae.string().nullish(),schema:ae.string().nullish(),template:ae.string().nullish(),scope:P2().nullish()})}function vle(){return ae.object({scope:ae.string(),example:ae.string(),id:ae.string(),insertBefore:ae.string().nullish()})}function ble(){return ae.object({__typename:ae.literal("DeleteChangeLogItemInput").optional(),id:ae.string()})}function _le(){return ae.object({id:ae.string()})}function wle(){return ae.object({id:ae.string()})}function Ele(){return ae.object({id:ae.string()})}function Sle(){return ae.object({id:ae.string()})}function xle(){return ae.object({scope:ae.string(),id:ae.string()})}function P2(){return ae.literal("global").or(ae.literal("local"))}function Tle(){return ae.object({newModuleId:ae.string(),operationId:ae.string()})}function Ile(){return ae.object({__typename:ae.literal("ReorderChangeLogItemsInput").optional(),order:ae.array(ae.string())})}function Ole(){return ae.object({moduleId:ae.string(),order:ae.array(ae.string())})}function Cle(){return ae.object({order:ae.array(ae.string())})}function Rle(){return ae.object({operationId:ae.string(),order:ae.array(ae.string())})}function Dle(){return ae.object({operationId:ae.string(),order:ae.array(ae.string())})}function kle(){return ae.object({scope:ae.string(),order:ae.array(ae.string())})}function Ale(){return ae.object({authorName:ae.string()})}function Nle(){return ae.object({authorWebsite:ae.string()})}function Ple(){return ae.object({scope:ae.string(),initialValue:ae.string()})}function Mle(){return ae.object({description:ae.string()})}function Lle(){return ae.object({extension:ae.string()})}function Fle(){return ae.object({id:ae.string()})}function $le(){return ae.object({name:ae.string()})}function jle(){return ae.object({description:ae.string().nullish(),id:ae.string()})}function Ule(){return ae.object({id:ae.string(),name:ae.string().nullish()})}function Ble(){return ae.object({description:ae.string().nullish(),id:ae.string()})}function zle(){return ae.object({errorCode:ae.string().nullish(),id:ae.string()})}function Vle(){return ae.object({errorDescription:ae.string().nullish(),id:ae.string()})}function Hle(){return ae.object({errorName:ae.string().nullish(),id:ae.string()})}function Wle(){return ae.object({errorTemplate:ae.string().nullish(),id:ae.string()})}function qle(){return ae.object({id:ae.string(),name:ae.string().nullish()})}function Gle(){return ae.object({id:ae.string(),scope:P2()})}function Zle(){return ae.object({id:ae.string(),reducer:ae.string().nullish()})}function Yle(){return ae.object({id:ae.string(),schema:ae.string().nullish()})}function Kle(){return ae.object({id:ae.string(),template:ae.string().nullish()})}function Jle(){return ae.object({scope:ae.string(),schema:ae.string()})}function Xle(){return ae.object({__typename:ae.literal("UpdateChangeLogItemInput").optional(),id:ae.string(),newContent:ae.string()})}function Qle(){return ae.object({example:ae.string(),id:ae.string()})}function eue(){return ae.object({scope:ae.string(),id:ae.string(),newExample:ae.string()})}const Jc={setModelNameOperation(t,e){t.name=e.input.name},setModelIdOperation(t,e){t.id=e.input.id},setModelExtensionOperation(t,e){t.extension=e.input.extension},setModelDescriptionOperation(t,e){t.description=e.input.description},setAuthorNameOperation(t,e){t.author=t.author||{name:"",website:null},t.author.name=e.input.authorName},setAuthorWebsiteOperation(t,e){t.author=t.author||{name:"",website:null},t.author.website=e.input.authorWebsite}},Yu={addChangeLogItemOperation(t,e){throw new Error('Reducer "addChangeLogItemOperation" not yet implemented')},updateChangeLogItemOperation(t,e){throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented')},deleteChangeLogItemOperation(t,e){throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented')},reorderChangeLogItemsOperation(t,e){throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented')},releaseNewVersionOperation(t,e){throw new Error('Reducer "releaseNewVersionOperation" not yet implemented')}},tue=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Ku={addModuleOperation(t,e){t.specifications[t.specifications.length-1].modules.push({id:e.input.id,name:e.input.name,description:e.input.description||"",operations:[]})},setModuleNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id===e.input.id&&(n.modules[r].name=e.input.name||"")},setModuleDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id===e.input.id&&(n.modules[r].description=e.input.description||"")},deleteModuleOperation(t,e){const n=t.specifications[t.specifications.length-1];n.modules=n.modules.filter(r=>r.id!=e.input.id)},reorderModulesOperation(t,e){t.specifications[t.specifications.length-1].modules.sort(tue(e.input.order))}},nue=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Oa={addOperationErrorOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].errors.push({id:e.input.id,name:e.input.errorName||"",code:e.input.errorCode||"",description:e.input.errorDescription||"",template:e.input.errorTemplate||""})},setOperationErrorCodeOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].code=e.input.errorCode||"")},setOperationErrorNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].name=e.input.errorName||"")},setOperationErrorDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].description=e.input.errorDescription||"")},setOperationErrorTemplateOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].errors.length;s++)n.modules[r].operations[i].errors[s].id==e.input.id&&(n.modules[r].operations[i].errors[s].template=e.input.errorTemplate||"")},deleteOperationErrorOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].errors=n.modules[r].operations[i].errors.filter(s=>s.id!=e.input.id)},reorderOperationErrorsOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].errors.sort(nue(e.input.order))}},rue=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Sh={addOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].examples.push({id:e.input.id,value:e.input.example})},updateOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)for(let s=0;s<n.modules[r].operations[i].examples.length;s++)n.modules[r].operations[i].examples[s].id==e.input.id&&(n.modules[r].operations[i].examples[s].value=e.input.example)},deleteOperationExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].examples=n.modules[r].operations[i].examples.filter(s=>s.id!=e.input.id)},reorderOperationExamplesOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.operationId&&n.modules[r].operations[i].examples.sort(rue(e.input.order))}},iue=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},es={addOperationOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id==e.input.moduleId&&n.modules[r].operations.push({id:e.input.id,name:e.input.name,description:e.input.description||"",schema:e.input.schema||"",template:e.input.template||e.input.description||"",reducer:e.input.reducer||"",errors:[],examples:[],scope:e.input.scope||"global"})},setOperationNameOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].name=e.input.name||"")},setOperationScopeOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].scope=e.input.scope||"global")},setOperationSchemaOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].schema=e.input.schema||"")},setOperationDescriptionOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].description=e.input.description||"")},setOperationTemplateOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].template=e.input.template||"")},setOperationReducerOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)for(let i=0;i<n.modules[r].operations.length;i++)n.modules[r].operations[i].id==e.input.id&&(n.modules[r].operations[i].reducer=e.input.reducer||"")},moveOperationOperation(t,e){const n=[],r=t.specifications[t.specifications.length-1];for(let i=0;i<r.modules.length;i++)r.modules[i].operations=r.modules[i].operations.filter(s=>s.id==e.input.operationId?(n.push(s),!1):!0);for(let i=0;i<r.modules.length;i++)r.modules[i].id==e.input.newModuleId&&r.modules[i].operations.push(...n)},deleteOperationOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].operations=n.modules[r].operations.filter(i=>i.id!=e.input.id)},reorderModuleOperationsOperation(t,e){const n=t.specifications[t.specifications.length-1];for(let r=0;r<n.modules.length;r++)n.modules[r].id==e.input.moduleId&&n.modules[r].operations.sort(iue(e.input.order))}},sue=t=>{const e={};return t.forEach((n,r)=>e[n]=r),(n,r)=>(e[r.id]||999999)-(e[n.id]||999999)},Xc={setStateSchemaOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].schema=e.input.schema;else throw new Error(`Invalid scope: ${e.input.scope}`)},setInitialStateOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].initialValue=e.input.initialValue;else throw new Error(`Invalid scope: ${e.input.scope}`)},addStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples.push({id:e.input.id,value:e.input.example});else throw new Error(`Invalid scope: ${e.input.scope}`)},updateStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(!Object.keys(n.state).includes(e.input.scope))throw new Error(`Invalid scope: ${e.input.scope}`);const r=n.state[e.input.scope].examples;for(let i=0;i<r.length;i++)r[i].id==e.input.id&&(r[i].value=e.input.newExample)},deleteStateExampleOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples=n.state[e.input.scope].examples.filter(r=>r.id!=e.input.id);else throw new Error(`Invalid scope: ${e.input.scope}`)},reorderStateExamplesOperation(t,e){const n=t.specifications[t.specifications.length-1];if(Object.keys(n.state).includes(e.input.scope))n.state[e.input.scope].examples.sort(sue(e.input.order));else throw new Error(`Invalid scope: ${e.input.scope}`)}},oue=(t,e)=>{if(Kl(e))return t;switch(e.type){case"SET_MODEL_NAME":$le().parse(e.input),Jc.setModelNameOperation(t.global,e);break;case"SET_MODEL_ID":Fle().parse(e.input),Jc.setModelIdOperation(t.global,e);break;case"SET_MODEL_EXTENSION":Lle().parse(e.input),Jc.setModelExtensionOperation(t.global,e);break;case"SET_MODEL_DESCRIPTION":Mle().parse(e.input),Jc.setModelDescriptionOperation(t.global,e);break;case"SET_AUTHOR_NAME":Ale().parse(e.input),Jc.setAuthorNameOperation(t.global,e);break;case"SET_AUTHOR_WEBSITE":Nle().parse(e.input),Jc.setAuthorWebsiteOperation(t.global,e);break;case"ADD_CHANGE_LOG_ITEM":ple().parse(e.input),Yu.addChangeLogItemOperation(t.global,e);break;case"UPDATE_CHANGE_LOG_ITEM":Xle().parse(e.input),Yu.updateChangeLogItemOperation(t.global,e);break;case"DELETE_CHANGE_LOG_ITEM":ble().parse(e.input),Yu.deleteChangeLogItemOperation(t.global,e);break;case"REORDER_CHANGE_LOG_ITEMS":Ile().parse(e.input),Yu.reorderChangeLogItemsOperation(t.global,e);break;case"RELEASE_NEW_VERSION":if(Object.keys(e.input).length>0)throw new Error("Expected empty input for action RELEASE_NEW_VERSION");Yu.releaseNewVersionOperation(t.global,e);break;case"ADD_MODULE":hle().parse(e.input),Ku.addModuleOperation(t.global,e);break;case"SET_MODULE_NAME":Ule().parse(e.input),Ku.setModuleNameOperation(t.global,e);break;case"SET_MODULE_DESCRIPTION":jle().parse(e.input),Ku.setModuleDescriptionOperation(t.global,e);break;case"DELETE_MODULE":_le().parse(e.input),Ku.deleteModuleOperation(t.global,e);break;case"REORDER_MODULES":Cle().parse(e.input),Ku.reorderModulesOperation(t.global,e);break;case"ADD_OPERATION_ERROR":mle().parse(e.input),Oa.addOperationErrorOperation(t.global,e);break;case"SET_OPERATION_ERROR_CODE":zle().parse(e.input),Oa.setOperationErrorCodeOperation(t.global,e);break;case"SET_OPERATION_ERROR_NAME":Hle().parse(e.input),Oa.setOperationErrorNameOperation(t.global,e);break;case"SET_OPERATION_ERROR_DESCRIPTION":Vle().parse(e.input),Oa.setOperationErrorDescriptionOperation(t.global,e);break;case"SET_OPERATION_ERROR_TEMPLATE":Wle().parse(e.input),Oa.setOperationErrorTemplateOperation(t.global,e);break;case"DELETE_OPERATION_ERROR":wle().parse(e.input),Oa.deleteOperationErrorOperation(t.global,e);break;case"REORDER_OPERATION_ERRORS":Rle().parse(e.input),Oa.reorderOperationErrorsOperation(t.global,e);break;case"ADD_OPERATION_EXAMPLE":gle().parse(e.input),Sh.addOperationExampleOperation(t.global,e);break;case"UPDATE_OPERATION_EXAMPLE":Qle().parse(e.input),Sh.updateOperationExampleOperation(t.global,e);break;case"DELETE_OPERATION_EXAMPLE":Ele().parse(e.input),Sh.deleteOperationExampleOperation(t.global,e);break;case"REORDER_OPERATION_EXAMPLES":Dle().parse(e.input),Sh.reorderOperationExamplesOperation(t.global,e);break;case"ADD_OPERATION":yle().parse(e.input),es.addOperationOperation(t.global,e);break;case"SET_OPERATION_NAME":qle().parse(e.input),es.setOperationNameOperation(t.global,e);break;case"SET_OPERATION_SCOPE":Gle().parse(e.input),es.setOperationScopeOperation(t.global,e);break;case"SET_OPERATION_SCHEMA":Yle().parse(e.input),es.setOperationSchemaOperation(t.global,e);break;case"SET_OPERATION_DESCRIPTION":Ble().parse(e.input),es.setOperationDescriptionOperation(t.global,e);break;case"SET_OPERATION_TEMPLATE":Kle().parse(e.input),es.setOperationTemplateOperation(t.global,e);break;case"SET_OPERATION_REDUCER":Zle().parse(e.input),es.setOperationReducerOperation(t.global,e);break;case"MOVE_OPERATION":Tle().parse(e.input),es.moveOperationOperation(t.global,e);break;case"DELETE_OPERATION":Sle().parse(e.input),es.deleteOperationOperation(t.global,e);break;case"REORDER_MODULE_OPERATIONS":Ole().parse(e.input),es.reorderModuleOperationsOperation(t.global,e);break;case"SET_STATE_SCHEMA":Jle().parse(e.input),Xc.setStateSchemaOperation(t.global,e);break;case"SET_INITIAL_STATE":Ple().parse(e.input),Xc.setInitialStateOperation(t.global,e);break;case"ADD_STATE_EXAMPLE":vle().parse(e.input),Xc.addStateExampleOperation(t.global,e);break;case"UPDATE_STATE_EXAMPLE":eue().parse(e.input),Xc.updateStateExampleOperation(t.global,e);break;case"DELETE_STATE_EXAMPLE":xle().parse(e.input),Xc.deleteStateExampleOperation(t.global,e);break;case"REORDER_STATE_EXAMPLES":kle().parse(e.input),Xc.reorderStateExamplesOperation(t.global,e);break;default:return t}},yg=BE(oue),aue={id:"",name:"",extension:"",description:"",author:{name:"",website:""},specifications:[{version:1,changeLog:[],state:{global:{schema:"",initialValue:"",examples:[]},local:{schema:"",initialValue:"",examples:[]}},modules:[]}]},cue={},kd={fileExtension:"phdm",createState(t){return{global:{...aue,...t==null?void 0:t.global},local:{...cue,...t==null?void 0:t.local}}},createExtendedState(t){return zE({...t,documentType:"powerhouse/document-model"},kd.createState)},createDocument(t){return VE(kd.createExtendedState(t),kd.createState)},saveToFile(t,e,n){return jE(t,e,"phdm",n)},saveToFileHandle(t,e){return mA(t,e)},loadFromFile(t){return Lm(t,yg)},loadFromInput(t){return UE(t,yg)}},M2=t=>ft("SET_MODEL_NAME",{...t}),L2=t=>ft("SET_MODEL_ID",{...t}),F2=t=>ft("SET_MODEL_EXTENSION",{...t}),$2=t=>ft("SET_MODEL_DESCRIPTION",{...t}),j2=t=>ft("SET_AUTHOR_NAME",{...t}),U2=t=>ft("SET_AUTHOR_WEBSITE",{...t});class lue extends ii{setModelName(e,n){return this.dispatch(M2(e),n)}setModelId(e,n){return this.dispatch(L2(e),n)}setModelExtension(e,n){return this.dispatch(F2(e),n)}setModelDescription(e,n){return this.dispatch($2(e),n)}setAuthorName(e,n){return this.dispatch(j2(e),n)}setAuthorWebsite(e,n){return this.dispatch(U2(e),n)}}const B2=t=>ft("ADD_CHANGE_LOG_ITEM",{...t}),z2=t=>ft("UPDATE_CHANGE_LOG_ITEM",{...t}),V2=t=>ft("DELETE_CHANGE_LOG_ITEM",{...t}),H2=t=>ft("REORDER_CHANGE_LOG_ITEMS",{...t}),W2=()=>ft("RELEASE_NEW_VERSION");class uue extends ii{addChangeLogItem(e,n){return this.dispatch(B2(e),n)}updateChangeLogItem(e,n){return this.dispatch(z2(e),n)}deleteChangeLogItem(e,n){return this.dispatch(V2(e),n)}reorderChangeLogItems(e,n){return this.dispatch(H2(e),n)}releaseNewVersion(e){return this.dispatch(W2(),e)}}const q2=t=>ft("ADD_MODULE",{...t}),G2=t=>ft("SET_MODULE_NAME",{...t}),Z2=t=>ft("SET_MODULE_DESCRIPTION",{...t}),Y2=t=>ft("DELETE_MODULE",{...t}),K2=t=>ft("REORDER_MODULES",{...t});class due extends ii{addModule(e,n){return this.dispatch(q2(e),n)}setModuleName(e,n){return this.dispatch(G2(e),n)}setModuleDescription(e,n){return this.dispatch(Z2(e),n)}deleteModule(e,n){return this.dispatch(Y2(e),n)}reorderModules(e,n){return this.dispatch(K2(e),n)}}const J2=t=>ft("ADD_OPERATION_ERROR",{...t}),X2=t=>ft("SET_OPERATION_ERROR_CODE",{...t}),Q2=t=>ft("SET_OPERATION_ERROR_NAME",{...t}),eF=t=>ft("SET_OPERATION_ERROR_DESCRIPTION",{...t}),tF=t=>ft("SET_OPERATION_ERROR_TEMPLATE",{...t}),nF=t=>ft("DELETE_OPERATION_ERROR",{...t}),rF=t=>ft("REORDER_OPERATION_ERRORS",{...t});class fue extends ii{addOperationError(e,n){return this.dispatch(J2(e),n)}setOperationErrorCode(e,n){return this.dispatch(X2(e),n)}setOperationErrorName(e,n){return this.dispatch(Q2(e),n)}setOperationErrorDescription(e,n){return this.dispatch(eF(e),n)}setOperationErrorTemplate(e,n){return this.dispatch(tF(e),n)}deleteOperationError(e,n){return this.dispatch(nF(e),n)}reorderOperationErrors(e,n){return this.dispatch(rF(e),n)}}const iF=t=>ft("ADD_OPERATION_EXAMPLE",{...t}),sF=t=>ft("UPDATE_OPERATION_EXAMPLE",{...t}),oF=t=>ft("DELETE_OPERATION_EXAMPLE",{...t}),aF=t=>ft("REORDER_OPERATION_EXAMPLES",{...t});class pue extends ii{addOperationExample(e,n){return this.dispatch(iF(e),n)}updateOperationExample(e,n){return this.dispatch(sF(e),n)}deleteOperationExample(e,n){return this.dispatch(oF(e),n)}reorderOperationExamples(e,n){return this.dispatch(aF(e),n)}}const cF=t=>ft("ADD_OPERATION",{...t}),lF=t=>ft("SET_OPERATION_NAME",{...t}),uF=t=>ft("SET_OPERATION_SCOPE",{...t}),dF=t=>ft("SET_OPERATION_SCHEMA",{...t}),fF=t=>ft("SET_OPERATION_DESCRIPTION",{...t}),pF=t=>ft("SET_OPERATION_TEMPLATE",{...t}),hF=t=>ft("SET_OPERATION_REDUCER",{...t}),mF=t=>ft("MOVE_OPERATION",{...t}),gF=t=>ft("DELETE_OPERATION",{...t}),yF=t=>ft("REORDER_MODULE_OPERATIONS",{...t});class hue extends ii{addOperation(e,n){return this.dispatch(cF(e),n)}setOperationName(e,n){return this.dispatch(lF(e),n)}setOperationScope(e,n){return this.dispatch(uF(e),n)}setOperationSchema(e,n){return this.dispatch(dF(e),n)}setOperationDescription(e,n){return this.dispatch(fF(e),n)}setOperationTemplate(e,n){return this.dispatch(pF(e),n)}setOperationReducer(e,n){return this.dispatch(hF(e),n)}moveOperation(e,n){return this.dispatch(mF(e),n)}deleteOperation(e,n){return this.dispatch(gF(e),n)}reorderModuleOperations(e,n){return this.dispatch(yF(e),n)}}const vF=t=>ft("SET_STATE_SCHEMA",{...t}),bF=t=>ft("SET_INITIAL_STATE",{...t}),_F=t=>ft("ADD_STATE_EXAMPLE",{...t}),wF=t=>ft("UPDATE_STATE_EXAMPLE",{...t}),EF=t=>ft("DELETE_STATE_EXAMPLE",{...t}),SF=t=>ft("REORDER_STATE_EXAMPLES",{...t});class mue extends ii{setStateSchema(e,n){return this.dispatch(vF(e),n)}setInitialState(e,n){return this.dispatch(bF(e),n)}addStateExample(e,n){return this.dispatch(_F(e),n)}updateStateExample(e,n){return this.dispatch(wF(e),n)}deleteStateExample(e,n){return this.dispatch(EF(e),n)}reorderStateExamples(e,n){return this.dispatch(SF(e),n)}}let xF=(Eh=class extends ii{constructor(t,e){super(yg,kd.createDocument(t),e)}saveToFile(t,e){return super.saveToFile(t,Eh.fileExtension,e)}loadFromFile(t){return super.loadFromFile(t)}static async fromFile(t){const e=new this;return await e.loadFromFile(t),e}},Jce(Eh,"fileExtension","phdm"),Eh);GE(xF,[lue,uue,due,fue,pue,hue,mue]);const gue=Object.freeze(Object.defineProperty({__proto__:null,addChangeLogItem:B2,addModule:q2,addOperation:cF,addOperationError:J2,addOperationExample:iF,addStateExample:_F,deleteChangeLogItem:V2,deleteModule:Y2,deleteOperation:gF,deleteOperationError:nF,deleteOperationExample:oF,deleteStateExample:EF,moveOperation:mF,releaseNewVersion:W2,reorderChangeLogItems:H2,reorderModuleOperations:yF,reorderModules:K2,reorderOperationErrors:rF,reorderOperationExamples:aF,reorderStateExamples:SF,setAuthorName:j2,setAuthorWebsite:U2,setInitialState:bF,setModelDescription:$2,setModelExtension:F2,setModelId:L2,setModelName:M2,setModuleDescription:Z2,setModuleName:G2,setOperationDescription:fF,setOperationErrorCode:X2,setOperationErrorDescription:eF,setOperationErrorName:Q2,setOperationErrorTemplate:tF,setOperationName:lF,setOperationReducer:hF,setOperationSchema:dF,setOperationScope:uF,setOperationTemplate:pF,setStateSchema:vF,updateChangeLogItem:z2,updateOperationExample:sF,updateStateExample:wF},Symbol.toStringTag,{value:"Module"})),yue=xF,vue={...kd,...ule},bue={...qE,...gue},_ue={Document:yue,reducer:yg,actions:bue,utils:vue,documentModel:dle};function wue(t){const e=rn(0),n=rn(()=>({i:0}),(c,l)=>{const u=c(n);return Object.assign(u,{m:!0,peek:c,set:l}),l(e,d=>d+1),()=>{u.m=!1,o(u),a(u)}});n.onMount=c=>c();const r=rn(c=>{c(e);const l=c(n);if(!l.m||l.irc||l.i&&!l.irf)return l.p;a(l);const u=new Map,d=h=>{const g=c(h);return u.set(h,g),g};d.peek=l.peek;const f=(...h)=>{try{return++l.i,l.set(...h)}finally{Array.from(u.keys(),c),--l.i}};f.recurse=(h,...g)=>{if(!l.fc)try{return l.irc=!0,l.set(h,...g)}finally{l.irc=!1,Array.from(u).some(p)&&s(l)}};function p([h,g]){return c(h)!==g}++l.i;function m(){try{if(l.irf=!1,!l.m)return;o(l),l.c=i.effect(d,f)}catch(h){l.e=h,s(l)}finally{l.p=void 0,--l.i}}return l.irf?m():l.p=Promise.resolve().then(m)}),i=rn(c=>void c(r));return i.effect=t,i;function s(c){try{c.irf=!0,c.set(e,l=>l+1)}finally{c.irf=!1}}function o(c){if(typeof c.c=="function")try{c.fc=!0,c.c()}finally{c.fc=!1,c.c=void 0}}function a(c){if("e"in c){const l=c.e;throw delete c.e,l}}}const xh=new WeakMap;function Eue(t,e=UA()){xh.has(e)||xh.set(e,new Map);const n=xh.get(e);let r=n.get(t);if(!r){const i=wue(t);let s=e.sub(i,()=>{});r=()=>{s&&(n.delete(t),n.size===0&&xh.delete(e),s=void s())},n.set(t,r)}return r}const Sue="feature-flags-config",Xh=window.__VITE_ENVS.PH_CONNECT_ENABLED_EDITORS||void 0,xue=Xh==null?void 0:Xh.split(","),Qh=window.__VITE_ENVS.PH_CONNECT_DISABLED_EDITORS||"powerhouse/document-drive",Tue=Qh==null?void 0:Qh.split(","),TF={editors:{enabledEditors:Xh==="*"?"*":xue,disabledEditors:Qh==="*"?"*":Tue}},Iue=pp(Sue,TF),Oue=()=>{const[t,e]=yi(Iue);return{config:{...TF,...t},setConfig:e}},Cue=GZ("theme","light",t=>{var e;typeof window<"u"&&((e=window.electronAPI)==null||e.setTheme(t))}),g0=ZE(),Rue=pp("sidebar-collapsed",!1);rn(!1);const Due={sidebarCollapsedAtom:Rue,themeAtom:Cue};async function Fy(){if(import.meta.resolve("PH:HMR_MODULE").toLowerCase()!=="ph:hmr_module")try{return(await Te(()=>import("PH:HMR_MODULE"),[])).default}catch{return}}async function kue(t){const e=await Fy();if(!e)throw new Error("HMR not available.");return new Promise(n=>{function r(i){t===i.name&&(n(),e==null||e.off("studio:external-package-added",r))}e.on("studio:external-package-added",r),e.send("studio:add-external-package",{name:t})})}async function Aue(t){const e=await Fy();if(!e)throw new Error("HMR not available.");return new Promise(n=>{function r(i){t===i.name&&(n(),e==null||e.off("studio:external-package-removed",r))}e.on("studio:external-package-removed",r),e.send("studio:remove-external-package",{name:t})})}async function Nue(t){const e=await Fy(),n=r=>{const i=Te(()=>import(`${r.url}?t=${r.timestamp}`),[]);t(i.then(s=>s.default))};return e==null||e.on("studio:external-packages-updated",n),()=>{e==null||e.off("studio:external-packages-updated",n)}}const Pue=window.__VITE_ENVS.LOAD_EXTERNAL_PACKAGES,Mue=Pue==="true";function Lue(){return Mue?Te(()=>import("PH:EXTERNAL_PACKAGES"),[]).then(t=>t.default):Promise.resolve([])}const Fue=rn(async()=>typeof await Fy()<"u"),$ue=()=>Dc(Fue),y0=YE(Lue);let OO;y0.onMount=t=>{OO||(OO=Nue(e=>{t(e)}))};const jue=()=>Dc(y0),Uue=window.__VITE_ENVS.LOCAL_DOCUMENT_MODELS,Bue=[qP,_ue];function zue(...t){const e=new Map;for(const n of t)for(const r of n)e.set(r.documentModel.id,r);return Array.from(e.values())}function Vue(t){return t.map(e=>e.documentModels).reduce((e,n)=>e.concat(n),[])}async function Hue(){if(!Uue)return[];try{const t=await Te(()=>import("LOCAL_DOCUMENT_MODELS"),[]);return console.log("Loaded local document models:",t),Object.values(t)}catch(t){return console.error("Error loading local document models",t),[]}}const Wue=YE(Hue),v0=rn(async t=>{const e=await t(Wue),n=await t(y0),r=Vue(n);return zue(Bue,r,e)}),que=qA(v0),IF=()=>Dc(que),Gue=function(t){const e=Eue(n=>{n(v0).then(t).catch(i=>{throw i})},g0);return()=>e()};function Zue(t,e){return e==null?void 0:e.find(n=>n.documentModel.id===t)}const OF=()=>{const t=IF();return e=>Zue(e,t)},Yue=()=>{const t=IF(),{config:e}=Oue(),{enabledEditors:n,disabledEditors:r}=e.editors;if(!t)return;const i=t.filter(s=>s.documentModel.id!=="powerhouse/document-drive");return n==="*"?t:r==="*"?[]:r?i.filter(s=>!r.includes(s.documentModel.id)):n?i.filter(s=>n.includes(s.documentModel.id)):i};function Kue(t){let e=!1;const n=Object.entries(t.operations).reduce((r,[i,s])=>{const o=i;for(const a of s){const c=Jue(a);r[o].push(c),c!==a&&(e=!0)}return r},{global:[],local:[]});return e?{...t,operations:n}:t}function Jue(t){var n;if(!((n=t.context)!=null&&n.signer)||t.context.signer.signatures)return t;const{signer:e}=t.context;if("signature"in e){const r=e.signature;return{...t,context:{...t.context,signer:{user:e.user,app:e.app,signatures:r!=null&&r.length?[r]:[]}}}}else return t}const nr=class nr{constructor(e){Ke(this,"db");this.db=SO.ready().then(()=>SO.createInstance({name:e?`${e}:${nr.DBName}`:nr.DBName}))}buildKey(...e){return e.join(nr.SEP)}async checkDocumentExists(e,n){return!!await(await this.db).getItem(this.buildKey(e,n))}async getDocuments(e){const r=await(await this.db).keys(),i=`${e}${nr.SEP}`;return r.filter(s=>s.startsWith(i)).map(s=>s.slice(i.length))}async getDocument(e,n){const r=await(await this.db).getItem(this.buildKey(e,n));if(!r)throw new Error(`Document with id ${n} not found`);return r}async createDocument(e,n,r){await(await this.db).setItem(this.buildKey(e,n),r)}async deleteDocument(e,n){await(await this.db).removeItem(this.buildKey(e,n))}async clearStorage(){return(await this.db).clear()}async addDocumentOperations(e,n,r,i){const s=await this.getDocument(e,n);if(!s)throw new Error(`Document with id ${n} not found`);const o=Xm(s.operations,r);await(await this.db).setItem(this.buildKey(e,n),{...s,...i,operations:o})}async getDrives(){return(await(await this.db).keys()).filter(r=>r.startsWith(nr.DRIVES_KEY)).map(r=>r.slice(nr.DRIVES_KEY.length+nr.SEP.length))}async getDrive(e){const r=await(await this.db).getItem(this.buildKey(nr.DRIVES_KEY,e));if(!r)throw new Td(e);return r}async getDriveBySlug(e){const n=(await this.getDrives()).reverse();for(const r of n)if((await this.getDrive(r)).initialState.state.global.slug===e)return this.getDrive(r);throw new Error(`Drive with slug ${e} not found`)}async createDrive(e,n){await(await this.db).setItem(this.buildKey(nr.DRIVES_KEY,e),n)}async deleteDrive(e){const n=await this.getDocuments(e);return await Promise.all(n.map(r=>this.deleteDocument(e,r))),(await this.db).removeItem(this.buildKey(nr.DRIVES_KEY,e))}async addDriveOperations(e,n,r){const i=await this.getDrive(e),s=Xm(i.operations,n);await(await this.db).setItem(this.buildKey(nr.DRIVES_KEY,e),{...i,...r,operations:s})}async getSynchronizationUnitsRevision(e){return(await Promise.allSettled(e.map(async r=>{try{const i=await(r.documentId?this.getDocument(r.driveId,r.documentId):this.getDrive(r.driveId));if(!i)return;const s=i.operations[r.scope].at(-1);if(s)return{driveId:r.driveId,documentId:r.documentId,scope:r.scope,branch:r.branch,lastUpdated:s.timestamp,revision:s.index}}catch{return}}))).reduce((r,i)=>(i.status==="fulfilled"&&i.value!==void 0&&r.push(i.value),r),[])}async migrateOperationSignatures(){const e=await this.getDrives();for(const n of e){await this.migrateDocument(nr.DRIVES_KEY,n);const r=await this.getDocuments(n);await Promise.all(r.map(async i=>this.migrateDocument(n,i)))}}async migrateDocument(e,n){const r=await this.getDocument(e,n),i=Kue(r);if(i!==r)return(await this.db).setItem(this.buildKey(e,n),i)}};Ke(nr,"DBName","DOCUMENT_DRIVES"),Ke(nr,"SEP",":"),Ke(nr,"DRIVES_KEY","DRIVES");let rw=nr;const CO=window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL||void 0,rb=CO?CO.split(","):[],Xue=()=>({defaultDrives:{remoteDrives:rb.map(e=>({url:e,options:{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:e,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[],pullInterval:3e3}})),removeOldRemoteDrives:rb.length>0?{strategy:"preserve-by-url-and-detach",urls:rb}:{strategy:"preserve-all"}}});function Que(t,e){return new QQ(t,new rw(e),new ZP,new KP(1,10),{...Xue()})}async function ede(t){const e=await t.initialize(),n=e==null?void 0:e.at(0);if(n)throw n;!(await t.getDrives()).length&&Ai.drives.sections.LOCAL.enabled&&t.addDrive({global:{id:Gt.hashKey(),name:"My Local Drive",icon:null,slug:"my-local-drive"},local:{availableOffline:!1,sharingType:"private",listeners:[],triggers:[]}}).catch(Bn.error)}async function tde(){var n;const t=await g0.get(v0),e=((n=window.electronAPI)==null?void 0:n.documentDrive)??Que(t,Ai.routerBasename);return await ede(e),e}const vg=YE(tde),nde=qA(vg),CF=()=>Dc(nde),rde=()=>Dc(RF),RF=rn(void 0);RF.onMount=t=>{const e=vg.onMount;vg.onMount=n=>(n(r=>(r.then(i=>t(i)).catch(console.error),r)),e==null?void 0:e(n))};let ib;vg.onMount=t=>{ib||t(async e=>{const n=await e;return ib||(ib=Gue(r=>{n.setDocumentModels(r)})),n})};const em=(async()=>{if(window.connectCrypto)return window.connectCrypto;const{ConnectCrypto:t}=await Te(async()=>{const{ConnectCrypto:r}=await import("./index-olgtq3p2.js");return{ConnectCrypto:r}},__vite__mapDeps([0,1,2,3])),{BrowserKeyStorage:e}=await Te(async()=>{const{BrowserKeyStorage:r}=await import("./browser-BbIPlSaA.js");return{BrowserKeyStorage:r}},[]),n=new t(new e);return await n.did(),n})();function b0(){return En(()=>({async regenerateDid(){return(await em).regenerateDid()},async did(){return(await em).did()},sign:async t=>await(await em).sign(t)}),[])}const ide=rn(void 0);function sde(){const[t,e]=yi(ide);return jt(()=>{t||em.then(n=>n.did()).then(n=>e(n)).catch(Bn.error)}),t}const ode=rn(window.renown?Promise.resolve(window.renown):void 0);function DF(){const[t,e]=yi(ode),{did:n}=b0();async function r(i){const s=await i();if(!s)return;const{initRenownBrowser:o}=await Te(async()=>{const{initRenownBrowser:l}=await import("./browser-BY_9pOaF.js");return{initRenownBrowser:l}},__vite__mapDeps([4,5,1,6,2,3])),a=o(s);return{user:function(){return Promise.resolve(a.user)},login:function(l){return a.login(l)},logout(){return Promise.resolve(a.logout())},on:{user(l){return a.on("user",l)}}}}return t||e(r(n)),t}let Th=!1;const ade=rn(void 0),kF=()=>{const[t,e]=yi(ade),n=DF();return jt(()=>{var i;let r=null;if(t){const{credential:s,...o}=t;r={id:o.did,username:(i=o.ens)==null?void 0:i.name,...o}}Cte(r)},[t]),jt(()=>{if(Th)return;Th=!0,n==null||n.user().then(i=>{e(i||null)}).catch(()=>{e(null)});const r=n==null?void 0:n.on.user(i=>{e(i||null)});return()=>{r==null||r(),Th=!1}},[n,Th]),t},cde=parseInt("50");function ume(t,e,n=Bn.error){const[r,i]=Qe(e),[s,o]=Qe(),a=l=>{o(l),n(l)};return jt(()=>{i(e),o(void 0)},[e]),[r,(l,u,d)=>{o(void 0),i(f=>{if(!t||!f)return f;try{const p=t(f,l),m=l.scope??"global",h=p.operations[m],g=h[h.length-1];if(g.error){const y=new Error(g.error);a(y),d==null||d(y)}return u==null||u(g,{prevState:{...f},newState:{...p}}),p}catch(p){return a(p),d==null||d(p),f}})},s]}async function lde(t,e,n,r,i){let s;const o=new Promise(l=>{s=i.on("strandUpdate",u=>{var p;if(!(u.documentId===e&&u.scope==n))return;const f=(p=u.operations.at(-1))==null?void 0:p.index;f&&f>=r&&l()})}),a=new Promise((l,u)=>setTimeout(()=>u(new Error(`Timed out waiting for operation ${r} for document ${e}`)),t)),c=Promise.race([o,a]);return c.finally(()=>{s==null||s()}),c}async function ude(t,e,n,r,i,s){const o=(s==null?void 0:s.operationsLimit)||cde;for(const a of Object.values(n.operations))for(let c=0;c<a.length;c+=o){const l=a.slice(c,c+o),u=l.at(-1);if(!u)break;const{scope:d}=u;await i(t,e,l),s!=null&&s.waitForSync&&await lde(1e4,e,d,u.index,r)}}const dde=async t=>{(await Gt.createZip(t)).generateAsync({type:"blob"}).then(n=>{const r=window.document.createElement("a");r.style.display="none",r.href=URL.createObjectURL(n),r.download=`${t.name||"Untitled"}.zip`,window.document.body.appendChild(r),r.click(),window.document.body.removeChild(r)}).catch(Bn.error)};async function dme(t,e){var i,s;const n=e(t.documentType);if(!n)throw new Error(`Document model not supported: ${t.documentType}`);const r=n.utils.fileExtension;if(!window.showSaveFilePicker){await dde(t);return}try{const o=await window.showSaveFilePicker({suggestedName:`${t.name||((i=t.state.global)==null?void 0:i.name)||"Untitled"}.${r?`${r}.`:""}zip`});await n.utils.saveToFileHandle(t,o);const a=(await o.getFile()).path;return typeof window<"u"&&((s=window.electronAPI)==null||s.fileSaved(t,a)),a}catch(o){if(!(o instanceof DOMException&&o.name==="AbortError"))throw o}}async function fde(t,e){const n=await Gt.loadFromInput(t,i=>i,{checkHashes:!0}),r=e(n.documentType);if(!r)throw new Error(`Document "${n.documentType}" is not supported`);return r.utils.loadFromInput(t)}async function pde(t,e,n,r,i,s){if(!s||!t.context||!t.context.signer)return t;if(!i)return Bn.error(`Document model '${r.documentType}' does not have a reducer`),t;const o={documentId:n,signer:t.context.signer};return await Gt.buildSignedOperation(t,i,r,o,e)}function hde(t,e,n){return n?{context:{signer:{app:{name:"Connect",key:e||""},user:{address:n.address,networkId:n.networkId,chainId:n.chainId},signatures:[]}},...t}:t}const RO=rn(new Map);function iw(t){return Object.keys(t.operations).map(e=>{var n;return`${e}:${t.operations[e].length}:${(n=t.operations[e].at(-1))==null?void 0:n.hash}`}).join(":")}function bg(t){return t.map(iw).join("&")}const mde=t=>()=>rn(e=>t?e(RO).get(t)??[]:[],(e,n,r)=>{n(RO,i=>{if(!t)return new Map;const s=i.get(t)??[];return s.length!==r.length||bg(s)!==bg(r)?new Map(i).set(t,r):i})}),gde=FZ(()=>rn("INITIAL"));function AF(){const t=CF(),[e,n]=yi(En(mde(t),[t])),r=xe(async()=>{if(!t)return;const a=[];try{const c=await t.getDrives();for(const l of c)try{const u=await t.getDrive(l);a.push(u)}catch(u){Bn.error(u)}}catch(c){Bn.error(c)}finally{n(a)}},[t]),[i,s]=yi(gde(t));i==="INITIAL"&&(s("LOADING"),r().then(()=>s("LOADED")).catch(()=>s("ERROR")));const o=xe(a=>{if(!t)return;const c=t.on("syncStatus",async(f,p,m)=>{m&&Bn.error(m),await r()}),l=t.on("strandUpdate",()=>r()),u=t.on("clientStrandsError",a.strandsErrorHandler),d=t.on("defaultRemoteDrive",()=>r());return()=>{c(),l(),u(),d()}},[t,r]);return En(()=>[e,r,o,i],[e,i])}const yde=window.__VITE_ENVS.PH_CONNECT_RENOWN_URL||"https://www.renown.id",vde=window.__VITE_ENVS.PH_CONNECT_RENOWN_NETWORK_ID||"eip155",bde=window.__VITE_ENVS.PH_CONNECT_RENOWN_CHAIN_ID||"1",_de=rn("initial"),wde=()=>{const[t,e]=yi(_de),n=kF(),r=DF(),{did:i}=b0(),s=xe(async()=>{var u;const c=await i(),l=new URL(yde);if(l.searchParams.set("connect",c),l.searchParams.set("network",vde),l.searchParams.set("chain",bde),window.electronAPI){const d=await window.electronAPI.protocol();l.searchParams.set("deeplink",d),await window.electronAPI.openURL(l.toString())}else{const d=new URL(window.location.pathname,window.location.origin);l.searchParams.set("returnUrl",d.toJSON()),(u=window.open(l,"_self"))==null||u.focus()}},[i]),o=xe(async c=>{if(r)try{e("checking");const l=await r.user();if((l==null?void 0:l.did)===c)return e("authorized"),l;const u=await r.login(c);if(u)return e("authorized"),u;e("not-authorized")}catch(l){e("not-authorized"),Bn.error(l)}},[r]);jt(()=>{n&&t!=="authorized"&&e("authorized")},[n,t]);const a=xe(async()=>{e("initial"),await(r==null?void 0:r.logout())},[r]);return En(()=>({openRenown:s,user:n,status:n?"authorized":t,login:r?o:void 0,logout:a}),[r,s,n,t,o,a])};function Ede(){const{user:t,status:e}=wde(),n=window.__VITE_ENVS.PH_CONNECT_ARBITRUM_ALLOW_LIST,r=window.__VITE_ENVS.PH_CONNECT_RWA_ALLOW_LIST,i=!!n&&n!=="",s=!!r&&r!=="";if(i&&s)throw new Error("Both Arbitrum and RWA allow lists are defined. Please only define one.");if(!i&&!s)return{isAllowed:!0,allowListType:"none"};if(t!==void 0){if(i){const o=n.split(",");return e!=="authorized"||!t?{isAllowed:!1,allowListType:"arbitrum"}:o.includes(t.address)?{isAllowed:!0,allowListType:"arbitrum"}:{isAllowed:!1,allowListType:"arbitrum"}}if(s){const o=r.split(",");return e!=="authorized"||!t?{isAllowed:!1,allowListType:"rwa"}:o.includes(t.address)?{isAllowed:!0,allowListType:"rwa"}:{isAllowed:!1,allowListType:"rwa"}}return{isAllowed:!0,allowListType:"none"}}}function _0(){const t=Ede();if(!t)return;const{allowListType:e,isAllowed:n}=t;return e==="arbitrum"?{isAllowedToCreateDocuments:n,isAllowedToEditDocuments:!0}:e==="rwa"?{isAllowedToCreateDocuments:n,isAllowedToEditDocuments:n}:{isAllowedToCreateDocuments:!0,isAllowedToEditDocuments:!0}}function Cp(){const{isAllowedToCreateDocuments:t,isAllowedToEditDocuments:e}=_0()||{isAllowedToCreateDocuments:!1,isAllowedToEditDocuments:!1},n=kF()||void 0,r=sde(),{sign:i}=b0(),s=CF(),o=OF(),[a,c,,l]=AF(),u=xe(async(L,G)=>{if(!s)throw new Error("Reactor is not loaded");const U=await s.getDocument(L,G);if(!U)throw new Error(`There was an error opening file with id ${G} on drive ${L}`);return U},[s]),d=xe(async(L,G)=>{if(!s)throw new Error("Reactor is not loaded");let U=a.find(le=>le.state.global.id===L);if(!U)throw new Error(`Drive with id ${L} not found`);const C={...U};U=vc(U,hde(G,r,n));const Z=G.scope??"global",V=U.operations[Z].findLast(le=>le.type===G.type);if(!V)throw new Error("There was an error applying the operation");const ce=await pde(V,i,L,C,vc,n);try{const le=await s.queueDriveOperation(L,ce);if(le.status!=="SUCCESS"&&Bn.error(le.error),le.operations.length&&await c(),le.document&&!Ra(le.document))throw new Error("Received document is not a Document Drive");return le.document}catch(le){return Bn.error(le),U}},[a,c,s,i,n,r]),f=xe(async(L,G,U,C,Z)=>{if(!t)throw new Error("User is not allowed to create documents");const H=Gt.hashKey();let V=a.find(ge=>ge.state.global.id===L);if(!V)throw new Error(`Drive with id ${L} not found`);const ce=NS(V.state.global,{id:H,name:G,parentFolder:C??null,documentType:U,document:Z},["global"]);V=await d(L,ce);const le=V==null?void 0:V.state.global.nodes.find(ge=>ge.id===H);if(!le||!Lr(le))throw new Error("There was an error adding document");return le},[d,a,t]),p=xe(async(L,G,U)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(H=>H.state.global.id===L))throw new Error(`Drive with id ${L} not found`);return(await s.queueOperations(L,G,U)).document},[a,e,s]),m=xe(async(L,G,U,C)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create files");const Z=await fde(L,o),H={...Z.initialState,initialState:Z.initialState,operations:{global:[],local:[]},clipboard:[]},V=await f(G,U||(typeof L=="string"?Z.name:L.name),Z.documentType,C,H),ce=a.find(ge=>ge.state.global.id===G),le=ce&&ce.state.local.listeners.length>0;ude(G,V.id,Z,s,p,{waitForSync:le}).catch(ge=>{throw ge})},[f,p,o,t,s]),h=xe(async(L,G,U,C,Z)=>{if(!t)throw new Error("User is not allowed to update files");const H=await d(L,rr.updateFile({id:G,name:C||void 0,parentFolder:Z,documentType:U})),V=H==null?void 0:H.state.global.nodes.find(ce=>ce.id===G);if(!V||!Lr(V))throw new Error("There was an error updating document");return V},[d,t]),g=xe(async(L,G,U)=>{if(!t)throw new Error("User is not allowed to create folders");const C=Gt.hashKey(),Z=await d(L,rr.addFolder({id:C,name:G,parentFolder:U})),H=Z==null?void 0:Z.state.global.nodes.find(V=>V.id===C);if(!H||!gy(H))throw new Error("There was an error adding folder");return H},[d,t]),y=xe(async(L,G)=>{if(!t)throw new Error("User is not allowed to delete documents");await d(L,rr.deleteNode({id:G}))},[d,t]),v=xe(async(L,G,U)=>{if(!t)throw new Error("User is not allowed to rename documents");const C=await d(L,rr.updateNode({id:G,name:U})),Z=C==null?void 0:C.state.global.nodes.find(H=>H.id===G);if(!Z)throw new Error("There was an error renaming node");return Z},[d,t]),b=xe(async(L,G)=>{if(!t)throw new Error("User is not allowed to move documents");G.kind===sr||L.parentFolder===G.id||await d(G.driveId,rr.moveNode({srcFolder:L.id,targetParentFolder:G.id}))},[d,t]),E=xe(async(L,G)=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to copy documents");if(G.kind===sr)return;const U=a.find(ce=>ce.state.global.id===L.driveId);if(!U)return;const C=()=>Gt.hashKey(),H=$f.generateNodesCopy({srcId:L.id,targetParentFolder:G.id,targetName:L.name},C,U.state.global.nodes).map(ce=>rr.copyNode(ce)),V=await s.addDriveActions(L.driveId,H);V.operations.length?await c():V.status!=="SUCCESS"&&Bn.error(`Error copying files: ${V.status}`,V.error)},[a,t,c,s]),w=xe(async(L,G,U)=>{if(!e)throw new Error("User is not allowed to edit documents");if(!s)throw new Error("Reactor is not loaded");if(!a.find(H=>H.state.global.id===L))throw new Error(`Drive with id ${L} not found`);return(await s.addOperation(L,G,U)).document},[a,e,s]),S=xe(async L=>{if(!s)throw new Error("Reactor is not loaded");if(!t)throw new Error("User is not allowed to create drives");const G=L.global.id||Gt.hashKey();L=$f.createState(L);const U=await s.addDrive({global:{...L.global,id:G},local:L.local});return await c(),U},[t,c,s]),_=xe(async(L,G)=>{if(!s)throw new Error("Reactor is not loaded");const U=await s.addRemoteDrive(L,G);return await c(),U},[c,s]),O=xe(async L=>{if(!t)throw new Error("User is not allowed to delete drives");if(!s)throw new Error("Reactor is not loaded");if(!a.find(U=>U.state.global.id===L))throw new Error(`Drive with id ${L} not found`);return await s.deleteDrive(L),c()},[a,t,c,s]),M=xe(async(L,G)=>{if(!t)throw new Error("User is not allowed to rename drives");return d(L,rr.setDriveName({name:G}))},[d,t]),F=xe(async(L,G)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d(L,rr.setAvailableOffline({availableOffline:G}))},[d,t]),q=xe(async(L,G)=>{if(!t)throw new Error("User is not allowed to change drive availability");return d(L,rr.setSharingType({type:G}))},[d,t]),I=xe(async(L,G)=>{if(G!==Js){if(!s)throw new Error("Reactor is not loaded");try{const U=s.getSyncStatus(L);return U instanceof YP?"INITIAL_SYNC":U}catch(U){return console.error(U),A8}}},[s]),$=xe(L=>{if(!s)throw new Error("Reactor is not loaded");return s.on("strandUpdate",L)},[s]),x=xe(L=>{if(!s)throw new Error("Reactor is not loaded");return s.on("syncStatus",L)},[s]),A=xe(async()=>{s&&(await s.clearStorage(),await c())},[c,s]),P=xe(async(L,G)=>{const U=await d(L,rr.removeTrigger({triggerId:G}));if(U==null?void 0:U.state.local.triggers.find(Z=>Z.id===G))throw new Error(`There was an error removing trigger ${G}`)},[d]),B=xe(async(L,G,U)=>{if(!s)throw new Error("Reactor is not loaded");return await s.registerPullResponderTrigger(L,G,U)},[s]),J=xe(async(L,G)=>{const U=await d(L,rr.addTrigger({trigger:G}));if(!(U==null?void 0:U.state.local.triggers.find(Z=>Z.id===Z.id)))throw new Error(`There was an error adding the trigger ${G.id}`)},[d]);return En(()=>({documentDrives:a,documentDrivesStatus:l,addDocument:f,openFile:u,addFile:m,updateFile:h,addFolder:g,deleteNode:y,renameNode:v,moveNode:b,copyNode:E,addOperation:w,addOperations:p,addDrive:S,addRemoteDrive:_,deleteDrive:O,renameDrive:M,setDriveAvailableOffline:F,setDriveSharingType:q,getSyncStatus:I,onStrandUpdate:$,onSyncStatus:x,clearStorage:A,removeTrigger:P,addTrigger:J,registerNewPullResponderTrigger:B}),[f,S,m,g,w,p,_,J,A,E,O,y,a,l,I,b,$,x,u,B,P,M,v,F,q,h])}function sw(t){return t.replaceAll(/\s/g,"-")}const Sde=t=>{const{open:e,onClose:n,selectedParentNode:r,setSelectedNode:i,documentModel:s}=t,{addDocument:o}=Cp();return T(wH,{open:e,onContinue:async c=>{if(n(),!r)throw new Error("No drive or folder selected");const l=await o(r.driveId,c||`New ${s.documentModel.name}`,s.documentModel.id,r.id);l&&i({...l,slug:sw(l.name),kind:sr,documentType:l.documentType,parentFolder:r.id,driveId:r.driveId,syncStatus:r.syncStatus,synchronizationUnits:[],sharingType:r.sharingType})},onOpenChange:c=>{if(!c)return n()}})},xde=rn(Ai);function NF(){return yi(xde)}let Ih;const Tde=new Uint8Array(16);function Ide(){if(!Ih&&(Ih=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ih))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ih(Tde)}const tr=[];for(let t=0;t<256;++t)tr.push((t+256).toString(16).slice(1));function Ode(t,e=0){return tr[t[e+0]]+tr[t[e+1]]+tr[t[e+2]]+tr[t[e+3]]+"-"+tr[t[e+4]]+tr[t[e+5]]+"-"+tr[t[e+6]]+tr[t[e+7]]+"-"+tr[t[e+8]]+tr[t[e+9]]+"-"+tr[t[e+10]]+tr[t[e+11]]+tr[t[e+12]]+tr[t[e+13]]+tr[t[e+14]]+tr[t[e+15]]}const Cde=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),DO={randomUUID:Cde};function kO(t,e,n){if(DO.randomUUID&&!t)return DO.randomUUID();t=t||{};const r=t.random||(t.rng||Ide)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ode(r)}const Rde=t=>{var q;const[e]=NF(),{open:n,onClose:r}=t,i=localStorage.getItem("AUTO_REGISTER_PULL_RESPONDER")!=="false";console.log("autoRegisterPullResponder",i);const[s,o]=Qe(e.appVersion),[a,c]=Qe({label:Np.debug?"Enabled":"Disabled",value:Np.debug}),[l,u]=Qe(),[d,f]=Qe(null),[p,m]=Qe(""),[h,g]=Qe({label:i?"Enabled":"Disabled",value:i?"true":"false"}),{documentDrives:y,removeTrigger:v,addTrigger:b,registerNewPullResponderTrigger:E}=Cp();jt(()=>{Np.setDebug(a.value)},[a]),console.log("documentDrives",y),console.log("selectedDrive",l);const w=((q=y.find(I=>I.state.global.id===l))==null?void 0:q.state.local.triggers)||[],_=!l||p==="",O=async()=>{!d||!l||(await v(l,d.value),f(null))},M=async(I=!1)=>{if(!(!p||p===""||!l)){if(!I){const $=await E(l,p,{pullInterval:3e3});await b(l,$),m("");return}await b(l,{id:`invalid-trigger-${kO()}`,type:"PullResponder",data:{interval:"3000",listenerId:`ivalid-listener-${kO()}`,url:p}}),m("")}},F=I=>{g(I),localStorage.setItem("AUTO_REGISTER_PULL_RESPONDER",I.value)};return T(ho,{open:n,onOpenChange:I=>{if(!I)return r()},contentProps:{className:"rounded-2xl"},children:_e("div",{className:"w-[700px] rounded-2xl p-6",children:[_e("div",{className:"mb-6 flex justify-between",children:[T("div",{className:"text-xl font-bold",children:"Debug Tools"}),T("button",{id:"close-modal",onClick:()=>r(),children:T(ze,{name:"Xmark",size:28})})]}),_e("div",{className:"flex text-sm font-bold",children:[T(ze,{name:"Ring",size:22}),_e("span",{className:"ml-2",children:["App Version: ",e.appVersion]})]}),_e("div",{className:"mt-4 flex text-sm font-bold",children:[T(ze,{name:"Hdd",size:22}),T("span",{className:"ml-2",children:"Drive Tools:"})]}),_e("div",{children:[T("label",{htmlFor:"selectedDrive",className:"text-xs",children:"Selected Drive:"}),T(jp,{id:"selectedDrive",onChange:I=>{if(!I||typeof I!="object"||!("value"in I)){u(void 0),f(null);return}u(I.value),f(null)},options:y.map(I=>({label:I.state.global.name,value:I.state.global.id}))})]}),T("div",{className:"mt-2 flex items-end justify-between pl-4",children:_e("div",{className:"w-[400px]",children:[T("label",{htmlFor:"autoRegisterPullResponder",className:"text-xs",children:"Auto register pull responder:"}),T(jp,{id:"autoRegisterPullResponder",onChange:I=>{F(I)},value:h,options:[{label:"Enabled",value:"true"},{label:"Disabled",value:"false"}]})]})}),_e("div",{className:"mt-2 flex items-end justify-between pl-4",children:[_e("div",{className:"w-[400px]",children:[T("label",{htmlFor:"driveTrigger",className:"text-xs",children:"Drive trigger:"}),T(jp,{id:"driveTrigger",onChange:I=>{f(I)},value:d,options:w.map(I=>({label:`${I.id} - ${I.type}`,value:I.id}))})]}),T("div",{children:T(Pr,{onClick:O,color:d?"red":"light",disabled:!d,size:"small",children:"Remove Trigger"})})]}),_e("div",{className:"mt-2 flex items-end justify-between pl-4",children:[_e("div",{className:"w-[400px]",children:[T("label",{htmlFor:"driveUrl",className:"text-xs",children:"Add drive trigger:"}),T(rc,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"driveUrl",icon:T("div",{className:"flex h-full items-center text-xs",children:"URL:"}),value:p,onChange:I=>m(I.target.value)})]}),_e("div",{className:"mb-1 flex items-center justify-center",children:[T(Pr,{className:"mr-2",color:_?"light":"blue",size:"small",disabled:_,onClick:()=>M(),children:"Add Trigger"}),T(Pr,{color:_?"light":"red",size:"small",disabled:_,onClick:()=>M(!0),children:"Add Invalid Trigger"})]})]}),_e("div",{className:"mt-4 flex text-sm font-bold",children:[T(ze,{name:"Gear",size:22}),T("span",{className:"ml-2",children:"Service Worker Tools:"})]}),T("div",{className:"mt-2 flex items-end justify-between pl-4",children:_e("div",{className:"w-[400px]",children:[T("label",{htmlFor:"serviceWorkerDebugMode",className:"text-xs",children:"Service Worker Debug Mode:"}),T(jp,{id:"serviceWorkerDebugMode",onChange:I=>{c(I)},value:a,options:[{label:"Enabled",value:!0},{label:"Disabled",value:!1}]})]})}),_e("div",{className:"mt-2 flex items-end justify-between pl-4",children:[_e("div",{className:"w-[400px]",children:[T("label",{htmlFor:"appVersion",className:"text-xs",children:"Set invalid app version:"}),T(rc,{containerClassName:"p-1 bg-white border border-gray-200 rounded-md text-sm",inputClassName:"text-xs font-normal",id:"appVersion",icon:T("div",{className:"flex h-full items-center text-xs",children:"Version:"}),value:s,onChange:I=>o(I.target.value)})]}),T("div",{className:"mb-1 flex items-center justify-center",children:T(Pr,{color:s===""?"light":"red",size:"small",disabled:s==="",onClick:()=>{Np.sendMessage({type:"SET_APP_VERSION",version:s}),o("")},children:"Add Invalid App Version"})})]})]})})},Dde=t=>{const{open:e,onClose:n,uiDriveNode:r,onDelete:i}=t,{t:s}=ha();return T(EH,{open:e,driveName:r.name,onCancel:n,header:s("modals.deleteDrive.title",{label:r.name}),body:s("modals.deleteDrive.body"),inputPlaceholder:s("modals.deleteDrive.inputPlaceholder"),cancelLabel:s("common.cancel"),continueLabel:s("common.delete"),onContinue:()=>i(n),onOpenChange:o=>{if(!o)return n()}})},kde=t=>{const{t:e}=ha(),{uiNode:n,open:r,onClose:i,onDelete:s}=t,{kind:o,name:a}=n;return T(SH,{open:r,onDelete:()=>s(i),onCancel:()=>i(),header:e(`modals.deleteItem.${o.toLowerCase()}.header`,{item:a}),body:e(`modals.deleteItem.${o.toLowerCase()}.body`),cancelLabel:e("common.cancel"),deleteLabel:e("common.delete")})},Ade=t=>{const{open:e,onClose:n}=t,{t:r}=ha();return T(H1,{open:e,header:r("modals.disclaimer.title"),body:r("modals.disclaimer.body"),closeLabel:"Close",onContinue:()=>n()})};function Nde(t){const{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onClose:a}=t;return T(xH,{uiDriveNode:e,open:n,onRenameDrive:r,onDeleteDrive:i,onChangeAvailableOffline:s,onChangeSharingType:o,onOpenChange:c=>{if(!c)return a()}})}const Pde=()=>T(MW,{packageJson:d$});var Mde=Object.defineProperty,Lde=Object.getOwnPropertyDescriptor,ks=(t,e,n,r)=>{for(var i=Lde(e,n),s=t.length-1,o;s>=0;s--)(o=t[s])&&(i=o(e,n,i)||i);return i&&Mde(e,n,i),i};function As(t,e,n){const r=n.value;n.value=function(...i){if(!this.server)throw new Error("Read mode document drive not initialized.");return r.apply(this,i)}}function Fde(t){const e=Object.getPrototypeOf(t);Object.getOwnPropertyNames(e).forEach(r=>{const i=Object.getOwnPropertyDescriptor(e,r);i&&typeof i.value=="function"&&r!=="constructor"&&(t[r]=t[r].bind(t))})}class Ji{constructor(e){Ke(this,"server");Fde(this),this.server=e}getServer(){return this.server}setDocumentDrive(e){this.server=e}migrateReadDrive(e,n){return this.server.migrateReadDrive(e,n)}addReadDrive(e,n){return this.server.addReadDrive(e,n)}getReadDrives(){return this.server.getReadDrives()}getReadDriveBySlug(e){return this.server.getReadDriveBySlug(e)}getReadDrive(e){return this.server.getReadDrive(e)}getReadDriveContext(e){return this.server.getReadDriveContext(e)}fetchDrive(e){return this.server.fetchDrive(e)}fetchDocument(e,n,r){return this.server.fetchDocument(e,n,r)}deleteReadDrive(e){return this.server.deleteReadDrive(e)}onReadDrivesUpdate(e){return this.server.onReadDrivesUpdate(e)}}ks([As],Ji.prototype,"migrateReadDrive");ks([As],Ji.prototype,"addReadDrive");ks([As],Ji.prototype,"getReadDrives");ks([As],Ji.prototype,"getReadDriveBySlug");ks([As],Ji.prototype,"getReadDrive");ks([As],Ji.prototype,"getReadDriveContext");ks([As],Ji.prototype,"fetchDrive");ks([As],Ji.prototype,"fetchDocument");ks([As],Ji.prototype,"deleteReadDrive");ks([As],Ji.prototype,"onReadDrivesUpdate");const al=new Ji,PF=fu({...al,readDrives:[]});async function $de(t){const e=await t.getReadDrives();return(await Promise.all(e.map(r=>t.getReadDrive(r)))).filter(r=>!(r instanceof Da))}const jde=t=>{const e=rde(),[n,r]=Qe([]),i=_0(),[s,o]=Qe(!1);jt(()=>{e&&(al.setDocumentDrive(e),o(!0))},[e]);const a=i===void 0?void 0:!(i.isAllowedToCreateDocuments||i.isAllowedToEditDocuments);En(()=>{if(!s||a===void 0)return;const l=a?"READ":"WRITE",u=al.getServer();u&&typeof u.setAllDefaultDrivesAccessLevel=="function"&&u.setAllDefaultDrivesAccessLevel(l).catch(Bn.error)},[a,s]),jt(()=>{if(!s)return;$de(al).then(u=>r(u)).catch(Bn.error);const l=al.onReadDrivesUpdate(u=>{r(d=>d.length!==u.length||bg(d)!==bg(u)?u:d)}).catch(Bn.error);return()=>{l.then(u=>u==null?void 0:u()).catch(Bn.error)}},[s]);const c=En(()=>({...al,readDrives:n}),[n]);return T(PF.Provider,{...t,value:c})},Ude=()=>da(PF);function Bde(t,e=50){let n;const r=[];return i=>{n&&clearTimeout(n);const s=r.findIndex(o=>o.scope===i.scope&&o.index===i.index);if(s>-1){const o=r[s];o.type===i.type&&JSON.stringify(i.input)===JSON.stringify(o.input)||console.warn("Two conflicting operations were dispatched:",o,i),r[s]=i}else r.push(i);return new Promise((o,a)=>{n=setTimeout(()=>{t(r).then(o).catch(a)},e)})}}const zde=rn(new Map),sb=rn(void 0);function Vde(t,e){return t===e?!0:!t||!e?!1:dc(t)===dc(e)}const tm=rn(t=>t(sb),(t,e,n)=>{const r=t(sb),i=t(zde);return!(n!=null&&n.document)&&(n==null?void 0:n.status)==="LOADING"&&(n.document=i.get(`${n.driveId}:${n.documentId}`)),(r==null?void 0:r.driveId)!==(n==null?void 0:n.driveId)||(r==null?void 0:r.documentId)!==(n==null?void 0:n.documentId)||(r==null?void 0:r.documentType)!==(n==null?void 0:n.documentType)||(r==null?void 0:r.status)!==(n==null?void 0:n.status)||!!(r!=null&&r.document)!=!!(n!=null&&n.document)||r!=null&&r.document&&(n!=null&&n.document)&&iw(r.document)!==iw(n.document)?((n==null?void 0:n.status)==="LOADED"&&i.set(`${n.driveId}:${n.documentId}`,n.document),e(sb,n),!0):!1}),Hde=rn(null,(t,e,n)=>{const r=t(tm);if(r)n?Vde(n,r.document)||e(tm,{...r,document:n}):e(tm,void 0);else throw new Error("fileNodeDocument is undefined")}),Wde=()=>HA(Hde);function qde(t){const{selectedNode:e,selectedDriveNode:n,openFile:r,addOperations:i,onStrandUpdate:s,fetchDocument:o}=t,[a,c]=yi(tm),l=(n==null?void 0:n.sharingType)!=="LOCAL"&&(n==null?void 0:n.syncStatus)===void 0,u=e==null?void 0:e.driveId,d=e==null?void 0:e.id,f=e==null?void 0:e.name,p=e==null?void 0:e.kind,m=p==="FILE"?e==null?void 0:e.documentType:void 0,h=Wde(),g=xe(async(E,w,S)=>{const _=await(l?o(E,w,S):r(E,w));if(_ instanceof Error)throw _;return _},[o,l,r]);jt(()=>{if(!u||!d||!m){a&&c(void 0);return}(u!==(a==null?void 0:a.driveId)||d!==a.documentId||m!==a.documentType||f!==a.name)&&c({driveId:u,documentId:d,documentType:m,name:f||"",document:void 0,status:"LOADING"})&&g(u,d,m).then(w=>c(w?{driveId:u,documentId:d,documentType:m,document:w,name:f||"",status:"LOADED"}:{driveId:u,documentId:d,documentType:m,document:w,name:f||"",status:"ERROR"})).catch(w=>{Bn.error(w),c({driveId:u,documentId:d,documentType:m,name:f||"",document:void 0,status:"ERROR"})})},[e,d,m,f,u,g,a,c]),jt(()=>!(a!=null&&a.driveId)||!a.documentId||!a.documentType?void 0:s(w=>{w.driveId===a.driveId&&w.documentId===a.documentId&&g(a.driveId,a.documentId,a.documentType).then(h).catch(Bn.error)}),[a==null?void 0:a.driveId,a==null?void 0:a.documentId,a==null?void 0:a.documentType,s,g,h]);const y=En(()=>{if(u&&d&&p===sr)return Bde(E=>i(u,d,E))},[i,u,d,p]),v=p===sr&&(a==null?void 0:a.driveId)===u&&(a==null?void 0:a.documentId)===d,b=v?a==null?void 0:a.document:void 0;return En(()=>({fileNodeDocument:a,selectedDocument:b,setSelectedDocument:h,addOperationToSelectedDocument:y}),[a,v,b,h,y])}const w0=localStorage.getItem("CONNECT_DEBUG")==="true",Gde=[{sharingType:to,label:"Public Drives"},{sharingType:$l,label:"Secure Cloud Drives"},{sharingType:Js,label:"My Local Drives"}],AO=t=>Ai.drives.sections[t];function ob(t){const e=[...o5];return Ai.drives.sections[t].allowDelete&&e.push(Vg),w0&&e.push(...Nw),e}function ab(){const t=[...a5];return w0&&t.push(...Nw),t}function cb(){const t=[...c5];return w0&&t.push(...Nw),t}function Zde(){return{[Js]:{[qr]:ob(Js),[gd]:cb(),[sr]:ab()},[$l]:{[qr]:ob($l),[gd]:cb(),[sr]:ab()},[to]:{[qr]:ob(to),[gd]:cb(),[sr]:ab()}}}const fme=Gde.filter(t=>AO(t.sharingType).enabled).map(t=>{const e=AO(t.sharingType);return{...t,disableAddDrives:!e.allowAdd}});function MF(t){var o;const{documentDrives:e}=Cp();if(!t)return{drive:null,remoteUrl:null,isRemoteDrive:!1};const n=e.find(a=>a.state.global.id===t),r=n==null?void 0:n.state.local.triggers.find(a=>a.type==="PullResponder"),{remoteUrl:i}=(n==null?void 0:n.state.global)||{},s=!!i||!!r;return{drive:n,remoteUrl:i||((o=r==null?void 0:r.data)==null?void 0:o.url),isRemoteDrive:s}}var E0={exports:{}};E0.exports;(function(t){var e=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function o(c,l){if(!s[c]){s[c]={};for(var u=0;u<c.length;u++)s[c][c.charAt(u)]=u}return s[c][l]}var a={compressToBase64:function(c){if(c==null)return"";var l=a._compress(c,6,function(u){return r.charAt(u)});switch(l.length%4){default:case 0:return l;case 1:return l+"===";case 2:return l+"==";case 3:return l+"="}},decompressFromBase64:function(c){return c==null?"":c==""?null:a._decompress(c.length,32,function(l){return o(r,c.charAt(l))})},compressToUTF16:function(c){return c==null?"":a._compress(c,15,function(l){return n(l+32)})+" "},decompressFromUTF16:function(c){return c==null?"":c==""?null:a._decompress(c.length,16384,function(l){return c.charCodeAt(l)-32})},compressToUint8Array:function(c){for(var l=a.compress(c),u=new Uint8Array(l.length*2),d=0,f=l.length;d<f;d++){var p=l.charCodeAt(d);u[d*2]=p>>>8,u[d*2+1]=p%256}return u},decompressFromUint8Array:function(c){if(c==null)return a.decompress(c);for(var l=new Array(c.length/2),u=0,d=l.length;u<d;u++)l[u]=c[u*2]*256+c[u*2+1];var f=[];return l.forEach(function(p){f.push(n(p))}),a.decompress(f.join(""))},compressToEncodedURIComponent:function(c){return c==null?"":a._compress(c,6,function(l){return i.charAt(l)})},decompressFromEncodedURIComponent:function(c){return c==null?"":c==""?null:(c=c.replace(/ /g,"+"),a._decompress(c.length,32,function(l){return o(i,c.charAt(l))}))},compress:function(c){return a._compress(c,16,function(l){return n(l)})},_compress:function(c,l,u){if(c==null)return"";var d,f,p={},m={},h="",g="",y="",v=2,b=3,E=2,w=[],S=0,_=0,O;for(O=0;O<c.length;O+=1)if(h=c.charAt(O),Object.prototype.hasOwnProperty.call(p,h)||(p[h]=b++,m[h]=!0),g=y+h,Object.prototype.hasOwnProperty.call(p,g))y=g;else{if(Object.prototype.hasOwnProperty.call(m,y)){if(y.charCodeAt(0)<256){for(d=0;d<E;d++)S=S<<1,_==l-1?(_=0,w.push(u(S)),S=0):_++;for(f=y.charCodeAt(0),d=0;d<8;d++)S=S<<1|f&1,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=f>>1}else{for(f=1,d=0;d<E;d++)S=S<<1|f,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=0;for(f=y.charCodeAt(0),d=0;d<16;d++)S=S<<1|f&1,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=f>>1}v--,v==0&&(v=Math.pow(2,E),E++),delete m[y]}else for(f=p[y],d=0;d<E;d++)S=S<<1|f&1,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=f>>1;v--,v==0&&(v=Math.pow(2,E),E++),p[g]=b++,y=String(h)}if(y!==""){if(Object.prototype.hasOwnProperty.call(m,y)){if(y.charCodeAt(0)<256){for(d=0;d<E;d++)S=S<<1,_==l-1?(_=0,w.push(u(S)),S=0):_++;for(f=y.charCodeAt(0),d=0;d<8;d++)S=S<<1|f&1,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=f>>1}else{for(f=1,d=0;d<E;d++)S=S<<1|f,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=0;for(f=y.charCodeAt(0),d=0;d<16;d++)S=S<<1|f&1,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=f>>1}v--,v==0&&(v=Math.pow(2,E),E++),delete m[y]}else for(f=p[y],d=0;d<E;d++)S=S<<1|f&1,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=f>>1;v--,v==0&&(v=Math.pow(2,E),E++)}for(f=2,d=0;d<E;d++)S=S<<1|f&1,_==l-1?(_=0,w.push(u(S)),S=0):_++,f=f>>1;for(;;)if(S=S<<1,_==l-1){w.push(u(S));break}else _++;return w.join("")},decompress:function(c){return c==null?"":c==""?null:a._decompress(c.length,32768,function(l){return c.charCodeAt(l)})},_decompress:function(c,l,u){var d=[],f=4,p=4,m=3,h="",g=[],y,v,b,E,w,S,_,O={val:u(0),position:l,index:1};for(y=0;y<3;y+=1)d[y]=y;for(b=0,w=Math.pow(2,2),S=1;S!=w;)E=O.val&O.position,O.position>>=1,O.position==0&&(O.position=l,O.val=u(O.index++)),b|=(E>0?1:0)*S,S<<=1;switch(b){case 0:for(b=0,w=Math.pow(2,8),S=1;S!=w;)E=O.val&O.position,O.position>>=1,O.position==0&&(O.position=l,O.val=u(O.index++)),b|=(E>0?1:0)*S,S<<=1;_=n(b);break;case 1:for(b=0,w=Math.pow(2,16),S=1;S!=w;)E=O.val&O.position,O.position>>=1,O.position==0&&(O.position=l,O.val=u(O.index++)),b|=(E>0?1:0)*S,S<<=1;_=n(b);break;case 2:return""}for(d[3]=_,v=_,g.push(_);;){if(O.index>c)return"";for(b=0,w=Math.pow(2,m),S=1;S!=w;)E=O.val&O.position,O.position>>=1,O.position==0&&(O.position=l,O.val=u(O.index++)),b|=(E>0?1:0)*S,S<<=1;switch(_=b){case 0:for(b=0,w=Math.pow(2,8),S=1;S!=w;)E=O.val&O.position,O.position>>=1,O.position==0&&(O.position=l,O.val=u(O.index++)),b|=(E>0?1:0)*S,S<<=1;d[p++]=n(b),_=p-1,f--;break;case 1:for(b=0,w=Math.pow(2,16),S=1;S!=w;)E=O.val&O.position,O.position>>=1,O.position==0&&(O.position=l,O.val=u(O.index++)),b|=(E>0?1:0)*S,S<<=1;d[p++]=n(b),_=p-1,f--;break;case 2:return g.join("")}if(f==0&&(f=Math.pow(2,m),m++),d[_])h=d[_];else if(_===p)h=v+v.charAt(0);else return null;g.push(h),d[p++]=v+h.charAt(0),f--,v=h,f==0&&(f=Math.pow(2,m),m++)}}};return a}();t!=null?t.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})})(E0);var Yde=E0.exports;const Kde=pa(Yde),Jde=`... on RealWorldAssets {
458
+ state {
459
+ portfolio {
460
+ __typename
461
+ ... on FixedIncome {
462
+ name
463
+ CUSIP
464
+ purchaseDate
465
+ purchasePrice
466
+ purchaseProceeds
467
+ salesProceeds
468
+ totalDiscount
469
+ spvId
470
+ }
471
+ ... on Cash {
472
+ id
473
+ balance
474
+ }
475
+ }
476
+ transactions {
477
+ id
478
+ type
479
+ entryTime
480
+ cashBalanceChange
481
+ fees {
482
+ id
483
+ serviceProviderFeeTypeId
484
+ amount
485
+ }
486
+ txRef
487
+ cashTransaction {
488
+ id
489
+ assetId
490
+ amount
491
+ entryTime
492
+ tradeTime
493
+ settlementTime
494
+ accountId
495
+ counterPartyAccountId
496
+ }
497
+ fixedIncomeTransaction {
498
+ id
499
+ assetId
500
+ amount
501
+ entryTime
502
+ tradeTime
503
+ settlementTime
504
+ accountId
505
+ counterPartyAccountId
506
+ }
507
+ }
508
+ }
509
+ }`,Xde=`... on AccountSnapshot {
510
+ state {
511
+ id
512
+ ownerId
513
+ ownerType
514
+ period
515
+ start
516
+ end
517
+ actualsComparison {
518
+ month
519
+ reportedActuals
520
+ currency
521
+ netExpenses {
522
+ offChainIncluded {amount difference}
523
+ onChainOnly {amount difference}
524
+ }
525
+ }
526
+ snapshotAccount {
527
+ id
528
+ accountLabel
529
+ accountAddress
530
+ accountType
531
+ groupAccountId
532
+ offChain
533
+ upstreamAccountId
534
+ }
535
+ }
536
+ }`,Qde=`... on BudgetStatement {
537
+ state {
538
+ month
539
+ quoteCurrency
540
+ accounts {
541
+ name
542
+ address
543
+ lineItems {
544
+ actual
545
+ payment
546
+ budgetCap
547
+ }
548
+ }
549
+ ftes {
550
+ value
551
+ }
552
+ }
553
+ }`,LF=(t,e,n=!0)=>{let r="";e==="powerhouse/account-snapshot"&&(r=Xde),e==="powerhouse/budget-statement"&&(r=Qde),e==="makerdao/rwa-portfolio"&&(r=Jde);const i=`query {
554
+ document(id:"${t}") {
555
+ name
556
+ documentType
557
+ revision
558
+ created
559
+ lastModified
560
+ ${r}
561
+ }
562
+ }`;return n?encodeURIComponent(i):i},efe=(t,e,n)=>{const r=LF(n,e,!1),i=Kde.compressToEncodedURIComponent(JSON.stringify({document:r.trim()}));return(t+`?explorerURLState=${i}`).toString()},tfe=(t,e,n)=>{if(t.includes("localhost"))return efe(t,e,n);const r=t.replace(/\/d\//,"/graphql/"),i=LF(n,e);return(r+`?query=${i}`).toString()},nfe=t=>window.open(t,"_blank");var aC;const rfe=((aC=window.electronAPI)==null?void 0:aC.openURL)??nfe,ife=t=>{const{isRemoteDrive:e,remoteUrl:n}=MF(t);return async r=>{if((r==null?void 0:r.kind)!==sr||!n||!e)return;new URL(n).origin;const s=tfe(n,r.documentType,r.id);await rfe(s)}};function sfe(){const{showModal:t}=S0(),{t:e}=ha(),n=wZ(),{selectedDriveNode:r,driveNodes:i,selectedParentNode:s,setSelectedNode:o,getParentNode:a}=n,c=Ude(),l=Cp(),{addFolder:u,addFile:d,renameNode:f,deleteNode:p,addDrive:m,addRemoteDrive:h,deleteDrive:g,renameDrive:y,setDriveAvailableOffline:v,setDriveSharingType:b,copyNode:E,moveNode:w,getSyncStatus:S,removeTrigger:_,addTrigger:O,registerNewPullResponderTrigger:M}=l,F=MF(r==null?void 0:r.id),q=ife(r==null?void 0:r.id),I=_0(),$=Zde(),x=Yue(),A=OF(),P=qde({...n,...l,...c}),B=xe(async N=>{const z="readContext"in N,{id:X,name:Y,icon:ee,slug:pe}=N.state.global,{sharingType:he,availableOffline:Pe}=z?{sharingType:to,availableOffline:!1}:N.state.local,nt=he==null?void 0:he.toUpperCase(),Ze=nt==="PRIVATE"?Js:nt,Xt=z?void 0:await S(X,Ze),Gn=Xt==="INITIAL_SYNC"?"SYNCING":Xt,an={id:X,name:Y,slug:pe||null,kind:qr,children:[],nodeMap:{},sharingType:Ze,syncStatus:Gn,availableOffline:Pe,icon:ee,parentFolder:null,driveId:X},pr=N.state.global.nodes.map(rt=>{const xn={...rt,slug:sw(rt.name),driveId:X,parentFolder:rt.parentFolder||X,kind:rt.kind.toUpperCase(),syncStatus:Gn,sharingType:Ze};if(xn.kind===qr)throw new Error("Drive nodes should not be nested");return xn.kind===sr?xn:{...xn,children:[]}});for(const rt of pr)an.nodeMap[rt.id]=rt;for await(const rt of pr){if(rt.kind===sr){const Rr=z?void 0:await S(rt.synchronizationUnits[0].syncId,Ze),ar=Rr==="INITIAL_SYNC"?"SYNCING":Rr;rt.syncStatus=ar}if(rt.parentFolder===X){an.children.push(rt);continue}const xn=an.nodeMap[rt.parentFolder];if(xn.kind===sr)throw new Error(`Parent node ${rt.parentFolder} is a file, not a folder`);xn.children.push(rt),rt.syncStatus!==k8&&(xn.syncStatus=rt.syncStatus)}return an},[S]),J=xe(async N=>Promise.all(N.map(B)),[B]),L=xe(async(N,z)=>{if(!z)throw new Error("Parent node is required");if(z.kind===sr)throw new Error("Cannot add folder to a file");return await u(z.driveId,N,z.id)},[u]),G=xe(async(N,z)=>{if(z.kind===qr)throw new Error("Drive can only be renamed from the drive settings modal");return await f(z.driveId,z.id,N)},[f]),U=xe(async(N,z)=>{if(N.kind===qr)throw new Error("Drive cannot be duplicated");await E(N,z)},[E]),C=xe(async(N,z)=>{if(N.kind===qr)throw new Error("Drive cannot be moved");await w(N,z)},[w]),Z=xe(async(N,z)=>{if(!z)throw new Error("Parent node is required");if(z.kind===sr)throw new Error("Cannot add file to a file");const X=N.name.replace(/\.zip$/gim,"");return await d(N,z.driveId,X,z.id)},[d]),H=xe(async N=>{if(s){if(N.kind===qr)throw new Error("Drive cannot be duplicated");await E(N,s)}},[E,s]),V=xe(N=>{t("deleteItem",{uiNode:N,onDelete:async z=>{z();const X=N.kind===gd?"notifications.deleteFolderSuccess":"notifications.fileDeleteSuccess",Y=a(N);await p(N.driveId,N.id),o(Y),ih(e(X),{type:"connect-deleted"})}})},[p,a,o,t,e]),ce=xe(N=>{t("deleteDriveModal",{uiDriveNode:N,onDelete:async z=>{z(),await g(N.id),o(i[0]),ih(e("notifications.deleteDriveSuccess"),{type:"connect-deleted"})}})},[g,i,o,t,e]),le=xe(async N=>{try{const z=await m({global:{name:N.name,id:void 0,icon:null,slug:null},local:{availableOffline:N.availableOffline,sharingType:N.sharingType.toLowerCase(),listeners:[],triggers:[]}});ih(e("notifications.addDriveSuccess"),{type:"connect-success"});const X=await B(z);o(X)}catch(z){console.error(z)}},[m,B,o,e]),ge=xe(async N=>{try{const z=await h(N.url,{sharingType:N.sharingType,availableOffline:N.availableOffline,listeners:[{block:!0,callInfo:{data:N.url,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[],pullInterval:3e3});ih(e("notifications.addDriveSuccess"),{type:"connect-success"});const X=await B(z);o(X)}catch(z){console.error(z)}},[h,B,o,e]),Re=xe(N=>{N===Js?t("addLocalDrive",{onAddLocalDrive:le}):t("addRemoteDrive",{onAddRemoteDrive:ge,groupSharingType:N})},[le,ge,t]),Ge=xe(async(N,z)=>{await y(N.id,z)},[y]),st=xe(async(N,z)=>{await b(N.id,z)},[b]),He=xe(async(N,z)=>{await v(N.id,z)},[v]),gt=xe(N=>{t("driveSettings",{uiDriveNode:N,onRenameDrive:Ge,onDeleteDrive:ce,onChangeSharingType:st,onChangeAvailableOffline:He})},[He,st,ce,Ge,t]),D=xe(async N=>{if(!N||!s)return;const z=await L(N,s);o({...z,kind:gd,slug:sw(z.name),parentFolder:s.id,syncStatus:s.syncStatus,driveId:s.driveId,sharingType:s.sharingType,children:[]})},[L,s,o]),me=xe(async N=>{const z=window.prompt("url")||"",X=await M(N,z,{pullInterval:6e3});await O(N,X)},[O,M]),ue=xe(async N=>{const z=window.prompt("triggerId:");z&&await _(N,z)},[_]),K=xe(async N=>{const z=window.prompt("url")||"";await O(N,{id:"some-invalid-id",type:"PullResponder",data:{interval:"3000",listenerId:"invalid-listener-id",url:z}})},[O]),R=En(()=>i.reduce((N,z)=>(N[z.sharingType].push(z),N),{[to]:[],[$l]:[],[Js]:[]}),[i]);return En(()=>({...l,...n,...I,...F,...P,nodeOptions:$,driveNodesBySharingType:R,documentModels:x,onAddFolder:L,onAddFile:Z,onCopyNode:U,onMoveNode:C,onRenameNode:G,onDuplicateNode:H,onDeleteNode:V,onDeleteDrive:ce,makeUiDriveNodes:J,onAddAndSelectNewFolder:D,showAddDriveModal:Re,showDriveSettingsModal:gt,openSwitchboardLink:q,onAddTrigger:me,onRemoveTrigger:ue,onAddInvalidTrigger:K,getDocumentModel:A}),[l,n,I,F,P,$,R,x,L,Z,U,C,G,H,V,ce,J,D,Re,gt,q,me,ue,K,A])}const ofe=({onRefresh:t})=>{const{t:e}=ha(),{clearStorage:n}=Cp(),{driveNodes:r,deleteDrive:i}=sfe(),{showModal:s}=S0(),o=xe(c=>i(c.driveId),[i]);return T(VW,{drives:r,onDeleteDrive:o,onClearStorage:()=>{s("confirmationModal",{title:e("modals.connectSettings.clearStorage.confirmation.title"),body:e("modals.connectSettings.clearStorage.confirmation.body"),cancelLabel:e("common.cancel"),continueLabel:e("modals.connectSettings.clearStorage.confirmation.clearButton"),onContinue:()=>{n().then(()=>{t()}).catch(Bn.error)},onCancel:()=>s("settingsModal",{onRefresh:t})})}})},afe="defaultDocumentModelEditor",cfe=pp(afe,{label:"V2",value:"document-model-editor-v2"}),lfe=()=>yi(cfe),NO=[{label:"V1",value:"document-model-editor"},{label:"V2",value:"document-model-editor-v2"}],ufe=()=>{const[t,e]=lfe(),n=xe(r=>{const i=NO.find(s=>s.value==r);i&&e(i)},[]);return T(hG,{documentModelEditor:t.value,setDocumentModelEditor:n,documentModelEditorOptions:NO})},dfe="Common",ffe="The Powerhouse Common package contains the basic document model and drive UI (App) that is required to get started with Connect and visualize private & public apps.",pfe="Meta",hfe={name:"Powerhouse",url:"https://www.powerhouse.inc/"},mfe=[{id:"powerhouse/document-drive",name:"Document Drive"}],gfe=[{id:"powerhouse/base-document-drive-editor",name:"Base Document Drive Editor",documentTypes:["powerhouse/document-drive"]},{id:"powerhouse/json-editor",name:"JSON Editor",documentTypes:["*"]}],yfe={name:dfe,description:ffe,category:pfe,publisher:hfe,documentModels:mfe,editors:gfe},lb="local-reactor",vfe="Local Reactor";function PO(t,e,n){const r=t.documentModels.map(s=>`Document Model: ${s.name}`),i=t.editors.map(s=>`Editor: ${s.name}`);return{id:e,...t,publisher:t.publisher.name,publisherUrl:t.publisher.url,modules:r.concat(i),removable:n}}const bfe=()=>{const t=jue(),e=$ue(),[n]=AF(),[r,i]=Qe(""),s=En(()=>n.reduce((u,d)=>{var h;const f=d.state.local.triggers.find(g=>{var y;return(y=g.data)==null?void 0:y.url});if(!((h=f==null?void 0:f.data)!=null&&h.url))return u;const p=f.data.url,m=d.state.global.name;return u.push({value:p,label:m,disabled:!0}),u},[{value:lb,label:vfe,disabled:!1}]),[n]);jt(()=>{i(u=>{const d=s.find(f=>!f.disabled);return u&&s.find(f=>f.value===u)?u:(d==null?void 0:d.value)??""})},[r,s]);const o=En(()=>[PO(yfe,"common",!1)].concat(...t.map(u=>PO(u.manifest,u.id,!0))),[t]),a=xe(u=>i(u??""),[]),c=xe(u=>{if(r!==lb)throw new Error("Cannot install external package on a remote reactor");return kue(u)},[r]),l=xe(u=>{if(r!==lb)throw new Error("Cannot delete external package on a remote reactor");return Aue(u)},[r]);return T(EG,{mutable:e,reactorOptions:s,reactor:r,packages:o,onReactorChange:a,onInstall:c,onUninstall:l})},_fe=t=>{const{open:e,onClose:n,onRefresh:r}=t,i=En(()=>[{id:"package-manager",icon:T(ze,{name:"PackageManager",size:12}),label:"Package Manager",content:bfe},{id:"default-editors",icon:T(ze,{name:"Edit",size:12}),label:"Default Editors",content:ufe},{id:"danger-zone",icon:T(ze,{name:"Danger",size:12,className:"text-red-900"}),label:T("span",{className:"text-red-900",children:"Danger Zone"}),content:()=>T(ofe,{onRefresh:r})},{id:"about",icon:T(ze,{name:"QuestionSquare",size:12}),label:"About",content:Pde}],[r]),s=xe(o=>{if(!o)return n()},[n]);return T(SG,{open:e,title:f$("modals.connectSettings.title"),onOpenChange:s,tabs:i})},wfe=t=>{const{open:e,onClose:n,driveId:r}=t,{t:i}=ha();return T(xG,{open:e,onContinue:()=>{console.log("Upgrade drive: ",r),n()},header:i("modals.upgradeDrive.header"),body:i("modals.upgradeDrive.body"),cancelLabel:i("common.cancel"),continueLabel:i("common.continue"),onOpenChange:o=>{if(!o)return n()}})},Efe={deleteItem:kde,upgradeDrive:wfe,createDocument:Sde,addLocalDrive:QZ,addRemoteDrive:IJ,driveSettings:Nde,settingsModal:_fe,confirmationModal:OJ,deleteDriveModal:Dde,debugSettingsModal:Rde,disclaimerModal:Ade,cookiesPolicy:CJ},FF=Ae.createContext({showModal:()=>{},closeModal:()=>{}}),S0=()=>da(FF),Sfe=t=>{const{children:e}=t,[n,r]=Qe(),[i,s]=Qe(),[o,a]=Qe(!1),c=xe((f,p)=>{a(!0),r(p),s(f)},[]),l=xe(()=>{a(!1)},[]),u=i?Efe[i]:null,d=En(()=>({showModal:c,closeModal:l}),[l,c]);return _e(FF.Provider,{value:d,children:[e,u&&T(u,{...n,open:o,onClose:l})]})},xfe=(t,e)=>t.some(n=>n.id===e&&n.value),Tfe=()=>{const{t}=ha(),{showModal:e}=S0(),[n,r]=XZ(),[,i]=KE(),s=[{id:"analytics-cookie",label:t("cookieBanner.cookies.analytics"),value:!0}],o=c=>{r(!1),xfe(c,"analytics-cookie")&&i(l=>({...l,analytics:!0}))},a=()=>{r(!1),i({analytics:!1,functional:!1,marketing:!1})};return n?_e("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[T("div",{className:"absolute inset-0 bg-black opacity-15"}),T("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:T(s5,{className:"max-w-[1024px] ",cookies:s,onSubmit:o,onReject:a,submitLabel:t("cookieBanner.accept"),rejectLabel:t("cookieBanner.reject"),children:T("p",{className:"font-semibold text-gray-500",children:T(mC,{i18nKey:"cookieBanner.message",components:{a:T("a",{onClick:()=>e("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"})}})})})})]}):null};/**
563
+ * @remix-run/router v1.22.0
564
+ *
565
+ * Copyright (c) Remix Software Inc.
566
+ *
567
+ * This source code is licensed under the MIT license found in the
568
+ * LICENSE.md file in the root directory of this source tree.
569
+ *
570
+ * @license MIT
571
+ */function _n(){return _n=Object.assign?Object.assign.bind():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},_n.apply(this,arguments)}var bn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(bn||(bn={}));const MO="popstate";function Ife(t){t===void 0&&(t={});let{initialEntries:e=["/"],initialIndex:n,v5Compat:r=!1}=t,i;i=e.map((p,m)=>u(p,typeof p=="string"?null:p.state,m===0?"default":void 0));let s=c(n??i.length-1),o=bn.Pop,a=null;function c(p){return Math.min(Math.max(p,0),i.length-1)}function l(){return i[s]}function u(p,m,h){m===void 0&&(m=null);let g=du(i?l().pathname:"/",p,m,h);return Sc(g.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(p)),g}function d(p){return typeof p=="string"?p:Au(p)}return{get index(){return s},get action(){return o},get location(){return l()},createHref:d,createURL(p){return new URL(d(p),"http://localhost")},encodeLocation(p){let m=typeof p=="string"?mo(p):p;return{pathname:m.pathname||"",search:m.search||"",hash:m.hash||""}},push(p,m){o=bn.Push;let h=u(p,m);s+=1,i.splice(s,i.length,h),r&&a&&a({action:o,location:h,delta:1})},replace(p,m){o=bn.Replace;let h=u(p,m);i[s]=h,r&&a&&a({action:o,location:h,delta:0})},go(p){o=bn.Pop;let m=c(s+p),h=i[m];s=m,a&&a({action:o,location:h,delta:p})},listen(p){return a=p,()=>{a=null}}}}function pme(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return du("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Au(i)}return Cfe(e,n,null,t)}function Pt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Sc(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Ofe(){return Math.random().toString(36).substr(2,8)}function LO(t,e){return{usr:t.state,key:t.key,idx:e}}function du(t,e,n,r){return n===void 0&&(n=null),_n({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?mo(e):e,{state:n,key:e&&e.key||r||Ofe()})}function Au(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function mo(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function Cfe(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=bn.Pop,c=null,l=u();l==null&&(l=0,o.replaceState(_n({},o.state,{idx:l}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=bn.Pop;let g=u(),y=g==null?null:g-l;l=g,c&&c({action:a,location:h.location,delta:y})}function f(g,y){a=bn.Push;let v=du(h.location,g,y);l=u()+1;let b=LO(v,l),E=h.createHref(v);try{o.pushState(b,"",E)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(E)}s&&c&&c({action:a,location:h.location,delta:1})}function p(g,y){a=bn.Replace;let v=du(h.location,g,y);l=u();let b=LO(v,l),E=h.createHref(v);o.replaceState(b,"",E),s&&c&&c({action:a,location:h.location,delta:0})}function m(g){let y=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof g=="string"?g:Au(g);return v=v.replace(/ $/,"%20"),Pt(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let h={get action(){return a},get location(){return t(i,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(MO,d),c=g,()=>{i.removeEventListener(MO,d),c=null}},createHref(g){return e(i,g)},createURL:m,encodeLocation(g){let y=m(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(g){return o.go(g)}};return h}var tn;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(tn||(tn={}));const Rfe=new Set(["lazy","caseSensitive","path","id","index","children"]);function Dfe(t){return t.index===!0}function _g(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,s)=>{let o=[...n,String(s)],a=typeof i.id=="string"?i.id:o.join("-");if(Pt(i.index!==!0||!i.children,"Cannot specify children on an index route"),Pt(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),Dfe(i)){let c=_n({},i,e(i),{id:a});return r[a]=c,c}else{let c=_n({},i,e(i),{id:a,children:void 0});return r[a]=c,i.children&&(c.children=_g(i.children,e,o,r)),c}})}function Lo(t,e,n){return n===void 0&&(n="/"),nm(t,e,n,!1)}function nm(t,e,n,r){let i=typeof e=="string"?mo(e):e,s=Rp(i.pathname||"/",n);if(s==null)return null;let o=$F(t);Afe(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let l=Vfe(s);a=Bfe(o[c],l,r)}return a}function kfe(t,e){let{route:n,pathname:r,params:i}=t;return{id:n.id,pathname:r,params:i,data:e[n.id],handle:n.handle}}function $F(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let c={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Pt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let l=Go([r,c.relativePath]),u=n.concat(c);s.children&&s.children.length>0&&(Pt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),$F(s.children,e,u,l)),!(s.path==null&&!s.index)&&e.push({path:l,score:jfe(l,s.index),routesMeta:u})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let c of jF(s.path))i(s,o,c)}),e}function jF(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=jF(r.join("/")),a=[];return a.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function Afe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:Ufe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Nfe=/^:[\w-]+$/,Pfe=3,Mfe=2,Lfe=1,Ffe=10,$fe=-2,FO=t=>t==="*";function jfe(t,e){let n=t.split("/"),r=n.length;return n.some(FO)&&(r+=$fe),e&&(r+=Mfe),n.filter(i=>!FO(i)).reduce((i,s)=>i+(Nfe.test(s)?Pfe:s===""?Lfe:Ffe),r)}function Ufe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function Bfe(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],l=a===r.length-1,u=s==="/"?e:e.slice(s.length)||"/",d=$O({path:c.relativePath,caseSensitive:c.caseSensitive,end:l},u),f=c.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=$O({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Go([s,d.pathname]),pathnameBase:qfe(Go([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=Go([s,d.pathnameBase]))}return o}function $O(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=zfe(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((l,u,d)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let h=a[d]||"";o=s.slice(0,s.length-h.length).replace(/(.)\/+$/,"$1")}const m=a[d];return p&&!m?l[f]=void 0:l[f]=(m||"").replace(/%2F/g,"/"),l},{}),pathname:s,pathnameBase:o,pattern:t}}function zfe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Sc(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function Vfe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Sc(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Rp(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function Hfe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?mo(t):t;return{pathname:n?n.startsWith("/")?n:Wfe(n,e):e,search:Gfe(r),hash:Zfe(i)}}function Wfe(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ub(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function UF(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function BF(t,e){let n=UF(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function zF(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=mo(t):(i=_n({},t),Pt(!i.pathname||!i.pathname.includes("?"),ub("?","pathname","search",i)),Pt(!i.pathname||!i.pathname.includes("#"),ub("#","pathname","hash",i)),Pt(!i.search||!i.search.includes("#"),ub("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?e[d]:"/"}let c=Hfe(i,a),l=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(l||u)&&(c.pathname+="/"),c}const Go=t=>t.join("/").replace(/\/\/+/g,"/"),qfe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Gfe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Zfe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class ow{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Wf(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const VF=["post","put","patch","delete"],Yfe=new Set(VF),Kfe=["get",...VF],Jfe=new Set(Kfe),Xfe=new Set([301,302,303,307,308]),Qfe=new Set([307,308]),db={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},epe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ju={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},x0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tpe=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),HF="remix-router-transitions";function npe(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Pt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let te=t.detectErrorBoundary;i=se=>({hasErrorBoundary:te(se)})}else i=tpe;let s={},o=_g(t.routes,i,void 0,s),a,c=t.basename||"/",l=t.dataStrategy||ope,u=t.patchRoutesOnNavigation,d=_n({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),f=null,p=new Set,m=null,h=null,g=null,y=t.hydrationData!=null,v=Lo(o,t.history.location,c),b=!1,E=null;if(v==null&&!u){let te=Ar(404,{pathname:t.history.location.pathname}),{matches:se,route:fe}=YO(o);v=se,E={[fe.id]:te}}v&&!t.hydrationData&&Fc(v,o,t.history.location.pathname).active&&(v=null);let w;if(v)if(v.some(te=>te.route.lazy))w=!1;else if(!v.some(te=>te.route.loader))w=!0;else if(d.v7_partialHydration){let te=t.hydrationData?t.hydrationData.loaderData:null,se=t.hydrationData?t.hydrationData.errors:null;if(se){let fe=v.findIndex(Ee=>se[Ee.route.id]!==void 0);w=v.slice(0,fe+1).every(Ee=>!cw(Ee.route,te,se))}else w=v.every(fe=>!cw(fe.route,te,se))}else w=t.hydrationData!=null;else if(w=!1,v=[],d.v7_partialHydration){let te=Fc(null,o,t.history.location.pathname);te.active&&te.matches&&(b=!0,v=te.matches)}let S,_={historyAction:t.history.action,location:t.history.location,matches:v,initialized:w,navigation:db,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||E,fetchers:new Map,blockers:new Map},O=bn.Pop,M=!1,F,q=!1,I=new Map,$=null,x=!1,A=!1,P=[],B=new Set,J=new Map,L=0,G=-1,U=new Map,C=new Set,Z=new Map,H=new Map,V=new Set,ce=new Map,le=new Map,ge;function Re(){if(f=t.history.listen(te=>{let{action:se,location:fe,delta:Ee}=te;if(ge){ge(),ge=void 0;return}Sc(le.size===0||Ee!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let $e=Vr({currentLocation:_.location,nextLocation:fe,historyAction:se});if($e&&Ee!=null){let et=new Promise(vt=>{ge=vt});t.history.go(Ee*-1),yo($e,{state:"blocked",location:fe,proceed(){yo($e,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),et.then(()=>t.history.go(Ee))},reset(){let vt=new Map(_.blockers);vt.set($e,Ju),He({blockers:vt})}});return}return ue(se,fe)}),n){_pe(e,I);let te=()=>wpe(e,I);e.addEventListener("pagehide",te),$=()=>e.removeEventListener("pagehide",te)}return _.initialized||ue(bn.Pop,_.location,{initialHydration:!0}),S}function Ge(){f&&f(),$&&$(),p.clear(),F&&F.abort(),_.fetchers.forEach((te,se)=>an(se)),_.blockers.forEach((te,se)=>wa(se))}function st(te){return p.add(te),()=>p.delete(te)}function He(te,se){se===void 0&&(se={}),_=_n({},_,te);let fe=[],Ee=[];d.v7_fetcherPersist&&_.fetchers.forEach(($e,et)=>{$e.state==="idle"&&(V.has(et)?Ee.push(et):fe.push(et))}),V.forEach($e=>{!_.fetchers.has($e)&&!J.has($e)&&Ee.push($e)}),[...p].forEach($e=>$e(_,{deletedFetchers:Ee,viewTransitionOpts:se.viewTransitionOpts,flushSync:se.flushSync===!0})),d.v7_fetcherPersist?(fe.forEach($e=>_.fetchers.delete($e)),Ee.forEach($e=>an($e))):Ee.forEach($e=>V.delete($e))}function gt(te,se,fe){var Ee,$e;let{flushSync:et}=fe===void 0?{}:fe,vt=_.actionData!=null&&_.navigation.formMethod!=null&&Ri(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Ee=te.state)==null?void 0:Ee._isRedirect)!==!0,Ve;se.actionData?Object.keys(se.actionData).length>0?Ve=se.actionData:Ve=null:vt?Ve=_.actionData:Ve=null;let We=se.loaderData?GO(_.loaderData,se.loaderData,se.matches||[],se.errors):_.loaderData,Be=_.blockers;Be.size>0&&(Be=new Map(Be),Be.forEach((Mt,zn)=>Be.set(zn,Ju)));let tt=M===!0||_.navigation.formMethod!=null&&Ri(_.navigation.formMethod)&&(($e=te.state)==null?void 0:$e._isRedirect)!==!0;a&&(o=a,a=void 0),x||O===bn.Pop||(O===bn.Push?t.history.push(te,te.state):O===bn.Replace&&t.history.replace(te,te.state));let Rt;if(O===bn.Pop){let Mt=I.get(_.location.pathname);Mt&&Mt.has(te.pathname)?Rt={currentLocation:_.location,nextLocation:te}:I.has(te.pathname)&&(Rt={currentLocation:te,nextLocation:_.location})}else if(q){let Mt=I.get(_.location.pathname);Mt?Mt.add(te.pathname):(Mt=new Set([te.pathname]),I.set(_.location.pathname,Mt)),Rt={currentLocation:_.location,nextLocation:te}}He(_n({},se,{actionData:Ve,loaderData:We,historyAction:O,location:te,initialized:!0,navigation:db,revalidation:"idle",restoreScrollPosition:kp(te,se.matches||_.matches),preventScrollReset:tt,blockers:Be}),{viewTransitionOpts:Rt,flushSync:et===!0}),O=bn.Pop,M=!1,q=!1,x=!1,A=!1,P=[]}async function D(te,se){if(typeof te=="number"){t.history.go(te);return}let fe=aw(_.location,_.matches,c,d.v7_prependBasename,te,d.v7_relativeSplatPath,se==null?void 0:se.fromRouteId,se==null?void 0:se.relative),{path:Ee,submission:$e,error:et}=jO(d.v7_normalizeFormMethod,!1,fe,se),vt=_.location,Ve=du(_.location,Ee,se&&se.state);Ve=_n({},Ve,t.history.encodeLocation(Ve));let We=se&&se.replace!=null?se.replace:void 0,Be=bn.Push;We===!0?Be=bn.Replace:We===!1||$e!=null&&Ri($e.formMethod)&&$e.formAction===_.location.pathname+_.location.search&&(Be=bn.Replace);let tt=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,Rt=(se&&se.flushSync)===!0,Mt=Vr({currentLocation:vt,nextLocation:Ve,historyAction:Be});if(Mt){yo(Mt,{state:"blocked",location:Ve,proceed(){yo(Mt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ve}),D(te,se)},reset(){let zn=new Map(_.blockers);zn.set(Mt,Ju),He({blockers:zn})}});return}return await ue(Be,Ve,{submission:$e,pendingError:et,preventScrollReset:tt,replace:se&&se.replace,enableViewTransition:se&&se.viewTransition,flushSync:Rt})}function me(){if(nt(),He({revalidation:"loading"}),_.navigation.state!=="submitting"){if(_.navigation.state==="idle"){ue(_.historyAction,_.location,{startUninterruptedRevalidation:!0});return}ue(O||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:q===!0})}}async function ue(te,se,fe){F&&F.abort(),F=null,O=te,x=(fe&&fe.startUninterruptedRevalidation)===!0,By(_.location,_.matches),M=(fe&&fe.preventScrollReset)===!0,q=(fe&&fe.enableViewTransition)===!0;let Ee=a||o,$e=fe&&fe.overrideNavigation,et=fe!=null&&fe.initialHydration&&_.matches&&_.matches.length>0&&!b?_.matches:Lo(Ee,se,c),vt=(fe&&fe.flushSync)===!0,Ve=Fc(et,Ee,se.pathname);if(Ve.active&&Ve.matches&&(et=Ve.matches),!et){let{error:on,notFoundMatches:qt,route:yn}=vo(se.pathname);gt(se,{matches:qt,loaderData:{},errors:{[yn.id]:on}},{flushSync:vt});return}if(_.initialized&&!A&&fpe(_.location,se)&&!(fe&&fe.submission&&Ri(fe.submission.formMethod))){gt(se,{matches:et},{flushSync:vt});return}F=new AbortController;let We=Qc(t.history,se,F.signal,fe&&fe.submission),Be;if(fe&&fe.pendingError)Be=[Na(et).route.id,{type:tn.error,error:fe.pendingError}];else if(fe&&fe.submission&&Ri(fe.submission.formMethod)){let on=await K(We,se,fe.submission,et,Ve.active,{replace:fe.replace,flushSync:vt});if(on.shortCircuited)return;if(on.pendingActionResult){let[qt,yn]=on.pendingActionResult;if(Hr(yn)&&Wf(yn.error)&&yn.error.status===404){F=null,gt(se,{matches:on.matches,loaderData:{},errors:{[qt]:yn.error}});return}}et=on.matches||et,Be=on.pendingActionResult,$e=fb(se,fe.submission),vt=!1,Ve.active=!1,We=Qc(t.history,We.url,We.signal)}let{shortCircuited:tt,matches:Rt,loaderData:Mt,errors:zn}=await R(We,se,et,Ve.active,$e,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,vt,Be);tt||(F=null,gt(se,_n({matches:Rt||et},ZO(Be),{loaderData:Mt,errors:zn})))}async function K(te,se,fe,Ee,$e,et){et===void 0&&(et={}),nt();let vt=vpe(se,fe);if(He({navigation:vt},{flushSync:et.flushSync===!0}),$e){let Be=await $c(Ee,se.pathname,te.signal);if(Be.type==="aborted")return{shortCircuited:!0};if(Be.type==="error"){let tt=Na(Be.partialMatches).route.id;return{matches:Be.partialMatches,pendingActionResult:[tt,{type:tn.error,error:Be.error}]}}else if(Be.matches)Ee=Be.matches;else{let{notFoundMatches:tt,error:Rt,route:Mt}=vo(se.pathname);return{matches:tt,pendingActionResult:[Mt.id,{type:tn.error,error:Rt}]}}}let Ve,We=md(Ee,se);if(!We.route.action&&!We.route.lazy)Ve={type:tn.error,error:Ar(405,{method:te.method,pathname:se.pathname,routeId:We.route.id})};else if(Ve=(await he("action",_,te,[We],Ee,null))[We.route.id],te.signal.aborted)return{shortCircuited:!0};if(Ba(Ve)){let Be;return et&&et.replace!=null?Be=et.replace:Be=HO(Ve.response.headers.get("Location"),new URL(te.url),c)===_.location.pathname+_.location.search,await pe(te,Ve,!0,{submission:fe,replace:Be}),{shortCircuited:!0}}if(Vo(Ve))throw Ar(400,{type:"defer-action"});if(Hr(Ve)){let Be=Na(Ee,We.route.id);return(et&&et.replace)!==!0&&(O=bn.Push),{matches:Ee,pendingActionResult:[Be.route.id,Ve]}}return{matches:Ee,pendingActionResult:[We.route.id,Ve]}}async function R(te,se,fe,Ee,$e,et,vt,Ve,We,Be,tt){let Rt=$e||fb(se,et),Mt=et||vt||JO(Rt),zn=!x&&(!d.v7_partialHydration||!We);if(Ee){if(zn){let vn=N(tt);He(_n({navigation:Rt},vn!==void 0?{actionData:vn}:{}),{flushSync:Be})}let Bt=await $c(fe,se.pathname,te.signal);if(Bt.type==="aborted")return{shortCircuited:!0};if(Bt.type==="error"){let vn=Na(Bt.partialMatches).route.id;return{matches:Bt.partialMatches,loaderData:{},errors:{[vn]:Bt.error}}}else if(Bt.matches)fe=Bt.matches;else{let{error:vn,notFoundMatches:Xi,route:Sa}=vo(se.pathname);return{matches:Xi,loaderData:{},errors:{[Sa.id]:vn}}}}let on=a||o,[qt,yn]=BO(t.history,_,fe,Mt,se,d.v7_partialHydration&&We===!0,d.v7_skipActionErrorRevalidation,A,P,B,V,Z,C,on,c,tt);if(wi(Bt=>!(fe&&fe.some(vn=>vn.route.id===Bt))||qt&&qt.some(vn=>vn.route.id===Bt)),G=++L,qt.length===0&&yn.length===0){let Bt=Rr();return gt(se,_n({matches:fe,loaderData:{},errors:tt&&Hr(tt[1])?{[tt[0]]:tt[1].error}:null},ZO(tt),Bt?{fetchers:new Map(_.fetchers)}:{}),{flushSync:Be}),{shortCircuited:!0}}if(zn){let Bt={};if(!Ee){Bt.navigation=Rt;let vn=N(tt);vn!==void 0&&(Bt.actionData=vn)}yn.length>0&&(Bt.fetchers=z(yn)),He(Bt,{flushSync:Be})}yn.forEach(Bt=>{rt(Bt.key),Bt.controller&&J.set(Bt.key,Bt.controller)});let bo=()=>yn.forEach(Bt=>rt(Bt.key));F&&F.signal.addEventListener("abort",bo);let{loaderResults:Ea,fetcherResults:oi}=await Pe(_,fe,qt,yn,te);if(te.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",bo),yn.forEach(Bt=>J.delete(Bt.key));let cr=Oh(Ea);if(cr)return await pe(te,cr.result,!0,{replace:Ve}),{shortCircuited:!0};if(cr=Oh(oi),cr)return C.add(cr.key),await pe(te,cr.result,!0,{replace:Ve}),{shortCircuited:!0};let{loaderData:jc,errors:ai}=qO(_,fe,Ea,tt,yn,oi,ce);ce.forEach((Bt,vn)=>{Bt.subscribe(Xi=>{(Xi||Bt.done)&&ce.delete(vn)})}),d.v7_partialHydration&&We&&_.errors&&(ai=_n({},_.errors,ai));let Ps=Rr(),Ms=ar(G),_o=Ps||Ms||yn.length>0;return _n({matches:fe,loaderData:jc,errors:ai},_o?{fetchers:new Map(_.fetchers)}:{})}function N(te){if(te&&!Hr(te[1]))return{[te[0]]:te[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function z(te){return te.forEach(se=>{let fe=_.fetchers.get(se.key),Ee=Xu(void 0,fe?fe.data:void 0);_.fetchers.set(se.key,Ee)}),new Map(_.fetchers)}function X(te,se,fe,Ee){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");rt(te);let $e=(Ee&&Ee.flushSync)===!0,et=a||o,vt=aw(_.location,_.matches,c,d.v7_prependBasename,fe,d.v7_relativeSplatPath,se,Ee==null?void 0:Ee.relative),Ve=Lo(et,vt,c),We=Fc(Ve,et,vt);if(We.active&&We.matches&&(Ve=We.matches),!Ve){Xt(te,se,Ar(404,{pathname:vt}),{flushSync:$e});return}let{path:Be,submission:tt,error:Rt}=jO(d.v7_normalizeFormMethod,!0,vt,Ee);if(Rt){Xt(te,se,Rt,{flushSync:$e});return}let Mt=md(Ve,Be),zn=(Ee&&Ee.preventScrollReset)===!0;if(tt&&Ri(tt.formMethod)){Y(te,se,Be,Mt,Ve,We.active,$e,zn,tt);return}Z.set(te,{routeId:se,path:Be}),ee(te,se,Be,Mt,Ve,We.active,$e,zn,tt)}async function Y(te,se,fe,Ee,$e,et,vt,Ve,We){nt(),Z.delete(te);function Be(Tn){if(!Tn.route.action&&!Tn.route.lazy){let j=Ar(405,{method:We.formMethod,pathname:fe,routeId:se});return Xt(te,se,j,{flushSync:vt}),!0}return!1}if(!et&&Be(Ee))return;let tt=_.fetchers.get(te);Ze(te,bpe(We,tt),{flushSync:vt});let Rt=new AbortController,Mt=Qc(t.history,fe,Rt.signal,We);if(et){let Tn=await $c($e,new URL(Mt.url).pathname,Mt.signal);if(Tn.type==="aborted")return;if(Tn.type==="error"){Xt(te,se,Tn.error,{flushSync:vt});return}else if(Tn.matches){if($e=Tn.matches,Ee=md($e,fe),Be(Ee))return}else{Xt(te,se,Ar(404,{pathname:fe}),{flushSync:vt});return}}J.set(te,Rt);let zn=L,qt=(await he("action",_,Mt,[Ee],$e,te))[Ee.route.id];if(Mt.signal.aborted){J.get(te)===Rt&&J.delete(te);return}if(d.v7_fetcherPersist&&V.has(te)){if(Ba(qt)||Hr(qt)){Ze(te,Co(void 0));return}}else{if(Ba(qt))if(J.delete(te),G>zn){Ze(te,Co(void 0));return}else return C.add(te),Ze(te,Xu(We)),pe(Mt,qt,!1,{fetcherSubmission:We,preventScrollReset:Ve});if(Hr(qt)){Xt(te,se,qt.error);return}}if(Vo(qt))throw Ar(400,{type:"defer-action"});let yn=_.navigation.location||_.location,bo=Qc(t.history,yn,Rt.signal),Ea=a||o,oi=_.navigation.state!=="idle"?Lo(Ea,_.navigation.location,c):_.matches;Pt(oi,"Didn't find any matches after fetcher action");let cr=++L;U.set(te,cr);let jc=Xu(We,qt.data);_.fetchers.set(te,jc);let[ai,Ps]=BO(t.history,_,oi,We,yn,!1,d.v7_skipActionErrorRevalidation,A,P,B,V,Z,C,Ea,c,[Ee.route.id,qt]);Ps.filter(Tn=>Tn.key!==te).forEach(Tn=>{let j=Tn.key,Q=_.fetchers.get(j),W=Xu(void 0,Q?Q.data:void 0);_.fetchers.set(j,W),rt(j),Tn.controller&&J.set(j,Tn.controller)}),He({fetchers:new Map(_.fetchers)});let Ms=()=>Ps.forEach(Tn=>rt(Tn.key));Rt.signal.addEventListener("abort",Ms);let{loaderResults:_o,fetcherResults:Bt}=await Pe(_,oi,ai,Ps,bo);if(Rt.signal.aborted)return;Rt.signal.removeEventListener("abort",Ms),U.delete(te),J.delete(te),Ps.forEach(Tn=>J.delete(Tn.key));let vn=Oh(_o);if(vn)return pe(bo,vn.result,!1,{preventScrollReset:Ve});if(vn=Oh(Bt),vn)return C.add(vn.key),pe(bo,vn.result,!1,{preventScrollReset:Ve});let{loaderData:Xi,errors:Sa}=qO(_,oi,_o,void 0,Ps,Bt,ce);if(_.fetchers.has(te)){let Tn=Co(qt.data);_.fetchers.set(te,Tn)}ar(cr),_.navigation.state==="loading"&&cr>G?(Pt(O,"Expected pending action"),F&&F.abort(),gt(_.navigation.location,{matches:oi,loaderData:Xi,errors:Sa,fetchers:new Map(_.fetchers)})):(He({errors:Sa,loaderData:GO(_.loaderData,Xi,oi,Sa),fetchers:new Map(_.fetchers)}),A=!1)}async function ee(te,se,fe,Ee,$e,et,vt,Ve,We){let Be=_.fetchers.get(te);Ze(te,Xu(We,Be?Be.data:void 0),{flushSync:vt});let tt=new AbortController,Rt=Qc(t.history,fe,tt.signal);if(et){let qt=await $c($e,new URL(Rt.url).pathname,Rt.signal);if(qt.type==="aborted")return;if(qt.type==="error"){Xt(te,se,qt.error,{flushSync:vt});return}else if(qt.matches)$e=qt.matches,Ee=md($e,fe);else{Xt(te,se,Ar(404,{pathname:fe}),{flushSync:vt});return}}J.set(te,tt);let Mt=L,on=(await he("loader",_,Rt,[Ee],$e,te))[Ee.route.id];if(Vo(on)&&(on=await T0(on,Rt.signal,!0)||on),J.get(te)===tt&&J.delete(te),!Rt.signal.aborted){if(V.has(te)){Ze(te,Co(void 0));return}if(Ba(on))if(G>Mt){Ze(te,Co(void 0));return}else{C.add(te),await pe(Rt,on,!1,{preventScrollReset:Ve});return}if(Hr(on)){Xt(te,se,on.error);return}Pt(!Vo(on),"Unhandled fetcher deferred data"),Ze(te,Co(on.data))}}async function pe(te,se,fe,Ee){let{submission:$e,fetcherSubmission:et,preventScrollReset:vt,replace:Ve}=Ee===void 0?{}:Ee;se.response.headers.has("X-Remix-Revalidate")&&(A=!0);let We=se.response.headers.get("Location");Pt(We,"Expected a Location header on the redirect Response"),We=HO(We,new URL(te.url),c);let Be=du(_.location,We,{_isRedirect:!0});if(n){let qt=!1;if(se.response.headers.has("X-Remix-Reload-Document"))qt=!0;else if(x0.test(We)){const yn=t.history.createURL(We);qt=yn.origin!==e.location.origin||Rp(yn.pathname,c)==null}if(qt){Ve?e.location.replace(We):e.location.assign(We);return}}F=null;let tt=Ve===!0||se.response.headers.has("X-Remix-Replace")?bn.Replace:bn.Push,{formMethod:Rt,formAction:Mt,formEncType:zn}=_.navigation;!$e&&!et&&Rt&&Mt&&zn&&($e=JO(_.navigation));let on=$e||et;if(Qfe.has(se.response.status)&&on&&Ri(on.formMethod))await ue(tt,Be,{submission:_n({},on,{formAction:We}),preventScrollReset:vt||M,enableViewTransition:fe?q:void 0});else{let qt=fb(Be,$e);await ue(tt,Be,{overrideNavigation:qt,fetcherSubmission:et,preventScrollReset:vt||M,enableViewTransition:fe?q:void 0})}}async function he(te,se,fe,Ee,$e,et){let vt,Ve={};try{vt=await ape(l,te,se,fe,Ee,$e,et,s,i)}catch(We){return Ee.forEach(Be=>{Ve[Be.route.id]={type:tn.error,error:We}}),Ve}for(let[We,Be]of Object.entries(vt))if(ppe(Be)){let tt=Be.result;Ve[We]={type:tn.redirect,response:upe(tt,fe,We,$e,c,d.v7_relativeSplatPath)}}else Ve[We]=await lpe(Be);return Ve}async function Pe(te,se,fe,Ee,$e){let et=te.matches,vt=he("loader",te,$e,fe,se,null),Ve=Promise.all(Ee.map(async tt=>{if(tt.matches&&tt.match&&tt.controller){let Mt=(await he("loader",te,Qc(t.history,tt.path,tt.controller.signal),[tt.match],tt.matches,tt.key))[tt.match.route.id];return{[tt.key]:Mt}}else return Promise.resolve({[tt.key]:{type:tn.error,error:Ar(404,{pathname:tt.path})}})})),We=await vt,Be=(await Ve).reduce((tt,Rt)=>Object.assign(tt,Rt),{});return await Promise.all([gpe(se,We,$e.signal,et,te.loaderData),ype(se,Be,Ee)]),{loaderResults:We,fetcherResults:Be}}function nt(){A=!0,P.push(...wi()),Z.forEach((te,se)=>{J.has(se)&&B.add(se),rt(se)})}function Ze(te,se,fe){fe===void 0&&(fe={}),_.fetchers.set(te,se),He({fetchers:new Map(_.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function Xt(te,se,fe,Ee){Ee===void 0&&(Ee={});let $e=Na(_.matches,se);an(te),He({errors:{[$e.route.id]:fe},fetchers:new Map(_.fetchers)},{flushSync:(Ee&&Ee.flushSync)===!0})}function Gn(te){return H.set(te,(H.get(te)||0)+1),V.has(te)&&V.delete(te),_.fetchers.get(te)||epe}function an(te){let se=_.fetchers.get(te);J.has(te)&&!(se&&se.state==="loading"&&U.has(te))&&rt(te),Z.delete(te),U.delete(te),C.delete(te),d.v7_fetcherPersist&&V.delete(te),B.delete(te),_.fetchers.delete(te)}function pr(te){let se=(H.get(te)||0)-1;se<=0?(H.delete(te),V.add(te),d.v7_fetcherPersist||an(te)):H.set(te,se),He({fetchers:new Map(_.fetchers)})}function rt(te){let se=J.get(te);se&&(se.abort(),J.delete(te))}function xn(te){for(let se of te){let fe=Gn(se),Ee=Co(fe.data);_.fetchers.set(se,Ee)}}function Rr(){let te=[],se=!1;for(let fe of C){let Ee=_.fetchers.get(fe);Pt(Ee,"Expected fetcher: "+fe),Ee.state==="loading"&&(C.delete(fe),te.push(fe),se=!0)}return xn(te),se}function ar(te){let se=[];for(let[fe,Ee]of U)if(Ee<te){let $e=_.fetchers.get(fe);Pt($e,"Expected fetcher: "+fe),$e.state==="loading"&&(rt(fe),U.delete(fe),se.push(fe))}return xn(se),se.length>0}function go(te,se){let fe=_.blockers.get(te)||Ju;return le.get(te)!==se&&le.set(te,se),fe}function wa(te){_.blockers.delete(te),le.delete(te)}function yo(te,se){let fe=_.blockers.get(te)||Ju;Pt(fe.state==="unblocked"&&se.state==="blocked"||fe.state==="blocked"&&se.state==="blocked"||fe.state==="blocked"&&se.state==="proceeding"||fe.state==="blocked"&&se.state==="unblocked"||fe.state==="proceeding"&&se.state==="unblocked","Invalid blocker state transition: "+fe.state+" -> "+se.state);let Ee=new Map(_.blockers);Ee.set(te,se),He({blockers:Ee})}function Vr(te){let{currentLocation:se,nextLocation:fe,historyAction:Ee}=te;if(le.size===0)return;le.size>1&&Sc(!1,"A router only supports one blocker at a time");let $e=Array.from(le.entries()),[et,vt]=$e[$e.length-1],Ve=_.blockers.get(et);if(!(Ve&&Ve.state==="proceeding")&&vt({currentLocation:se,nextLocation:fe,historyAction:Ee}))return et}function vo(te){let se=Ar(404,{pathname:te}),fe=a||o,{matches:Ee,route:$e}=YO(fe);return wi(),{notFoundMatches:Ee,route:$e,error:se}}function wi(te){let se=[];return ce.forEach((fe,Ee)=>{(!te||te(Ee))&&(fe.cancel(),se.push(Ee),ce.delete(Ee))}),se}function Ns(te,se,fe){if(m=te,g=se,h=fe||null,!y&&_.navigation===db){y=!0;let Ee=kp(_.location,_.matches);Ee!=null&&He({restoreScrollPosition:Ee})}return()=>{m=null,g=null,h=null}}function Dp(te,se){return h&&h(te,se.map(Ee=>kfe(Ee,_.loaderData)))||te.key}function By(te,se){if(m&&g){let fe=Dp(te,se);m[fe]=g()}}function kp(te,se){if(m){let fe=Dp(te,se),Ee=m[fe];if(typeof Ee=="number")return Ee}return null}function Fc(te,se,fe){if(u)if(te){if(Object.keys(te[0].params).length>0)return{active:!0,matches:nm(se,fe,c,!0)}}else return{active:!0,matches:nm(se,fe,c,!0)||[]};return{active:!1,matches:null}}async function $c(te,se,fe){if(!u)return{type:"success",matches:te};let Ee=te;for(;;){let $e=a==null,et=a||o,vt=s;try{await u({signal:fe,path:se,matches:Ee,patch:(Be,tt)=>{fe.aborted||VO(Be,tt,et,vt,i)}})}catch(Be){return{type:"error",error:Be,partialMatches:Ee}}finally{$e&&!fe.aborted&&(o=[...o])}if(fe.aborted)return{type:"aborted"};let Ve=Lo(et,se,c);if(Ve)return{type:"success",matches:Ve};let We=nm(et,se,c,!0);if(!We||Ee.length===We.length&&Ee.every((Be,tt)=>Be.route.id===We[tt].route.id))return{type:"success",matches:null};Ee=We}}function zy(te){s={},a=_g(te,i,void 0,s)}function Vy(te,se){let fe=a==null;VO(te,se,a||o,s,i),fe&&(o=[...o],He({}))}return S={get basename(){return c},get future(){return d},get state(){return _},get routes(){return o},get window(){return e},initialize:Re,subscribe:st,enableScrollRestoration:Ns,navigate:D,fetch:X,revalidate:me,createHref:te=>t.history.createHref(te),encodeLocation:te=>t.history.encodeLocation(te),getFetcher:Gn,deleteFetcher:pr,dispose:Ge,getBlocker:go,deleteBlocker:wa,patchRoutes:Vy,_internalFetchControllers:J,_internalActiveDeferreds:ce,_internalSetRoutes:zy},S}function rpe(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function aw(t,e,n,r,i,s,o,a){let c,l;if(o){c=[];for(let d of e)if(c.push(d),d.route.id===o){l=d;break}}else c=e,l=e[e.length-1];let u=zF(i||".",BF(c,s),Rp(t.pathname,n)||t.pathname,a==="path");if(i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&l){let d=I0(u.search);if(l.route.index&&!d)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&d){let f=new URLSearchParams(u.search),p=f.getAll("index");f.delete("index"),p.filter(h=>h).forEach(h=>f.append("index",h));let m=f.toString();u.search=m?"?"+m:""}}return r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Go([n,u.pathname])),Au(u)}function jO(t,e,n,r){if(!r||!rpe(r))return{path:n};if(r.formMethod&&!mpe(r.formMethod))return{path:n,error:Ar(405,{method:r.formMethod})};let i=()=>({path:n,error:Ar(400,{type:"invalid-body"})}),s=r.formMethod||"get",o=t?s.toUpperCase():s.toLowerCase(),a=GF(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ri(o))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,m)=>{let[h,g]=m;return""+p+h+"="+g+`
572
+ `},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Ri(o))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}Pt(typeof FormData=="function","FormData is not available in this environment");let c,l;if(r.formData)c=lw(r.formData),l=r.formData;else if(r.body instanceof FormData)c=lw(r.body),l=r.body;else if(r.body instanceof URLSearchParams)c=r.body,l=WO(c);else if(r.body==null)c=new URLSearchParams,l=new FormData;else try{c=new URLSearchParams(r.body),l=WO(c)}catch{return i()}let u={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(Ri(u.formMethod))return{path:n,submission:u};let d=mo(n);return e&&d.search&&I0(d.search)&&c.append("index",""),d.search="?"+c,{path:Au(d),submission:u}}function UO(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(i=>i.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function BO(t,e,n,r,i,s,o,a,c,l,u,d,f,p,m,h){let g=h?Hr(h[1])?h[1].error:h[1].data:void 0,y=t.createURL(e.location),v=t.createURL(i),b=n;s&&e.errors?b=UO(n,Object.keys(e.errors)[0],!0):h&&Hr(h[1])&&(b=UO(n,h[0]));let E=h?h[1].statusCode:void 0,w=o&&E&&E>=400,S=b.filter((O,M)=>{let{route:F}=O;if(F.lazy)return!0;if(F.loader==null)return!1;if(s)return cw(F,e.loaderData,e.errors);if(ipe(e.loaderData,e.matches[M],O)||c.some($=>$===O.route.id))return!0;let q=e.matches[M],I=O;return zO(O,_n({currentUrl:y,currentParams:q.params,nextUrl:v,nextParams:I.params},r,{actionResult:g,actionStatus:E,defaultShouldRevalidate:w?!1:a||y.pathname+y.search===v.pathname+v.search||y.search!==v.search||WF(q,I)}))}),_=[];return d.forEach((O,M)=>{if(s||!n.some(x=>x.route.id===O.routeId)||u.has(M))return;let F=Lo(p,O.path,m);if(!F){_.push({key:M,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let q=e.fetchers.get(M),I=md(F,O.path),$=!1;f.has(M)?$=!1:l.has(M)?(l.delete(M),$=!0):q&&q.state!=="idle"&&q.data===void 0?$=a:$=zO(I,_n({currentUrl:y,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:g,actionStatus:E,defaultShouldRevalidate:w?!1:a})),$&&_.push({key:M,routeId:O.routeId,path:O.path,matches:F,match:I,controller:new AbortController})}),[S,_]}function cw(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,i=n!=null&&n[t.id]!==void 0;return!r&&i?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!i}function ipe(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function WF(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function zO(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function VO(t,e,n,r,i){var s;let o;if(t){let l=r[t];Pt(l,"No route found to patch children into: routeId = "+t),l.children||(l.children=[]),o=l.children}else o=n;let a=e.filter(l=>!o.some(u=>qF(l,u))),c=_g(a,i,[t||"_","patch",String(((s=o)==null?void 0:s.length)||"0")],r);o.push(...c)}function qF(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var i;return(i=e.children)==null?void 0:i.some(s=>qF(n,s))}):!1}async function spe(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Pt(i,"No route found in manifest");let s={};for(let o in r){let c=i[o]!==void 0&&o!=="hasErrorBoundary";Sc(!c,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!c&&!Rfe.has(o)&&(s[o]=r[o])}Object.assign(i,s),Object.assign(i,_n({},e(i),{lazy:void 0}))}async function ope(t){let{matches:e}=t,n=e.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,o)=>Object.assign(i,{[n[o].route.id]:s}),{})}async function ape(t,e,n,r,i,s,o,a,c,l){let u=s.map(p=>p.route.lazy?spe(p.route,c,a):void 0),d=s.map((p,m)=>{let h=u[m],g=i.some(v=>v.route.id===p.route.id);return _n({},p,{shouldLoad:g,resolve:async v=>(v&&r.method==="GET"&&(p.route.lazy||p.route.loader)&&(g=!0),g?cpe(e,r,p,h,v,l):Promise.resolve({type:tn.data,result:void 0}))})}),f=await t({matches:d,request:r,params:s[0].params,fetcherKey:o,context:l});try{await Promise.all(u)}catch{}return f}async function cpe(t,e,n,r,i,s){let o,a,c=l=>{let u,d=new Promise((m,h)=>u=h);a=()=>u(),e.signal.addEventListener("abort",a);let f=m=>typeof l!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):l({request:e,params:n.params,context:s},...m!==void 0?[m]:[]),p=(async()=>{try{return{type:"data",result:await(i?i(h=>f(h)):f())}}catch(m){return{type:"error",result:m}}})();return Promise.race([p,d])};try{let l=n.route[t];if(r)if(l){let u,[d]=await Promise.all([c(l).catch(f=>{u=f}),r]);if(u!==void 0)throw u;o=d}else if(await r,l=n.route[t],l)o=await c(l);else if(t==="action"){let u=new URL(e.url),d=u.pathname+u.search;throw Ar(405,{method:e.method,pathname:d,routeId:n.route.id})}else return{type:tn.data,result:void 0};else if(l)o=await c(l);else{let u=new URL(e.url),d=u.pathname+u.search;throw Ar(404,{pathname:d})}Pt(o.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(l){return{type:tn.error,result:l}}finally{a&&e.signal.removeEventListener("abort",a)}return o}async function lpe(t){let{result:e,type:n}=t;if(ZF(e)){let d;try{let f=e.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?e.body==null?d=null:d=await e.json():d=await e.text()}catch(f){return{type:tn.error,error:f}}return n===tn.error?{type:tn.error,error:new ow(e.status,e.statusText,d),statusCode:e.status,headers:e.headers}:{type:tn.data,data:d,statusCode:e.status,headers:e.headers}}if(n===tn.error){if(KO(e)){var r,i;if(e.data instanceof Error){var s,o;return{type:tn.error,error:e.data,statusCode:(s=e.init)==null?void 0:s.status,headers:(o=e.init)!=null&&o.headers?new Headers(e.init.headers):void 0}}return{type:tn.error,error:new ow(((r=e.init)==null?void 0:r.status)||500,void 0,e.data),statusCode:Wf(e)?e.status:void 0,headers:(i=e.init)!=null&&i.headers?new Headers(e.init.headers):void 0}}return{type:tn.error,error:e,statusCode:Wf(e)?e.status:void 0}}if(hpe(e)){var a,c;return{type:tn.deferred,deferredData:e,statusCode:(a=e.init)==null?void 0:a.status,headers:((c=e.init)==null?void 0:c.headers)&&new Headers(e.init.headers)}}if(KO(e)){var l,u;return{type:tn.data,data:e.data,statusCode:(l=e.init)==null?void 0:l.status,headers:(u=e.init)!=null&&u.headers?new Headers(e.init.headers):void 0}}return{type:tn.data,data:e}}function upe(t,e,n,r,i,s){let o=t.headers.get("Location");if(Pt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!x0.test(o)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=aw(new URL(e.url),a,i,!0,o,s),t.headers.set("Location",o)}return t}function HO(t,e,n){if(x0.test(t)){let r=t,i=r.startsWith("//")?new URL(e.protocol+r):new URL(r),s=Rp(i.pathname,n)!=null;if(i.origin===e.origin&&s)return i.pathname+i.search+i.hash}return t}function Qc(t,e,n,r){let i=t.createURL(GF(e)).toString(),s={signal:n};if(r&&Ri(r.formMethod)){let{formMethod:o,formEncType:a}=r;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(r.json)):a==="text/plain"?s.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?s.body=lw(r.formData):s.body=r.formData}return new Request(i,s)}function lw(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function WO(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function dpe(t,e,n,r,i){let s={},o=null,a,c=!1,l={},u=n&&Hr(n[1])?n[1].error:void 0;return t.forEach(d=>{if(!(d.route.id in e))return;let f=d.route.id,p=e[f];if(Pt(!Ba(p),"Cannot handle redirect results in processLoaderData"),Hr(p)){let m=p.error;u!==void 0&&(m=u,u=void 0),o=o||{};{let h=Na(t,f);o[h.route.id]==null&&(o[h.route.id]=m)}s[f]=void 0,c||(c=!0,a=Wf(p.error)?p.error.status:500),p.headers&&(l[f]=p.headers)}else Vo(p)?(r.set(f,p.deferredData),s[f]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!c&&(a=p.statusCode),p.headers&&(l[f]=p.headers)):(s[f]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(a=p.statusCode),p.headers&&(l[f]=p.headers))}),u!==void 0&&n&&(o={[n[0]]:u},s[n[0]]=void 0),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:l}}function qO(t,e,n,r,i,s,o){let{loaderData:a,errors:c}=dpe(e,n,r,o);return i.forEach(l=>{let{key:u,match:d,controller:f}=l,p=s[u];if(Pt(p,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Hr(p)){let m=Na(t.matches,d==null?void 0:d.route.id);c&&c[m.route.id]||(c=_n({},c,{[m.route.id]:p.error})),t.fetchers.delete(u)}else if(Ba(p))Pt(!1,"Unhandled fetcher revalidation redirect");else if(Vo(p))Pt(!1,"Unhandled fetcher deferred data");else{let m=Co(p.data);t.fetchers.set(u,m)}}),{loaderData:a,errors:c}}function GO(t,e,n,r){let i=_n({},e);for(let s of n){let o=s.route.id;if(e.hasOwnProperty(o)?e[o]!==void 0&&(i[o]=e[o]):t[o]!==void 0&&s.route.loader&&(i[o]=t[o]),r&&r.hasOwnProperty(o))break}return i}function ZO(t){return t?Hr(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Na(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function YO(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ar(t,e){let{pathname:n,routeId:r,method:i,type:s,message:o}=e===void 0?{}:e,a="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(a="Bad Request",i&&n&&r?c="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?c="defer() is not supported in actions":s==="invalid-body"&&(c="Unable to encode submission body")):t===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(a="Not Found",c='No route matches URL "'+n+'"'):t===405&&(a="Method Not Allowed",i&&n&&r?c="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(c='Invalid request method "'+i.toUpperCase()+'"')),new ow(t||500,a,new Error(c),!0)}function Oh(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,i]=e[n];if(Ba(i))return{key:r,result:i}}}function GF(t){let e=typeof t=="string"?mo(t):t;return Au(_n({},e,{hash:""}))}function fpe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function ppe(t){return ZF(t.result)&&Xfe.has(t.result.status)}function Vo(t){return t.type===tn.deferred}function Hr(t){return t.type===tn.error}function Ba(t){return(t&&t.type)===tn.redirect}function KO(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function hpe(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function ZF(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function mpe(t){return Jfe.has(t.toLowerCase())}function Ri(t){return Yfe.has(t.toLowerCase())}async function gpe(t,e,n,r,i){let s=Object.entries(e);for(let o=0;o<s.length;o++){let[a,c]=s[o],l=t.find(f=>(f==null?void 0:f.route.id)===a);if(!l)continue;let u=r.find(f=>f.route.id===l.route.id),d=u!=null&&!WF(u,l)&&(i&&i[l.route.id])!==void 0;Vo(c)&&d&&await T0(c,n,!1).then(f=>{f&&(e[a]=f)})}}async function ype(t,e,n){for(let r=0;r<n.length;r++){let{key:i,routeId:s,controller:o}=n[r],a=e[i];t.find(l=>(l==null?void 0:l.route.id)===s)&&Vo(a)&&(Pt(o,"Expected an AbortController for revalidating fetcher deferred result"),await T0(a,o.signal,!0).then(l=>{l&&(e[i]=l)}))}}async function T0(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:tn.data,data:t.deferredData.unwrappedData}}catch(i){return{type:tn.error,error:i}}return{type:tn.data,data:t.deferredData.data}}}function I0(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function md(t,e){let n=typeof e=="string"?mo(e).search:e.search;if(t[t.length-1].route.index&&I0(n||""))return t[t.length-1];let r=UF(t);return r[r.length-1]}function JO(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:s,json:o}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function fb(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function vpe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Xu(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bpe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Co(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function _pe(t,e){try{let n=t.sessionStorage.getItem(HF);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&e.set(i,new Set(s||[]))}}catch{}}function wpe(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(HF,JSON.stringify(n))}catch(r){Sc(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
573
+ * React Router v6.29.0
574
+ *
575
+ * Copyright (c) Remix Software Inc.
576
+ *
577
+ * This source code is licensed under the MIT license found in the
578
+ * LICENSE.md file in the root directory of this source tree.
579
+ *
580
+ * @license MIT
581
+ */function qf(){return qf=Object.assign?Object.assign.bind():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},qf.apply(this,arguments)}const O0=k.createContext(null),Epe=k.createContext(null),$y=k.createContext(null),jy=k.createContext(null),_a=k.createContext({outlet:null,matches:[],isDataRoute:!1}),YF=k.createContext(null);function Uy(){return k.useContext(jy)!=null}function C0(){return Uy()||Pt(!1),k.useContext(jy).location}function Spe(){return k.useContext(jy).navigationType}function KF(t){k.useContext($y).static||k.useLayoutEffect(t)}function hme(){let{isDataRoute:t}=k.useContext(_a);return t?Lpe():xpe()}function xpe(){Uy()||Pt(!1);let t=k.useContext(O0),{basename:e,future:n,navigator:r}=k.useContext($y),{matches:i}=k.useContext(_a),{pathname:s}=C0(),o=JSON.stringify(BF(i,n.v7_relativeSplatPath)),a=k.useRef(!1);return KF(()=>{a.current=!0}),k.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=zF(l,JSON.parse(o),s,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Go([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,o,s,t])}const Tpe=k.createContext(null);function Ipe(t){let e=k.useContext(_a).outlet;return e&&k.createElement(Tpe.Provider,{value:t},e)}function mme(){let{matches:t}=k.useContext(_a),e=t[t.length-1];return e?e.params:{}}function gme(t,e,n,r){Uy()||Pt(!1);let{navigator:i,static:s}=k.useContext($y),{matches:o}=k.useContext(_a),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=C0(),d;d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=!s&&n&&n.matches&&n.matches.length>0?n.matches:Lo(t,{pathname:p});return kpe(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},c,g.params),pathname:Go([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:Go([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r)}function Ope(){let t=Mpe(),e=Wf(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},e),n?k.createElement("pre",{style:i},n):null,null)}const Cpe=k.createElement(Ope,null);class Rpe extends k.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?k.createElement(_a.Provider,{value:this.props.routeContext},k.createElement(YF.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Dpe(t){let{routeContext:e,match:n,children:r}=t,i=k.useContext(O0);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(_a.Provider,{value:e},r)}function kpe(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||Pt(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:p}=n,m=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||m){c=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let p,m=!1,h=null,g=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,h=d.route.errorElement||Cpe,c&&(l<0&&f===0?(m=!0,g=null):l===f&&(m=!0,g=d.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,f+1)),v=()=>{let b;return p?b=h:m?b=g:d.route.Component?b=k.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,k.createElement(Dpe,{match:d,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?k.createElement(Rpe,{location:n.location,revalidation:n.revalidation,component:h,error:p,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var JF=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(JF||{}),wg=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(wg||{});function Ape(t){let e=k.useContext(O0);return e||Pt(!1),e}function Npe(t){let e=k.useContext(Epe);return e||Pt(!1),e}function Ppe(t){let e=k.useContext(_a);return e||Pt(!1),e}function XF(t){let e=Ppe(),n=e.matches[e.matches.length-1];return n.route.id||Pt(!1),n.route.id}function Mpe(){var t;let e=k.useContext(YF),n=Npe(wg.UseRouteError),r=XF(wg.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Lpe(){let{router:t}=Ape(JF.UseNavigateStable),e=XF(wg.UseNavigateStable),n=k.useRef(!1);return KF(()=>{n.current=!0}),k.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,qf({fromRouteId:e},s)))},[t,e])}function yme(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function vme(t){return Ipe(t.context)}function Fpe(t){Pt(!1)}function bme(t){let{basename:e="/",children:n=null,location:r,navigationType:i=bn.Pop,navigator:s,static:o=!1,future:a}=t;Uy()&&Pt(!1);let c=e.replace(/^\/*/,"/"),l=k.useMemo(()=>({basename:c,navigator:s,static:o,future:qf({v7_relativeSplatPath:!1},a)}),[c,a,s,o]);typeof r=="string"&&(r=mo(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:m="default"}=r,h=k.useMemo(()=>{let g=Rp(u,c);return g==null?null:{location:{pathname:g,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:k.createElement($y.Provider,{value:l},k.createElement(jy.Provider,{children:n,value:h}))}new Promise(()=>{});function uw(t,e){e===void 0&&(e=[]);let n=[];return k.Children.forEach(t,(r,i)=>{if(!k.isValidElement(r))return;let s=[...e,i];if(r.type===k.Fragment){n.push.apply(n,uw(r.props.children,s));return}r.type!==Fpe&&Pt(!1),!r.props.index||!r.props.children||Pt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=uw(r.props.children,s)),n.push(o)}),n}function $pe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:k.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:k.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:k.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function _me(t,e){return npe({basename:e==null?void 0:e.basename,future:qf({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:Ife({initialEntries:e==null?void 0:e.initialEntries,initialIndex:e==null?void 0:e.initialIndex}),hydrationData:e==null?void 0:e.hydrationData,routes:t,mapRouteProperties:$pe,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation}).initialize()}function jpe(){const[t]=KE(),{analytics:e}=t;jt(()=>{const n=Ut();if(!e){n&&n.close();return}if(n||!Ai.sentry.dsn||Ai.sentry.dsn==="")return;const r=window.__VITE_ENVS.SENTRY_RELEASE,i=[I2(),S2({depth:5}),Ice(),w2({levels:["error"]})];Ai.sentry.tracing&&i.push(qce({useEffect:Ae.useEffect,useLocation:C0,useNavigationType:Spe,createRoutesFromChildren:uw,matchRoutes:Lo})),Wce({release:r,dsn:Ai.sentry.dsn,environment:Ai.sentry.env,integrations:i,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(s,o){const a=o.originalException;return a instanceof TypeError&&a.message.includes("Failed to fetch")&&!navigator.onLine?null:s}})},[e])}const Upe=({children:t})=>(jpe(),t);function XO(...t){var e;(e=window.dataLayer)==null||e.push(...t)}const Bpe=()=>{const[{gaTrackingId:t}]=NF(),[{analytics:e}]=KE(),n=t&&e;return jt(()=>{if(n){const r=document.createElement("script");return r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[],XO("js",new Date),XO("config",t),()=>{document.head.removeChild(r)}}},[n,t]),null},zpe=Ae.lazy(async()=>({default:await(await Te(()=>import("./router-WBIxvb9L.js").then(n=>n.r),__vite__mapDeps([7,1,2,3]))).default()})),Vpe=()=>{for(const t of Object.values(Due))Dc(t);return null},Hpe=()=>T(Ae.StrictMode,{children:T(cC,{fallback:T(Zo,{}),children:_e(AZ,{store:g0,children:[T(Vpe,{}),T(xZ,{children:T(Upe,{children:T(jde,{children:_e(_Z,{children:[T(vZ,{position:"bottom-right"}),_e(Sfe,{children:[T(zpe,{}),T(Tfe,{}),T(Bpe,{})]})]})})})})]})})}),wme=Object.freeze(Object.defineProperty({__proto__:null,default:Hpe},Symbol.toStringTag,{value:"Module"}));export{O9 as $,mhe as A,Xn as B,D6 as C,O0 as D,ow as E,Nx as F,hv as G,K6 as H,g9 as I,Ga as J,Vd as K,u9 as L,$6 as M,FD as N,h9 as O,HD as P,phe as Q,bme as R,Xg as S,ghe as T,vhe as U,dhe as V,qp as W,x9 as X,_9 as Y,vu as Z,AT as _,hme as a,n1 as a$,yde as a0,Bn as a1,lhe as a2,O6 as a3,L6 as a4,x6 as a5,uhe as a6,Oc as a7,che as a8,bhe as a9,Ude as aA,rde as aB,NF as aC,k8 as aD,ih as aE,She as aF,A8 as aG,fme as aH,yi as aI,S0 as aJ,wde as aK,Rue as aL,vme as aM,ehe as aN,Oj as aO,ihe as aP,ZD as aQ,K9 as aR,Qg as aS,v8 as aT,d8 as aU,_he as aV,qx as aW,Ti as aX,ey as aY,l8 as aZ,u8 as a_,MD as aa,zl as ab,VD as ac,m9 as ad,St as ae,rhe as af,sr as ag,qr as ah,she as ai,ze as aj,DD as ak,nhe as al,the as am,kw as an,Aw as ao,zg as ap,Vg as aq,yR as ar,bR as as,vR as at,_R as au,Jf as av,ha as aw,Cp as ax,sfe as ay,AF as az,Epe as b,E8 as b0,p8 as b1,br as b2,whe as b3,k$ as b4,The as b5,Ehe as b6,xhe as b7,gd as b8,fi as b9,Vde as bA,hde as bB,qE as bC,Cue as bD,pde as bE,XZ as bF,mC as bG,rfe as bH,mme as bI,wZ as bJ,vue as bK,dme as bL,Xw as bM,yd as bN,ve as bO,GE as bP,ii as bQ,bue as bR,wme as bS,iG as ba,sG as bb,oG as bc,aG as bd,cG as be,Qpe as bf,Q8 as bg,Pr as bh,Gt as bi,_6 as bj,w6 as bk,E6 as bl,S6 as bm,YE as bn,rn as bo,qA as bp,Dhe as bq,y0 as br,lfe as bs,Dc as bt,kF as bu,sde as bv,b0 as bw,OF as bx,ume as by,_0 as bz,gme as c,npe as d,pme as e,_me as f,Xpe as g,pa as h,zD as i,Yw as j,c9 as k,yme as l,$pe as m,N6 as n,fhe as o,LD as p,PD as q,ym as r,d9 as s,M6 as t,C0 as u,hhe as v,Mx as w,$D as x,U6 as y,J6 as z};
582
+ //# sourceMappingURL=app-D5JkX4Uj.js.map