@atproto/oauth-provider-ui 0.4.1 → 0.4.3
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.
- package/LICENSE.txt +1 -1
- package/dist/admonition-BGv4N7na.js +59 -0
- package/dist/admonition-BGv4N7na.js.map +1 -0
- package/dist/authorization-page-B4QH37VO.js +20 -0
- package/dist/authorization-page-B4QH37VO.js.map +1 -0
- package/dist/bundle-manifest.json +234 -189
- package/dist/cookie-error-page-CiwQMoZB.js +2 -0
- package/dist/cookie-error-page-CiwQMoZB.js.map +1 -0
- package/dist/error-page-CcpKftK-.js +2 -0
- package/dist/{error-page-BSIrbq_G.js.map → error-page-CcpKftK-.js.map} +1 -1
- package/dist/error-view-zWcVh4wA.js +2 -0
- package/dist/error-view-zWcVh4wA.js.map +1 -0
- package/dist/form-card-DJyQYXqE.js +2 -0
- package/dist/form-card-DJyQYXqE.js.map +1 -0
- package/dist/messages-2XdI_AQm.js +2 -0
- package/dist/messages-2XdI_AQm.js.map +1 -0
- package/dist/messages-9U7tUi4x.js +2 -0
- package/dist/messages-9U7tUi4x.js.map +1 -0
- package/dist/messages-B7IsIn9T.js +2 -0
- package/dist/messages-B7IsIn9T.js.map +1 -0
- package/dist/messages-B8DETVR-.js +2 -0
- package/dist/messages-B8DETVR-.js.map +1 -0
- package/dist/messages-BAMcq6af.js +2 -0
- package/dist/messages-BAMcq6af.js.map +1 -0
- package/dist/messages-BKyO1npx.js +2 -0
- package/dist/messages-BKyO1npx.js.map +1 -0
- package/dist/messages-BOyLrym-.js +2 -0
- package/dist/messages-BOyLrym-.js.map +1 -0
- package/dist/messages-BWkeH_1D.js +2 -0
- package/dist/messages-BWkeH_1D.js.map +1 -0
- package/dist/messages-BbmQU72s.js +2 -0
- package/dist/messages-BbmQU72s.js.map +1 -0
- package/dist/messages-BerE3mk1.js +2 -0
- package/dist/messages-BerE3mk1.js.map +1 -0
- package/dist/messages-BkV1inHY.js +2 -0
- package/dist/messages-BkV1inHY.js.map +1 -0
- package/dist/messages-BsvJVX-v.js +2 -0
- package/dist/messages-BsvJVX-v.js.map +1 -0
- package/dist/messages-C0MumCsH.js +2 -0
- package/dist/messages-C0MumCsH.js.map +1 -0
- package/dist/messages-C5EZ4xwD.js +2 -0
- package/dist/messages-C5EZ4xwD.js.map +1 -0
- package/dist/messages-C7AE3hAl.js +2 -0
- package/dist/messages-C7AE3hAl.js.map +1 -0
- package/dist/messages-CEusitnW.js +2 -0
- package/dist/messages-CEusitnW.js.map +1 -0
- package/dist/messages-Ci8OHfe7.js +2 -0
- package/dist/messages-Ci8OHfe7.js.map +1 -0
- package/dist/messages-Ck6MZktA.js +2 -0
- package/dist/messages-Ck6MZktA.js.map +1 -0
- package/dist/messages-CpH-4dT7.js +2 -0
- package/dist/messages-CpH-4dT7.js.map +1 -0
- package/dist/messages-CqBsTRuX.js +2 -0
- package/dist/messages-CqBsTRuX.js.map +1 -0
- package/dist/messages-DBBpCczd.js +2 -0
- package/dist/messages-DBBpCczd.js.map +1 -0
- package/dist/messages-DL_Ev0ra.js +2 -0
- package/dist/messages-DL_Ev0ra.js.map +1 -0
- package/dist/messages-DLt8s_S-.js +2 -0
- package/dist/messages-DLt8s_S-.js.map +1 -0
- package/dist/messages-DMxRMxKN.js +2 -0
- package/dist/messages-DMxRMxKN.js.map +1 -0
- package/dist/messages-DRbpC2Zv.js +2 -0
- package/dist/messages-DRbpC2Zv.js.map +1 -0
- package/dist/messages-DZUdpac2.js +2 -0
- package/dist/messages-DZUdpac2.js.map +1 -0
- package/dist/messages-DZXEFjxq.js +2 -0
- package/dist/messages-DZXEFjxq.js.map +1 -0
- package/dist/messages-EOBHGTgV.js +2 -0
- package/dist/messages-EOBHGTgV.js.map +1 -0
- package/dist/messages-FrGxJXIm.js +2 -0
- package/dist/messages-FrGxJXIm.js.map +1 -0
- package/dist/messages-McTTmsqQ.js +2 -0
- package/dist/messages-McTTmsqQ.js.map +1 -0
- package/dist/messages-Moc1-Omz.js +2 -0
- package/dist/messages-Moc1-Omz.js.map +1 -0
- package/dist/messages-UO4iw-tn.js +2 -0
- package/dist/messages-UO4iw-tn.js.map +1 -0
- package/dist/messages-_p29KQwo.js +2 -0
- package/dist/messages-_p29KQwo.js.map +1 -0
- package/dist/messages-dBOA6Wji.js +2 -0
- package/dist/messages-dBOA6Wji.js.map +1 -0
- package/dist/messages-tEg5lx9l.js +2 -0
- package/dist/messages-tEg5lx9l.js.map +1 -0
- package/hydration-data.d.ts +10 -3
- package/package.json +6 -7
- package/dist/authorization-page-rtYWhk8x.js +0 -20
- package/dist/authorization-page-rtYWhk8x.js.map +0 -1
- package/dist/error-page-BSIrbq_G.js +0 -2
- package/dist/error-view-BrIEEpo5.js +0 -59
- package/dist/error-view-BrIEEpo5.js.map +0 -1
- package/dist/messages-1IrU-_Vi.js +0 -2
- package/dist/messages-1IrU-_Vi.js.map +0 -1
- package/dist/messages-4v1Nam8h.js +0 -2
- package/dist/messages-4v1Nam8h.js.map +0 -1
- package/dist/messages-B75WrZJr.js +0 -2
- package/dist/messages-B75WrZJr.js.map +0 -1
- package/dist/messages-B8A3W5Ul.js +0 -2
- package/dist/messages-B8A3W5Ul.js.map +0 -1
- package/dist/messages-BA3akJZw.js +0 -2
- package/dist/messages-BA3akJZw.js.map +0 -1
- package/dist/messages-BP45_OWC.js +0 -2
- package/dist/messages-BP45_OWC.js.map +0 -1
- package/dist/messages-Bv09cv32.js +0 -2
- package/dist/messages-Bv09cv32.js.map +0 -1
- package/dist/messages-BvEGsymN.js +0 -2
- package/dist/messages-BvEGsymN.js.map +0 -1
- package/dist/messages-Bzgnq5Tk.js +0 -2
- package/dist/messages-Bzgnq5Tk.js.map +0 -1
- package/dist/messages-C0z-SNig.js +0 -2
- package/dist/messages-C0z-SNig.js.map +0 -1
- package/dist/messages-C5LyUDEz.js +0 -2
- package/dist/messages-C5LyUDEz.js.map +0 -1
- package/dist/messages-C7tVmlQS.js +0 -2
- package/dist/messages-C7tVmlQS.js.map +0 -1
- package/dist/messages-CS8z4ihZ.js +0 -2
- package/dist/messages-CS8z4ihZ.js.map +0 -1
- package/dist/messages-CcR-3cp2.js +0 -2
- package/dist/messages-CcR-3cp2.js.map +0 -1
- package/dist/messages-CoHfWL1D.js +0 -2
- package/dist/messages-CoHfWL1D.js.map +0 -1
- package/dist/messages-Cro0v3rI.js +0 -2
- package/dist/messages-Cro0v3rI.js.map +0 -1
- package/dist/messages-CwE3gAfq.js +0 -2
- package/dist/messages-CwE3gAfq.js.map +0 -1
- package/dist/messages-CwJv_fQs.js +0 -2
- package/dist/messages-CwJv_fQs.js.map +0 -1
- package/dist/messages-Czj9Py78.js +0 -2
- package/dist/messages-Czj9Py78.js.map +0 -1
- package/dist/messages-D6WiBBde.js +0 -2
- package/dist/messages-D6WiBBde.js.map +0 -1
- package/dist/messages-D9auq5jB.js +0 -2
- package/dist/messages-D9auq5jB.js.map +0 -1
- package/dist/messages-DAMzu2TX.js +0 -2
- package/dist/messages-DAMzu2TX.js.map +0 -1
- package/dist/messages-DH4DM5Sn.js +0 -2
- package/dist/messages-DH4DM5Sn.js.map +0 -1
- package/dist/messages-DJc1APbG.js +0 -2
- package/dist/messages-DJc1APbG.js.map +0 -1
- package/dist/messages-DLhyuCf_.js +0 -2
- package/dist/messages-DLhyuCf_.js.map +0 -1
- package/dist/messages-DV36V9jH.js +0 -2
- package/dist/messages-DV36V9jH.js.map +0 -1
- package/dist/messages-DiYwcD9u.js +0 -2
- package/dist/messages-DiYwcD9u.js.map +0 -1
- package/dist/messages-DqYJdZHM.js +0 -2
- package/dist/messages-DqYJdZHM.js.map +0 -1
- package/dist/messages-KnJQiomY.js +0 -2
- package/dist/messages-KnJQiomY.js.map +0 -1
- package/dist/messages-MTSVfqk-.js +0 -2
- package/dist/messages-MTSVfqk-.js.map +0 -1
- package/dist/messages-P9tooA-S.js +0 -2
- package/dist/messages-P9tooA-S.js.map +0 -1
- package/dist/messages-V2Gis-Rz.js +0 -2
- package/dist/messages-V2Gis-Rz.js.map +0 -1
- package/dist/messages-eQS9zEPK.js +0 -2
- package/dist/messages-eQS9zEPK.js.map +0 -1
- package/dist/messages-lD5uWYft.js +0 -2
- package/dist/messages-lD5uWYft.js.map +0 -1
- package/dist/messages-pb2Vb2bd.js +0 -2
- package/dist/messages-pb2Vb2bd.js.map +0 -1
- /package/dist/{error-view-D2nJsHXB.css → admonition-D2nJsHXB.css} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var Wu=Object.defineProperty;var Ku=(e,t,r)=>t in e?Wu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Xu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wt=(e,t,r)=>Ku(e,typeof t!="symbol"?t+"":t,r);import{r as S,u as q,j as f,C as Ju,A as Mt,g as Qu,c as fe,T as C,E as ed,a as Ir,b as td,B as go,d as yo,R as rd,e as nd,N as Ss,f as ws,h as dn,i as id,k as sd,L as ad,l as vo,m as od,n as Ts,X as cd,o as ud,p as dd}from"./admonition-BGv4N7na.js";import{B as se,F as Oi,L as Ee}from"./form-card-DJyQYXqE.js";import{A as ld,U as fd,u as jr,L as Is,E as hd,S as pd,I as md,a as js,b as _d,c as gd}from"./error-view-zWcVh4wA.js";var s_=Xu((d_,lu)=>{const bo=S.createContext(null),Vn={didCatch:!1,error:null};class yd extends S.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Vn}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:s,reason:"imperative-api"}),this.setState(Vn)}}componentDidCatch(t,r){var n,i;(n=(i=this.props).onError)===null||n===void 0||n.call(i,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:i}=this.props;if(n&&r.error!==null&&vd(t.resetKeys,i)){var s,a;(s=(a=this.props).onReset)===null||s===void 0||s.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Vn)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:i}=this.props,{didCatch:s,error:a}=this.state;let c=t;if(s){const u={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")c=r(u);else if(n)c=S.createElement(n,u);else if(i!==void 0)c=i;else throw a}return S.createElement(bo.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},c)}}function vd(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}function bd(e){if(e==null||typeof e.didCatch!="boolean"||typeof e.resetErrorBoundary!="function")throw new Error("ErrorBoundaryContext not found")}function xd(){const e=S.useContext(bo);bd(e);const[t,r]=S.useState({error:null,hasError:!1}),n=S.useMemo(()=>({resetBoundary:()=>{e.resetErrorBoundary(),r({error:null,hasError:!1})},showBoundary:i=>r({error:i,hasError:!0})}),[e.resetErrorBoundary]);if(t.hasError)throw t.error;return n}function Ed(e,t,r){if(!e)return[t];const n=e.findIndex(r);return n===-1?[...e,t]:[...e.slice(0,n),t,...e.slice(n+1)]}function nt(e,t){const{showBoundary:r}=xd();return S.useCallback(async(...n)=>{try{return await e(...n)}catch(i){throw i instanceof fd&&r(i),i}},t.concat(r))}function Sd({sessions:e=[],onRedirected:t}){const[r]=S.useState(()=>new ld),[n,i]=S.useState(e),{i18n:s,_:a}=q(),{locale:c}=s,u=S.useCallback(P=>{i(A=>{var j;return P===(((j=A.find(Z=>Z.selected))==null?void 0:j.account.sub)||null)?A:A.map(Z=>({...Z,selected:Z.account.sub===P}))})},[i]),d=S.useCallback(({account:P,ephemeralToken:A,consentRequired:j=!0,selected:Z=!0,loginRequired:B=!1})=>{const M={account:P,ephemeralToken:A,selected:Z,loginRequired:B,consentRequired:j};i(K=>Ed(K,M,H=>H.account.sub===P.sub).map(H=>!Z||H===M||!H.selected?H:{...H,selected:!1}))},[i]),l=S.useCallback(P=>{window.location.href=String(P),t&&setTimeout(t)},[t]),p=nt(async(P,A)=>{const j=await r.fetch("POST","/sign-in",{...P,locale:c},{signal:A});d(j)},[r,c,d]),g=nt(async(P,A)=>{await r.fetch("POST","/reset-password-request",{...P,locale:c},{signal:A})},[r,c]),m=nt(async(P,A)=>{await r.fetch("POST","/reset-password-confirm",P,{signal:A})},[r]),x=nt(async(P,A)=>{await r.fetch("POST","/verify-handle-availability",P,{signal:A})},[r]),w=nt(async(P,A)=>{const j=await r.fetch("POST","/sign-up",{...P,locale:c},{signal:A});d(j)},[r,c,d]),I=nt(async(P,A)=>{var B;const j=(B=n.find(M=>M.account.sub===P))==null?void 0:B.ephemeralToken,{url:Z}=await r.fetch("POST","/consent",{sub:P,scope:A},{bearer:j});l(Z)},[r,n,l]),N=nt(async()=>{const{url:P}=await r.fetch("POST","/reject",{});l(P)},[r,l]);return{sessions:n,selectSub:u,doSignIn:p,doInitiatePasswordReset:g,doConfirmResetPassword:m,doValidateNewHandle:x,doSignUp:w,doConsent:I,doReject:N}}function Tt(e,t){return S.useCallback(()=>e(t),[e,t])}function wd({clientId:e,clientMetadata:t,clientTrusted:r}){const[n,i]=S.useState(!1),s=r?t.logo_uri:void 0,a=t.client_name||e;return S.useEffect(()=>{i(!1)},[s]),s&&!n?f.jsx("img",{"aria-hidden":!0,src:s,alt:a,className:"-ml-1 size-8",onError:()=>i(!0)}):f.jsx("div",{"aria-hidden":!0,className:"bg-primary flex size-8 items-center justify-center overflow-hidden rounded-full text-white",children:f.jsx(Ju,{className:"size-4"})})}function Td(e,t){S.useEffect(()=>{const r=n=>{!n.defaultPrevented&&e.current&&!e.current.contains(n.target)&&t(n)};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t])}function Id(e){const t=r=>{r.key==="Escape"&&(r.preventDefault(),e())};S.useEffect(()=>(window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}),[e])}function we({hint:e,image:t,title:r,description:n,append:i,className:s,children:a,...c}){const{i18n:u,_:d}=q(),[l,p]=S.useState(!1),g=S.useCallback(()=>p(!1),[]),m=S.useRef(null);Id(g),Td(m,g);const x=a!=null,w=jr("details-card-");return f.jsxs("div",{ref:m,className:s,...c,children:[f.jsxs("div",{className:"flex items-center justify-start gap-2",children:[f.jsx("div",{className:"ml-2 flex w-8 flex-grow-0 items-center justify-center","aria-hidden":!0,children:t}),f.jsxs("div",{className:"flex flex-1 flex-col","aria-describedby":x?w:void 0,children:[r&&f.jsx("h3",{children:r}),n&&f.jsx("p",{className:"text-sm",children:n})]}),i&&f.jsx("div",{className:"flex shrink-0 grow-0 items-center justify-center",children:i}),x&&f.jsx(se,{onClick:I=>{I.defaultPrevented||(I.preventDefault(),p(N=>!N))},shape:"circle",title:l?u._({id:"183A6G"}):e??u._({id:"xAo8pm"}),"aria-expanded":l,"aria-label":l?u._({id:"183A6G"}):e??u._({id:"xAo8pm"}),"aria-haspopup":"true","aria-controls":w,children:"?"})]}),x&&f.jsx(Mt,{className:"mt-4",hidden:!l,id:w,"aria-hidden":!l,children:a})]})}var it={},zn={},cr={},Rs;function yt(){if(Rs)return cr;Rs=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.isScopeStringFor=e,cr.isScopeSyntaxFor=t;function e(r,n){if(r.length>n.length){const i=r.charCodeAt(n.length);return i!==58&&i!==63?!1:r.startsWith(n)}else return r===n}function t(r,n){return r.prefix===n}return cr}var It={},Cs;function Rr(){if(Cs)return It;Cs=1,Object.defineProperty(It,"__esModule",{value:!0}),It.minIdx=e,It.knownValuesValidator=t,It.isNonNullable=r;function e(n,i){return n===-1?i:i===-1?n:Math.min(n,i)}function t(n){const i=new Set(n);return s=>i.has(s)}function r(n){return n!=null}return It}var qn={},ur={},dr={},Ds;function vt(){if(Ds)return dr;Ds=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.ScopeStringSyntax=void 0;const e=Rr();class t{constructor(a,c,u){Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"positional",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:u})}*keys(){this.params&&(yield*this.params.keys())}getSingle(a){var u;if(!((u=this.params)!=null&&u.has(a)))return;const c=this.params.getAll(a);return c.length>1?null:c[0]}getMulti(a){var c;if((c=this.params)!=null&&c.has(a))return this.params.getAll(a)}toString(){var c;let a=this.prefix;return this.positional!==void 0&&(a+=`:${i(encodeURIComponent(this.positional))}`),(c=this.params)!=null&&c.size&&(a+=`?${i(this.params.toString())}`),a}static fromString(a){const c=a.indexOf("?"),u=a.indexOf(":"),d=(0,e.minIdx)(c,u);if(d===-1)return new t(a);const l=a.slice(0,d),p=u!==-1?c===-1?decodeURIComponent(a.slice(u+1)):u<c?decodeURIComponent(a.slice(u+1,c)):void 0:void 0,g=c!==-1&&c<a.length-1?new URLSearchParams(a.slice(c+1)):void 0;return new t(l,p,g)}}dr.ScopeStringSyntax=t;const r=new Set([":","/","+",",","@","%"]),n=new Map(Array.from(r,s=>[encodeURIComponent(s),s]).filter(([s,a])=>s!==a&&s.length===3&&s.startsWith("%")));function i(s){let a=s.length-2;for(let c=0;c<a;c++)if(s.charCodeAt(c)===37){const u=s.slice(c,c+3),d=n.get(u);d&&(s=`${s.slice(0,c)}${d}${s.slice(c+u.length)}`,c+=d.length-1,a-=u.length-d.length)}return s}return dr}var Ns;function Vt(){if(Ns)return ur;Ns=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.Parser=void 0;const e=vt();class t{constructor(i,s,a){Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"positionalName",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"schemaKeys",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.schemaKeys=new Set(Object.keys(s))}format(i){const s=new URLSearchParams;let a;for(const c of this.schemaKeys){const u=i[c];if(u===void 0)continue;const d=this.schema[c],l=d.normalize?d.normalize(u):u;if(!(!d.required&&(d.default===l||d.multiple&&d.default&&r(d.default,l))))if(Array.isArray(l))if(c===this.positionalName&&l.length===1)a=String(l[0]);else{const p=new Set(l.map(String));for(const g of p)s.append(c,g)}else c===this.positionalName?a=String(l):s.set(c,String(l))}return new e.ScopeStringSyntax(this.prefix,a,s).toString()}parse(i){for(const a of i.keys())if(!this.schemaKeys.has(a))return null;const s=Object.create(null);for(const a of this.schemaKeys){const c=this.schema[a],u=c.multiple?i.getMulti(a):i.getSingle(a);if(u===null)return null;if(u!==void 0){if(a===this.positionalName&&i.positional!==void 0)return null;if(c.multiple){if(!u.length||!u.every(c.validate))return null}else if(!c.validate(u))return null;s[a]=u}else if(a===this.positionalName&&i.positional!==void 0){const{positional:d}=i;if(!c.validate(d))return null;s[a]=c.multiple?[d]:d}else{if(c.required)return null;s[a]=c.default}}return s}}ur.Parser=t;function r(n,i){for(const s of n)if(!i.includes(s))return!1;for(const s of i)if(!n.includes(s))return!1;return!0}return ur}var ks;function Sn(){return ks||(ks=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AccountPermission=e.ACCOUNT_ACTIONS=e.ACCOUNT_ATTRIBUTES=void 0;const t=Vt(),r=vt(),n=yt(),i=Rr();e.ACCOUNT_ATTRIBUTES=Object.freeze(["email","repo","status"]),e.ACCOUNT_ACTIONS=Object.freeze(["read","manage"]);class s{constructor(c,u){Object.defineProperty(this,"attr",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"action",{enumerable:!0,configurable:!0,writable:!0,value:u})}matches(c){return this.attr===c.attr&&(this.action.includes("manage")||this.action.includes(c.action))}toString(){return s.parser.format(this)}static fromString(c){if(!(0,n.isScopeStringFor)(c,"account"))return null;const u=r.ScopeStringSyntax.fromString(c);return s.fromSyntax(u)}static fromSyntax(c){const u=s.parser.parse(c);return u?new s(u.attr,u.action):null}static scopeNeededFor(c){return s.parser.format({attr:c.attr,action:[c.action]})}}e.AccountPermission=s,Object.defineProperty(s,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new t.Parser("account",{attr:{multiple:!1,required:!0,validate:(0,i.knownValuesValidator)(e.ACCOUNT_ATTRIBUTES)},action:{multiple:!0,required:!1,validate:(0,i.knownValuesValidator)(e.ACCOUNT_ACTIONS),default:["read"]}},"attr")})}(qn)),qn}var Gn={},st={},Ps;function jd(){if(Ps)return st;Ps=1,Object.defineProperty(st,"__esModule",{value:!0}),st.isMime=t,st.isAccept=r,st.matchesAccept=i,st.matchesAnyAccept=a;function e(c){const u=c.indexOf("/");return!(u===-1||u===0||u===c.length-1||c.includes("/",u+1)||c.includes(" "))}function t(c){return e(c)&&!c.includes("*")}function r(c){return typeof c!="string"?!1:c==="*/*"?!0:e(c)?!c.includes("*")||c.endsWith("/*"):!1}function n(c,u){return c==="*/*"?!0:c.endsWith("/*")?u.startsWith(c.slice(0,-1)):c===u}function i(c,u){return t(u)&&n(c,u)}function s(c,u){for(const d of c)if(n(d,u))return!0;return!1}function a(c,u){return t(u)&&s(c,u)}return st}var As;function wn(){return As||(As=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BlobPermission=e.DEFAULT_ACCEPT=void 0;const t=jd(),r=Vt(),n=vt(),i=yt();e.DEFAULT_ACCEPT=Object.freeze(["*/*"]);class s{constructor(d){Object.defineProperty(this,"accept",{enumerable:!0,configurable:!0,writable:!0,value:d})}matches(d){return(0,t.matchesAnyAccept)(this.accept,d.mime)}toString(){return s.parser.format(this)}static fromString(d){if(!(0,i.isScopeStringFor)(d,"blob"))return null;const l=n.ScopeStringSyntax.fromString(d);return s.fromSyntax(l)}static fromSyntax(d){const l=s.parser.parse(d);return l?new s(l.accept):null}static scopeNeededFor(d){return s.parser.format({accept:[d.mime]})}}e.BlobPermission=s,Object.defineProperty(s,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new r.Parser("blob",{accept:{multiple:!0,required:!0,validate:t.isAccept,normalize:u=>u.includes("*/*")?e.DEFAULT_ACCEPT:u.map(a).filter(c).sort()}},"accept")});function a(u){return typeof u=="string"?u.toLowerCase():u}function c(u,d,l){if(typeof u!="string"||u.endsWith("/*"))return!0;const p=u.split("/",1)[0];return!l.includes(`${p}/*`)}}(Gn)),Gn}var Yn={},Os;function Tn(){return Os||(Os=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IdentityPermission=e.IDENTITY_ATTRIBUTES=void 0;const t=Vt(),r=vt(),n=yt(),i=Rr();e.IDENTITY_ATTRIBUTES=Object.freeze(["handle","*"]);class s{constructor(c){Object.defineProperty(this,"attr",{enumerable:!0,configurable:!0,writable:!0,value:c})}matches(c){return this.attr==="*"||this.attr===c.attr}toString(){return s.parser.format(this)}static fromString(c){if(!(0,n.isScopeStringFor)(c,"identity"))return null;const u=r.ScopeStringSyntax.fromString(c);return s.fromSyntax(u)}static fromSyntax(c){const u=s.parser.parse(c);return u?new s(u.attr):null}static scopeNeededFor(c){return s.parser.format(c)}}e.IdentityPermission=s,Object.defineProperty(s,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new t.Parser("identity",{attr:{multiple:!1,required:!0,validate:(0,i.knownValuesValidator)(e.IDENTITY_ATTRIBUTES)}},"attr")})}(Yn)),Yn}var Fn={},at={},Hn={},be={},ot={},xe={},qr={},Wn={},Us;function In(){return Us||(Us=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(i){i.assertEqual=u=>u;function s(u){}i.assertIs=s;function a(u){throw new Error}i.assertNever=a,i.arrayToEnum=u=>{const d={};for(const l of u)d[l]=l;return d},i.getValidEnumValues=u=>{const d=i.objectKeys(u).filter(p=>typeof u[u[p]]!="number"),l={};for(const p of d)l[p]=u[p];return i.objectValues(l)},i.objectValues=u=>i.objectKeys(u).map(function(d){return u[d]}),i.objectKeys=typeof Object.keys=="function"?u=>Object.keys(u):u=>{const d=[];for(const l in u)Object.prototype.hasOwnProperty.call(u,l)&&d.push(l);return d},i.find=(u,d)=>{for(const l of u)if(d(l))return l},i.isInteger=typeof Number.isInteger=="function"?u=>Number.isInteger(u):u=>typeof u=="number"&&isFinite(u)&&Math.floor(u)===u;function c(u,d=" | "){return u.map(l=>typeof l=="string"?`'${l}'`:l).join(d)}i.joinValues=c,i.jsonStringifyReplacer=(u,d)=>typeof d=="bigint"?d.toString():d})(t||(e.util=t={}));var r;(function(i){i.mergeShapes=(s,a)=>({...s,...a})})(r||(e.objectUtil=r={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=i=>{switch(typeof i){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(i)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(i)?e.ZodParsedType.array:i===null?e.ZodParsedType.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&i instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&i instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&i instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=n}(Wn)),Wn}var Ae={},Zs;function Ui(){if(Zs)return Ae;Zs=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.ZodError=Ae.quotelessJson=Ae.ZodIssueCode=void 0;const e=In();Ae.ZodIssueCode=e.util.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"]);const t=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");Ae.quotelessJson=t;let r=class xo extends Error{get errors(){return this.issues}constructor(i){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=i}format(i){const s=i||function(u){return u.message},a={_errors:[]},c=u=>{for(const d of u.issues)if(d.code==="invalid_union")d.unionErrors.map(c);else if(d.code==="invalid_return_type")c(d.returnTypeError);else if(d.code==="invalid_arguments")c(d.argumentsError);else if(d.path.length===0)a._errors.push(s(d));else{let l=a,p=0;for(;p<d.path.length;){const g=d.path[p];p===d.path.length-1?(l[g]=l[g]||{_errors:[]},l[g]._errors.push(s(d))):l[g]=l[g]||{_errors:[]},l=l[g],p++}}};return c(this),a}static assert(i){if(!(i instanceof xo))throw new Error(`Not a ZodError: ${i}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(i=s=>s.message){const s={},a=[];for(const c of this.issues)c.path.length>0?(s[c.path[0]]=s[c.path[0]]||[],s[c.path[0]].push(i(c))):a.push(i(c));return{formErrors:a,fieldErrors:s}}get formErrors(){return this.flatten()}};return Ae.ZodError=r,r.create=n=>new r(n),Ae}var $s;function Eo(){if($s)return qr;$s=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=In(),t=Ui(),r=(n,i)=>{let s;switch(n.code){case t.ZodIssueCode.invalid_type:n.received===e.ZodParsedType.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case t.ZodIssueCode.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,e.util.jsonStringifyReplacer)}`;break;case t.ZodIssueCode.unrecognized_keys:s=`Unrecognized key(s) in object: ${e.util.joinValues(n.keys,", ")}`;break;case t.ZodIssueCode.invalid_union:s="Invalid input";break;case t.ZodIssueCode.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${e.util.joinValues(n.options)}`;break;case t.ZodIssueCode.invalid_enum_value:s=`Invalid enum value. Expected ${e.util.joinValues(n.options)}, received '${n.received}'`;break;case t.ZodIssueCode.invalid_arguments:s="Invalid function arguments";break;case t.ZodIssueCode.invalid_return_type:s="Invalid function return type";break;case t.ZodIssueCode.invalid_date:s="Invalid date";break;case t.ZodIssueCode.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:e.util.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case t.ZodIssueCode.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case t.ZodIssueCode.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case t.ZodIssueCode.custom:s="Invalid input";break;case t.ZodIssueCode.invalid_intersection_types:s="Intersection results could not be merged";break;case t.ZodIssueCode.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case t.ZodIssueCode.not_finite:s="Number must be finite";break;default:s=i.defaultError,e.util.assertNever(n)}return{message:s}};return qr.default=r,qr}var Ls;function Zi(){if(Ls)return xe;Ls=1;var e=xe&&xe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(xe,"__esModule",{value:!0}),xe.getErrorMap=xe.setErrorMap=xe.defaultErrorMap=void 0;const t=e(Eo());xe.defaultErrorMap=t.default;let r=t.default;function n(s){r=s}xe.setErrorMap=n;function i(){return r}return xe.getErrorMap=i,xe}var lr={},Bs;function So(){return Bs||(Bs=1,function(e){var t=lr&&lr.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;const r=Zi(),n=t(Eo()),i=m=>{const{data:x,path:w,errorMaps:I,issueData:N}=m,P=[...w,...N.path||[]],A={...N,path:P};if(N.message!==void 0)return{...N,path:P,message:N.message};let j="";const Z=I.filter(B=>!!B).slice().reverse();for(const B of Z)j=B(A,{data:x,defaultError:j}).message;return{...N,path:P,message:j}};e.makeIssue=i,e.EMPTY_PATH=[];function s(m,x){const w=(0,r.getErrorMap)(),I=(0,e.makeIssue)({issueData:x,data:m.data,path:m.path,errorMaps:[m.common.contextualErrorMap,m.schemaErrorMap,w,w===n.default?void 0:n.default].filter(N=>!!N)});m.common.issues.push(I)}e.addIssueToContext=s;class a{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(x,w){const I=[];for(const N of w){if(N.status==="aborted")return e.INVALID;N.status==="dirty"&&x.dirty(),I.push(N.value)}return{status:x.value,value:I}}static async mergeObjectAsync(x,w){const I=[];for(const N of w){const P=await N.key,A=await N.value;I.push({key:P,value:A})}return a.mergeObjectSync(x,I)}static mergeObjectSync(x,w){const I={};for(const N of w){const{key:P,value:A}=N;if(P.status==="aborted"||A.status==="aborted")return e.INVALID;P.status==="dirty"&&x.dirty(),A.status==="dirty"&&x.dirty(),P.value!=="__proto__"&&(typeof A.value<"u"||N.alwaysSet)&&(I[P.value]=A.value)}return{status:x.value,value:I}}}e.ParseStatus=a,e.INVALID=Object.freeze({status:"aborted"});const c=m=>({status:"dirty",value:m});e.DIRTY=c;const u=m=>({status:"valid",value:m});e.OK=u;const d=m=>m.status==="aborted";e.isAborted=d;const l=m=>m.status==="dirty";e.isDirty=l;const p=m=>m.status==="valid";e.isValid=p;const g=m=>typeof Promise<"u"&&m instanceof Promise;e.isAsync=g}(lr)),lr}var Kn={},Ms;function Rd(){return Ms||(Ms=1,Object.defineProperty(Kn,"__esModule",{value:!0})),Kn}var E={},fr={},Vs;function Cd(){if(Vs)return fr;Vs=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.errorUtil=void 0;var e;return function(t){t.errToObj=r=>typeof r=="string"?{message:r}:r||{},t.toString=r=>typeof r=="string"?r:r==null?void 0:r.message}(e||(fr.errorUtil=e={})),fr}var zs;function Dd(){if(zs)return E;zs=1;var e=E&&E.__classPrivateFieldGet||function(y,o,h,_){if(h==="a"&&!_)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?y!==o||!_:!o.has(y))throw new TypeError("Cannot read private member from an object whose class did not declare it");return h==="m"?_:h==="a"?_.call(y):_?_.value:o.get(y)},t=E&&E.__classPrivateFieldSet||function(y,o,h,_,v){if(_==="m")throw new TypeError("Private method is not writable");if(_==="a"&&!v)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?y!==o||!v:!o.has(y))throw new TypeError("Cannot write private member to an object whose class did not declare it");return _==="a"?v.call(y,h):v?v.value=h:o.set(y,h),h},r,n;Object.defineProperty(E,"__esModule",{value:!0}),E.boolean=E.bigint=E.array=E.any=E.coerce=E.ZodFirstPartyTypeKind=E.late=E.ZodSchema=E.Schema=E.custom=E.ZodReadonly=E.ZodPipeline=E.ZodBranded=E.BRAND=E.ZodNaN=E.ZodCatch=E.ZodDefault=E.ZodNullable=E.ZodOptional=E.ZodTransformer=E.ZodEffects=E.ZodPromise=E.ZodNativeEnum=E.ZodEnum=E.ZodLiteral=E.ZodLazy=E.ZodFunction=E.ZodSet=E.ZodMap=E.ZodRecord=E.ZodTuple=E.ZodIntersection=E.ZodDiscriminatedUnion=E.ZodUnion=E.ZodObject=E.ZodArray=E.ZodVoid=E.ZodNever=E.ZodUnknown=E.ZodAny=E.ZodNull=E.ZodUndefined=E.ZodSymbol=E.ZodDate=E.ZodBoolean=E.ZodBigInt=E.ZodNumber=E.ZodString=E.datetimeRegex=E.ZodType=void 0,E.NEVER=E.void=E.unknown=E.union=E.undefined=E.tuple=E.transformer=E.symbol=E.string=E.strictObject=E.set=E.record=E.promise=E.preprocess=E.pipeline=E.ostring=E.optional=E.onumber=E.oboolean=E.object=E.number=E.nullable=E.null=E.never=E.nativeEnum=E.nan=E.map=E.literal=E.lazy=E.intersection=E.instanceof=E.function=E.enum=E.effect=E.discriminatedUnion=E.date=void 0;const i=Zi(),s=Cd(),a=So(),c=In(),u=Ui();class d{constructor(o,h,_,v){this._cachedPath=[],this.parent=o,this.data=h,this._path=_,this._key=v}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 l=(y,o)=>{if((0,a.isValid)(o))return{success:!0,data:o.value};if(!y.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const h=new u.ZodError(y.common.issues);return this._error=h,this._error}}};function p(y){if(!y)return{};const{errorMap:o,invalid_type_error:h,required_error:_,description:v}=y;if(o&&(h||_))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return o?{errorMap:o,description:v}:{errorMap:(D,R)=>{var U,O;const{message:$}=y;return D.code==="invalid_enum_value"?{message:$??R.defaultError}:typeof R.data>"u"?{message:(U=$??_)!==null&&U!==void 0?U:R.defaultError}:D.code!=="invalid_type"?{message:R.defaultError}:{message:(O=$??h)!==null&&O!==void 0?O:R.defaultError}},description:v}}class g{get description(){return this._def.description}_getType(o){return(0,c.getParsedType)(o.data)}_getOrReturnCtx(o,h){return h||{common:o.parent.common,data:o.data,parsedType:(0,c.getParsedType)(o.data),schemaErrorMap:this._def.errorMap,path:o.path,parent:o.parent}}_processInputParams(o){return{status:new a.ParseStatus,ctx:{common:o.parent.common,data:o.data,parsedType:(0,c.getParsedType)(o.data),schemaErrorMap:this._def.errorMap,path:o.path,parent:o.parent}}}_parseSync(o){const h=this._parse(o);if((0,a.isAsync)(h))throw new Error("Synchronous parse encountered promise.");return h}_parseAsync(o){const h=this._parse(o);return Promise.resolve(h)}parse(o,h){const _=this.safeParse(o,h);if(_.success)return _.data;throw _.error}safeParse(o,h){var _;const v={common:{issues:[],async:(_=h==null?void 0:h.async)!==null&&_!==void 0?_:!1,contextualErrorMap:h==null?void 0:h.errorMap},path:(h==null?void 0:h.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:(0,c.getParsedType)(o)},b=this._parseSync({data:o,path:v.path,parent:v});return l(v,b)}"~validate"(o){var h,_;const v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:(0,c.getParsedType)(o)};if(!this["~standard"].async)try{const b=this._parseSync({data:o,path:[],parent:v});return(0,a.isValid)(b)?{value:b.value}:{issues:v.common.issues}}catch(b){!((_=(h=b==null?void 0:b.message)===null||h===void 0?void 0:h.toLowerCase())===null||_===void 0)&&_.includes("encountered")&&(this["~standard"].async=!0),v.common={issues:[],async:!0}}return this._parseAsync({data:o,path:[],parent:v}).then(b=>(0,a.isValid)(b)?{value:b.value}:{issues:v.common.issues})}async parseAsync(o,h){const _=await this.safeParseAsync(o,h);if(_.success)return _.data;throw _.error}async safeParseAsync(o,h){const _={common:{issues:[],contextualErrorMap:h==null?void 0:h.errorMap,async:!0},path:(h==null?void 0:h.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:(0,c.getParsedType)(o)},v=this._parse({data:o,path:_.path,parent:_}),b=await((0,a.isAsync)(v)?v:Promise.resolve(v));return l(_,b)}refine(o,h){const _=v=>typeof h=="string"||typeof h>"u"?{message:h}:typeof h=="function"?h(v):h;return this._refinement((v,b)=>{const D=o(v),R=()=>b.addIssue({code:u.ZodIssueCode.custom,..._(v)});return typeof Promise<"u"&&D instanceof Promise?D.then(U=>U?!0:(R(),!1)):D?!0:(R(),!1)})}refinement(o,h){return this._refinement((_,v)=>o(_)?!0:(v.addIssue(typeof h=="function"?h(_,v):h),!1))}_refinement(o){return new ve({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:o}})}superRefine(o){return this._refinement(o)}constructor(o){this.spa=this.safeParseAsync,this._def=o,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:h=>this["~validate"](h)}}optional(){return Ie.create(this,this._def)}nullable(){return Ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ye.create(this)}promise(){return St.create(this,this._def)}or(o){return Jt.create([this,o],this._def)}and(o){return Qt.create(this,o,this._def)}transform(o){return new ve({...p(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:o}})}default(o){const h=typeof o=="function"?o:()=>o;return new ir({...p(this._def),innerType:this,defaultValue:h,typeName:L.ZodDefault})}brand(){return new Bn({typeName:L.ZodBranded,type:this,...p(this._def)})}catch(o){const h=typeof o=="function"?o:()=>o;return new sr({...p(this._def),innerType:this,catchValue:h,typeName:L.ZodCatch})}describe(o){const h=this.constructor;return new h({...this._def,description:o})}pipe(o){return ar.create(this,o)}readonly(){return or.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}E.ZodType=g,E.Schema=g,E.ZodSchema=g;const m=/^c[^\s-]{8,}$/i,x=/^[0-9a-z]+$/,w=/^[0-9A-HJKMNP-TV-Z]{26}$/i,I=/^[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,N=/^[a-z0-9_-]{21}$/i,P=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,A=/^[-+]?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)?)??$/,j=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Z="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let B;const M=/^(?:(?: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])$/,K=/^(?:(?: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])$/,H=/^(([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]))$/,ce=/^(([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])$/,z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,re=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\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])))",ue=new RegExp(`^${G}$`);function Ft(y){let o="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return y.precision?o=`${o}\\.\\d{${y.precision}}`:y.precision==null&&(o=`${o}(\\.\\d+)?`),o}function _e(y){return new RegExp(`^${Ft(y)}$`)}function Ht(y){let o=`${G}T${Ft(y)}`;const h=[];return h.push(y.local?"Z?":"Z"),y.offset&&h.push("([+-]\\d{2}:?\\d{2})"),o=`${o}(${h.join("|")})`,new RegExp(`^${o}$`)}E.datetimeRegex=Ht;function Me(y,o){return!!((o==="v4"||!o)&&M.test(y)||(o==="v6"||!o)&&H.test(y))}function fu(y,o){if(!P.test(y))return!1;try{const[h]=y.split("."),_=h.replace(/-/g,"+").replace(/_/g,"/").padEnd(h.length+(4-h.length%4)%4,"="),v=JSON.parse(atob(_));return!(typeof v!="object"||v===null||!v.typ||!v.alg||o&&v.alg!==o)}catch{return!1}}function hu(y,o){return!!((o==="v4"||!o)&&K.test(y)||(o==="v6"||!o)&&ce.test(y))}class ge extends g{_parse(o){if(this._def.coerce&&(o.data=String(o.data)),this._getType(o)!==c.ZodParsedType.string){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:b.parsedType}),a.INVALID}const _=new a.ParseStatus;let v;for(const b of this._def.checks)if(b.kind==="min")o.data.length<b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),_.dirty());else if(b.kind==="max")o.data.length>b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),_.dirty());else if(b.kind==="length"){const D=o.data.length>b.value,R=o.data.length<b.value;(D||R)&&(v=this._getOrReturnCtx(o,v),D?(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}):R&&(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message}),_.dirty())}else if(b.kind==="email")j.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"email",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="emoji")B||(B=new RegExp(Z,"u")),B.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"emoji",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="uuid")I.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"uuid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="nanoid")N.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"nanoid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="cuid")m.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"cuid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="cuid2")x.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"cuid2",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="ulid")w.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"ulid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="url")try{new URL(o.data)}catch{v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"url",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()}else b.kind==="regex"?(b.regex.lastIndex=0,b.regex.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"regex",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty())):b.kind==="trim"?o.data=o.data.trim():b.kind==="includes"?o.data.includes(b.value,b.position)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:{includes:b.value,position:b.position},message:b.message}),_.dirty()):b.kind==="toLowerCase"?o.data=o.data.toLowerCase():b.kind==="toUpperCase"?o.data=o.data.toUpperCase():b.kind==="startsWith"?o.data.startsWith(b.value)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:{startsWith:b.value},message:b.message}),_.dirty()):b.kind==="endsWith"?o.data.endsWith(b.value)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:{endsWith:b.value},message:b.message}),_.dirty()):b.kind==="datetime"?Ht(b).test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:"datetime",message:b.message}),_.dirty()):b.kind==="date"?ue.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:"date",message:b.message}),_.dirty()):b.kind==="time"?_e(b).test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:"time",message:b.message}),_.dirty()):b.kind==="duration"?A.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"duration",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="ip"?Me(o.data,b.version)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"ip",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="jwt"?fu(o.data,b.alg)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"jwt",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="cidr"?hu(o.data,b.version)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"cidr",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="base64"?z.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"base64",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="base64url"?re.test(o.data)||(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{validation:"base64url",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):c.util.assertNever(b);return{status:_.value,value:o.data}}_regex(o,h,_){return this.refinement(v=>o.test(v),{validation:h,code:u.ZodIssueCode.invalid_string,...s.errorUtil.errToObj(_)})}_addCheck(o){return new ge({...this._def,checks:[...this._def.checks,o]})}email(o){return this._addCheck({kind:"email",...s.errorUtil.errToObj(o)})}url(o){return this._addCheck({kind:"url",...s.errorUtil.errToObj(o)})}emoji(o){return this._addCheck({kind:"emoji",...s.errorUtil.errToObj(o)})}uuid(o){return this._addCheck({kind:"uuid",...s.errorUtil.errToObj(o)})}nanoid(o){return this._addCheck({kind:"nanoid",...s.errorUtil.errToObj(o)})}cuid(o){return this._addCheck({kind:"cuid",...s.errorUtil.errToObj(o)})}cuid2(o){return this._addCheck({kind:"cuid2",...s.errorUtil.errToObj(o)})}ulid(o){return this._addCheck({kind:"ulid",...s.errorUtil.errToObj(o)})}base64(o){return this._addCheck({kind:"base64",...s.errorUtil.errToObj(o)})}base64url(o){return this._addCheck({kind:"base64url",...s.errorUtil.errToObj(o)})}jwt(o){return this._addCheck({kind:"jwt",...s.errorUtil.errToObj(o)})}ip(o){return this._addCheck({kind:"ip",...s.errorUtil.errToObj(o)})}cidr(o){return this._addCheck({kind:"cidr",...s.errorUtil.errToObj(o)})}datetime(o){var h,_;return typeof o=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:o}):this._addCheck({kind:"datetime",precision:typeof(o==null?void 0:o.precision)>"u"?null:o==null?void 0:o.precision,offset:(h=o==null?void 0:o.offset)!==null&&h!==void 0?h:!1,local:(_=o==null?void 0:o.local)!==null&&_!==void 0?_:!1,...s.errorUtil.errToObj(o==null?void 0:o.message)})}date(o){return this._addCheck({kind:"date",message:o})}time(o){return typeof o=="string"?this._addCheck({kind:"time",precision:null,message:o}):this._addCheck({kind:"time",precision:typeof(o==null?void 0:o.precision)>"u"?null:o==null?void 0:o.precision,...s.errorUtil.errToObj(o==null?void 0:o.message)})}duration(o){return this._addCheck({kind:"duration",...s.errorUtil.errToObj(o)})}regex(o,h){return this._addCheck({kind:"regex",regex:o,...s.errorUtil.errToObj(h)})}includes(o,h){return this._addCheck({kind:"includes",value:o,position:h==null?void 0:h.position,...s.errorUtil.errToObj(h==null?void 0:h.message)})}startsWith(o,h){return this._addCheck({kind:"startsWith",value:o,...s.errorUtil.errToObj(h)})}endsWith(o,h){return this._addCheck({kind:"endsWith",value:o,...s.errorUtil.errToObj(h)})}min(o,h){return this._addCheck({kind:"min",value:o,...s.errorUtil.errToObj(h)})}max(o,h){return this._addCheck({kind:"max",value:o,...s.errorUtil.errToObj(h)})}length(o,h){return this._addCheck({kind:"length",value:o,...s.errorUtil.errToObj(h)})}nonempty(o){return this.min(1,s.errorUtil.errToObj(o))}trim(){return new ge({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ge({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(o=>o.kind==="datetime")}get isDate(){return!!this._def.checks.find(o=>o.kind==="date")}get isTime(){return!!this._def.checks.find(o=>o.kind==="time")}get isDuration(){return!!this._def.checks.find(o=>o.kind==="duration")}get isEmail(){return!!this._def.checks.find(o=>o.kind==="email")}get isURL(){return!!this._def.checks.find(o=>o.kind==="url")}get isEmoji(){return!!this._def.checks.find(o=>o.kind==="emoji")}get isUUID(){return!!this._def.checks.find(o=>o.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(o=>o.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(o=>o.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(o=>o.kind==="cuid2")}get isULID(){return!!this._def.checks.find(o=>o.kind==="ulid")}get isIP(){return!!this._def.checks.find(o=>o.kind==="ip")}get isCIDR(){return!!this._def.checks.find(o=>o.kind==="cidr")}get isBase64(){return!!this._def.checks.find(o=>o.kind==="base64")}get isBase64url(){return!!this._def.checks.find(o=>o.kind==="base64url")}get minLength(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o}get maxLength(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o}}E.ZodString=ge,ge.create=y=>{var o;return new ge({checks:[],typeName:L.ZodString,coerce:(o=y==null?void 0:y.coerce)!==null&&o!==void 0?o:!1,...p(y)})};function pu(y,o){const h=(y.toString().split(".")[1]||"").length,_=(o.toString().split(".")[1]||"").length,v=h>_?h:_,b=parseInt(y.toFixed(v).replace(".","")),D=parseInt(o.toFixed(v).replace(".",""));return b%D/Math.pow(10,v)}class Ve extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(o){if(this._def.coerce&&(o.data=Number(o.data)),this._getType(o)!==c.ZodParsedType.number){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:b.parsedType}),a.INVALID}let _;const v=new a.ParseStatus;for(const b of this._def.checks)b.kind==="int"?c.util.isInteger(o.data)||(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:b.message}),v.dirty()):b.kind==="min"?(b.inclusive?o.data<b.value:o.data<=b.value)&&(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_small,minimum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),v.dirty()):b.kind==="max"?(b.inclusive?o.data>b.value:o.data>=b.value)&&(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_big,maximum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),v.dirty()):b.kind==="multipleOf"?pu(o.data,b.value)!==0&&(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.not_multiple_of,multipleOf:b.value,message:b.message}),v.dirty()):b.kind==="finite"?Number.isFinite(o.data)||(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.not_finite,message:b.message}),v.dirty()):c.util.assertNever(b);return{status:v.value,value:o.data}}gte(o,h){return this.setLimit("min",o,!0,s.errorUtil.toString(h))}gt(o,h){return this.setLimit("min",o,!1,s.errorUtil.toString(h))}lte(o,h){return this.setLimit("max",o,!0,s.errorUtil.toString(h))}lt(o,h){return this.setLimit("max",o,!1,s.errorUtil.toString(h))}setLimit(o,h,_,v){return new Ve({...this._def,checks:[...this._def.checks,{kind:o,value:h,inclusive:_,message:s.errorUtil.toString(v)}]})}_addCheck(o){return new Ve({...this._def,checks:[...this._def.checks,o]})}int(o){return this._addCheck({kind:"int",message:s.errorUtil.toString(o)})}positive(o){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s.errorUtil.toString(o)})}negative(o){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s.errorUtil.toString(o)})}nonpositive(o){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s.errorUtil.toString(o)})}nonnegative(o){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s.errorUtil.toString(o)})}multipleOf(o,h){return this._addCheck({kind:"multipleOf",value:o,message:s.errorUtil.toString(h)})}finite(o){return this._addCheck({kind:"finite",message:s.errorUtil.toString(o)})}safe(o){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s.errorUtil.toString(o)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s.errorUtil.toString(o)})}get minValue(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o}get maxValue(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o}get isInt(){return!!this._def.checks.find(o=>o.kind==="int"||o.kind==="multipleOf"&&c.util.isInteger(o.value))}get isFinite(){let o=null,h=null;for(const _ of this._def.checks){if(_.kind==="finite"||_.kind==="int"||_.kind==="multipleOf")return!0;_.kind==="min"?(h===null||_.value>h)&&(h=_.value):_.kind==="max"&&(o===null||_.value<o)&&(o=_.value)}return Number.isFinite(h)&&Number.isFinite(o)}}E.ZodNumber=Ve,Ve.create=y=>new Ve({checks:[],typeName:L.ZodNumber,coerce:(y==null?void 0:y.coerce)||!1,...p(y)});class ze extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(o){if(this._def.coerce)try{o.data=BigInt(o.data)}catch{return this._getInvalidInput(o)}if(this._getType(o)!==c.ZodParsedType.bigint)return this._getInvalidInput(o);let _;const v=new a.ParseStatus;for(const b of this._def.checks)b.kind==="min"?(b.inclusive?o.data<b.value:o.data<=b.value)&&(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_small,type:"bigint",minimum:b.value,inclusive:b.inclusive,message:b.message}),v.dirty()):b.kind==="max"?(b.inclusive?o.data>b.value:o.data>=b.value)&&(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_big,type:"bigint",maximum:b.value,inclusive:b.inclusive,message:b.message}),v.dirty()):b.kind==="multipleOf"?o.data%b.value!==BigInt(0)&&(_=this._getOrReturnCtx(o,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.not_multiple_of,multipleOf:b.value,message:b.message}),v.dirty()):c.util.assertNever(b);return{status:v.value,value:o.data}}_getInvalidInput(o){const h=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:h.parsedType}),a.INVALID}gte(o,h){return this.setLimit("min",o,!0,s.errorUtil.toString(h))}gt(o,h){return this.setLimit("min",o,!1,s.errorUtil.toString(h))}lte(o,h){return this.setLimit("max",o,!0,s.errorUtil.toString(h))}lt(o,h){return this.setLimit("max",o,!1,s.errorUtil.toString(h))}setLimit(o,h,_,v){return new ze({...this._def,checks:[...this._def.checks,{kind:o,value:h,inclusive:_,message:s.errorUtil.toString(v)}]})}_addCheck(o){return new ze({...this._def,checks:[...this._def.checks,o]})}positive(o){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(o)})}negative(o){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(o)})}nonpositive(o){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(o)})}nonnegative(o){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(o)})}multipleOf(o,h){return this._addCheck({kind:"multipleOf",value:o,message:s.errorUtil.toString(h)})}get minValue(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o}get maxValue(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o}}E.ZodBigInt=ze,ze.create=y=>{var o;return new ze({checks:[],typeName:L.ZodBigInt,coerce:(o=y==null?void 0:y.coerce)!==null&&o!==void 0?o:!1,...p(y)})};class Wt extends g{_parse(o){if(this._def.coerce&&(o.data=!!o.data),this._getType(o)!==c.ZodParsedType.boolean){const _=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:_.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodBoolean=Wt,Wt.create=y=>new Wt({typeName:L.ZodBoolean,coerce:(y==null?void 0:y.coerce)||!1,...p(y)});class et extends g{_parse(o){if(this._def.coerce&&(o.data=new Date(o.data)),this._getType(o)!==c.ZodParsedType.date){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:b.parsedType}),a.INVALID}if(isNaN(o.data.getTime())){const b=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(b,{code:u.ZodIssueCode.invalid_date}),a.INVALID}const _=new a.ParseStatus;let v;for(const b of this._def.checks)b.kind==="min"?o.data.getTime()<b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.too_small,message:b.message,inclusive:!0,exact:!1,minimum:b.value,type:"date"}),_.dirty()):b.kind==="max"?o.data.getTime()>b.value&&(v=this._getOrReturnCtx(o,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.too_big,message:b.message,inclusive:!0,exact:!1,maximum:b.value,type:"date"}),_.dirty()):c.util.assertNever(b);return{status:_.value,value:new Date(o.data.getTime())}}_addCheck(o){return new et({...this._def,checks:[...this._def.checks,o]})}min(o,h){return this._addCheck({kind:"min",value:o.getTime(),message:s.errorUtil.toString(h)})}max(o,h){return this._addCheck({kind:"max",value:o.getTime(),message:s.errorUtil.toString(h)})}get minDate(){let o=null;for(const h of this._def.checks)h.kind==="min"&&(o===null||h.value>o)&&(o=h.value);return o!=null?new Date(o):null}get maxDate(){let o=null;for(const h of this._def.checks)h.kind==="max"&&(o===null||h.value<o)&&(o=h.value);return o!=null?new Date(o):null}}E.ZodDate=et,et.create=y=>new et({checks:[],coerce:(y==null?void 0:y.coerce)||!1,typeName:L.ZodDate,...p(y)});class $r extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.symbol){const _=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:_.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodSymbol=$r,$r.create=y=>new $r({typeName:L.ZodSymbol,...p(y)});class Kt extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.undefined){const _=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:_.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodUndefined=Kt,Kt.create=y=>new Kt({typeName:L.ZodUndefined,...p(y)});class Xt extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.null){const _=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:_.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodNull=Xt,Xt.create=y=>new Xt({typeName:L.ZodNull,...p(y)});class bt extends g{constructor(){super(...arguments),this._any=!0}_parse(o){return(0,a.OK)(o.data)}}E.ZodAny=bt,bt.create=y=>new bt({typeName:L.ZodAny,...p(y)});class tt extends g{constructor(){super(...arguments),this._unknown=!0}_parse(o){return(0,a.OK)(o.data)}}E.ZodUnknown=tt,tt.create=y=>new tt({typeName:L.ZodUnknown,...p(y)});class ke extends g{_parse(o){const h=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:h.parsedType}),a.INVALID}}E.ZodNever=ke,ke.create=y=>new ke({typeName:L.ZodNever,...p(y)});class Lr extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.undefined){const _=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:_.parsedType}),a.INVALID}return(0,a.OK)(o.data)}}E.ZodVoid=Lr,Lr.create=y=>new Lr({typeName:L.ZodVoid,...p(y)});class ye extends g{_parse(o){const{ctx:h,status:_}=this._processInputParams(o),v=this._def;if(h.parsedType!==c.ZodParsedType.array)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:h.parsedType}),a.INVALID;if(v.exactLength!==null){const D=h.data.length>v.exactLength.value,R=h.data.length<v.exactLength.value;(D||R)&&((0,a.addIssueToContext)(h,{code:D?u.ZodIssueCode.too_big:u.ZodIssueCode.too_small,minimum:R?v.exactLength.value:void 0,maximum:D?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),_.dirty())}if(v.minLength!==null&&h.data.length<v.minLength.value&&((0,a.addIssueToContext)(h,{code:u.ZodIssueCode.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),_.dirty()),v.maxLength!==null&&h.data.length>v.maxLength.value&&((0,a.addIssueToContext)(h,{code:u.ZodIssueCode.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),_.dirty()),h.common.async)return Promise.all([...h.data].map((D,R)=>v.type._parseAsync(new d(h,D,h.path,R)))).then(D=>a.ParseStatus.mergeArray(_,D));const b=[...h.data].map((D,R)=>v.type._parseSync(new d(h,D,h.path,R)));return a.ParseStatus.mergeArray(_,b)}get element(){return this._def.type}min(o,h){return new ye({...this._def,minLength:{value:o,message:s.errorUtil.toString(h)}})}max(o,h){return new ye({...this._def,maxLength:{value:o,message:s.errorUtil.toString(h)}})}length(o,h){return new ye({...this._def,exactLength:{value:o,message:s.errorUtil.toString(h)}})}nonempty(o){return this.min(1,o)}}E.ZodArray=ye,ye.create=(y,o)=>new ye({type:y,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...p(o)});function xt(y){if(y instanceof W){const o={};for(const h in y.shape){const _=y.shape[h];o[h]=Ie.create(xt(_))}return new W({...y._def,shape:()=>o})}else return y instanceof ye?new ye({...y._def,type:xt(y.element)}):y instanceof Ie?Ie.create(xt(y.unwrap())):y instanceof Ge?Ge.create(xt(y.unwrap())):y instanceof Te?Te.create(y.items.map(o=>xt(o))):y}class W extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const o=this._def.shape(),h=c.util.objectKeys(o);return this._cached={shape:o,keys:h}}_parse(o){if(this._getType(o)!==c.ZodParsedType.object){const O=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(O,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:O.parsedType}),a.INVALID}const{status:_,ctx:v}=this._processInputParams(o),{shape:b,keys:D}=this._getCached(),R=[];if(!(this._def.catchall instanceof ke&&this._def.unknownKeys==="strip"))for(const O in v.data)D.includes(O)||R.push(O);const U=[];for(const O of D){const $=b[O],ie=v.data[O];U.push({key:{status:"valid",value:O},value:$._parse(new d(v,ie,v.path,O)),alwaysSet:O in v.data})}if(this._def.catchall instanceof ke){const O=this._def.unknownKeys;if(O==="passthrough")for(const $ of R)U.push({key:{status:"valid",value:$},value:{status:"valid",value:v.data[$]}});else if(O==="strict")R.length>0&&((0,a.addIssueToContext)(v,{code:u.ZodIssueCode.unrecognized_keys,keys:R}),_.dirty());else if(O!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const O=this._def.catchall;for(const $ of R){const ie=v.data[$];U.push({key:{status:"valid",value:$},value:O._parse(new d(v,ie,v.path,$)),alwaysSet:$ in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const O=[];for(const $ of U){const ie=await $.key,zr=await $.value;O.push({key:ie,value:zr,alwaysSet:$.alwaysSet})}return O}).then(O=>a.ParseStatus.mergeObjectSync(_,O)):a.ParseStatus.mergeObjectSync(_,U)}get shape(){return this._def.shape()}strict(o){return s.errorUtil.errToObj,new W({...this._def,unknownKeys:"strict",...o!==void 0?{errorMap:(h,_)=>{var v,b,D,R;const U=(D=(b=(v=this._def).errorMap)===null||b===void 0?void 0:b.call(v,h,_).message)!==null&&D!==void 0?D:_.defaultError;return h.code==="unrecognized_keys"?{message:(R=s.errorUtil.errToObj(o).message)!==null&&R!==void 0?R:U}:{message:U}}}:{}})}strip(){return new W({...this._def,unknownKeys:"strip"})}passthrough(){return new W({...this._def,unknownKeys:"passthrough"})}extend(o){return new W({...this._def,shape:()=>({...this._def.shape(),...o})})}merge(o){return new W({unknownKeys:o._def.unknownKeys,catchall:o._def.catchall,shape:()=>({...this._def.shape(),...o._def.shape()}),typeName:L.ZodObject})}setKey(o,h){return this.augment({[o]:h})}catchall(o){return new W({...this._def,catchall:o})}pick(o){const h={};return c.util.objectKeys(o).forEach(_=>{o[_]&&this.shape[_]&&(h[_]=this.shape[_])}),new W({...this._def,shape:()=>h})}omit(o){const h={};return c.util.objectKeys(this.shape).forEach(_=>{o[_]||(h[_]=this.shape[_])}),new W({...this._def,shape:()=>h})}deepPartial(){return xt(this)}partial(o){const h={};return c.util.objectKeys(this.shape).forEach(_=>{const v=this.shape[_];o&&!o[_]?h[_]=v:h[_]=v.optional()}),new W({...this._def,shape:()=>h})}required(o){const h={};return c.util.objectKeys(this.shape).forEach(_=>{if(o&&!o[_])h[_]=this.shape[_];else{let b=this.shape[_];for(;b instanceof Ie;)b=b._def.innerType;h[_]=b}}),new W({...this._def,shape:()=>h})}keyof(){return _s(c.util.objectKeys(this.shape))}}E.ZodObject=W,W.create=(y,o)=>new W({shape:()=>y,unknownKeys:"strip",catchall:ke.create(),typeName:L.ZodObject,...p(o)}),W.strictCreate=(y,o)=>new W({shape:()=>y,unknownKeys:"strict",catchall:ke.create(),typeName:L.ZodObject,...p(o)}),W.lazycreate=(y,o)=>new W({shape:y,unknownKeys:"strip",catchall:ke.create(),typeName:L.ZodObject,...p(o)});class Jt extends g{_parse(o){const{ctx:h}=this._processInputParams(o),_=this._def.options;function v(b){for(const R of b)if(R.result.status==="valid")return R.result;for(const R of b)if(R.result.status==="dirty")return h.common.issues.push(...R.ctx.common.issues),R.result;const D=b.map(R=>new u.ZodError(R.ctx.common.issues));return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_union,unionErrors:D}),a.INVALID}if(h.common.async)return Promise.all(_.map(async b=>{const D={...h,common:{...h.common,issues:[]},parent:null};return{result:await b._parseAsync({data:h.data,path:h.path,parent:D}),ctx:D}})).then(v);{let b;const D=[];for(const U of _){const O={...h,common:{...h.common,issues:[]},parent:null},$=U._parseSync({data:h.data,path:h.path,parent:O});if($.status==="valid")return $;$.status==="dirty"&&!b&&(b={result:$,ctx:O}),O.common.issues.length&&D.push(O.common.issues)}if(b)return h.common.issues.push(...b.ctx.common.issues),b.result;const R=D.map(U=>new u.ZodError(U));return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_union,unionErrors:R}),a.INVALID}}get options(){return this._def.options}}E.ZodUnion=Jt,Jt.create=(y,o)=>new Jt({options:y,typeName:L.ZodUnion,...p(o)});const Pe=y=>y instanceof tr?Pe(y.schema):y instanceof ve?Pe(y.innerType()):y instanceof rr?[y.value]:y instanceof qe?y.options:y instanceof nr?c.util.objectValues(y.enum):y instanceof ir?Pe(y._def.innerType):y instanceof Kt?[void 0]:y instanceof Xt?[null]:y instanceof Ie?[void 0,...Pe(y.unwrap())]:y instanceof Ge?[null,...Pe(y.unwrap())]:y instanceof Bn||y instanceof or?Pe(y.unwrap()):y instanceof sr?Pe(y._def.innerType):[];class Br extends g{_parse(o){const{ctx:h}=this._processInputParams(o);if(h.parsedType!==c.ZodParsedType.object)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:h.parsedType}),a.INVALID;const _=this.discriminator,v=h.data[_],b=this.optionsMap.get(v);return b?h.common.async?b._parseAsync({data:h.data,path:h.path,parent:h}):b._parseSync({data:h.data,path:h.path,parent:h}):((0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[_]}),a.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(o,h,_){const v=new Map;for(const b of h){const D=Pe(b.shape[o]);if(!D.length)throw new Error(`A discriminator value for key \`${o}\` could not be extracted from all schema options`);for(const R of D){if(v.has(R))throw new Error(`Discriminator property ${String(o)} has duplicate value ${String(R)}`);v.set(R,b)}}return new Br({typeName:L.ZodDiscriminatedUnion,discriminator:o,options:h,optionsMap:v,...p(_)})}}E.ZodDiscriminatedUnion=Br;function Ln(y,o){const h=(0,c.getParsedType)(y),_=(0,c.getParsedType)(o);if(y===o)return{valid:!0,data:y};if(h===c.ZodParsedType.object&&_===c.ZodParsedType.object){const v=c.util.objectKeys(o),b=c.util.objectKeys(y).filter(R=>v.indexOf(R)!==-1),D={...y,...o};for(const R of b){const U=Ln(y[R],o[R]);if(!U.valid)return{valid:!1};D[R]=U.data}return{valid:!0,data:D}}else if(h===c.ZodParsedType.array&&_===c.ZodParsedType.array){if(y.length!==o.length)return{valid:!1};const v=[];for(let b=0;b<y.length;b++){const D=y[b],R=o[b],U=Ln(D,R);if(!U.valid)return{valid:!1};v.push(U.data)}return{valid:!0,data:v}}else return h===c.ZodParsedType.date&&_===c.ZodParsedType.date&&+y==+o?{valid:!0,data:y}:{valid:!1}}class Qt extends g{_parse(o){const{status:h,ctx:_}=this._processInputParams(o),v=(b,D)=>{if((0,a.isAborted)(b)||(0,a.isAborted)(D))return a.INVALID;const R=Ln(b.value,D.value);return R.valid?(((0,a.isDirty)(b)||(0,a.isDirty)(D))&&h.dirty(),{status:h.value,value:R.data}):((0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_intersection_types}),a.INVALID)};return _.common.async?Promise.all([this._def.left._parseAsync({data:_.data,path:_.path,parent:_}),this._def.right._parseAsync({data:_.data,path:_.path,parent:_})]).then(([b,D])=>v(b,D)):v(this._def.left._parseSync({data:_.data,path:_.path,parent:_}),this._def.right._parseSync({data:_.data,path:_.path,parent:_}))}}E.ZodIntersection=Qt,Qt.create=(y,o,h)=>new Qt({left:y,right:o,typeName:L.ZodIntersection,...p(h)});class Te extends g{_parse(o){const{status:h,ctx:_}=this._processInputParams(o);if(_.parsedType!==c.ZodParsedType.array)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:_.parsedType}),a.INVALID;if(_.data.length<this._def.items.length)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.INVALID;!this._def.rest&&_.data.length>this._def.items.length&&((0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h.dirty());const b=[..._.data].map((D,R)=>{const U=this._def.items[R]||this._def.rest;return U?U._parse(new d(_,D,_.path,R)):null}).filter(D=>!!D);return _.common.async?Promise.all(b).then(D=>a.ParseStatus.mergeArray(h,D)):a.ParseStatus.mergeArray(h,b)}get items(){return this._def.items}rest(o){return new Te({...this._def,rest:o})}}E.ZodTuple=Te,Te.create=(y,o)=>{if(!Array.isArray(y))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Te({items:y,typeName:L.ZodTuple,rest:null,...p(o)})};class er extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(o){const{status:h,ctx:_}=this._processInputParams(o);if(_.parsedType!==c.ZodParsedType.object)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:_.parsedType}),a.INVALID;const v=[],b=this._def.keyType,D=this._def.valueType;for(const R in _.data)v.push({key:b._parse(new d(_,R,_.path,R)),value:D._parse(new d(_,_.data[R],_.path,R)),alwaysSet:R in _.data});return _.common.async?a.ParseStatus.mergeObjectAsync(h,v):a.ParseStatus.mergeObjectSync(h,v)}get element(){return this._def.valueType}static create(o,h,_){return h instanceof g?new er({keyType:o,valueType:h,typeName:L.ZodRecord,...p(_)}):new er({keyType:ge.create(),valueType:o,typeName:L.ZodRecord,...p(h)})}}E.ZodRecord=er;class Mr extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(o){const{status:h,ctx:_}=this._processInputParams(o);if(_.parsedType!==c.ZodParsedType.map)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:_.parsedType}),a.INVALID;const v=this._def.keyType,b=this._def.valueType,D=[..._.data.entries()].map(([R,U],O)=>({key:v._parse(new d(_,R,_.path,[O,"key"])),value:b._parse(new d(_,U,_.path,[O,"value"]))}));if(_.common.async){const R=new Map;return Promise.resolve().then(async()=>{for(const U of D){const O=await U.key,$=await U.value;if(O.status==="aborted"||$.status==="aborted")return a.INVALID;(O.status==="dirty"||$.status==="dirty")&&h.dirty(),R.set(O.value,$.value)}return{status:h.value,value:R}})}else{const R=new Map;for(const U of D){const O=U.key,$=U.value;if(O.status==="aborted"||$.status==="aborted")return a.INVALID;(O.status==="dirty"||$.status==="dirty")&&h.dirty(),R.set(O.value,$.value)}return{status:h.value,value:R}}}}E.ZodMap=Mr,Mr.create=(y,o,h)=>new Mr({valueType:o,keyType:y,typeName:L.ZodMap,...p(h)});class rt extends g{_parse(o){const{status:h,ctx:_}=this._processInputParams(o);if(_.parsedType!==c.ZodParsedType.set)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:_.parsedType}),a.INVALID;const v=this._def;v.minSize!==null&&_.data.size<v.minSize.value&&((0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),h.dirty()),v.maxSize!==null&&_.data.size>v.maxSize.value&&((0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),h.dirty());const b=this._def.valueType;function D(U){const O=new Set;for(const $ of U){if($.status==="aborted")return a.INVALID;$.status==="dirty"&&h.dirty(),O.add($.value)}return{status:h.value,value:O}}const R=[..._.data.values()].map((U,O)=>b._parse(new d(_,U,_.path,O)));return _.common.async?Promise.all(R).then(U=>D(U)):D(R)}min(o,h){return new rt({...this._def,minSize:{value:o,message:s.errorUtil.toString(h)}})}max(o,h){return new rt({...this._def,maxSize:{value:o,message:s.errorUtil.toString(h)}})}size(o,h){return this.min(o,h).max(o,h)}nonempty(o){return this.min(1,o)}}E.ZodSet=rt,rt.create=(y,o)=>new rt({valueType:y,minSize:null,maxSize:null,typeName:L.ZodSet,...p(o)});class Et extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(o){const{ctx:h}=this._processInputParams(o);if(h.parsedType!==c.ZodParsedType.function)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:h.parsedType}),a.INVALID;function _(R,U){return(0,a.makeIssue)({data:R,path:h.path,errorMaps:[h.common.contextualErrorMap,h.schemaErrorMap,(0,i.getErrorMap)(),i.defaultErrorMap].filter(O=>!!O),issueData:{code:u.ZodIssueCode.invalid_arguments,argumentsError:U}})}function v(R,U){return(0,a.makeIssue)({data:R,path:h.path,errorMaps:[h.common.contextualErrorMap,h.schemaErrorMap,(0,i.getErrorMap)(),i.defaultErrorMap].filter(O=>!!O),issueData:{code:u.ZodIssueCode.invalid_return_type,returnTypeError:U}})}const b={errorMap:h.common.contextualErrorMap},D=h.data;if(this._def.returns instanceof St){const R=this;return(0,a.OK)(async function(...U){const O=new u.ZodError([]),$=await R._def.args.parseAsync(U,b).catch(Mn=>{throw O.addIssue(_(U,Mn)),O}),ie=await Reflect.apply(D,this,$);return await R._def.returns._def.type.parseAsync(ie,b).catch(Mn=>{throw O.addIssue(v(ie,Mn)),O})})}else{const R=this;return(0,a.OK)(function(...U){const O=R._def.args.safeParse(U,b);if(!O.success)throw new u.ZodError([_(U,O.error)]);const $=Reflect.apply(D,this,O.data),ie=R._def.returns.safeParse($,b);if(!ie.success)throw new u.ZodError([v($,ie.error)]);return ie.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...o){return new Et({...this._def,args:Te.create(o).rest(tt.create())})}returns(o){return new Et({...this._def,returns:o})}implement(o){return this.parse(o)}strictImplement(o){return this.parse(o)}static create(o,h,_){return new Et({args:o||Te.create([]).rest(tt.create()),returns:h||tt.create(),typeName:L.ZodFunction,...p(_)})}}E.ZodFunction=Et;class tr extends g{get schema(){return this._def.getter()}_parse(o){const{ctx:h}=this._processInputParams(o);return this._def.getter()._parse({data:h.data,path:h.path,parent:h})}}E.ZodLazy=tr,tr.create=(y,o)=>new tr({getter:y,typeName:L.ZodLazy,...p(o)});class rr extends g{_parse(o){if(o.data!==this._def.value){const h=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(h,{received:h.data,code:u.ZodIssueCode.invalid_literal,expected:this._def.value}),a.INVALID}return{status:"valid",value:o.data}}get value(){return this._def.value}}E.ZodLiteral=rr,rr.create=(y,o)=>new rr({value:y,typeName:L.ZodLiteral,...p(o)});function _s(y,o){return new qe({values:y,typeName:L.ZodEnum,...p(o)})}class qe extends g{constructor(){super(...arguments),r.set(this,void 0)}_parse(o){if(typeof o.data!="string"){const h=this._getOrReturnCtx(o),_=this._def.values;return(0,a.addIssueToContext)(h,{expected:c.util.joinValues(_),received:h.parsedType,code:u.ZodIssueCode.invalid_type}),a.INVALID}if(e(this,r,"f")||t(this,r,new Set(this._def.values),"f"),!e(this,r,"f").has(o.data)){const h=this._getOrReturnCtx(o),_=this._def.values;return(0,a.addIssueToContext)(h,{received:h.data,code:u.ZodIssueCode.invalid_enum_value,options:_}),a.INVALID}return(0,a.OK)(o.data)}get options(){return this._def.values}get enum(){const o={};for(const h of this._def.values)o[h]=h;return o}get Values(){const o={};for(const h of this._def.values)o[h]=h;return o}get Enum(){const o={};for(const h of this._def.values)o[h]=h;return o}extract(o,h=this._def){return qe.create(o,{...this._def,...h})}exclude(o,h=this._def){return qe.create(this.options.filter(_=>!o.includes(_)),{...this._def,...h})}}E.ZodEnum=qe,r=new WeakMap,qe.create=_s;class nr extends g{constructor(){super(...arguments),n.set(this,void 0)}_parse(o){const h=c.util.getValidEnumValues(this._def.values),_=this._getOrReturnCtx(o);if(_.parsedType!==c.ZodParsedType.string&&_.parsedType!==c.ZodParsedType.number){const v=c.util.objectValues(h);return(0,a.addIssueToContext)(_,{expected:c.util.joinValues(v),received:_.parsedType,code:u.ZodIssueCode.invalid_type}),a.INVALID}if(e(this,n,"f")||t(this,n,new Set(c.util.getValidEnumValues(this._def.values)),"f"),!e(this,n,"f").has(o.data)){const v=c.util.objectValues(h);return(0,a.addIssueToContext)(_,{received:_.data,code:u.ZodIssueCode.invalid_enum_value,options:v}),a.INVALID}return(0,a.OK)(o.data)}get enum(){return this._def.values}}E.ZodNativeEnum=nr,n=new WeakMap,nr.create=(y,o)=>new nr({values:y,typeName:L.ZodNativeEnum,...p(o)});class St extends g{unwrap(){return this._def.type}_parse(o){const{ctx:h}=this._processInputParams(o);if(h.parsedType!==c.ZodParsedType.promise&&h.common.async===!1)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:h.parsedType}),a.INVALID;const _=h.parsedType===c.ZodParsedType.promise?h.data:Promise.resolve(h.data);return(0,a.OK)(_.then(v=>this._def.type.parseAsync(v,{path:h.path,errorMap:h.common.contextualErrorMap})))}}E.ZodPromise=St,St.create=(y,o)=>new St({type:y,typeName:L.ZodPromise,...p(o)});class ve extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(o){const{status:h,ctx:_}=this._processInputParams(o),v=this._def.effect||null,b={addIssue:D=>{(0,a.addIssueToContext)(_,D),D.fatal?h.abort():h.dirty()},get path(){return _.path}};if(b.addIssue=b.addIssue.bind(b),v.type==="preprocess"){const D=v.transform(_.data,b);if(_.common.async)return Promise.resolve(D).then(async R=>{if(h.value==="aborted")return a.INVALID;const U=await this._def.schema._parseAsync({data:R,path:_.path,parent:_});return U.status==="aborted"?a.INVALID:U.status==="dirty"||h.value==="dirty"?(0,a.DIRTY)(U.value):U});{if(h.value==="aborted")return a.INVALID;const R=this._def.schema._parseSync({data:D,path:_.path,parent:_});return R.status==="aborted"?a.INVALID:R.status==="dirty"||h.value==="dirty"?(0,a.DIRTY)(R.value):R}}if(v.type==="refinement"){const D=R=>{const U=v.refinement(R,b);if(_.common.async)return Promise.resolve(U);if(U instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return R};if(_.common.async===!1){const R=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});return R.status==="aborted"?a.INVALID:(R.status==="dirty"&&h.dirty(),D(R.value),{status:h.value,value:R.value})}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then(R=>R.status==="aborted"?a.INVALID:(R.status==="dirty"&&h.dirty(),D(R.value).then(()=>({status:h.value,value:R.value}))))}if(v.type==="transform")if(_.common.async===!1){const D=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});if(!(0,a.isValid)(D))return D;const R=v.transform(D.value,b);if(R instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:h.value,value:R}}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then(D=>(0,a.isValid)(D)?Promise.resolve(v.transform(D.value,b)).then(R=>({status:h.value,value:R})):D);c.util.assertNever(v)}}E.ZodEffects=ve,E.ZodTransformer=ve,ve.create=(y,o,h)=>new ve({schema:y,typeName:L.ZodEffects,effect:o,...p(h)}),ve.createWithPreprocess=(y,o,h)=>new ve({schema:o,effect:{type:"preprocess",transform:y},typeName:L.ZodEffects,...p(h)});class Ie extends g{_parse(o){return this._getType(o)===c.ZodParsedType.undefined?(0,a.OK)(void 0):this._def.innerType._parse(o)}unwrap(){return this._def.innerType}}E.ZodOptional=Ie,Ie.create=(y,o)=>new Ie({innerType:y,typeName:L.ZodOptional,...p(o)});class Ge extends g{_parse(o){return this._getType(o)===c.ZodParsedType.null?(0,a.OK)(null):this._def.innerType._parse(o)}unwrap(){return this._def.innerType}}E.ZodNullable=Ge,Ge.create=(y,o)=>new Ge({innerType:y,typeName:L.ZodNullable,...p(o)});class ir extends g{_parse(o){const{ctx:h}=this._processInputParams(o);let _=h.data;return h.parsedType===c.ZodParsedType.undefined&&(_=this._def.defaultValue()),this._def.innerType._parse({data:_,path:h.path,parent:h})}removeDefault(){return this._def.innerType}}E.ZodDefault=ir,ir.create=(y,o)=>new ir({innerType:y,typeName:L.ZodDefault,defaultValue:typeof o.default=="function"?o.default:()=>o.default,...p(o)});class sr extends g{_parse(o){const{ctx:h}=this._processInputParams(o),_={...h,common:{...h.common,issues:[]}},v=this._def.innerType._parse({data:_.data,path:_.path,parent:{..._}});return(0,a.isAsync)(v)?v.then(b=>({status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new u.ZodError(_.common.issues)},input:_.data})})):{status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new u.ZodError(_.common.issues)},input:_.data})}}removeCatch(){return this._def.innerType}}E.ZodCatch=sr,sr.create=(y,o)=>new sr({innerType:y,typeName:L.ZodCatch,catchValue:typeof o.catch=="function"?o.catch:()=>o.catch,...p(o)});class Vr extends g{_parse(o){if(this._getType(o)!==c.ZodParsedType.nan){const _=this._getOrReturnCtx(o);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:_.parsedType}),a.INVALID}return{status:"valid",value:o.data}}}E.ZodNaN=Vr,Vr.create=y=>new Vr({typeName:L.ZodNaN,...p(y)}),E.BRAND=Symbol("zod_brand");class Bn extends g{_parse(o){const{ctx:h}=this._processInputParams(o),_=h.data;return this._def.type._parse({data:_,path:h.path,parent:h})}unwrap(){return this._def.type}}E.ZodBranded=Bn;class ar extends g{_parse(o){const{status:h,ctx:_}=this._processInputParams(o);if(_.common.async)return(async()=>{const b=await this._def.in._parseAsync({data:_.data,path:_.path,parent:_});return b.status==="aborted"?a.INVALID:b.status==="dirty"?(h.dirty(),(0,a.DIRTY)(b.value)):this._def.out._parseAsync({data:b.value,path:_.path,parent:_})})();{const v=this._def.in._parseSync({data:_.data,path:_.path,parent:_});return v.status==="aborted"?a.INVALID:v.status==="dirty"?(h.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:_.path,parent:_})}}static create(o,h){return new ar({in:o,out:h,typeName:L.ZodPipeline})}}E.ZodPipeline=ar;class or extends g{_parse(o){const h=this._def.innerType._parse(o),_=v=>((0,a.isValid)(v)&&(v.value=Object.freeze(v.value)),v);return(0,a.isAsync)(h)?h.then(v=>_(v)):_(h)}unwrap(){return this._def.innerType}}E.ZodReadonly=or,or.create=(y,o)=>new or({innerType:y,typeName:L.ZodReadonly,...p(o)});function gs(y,o){const h=typeof y=="function"?y(o):typeof y=="string"?{message:y}:y;return typeof h=="string"?{message:h}:h}function ys(y,o={},h){return y?bt.create().superRefine((_,v)=>{var b,D;const R=y(_);if(R instanceof Promise)return R.then(U=>{var O,$;if(!U){const ie=gs(o,_),zr=($=(O=ie.fatal)!==null&&O!==void 0?O:h)!==null&&$!==void 0?$:!0;v.addIssue({code:"custom",...ie,fatal:zr})}});if(!R){const U=gs(o,_),O=(D=(b=U.fatal)!==null&&b!==void 0?b:h)!==null&&D!==void 0?D:!0;v.addIssue({code:"custom",...U,fatal:O})}}):bt.create()}E.custom=ys,E.late={object:W.lazycreate};var L;(function(y){y.ZodString="ZodString",y.ZodNumber="ZodNumber",y.ZodNaN="ZodNaN",y.ZodBigInt="ZodBigInt",y.ZodBoolean="ZodBoolean",y.ZodDate="ZodDate",y.ZodSymbol="ZodSymbol",y.ZodUndefined="ZodUndefined",y.ZodNull="ZodNull",y.ZodAny="ZodAny",y.ZodUnknown="ZodUnknown",y.ZodNever="ZodNever",y.ZodVoid="ZodVoid",y.ZodArray="ZodArray",y.ZodObject="ZodObject",y.ZodUnion="ZodUnion",y.ZodDiscriminatedUnion="ZodDiscriminatedUnion",y.ZodIntersection="ZodIntersection",y.ZodTuple="ZodTuple",y.ZodRecord="ZodRecord",y.ZodMap="ZodMap",y.ZodSet="ZodSet",y.ZodFunction="ZodFunction",y.ZodLazy="ZodLazy",y.ZodLiteral="ZodLiteral",y.ZodEnum="ZodEnum",y.ZodEffects="ZodEffects",y.ZodNativeEnum="ZodNativeEnum",y.ZodOptional="ZodOptional",y.ZodNullable="ZodNullable",y.ZodDefault="ZodDefault",y.ZodCatch="ZodCatch",y.ZodPromise="ZodPromise",y.ZodBranded="ZodBranded",y.ZodPipeline="ZodPipeline",y.ZodReadonly="ZodReadonly"})(L||(E.ZodFirstPartyTypeKind=L={}));const mu=(y,o={message:`Input not instance of ${y.name}`})=>ys(h=>h instanceof y,o);E.instanceof=mu;const vs=ge.create;E.string=vs;const bs=Ve.create;E.number=bs;const _u=Vr.create;E.nan=_u;const gu=ze.create;E.bigint=gu;const xs=Wt.create;E.boolean=xs;const yu=et.create;E.date=yu;const vu=$r.create;E.symbol=vu;const bu=Kt.create;E.undefined=bu;const xu=Xt.create;E.null=xu;const Eu=bt.create;E.any=Eu;const Su=tt.create;E.unknown=Su;const wu=ke.create;E.never=wu;const Tu=Lr.create;E.void=Tu;const Iu=ye.create;E.array=Iu;const ju=W.create;E.object=ju;const Ru=W.strictCreate;E.strictObject=Ru;const Cu=Jt.create;E.union=Cu;const Du=Br.create;E.discriminatedUnion=Du;const Nu=Qt.create;E.intersection=Nu;const ku=Te.create;E.tuple=ku;const Pu=er.create;E.record=Pu;const Au=Mr.create;E.map=Au;const Ou=rt.create;E.set=Ou;const Uu=Et.create;E.function=Uu;const Zu=tr.create;E.lazy=Zu;const $u=rr.create;E.literal=$u;const Lu=qe.create;E.enum=Lu;const Bu=nr.create;E.nativeEnum=Bu;const Mu=St.create;E.promise=Mu;const Es=ve.create;E.effect=Es,E.transformer=Es;const Vu=Ie.create;E.optional=Vu;const zu=Ge.create;E.nullable=zu;const qu=ve.createWithPreprocess;E.preprocess=qu;const Gu=ar.create;E.pipeline=Gu;const Yu=()=>vs().optional();E.ostring=Yu;const Fu=()=>bs().optional();E.onumber=Fu;const Hu=()=>xs().optional();return E.oboolean=Hu,E.coerce={string:y=>ge.create({...y,coerce:!0}),number:y=>Ve.create({...y,coerce:!0}),boolean:y=>Wt.create({...y,coerce:!0}),bigint:y=>ze.create({...y,coerce:!0}),date:y=>et.create({...y,coerce:!0})},E.NEVER=a.INVALID,E}var qs;function Gs(){return qs||(qs=1,function(e){var t=ot&&ot.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=ot&&ot.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Zi(),e),r(So(),e),r(Rd(),e),r(In(),e),r(Dd(),e),r(Ui(),e)}(ot)),ot}var Ys;function $i(){return Ys||(Ys=1,function(e){var t=be&&be.__createBinding||(Object.create?function(a,c,u,d){d===void 0&&(d=u);var l=Object.getOwnPropertyDescriptor(c,u);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(a,d,l)}:function(a,c,u,d){d===void 0&&(d=u),a[d]=c[u]}),r=be&&be.__setModuleDefault||(Object.create?function(a,c){Object.defineProperty(a,"default",{enumerable:!0,value:c})}:function(a,c){a.default=c}),n=be&&be.__importStar||function(a){if(a&&a.__esModule)return a;var c={};if(a!=null)for(var u in a)u!=="default"&&Object.prototype.hasOwnProperty.call(a,u)&&t(c,a,u);return r(c,a),c},i=be&&be.__exportStar||function(a,c){for(var u in a)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&t(c,a,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const s=n(Gs());e.z=s,i(Gs(),e),e.default=s}(be)),be}var ct={},Fs;function Cr(){if(Fs)return ct;Fs=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.InvalidDidError=ct.DidError=void 0;class e extends Error{constructor(n,i,s,a=400,c){super(i,{cause:c}),Object.defineProperty(this,"did",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:a})}get statusCode(){return this.status}toString(){return`${this.constructor.name} ${this.code} (${this.did}): ${this.message}`}static from(n,i){if(n instanceof e)return n;const s=n instanceof Error?n.message:typeof n=="string"?n:"An unknown error occurred",a=(typeof(n==null?void 0:n.statusCode)=="number"?n.statusCode:void 0)??(typeof(n==null?void 0:n.status)=="number"?n.status:void 0);return new e(i,s,"did-unknown-error",a,n)}}ct.DidError=e;class t extends e{constructor(n,i,s){super(n,i,"did-invalid",400,s)}}return ct.InvalidDidError=t,ct}var ut={},Hs;function Li(){var r;if(Hs)return ut;Hs=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.canParse=void 0,ut.isFragment=e,ut.isHexDigit=t;function e(n,i=0,s=n.length){let a;for(let c=i;c<s;c++)if(a=n.charCodeAt(c),!(a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||a===45||a===46||a===95||a===126)){if(!(a===33||a===36||a===38||a===39||a===40||a===41||a===42||a===43||a===44||a===59||a===61)){if(!(a===58||a===64)){if(!(a===47||a===63))if(a===37){if(c+2>=s||!t(n.charCodeAt(c+1))||!t(n.charCodeAt(c+2)))return!1;c+=2}else return!1}}}return!0}function t(n){return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}return ut.canParse=((r=URL.canParse)==null?void 0:r.bind(URL))??((n,i)=>{try{return new URL(n,i),!0}catch{return!1}}),ut}var dt={},Ye={},Ws;function Nd(){if(Ws)return Ye;Ws=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.DID_PLC_PREFIX=void 0,Ye.isDidPlc=i,Ye.asDidPlc=s,Ye.assertDidPlc=a;const e=Cr(),t="did:plc:";Ye.DID_PLC_PREFIX=t;const r=t.length,n=32;function i(u){if(typeof u!="string"||u.length!==n||!u.startsWith(t))return!1;for(let d=r;d<n;d++)if(!c(u.charCodeAt(d)))return!1;return!0}function s(u){return a(u),u}function a(u){if(typeof u!="string")throw new e.InvalidDidError(typeof u,"DID must be a string");if(!u.startsWith(t))throw new e.InvalidDidError(u,"Invalid did:plc prefix");if(u.length!==n)throw new e.InvalidDidError(u,`did:plc must be ${n} characters long`);for(let d=r;d<n;d++)if(!c(u.charCodeAt(d)))throw new e.InvalidDidError(u,`Invalid character at position ${d}`)}const c=u=>u>=97&&u<=122||u>=50&&u<=55;return Ye}var Xn={},de={},Ks;function Bi(){if(Ks)return de;Ks=1,Object.defineProperty(de,"__esModule",{value:!0}),de.didSchema=de.DID_PREFIX=void 0,de.assertDidMethod=i,de.extractDidMethod=s,de.assertDidMsid=a,de.assertDid=c,de.isDid=u,de.asDid=d;const e=$i(),t=Cr(),r="did:";de.DID_PREFIX=r;const n=r.length;function i(l,p=0,g=l.length){if(!Number.isFinite(g)||!Number.isFinite(p)||g<p||g>l.length)throw new TypeError("Invalid start or end position");if(g===p)throw new t.InvalidDidError(l,"Empty method name");let m;for(let x=p;x<g;x++)if(m=l.charCodeAt(x),(m<97||m>122)&&(m<48||m>57))throw new t.InvalidDidError(l,`Invalid character at position ${x} in DID method name`)}function s(l){const p=l.indexOf(":",n);return l.slice(n,p)}function a(l,p=0,g=l.length){if(!Number.isFinite(g)||!Number.isFinite(p)||g<p||g>l.length)throw new TypeError("Invalid start or end position");if(g===p)throw new t.InvalidDidError(l,"DID method-specific id must not be empty");let m;for(let x=p;x<g;x++)if(m=l.charCodeAt(x),(m<97||m>122)&&(m<65||m>90)&&(m<48||m>57)&&m!==46&&m!==45&&m!==95){if(m===58){if(x===g-1)throw new t.InvalidDidError(l,'DID cannot end with ":"');continue}if(m===37){if(m=l.charCodeAt(++x),(m<48||m>57)&&(m<65||m>70))throw new t.InvalidDidError(l,`Invalid pct-encoded character at position ${x}`);if(m=l.charCodeAt(++x),(m<48||m>57)&&(m<65||m>70))throw new t.InvalidDidError(l,`Invalid pct-encoded character at position ${x}`);if(x>=g)throw new t.InvalidDidError(l,`Incomplete pct-encoded character at position ${x-2}`);continue}throw new t.InvalidDidError(l,`Disallowed character in DID at position ${x}`)}}function c(l){if(typeof l!="string")throw new t.InvalidDidError(typeof l,"DID must be a string");const{length:p}=l;if(p>2048)throw new t.InvalidDidError(l,"DID is too long (2048 chars max)");if(!l.startsWith(r))throw new t.InvalidDidError(l,`DID requires "${r}" prefix`);const g=l.indexOf(":",n);if(g===-1)throw new t.InvalidDidError(l,"Missing colon after method name");i(l,n,g),a(l,g+1,p)}function u(l){try{return c(l),!0}catch(p){if(p instanceof t.DidError)return!1;throw p}}function d(l){return c(l),l}return de.didSchema=e.z.string().superRefine((l,p)=>{try{return c(l),!0}catch(g){return p.addIssue({code:e.z.ZodIssueCode.custom,message:g instanceof Error?g.message:"Unexpected error"}),!1}}),de}var Xs;function kd(){return Xs||(Xs=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_WEB_PREFIX=void 0,e.isDidWeb=i,e.asDidWeb=s,e.assertDidWeb=a,e.didWebToUrl=c,e.urlToDidWeb=u,e.buildDidWebUrl=d;const t=Cr(),r=Bi(),n=Li();e.DID_WEB_PREFIX="did:web:";function i(l){if(typeof l!="string"||!l.startsWith(e.DID_WEB_PREFIX)||l.charAt(e.DID_WEB_PREFIX.length)===":")return!1;try{(0,r.assertDidMsid)(l,e.DID_WEB_PREFIX.length)}catch{return!1}return(0,n.canParse)(d(l))}function s(l){return a(l),l}function a(l){if(typeof l!="string")throw new t.InvalidDidError(typeof l,"DID must be a string");if(!l.startsWith(e.DID_WEB_PREFIX))throw new t.InvalidDidError(l,"Invalid did:web prefix");if(l.charAt(e.DID_WEB_PREFIX.length)===":")throw new t.InvalidDidError(l,"did:web MSID must not start with a colon");if((0,r.assertDidMsid)(l,e.DID_WEB_PREFIX.length),!(0,n.canParse)(d(l)))throw new t.InvalidDidError(l,"Invalid Web DID")}function c(l){try{return new URL(d(l))}catch(p){throw new t.InvalidDidError(l,"Invalid Web DID",p)}}function u(l){const p=l.port?`%3A${l.port}`:"",g=l.pathname==="/"?"":l.pathname.replaceAll("/",":");return`did:web:${l.hostname}${p}${g}`}function d(l){const p=e.DID_WEB_PREFIX.length,g=l.indexOf(":",p),x=(g===-1?l.slice(p):l.slice(p,g)).replaceAll("%3A",":"),w=g===-1?"":l.slice(g).replaceAll(":","/");return`${x.startsWith("localhost")&&(x.length===9||x.charCodeAt(9)===58)?"http":"https"}://${x}${w}`}}(Xn)),Xn}var Js;function wo(){return Js||(Js=1,function(e){var t=dt&&dt.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=dt&&dt.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Nd(),e),r(kd(),e)}(dt)),dt}var Gr={},Qs;function To(){if(Qs)return Gr;Qs=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.matchesIdentifier=e;function e(t,r,n){return n.charCodeAt(0)===35?n.length===r.length+1&&n.endsWith(r):n.length===r.length+1+t.length&&n.charCodeAt(t.length)===35&&n.startsWith(t)&&n.endsWith(r)}return Gr}var ea;function Pd(){return ea||(ea=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ATPROTO_VERIFICATION_METHOD_TYPES=e.isAtprotoAudience=e.atprotoDidSchema=void 0,e.isAtprotoDid=a,e.asAtprotoDid=c,e.assertAtprotoDid=u,e.assertAtprotoDidWeb=d,e.isAtprotoDidWeb=l,e.extractAtprotoData=w,e.extractPdsUrl=I,e.isAtprotoAka=N,e.isAtprotoPersonalDataServerService=P,e.isAtprotoVerificationMethod=A;const t=$i(),r=Cr(),n=Li(),i=wo(),s=To();e.atprotoDidSchema=t.z.string().refine(a,'Atproto only allows "plc" and "web" DID methods');function a(j){return(0,i.isDidPlc)(j)||l(j)}function c(j){return u(j),j}function u(j){if(typeof j!="string")throw new r.InvalidDidError(typeof j,"DID must be a string");if(j.startsWith(i.DID_PLC_PREFIX))(0,i.assertDidPlc)(j);else if(j.startsWith(i.DID_WEB_PREFIX))d(j);else throw new r.InvalidDidError(j,'Atproto only allows "plc" and "web" DID methods')}function d(j){if((0,i.assertDidWeb)(j),p(j))throw new r.InvalidDidError(j,"Atproto does not allow path components in Web DIDs");if(m(j))throw new r.InvalidDidError(j,"Atproto does not allow port numbers in Web DIDs, except for localhost")}function l(j){return!(!(0,i.isDidWeb)(j)||p(j)||m(j))}function p(j){return j.includes(":",i.DID_WEB_PREFIX.length)}function g(j){return j==="did:web:localhost"||j.startsWith("did:web:localhost:")||j.startsWith("did:web:localhost%3A")}function m(j){if(g(j))return!1;const Z=j.indexOf(":",i.DID_WEB_PREFIX.length);return Z===-1?j.includes("%3A",i.DID_WEB_PREFIX.length):j.lastIndexOf("%3A",Z)!==-1}const x=j=>{if(typeof j!="string")return!1;const Z=j.indexOf("#");return Z===-1||j.indexOf("#",Z+1)!==-1?!1:(0,n.isFragment)(j,Z+1)&&a(j.slice(0,Z))};e.isAtprotoAudience=x;function w(j){var Z,B,M,K;return{did:j.id,aka:(B=(Z=j.alsoKnownAs)==null?void 0:Z.find(N))==null?void 0:B.slice(5),key:(M=j.verificationMethod)==null?void 0:M.find(A,j),pds:(K=j.service)==null?void 0:K.find(P,j)}}function I(j){var B;const Z=(B=j.service)==null?void 0:B.find(P,j);if(!Z)throw new r.DidError(j.id,`Document ${j.id} does not contain a (valid) #atproto_pds service URL`,"did-service-not-found");return new URL(Z.serviceEndpoint)}function N(j){return j.startsWith("at://")}function P(j){return(j==null?void 0:j.type)==="AtprotoPersonalDataServer"&&typeof j.serviceEndpoint=="string"&&(0,n.canParse)(j.serviceEndpoint)&&(0,s.matchesIdentifier)(this.id,"atproto_pds",j.id)}e.ATPROTO_VERIFICATION_METHOD_TYPES=Object.freeze(["EcdsaSecp256r1VerificationKey2019","EcdsaSecp256k1VerificationKey2019","Multikey"]);function A(j){return typeof j=="object"&&typeof(j==null?void 0:j.publicKeyMultibase)=="string"&&e.ATPROTO_VERIFICATION_METHOD_TYPES.includes(j.type)&&(0,s.matchesIdentifier)(this.id,"atproto",j.id)}}(Hn)),Hn}var Jn={},ta;function Ad(){return ta||(ta=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.didDocumentValidator=e.didDocumentSchema=void 0;const t=$i(),r=Bi(),n=Li(),i=t.z.string().url("RFC3968 compliant URI"),s=t.z.union([r.didSchema,t.z.array(r.didSchema)]),a=t.z.union([i.refine(m=>{const x=m.indexOf("#");return x===-1?!1:(0,n.isFragment)(m,x+1)},{message:"Missing or invalid fragment in RFC3968 URI"}),t.z.string().refine(m=>m.charCodeAt(0)===35,{message:"Fragment must start with #"}).refine(m=>(0,n.isFragment)(m,1),{message:"Invalid char in URI fragment"})]),c=t.z.object({id:a,type:t.z.string().min(1),controller:s,publicKeyJwk:t.z.record(t.z.string(),t.z.unknown()).optional(),publicKeyMultibase:t.z.string().optional()}),u=a,d=t.z.union([t.z.string(),t.z.array(t.z.string())]),l=t.z.union([i,t.z.record(t.z.string(),i),t.z.array(t.z.union([i,t.z.record(t.z.string(),i)])).nonempty()]),p=t.z.object({id:u,type:d,serviceEndpoint:l}),g=t.z.union([a,c]);e.didDocumentSchema=t.z.object({"@context":t.z.union([t.z.literal("https://www.w3.org/ns/did/v1"),t.z.array(t.z.string().url()).nonempty().refine(m=>m[0]==="https://www.w3.org/ns/did/v1",{message:"First @context must be https://www.w3.org/ns/did/v1"})]).optional(),id:r.didSchema,controller:s.optional(),alsoKnownAs:t.z.array(i).optional(),service:t.z.array(p).optional(),authentication:t.z.array(g).optional(),verificationMethod:t.z.array(c).optional()}),e.didDocumentValidator=e.didDocumentSchema.superRefine(({id:m,service:x},w)=>{if(x){const I=new Set;for(let N=0;N<x.length;N++){const P=x[N],A=P.id.startsWith("#")?`${m}${P.id}`:P.id;I.has(A)?w.addIssue({code:t.z.ZodIssueCode.custom,message:`Duplicate service id (${P.id}) found in the document`,path:["service",N,"id"]}):I.add(A)}}})}(Jn)),Jn}var ra;function Io(){return ra||(ra=1,function(e){var t=at&&at.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=at&&at.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Pd(),e),r(Ad(),e),r(Cr(),e),r(Bi(),e),r(wo(),e),r(To(),e)}(at)),at}var hr={},Qn={},fi=function(e,t){return fi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},fi(e,t)};function jo(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fi(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var mn=function(){return mn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},mn.apply(this,arguments)};function Ro(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Co(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(i<3?a(s):i>3?a(t,r,s):a(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function Do(e,t){return function(r,n){t(r,n,e)}}function No(e,t,r,n,i,s){function a(N){if(N!==void 0&&typeof N!="function")throw new TypeError("Function expected");return N}for(var c=n.kind,u=c==="getter"?"get":c==="setter"?"set":"value",d=!t&&e?n.static?e:e.prototype:null,l=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),p,g=!1,m=r.length-1;m>=0;m--){var x={};for(var w in n)x[w]=w==="access"?{}:n[w];for(var w in n.access)x.access[w]=n.access[w];x.addInitializer=function(N){if(g)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(N||null))};var I=(0,r[m])(c==="accessor"?{get:l.get,set:l.set}:l[u],x);if(c==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(p=a(I.get))&&(l.get=p),(p=a(I.set))&&(l.set=p),(p=a(I.init))&&i.unshift(p)}else(p=a(I))&&(c==="field"?i.unshift(p):l[u]=p)}d&&Object.defineProperty(d,n.name,l),g=!0}function ko(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function Po(e){return typeof e=="symbol"?e:"".concat(e)}function Ao(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function Oo(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Uo(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function c(l){try{d(n.next(l))}catch(p){a(p)}}function u(l){try{d(n.throw(l))}catch(p){a(p)}}function d(l){l.done?s(l.value):i(l.value).then(c,u)}d((n=n.apply(e,t||[])).next())})}function Zo(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(d){return function(l){return u([d,l])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(r=0)),r;)try{if(n=1,i&&(s=d[0]&2?i.return:d[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,d[1])).done)return s;switch(i=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,i=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(l){d=[6,l],i=0}finally{n=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}var jn=Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function $o(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&jn(t,e,r)}function _n(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function Lo(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Mi(arguments[t]));return e}function Bo(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],a=0,c=s.length;a<c;a++,i++)n[i]=s[a];return n}function Mo(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}function Ot(e){return this instanceof Ot?(this.v=e,this):new Ot(e)}function Vo(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(m){return function(x){return Promise.resolve(x).then(m,p)}}function c(m,x){n[m]&&(i[m]=function(w){return new Promise(function(I,N){s.push([m,w,I,N])>1||u(m,w)})},x&&(i[m]=x(i[m])))}function u(m,x){try{d(n[m](x))}catch(w){g(s[0][3],w)}}function d(m){m.value instanceof Ot?Promise.resolve(m.value.v).then(l,p):g(s[0][2],m)}function l(m){u("next",m)}function p(m){u("throw",m)}function g(m,x){m(x),s.shift(),s.length&&u(s[0][0],s[0][1])}}function zo(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(a){return(r=!r)?{value:Ot(e[i](a)),done:!1}:s?s(a):a}:s}}function qo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof _n=="function"?_n(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(a){return new Promise(function(c,u){a=e[s](a),i(c,u,a.done,a.value)})}}function i(s,a,c,u){Promise.resolve(u).then(function(d){s({value:d,done:c})},a)}}function Go(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Od=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},hi=function(e){return hi=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},hi(e)};function Yo(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=hi(e),n=0;n<r.length;n++)r[n]!=="default"&&jn(t,e,r[n]);return Od(t,e),t}function Fo(e){return e&&e.__esModule?e:{default:e}}function Ho(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Wo(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function Ko(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Xo(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var Ud=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function Jo(e){function t(s){e.error=e.hasError?new Ud(s,e.error,"An error was suppressed during disposal."):s,e.hasError=!0}var r,n=0;function i(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(a){return t(a),i()})}else n|=1}catch(a){t(a)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return i()}function Qo(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,s,a){return n?t?".jsx":".js":i&&(!s||!a)?r:i+s+"."+a.toLowerCase()+"js"}):e}const Zd={__extends:jo,__assign:mn,__rest:Ro,__decorate:Co,__param:Do,__esDecorate:No,__runInitializers:ko,__propKey:Po,__setFunctionName:Ao,__metadata:Oo,__awaiter:Uo,__generator:Zo,__createBinding:jn,__exportStar:$o,__values:_n,__read:Mi,__spread:Lo,__spreadArrays:Bo,__spreadArray:Mo,__await:Ot,__asyncGenerator:Vo,__asyncDelegator:zo,__asyncValues:qo,__makeTemplateObject:Go,__importStar:Yo,__importDefault:Fo,__classPrivateFieldGet:Ho,__classPrivateFieldSet:Wo,__classPrivateFieldIn:Ko,__addDisposableResource:Xo,__disposeResources:Jo,__rewriteRelativeImportExtension:Qo},$d=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Xo,get __assign(){return mn},__asyncDelegator:zo,__asyncGenerator:Vo,__asyncValues:qo,__await:Ot,__awaiter:Uo,__classPrivateFieldGet:Ho,__classPrivateFieldIn:Ko,__classPrivateFieldSet:Wo,__createBinding:jn,__decorate:Co,__disposeResources:Jo,__esDecorate:No,__exportStar:$o,__extends:jo,__generator:Zo,__importDefault:Fo,__importStar:Yo,__makeTemplateObject:Go,__metadata:Oo,__param:Do,__propKey:Po,__read:Mi,__rest:Ro,__rewriteRelativeImportExtension:Qo,__runInitializers:ko,__setFunctionName:Ao,__spread:Lo,__spreadArray:Mo,__spreadArrays:Bo,__values:_n,default:Zd},Symbol.toStringTag,{value:"Module"})),ec=Qu($d);var pr={},Fe={},na;function Vi(){if(na)return Fe;na=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.InvalidDidError=void 0,Fe.ensureValidDid=e,Fe.ensureValidDidRegex=r,Fe.isValidDid=n;function e(s){if(!s.startsWith("did:"))throw new i('DID requires "did:" prefix');if(s.length>2048)throw new i("DID is too long (2048 chars max)");if(s.endsWith(":")||s.endsWith("%"))throw new i('DID can not end with ":" or "%"');if(!/^[a-zA-Z0-9._:%-]*$/.test(s))throw new i("Disallowed characters in DID (ASCII letters, digits, and a couple other characters only)");const{length:a,1:c}=s.split(":");if(a<3)throw new i("DID requires prefix, method, and method-specific content");if(!/^[a-z]+$/.test(c))throw new i("DID method must be lower-case letters")}const t=/^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/;function r(s){if(!t.test(s))throw new i("DID didn't validate via regex");if(s.length>2048)throw new i("DID is too long (2048 chars max)")}function n(s){return s.length<=2048&&t.test(s)}class i extends Error{}return Fe.InvalidDidError=i,Fe}var ei={},ia;function zi(){return ia||(ia=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DisallowedDomainError=e.UnsupportedDomainError=e.ReservedHandleError=e.InvalidHandleError=e.DISALLOWED_TLDS=e.INVALID_HANDLE=void 0,e.ensureValidHandle=t,e.ensureValidHandleRegex=n,e.normalizeHandle=i,e.normalizeAndEnsureValidHandle=s,e.isValidHandle=a,e.isValidTld=c,e.INVALID_HANDLE="handle.invalid",e.DISALLOWED_TLDS=[".local",".arpa",".invalid",".localhost",".internal",".example",".alt",".onion"];function t(g){if(!/^[a-zA-Z0-9.-]*$/.test(g))throw new u("Disallowed characters in handle (ASCII letters, digits, dashes, periods only)");if(g.length>253)throw new u("Handle is too long (253 chars max)");const m=g.split(".");if(m.length<2)throw new u("Handle domain needs at least two parts");for(let x=0;x<m.length;x++){const w=m[x];if(w.length<1)throw new u("Handle parts can not be empty");if(w.length>63)throw new u("Handle part too long (max 63 chars)");if(w.endsWith("-")||w.startsWith("-"))throw new u("Handle parts can not start or end with hyphens");if(x+1===m.length&&!/^[a-zA-Z]/.test(w))throw new u("Handle final component (TLD) must start with ASCII letter")}}const r=/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;function n(g){if(g.length>253)throw new u("Handle is too long (253 chars max)");if(!r.test(g))throw new u("Handle didn't validate via regex")}function i(g){return g.toLowerCase()}function s(g){const m=i(g);return t(m),m}function a(g){return g.length<=253&&r.test(g)}function c(g){for(const m of e.DISALLOWED_TLDS)if(g.endsWith(m))return!1;return!0}class u extends Error{}e.InvalidHandleError=u;class d extends Error{}e.ReservedHandleError=d;class l extends Error{}e.UnsupportedDomainError=l;class p extends Error{}e.DisallowedDomainError=p}(ei)),ei}var sa;function qi(){if(sa)return pr;sa=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.ensureValidAtIdentifier=r,pr.isValidAtIdentifier=n;const e=Vi(),t=zi();function r(i){try{i.startsWith("did:")?(0,e.ensureValidDidRegex)(i):(0,t.ensureValidHandleRegex)(i)}catch(s){throw new t.InvalidHandleError("Invalid DID or handle",{cause:s})}}function n(i){return i.startsWith("did:")?(0,e.isValidDid)(i):(0,t.isValidHandle)(i)}return pr}var ti={},le={},aa;function Gi(){if(aa)return le;aa=1,Object.defineProperty(le,"__esModule",{value:!0}),le.InvalidNsidError=le.NSID=void 0,le.ensureValidNsid=t,le.parseNsid=r,le.isValidNsid=n,le.validateNsid=i,le.ensureValidNsidRegex=l,le.validateNsidRegex=p;class e{constructor(x){wt(this,"segments");this.segments=r(x)}static parse(x){return new e(x)}static create(x,w){const I=[...x.split(".").reverse(),w].join(".");return new e(I)}static isValid(x){return n(x)}static from(x){return x instanceof e?x:Array.isArray(x)?new e(x.join(".")):new e(String(x))}get authority(){return this.segments.slice(0,this.segments.length-1).reverse().join(".")}get name(){return this.segments.at(this.segments.length-1)}toString(){return this.segments.join(".")}}le.NSID=e;function t(m){const x=i(m);if(!x.success)throw new g(x.message)}function r(m){const x=i(m);if(!x.success)throw new g(x.message);return x.value}function n(m){return p(m).success}function i(m){if(m.length>317)return{success:!1,message:"NSID is too long (317 chars max)"};if(s(m))return{success:!1,message:"Disallowed characters in NSID (ASCII letters, digits, dashes, periods only)"};const x=m.split(".");if(x.length<3)return{success:!1,message:"NSID needs at least three parts"};for(const w of x){if(w.length<1)return{success:!1,message:"NSID parts can not be empty"};if(w.length>63)return{success:!1,message:"NSID part too long (max 63 chars)"};if(c(w)||u(w))return{success:!1,message:"NSID parts can not start or end with hyphen"}}return a(x[0])?{success:!1,message:"NSID first part may not start with a digit"}:d(x[x.length-1])?{success:!0,value:x}:{success:!1,message:"NSID name part must be only letters and digits (and no leading digit)"}}function s(m){return!/^[a-zA-Z0-9.-]*$/.test(m)}function a(m){const x=m.charCodeAt(0);return x>=48&&x<=57}function c(m){return m.charCodeAt(0)===45}function u(m){return m.charCodeAt(m.length-1)===45}function d(m){return!a(m)&&!m.includes("-")}function l(m){const x=p(m);if(!x.success)throw new g(x.message)}function p(m){return m.length>317?{success:!1,message:"NSID is too long (317 chars max)"}:/^[a-zA-Z](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?:\.[a-zA-Z](?:[a-zA-Z0-9]{0,62})?)$/.test(m)?{success:!0,value:m}:{success:!1,message:"NSID didn't validate via regex"}}class g extends Error{}return le.InvalidNsidError=g,le}var jt={},oa;function Ld(){if(oa)return jt;oa=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.ensureValidAtUri=i,jt.ensureValidAtUriRegex=s,jt.isValidAtUri=a;const e=qi(),t=Vi(),r=zi(),n=Gi();function i(c){const u=c.indexOf("#");if(u!==-1){if(c.charCodeAt(u+1)!==47)throw new Error("ATURI fragment must be non-empty and start with slash");if(c.includes("#",u+1))throw new Error('ATURI can have at most one "#", separating fragment out');const I=c.slice(u+1);if(!/^\/[a-zA-Z0-9._~:@!$&')(*+,;=%[\]/-]*$/.test(I))throw new Error("Disallowed characters in ATURI fragment (ASCII)")}const d=u===-1?c:c.slice(0,u);if(d.length>8*1024)throw new Error("ATURI is far too long");if(!d.startsWith("at://"))throw new Error('ATURI must start with "at://"');if(!/^[a-zA-Z0-9._~:@!$&')(*+,;=%/-]*$/.test(d))throw new Error("Disallowed characters in ATURI (ASCII)");const l=d.indexOf("/",5),p=l===-1?d.slice(5):d.slice(5,l);try{(0,e.ensureValidAtIdentifier)(p)}catch(I){throw new Error("ATURI authority must be a valid handle or DID",{cause:I})}const g=l===-1?-1:l+1,m=g===-1?-1:d.indexOf("/",g);if(g!==-1){const I=m===-1?d.slice(g):d.slice(g,m);if(I.length===0)throw new Error("ATURI can not have a slash after authority without a path segment");if(!(0,n.isValidNsid)(I))throw new Error("ATURI requires first path segment (if supplied) to be valid NSID")}const x=m===-1?-1:m+1,w=x===-1?-1:d.indexOf("/",x);if(x!==-1&&x===d.length)throw new Error("ATURI can not have a slash after collection, unless record key is provided");if(w!==-1)throw new Error("ATURI path can have at most two parts, and no trailing slash")}function s(c){const u=/^at:\/\/(?<authority>[a-zA-Z0-9._:%-]+)(\/(?<collection>[a-zA-Z0-9-.]+)(\/(?<rkey>[a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(#(?<fragment>\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/,d=c.match(u);if(!d||!d.groups)throw new Error("ATURI didn't validate via regex");const l=d.groups;try{(0,r.ensureValidHandleRegex)(l.authority)}catch{try{(0,t.ensureValidDidRegex)(l.authority)}catch{throw new Error("ATURI authority must be a valid handle or DID")}}if(l.collection&&!(0,n.isValidNsid)(l.collection))throw new Error("ATURI collection path segment must be a valid NSID");if(c.length>8*1024)throw new Error("ATURI is far too long")}function a(c){try{s(c)}catch{return!1}return!0}return jt}var ca;function Bd(){return ca||(ca=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AtUri=e.ATP_URI_REGEX=void 0;const t=ec,r=qi(),n=Gi();t.__exportStar(Ld(),e),e.ATP_URI_REGEX=/^(at:\/\/)?((?:did:[a-z0-9:%-]+)|(?:[a-z0-9][a-z0-9.:-]*))(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;const i=/^(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;class s{constructor(d,l){wt(this,"hash");wt(this,"host");wt(this,"pathname");wt(this,"searchParams");const p=l!==void 0?Object.assign(typeof l=="string"?a(l):{host:l.host},c(d)):a(d);(0,r.ensureValidAtIdentifier)(p.host),this.hash=p.hash??"",this.host=p.host,this.pathname=p.pathname??"",this.searchParams=p.searchParams}static make(d,l,p){let g=d;return l&&(g+="/"+l),p&&(g+="/"+p),new s(g)}get protocol(){return"at:"}get origin(){return`at://${this.host}`}get hostname(){return this.host}set hostname(d){(0,r.ensureValidAtIdentifier)(d),this.host=d}get search(){return this.searchParams.toString()}set search(d){this.searchParams=new URLSearchParams(d)}get collection(){return this.pathname.split("/").filter(Boolean)[0]||""}set collection(d){(0,n.ensureValidNsid)(d);const l=this.pathname.split("/").filter(Boolean);l[0]=d,this.pathname=l.join("/")}get rkey(){return this.pathname.split("/").filter(Boolean)[1]||""}set rkey(d){const l=this.pathname.split("/").filter(Boolean);l[0]||(l[0]="undefined"),l[1]=d,this.pathname=l.join("/")}get href(){return this.toString()}toString(){let d=this.pathname||"/";d.startsWith("/")||(d=`/${d}`);let l="";this.searchParams.size&&(l=`?${this.searchParams.toString()}`);let p=this.hash;return p&&!p.startsWith("#")&&(p=`#${p}`),`at://${this.host}${d}${l}${p}`}}e.AtUri=s;function a(u){const d=u.match(e.ATP_URI_REGEX);if(!d)throw new Error(`Invalid AT uri: ${u}`);return{host:d[2],hash:d[5],pathname:d[3],searchParams:new URLSearchParams(d[4])}}function c(u){const d=u.match(i);if(!d)throw new Error(`Invalid path: ${u}`);return{hash:d[3],pathname:d[1],searchParams:new URLSearchParams(d[2])}}}(ti)),ti}var je={},ua;function Md(){if(ua)return je;ua=1,Object.defineProperty(je,"__esModule",{value:!0}),je.InvalidDatetimeError=je.normalizeDatetimeAlways=void 0,je.ensureValidDatetime=e,je.isValidDatetime=t,je.normalizeDatetime=r;function e(s){const a=new Date(s);if(isNaN(a.getTime()))throw new i("datetime did not parse as ISO 8601");if(a.toISOString().startsWith("-"))throw new i("datetime normalized to a negative time");if(!/^[0-9]{4}-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](.[0-9]{1,20})?(Z|([+-][0-2][0-9]:[0-5][0-9]))$/.test(s))throw new i("datetime didn't validate via regex");if(s.length>64)throw new i("datetime is too long (64 chars max)");if(s.endsWith("-00:00"))throw new i('datetime can not use "-00:00" for UTC timezone');if(s.startsWith("000"))throw new i("datetime so close to year zero not allowed")}function t(s){try{e(s)}catch{return!1}return!0}function r(s){if(t(s)){const u=new Date(s).toISOString();if(t(u))return u}if(!/.*(([+-]\d\d:?\d\d)|[a-zA-Z])$/.test(s)){const u=new Date(s+"Z");if(!isNaN(u.getTime())){const d=u.toISOString();if(t(d))return d}}const a=new Date(s);if(isNaN(a.getTime()))throw new i("datetime did not parse as any timestamp format");const c=a.toISOString();if(t(c))return c;throw new i("datetime normalized to invalid timestamp string")}const n=s=>{try{return r(s)}catch(a){if(a instanceof i)return new Date(0).toISOString();throw a}};je.normalizeDatetimeAlways=n;class i extends Error{}return je.InvalidDatetimeError=i,je}var mr={},da;function Vd(){if(da)return mr;da=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.parseLanguageString=t,mr.isValidLanguage=r;const e=/^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUseA>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUseB>x(-[A-Za-z0-9]{1,8})+))$/;function t(n){const i=n.match(e);if(!(i!=null&&i.groups))return null;const{groups:s}=i;return{grandfathered:s.grandfathered,language:s.language,extlang:s.extlang,script:s.script,region:s.region,variant:s.variant,extension:s.extension,privateUse:s.privateUseA||s.privateUseB}}function r(n){return e.test(n)}return mr}var lt={},la;function zd(){if(la)return lt;la=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.InvalidRecordKeyError=void 0,lt.ensureValidRecordKey=i,lt.isValidRecordKey=s;const e=512,t=1,r=new Set([".",".."]),n=/^[a-zA-Z0-9_~.:-]{1,512}$/;function i(c){if(c.length>e||c.length<t)throw new a(`record key must be ${t} to ${e} characters`);if(r.has(c))throw new a('record key can not be "." or ".."');if(!n.test(c))throw new a("record key syntax not valid (regex)")}function s(c){return c.length>=t&&c.length<=e&&n.test(c)&&!r.has(c)}class a extends Error{}return lt.InvalidRecordKeyError=a,lt}var ft={},fa;function qd(){if(fa)return ft;fa=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.InvalidTidError=void 0,ft.ensureValidTid=r,ft.isValidTid=n;const e=13,t=/^[234567abcdefghij][234567abcdefghijklmnopqrstuvwxyz]{12}$/;function r(s){if(s.length!==e)throw new i(`TID must be ${e} characters`);if(!t.test(s))throw new i("TID syntax not valid (regex)")}function n(s){return s.length===e&&t.test(s)}class i extends Error{}return ft.InvalidTidError=i,ft}var Yr={},ha;function Gd(){if(ha)return Yr;ha=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.isValidUri=e;function e(t){return/^\w+:(?:\/\/)?[^\s/][^\s]*$/.test(t)}return Yr}var pa;function Yd(){return pa||(pa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ec;t.__exportStar(qi(),e),t.__exportStar(Bd(),e),t.__exportStar(Md(),e),t.__exportStar(Vi(),e),t.__exportStar(zi(),e),t.__exportStar(Gi(),e),t.__exportStar(Vd(),e),t.__exportStar(zd(),e),t.__exportStar(qd(),e),t.__exportStar(Gd(),e)}(Qn)),Qn}var ma;function Yi(){if(ma)return hr;ma=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.isNsid=void 0;const e=Yd(),t=r=>typeof r=="string"&&(0,e.isValidNsid)(r);return hr.isNsid=t,hr}var _r={},_a;function Fd(){if(_a)return _r;_a=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.LexPermissionSyntax=void 0;const e=Array.isArray;class t{constructor(n){Object.defineProperty(this,"lexPermission",{enumerable:!0,configurable:!0,writable:!0,value:n})}get prefix(){return this.lexPermission.resource}get positional(){}get(n){if(n!=="type"&&n!=="resource"&&Object.hasOwn(this.lexPermission,n))return this.lexPermission[n]}*keys(){for(const n of Object.keys(this.lexPermission))this.get(n)!==void 0&&(yield n)}getSingle(n){const i=this.get(n);return e(i)?null:i}getMulti(n){const i=this.get(n);if(i!==void 0)return e(i)?i:null}toJSON(){return this.lexPermission}}return _r.LexPermissionSyntax=t,_r}var ri={},ga;function Dr(){return ga||(ga=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RepoPermission=e.isCollectionParam=e.isRepoAction=e.REPO_ACTIONS=e.isNsid=void 0;const t=Yi();Object.defineProperty(e,"isNsid",{enumerable:!0,get:function(){return t.isNsid}});const r=Vt(),n=vt(),i=yt(),s=Rr();e.REPO_ACTIONS=Object.freeze(["create","update","delete"]),e.isRepoAction=(0,s.knownValuesValidator)(e.REPO_ACTIONS);const a=d=>d==="*"||(0,t.isNsid)(d);e.isCollectionParam=a;class c{constructor(l,p){Object.defineProperty(this,"collection",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"action",{enumerable:!0,configurable:!0,writable:!0,value:p})}matches({action:l,collection:p}){return this.action.includes(l)&&(this.collection.includes("*")||this.collection.includes(p))}toString(){return c.parser.format(this)}static fromString(l){if(!(0,i.isScopeStringFor)(l,"repo"))return null;const p=n.ScopeStringSyntax.fromString(l);return c.fromSyntax(p)}static fromSyntax(l){const p=c.parser.parse(l);return p?new c(p.collection,p.action):null}static scopeNeededFor(l){return c.parser.format({collection:[l.collection],action:[l.action]})}}e.RepoPermission=c,Object.defineProperty(c,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new r.Parser("repo",{collection:{multiple:!0,required:!0,validate:e.isCollectionParam,normalize:d=>d.length>1?d.includes("*")?["*"]:[...new Set(d)].sort():d},action:{multiple:!0,required:!1,validate:e.isRepoAction,default:e.REPO_ACTIONS,normalize:d=>d===e.REPO_ACTIONS?e.REPO_ACTIONS:e.REPO_ACTIONS.filter(u,d)}},"collection")});function u(d){return this.includes(d)}}(ri)),ri}var ni={},ya;function Nr(){return ya||(ya=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RpcPermission=e.isAudParam=e.isLxmParam=e.isNsid=e.isAtprotoAudience=void 0;const t=Io();Object.defineProperty(e,"isAtprotoAudience",{enumerable:!0,get:function(){return t.isAtprotoAudience}});const r=Yi();Object.defineProperty(e,"isNsid",{enumerable:!0,get:function(){return r.isNsid}});const n=Vt(),i=vt(),s=yt(),a=d=>d==="*"||(0,r.isNsid)(d);e.isLxmParam=a;const c=d=>d==="*"||(0,t.isAtprotoAudience)(d);e.isAudParam=c;class u{constructor(l,p){Object.defineProperty(this,"aud",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"lxm",{enumerable:!0,configurable:!0,writable:!0,value:p})}matches(l){const{aud:p,lxm:g}=this;return(p==="*"||p===l.aud)&&(g.includes("*")||g.includes(l.lxm))}toString(){return u.parser.format(this)}static fromString(l){if(!(0,s.isScopeStringFor)(l,"rpc"))return null;const p=i.ScopeStringSyntax.fromString(l);return u.fromSyntax(p)}static fromSyntax(l){const p=u.parser.parse(l);return!p||p.aud==="*"&&p.lxm.includes("*")?null:new u(p.aud,p.lxm)}static scopeNeededFor(l){return u.parser.format({aud:l.aud,lxm:[l.lxm]})}}e.RpcPermission=u,Object.defineProperty(u,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new n.Parser("rpc",{lxm:{multiple:!0,required:!0,validate:e.isLxmParam,normalize:d=>d.length>1&&d.includes("*")?["*"]:[...new Set(d)].sort()},aud:{multiple:!1,required:!0,validate:e.isAudParam}},"lxm")})}(ni)),ni}var va;function tc(){return va||(va=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IncludeScope=e.isNsid=void 0;const t=Io(),r=Yi();Object.defineProperty(e,"isNsid",{enumerable:!0,get:function(){return r.isNsid}});const n=Vt(),i=Fd(),s=vt(),a=yt(),c=Dr(),u=Nr();class d{constructor(m,x=void 0){Object.defineProperty(this,"nsid",{enumerable:!0,configurable:!0,writable:!0,value:m}),Object.defineProperty(this,"aud",{enumerable:!0,configurable:!0,writable:!0,value:x})}toString(){return d.parser.format(this)}toPermissions(m){return Array.from(this.buildPermissions(m))}toScopes(m){return Array.from(this.buildPermissions(m),x=>x.toString())}*buildPermissions(m){for(const x of m.permissions){const w=this.parseLexPermission(x);if(!w)continue;const I=l(w);I&&this.isAllowedPermission(I)&&(yield I)}}parseLexPermission(m){if(p(m,"repo"))return new i.LexPermissionSyntax(m);if(p(m,"rpc")){if(m.aud!==void 0&&m.aud!=="*")return null;if(m.inheritAud===!0&&m.aud===void 0&&this.aud!==void 0){const{inheritAud:x,...w}=m;return new i.LexPermissionSyntax({aud:this.aud,...w})}return new i.LexPermissionSyntax(m)}return null}isAllowedPermission(m){if(m instanceof u.RpcPermission)return m.lxm.every(this.isParentAuthorityOf,this);if(m instanceof c.RepoPermission)return m.collection.every(this.isParentAuthorityOf,this);throw new TypeError(`Unexpected permission ${m}`)}isParentAuthorityOf(m){if(m==="*")return!1;const x=this.nsid,w=x.lastIndexOf(".");if(w===-1)throw new TypeError('Dot character (".") missing from lexicon NSID');if(w>=m.length-1)return!1;for(let I=w;I>=0;I--)if(x.charCodeAt(I)!==m.charCodeAt(I))return!1;return!0}static fromString(m){if(!(0,a.isScopeStringFor)(m,"include"))return null;const x=s.ScopeStringSyntax.fromString(m);return d.fromSyntax(x)}static fromSyntax(m){const x=d.parser.parse(m);return x?new d(x.nsid,x.aud):null}}e.IncludeScope=d,Object.defineProperty(d,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new n.Parser("include",{nsid:{multiple:!1,required:!0,validate:r.isNsid},aud:{multiple:!1,required:!1,validate:t.isAtprotoAudience}},"nsid")});function l(g){return(0,a.isScopeSyntaxFor)(g,"repo")?c.RepoPermission.fromSyntax(g):(0,a.isScopeSyntaxFor)(g,"rpc")?u.RpcPermission.fromSyntax(g):null}function p(g,m){return g.resource===m}}(Fn)),Fn}var ba;function Hd(){return ba||(ba=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.STATIC_SCOPE_VALUES=e.isScopeStringFor=void 0,e.isStaticScopeValue=d,e.isAtprotoOauthScope=l,e.normalizeAtprotoOauthScope=p,e.normalizeAtprotoOauthScopeValue=g;const t=yt();Object.defineProperty(e,"isScopeStringFor",{enumerable:!0,get:function(){return t.isScopeStringFor}});const r=Rr(),n=Sn(),i=wn(),s=Tn(),a=tc(),c=Dr(),u=Nr();e.STATIC_SCOPE_VALUES=Object.freeze(["atproto","transition:email","transition:generic","transition:chat.bsky"]);function d(m){return e.STATIC_SCOPE_VALUES.includes(m)}function l(m){return d(m)||n.AccountPermission.fromString(m)!=null||i.BlobPermission.fromString(m)!=null||s.IdentityPermission.fromString(m)!=null||a.IncludeScope.fromString(m)!=null||c.RepoPermission.fromString(m)!=null||u.RpcPermission.fromString(m)!=null}function p(m){return m.split(" ").map(g).filter(r.isNonNullable).sort().join(" ")}function g(m){if(d(m))return m;for(const x of[n.AccountPermission,i.BlobPermission,s.IdentityPermission,a.IncludeScope,c.RepoPermission,u.RpcPermission]){const w=x.fromString(m);if(w)return w.toString()}return null}}(zn)),zn}var gr={},xa;function Fi(){if(xa)return gr;xa=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.ScopeMissingError=void 0;class e extends Error{get statusCode(){return this.status}constructor(r){super(`Missing required scope "${r}"`),Object.defineProperty(this,"scope",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ScopeMissingError"}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:403}),Object.defineProperty(this,"expose",{enumerable:!0,configurable:!0,writable:!0,value:!0})}}return gr.ScopeMissingError=e,gr}var yr={},vr={},ii={},Ea;function rc(){return Ea||(Ea=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ScopesSet=e.ScopeMissingError=void 0;const t=Fi();Object.defineProperty(e,"ScopeMissingError",{enumerable:!0,get:function(){return t.ScopeMissingError}});const r=Sn(),n=wn(),i=Tn(),s=Dr(),a=Nr();class c extends Set{matches(g,m){for(const x of this)if(d(x,g,m))return!0;return!1}assert(g,m){if(!this.matches(g,m)){const x=u(g,m);throw new t.ScopeMissingError(x)}}some(g){for(const m of this)if(g(m))return!0;return!1}every(g){for(const m of this)if(!g(m))return!1;return!0}*filter(g){for(const m of this)g(m)&&(yield m)}*map(g){for(const m of this)yield g(m)}static fromString(g){return new c(g==null?void 0:g.split(" "))}}e.ScopesSet=c;function u(p,g){switch(p){case"account":return r.AccountPermission.scopeNeededFor(g);case"identity":return i.IdentityPermission.scopeNeededFor(g);case"repo":return s.RepoPermission.scopeNeededFor(g);case"rpc":return a.RpcPermission.scopeNeededFor(g);case"blob":return n.BlobPermission.scopeNeededFor(g)}throw new TypeError(`Unknown resource: ${p}`)}function d(p,g,m){const x=l(g,p);return x?x.matches(m):!1}function l(p,g){switch(p){case"account":return r.AccountPermission.fromString(g);case"identity":return i.IdentityPermission.fromString(g);case"repo":return s.RepoPermission.fromString(g);case"rpc":return a.RpcPermission.fromString(g);case"blob":return n.BlobPermission.fromString(g);default:return null}}}(ii)),ii}var Sa;function nc(){if(Sa)return vr;Sa=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.ScopePermissions=void 0;const e=Fi(),t=Sn(),r=wn(),n=Tn(),i=Dr(),s=Nr(),a=rc();class c{constructor(d){Object.defineProperty(this,"scopes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.scopes=new a.ScopesSet(d?typeof d=="string"?d.split(" "):d:void 0)}allowsAccount(d){return this.scopes.matches("account",d)}assertAccount(d){if(!this.allowsAccount(d)){const l=t.AccountPermission.scopeNeededFor(d);throw new e.ScopeMissingError(l)}}allowsIdentity(d){return this.scopes.matches("identity",d)}assertIdentity(d){if(!this.allowsIdentity(d)){const l=n.IdentityPermission.scopeNeededFor(d);throw new e.ScopeMissingError(l)}}allowsBlob(d){return this.scopes.matches("blob",d)}assertBlob(d){if(!this.allowsBlob(d)){const l=r.BlobPermission.scopeNeededFor(d);throw new e.ScopeMissingError(l)}}allowsRepo(d){return this.scopes.matches("repo",d)}assertRepo(d){if(!this.allowsRepo(d)){const l=i.RepoPermission.scopeNeededFor(d);throw new e.ScopeMissingError(l)}}allowsRpc(d){return this.scopes.matches("rpc",d)}assertRpc(d){if(!this.allowsRpc(d)){const l=s.RpcPermission.scopeNeededFor(d);throw new e.ScopeMissingError(l)}}}return vr.ScopePermissions=c,vr}var wa;function Wd(){if(wa)return yr;wa=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.ScopePermissionsTransition=void 0;const e=nc();class t extends e.ScopePermissions{get hasTransitionGeneric(){return this.scopes.has("transition:generic")}get hasTransitionEmail(){return this.scopes.has("transition:email")}get hasTransitionChatBsky(){return this.scopes.has("transition:chat.bsky")}allowsAccount(n){return n.attr==="email"&&n.action==="read"&&this.hasTransitionEmail?!0:super.allowsAccount(n)}allowsBlob(n){return this.hasTransitionGeneric?!0:super.allowsBlob(n)}allowsRepo(n){return this.hasTransitionGeneric?!0:super.allowsRepo(n)}allowsRpc(n){const{lxm:i}=n;return this.hasTransitionGeneric&&i==="*"||this.hasTransitionGeneric&&!i.startsWith("chat.bsky.")||this.hasTransitionChatBsky&&i.startsWith("chat.bsky.")?!0:super.allowsRpc(n)}}return yr.ScopePermissionsTransition=t,yr}var Ta;function Kd(){return Ta||(Ta=1,function(e){var t=it&&it.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=it&&it.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Hd(),e),r(Fi(),e),r(Wd(),e),r(nc(),e),r(rc(),e),r(Sn(),e),r(wn(),e),r(Tn(),e),r(tc(),e),r(Dr(),e),r(Nr(),e)}(it)),it}var ae=Kd();const Hi=S.forwardRef(({className:e,invalid:t,disabled:r,...n},i)=>f.jsx("input",{...n,type:"checkbox",ref:i,disabled:r,className:fe(["block size-4 rounded-md border-2","accent-primary","transition duration-300 ease-in-out","outline-none","focus:ring-primary focus:ring-2 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-black",t&&"accent-error focus:border-error",r&&"bg-contrast-50 text-contrast-500 cursor-not-allowed",e])}));Hi.displayName="Checkbox";function Xd({scope:e,permissionSets:t,clientTrusted:r=!1,clientFirstParty:n=!1,allowEmail:i,onAllowEmail:s,className:a="",...c}){const u=S.useMemo(()=>Array.from(new Set(e==null?void 0:e.split(" ").map(l=>ae.IncludeScope.fromString(l)).filter(l=>l!=null))),[e]),d=S.useMemo(()=>new ae.ScopePermissionsTransition(e),[e]);return d.scopes.size===0||d.scopes.size===1&&d.scopes.has("atproto")?null:f.jsxs("div",{className:`flex flex-col gap-2 ${a}`,...c,role:"list",children:[f.jsx(tl,{permissions:d,allowEmail:i,onAllowEmail:s}),f.jsx(al,{permissions:d}),f.jsx(rl,{permissions:d}),f.jsx(il,{permissions:d}),f.jsx(sl,{permissions:d}),f.jsx(Jd,{includeScopes:u,permissionSets:t}),f.jsx(nl,{permissions:d}),(!n||!r)&&f.jsx(el,{className:"mt-2",permissions:d})]})}function Jd({includeScopes:e,permissionSets:t}){return e.length?f.jsx(f.Fragment,{children:e.map((r,n)=>f.jsx(Qd,{includeScope:r,permissionSet:t[r.nsid]},n))}):null}function Qd({includeScope:e,permissionSet:t}){const{nsid:r}=e,n=S.useMemo(()=>t?new ae.ScopePermissionsTransition(e.toScopes(t)):null,[e,t]);return f.jsxs(we,{role:"listitem",image:oc(r)?f.jsx(go,{className:"size-6"}):Wi(r)?f.jsx(yo,{className:"size-6"}):r.startsWith("com.atproto.moderation.")?f.jsx(rd,{className:"size-6"}):f.jsx(nd,{className:"size-6"}),title:f.jsx(Is,{object:t,property:"title",fallback:r}),description:f.jsx(Is,{object:t,property:"detail",fallback:t!=null&&t.title?r:null}),children:[f.jsx("p",{className:"mt-1",children:f.jsx(C,{id:"ZEwA2R"})}),n?f.jsxs(f.Fragment,{children:[f.jsx(ic,{className:"mt-2",permissions:n}),f.jsx(sc,{className:"mt-2",permissions:n})]}):null]})}function el({permissions:e,type:t="alert",prominent:r=!0,...n}){return S.useMemo(()=>e.allowsIdentity({attr:"*"}),[e])?f.jsx(Mt,{...n,type:t,prominent:r,children:f.jsx("p",{children:f.jsx(C,{id:"zb3TS0",components:{0:f.jsx("b",{}),1:f.jsx("b",{})}})})}):null}function tl({permissions:e,allowEmail:t,onAllowEmail:r}){const{i18n:n,_:i}=q(),s=S.useMemo(()=>["manage","read"].find(a=>e.allowsAccount({attr:"email",action:a})),[e]);return s?f.jsx("label",{className:r?"cursor-pointer":void 0,children:f.jsx(we,{role:"listitem",image:f.jsx(ed,{className:"size-6"}),title:n._({id:"O3oNi5"}),description:s==="manage"?f.jsx(C,{id:"FLm/n9"}):f.jsx(C,{id:"fEvm25"}),append:r&&f.jsx(Hi,{className:"m-2",checked:t,onChange:a=>r(a.target.checked)})})}):null}function rl({permissions:e}){const{i18n:t,_:r}=q();return e.allowsAccount({attr:"status",action:"manage"})?f.jsx(we,{role:"listitem",image:f.jsx(td,{className:"size-6"}),title:t._({id:"AeXO77"}),description:t._({id:"NKHn7N"})}):null}function nl({permissions:e}){return S.useMemo(()=>{if(e.allowsAccount({attr:"repo",action:"manage"}))return!1;let r=!1;for(const n of e.scopes){const i=ae.RpcPermission.fromString(n);if(i){if(r=!0,ac(i.aud)||i.lxm.every(pi))continue;return!1}const s=ae.RepoPermission.fromString(n);if(s){if(r=!0,s.collection.every(pi))continue;return!1}}return r},[e])?null:f.jsxs(f.Fragment,{children:[f.jsx(cl,{permissions:e}),f.jsx(ol,{permissions:e})]})}function il({permissions:e}){const t=S.useMemo(()=>e.scopes.some(dl),[e]),r=S.useMemo(()=>e.scopes.some(ll),[e]);return t||r?f.jsx(we,{role:"listitem",image:f.jsx(go,{className:"size-6"}),title:"Bluesky",description:t&&r?f.jsx(C,{id:"0ZqxWk"}):f.jsx(C,{id:"YRqkn2"})}):null}function sl({permissions:e}){const{i18n:t,_:r}=q();return S.useMemo(()=>e.hasTransitionChatBsky||e.scopes.some(ul),[e])?f.jsx(we,{role:"listitem",image:f.jsx(yo,{className:"size-6"}),title:t._({id:"AHZflp"}),description:t._({id:"yZDyOS"})}):null}function al({permissions:e}){const{i18n:t,_:r}=q(),n=S.useMemo(()=>e.allowsIdentity({attr:"*"})?"*":e.allowsIdentity({attr:"handle"})?"handle":null,[e]);return n?f.jsx(we,{role:"listitem",image:f.jsx(Ir,{className:"h-6"}),title:t._({id:"ePYQjq"}),description:n==="*"?f.jsx(C,{id:"hqGoYC",components:{0:f.jsx("b",{}),1:f.jsx("b",{})}}):f.jsx(C,{id:"lbjZdy",components:{0:f.jsx("b",{})}})}):null}function ol({permissions:e}){const{i18n:t,_:r}=q();return e.hasTransitionGeneric?f.jsx(we,{role:"listitem",image:f.jsx(ws,{className:"size-6"}),title:t._({id:"OX6vme"}),description:f.jsx(C,{id:"17SnJo",components:{0:f.jsx("b",{})}}),children:f.jsx("p",{children:f.jsx(Ia,{})})}):e.scopes.some(n=>ae.RpcPermission.fromString(n)!=null)?f.jsxs(we,{role:"listitem",image:f.jsx(ws,{className:"size-6"}),title:t._({id:"OX6vme"}),description:t._({id:"RZlEhS"}),children:[f.jsx("p",{children:f.jsx(Ia,{})}),f.jsx("p",{className:"mt-1",children:f.jsx(C,{id:"ZEwA2R"})}),f.jsx(ic,{className:"mt-2",permissions:e})]}):null}function Ia(){return f.jsx(C,{id:"sVs8xu"})}function ic({permissions:e,className:t="",...r}){const n=S.useMemo(()=>{const i=new Map;for(const s of e.scopes){const a=ae.RpcPermission.fromString(s);if(!a)continue;let c=i.get(a.aud);c||i.set(a.aud,c=new Set);for(const u of a.lxm)c.add(u)}return Array.from(i.entries()).sort(([s],[a])=>s.localeCompare(a)).map(([s,a])=>[s,a.has("*")?["*"]:Array.from(a).sort((c,u)=>c.localeCompare(u))])},[e]);return n.length?f.jsxs("table",{className:`w-full table-auto ${t}`,...r,children:[f.jsx("thead",{children:f.jsxs("tr",{className:"text-sm",children:[f.jsx("th",{className:"text-left font-normal",children:f.jsx(C,{id:"b4SMYa"})}),f.jsx("th",{className:"text-left font-normal",children:f.jsx(C,{id:"nURwxX"})})]})}),f.jsx("tbody",{children:n.map(([i,s])=>s.map((a,c,u)=>f.jsxs("tr",{className:"text-xs",children:[f.jsx("td",{className:c>0?"pt-1":void 0,children:f.jsx(fl,{lxm:a})}),c===0&&f.jsx("td",{className:"align-top",rowSpan:u.length,children:f.jsx(hl,{aud:i})})]},a)))})]}):null}function cl({permissions:e}){const{i18n:t,_:r}=q();return e.hasTransitionGeneric||e.allowsAccount({attr:"repo",action:"manage"})||e.allowsRepo({collection:"*",action:"create"})&&e.allowsRepo({collection:"*",action:"delete"})&&e.allowsRepo({collection:"*",action:"update"})?f.jsxs(we,{role:"listitem",image:f.jsx(Ss,{className:"size-6"}),title:t._({id:"IreQBq"}),description:t._({id:"NnNRWU"}),children:[f.jsx("p",{children:f.jsx(ja,{})}),f.jsx("p",{className:"mt-1",children:f.jsx(C,{id:"jhMKee",components:{0:f.jsx("b",{})}})})]}):e.scopes.some(n=>ae.RepoPermission.fromString(n)!=null)?f.jsxs(we,{role:"listitem",image:f.jsx(Ss,{className:"size-6"}),title:t._({id:"IreQBq"}),description:t._({id:"xs63gu"}),children:[f.jsx("p",{children:f.jsx(ja,{})}),f.jsx("p",{className:"mt-1",children:f.jsx(C,{id:"ZEwA2R"})}),f.jsx(sc,{className:"mt-2",permissions:e})]}):null}function ja(){return f.jsx(C,{id:"Gmgygg"})}function sc({permissions:e,className:t,...r}){const{i18n:n,_:i}=q(),s=S.useMemo(()=>{const d=new Map;for(const l of e.scopes){const p=ae.RepoPermission.fromString(l);if(p)for(const g of p.collection)if(d.has(g)){const m=d.get(g);for(const x of p.action)m[x]=!0}else d.set(g,{create:p.action.includes("create"),update:p.action.includes("update"),delete:p.action.includes("delete")})}return d},[e]),a=S.useMemo(()=>e.hasTransitionGeneric?[new ae.BlobPermission(["*/*"])]:Array.from(e.scopes.map(d=>ae.BlobPermission.fromString(d))).filter(d=>d!=null),[e]);if(!s.size)return null;const c=s.get("*"),u=S.useMemo(()=>Array.from(s.entries()).sort(([d],[l])=>d.localeCompare(l)),[s]);return f.jsxs("table",{className:`w-full table-auto text-left ${t}`,...r,children:[f.jsx("thead",{children:f.jsxs("tr",{className:"text-sm",children:[f.jsx("th",{className:"font-normal",children:n._({id:"q+hNag"})}),f.jsx("th",{className:"text-center font-normal",children:n._({id:"hYgDIe"})}),f.jsx("th",{className:"text-center font-normal",children:n._({id:"EkH9pt"})}),f.jsx("th",{className:"text-center font-normal",children:n._({id:"cnGeoo"})})]})}),f.jsxs("tbody",{children:[u.map(([d,l],p)=>f.jsxs("tr",{className:"text-xs",children:[f.jsx("td",{className:p>0?"pt-1":void 0,children:f.jsx(pl,{coll:d})}),f.jsx("td",{className:"text-center",children:c!=null&&c.create||l.create?f.jsx(dn,{className:"inline-block size-3"}):null}),f.jsx("td",{className:"text-center",children:c!=null&&c.update||l.update?f.jsx(dn,{className:"inline-block size-3"}):null}),f.jsx("td",{className:"text-center",children:c!=null&&c.delete||l.delete?f.jsx(dn,{className:"inline-block size-3"}):null})]},d)),a.length>0&&f.jsxs("tr",{children:[f.jsx("td",{className:"pt-2",children:f.jsx(C,{id:"4X0Qky"})}),f.jsx("td",{colSpan:3,className:"pt-2 text-center",children:f.jsx(C,{id:"sCtyHQ"})})]})]})]})}function ac(e){return e==="did:web:bsky.app#bsky_appview"}function oc(e){return e.startsWith("app.bsky.")}function Wi(e){return e.startsWith("chat.bsky.")}function ul(e){if(e==="transition:chat.bsky")return!0;const t=ae.RpcPermission.fromString(e);return!t||ac(t.aud)?!1:t.lxm.includes("*")||t.lxm.some(Wi)}function pi(e){return e==="*"?!1:e==="com.atproto.moderation.createReport"||oc(e)||Wi(e)}function dl(e){if(e==="transition:generic")return!0;const t=ae.RepoPermission.fromString(e);return t?t.collection.includes("*")||t.collection.some(pi):!1}function ll(e){if(e==="transition:generic")return!0;const t=ae.RpcPermission.fromString(e);return t?t.lxm.includes("app.bsky.actor.getPreferences")||t.lxm.includes("app.bsky.graph.block")||t.lxm.includes("app.bsky.graph.muteActor")||t.lxm.includes("app.bsky.graph.muteActorList")||t.lxm.includes("app.bsky.graph.muteThread")||t.lxm.includes("app.bsky.graph.unmuteActor")||t.lxm.includes("app.bsky.graph.unmuteActorList")||t.lxm.includes("app.bsky.graph.unmuteThread")||t.lxm.includes("app.bsky.graph.getMutes")||t.lxm.includes("*"):!1}function fl({lxm:e,...t}){return e==="*"?f.jsx(Nt,{...t,children:f.jsx(C,{id:"P5xSNt"})}):f.jsx(cc,{...t,nsid:e})}function hl({aud:e,...t}){if(e.startsWith("did:web:api.bsky.app#"))return f.jsx(Nt,{...t,title:e,children:f.jsx(C,{id:"3GEYP0"})});if(e.startsWith("did:web:api.bsky.chat#"))return f.jsx(Nt,{...t,title:e,children:f.jsx(C,{id:"eglFj/"})});if(e.startsWith("did:web:")&&e.includes("#")){const r=e.slice(8,e.indexOf("#"));return f.jsx(Nt,{...t,title:e,children:f.jsx(C,{id:"BO3Kuy",values:{domain:r},components:{0:f.jsx("b",{})}})})}return e==="*"?f.jsx(Nt,{...t,children:f.jsx(C,{id:"UuQciw"})}):f.jsx(uc,{...t,title:e,children:e})}function pl({coll:e,...t}){return e==="*"?f.jsx(Nt,{...t,children:f.jsx(C,{id:"a6yfpg"})}):f.jsx(cc,{...t,nsid:e})}function Nt({children:e,className:t="",...r}){return f.jsx("em",{...r,className:`text-slate-500 ${t}`,children:e})}function cc({nsid:e,...t}){return f.jsx(uc,{...t,children:e.split(".").map((r,n)=>n===0?r:f.jsxs(S.Fragment,{children:[".",f.jsx("wbr",{}),r]},n))})}function uc({children:e,className:t="",...r}){return f.jsx("code",{...r,className:`text-slate-500 ${t}`,children:e})}function Ra({account:e,...t}){return f.jsx("b",{...t,children:e.preferred_username||e.email||e.sub})}const ml=e=>{try{const t=new URL(e);return t.protocol==="https:"&&t.pathname==="/oauth-client-metadata.json"&&!t.port&&!t.search}catch{return!1}};function _l({url:e,proto:t=!1,host:r=!0,path:n=!1,query:i=!1,hash:s=!1,as:a="span",...c}){const u=S.useMemo(()=>e instanceof URL?e:new URL(e),[e]);return f.jsxs(a,{...c,children:[t&&f.jsx(br,{value:`${u.protocol}//`,...t===!0?null:t}),r&&f.jsx(br,{value:u.host,...r===!0?{faded:!1,bold:!0}:r}),n&&f.jsx(br,{value:u.pathname,...n===!0?null:n}),i&&f.jsx(br,{value:u.search,...i===!0?null:i}),s&&f.jsx(br,{value:u.hash,...s===!0?null:s})]})}function br({value:e,faded:t=!0,bold:r=!1}){const n=r?"b":"span";return f.jsx(n,{className:t?"opacity-50":"",children:e})}function gl({clientId:e,clientMetadata:t,clientTrusted:r,...n}){const i=S.useMemo(()=>{try{return new URL(e)}catch{return null}},[e]);if(r&&t.client_name)return f.jsx("span",{...n,children:t.client_name});if((i==null?void 0:i.protocol)==="http:")return f.jsx("span",{...n,children:f.jsx(C,{id:"eYNzrj"})});if((i==null?void 0:i.protocol)==="https:"){const s=ml(e);return f.jsx(_l,{...n,url:i,proto:!s,host:!0,path:!s,query:!s,hash:!1})}return f.jsx("span",{...n,children:e})}function yl(e){return e.startsWith("transition:")}function vl(e){const t=ae.AccountPermission.fromString(e);return t?t.matches({attr:"email",action:"read"}):!1}function bl(e){return e==null?void 0:e.split(" ").filter(t=>!vl(t)).join(" ")}function xl({clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:i,account:s,scope:a,onConsent:c,consentLabel:u,onReject:d,rejectLabel:l,onBack:p,backLabel:g,...m}){const{i18n:x,_:w}=q(),[I,N]=S.useState(!0),P=!(a!=null&&a.split(" ").some(yl));return f.jsxs(Oi,{...m,onSubmit:A=>{A.preventDefault();const j=P&&!I?bl(a):a;c(j)},cancel:p&&f.jsx(se,{onClick:p,children:g||f.jsx(C,{id:"iH8pgl"})}),actions:f.jsxs(f.Fragment,{children:[f.jsx(se,{type:"submit",color:"primary",children:u||f.jsx(C,{id:"yIVrHZ"})}),f.jsx(se,{onClick:d,children:l||f.jsx(C,{id:"54JiGG"})})]}),children:[f.jsx(we,{image:f.jsx(wd,{clientId:e,clientMetadata:t,clientTrusted:r}),title:f.jsx(gl,{clientId:e,clientMetadata:t,clientTrusted:r}),description:!a||a==="atproto"?f.jsx(C,{id:"AM8FL/",components:{0:f.jsx(Ra,{account:s})}}):f.jsx(C,{id:"sUabXh",components:{0:f.jsx(Ra,{account:s})}}),hint:x._({id:"69Gavs"}),children:a?f.jsxs(f.Fragment,{children:[f.jsx("p",{children:f.jsx(C,{id:"Poe314"})}),f.jsx("ul",{className:"mt-2",children:a.split(" ").map(A=>f.jsx("li",{children:f.jsx("code",{children:A})},A))})]}):null}),f.jsx(Xd,{scope:a,permissionSets:i,clientTrusted:r,clientFirstParty:n,allowEmail:P?I:!0,onAllowEmail:P?N:void 0}),f.jsx("p",{children:f.jsx(C,{id:"TQzU6E",values:{0:u||f.jsx(C,{id:"yIVrHZ"})},components:{0:f.jsx("b",{}),1:f.jsx("a",{role:"link",href:t.tos_uri,rel:"nofollow noopener",target:"_blank",className:t.tos_uri?"text-primary underline":void 0}),2:f.jsx("a",{role:"link",href:t.policy_uri,rel:"nofollow noopener",target:"_blank",className:t.policy_uri?"text-primary underline":void 0})}})})]})}function El({clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:i,account:s,scope:a,onConsent:c,onReject:u,onBack:d,title:l,subtitle:p=f.jsx(C,{id:"QdVx1C",values:{0:s.preferred_username||s.email||s.sub},components:{0:f.jsx("b",{className:"text-slate-800 dark:text-slate-200"})}}),...g}){const{i18n:m,_:x}=q();return f.jsx(Ee,{...g,title:l??m._({id:"yIVrHZ"}),subtitle:p,children:f.jsx(xl,{clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:i,account:s,scope:a,onBack:d,onConsent:c,onReject:u})})}const Rn=S.createContext({disabled:!1});Rn.displayName="FieldsetContext";function Le({label:e,children:t,disabled:r,...n}){const i=jr({prefix:"fieldset-"}),s=S.useMemo(()=>({disabled:r??!1,labelId:e?i:void 0}),[r,e,i]);return f.jsxs("fieldset",{...n,"aria-labelledby":i,disabled:r,children:[e&&f.jsx("legend",{id:i,className:"mb-1 text-sm font-medium text-slate-600 dark:text-slate-400",children:e},"title"),f.jsx("div",{className:"flex flex-col space-y-4",children:f.jsx(Rn,{value:s,children:t})})]})}function Sl(e,{ref:t,onLoading:r,onError:n}={}){const[i,s]=S.useState(!1),[a,c]=S.useState(),u=S.useCallback(m=>{c(m),n==null||n(m)},[n]),d=S.useCallback(m=>{s(m),r==null||r(m)},[r]),l=S.useRef(null),p=S.useRef(null);S.useEffect(()=>(p.current=()=>{var m;(m=l.current)==null||m.abort(),l.current=null,u(void 0),d(!1)},()=>{p.current=null}),[u,d]),S.useImperativeHandle(t,()=>({reset:()=>{var m;return(m=p.current)==null?void 0:m.call(p)}}),[]),S.useEffect(()=>()=>{var m;(m=l.current)==null||m.abort(),l.current=null},[]);const g=S.useCallback(async()=>{var w;(w=l.current)==null||w.abort(),d(!0),u(void 0);const m=new AbortController,{signal:x}=m;l.current=m;try{await e(x)}catch(I){m===l.current?u(I instanceof Error?I:new Error(String(I))):wl(x,I)||console.warn("Async action error after abort",I)}finally{m===l.current&&(l.current=null,d(!1)),m.abort()}},[e,d,u]);return{loading:i,error:a,run:g}}function wl(e,t){return e.aborted&&(e.reason===t||e.reason===(t==null?void 0:t.cause)||t instanceof DOMException&&t.name==="AbortError")}const Tl=({error:e})=>f.jsx(hd,{error:e});function zt({invalid:e,disabled:t,onSubmit:r,submitLabel:n,onCancel:i=void 0,cancelLabel:s,errorRender:a=Tl,ref:c,onLoading:u,onError:d,children:l,...p}){const{run:g,loading:m,error:x}=Sl(r,{ref:c,onError:d,onLoading:u}),w=S.useCallback(I=>{I.preventDefault(),I.currentTarget.reportValidity()&&!t&&!e&&g()},[t,e,g]);return f.jsx(Oi,{...p,onSubmit:w,disabled:t||m,prepend:x!=null?a({error:x}):void 0,cancel:i&&f.jsx(se,{onClick:i,children:s||f.jsx(C,{id:"dEgA5A"})}),actions:f.jsx(se,{color:"primary",type:"submit",loading:m,disabled:t,children:n||f.jsx(C,{id:"hQRttt"})}),children:l})}const Ue=8,Il=/(\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/,Fr=/[A-Z]/,Hr=/[a-z]/,Wr=/[0-9]/,Kr=/[^a-zA-Z0-9]/;var mt=function(e){return e[e.weak=1]="weak",e[e.moderate=2]="moderate",e[e.strong=3]="strong",e[e.extra=4]="extra",e}({});function dc(e){return e.length<Ue?1:e.length>=Ue+12?4:e.length>=Ue+8?Oe(e,[Kr])||Oe(e,[Fr,Hr,Wr],2)?4:3:e.length>=Ue&&Oe(e,[Il])?3:e.length>=Ue+6?Oe(e,[Kr])||Oe(e,[Fr,Hr,Wr],2)?3:2:e.length>=Ue+4?Oe(e,[Kr])||Oe(e,[Fr,Hr,Wr],2)?2:1:e.length>=Ue&&(Oe(e,[Kr])||Oe(e,[Fr,Hr,Wr]))?2:1}function Oe(e,t,r=t.length){if(r<1||r>t.length)throw new TypeError("Invalid regexpsCountToMatch");for(const n of t)if(n.test(e)&&(r--,r===0))return!0;return!1}function jl({password:e,...t}){const{i18n:r,_:n}=q(),i=dc(e);return f.jsx("span",{...t,"aria-label":r._({id:"osAB4a"}),children:i===mt.extra?f.jsx(C,{id:"/Ltc/k"}):i===mt.strong?f.jsx(C,{id:"LLx/nr"}):i===mt.moderate?f.jsx(C,{id:"dvYuhh"}):e?f.jsx(C,{id:"9ls/Vs"}):f.jsx(C,{id:"VU3Nrn"})})}function Rl({password:e,className:t,...r}){const{i18n:n,_:i}=q(),s=e?dc(e):0,a="bg-gray-300 dark:bg-slate-500",c=s===mt.extra||s===mt.strong?"bg-success":s===mt.moderate?"bg-warning":"bg-error";return f.jsx("div",{...r,className:fe("flex h-1 w-full space-x-2",t),role:"meter","aria-label":n._({id:"xfNKwI"}),"aria-valuemin":0,"aria-valuemax":mt.extra,"aria-valuenow":s,children:Array.from({length:4},(u,d)=>f.jsx("div",{className:`h-1 w-1/4 rounded-sm ${s>d?c:a}`},d))})}function Cl(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Qe(e){return t=>{for(const r of e)r&&Cl(r,t)}}function Dl({visible:e,toggleVisible:t,onClick:r,...n}){const{i18n:i,_:s}=q();return f.jsx(se,{...n,shape:"padded",onClick:a=>{r==null||r(a),a.defaultPrevented||t()},"aria-label":e?i._({id:"vLyv1R"}):i._({id:"huXYDE"}),children:e?f.jsx(id,{className:"w-5","aria-hidden":!0}):f.jsx(sd,{className:"w-5","aria-hidden":!0})})}function gn({icon:e,append:t,bellow:r,actionable:n,className:i,children:s,onFocus:a,onBlur:c,...u}){const[d,l]=S.useState(!1);return n??(n=u.onClick!=null),f.jsxs("div",{...u,onFocus:p=>{a==null||a(p),p.defaultPrevented||l(!0)},onBlur:p=>{c==null||c(p),p.defaultPrevented||l(!1)},className:fe("min-h-12","max-w-full","overflow-hidden","rounded-lg","transition duration-300 ease-in-out","outline-none","focus:ring-primary focus:ring-2 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-black","has-focus:ring-primary has-focus:ring-2 has-focus:ring-offset-1 has-focus:ring-offset-white dark:has-focus:ring-offset-black","bg-gray-100 dark:bg-gray-800",n?"cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700":void 0,i),children:[f.jsxs("div",{className:fe("px-1","min-h-12 w-full","flex items-center justify-stretch","rounded-lg",r?"rounded-bl-none rounded-br-none":void 0,"text-slate-600 dark:text-slate-300"),children:[e&&f.jsx("div",{className:fe("flex shrink-0 grow-0 items-center justify-center","mx-2",d?"text-primary":"text-slate-500"),children:e}),s,f.jsx("div",{className:"ml-1 flex shrink-0 grow-0 items-center",children:t})]}),r&&f.jsx("div",{className:fe("space-x-2 px-3 py-2","flex flex-row items-center gap-1","rounded-br-2 rounded-bl-2","bg-gray-200 dark:bg-slate-700","text-gray-700 dark:text-gray-300","text-sm italic"),children:r})]})}function qt({icon:e,append:t,bellow:r,className:n,onFocus:i,onBlur:s,ref:a,disabled:c,title:u,"aria-label":d=u,"aria-labelledby":l,placeholder:p=d,...g}){const m=S.useContext(Rn),x=S.useRef(null),w=S.useRef(!1);return f.jsx(gn,{icon:e,append:t,bellow:r,className:fe("cursor-text",n),tabIndex:-1,actionable:!1,onClick:I=>{var N;x.current!==I.target&&(I.preventDefault(),I.stopPropagation(),(N=x.current)==null||N.focus())},onMouseDown:I=>{w.current&&I.target!==x.current&&(I.preventDefault(),I.stopPropagation())},children:f.jsx("input",{...g,disabled:c??m.disabled,title:u,placeholder:p,"aria-label":d,"aria-labelledby":l??m.labelId,ref:Qe([a,x]),className:"outline-hidden w-full text-ellipsis bg-transparent bg-clip-padding text-base text-inherit dark:placeholder-gray-500",onFocus:I=>{i==null||i(I),I.defaultPrevented||(w.current=!0)},onBlur:I=>{s==null||s(I),I.defaultPrevented||(w.current=!1)}})})}function lc({autoHide:e=!0,onBlur:t,onChange:r,append:n,autoComplete:i="current-password",icon:s=f.jsx(ad,{className:"w-5"}),value:a,defaultValue:c=a,ref:u,title:d,dir:l="auto",autoCapitalize:p="none",autoCorrect:g="off",spellCheck:m="false",...x}){const{i18n:w,_:I}=q(),N=S.useRef(null),[P,A]=S.useState(!1),[j,Z]=S.useState(typeof c=="string"?c:""),B=S.useCallback(M=>{r==null||r(M),Z(M.target.value)},[r]);return f.jsx(qt,{...x,title:d??w._({id:"8ZsakT"}),ref:Qe([u,N]),dir:l,autoCapitalize:p,autoCorrect:g,spellCheck:m,icon:s,onBlur:e?M=>{t==null||t(M),M.defaultPrevented||A(!1)}:t,value:j,onChange:B,type:P?"text":"password",autoComplete:i,append:f.jsxs(f.Fragment,{children:[f.jsx(Dl,{className:"m-1",visible:P,toggleVisible:()=>{var M;A(K=>!K),(M=N.current)==null||M.focus()}}),n]})})}function fc({password:e="",onPassword:t,onChange:r,autoComplete:n="new-password",minLength:i=Ue,...s}){const{i18n:a,_:c}=q(),[u,d]=S.useState(e),l=S.useCallback(p=>{const{value:g}=p.target;r==null||r(p),!p.defaultPrevented&&(d(g),t==null||t(p.target.validity.valid?g:void 0))},[r,t]);return f.jsx(lc,{...s,placeholder:a._({id:"3tOlz6"}),"aria-label":a._({id:"0StR7t"}),title:a._({id:"5CqSPX",values:{MIN_PASSWORD_LENGTH:Ue}}),minLength:i,onChange:l,value:u,autoComplete:n,bellow:f.jsxs(f.Fragment,{children:[f.jsx(Rl,{password:u}),f.jsx(jl,{className:"grow-1 min-w-max text-xs text-gray-500 dark:text-gray-400",password:u})]})})}const Nl="XXXXX-XXXXX";function hc({example:e=Nl,onToken:t,icon:r=f.jsx(vo,{className:"w-5"}),title:n=e,onChange:i,value:s,defaultValue:a=s,...c}){const{i18n:u,_:d}=q(),[l,p]=S.useState(typeof a=="string"?a:"");return f.jsx(qt,{...c,type:"text",autoCapitalize:"characters",autoCorrect:"off",autoComplete:"one-time-code",spellCheck:"false",minLength:11,maxLength:11,dir:"auto",icon:r,pattern:"^[A-Z2-7]{5}-[A-Z2-7]{5}$",placeholder:u._({id:"0hTJM+",values:{example:e}}),title:n,value:l,onChange:g=>{const{value:m,selectionEnd:x,selectionStart:w}=g.currentTarget,I=Ca(m);g.currentTarget.value=I;const N=x??w;if(N!=null){const P=Ca(m.slice(0,N));g.currentTarget.selectionStart=g.currentTarget.selectionEnd=P.length}p(I),i==null||i(g),g.isDefaultPrevented()||t==null||t(I.length===11?I:null)}})}function Ca(e){const t=e.toUpperCase().replaceAll(/[^A-Z2-7]/g,"");return t.length<=5?t:`${t.slice(0,5)}-${t.slice(5,10)}`}function kl({onSubmit:e,invalid:t,...r}){const n=jr({prefix:"reset-pwd-email-"}),i=S.useRef(null),[s,a]=S.useState(null),[c,u]=S.useState(void 0);return f.jsxs(zt,{...r,onSubmit:d=>{if(s&&c)return e({token:s,password:c},d)},invalid:t||!s||!c,children:[f.jsx(Mt,{id:n,type:"status",children:f.jsx(C,{id:"imRJNy"})}),f.jsx(Le,{label:f.jsx(C,{id:"vJgYMA"}),children:f.jsx(hc,{name:"code","aria-labelledby":n,enterKeyHint:"next",required:!0,autoFocus:!0,onToken:d=>{var l;a(d),d&&((l=i.current)==null||l.focus())}})}),f.jsx(Le,{label:f.jsx(C,{id:"/nT6AE"}),children:f.jsx(fc,{ref:i,name:"password",enterKeyHint:"done",required:!0,password:c,onPassword:u})})]})}function pc({onEmail:e,autoCapitalize:t="none",autoComplete:r="email",autoCorrect:n="off",dir:i="auto",icon:s=f.jsx(Ir,{className:"w-5"}),onBlur:a,onChange:c,pattern:u="^[^@]+@[^@]+\\.[^@]+$",spellCheck:d="false",value:l,defaultValue:p=l,title:g,...m}){const{i18n:x,_:w}=q(),[I,N]=S.useState(typeof p=="string"?p:""),P=S.useCallback(A=>{const j=A.target.value.toLowerCase();N(j),c==null||c(A),e==null||e(A.target.validity.valid?j:void 0)},[c,e]);return f.jsx(qt,{...m,title:g??x._({id:"ATGYL1"}),type:"email",autoCapitalize:t,autoCorrect:n,dir:i,spellCheck:d,icon:s,pattern:u,autoComplete:r,value:I,onChange:P,onBlur:a})}function Pl({emailDefault:e,onSubmit:t,invalid:r,ref:n,...i}){const{i18n:s,_:a}=q(),c=jr({prefix:"reset-pwd-email-"}),[u,d]=S.useState(e),l=S.useRef(null),p=S.useCallback(g=>{if(u)return t({email:u},g)},[u,t]);return f.jsx(zt,{...i,ref:Qe([n,l]),invalid:r||!u,onSubmit:p,children:f.jsxs(Le,{label:f.jsx(C,{id:"ATGYL1"}),children:[f.jsx(pc,{name:"email",placeholder:s._({id:"xRPn3U"}),"aria-labelledby":c,title:s._({id:"ATGYL1"}),required:!0,autoFocus:!0,value:u,onEmail:g=>{var m;(m=l.current)==null||m.reset(),d(g)}}),f.jsx(Mt,{type:"status",id:c,children:f.jsx(C,{id:"cHrOqs"})})]})})}function Al({emailDefault:e,onresetPasswordRequest:t,onResetPasswordConfirm:r,onBack:n,...i}){const{i18n:s,_:a}=q(),[c,u]=S.useState(0);if(c===0)return f.jsxs(Ee,{...i,title:i.title||s._({id:"dn8X5t"}),subtitle:i.subtitle||f.jsx(C,{id:"Esfg1M"}),children:[f.jsx(Pl,{emailDefault:e,submitLabel:f.jsx(C,{id:"hXzOVo"}),onSubmit:async(d,l)=>{await t(d,l),l.aborted||u(1)},cancelLabel:f.jsx(C,{id:"iH8pgl"}),onCancel:n}),f.jsx("hr",{className:"my-5 border-gray-300 dark:border-gray-700"}),f.jsx("center",{children:f.jsx(se,{transparent:!0,onClick:()=>u(1),children:f.jsx(C,{id:"FTT4a4"})})})]});if(c===1)return f.jsx(Ee,{...i,title:i.title||s._({id:"KbS2K9"}),subtitle:i.subtitle||f.jsx(C,{id:"xg/UcZ"}),children:f.jsx(kl,{submitLabel:f.jsx(C,{id:"hXzOVo"}),onSubmit:async(d,l)=>{await r(d,l),l.aborted||u(2)},cancelLabel:f.jsx(C,{id:"iH8pgl"}),onCancel:n})});if(c===2)return f.jsx(Ee,{...i,title:i.title||s._({id:"fSy6T1"}),subtitle:i.subtitle||f.jsx(C,{id:"+qGdcW"}),children:f.jsxs("center",{children:[f.jsx("h2",{className:"pb-2 text-xl font-bold",children:f.jsx(C,{id:"DKeVgZ"})}),f.jsx("p",{className:"pb-4",children:f.jsx(C,{id:"67nRLM"})}),f.jsx(se,{color:"primary",onClick:n,children:f.jsx(C,{id:"UaXeX3"})})]})});throw new Error(`Invalid view: ${c}`)}function Ol({className:e,children:t,id:r,ref:n,disabled:i,title:s,"aria-label":a=s,"aria-labelledby":c,...u}){const d=jr("input-checkbox-"),l=S.useRef(null),p=S.useRef(null),g=S.useContext(Rn),m=r??d;return f.jsx(gn,{className:fe("cursor-pointer",e),icon:f.jsx(Hi,{...u,disabled:i??g.disabled,title:s,"aria-label":a,"aria-labelledby":t?void 0:c??g.labelId,ref:Qe([n,p]),id:m}),tabIndex:-1,onClick:({target:x})=>{var w,I;x!==l.current&&x!==p.current&&((w=p.current)==null||w.click(),(I=p.current)==null||I.focus())},children:t&&f.jsx("label",{ref:l,htmlFor:m,className:"block w-full cursor-pointer select-none leading-[1.6]",children:t})})}function Xr({usernameDefault:e="",usernameReadonly:t=!1,rememberDefault:r=!1,onSubmit:n,onBack:i,backLabel:s,onForgotPassword:a,ref:c,invalid:u,children:d,...l}){const{i18n:p,_:g}=q(),[m,x]=S.useState(e),[w,I]=S.useState(""),[N,P]=S.useState(r),[A,j]=S.useState(null),[Z,B]=S.useState(null),[M,K]=S.useState(!1),H=S.useRef(null),ce=S.useCallback(()=>{j(null),B(null)},[j,B]),z=S.useCallback(()=>{var G;ce(),(G=H.current)==null||G.reset()},[ce,H]),re=S.useCallback(async G=>{try{await n({username:m,password:w,remember:N,...Z?{[Z.type]:A}:{}},G)}catch(ue){if(G.aborted)return;if(ue instanceof pd){B(ue);return}throw ue instanceof md&&ce(),ue}},[m,w,N,Z,A,n]);return f.jsxs(zt,{...l,ref:Qe([c,H]),onLoading:K,onCancel:i,cancelLabel:s??p._({id:"iH8pgl"}),append:d,invalid:u||!m||!w||Z!=null&&!A,submitLabel:Z?f.jsx(C,{id:"UwGV9B"}):f.jsx(C,{id:"yKDCQ1"}),onSubmit:re,children:[f.jsx(Le,{disabled:M,label:f.jsx(C,{id:"sJGljQ"}),children:f.jsx(qt,{icon:f.jsx(Ir,{className:"w-5"}),name:"username",type:"text",title:p._({id:"nZx9mr"}),autoCapitalize:"none",autoCorrect:"off",autoComplete:"username",spellCheck:"false",dir:"auto",enterKeyHint:"next",required:!0,readOnly:t,disabled:t,autoFocus:!t,value:m,onChange:G=>{z(),x(G.target.value)}})}),f.jsx(Le,{disabled:M,label:f.jsx(C,{id:"8ZsakT"}),children:f.jsx(lc,{name:"password",onChange:G=>{z(),I(G.target.value)},append:a&&f.jsx(se,{className:"text-sm",type:"button",onClick:()=>{a(m!=null&&m.includes("@")?m:void 0)},"aria-label":p._({id:"slOprG"}),children:f.jsx(C,{id:"F4OP4y"})}),enterKeyHint:Z?"next":"done",disabled:M,autoFocus:t,required:!0})}),f.jsx(Mt,{role:"alert",title:f.jsx(C,{id:"r6y+jM"}),children:f.jsx(C,{id:"+Z2ZNt"})}),f.jsx(Ol,{name:"remember",title:p._({id:"1TxdLU"}),enterKeyHint:Z?"next":"done",checked:N,onChange:G=>P(G.target.checked),children:f.jsx(C,{id:"1TxdLU"})}),Z&&f.jsx(Le,{disabled:M,label:f.jsx(C,{id:"4blS0m"}),children:f.jsxs("div",{children:[f.jsx(hc,{title:p._({id:"ioZOzk"}),enterKeyHint:"done",required:!0,autoFocus:!0,value:A??"",onToken:j}),f.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:f.jsx(C,{id:"B+Yy3b",values:{0:Z.hint}})})]})},"2fa")]})}function Ul({src:e,alt:t}){const[r,n]=S.useState(!1);return S.useEffect(()=>{n(!1)},[e]),e&&!r?f.jsx("img",{"aria-hidden":!0,src:e,alt:t,className:"h-6 w-6 rounded-full",onError:()=>n(!0)}):f.jsx("div",{"aria-hidden":!0,className:"bg-primary border-primary h-6 w-6 overflow-hidden rounded-full border-2 border-solid text-white",children:f.jsx(od,{className:"-mx-1 -mb-1"})})}function Zl({accounts:e,onAccount:t,onOther:r=void 0,onBack:n,onSignUp:i,backLabel:s,children:a,...c}){const{i18n:u,_:d}=q();return f.jsxs(Oi,{...c,append:a,actions:i&&f.jsx(se,{onClick:i,color:"primary",transparent:!0,children:f.jsx(C,{id:"e+RpCP"})}),cancel:n&&f.jsx(se,{onClick:n,children:s||f.jsx(C,{id:"iH8pgl"})}),children:[f.jsx("p",{className:"text-sm font-medium text-slate-600 dark:text-slate-400",children:f.jsx(C,{id:"FT1MVS"})}),e.map(l=>f.jsx(gn,{tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(l)},onClick:()=>t(l),role:"button","aria-label":u._({id:"N9o7n5",values:{0:l.name}}),icon:f.jsx(Ul,{src:l.picture,alt:u._({id:"kfcRb0"})}),append:f.jsx(Ts,{"aria-hidden":!0,className:"h-4"}),children:f.jsxs("span",{className:"flex flex-wrap items-center",children:[l.name&&f.jsx("span",{className:"mr-2 truncate font-medium","arial-label":u._({id:"6YtxFj"}),children:l.name}),f.jsx("span",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400","arial-label":u._({id:"sJGljQ"}),children:l.preferred_username||l.email||l.sub})]})},l.sub)),r&&f.jsx(gn,{tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},onClick:r,"aria-label":u._({id:"cR9UpQ"}),role:"button",append:f.jsx(Ts,{"aria-hidden":!0,className:"h-4"}),icon:f.jsx(Ir,{"aria-hidden":!0,className:"h-4 w-6"}),children:f.jsx("span",{className:"truncate text-slate-700 dark:text-slate-400",children:f.jsx(C,{id:"+TaG50"})})},"other")]})}function $l({loginHint:e,sessions:t,selectSub:r,onSignIn:n,onSignUp:i,onForgotPassword:s,onBack:a,backLabel:c,title:u,subtitle:d,...l}){const{i18n:p,_:g}=q(),m=S.useMemo(()=>t.find(P=>P.selected),[t]),x=S.useCallback(()=>r(null),[r]),w=S.useMemo(()=>t.map(P=>P.account),[t]),[I,N]=S.useState(t.length===0);return u??(u=p._({id:"cQae5I"})),S.useEffect(()=>{m&&N(!1)},[m]),m?m.loginRequired?f.jsx(Ee,{...l,title:u,subtitle:d??f.jsx(C,{id:"HaGV2g"}),children:f.jsx(Xr,{onSubmit:n,onForgotPassword:s,onBack:x,usernameDefault:m.account.preferred_username||m.account.sub,usernameReadonly:!0,rememberDefault:!0})}):null:e?f.jsx(Ee,{...l,title:u,subtitle:d??f.jsx(C,{id:"NgaR6B"}),children:f.jsx(Xr,{onSubmit:n,onForgotPassword:s,onBack:a,backLabel:c,usernameDefault:e,usernameReadonly:!0})}):t.length===0?f.jsx(Ee,{...l,title:u,subtitle:d??f.jsx(C,{id:"T0KLp4"}),children:f.jsx(Xr,{onSubmit:n,onForgotPassword:s,onBack:a,backLabel:c})}):I?f.jsx(Ee,{...l,title:u,subtitle:d??f.jsx(C,{id:"T0KLp4"}),children:f.jsx(Xr,{onSubmit:n,onForgotPassword:s,onBack:()=>N(!1)})}):f.jsx(Ee,{...l,title:u,subtitle:d??f.jsx(C,{id:"o3dwub"}),children:f.jsx(Zl,{accounts:w,onAccount:P=>r(P.sub),onOther:()=>N(!0),onBack:a,backLabel:c,onSignUp:i})})}const Ze=e=>e!=null&&e!==!1,Ll=e=>Ze(e)&&e.invalid===!0,Bl=e=>!Ze(e)||e.invalid===!1;function Ml(e){const t=e.findIndex(Ze),r=e.findLastIndex(Ze),n=e.findIndex(Ll),[i,s]=S.useState(t),a=S.useCallback(A=>A!==-1&&e[A]?(s(A),!0):!1,[e.map(Ze).join()]),c=e.findLastIndex((A,j)=>Ze(A)&&j<i),u=e.findIndex((A,j)=>Ze(A)&&j>i),d=S.useCallback(()=>a(t),[a,t]),l=S.useCallback(()=>a(r),[a,r]),p=S.useCallback(()=>a(c),[a,c]),g=S.useCallback(()=>a(u),[a,u]),m=S.useCallback(()=>a(n),[a,n]),x=i+1+e.reduce((A,j,Z)=>Z>=i||Ze(j)?A:A-1,0),w=e.filter(Ze).length,I=e.every(Bl),N=i===-1||!e[i]?void 0:e[i],P=i===-1;return S.useEffect(()=>{P&&d()},[P]),{current:N,currentPosition:x,count:w,completed:I,atFirst:x===1,atLast:x===w,toFirst:d,toLast:l,toPrev:p,toNext:g,toRequired:m}}function Vl({prevLabel:e,nextLabel:t,onBack:r,backLabel:n,onDone:i,doneLabel:s,steps:a,className:c,...u}){var B,M;const{atFirst:d,atLast:l,count:p,current:g,currentPosition:m,completed:x,toNext:w,toPrev:I,toRequired:N}=Ml(a),P=S.useCallback(()=>{w()||N()},[w,N]),A={current:!0,invalid:g?g.invalid:!1,prevLabel:d&&n||e||f.jsx(C,{id:"iH8pgl"}),prev:d?r:I,nextLabel:l&&s||t||f.jsx(C,{id:"hXzOVo"}),next:l&&x?i:P},j=(B=g==null?void 0:g.titleRender)==null?void 0:B.call(g,A),Z=(M=g==null?void 0:g.contentRender)==null?void 0:M.call(g,A);return f.jsxs("div",{className:fe(c,"flex flex-col"),...u,children:[f.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:f.jsx(C,{id:"BEx8rG",values:{currentPosition:m,count:p}})}),j&&f.jsx("h2",{className:"mb-4 text-xl font-medium",children:j}),Z]})}function zl({links:e,className:t,...r}){const n=e==null?void 0:e.find(i=>i.rel==="help");return n?f.jsx("p",{...r,className:fe("rounded-md bg-slate-100 p-3 text-sm text-slate-800 dark:bg-slate-800 dark:text-slate-400",t),children:f.jsx(C,{id:"87VTIH",components:{0:f.jsx("a",{role:"link",href:n.href,rel:n.rel,target:"_blank",className:"text-primary"})}})}):null}function ql({inviteCodeRequired:e=!0,credentials:t,onCredentials:r,onNext:n,nextLabel:i,onPrev:s,prevLabel:a,children:c,ref:u,invalid:d,...l}){const{i18n:p,_:g}=q(),[m,x]=S.useState(t==null?void 0:t.email),[w,I]=S.useState(t==null?void 0:t.password),[N,P]=S.useState(t==null?void 0:t.inviteCode),A=S.useRef(null),j=()=>{var B;return(B=A.current)==null?void 0:B.reset()},Z=S.useMemo(()=>m&&w&&(!e||N)?{email:m,password:w,inviteCode:e?N:void 0}:void 0,[m,w,N,e]);return S.useEffect(()=>{r==null||r(Z)},[Z,r]),f.jsxs(zt,{...l,ref:Qe([u,A]),invalid:d||!Z,onCancel:s,cancelLabel:a,onSubmit:n,submitLabel:i,append:c,children:[e&&f.jsx(Le,{label:f.jsx(C,{id:"6KlkHI"}),children:f.jsx(qt,{icon:f.jsx(vo,{className:"w-5"}),autoFocus:!0,name:"inviteCode",title:p._({id:"6KlkHI"}),placeholder:p._({id:"jxqcgY"}),required:!0,value:N||"",onChange:B=>{P(B.target.value||void 0),j()},enterKeyHint:"next"})}),f.jsx(Le,{label:f.jsx(C,{id:"O3oNi5"}),children:f.jsx(pc,{autoFocus:!e,name:"email",enterKeyHint:"next",required:!0,defaultValue:m,onEmail:B=>{x(B),j()}})}),f.jsx(Le,{label:f.jsx(C,{id:"8ZsakT"}),children:f.jsx(fc,{name:"password",enterKeyHint:"next",required:!0,password:w,onPassword:B=>{I(B),j()}})})]})}function si({links:e,className:t,...r}){const n=e==null?void 0:e.find(s=>s.rel==="terms-of-service"),i=e==null?void 0:e.find(s=>s.rel==="privacy-policy");return f.jsx("p",{className:fe("text-sm text-slate-500 dark:text-slate-400",t),...r,children:f.jsx(C,{id:"mBUXx0",values:{0:n?f.jsx(js,{className:"text-primary underline",link:n,children:f.jsx(C,{id:"xowcRf"})}):f.jsx(C,{id:"xowcRf"}),1:i?f.jsx(js,{className:"text-primary underline",link:i,children:f.jsx(C,{id:"LcET2C"})}):f.jsx(C,{id:"LcET2C"})}})})}const Gl=18,mc=3,_c=30,Yl=e=>mc+e.length<=_c&&e.startsWith(".")&&!e.endsWith(".");function Fl(e){const t=mc,r=Math.min(Gl,_c-e.length),n=S.useCallback(i=>{const s=i.length>=t&&i.length<=r,a=/^[a-z0-9][a-z0-9-]+[a-z0-9]$/g.test(i);return{validLength:s,validCharset:a,valid:s&&a}},[r,t]);return{minLength:t,maxLength:r,validateSegment:n}}function Hl({domains:e,onNext:t,nextLabel:r,onPrev:n,prevLabel:i,handle:s,onHandle:a,invalid:c,children:u,ref:d,...l}){const{i18n:p,_:g}=q(),m=e.filter(Yl),x=S.useRef(null),[w,I]=S.useState(()=>{const z=m.findIndex(re=>s==null?void 0:s.endsWith(re));return z===-1?0:z}),[N,P]=S.useState(()=>(s==null?void 0:s.split(".")[0])||"");S.useEffect(()=>{I(z=>Math.min(z,m.length-1))},[m.length]);const A=m[w]||m[0]||null,{minLength:j,maxLength:Z,validateSegment:B}=Fl(A),M=B(N),K=A&&M.valid?`${N}${A}`:void 0;S.useEffect(()=>{var z;(z=x.current)==null||z.reset(),a==null||a(K)},[a,K]);const H=S.useRef(null),ce=`@${N}${A}`;return f.jsxs(zt,{...l,ref:Qe([d,x]),onCancel:n,cancelLabel:i,onSubmit:t,submitLabel:r,invalid:c||!K,append:u,children:[f.jsxs("div",{children:[f.jsx(Da,{hasValue:!!N,valid:M.validLength,children:f.jsx(C,{id:"4Rgp24",values:{minLength:j,maxLength:Z}})}),f.jsx(Da,{hasValue:!!N,valid:M.validCharset,children:f.jsx(C,{id:"yDlXDJ"})})]}),f.jsx(qt,{ref:H,icon:f.jsx(Ir,{className:"w-5"}),name:"handle",type:"text",title:p._({id:"LX2sHe"}),pattern:"[a-z0-9][a-z0-9\\-]+[a-z0-9]",minLength:j,maxLength:Z,autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",dir:"auto",enterKeyHint:"done",autoFocus:!0,required:!0,value:N,onChange:z=>{const re=z.target.value.toLowerCase(),G=z.target.selectionStart,ue=z.target.selectionEnd;z.target.value=re,z.target.setSelectionRange(G,ue),P(re)},append:m.length>1&&f.jsx("select",{onClick:z=>z.stopPropagation(),onMouseDown:z=>z.stopPropagation(),value:w,"aria-label":p._({id:"HB+TbB"}),onChange:z=>{var re;I(Number(z.target.value)),(re=H.current)==null||re.focus()},className:fe("block w-full","text-sm","accent-primary","cursor-pointer","bg-gray-100 dark:bg-gray-800","hover:bg-gray-200 dark:hover:bg-gray-700","transition duration-300 ease-in-out","outline-none","focus:ring-primary focus:ring-2 focus:ring-offset-1 focus:ring-offset-white dark:focus:ring-offset-black","text-slate-600 dark:text-slate-300","rounded-lg","p-2 pr-1"),children:m.map((z,re)=>f.jsx("option",{value:re,children:z},z))}),bellow:f.jsx(C,{id:"r/b/p8",values:{0:N.length?f.jsx("strong",{className:"text-gray-800 dark:text-gray-200",children:ce}):f.jsx("span",{"aria-hidden":!0,className:"w-24 rounded-md bg-gray-300 p-2 dark:bg-slate-600"})}})}),f.jsx(Mt,{type:"status",children:f.jsx(C,{id:"B9VwbO"})})]})}function Da({valid:e,hasValue:t,children:r,className:n,...i}){const{i18n:s,_:a}=q();return f.jsxs("div",{...i,className:fe("flex flex-row items-center gap-2",n),children:[t?f.jsx(f.Fragment,{children:e?f.jsx(dn,{className:"text-success inline-block h-4 w-4",title:s._({id:"nfagfM"})}):f.jsx(cd,{className:"text-error inline-block h-4 w-4",title:s._({id:"JHB/Ky"})})}):f.jsx("div",{"aria-hidden":!0,className:"flex h-4 w-4 items-center justify-center",children:f.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-300 dark:bg-slate-600"})}),f.jsx("div",{className:"text-sm",children:r})]})}function he(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mi(e,t){return mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mi(e,t)}function Wl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,mi(e,t)}var gc=Object.defineProperty,Kl=Object.defineProperties,Xl=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertySymbols,yc=Object.prototype.hasOwnProperty,vc=Object.prototype.propertyIsEnumerable,Na=(e,t,r)=>t in e?gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))yc.call(t,r)&&Na(e,r,t[r]);if(yn)for(var r of yn(t))vc.call(t,r)&&Na(e,r,t[r]);return e},V=(e,t)=>Kl(e,Xl(t)),Jl=(e,t)=>{var r={};for(var n in e)yc.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yn)for(var n of yn(e))t.indexOf(n)<0&&vc.call(e,n)&&(r[n]=e[n]);return r},bc=(e,t)=>{for(var r in t)gc(e,r,{get:t[r],enumerable:!0})},Ki=(e,t,r)=>new Promise((n,i)=>{var s=u=>{try{c(r.next(u))}catch(d){i(d)}},a=u=>{try{c(r.throw(u))}catch(d){i(d)}},c=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);c((r=r.apply(e,t)).next())});function Ql(e){return Object.entries(e).filter(([,t])=>t||t===!1).map(([t,r])=>`${encodeURIComponent(t)}=${encodeURIComponent(String(r))}`).join("&")}function xc(e){let t=e&&e.ownerDocument||document,r=t.defaultView||t.parentWindow||window;return{document:t,window:r}}function Ec(e){return e||document.head}var ef="hCaptcha-script",ln="hCaptchaOnLoad",_i="script-error",Dt="@hCaptcha/loader",Sc=Object.prototype.toString;function wc(e){switch(Sc.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Be(e,Error)}}function Gt(e,t){return Sc.call(e)===`[object ${t}]`}function Xi(e){return Gt(e,"ErrorEvent")}function ka(e){return Gt(e,"DOMError")}function tf(e){return Gt(e,"DOMException")}function Xe(e){return Gt(e,"String")}function Tc(e){return e===null||typeof e!="object"&&typeof e!="function"}function Ut(e){return Gt(e,"Object")}function Cn(e){return typeof Event<"u"&&Be(e,Event)}function rf(e){return typeof Element<"u"&&Be(e,Element)}function nf(e){return Gt(e,"RegExp")}function Ji(e){return!!(e&&e.then&&typeof e.then=="function")}function sf(e){return Ut(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Ic(e){return typeof e=="number"&&e!==e}function Be(e,t){try{return e instanceof t}catch{return!1}}function jc(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function Pt(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Pa(e,t){if(!Array.isArray(e))return"";let r=[];for(let n=0;n<e.length;n++){let i=e[n];try{jc(i)?r.push("[VueViewModel]"):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function af(e,t,r=!1){return Xe(e)?nf(t)?t.test(e):Xe(t)?r?e===t:e.includes(t):!1:!1}function kr(e,t=[],r=!1){return t.some(n=>af(e,n,r))}function of(e,t,r=250,n,i,s,a){if(!s.exception||!s.exception.values||!a||!Be(a.originalException,Error))return;let c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;c&&(s.exception.values=cf(gi(e,t,i,a.originalException,n,s.exception.values,c,0),r))}function gi(e,t,r,n,i,s,a,c){if(s.length>=r+1)return s;let u=[...s];if(Be(n[i],Error)){Aa(a,c);let d=e(t,n[i]),l=u.length;Oa(d,i,l,c),u=gi(e,t,r,n[i],i,[d,...u],d,l)}return Array.isArray(n.errors)&&n.errors.forEach((d,l)=>{if(Be(d,Error)){Aa(a,c);let p=e(t,d),g=u.length;Oa(p,`errors[${l}]`,g,c),u=gi(e,t,r,d,i,[p,...u],p,g)}}),u}function Aa(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=V(T({},e.mechanism),{is_exception_group:!0,exception_id:t})}function Oa(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=V(T({},e.mechanism),{type:"chained",source:t,exception_id:r,parent_id:n})}function cf(e,t){return e.map(r=>(r.value&&(r.value=Pt(r.value,t)),r))}function Jr(e){return e&&e.Math==Math?e:void 0}var Q=typeof globalThis=="object"&&Jr(globalThis)||typeof window=="object"&&Jr(window)||typeof self=="object"&&Jr(self)||typeof global=="object"&&Jr(global)||function(){return this}()||{};function Pr(){return Q}function Rc(e,t,r){let n=r||Q,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}var fn=Pr(),uf=80;function Zt(e,t={}){try{let r=e,n=5,i=[],s=0,a=0,c=" > ",u=c.length,d,l=Array.isArray(t)?t:t.keyAttrs,p=!Array.isArray(t)&&t.maxStringLength||uf;for(;r&&s++<n&&(d=df(r,l),!(d==="html"||s>1&&a+i.length*u+d.length>=p));)i.push(d),a+=d.length,r=r.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function df(e,t){let r=e,n=[],i,s,a,c,u;if(!r||!r.tagName)return"";n.push(r.tagName.toLowerCase());let d=t&&t.length?t.filter(p=>r.getAttribute(p)).map(p=>[p,r.getAttribute(p)]):null;if(d&&d.length)d.forEach(p=>{n.push(`[${p[0]}="${p[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),i=r.className,i&&Xe(i))for(s=i.split(/\s+/),u=0;u<s.length;u++)n.push(`.${s[u]}`);let l=["aria-label","type","name","title","alt"];for(u=0;u<l.length;u++)a=l[u],c=r.getAttribute(a),c&&n.push(`[${a}="${c}"]`);return n.join("")}function lf(){try{return fn.document.location.href}catch{return""}}function ff(e){return fn.document&&fn.document.querySelector?fn.document.querySelector(e):null}var hf="Sentry Logger ",yi=["debug","info","warn","error","log","assert","trace"],vn={};function Cc(e){if(!("console"in Q))return e();let t=Q.console,r={},n=Object.keys(vn);n.forEach(i=>{let s=vn[i];r[i]=t[i],t[i]=s});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function pf(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?yi.forEach(r=>{t[r]=(...n)=>{e&&Cc(()=>{Q.console[r](`${hf}[${r}]:`,...n)})}}):yi.forEach(r=>{t[r]=()=>{}}),t}var k=pf(),mf=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function _f(e){return e==="http"||e==="https"}function Dn(e,t=!1){let{host:r,path:n,pass:i,port:s,projectId:a,protocol:c,publicKey:u}=e;return`${c}://${u}${t&&i?`:${i}`:""}@${r}${s?`:${s}`:""}/${n&&`${n}/`}${a}`}function gf(e){let t=mf.exec(e);if(!t){console.error(`Invalid Sentry Dsn: ${e}`);return}let[r,n,i="",s,a="",c]=t.slice(1),u="",d=c,l=d.split("/");if(l.length>1&&(u=l.slice(0,-1).join("/"),d=l.pop()),d){let p=d.match(/^\d+/);p&&(d=p[0])}return Dc({host:s,pass:i,path:u,projectId:d,port:a,protocol:r,publicKey:n})}function Dc(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function yf(e){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(k.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:r.match(/^\d+$/)?_f(n)?t&&isNaN(parseInt(t,10))?(k.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(k.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(k.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function vf(e){let t=typeof e=="string"?gf(e):Dc(e);if(!(!t||!yf(t)))return t}var De=class extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}};function ne(e,t,r){if(!(t in e))return;let n=e[t],i=r(n);typeof i=="function"&&Nc(i,n),e[t]=i}function Qi(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Nc(e,t){try{let r=t.prototype||{};e.prototype=t.prototype=r,Qi(e,"__sentry_original__",t)}catch{}}function es(e){return e.__sentry_original__}function bf(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function kc(e){if(wc(e))return T({message:e.message,name:e.name,stack:e.stack},Za(e));if(Cn(e)){let t=T({type:e.type,target:Ua(e.target),currentTarget:Ua(e.currentTarget)},Za(e));return typeof CustomEvent<"u"&&Be(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Ua(e){try{return rf(e)?Zt(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Za(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function xf(e,t=40){let r=Object.keys(kc(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Pt(r[0],t);for(let n=r.length;n>0;n--){let i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length?i:Pt(i,t)}return""}function Ke(e){return vi(e,new Map)}function vi(e,t){if(Ut(e)){let r=t.get(e);if(r!==void 0)return r;let n={};t.set(e,n);for(let i of Object.keys(e))typeof e[i]<"u"&&(n[i]=vi(e[i],t));return n}if(Array.isArray(e)){let r=t.get(e);if(r!==void 0)return r;let n=[];return t.set(e,n),e.forEach(i=>{n.push(vi(i,t))}),n}return e}var Pc=50,$a=/\(error: (.*)\)/,La=/captureMessage|captureException/;function Ef(...e){let t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0)=>{let i=[],s=r.split(`
|
|
2
|
+
`);for(let a=n;a<s.length;a++){let c=s[a];if(c.length>1024)continue;let u=$a.test(c)?c.replace($a,"$1"):c;if(!u.match(/\S*Error: /)){for(let d of t){let l=d(u);if(l){i.push(l);break}}if(i.length>=Pc)break}}return Sf(i)}}function Sf(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),La.test(t[t.length-1].function||"")&&(t.pop(),La.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,Pc).map(r=>V(T({},r),{filename:r.filename||t[t.length-1].filename,function:r.function||"?"}))}var ai="<anonymous>";function Je(e){try{return!e||typeof e!="function"?ai:e.name||ai}catch{return ai}}var bi=Pr();function wf(){if(!("fetch"in bi))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function xi(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Tf(){if(!wf())return!1;if(xi(bi.fetch))return!0;let e=!1,t=bi.document;if(t&&typeof t.createElement=="function")try{let r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=xi(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}var Qr=Pr();function If(){let e=Qr.chrome,t=e&&e.app&&e.app.runtime,r="history"in Qr&&!!Qr.history.pushState&&!!Qr.history.replaceState;return!t&&r}var te=Pr(),kt="__sentry_xhr_v2__",Sr={},Ba={};function jf(e){if(!Ba[e])switch(Ba[e]=!0,e){case"console":Rf();break;case"dom":Uf();break;case"xhr":Nf();break;case"fetch":Cf();break;case"history":kf();break;case"error":Zf();break;case"unhandledrejection":$f();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("unknown instrumentation type:",e);return}}function me(e,t){Sr[e]=Sr[e]||[],Sr[e].push(t),jf(e)}function Se(e,t){if(!(!e||!Sr[e]))for(let r of Sr[e]||[])try{r(t)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${Je(r)}
|
|
5
|
+
Error:`,n)}}function Rf(){"console"in Q&&yi.forEach(function(e){e in Q.console&&ne(Q.console,e,function(t){return vn[e]=t,function(...r){Se("console",{args:r,level:e});let n=vn[e];n&&n.apply(Q.console,r)}})})}function Cf(){Tf()&&ne(Q,"fetch",function(e){return function(...t){let{method:r,url:n}=Df(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Se("fetch",T({},i)),e.apply(Q,t).then(s=>(Se("fetch",V(T({},i),{endTimestamp:Date.now(),response:s})),s),s=>{throw Se("fetch",V(T({},i),{endTimestamp:Date.now(),error:s})),s})}})}function Ei(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Ma(e){return typeof e=="string"?e:e?Ei(e,"url")?e.url:e.toString?e.toString():"":""}function Df(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[r,n]=e;return{url:Ma(r),method:Ei(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:Ma(t),method:Ei(t,"method")?String(t.method).toUpperCase():"GET"}}function Nf(){if(!te.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;ne(e,"open",function(t){return function(...r){let n=r[1],i=this[kt]={method:Xe(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};Xe(n)&&i.method==="POST"&&n.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let s=()=>{let a=this[kt];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}Se("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?ne(this,"onreadystatechange",function(a){return function(...c){return s(),a.apply(this,c)}}):this.addEventListener("readystatechange",s),ne(this,"setRequestHeader",function(a){return function(...c){let[u,d]=c,l=this[kt];return l&&(l.request_headers[u.toLowerCase()]=d),a.apply(this,c)}}),t.apply(this,r)}}),ne(e,"send",function(t){return function(...r){let n=this[kt];return n&&r[0]!==void 0&&(n.body=r[0]),Se("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),t.apply(this,r)}})}var en;function kf(){if(!If())return;let e=te.onpopstate;te.onpopstate=function(...r){let n=te.location.href,i=en;if(en=n,Se("history",{from:i,to:n}),e)try{return e.apply(this,r)}catch{}};function t(r){return function(...n){let i=n.length>2?n[2]:void 0;if(i){let s=en,a=String(i);en=a,Se("history",{from:s,to:a})}return r.apply(this,n)}}ne(te.history,"pushState",t),ne(te.history,"replaceState",t)}var Pf=1e3,tn,rn;function Af(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}function Of(e){if(e.type!=="keypress")return!1;try{let t=e.target;if(!t||!t.tagName)return!0;if(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)return!1}catch{}return!0}function Va(e,t=!1){return r=>{if(!r||rn===r||Of(r))return;let n=r.type==="keypress"?"input":r.type;tn===void 0?(e({event:r,name:n,global:t}),rn=r):Af(rn,r)&&(e({event:r,name:n,global:t}),rn=r),clearTimeout(tn),tn=te.setTimeout(()=>{tn=void 0},Pf)}}function Uf(){if(!te.document)return;let e=Se.bind(null,"dom"),t=Va(e,!0);te.document.addEventListener("click",t,!1),te.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{let n=te[r]&&te[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(ne(n,"addEventListener",function(i){return function(s,a,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__=u.__sentry_instrumentation_handlers__||{},l=d[s]=d[s]||{refCount:0};if(!l.handler){let p=Va(e);l.handler=p,i.call(this,s,p,c)}l.refCount++}catch{}return i.call(this,s,a,c)}}),ne(n,"removeEventListener",function(i){return function(s,a,c){if(s==="click"||s=="keypress")try{let u=this,d=u.__sentry_instrumentation_handlers__||{},l=d[s];l&&(l.refCount--,l.refCount<=0&&(i.call(this,s,l.handler,c),l.handler=void 0,delete d[s]),Object.keys(d).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,c)}}))})}var nn=null;function Zf(){nn=te.onerror,te.onerror=function(e,t,r,n,i){return Se("error",{column:n,error:i,line:r,msg:e,url:t}),nn&&!nn.__SENTRY_LOADER__?nn.apply(this,arguments):!1},te.onerror.__SENTRY_INSTRUMENTED__=!0}var sn=null;function $f(){sn=te.onunhandledrejection,te.onunhandledrejection=function(e){return Se("unhandledrejection",e),sn&&!sn.__SENTRY_LOADER__?sn.apply(this,arguments):!0},te.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Lf(){let e=typeof WeakSet=="function",t=e?new WeakSet:[];function r(i){if(e)return t.has(i)?!0:(t.add(i),!1);for(let s=0;s<t.length;s++)if(t[s]===i)return!0;return t.push(i),!1}function n(i){if(e)t.delete(i);else for(let s=0;s<t.length;s++)if(t[s]===i){t.splice(s,1);break}}return[r,n]}function oe(){let e=Q,t=e.crypto||e.msCrypto,r=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>t.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function Ac(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function We(e){let{message:t,event_id:r}=e;if(t)return t;let n=Ac(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Si(e,t,r){let n=e.exception=e.exception||{},i=n.values=n.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function Tr(e,t){let r=Ac(e);if(!r)return;let n={type:"generic",handled:!0},i=r.mechanism;if(r.mechanism=T(T(T({},n),i),t),t&&"data"in t){let s=T(T({},i&&i.data),t.data);r.mechanism.data=s}}function za(e){if(e&&e.__sentry_captured__)return!0;try{Qi(e,"__sentry_captured__",!0)}catch{}return!1}function Bf(e){return Array.isArray(e)?e:[e]}function Mf(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Vf(){return"npm"}function zf(){return!Mf()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function qf(e,t){return e.require(t)}function He(e,t=100,r=1/0){try{return wi("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function Oc(e,t=3,r=100*1024){let n=He(e,t);return Hf(n)>r?Oc(e,t-1,r):n}function wi(e,t,r=1/0,n=1/0,i=Lf()){let[s,a]=i;if(t==null||["number","boolean","string"].includes(typeof t)&&!Ic(t))return t;let c=Gf(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;let u=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:r;if(u===0)return c.replace("object ","");if(s(t))return"[Circular ~]";let d=t;if(d&&typeof d.toJSON=="function")try{let m=d.toJSON();return wi("",m,u-1,n,i)}catch{}let l=Array.isArray(t)?[]:{},p=0,g=kc(t);for(let m in g){if(!Object.prototype.hasOwnProperty.call(g,m))continue;if(p>=n){l[m]="[MaxProperties ~]";break}let x=g[m];l[m]=wi(m,x,u-1,n,i),p++}return a(t),l}function Gf(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(jc(t))return"[VueViewModel]";if(sf(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${Je(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let r=Yf(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Yf(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Ff(e){return~-encodeURI(e).split(/%..|./).length}function Hf(e){return Ff(JSON.stringify(e))}var $e;(function(e){e[e.PENDING=0]="PENDING";let t=1;e[e.RESOLVED=t]="RESOLVED";let r=2;e[e.REJECTED=r]="REJECTED"})($e||($e={}));function _t(e){return new pe(t=>{t(e)})}function ts(e){return new pe((t,r)=>{r(e)})}var pe=class{constructor(e){pe.prototype.__init.call(this),pe.prototype.__init2.call(this),pe.prototype.__init3.call(this),pe.prototype.__init4.call(this),this._state=$e.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new pe((r,n)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(s){n(s)}},i=>{if(!t)n(i);else try{r(t(i))}catch(s){n(s)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new pe((t,r)=>{let n,i;return this.then(s=>{i=!1,n=s,e&&e()},s=>{i=!0,n=s,e&&e()}).then(()=>{if(i){r(n);return}t(n)})})}__init(){this._resolve=e=>{this._setResult($e.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult($e.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===$e.PENDING){if(Ji(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===$e.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===$e.RESOLVED&&t[1](this._value),this._state===$e.REJECTED&&t[2](this._value),t[0]=!0)})}}};function Wf(e){let t=[];function r(){return e===void 0||t.length<e}function n(a){return t.splice(t.indexOf(a),1)[0]}function i(a){if(!r())return ts(new De("Not adding Promise because buffer limit was reached."));let c=a();return t.indexOf(c)===-1&&t.push(c),c.then(()=>n(c)).then(null,()=>n(c).then(null,()=>{})),c}function s(a){return new pe((c,u)=>{let d=t.length;if(!d)return c(!0);let l=setTimeout(()=>{a&&a>0&&c(!1)},a);t.forEach(p=>{_t(p).then(()=>{--d||(clearTimeout(l),c(!0))},u)})})}return{$:t,add:i,drain:s}}function oi(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}var Kf=["fatal","error","warning","log","info","debug"];function Xf(e){return e==="warn"?"warning":Kf.includes(e)?e:"log"}var Uc=Pr(),Ti={nowSeconds:()=>Date.now()/1e3};function Jf(){let{performance:e}=Uc;if(!e||!e.now)return;let t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}function Qf(){try{return qf(lu,"perf_hooks").performance}catch{return}}var ci=zf()?Qf():Jf(),qa=ci===void 0?Ti:{nowSeconds:()=>(ci.timeOrigin+ci.now())/1e3},Nn=Ti.nowSeconds.bind(Ti),gt=qa.nowSeconds.bind(qa),Ne=(()=>{let{performance:e}=Uc;if(!e||!e.now)return;let t=3600*1e3,r=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,s=i<t,a=e.timing&&e.timing.navigationStart,c=typeof a=="number"?Math.abs(a+r-n):t,u=c<t;return s||u?i<=c?e.timeOrigin:a:n})(),Ii="baggage",Zc="sentry-",eh=/^sentry-/,th=8192;function rh(e){if(!Xe(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce((n,i)=>{let s=Ga(i);return T(T({},n),s)},{});else{if(!e)return;t=Ga(e)}let r=Object.entries(t).reduce((n,[i,s])=>{if(i.match(eh)){let a=i.slice(Zc.length);n[a]=s}return n},{});if(Object.keys(r).length>0)return r}function ji(e){if(!e)return;let t=Object.entries(e).reduce((r,[n,i])=>(i&&(r[`${Zc}${n}`]=i),r),{});return nh(t)}function Ga(e){return e.split(",").map(t=>t.split("=").map(r=>decodeURIComponent(r.trim()))).reduce((t,[r,n])=>(t[r]=n,t),{})}function nh(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[r,n],i)=>{let s=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,a=i===0?s:`${t},${s}`;return a.length>th?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):a},"")}var ih=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function sh(e){if(!e)return;let t=e.match(ih);if(!t)return;let r;return t[3]==="1"?r=!0:t[3]==="0"&&(r=!1),{traceId:t[1],parentSampled:r,parentSpanId:t[2]}}function ah(e,t){let r=sh(e),n=rh(t),{traceId:i,parentSpanId:s,parentSampled:a}=r||{},c={traceId:i||oe(),spanId:oe().substring(16),sampled:a};return s&&(c.parentSpanId=s),n&&(c.dsc=n),{traceparentData:r,dynamicSamplingContext:n,propagationContext:c}}function rs(e=oe(),t=oe().substring(16),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${e}-${t}${n}`}function Ar(e,t=[]){return[e,t]}function oh(e,t){let[r,n]=e;return[r,[...n,t]]}function Ya(e,t){let r=e[1];for(let n of r){let i=n[0].type;if(t(n,i))return!0}return!1}function Ri(e,t){return(t||new TextEncoder).encode(e)}function ch(e,t){let[r,n]=e,i=JSON.stringify(r);function s(a){typeof i=="string"?i=typeof a=="string"?i+a:[Ri(i,t),a]:i.push(typeof a=="string"?Ri(a,t):a)}for(let a of n){let[c,u]=a;if(s(`
|
|
6
|
+
${JSON.stringify(c)}
|
|
7
|
+
`),typeof u=="string"||u instanceof Uint8Array)s(u);else{let d;try{d=JSON.stringify(u)}catch{d=JSON.stringify(He(u))}s(d)}}return typeof i=="string"?i:uh(i)}function uh(e){let t=e.reduce((i,s)=>i+s.length,0),r=new Uint8Array(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return r}function dh(e,t){let r=typeof e.data=="string"?Ri(e.data,t):e.data;return[Ke({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}var lh={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"};function Fa(e){return lh[e]}function $c(e){if(!e||!e.sdk)return;let{name:t,version:r}=e.sdk;return{name:t,version:r}}function fh(e,t,r,n){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return T(T(T({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!r&&n&&{dsn:Dn(n)}),i&&{trace:Ke(T({},i))})}function hh(e,t,r){let n=[{type:"client_report"},{timestamp:Nn(),discarded_events:e}];return Ar(t?{dsn:t}:{},[n])}function ph(e,t=Date.now()){let r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${e}`);return isNaN(n)?6e4:n-t}function mh(e,t){return e[t]||e.all||0}function _h(e,t,r=Date.now()){return mh(e,t)>r}function gh(e,{statusCode:t,headers:r},n=Date.now()){let i=T({},e),s=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(s)for(let c of s.trim().split(",")){let[u,d]=c.split(":",2),l=parseInt(u,10),p=(isNaN(l)?60:l)*1e3;if(!d)i.all=n+p;else for(let g of d.split(";"))i[g]=n+p}else a?i.all=n+ph(a,n):t===429&&(i.all=n+60*1e3);return i}var ns="production";function is(){return Rc("globalEventProcessors",()=>[])}function yh(e){is().push(e)}function bn(e,t,r,n=0){return new pe((i,s)=>{let a=e[n];if(t===null||typeof a!="function")i(t);else{let c=a(T({},t),r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&c===null&&k.log(`Event processor "${a.id}" dropped event`),Ji(c)?c.then(u=>bn(e,u,r,n+1).then(i)).then(null,s):bn(e,c,r,n+1).then(i).then(null,s)}})}function vh(e){let t=gt(),r={sid:oe(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>xh(r)};return e&&$t(r,e),r}function $t(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||gt(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:oe()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function bh(e,t){let r={};e.status==="ok"&&(r={status:"exited"}),$t(e,r)}function xh(e){return Ke({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}var Eh=100,At=class{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ha()}static clone(e){let t=new At;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags=T({},e._tags),t._extra=T({},e._extra),t._contexts=T({},e._contexts),t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata=T({},e._sdkProcessingMetadata),t._propagationContext=T({},e._propagationContext)),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&$t(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=T(T({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=V(T({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=T(T({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=V(T({},this._extra),{[e]:t}),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,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();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;if(typeof e=="function"){let t=e(this);return t instanceof At?t:this}return e instanceof At?(this._tags=T(T({},this._tags),e._tags),this._extra=T(T({},this._extra),e._extra),this._contexts=T(T({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Ut(e)&&(e=e,this._tags=T(T({},this._tags),e.tags),this._extra=T(T({},this._extra),e.extra),this._contexts=T(T({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),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=Ha(),this}addBreadcrumb(e,t){let r=typeof t=="number"?t:Eh;if(r<=0)return this;let n=T({timestamp:Nn()},e),i=this._breadcrumbs;return i.push(n),this._breadcrumbs=i.length>r?i.slice(-r):i,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._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},r){if(this._extra&&Object.keys(this._extra).length&&(e.extra=T(T({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=T(T({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=T(T({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=T(T({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=T({trace:this._span.getTraceContext()},e.contexts);let s=this._span.transaction;if(s){e.sdkProcessingMetadata=T({dynamicSamplingContext:s.getDynamicSamplingContext()},e.sdkProcessingMetadata);let a=s.name;a&&(e.tags=T({transaction:a},e.tags))}}this._applyFingerprint(e);let n=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...n];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata=V(T(T({},e.sdkProcessingMetadata),this._sdkProcessingMetadata),{propagationContext:this._propagationContext}),bn([...r||[],...is(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=T(T({},this._sdkProcessingMetadata),e),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Bf(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function Ha(){return{traceId:oe(),spanId:oe().substring(16)}}var Lc=4,Sh=100,ss=class{constructor(e,t=new At,r=Lc){this._version=r,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let t=this.getStackTop();t.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=At.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){let r=this._lastEventId=t&&t.event_id?t.event_id:oe(),n=new Error("Sentry syntheticException");return this._withClient((i,s)=>{i.captureException(e,V(T({originalException:e,syntheticException:n},t),{event_id:r}),s)}),r}captureMessage(e,t,r){let n=this._lastEventId=r&&r.event_id?r.event_id:oe(),i=new Error(e);return this._withClient((s,a)=>{s.captureMessage(e,t,V(T({originalException:e,syntheticException:i},r),{event_id:n}),a)}),n}captureEvent(e,t){let r=t&&t.event_id?t.event_id:oe();return e.type||(this._lastEventId=r),this._withClient((n,i)=>{n.captureEvent(e,V(T({},t),{event_id:r}),i)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:r,client:n}=this.getStackTop();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:s=Sh}=n.getOptions&&n.getOptions()||{};if(s<=0)return;let a=Nn(),c=T({timestamp:a},e),u=i?Cc(()=>i(c,t)):c;u!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",u,t),r.addBreadcrumb(u,s))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){let{scope:t,client:r}=this.getStackTop();r&&e(t)}run(e){let t=Wa(this);try{e(this)}finally{Wa(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){let r=this._callExtensionMethod("startTransaction",e,t);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!r){let n=this.getClient();console.warn(n?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
8
|
+
Sentry.addTracingExtensions();
|
|
9
|
+
Sentry.init({...});
|
|
10
|
+
`:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,t=e.getSession();t&&bh(t),this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=ns}=r&&r.getOptions()||{},{userAgent:s}=Q.navigator||{},a=vh(T(T({release:n,environment:i,user:t.getUser()},s&&{userAgent:s}),e)),c=t.getSession&&t.getSession();return c&&c.status==="ok"&&$t(c,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop(),r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}_withClient(e){let{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){let r=Or().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function Or(){return Q.__SENTRY__=Q.__SENTRY__||{extensions:{},hub:void 0},Q}function Wa(e){let t=Or(),r=Ci(t);return Bc(t,e),r}function ee(){let e=Or();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return wh(e)}function wh(e=Or()){return(!Th(e)||Ci(e).isOlderThan(Lc))&&Bc(e,new ss),Ci(e)}function Th(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Ci(e){return Rc("hub",()=>new ss,e)}function Bc(e,t){if(!e)return!1;let r=e.__SENTRY__=e.__SENTRY__||{};return r.hub=t,!0}function as(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=ee().getClient(),r=e||t&&t.getOptions();return!!r&&(r.enableTracing||"tracesSampleRate"in r||"tracesSampler"in r)}function Ur(e){return ee().getScope().getTransaction()}var Ka=!1;function Ih(){Ka||(Ka=!0,me("error",Di),me("unhandledrejection",Di))}function Di(){let e=Ur();if(e){let t="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}Di.tag="sentry_tracingErrorCallback";var Mc=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},Vc=class{constructor(e={}){this.traceId=e.traceId||oe(),this.spanId=e.spanId||oe().substring(16),this.startTimestamp=e.startTimestamp||gt(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){let t=new Vc(V(T({},e),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.transaction){let r=e&&e.op||"< unknown op >",n=t.transaction.name||"< unknown name >",i=t.transaction.spanId,s=`[Tracing] Starting '${r}' span on transaction '${n}' (${i}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:s},k.log(s)}return t}setTag(e,t){return this.tags=V(T({},this.tags),{[e]:t}),this}setData(e,t){return this.data=V(T({},this.data),{[e]:t}),this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);let t=jh(e);return t!=="unknown_error"&&this.setStatus(t),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&k.log(t.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:gt()}toTraceparent(){return rs(this.traceId,this.spanId,this.sampled)}toContext(){return Ke({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return Ke({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return Ke({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function jh(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){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(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function kn(e,t,r){let n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:s}=r&&r.getUser()||{},a=Ke({environment:n.environment||ns,release:n.release,user_segment:s,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}var zc=class extends Vc{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||ee(),this._name=e.name||"",this.metadata=V(T({source:"custom"},e.metadata),{spanMetadata:{}}),this._trimEnd=e.trimEnd,this.transaction=this;let r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext=T({},r))}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Mc(e)),this.spanRecorder.add(this)}setContext(e,t){t===null?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,r=""){this._measurements[e]={value:t,unit:r}}setMetadata(e){this.metadata=T(T({},this.metadata),e)}finish(e){let t=this._finishTransaction(e);if(t)return this._hub.captureEvent(t)}toContext(){let e=super.toContext();return Ke(V(T({},e),{name:this.name,trimEnd:this._trimEnd}))}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||ee(),t=e.getClient();if(!t)return{};let r=e.getScope(),n=kn(this.traceId,t,r),i=this.metadata.sampleRate;i!==void 0&&(n.sample_rate=`${i}`);let s=this.metadata.source;return s&&s!=="url"&&(n.transaction=this.name),this.sampled!==void 0&&(n.sampled=String(this.sampled)),n}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","transaction");return}let r=this.spanRecorder?this.spanRecorder.spans.filter(s=>s!==this&&s.endTimestamp):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((s,a)=>s.endTimestamp&&a.endTimestamp?s.endTimestamp>a.endTimestamp?s:a:s).endTimestamp);let n=this.metadata,i=T({contexts:V(T({},this._contexts),{trace:this.getTraceContext()}),spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:V(T({},n),{dynamicSamplingContext:this.getDynamicSamplingContext()})},n.source&&{transaction_info:{source:n.source}});return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}},hn={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Rh="finishReason",Rt=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],Ch=class extends Mc{constructor(e,t,r,n){super(n),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=r}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp=typeof t=="number"?t:gt(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},Dh=class extends zc{constructor(e,t,r=hn.idleTimeout,n=hn.finalTimeout,i=hn.heartbeatInterval,s=!1){super(e,t),this._idleHub=t,this._idleTimeout=r,this._finalTimeout=n,this._heartbeatInterval=i,this._onScope=s,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Rt[4],s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Rt[3],this.finish())},this._finalTimeout)}finish(e=gt()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Rh,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let t of this._beforeFinishCallbacks)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(t=>{if(t.spanId===this.spanId)return!0;t.endTimestamp||(t.endTimestamp=e,t.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));let r=t.startTimestamp<e,n=(this._finalTimeout+this._idleTimeout)/1e3,i=t.endTimestamp-this.startTimestamp<n;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let s=JSON.stringify(t,void 0,2);r?i||k.log("[Tracing] discarding Span since it finished after Transaction final timeout",s):k.log("[Tracing] discarding Span since it happened after Transaction was finished",s)}return r&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] No active IdleTransaction");if(this._onScope){let t=this._idleHub.getScope();t.getTransaction()===this&&t.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let t=n=>{this._finished||this._pushActivity(n)},r=n=>{this._finished||this._popActivity(n)};this.spanRecorder=new Ch(t,r,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=t===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Rt[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=Rt[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let t=gt();this._idleTimeoutCanceledPermanently?(this._finishReason=Rt[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Rt[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function Nh(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function qc(e,t,r){if(!as(t))return e.sampled=!1,e;if(e.sampled!==void 0)return e.setMetadata({sampleRate:Number(e.sampled)}),e;let n;return typeof t.tracesSampler=="function"?(n=t.tracesSampler(r),e.setMetadata({sampleRate:Number(n)})):r.parentSampled!==void 0?n=r.parentSampled:typeof t.tracesSampleRate<"u"?(n=t.tracesSampleRate,e.setMetadata({sampleRate:Number(n)})):(n=1,e.setMetadata({sampleRate:n})),kh(n)?n?(e.sampled=Math.random()<n,e.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] starting ${e.op} transaction - ${e.name}`),e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),e)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),e.sampled=!1,e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)}function kh(e){return Ic(e)||!(typeof e=="number"||typeof e=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e<0||e>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function Ph(e,t){let r=this.getClient(),n=r&&r.getOptions()||{},i=n.instrumenter||"sentry",s=e.instrumenter||"sentry";i!==s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.error(`A transaction was started with instrumenter=\`${s}\`, but the SDK is configured with the \`${i}\` instrumenter.
|
|
11
|
+
The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),e.sampled=!1);let a=new zc(e,this);return a=qc(a,n,T({parentSampled:e.parentSampled,transactionContext:e},t)),a.sampled&&a.initSpanRecorder(n._experiments&&n._experiments.maxSpans),r&&r.emit&&r.emit("startTransaction",a),a}function Xa(e,t,r,n,i,s,a){let c=e.getClient(),u=c&&c.getOptions()||{},d=new Dh(t,e,r,n,a,i);return d=qc(d,u,T({parentSampled:t.parentSampled,transactionContext:t},s)),d.sampled&&d.initSpanRecorder(u._experiments&&u._experiments.maxSpans),c&&c.emit&&c.emit("startTransaction",d),d}function Ah(){let e=Or();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=Ph),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=Nh),Ih())}function Oh(e,t){return ee().captureException(e,{captureContext:t})}function Uh(e){ee().withScope(e)}var Zh="7";function $h(e){let t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function Lh(e){return`${$h(e)}${e.projectId}/envelope/`}function Bh(e,t){return bf(T({sentry_key:e.publicKey,sentry_version:Zh},t&&{sentry_client:`${t.name}/${t.version}`}))}function Mh(e,t={}){let r=typeof t=="string"?t:t.tunnel,n=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return r||`${Lh(e)}?${Bh(e,n)}`}function Vh(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function zh(e,t,r,n){let i=$c(r),s=T(T({sent_at:new Date().toISOString()},i&&{sdk:i}),!!n&&t&&{dsn:Dn(t)}),a="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Ar(s,[a])}function qh(e,t,r,n){let i=$c(r),s=e.type&&e.type!=="replay_event"?e.type:"event";Vh(e,r&&r.sdk);let a=fh(e,i,n,t);return delete e.sdkProcessingMetadata,Ar(a,[[{type:s},e]])}var Ja=[];function Gh(e,t){let r={};return t.forEach(n=>{n&&Gc(e,n,r)}),r}function Gc(e,t,r){if(r[t.name]=t,Ja.indexOf(t.name)===-1&&(t.setupOnce(yh,ee),Ja.push(t.name)),e.on&&typeof t.preprocessEvent=="function"){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,s)=>n(i,s,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){let n=t.processEvent.bind(t),i=Object.assign((s,a)=>n(s,a,e),{id:t.name});e.addEventProcessor(i)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`Integration installed: ${t.name}`)}function Yh(e,t,r,n,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,c=V(T({},t),{event_id:t.event_id||r.event_id||oe(),timestamp:t.timestamp||Nn()}),u=r.integrations||e.integrations.map(g=>g.name);Fh(c,e),Kh(c,u),t.type===void 0&&Hh(c,e.stackParser);let d=n;r.captureContext&&(d=At.clone(d).update(r.captureContext));let l=_t(c),p=i&&i.getEventProcessors?i.getEventProcessors():[];if(d){if(d.getAttachments){let g=[...r.attachments||[],...d.getAttachments()];g.length&&(r.attachments=g)}l=d.applyToEvent(c,r,p)}else l=bn([...p,...is()],c,r);return l.then(g=>(g&&Wh(g),typeof s=="number"&&s>0?Xh(g,s,a):g))}function Fh(e,t){let{environment:r,release:n,dist:i,maxValueLength:s=250}=t;"environment"in e||(e.environment="environment"in t?r:ns),e.release===void 0&&n!==void 0&&(e.release=n),e.dist===void 0&&i!==void 0&&(e.dist=i),e.message&&(e.message=Pt(e.message,s));let a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Pt(a.value,s));let c=e.request;c&&c.url&&(c.url=Pt(c.url,s))}var Qa=new WeakMap;function Hh(e,t){let r=Q._sentryDebugIds;if(!r)return;let n,i=Qa.get(t);i?n=i:(n=new Map,Qa.set(t,n));let s=Object.keys(r).reduce((a,c)=>{let u,d=n.get(c);d?u=d:(u=t(c),n.set(c,u));for(let l=u.length-1;l>=0;l--){let p=u[l];if(p.filename){a[p.filename]=r[c];break}}return a},{});try{e.exception.values.forEach(a=>{a.stacktrace.frames.forEach(c=>{c.filename&&(c.debug_id=s[c.filename])})})}catch{}}function Wh(e){let t={};try{e.exception.values.forEach(n=>{n.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let r=e.debug_meta.images;Object.keys(t).forEach(n=>{r.push({type:"sourcemap",code_file:n,debug_id:t[n]})})}function Kh(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Xh(e,t,r){if(!e)return null;let n=T(T(T(T(T({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>T(T({},i),i.data&&{data:He(i.data,t,r)}))}),e.user&&{user:He(e.user,t,r)}),e.contexts&&{contexts:He(e.contexts,t,r)}),e.extra&&{extra:He(e.extra,t,r)});return e.contexts&&e.contexts.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=He(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(i=>(i.data&&(i.data=He(i.data,t,r)),i))),n}var eo="Not capturing exception because it's already been captured.",Jh=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=vf(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("No DSN provided, client will not send events."),this._dsn){let t=Mh(this._dsn,e);this._transport=e.transport(V(T({recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}}captureException(e,t,r){if(za(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(eo);return}let n=t&&t.event_id;return this._process(this.eventFromException(e,t).then(i=>this._captureEvent(i,t,r)).then(i=>{n=i})),n}captureMessage(e,t,r,n){let i=r&&r.event_id,s=Tc(e)?this.eventFromMessage(String(e),t,r):this.eventFromException(e,r);return this._process(s.then(a=>this._captureEvent(a,r,n)).then(a=>{i=a})),i}captureEvent(e,t,r){if(t&&t.originalException&&za(t.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(eo);return}let n=t&&t.event_id;return this._process(this._captureEvent(e,t,r).then(i=>{n=i})),n}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),$t(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?this._isClientDoneProcessing(e).then(r=>t.flush(e).then(n=>r&&n)):_t(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=Gh(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Gc(this,e,this._integrations)}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=qh(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of t.attachments||[])r=oh(r,dh(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let n=this._sendEnvelope(r);n&&n.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let t=zh(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){let n=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(r=>r(...t))}_updateSessionFromEvent(e,t){let r=!1,n=!1,i=t.exception&&t.exception.values;if(i){n=!0;for(let a of i){let c=a.mechanism;if(c&&c.handled===!1){r=!0;break}}}let s=e.status==="ok";(s&&e.errors===0||s&&r)&&($t(e,V(T({},r&&{status:"crashed"}),{errors:e.errors||Number(n||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new pe(t=>{let r=0,n=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),t(!0)):(r+=n,e&&r>=e&&(clearInterval(i),t(!1)))},n)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,r){let n=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),this.emit("preprocessEvent",e,t),Yh(n,e,t,r,this).then(s=>{if(s===null)return s;let{propagationContext:a}=s.sdkProcessingMetadata||{};if(!(s.contexts&&s.contexts.trace)&&a){let{traceId:c,spanId:u,parentSpanId:d,dsc:l}=a;s.contexts=T({trace:{trace_id:c,span_id:u,parent_span_id:d}},s.contexts);let p=l||kn(c,this,r);s.sdkProcessingMetadata=T({dynamicSamplingContext:p},s.sdkProcessingMetadata)}return s})}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(n=>n.event_id,n=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=n;i.logLevel==="log"?k.log(i.message):k.warn(i)}})}_processEvent(e,t,r){let n=this.getOptions(),{sampleRate:i}=n,s=Fc(e),a=Yc(e),c=e.type||"error",u=`before send for type \`${c}\``;if(a&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),ts(new De(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let d=c==="replay_event"?"replay":c;return this._prepareEvent(e,t,r).then(l=>{if(l===null)throw this.recordDroppedEvent("event_processor",d,e),new De("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return l;let p=ep(n,l,t);return Qh(p,u)}).then(l=>{if(l===null)throw this.recordDroppedEvent("before_send",d,e),new De(`${u} returned \`null\`, will not send event.`,"log");let p=r&&r.getSession();!s&&p&&this._updateSessionFromEvent(p,l);let g=l.transaction_info;if(s&&g&&l.transaction!==e.transaction){let m="custom";l.transaction_info=V(T({},g),{source:m})}return this.sendEvent(l,t),l}).then(null,l=>{throw l instanceof De?l:(this.captureException(l,{data:{__sentry__:!0},originalException:l}),new De(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
12
|
+
Reason: ${l}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,t=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.error("Error while sending event:",t)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{let[r,n]=t.split(":");return{reason:r,category:n,quantity:e[t]}})}};function Qh(e,t){let r=`${t} must return \`null\` or a valid event.`;if(Ji(e))return e.then(n=>{if(!Ut(n)&&n!==null)throw new De(r);return n},n=>{throw new De(`${t} rejected with ${n}`)});if(!Ut(e)&&e!==null)throw new De(r);return e}function ep(e,t,r){let{beforeSend:n,beforeSendTransaction:i}=e;return Yc(t)&&n?n(t,r):Fc(t)&&i?i(t,r):t}function Yc(e){return e.type===void 0}function Fc(e){return e.type==="transaction"}var tp=30;function Hc(e,t,r=Wf(e.bufferSize||tp)){let n={},i=a=>r.drain(a);function s(a){let c=[];if(Ya(a,(p,g)=>{let m=Fa(g);if(_h(n,m)){let x=to(p,g);e.recordDroppedEvent("ratelimit_backoff",m,x)}else c.push(p)}),c.length===0)return _t();let u=Ar(a[0],c),d=p=>{Ya(u,(g,m)=>{let x=to(g,m);e.recordDroppedEvent(p,Fa(m),x)})},l=()=>t({body:ch(u,e.textEncoder)}).then(p=>(p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),n=gh(n,p),p),p=>{throw d("network_error"),p});return r.add(l).then(p=>p,p=>{if(p instanceof De)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.error("Skipped sending event because buffer is full."),d("queue_overflow"),_t();throw p})}return s.__sentry__baseTransport__=!0,{send:s,flush:i}}function to(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}var ro="7.73.0",Wc={};bc(Wc,{FunctionToString:()=>os,InboundFilters:()=>cs});var no,os=class{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=os.id}setupOnce(){no=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=es(this)||this;return no.apply(t,e)}}catch{}}};os.__initStatic();var rp=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],np=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/],cs=class{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=cs.id,this._options=e}setupOnce(e,t){}processEvent(e,t,r){let n=r.getOptions(),i=ip(this._options,n);return sp(e,i)?null:e}};cs.__initStatic();function ip(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:rp],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:np],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function sp(e,t){return t.ignoreInternal&&lp(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Event dropped due to being internal Sentry Error.
|
|
13
|
+
Event: ${We(e)}`),!0):ap(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
14
|
+
Event: ${We(e)}`),!0):op(e,t.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
15
|
+
Event: ${We(e)}`),!0):cp(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
16
|
+
Event: ${We(e)}.
|
|
17
|
+
Url: ${xn(e)}`),!0):up(e,t.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
18
|
+
Event: ${We(e)}.
|
|
19
|
+
Url: ${xn(e)}`),!0)}function ap(e,t){return e.type||!t||!t.length?!1:dp(e).some(r=>kr(r,t))}function op(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let r=e.transaction;return r?kr(r,t):!1}function cp(e,t){if(!t||!t.length)return!1;let r=xn(e);return r?kr(r,t):!1}function up(e,t){if(!t||!t.length)return!0;let r=xn(e);return r?kr(r,t):!0}function dp(e){let t=[];e.message&&t.push(e.message);let r;try{r=e.exception.values[e.exception.values.length-1]}catch{}return r&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.length===0&&k.error(`Could not extract message for event ${We(e)}`),t}function lp(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function fp(e=[]){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function xn(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?fp(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.error(`Cannot extract url for event ${We(e)}`),null}}var F=Q,Ni=0;function Kc(){return Ni>0}function hp(){Ni++,setTimeout(()=>{Ni--})}function Lt(e,t={},r){if(typeof e!="function")return e;try{let i=e.__sentry_wrapped__;if(i)return i;if(es(e))return e}catch{return e}let n=function(){let i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let s=i.map(a=>Lt(a,t));return e.apply(this,s)}catch(s){throw hp(),Uh(a=>{a.addEventProcessor(c=>(t.mechanism&&(Si(c,void 0),Tr(c,t.mechanism)),c.extra=V(T({},c.extra),{arguments:i}),c)),Oh(s)}),s}};try{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}Nc(n,e),Qi(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return e.name}})}catch{}return n}function Xc(e,t){let r=us(e,t),n={type:t&&t.name,value:gp(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function pp(e,t,r,n){let i=ee().getClient(),s=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:Cn(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:bp(t,{isUnhandledRejection:n})}]},extra:{__serialized__:Oc(t,s)}};if(r){let c=us(e,r);c.length&&(a.exception.values[0].stacktrace={frames:c})}return a}function ui(e,t){return{exception:{values:[Xc(e,t)]}}}function us(e,t){let r=t.stacktrace||t.stack||"",n=_p(t);try{return e(r,n)}catch{}return[]}var mp=/Minified React error #\d+;/i;function _p(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(mp.test(e.message))return 1}return 0}function gp(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function yp(e,t,r,n){let i=r&&r.syntheticException||void 0,s=ds(e,t,i,n);return Tr(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),_t(s)}function vp(e,t,r="info",n,i){let s=n&&n.syntheticException||void 0,a=ki(e,t,s,i);return a.level=r,n&&n.event_id&&(a.event_id=n.event_id),_t(a)}function ds(e,t,r,n,i){let s;if(Xi(t)&&t.error)return ui(e,t.error);if(ka(t)||tf(t)){let a=t;if("stack"in t)s=ui(e,t);else{let c=a.name||(ka(a)?"DOMError":"DOMException"),u=a.message?`${c}: ${a.message}`:c;s=ki(e,u,r,n),Si(s,u)}return"code"in a&&(s.tags=V(T({},s.tags),{"DOMException.code":`${a.code}`})),s}return wc(t)?ui(e,t):Ut(t)||Cn(t)?(s=pp(e,t,r,i),Tr(s,{synthetic:!0}),s):(s=ki(e,t,r,n),Si(s,`${t}`),Tr(s,{synthetic:!0}),s)}function ki(e,t,r,n){let i={message:t};if(n&&r){let s=us(e,r);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]})}return i}function bp(e,{isUnhandledRejection:t}){let r=xf(e),n=t?"promise rejection":"exception";return Xi(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Cn(e)?`Event \`${xp(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function xp(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Ep(e,{metadata:t,tunnel:r,dsn:n}){let i=T(T({event_id:e.event_id,sent_at:new Date().toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!r&&!!n&&{dsn:Dn(n)}),s=Sp(e);return Ar(i,[s])}function Sp(e){return[{type:"user_report"},e]}var wp=class extends Jh{constructor(e){let t=F.SENTRY_SDK_SOURCE||Vf();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:ro}],version:ro},super(e),e.sendClientReports&&F.document&&F.document.addEventListener("visibilitychange",()=>{F.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return yp(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return vp(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("SDK not enabled, will not capture user feedback.");return}let t=Ep(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("Sending outcomes:",e);let t=hh(e,this._options.tunnel&&Dn(this._dsn));this._sendEnvelope(t)}},Er;function Tp(){if(Er)return Er;if(xi(F.fetch))return Er=F.fetch.bind(F);let e=F.document,t=F.fetch;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);let n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return Er=t.bind(F)}function Ip(){Er=void 0}function jp(e,t=Tp()){let r=0,n=0;function i(s){let a=s.body.length;r+=a,n++;let c=T({body:s.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15},e.fetchOptions);try{return t(e.url,c).then(u=>(r-=a,n--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return Ip(),r-=a,n--,ts(u)}}return Hc(e,i)}var Rp=4;function Cp(e){function t(r){return new pe((n,i)=>{let s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===Rp&&n({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",e.url);for(let a in e.headers)Object.prototype.hasOwnProperty.call(e.headers,a)&&s.setRequestHeader(a,e.headers[a]);s.send(r.body)})}return Hc(e,t)}var Pn="?",Dp=30,Np=40,kp=50;function ls(e,t,r,n){let i={filename:e,function:t,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var Pp=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ap=/\((\S*)(?::(\d+))(?::(\d+))\)/,Op=e=>{let t=Pp.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){let i=Ap.exec(t[2]);i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3])}let[r,n]=Jc(t[1]||Pn,t[2]);return ls(n,r,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},Up=[Dp,Op],Zp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$p=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Lp=e=>{let t=Zp.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=$p.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],n=t[1]||Pn;return[n,r]=Jc(n,r),ls(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Bp=[kp,Lp],Mp=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Vp=e=>{let t=Mp.exec(e);return t?ls(t[2],t[1]||Pn,+t[3],t[4]?+t[4]:void 0):void 0},zp=[Np,Vp],qp=[Up,Bp,zp],Gp=Ef(...qp),Jc=(e,t)=>{let r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:Pn,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Yt=class{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=Yt.id,this._options=T({onerror:!0,onunhandledrejection:!0},e),this._installFunc={onerror:Yp,onunhandledrejection:Fp}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let t in e){let r=this._installFunc[t];r&&e[t]&&(Kp(t),r(),this._installFunc[t]=void 0)}}};Yt.__initStatic();function Yp(){me("error",e=>{let[t,r,n]=tu();if(!t.getIntegration(Yt))return;let{msg:i,url:s,line:a,column:c,error:u}=e;if(Kc()||u&&u.__sentry_own_request__)return;let d=u===void 0&&Xe(i)?Wp(i,s,a,c):Qc(ds(r,u||i,void 0,n,!1),s,a,c);d.level="error",eu(t,u,d,"onerror")})}function Fp(){me("unhandledrejection",e=>{let[t,r,n]=tu();if(!t.getIntegration(Yt))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch{}if(Kc()||i&&i.__sentry_own_request__)return!0;let s=Tc(i)?Hp(i):ds(r,i,void 0,n,!0);s.level="error",eu(t,i,s,"onunhandledrejection")})}function Hp(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Wp(e,t,r,n){let i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,s=Xi(e)?e.message:e,a="Error",c=s.match(i);return c&&(a=c[1],s=c[2]),Qc({exception:{values:[{type:a,value:s}]}},t,r,n)}function Qc(e,t,r,n){let i=e.exception=e.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},c=a.stacktrace=a.stacktrace||{},u=c.frames=c.frames||[],d=isNaN(parseInt(n,10))?void 0:n,l=isNaN(parseInt(r,10))?void 0:r,p=Xe(t)&&t.length>0?t:lf();return u.length===0&&u.push({colno:d,filename:p,function:"?",in_app:!0,lineno:l}),e}function Kp(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`Global Handler attached: ${e}`)}function eu(e,t,r,n){Tr(r,{handled:!1,type:n}),e.captureEvent(r,{originalException:t})}function tu(){let e=ee(),t=e.getClient(),r=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,r.stackParser,r.attachStacktrace]}var Xp=["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"],fs=class{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=fs.id,this._options=T({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}setupOnce(){this._options.setTimeout&&ne(F,"setTimeout",io),this._options.setInterval&&ne(F,"setInterval",io),this._options.requestAnimationFrame&&ne(F,"requestAnimationFrame",Jp),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&ne(XMLHttpRequest.prototype,"send",Qp);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:Xp).forEach(em)}};fs.__initStatic();function io(e){return function(...t){let r=t[0];return t[0]=Lt(r,{mechanism:{data:{function:Je(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Jp(e){return function(t){return e.apply(this,[Lt(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Je(e)},handled:!1,type:"instrument"}})])}}function Qp(e){return function(...t){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&ne(r,n,function(i){let s={mechanism:{data:{function:n,handler:Je(i)},handled:!1,type:"instrument"}},a=es(i);return a&&(s.mechanism.data.handler=Je(a)),Lt(i,s)})}),e.apply(this,t)}}function em(e){let t=F,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ne(r,"addEventListener",function(n){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=Lt(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Je(s),target:e},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,Lt(s,{mechanism:{data:{function:"addEventListener",handler:Je(s),target:e},handled:!1,type:"instrument"}}),a])}}),ne(r,"removeEventListener",function(n){return function(i,s,a){let c=s;try{let u=c&&c.__sentry_wrapped__;u&&n.call(this,i,u,a)}catch{}return n.call(this,i,c,a)}}))}var an=1024,An=class{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=An.id,this.options=T({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}setupOnce(){if(this.options.console&&me("console",nm),this.options.dom&&me("dom",rm(this.options.dom)),this.options.xhr&&me("xhr",im),this.options.fetch&&me("fetch",sm),this.options.history&&me("history",am),this.options.sentry){let e=ee().getClient();e&&e.on&&e.on("beforeSendEvent",tm)}}};An.__initStatic();function tm(e){ee().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:We(e)},{event:e})}function rm(e){function t(r){let n,i=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>an&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`\`dom.maxStringLength\` cannot exceed ${an}, but a value of ${s} was configured. Sentry will use ${an} instead.`),s=an),typeof i=="string"&&(i=[i]);try{let a=r.event;n=om(a)?Zt(a.target,{keyAttrs:i,maxStringLength:s}):Zt(a,{keyAttrs:i,maxStringLength:s})}catch{n="<unknown>"}n.length!==0&&ee().addBreadcrumb({category:`ui.${r.name}`,message:n},{event:r.event,name:r.name,global:r.global})}return t}function nm(e){let t={category:"console",data:{arguments:e.args,logger:"console"},level:Xf(e.level),message:Pa(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message=`Assertion failed: ${Pa(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1);else return;ee().addBreadcrumb(t,{input:e.args,level:e.level})}function im(e){let{startTimestamp:t,endTimestamp:r}=e,n=e.xhr[kt];if(!t||!r||!n)return;let{method:i,url:s,status_code:a,body:c}=n,u={method:i,url:s,status_code:a},d={xhr:e.xhr,input:c,startTimestamp:t,endTimestamp:r};ee().addBreadcrumb({category:"xhr",data:u,type:"http"},d)}function sm(e){let{startTimestamp:t,endTimestamp:r}=e;if(r&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let n=e.fetchData,i={data:e.error,input:e.args,startTimestamp:t,endTimestamp:r};ee().addBreadcrumb({category:"fetch",data:n,level:"error",type:"http"},i)}else{let n=V(T({},e.fetchData),{status_code:e.response&&e.response.status}),i={input:e.args,response:e.response,startTimestamp:t,endTimestamp:r};ee().addBreadcrumb({category:"fetch",data:n,type:"http"},i)}}function am(e){let t=e.from,r=e.to,n=oi(F.location.href),i=oi(t),s=oi(r);i.path||(i=n),n.protocol===s.protocol&&n.host===s.host&&(r=s.relative),n.protocol===i.protocol&&n.host===i.host&&(t=i.relative),ee().addBreadcrumb({category:"navigation",data:{from:t,to:r}})}function om(e){return!!e&&!!e.target}var cm="cause",um=5,On=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=On.id,this._key=e.key||cm,this._limit=e.limit||um}setupOnce(){}preprocessEvent(e,t,r){let n=r.getOptions();of(Xc,n.stackParser,n.maxValueLength,this._key,this._limit,e,t)}};On.__initStatic();var Un=class{static __initStatic(){this.id="HttpContext"}constructor(){this.name=Un.id}setupOnce(){}preprocessEvent(e){if(!F.navigator&&!F.location&&!F.document)return;let t=e.request&&e.request.url||F.location&&F.location.href,{referrer:r}=F.document||{},{userAgent:n}=F.navigator||{},i=T(T(T({},e.request&&e.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=V(T(T({},e.request),t&&{url:t}),{headers:i});e.request=s}};Un.__initStatic();var Zn=class{static __initStatic(){this.id="Dedupe"}constructor(){this.name=Zn.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(dm(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}};Zn.__initStatic();function dm(e,t){return t?!!(lm(e,t)||fm(e,t)):!1}function lm(e,t){let r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!nu(e,t)||!ru(e,t))}function fm(e,t){let r=so(t),n=so(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!nu(e,t)||!ru(e,t))}function ru(e,t){let r=ao(e),n=ao(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let s=n[i],a=r[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function nu(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function so(e){return e.exception&&e.exception.values&&e.exception.values[0]}function ao(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}var iu={};bc(iu,{Breadcrumbs:()=>An,Dedupe:()=>Zn,GlobalHandlers:()=>Yt,HttpContext:()=>Un,LinkedErrors:()=>On,TryCatch:()=>fs});var Y=Q;function hm(){Y&&Y.document?Y.document.addEventListener("visibilitychange",()=>{let e=Ur();if(Y.document.hidden&&e){let t="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${e.op}`),e.status||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var hs=(e,t,r)=>{let n,i;return s=>{t.value>=0&&(s||r)&&(i=t.value-(n||0),(i||n===void 0)&&(n=t.value,t.delta=i,e(t)))}},pm=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,mm=()=>{let e=Y.performance.timing,t=Y.performance.navigation.type,r={entryType:"navigation",startTime:0,type:t==2?"back_forward":t===1?"reload":"navigate"};for(let n in e)n!=="navigationStart"&&n!=="toJSON"&&(r[n]=Math.max(e[n]-e.navigationStart,0));return r},su=()=>Y.__WEB_VITALS_POLYFILL__?Y.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||mm()):Y.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],au=()=>{let e=su();return e&&e.activationStart||0},ps=(e,t)=>{let r=su(),n="navigate";return r&&(Y.document.prerendering||au()>0?n="prerender":n=r.type.replace(/_/g,"-")),{name:e,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:pm(),navigationType:n}},Zr=(e,t,r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let n=new PerformanceObserver(i=>{t(i.getEntries())});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch{}},$n=(e,t)=>{let r=n=>{(n.type==="pagehide"||Y.document.visibilityState==="hidden")&&(e(n),t&&(removeEventListener("visibilitychange",r,!0),removeEventListener("pagehide",r,!0)))};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},_m=e=>{let t=ps("CLS",0),r,n=0,i=[],s=c=>{c.forEach(u=>{if(!u.hadRecentInput){let d=i[0],l=i[i.length-1];n&&i.length!==0&&u.startTime-l.startTime<1e3&&u.startTime-d.startTime<5e3?(n+=u.value,i.push(u)):(n=u.value,i=[u]),n>t.value&&(t.value=n,t.entries=i,r&&r())}})},a=Zr("layout-shift",s);if(a){r=hs(e,t);let c=()=>{s(a.takeRecords()),r(!0)};return $n(c),c}},pn=-1,gm=()=>Y.document.visibilityState==="hidden"&&!Y.document.prerendering?0:1/0,ym=()=>{$n(({timeStamp:e})=>{pn=e},!0)},ms=()=>(pn<0&&(pn=gm(),ym()),{get firstHiddenTime(){return pn}}),vm=e=>{let t=ms(),r=ps("FID"),n,i=c=>{c.startTime<t.firstHiddenTime&&(r.value=c.processingStart-c.startTime,r.entries.push(c),n(!0))},s=c=>{c.forEach(i)},a=Zr("first-input",s);n=hs(e,r),a&&$n(()=>{s(a.takeRecords()),a.disconnect()},!0)},oo={},bm=e=>{let t=ms(),r=ps("LCP"),n,i=a=>{let c=a[a.length-1];if(c){let u=Math.max(c.startTime-au(),0);u<t.firstHiddenTime&&(r.value=u,r.entries=[c],n())}},s=Zr("largest-contentful-paint",i);if(s){n=hs(e,r);let a=()=>{oo[r.id]||(i(s.takeRecords()),s.disconnect(),oo[r.id]=!0,n(!0))};return["keydown","click"].forEach(c=>{addEventListener(c,a,{once:!0,capture:!0})}),$n(a,!0),a}};function di(e){return typeof e=="number"&&isFinite(e)}function Bt(e,t){var r=t,{startTimestamp:n}=r,i=Jl(r,["startTimestamp"]);return n&&e.startTimestamp>n&&(e.startTimestamp=n),e.startChild(T({startTimestamp:n},i))}function J(e){return e/1e3}function ou(){return Y&&Y.addEventListener&&Y.performance}var co=0,X={},Ce,wr;function xm(){let e=ou();if(e&&Ne){e.mark&&Y.performance.mark("sentry-tracing-init"),Im();let t=wm(),r=Tm();return()=>{t&&t(),r&&r()}}return()=>{}}function Em(){Zr("longtask",e=>{for(let t of e){let r=Ur();if(!r)return;let n=J(Ne+t.startTime),i=J(t.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+i})}})}function Sm(){Zr("event",e=>{for(let t of e){let r=Ur();if(!r)return;if(t.name==="click"){let n=J(Ne+t.startTime),i=J(t.duration);r.startChild({description:Zt(t.target),op:`ui.interaction.${t.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+i})}}},{durationThreshold:0})}function wm(){return _m(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding CLS"),X.cls={value:e.value,unit:""},wr=t)})}function Tm(){return bm(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding LCP"),X.lcp={value:e.value,unit:"millisecond"},Ce=t)})}function Im(){vm(e=>{let t=e.entries.pop();if(!t)return;let r=J(Ne),n=J(t.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding FID"),X.fid={value:e.value,unit:"millisecond"},X["mark.fid"]={value:r+n,unit:"second"}})}function jm(e){let t=ou();if(!t||!Y.performance.getEntries||!Ne)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Tracing] Adding & adjusting spans using Performance API");let r=J(Ne),n=t.getEntries(),i,s;if(n.slice(co).forEach(a=>{let c=J(a.startTime),u=J(a.duration);if(!(e.op==="navigation"&&r+c<e.startTimestamp))switch(a.entryType){case"navigation":{Cm(e,a,r),i=r+J(a.responseStart),s=r+J(a.requestStart);break}case"mark":case"paint":case"measure":{Rm(e,a,c,u,r);let d=ms(),l=a.startTime<d.firstHiddenTime;a.name==="first-paint"&&l&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding FP"),X.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&l&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding FCP"),X.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{let d=a.name.replace(Y.location.origin,"");Nm(e,a,d,c,u,r);break}}}),co=Math.max(n.length-1,0),km(e),e.op==="pageload"){typeof i=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding TTFB"),X.ttfb={value:(i-e.startTimestamp)*1e3,unit:"millisecond"},typeof s=="number"&&s<=i&&(X["ttfb.requestTime"]={value:(i-s)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(c=>{if(!X[c]||r>=e.startTimestamp)return;let u=X[c].value,d=r+J(u),l=Math.abs((d-e.startTimestamp)*1e3),p=l-u;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Measurements] Normalized ${c} from ${u} to ${l} (${p})`),X[c].value=l});let a=X["mark.fid"];a&&X.fid&&(Bt(e,{description:"first input delay",endTimestamp:a.value+J(X.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:a.value}),delete X["mark.fid"]),"fcp"in X||delete X.cls,Object.keys(X).forEach(c=>{e.setMeasurement(c,X[c].value,X[c].unit)}),Pm(e)}Ce=void 0,wr=void 0,X={}}function Rm(e,t,r,n,i){let s=i+r,a=s+n;return Bt(e,{description:t.name,endTimestamp:a,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function Cm(e,t,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{on(e,t,n,r)}),on(e,t,"secureConnection",r,"TLS/SSL","connectEnd"),on(e,t,"fetch",r,"cache","domainLookupStart"),on(e,t,"domainLookup",r,"DNS"),Dm(e,t,r)}function on(e,t,r,n,i,s){let a=s?t[s]:t[`${r}End`],c=t[`${r}Start`];!c||!a||Bt(e,{op:"browser",origin:"auto.browser.browser.metrics",description:i||r,startTimestamp:n+J(c),endTimestamp:n+J(a)})}function Dm(e,t,r){Bt(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:r+J(t.requestStart),endTimestamp:r+J(t.responseEnd)}),Bt(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:r+J(t.responseStart),endTimestamp:r+J(t.responseEnd)})}function Nm(e,t,r,n,i,s){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a={};"transferSize"in t&&(a["http.response_transfer_size"]=t.transferSize),"encodedBodySize"in t&&(a["http.response_content_length"]=t.encodedBodySize),"decodedBodySize"in t&&(a["http.decoded_response_content_length"]=t.decodedBodySize),"renderBlockingStatus"in t&&(a["resource.render_blocking_status"]=t.renderBlockingStatus);let c=s+n,u=c+i;Bt(e,{description:r,endTimestamp:u,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:c,data:a})}function km(e){let t=Y.navigator;if(!t)return;let r=t.connection;r&&(r.effectiveType&&e.setTag("effectiveConnectionType",r.effectiveType),r.type&&e.setTag("connectionType",r.type),di(r.rtt)&&(X["connection.rtt"]={value:r.rtt,unit:"millisecond"})),di(t.deviceMemory)&&e.setTag("deviceMemory",`${t.deviceMemory} GB`),di(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}function Pm(e){Ce&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding LCP Data"),Ce.element&&e.setTag("lcp.element",Zt(Ce.element)),Ce.id&&e.setTag("lcp.id",Ce.id),Ce.url&&e.setTag("lcp.url",Ce.url.trim().slice(0,200)),e.setTag("lcp.size",Ce.size)),wr&&wr.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log("[Measurements] Adding CLS Data"),wr.sources.forEach((t,r)=>e.setTag(`cls.source.${r+1}`,Zt(t.node))))}var Pi=["localhost",/^\/(?!\/)/],Ai={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Pi,tracePropagationTargets:Pi};function Am(e){let{traceFetch:t,traceXHR:r,tracePropagationTargets:n,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:a}=T({traceFetch:Ai.traceFetch,traceXHR:Ai.traceXHR},e),c=typeof s=="function"?s:l=>!0,u=l=>$m(l,n||i),d={};t&&me("fetch",l=>{let p=Lm(l,c,u,d);a&&p&&uo(p)}),r&&me("xhr",l=>{let p=Mm(l,c,u,d);a&&p&&uo(p)})}function Om(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function uo(e){let t=e.data.url,r=new PerformanceObserver(n=>{n.getEntries().forEach(i=>{Om(i)&&i.name.endsWith(t)&&(Zm(i).forEach(s=>e.setData(...s)),r.disconnect())})});r.observe({entryTypes:["resource"]})}function Um(e){let t="unknown",r="unknown",n="";for(let i of e){if(i==="/"){[t,r]=e.split("/");break}if(!isNaN(Number(i))){t=n==="h"?"http":n,r=e.split(n)[1];break}n+=i}return n===e&&(t=n),{name:t,version:r}}function Re(e=0){return((Ne||performance.timeOrigin)+e)/1e3}function Zm(e){let{name:t,version:r}=Um(e.nextHopProtocol),n=[];return n.push(["network.protocol.version",r],["network.protocol.name",t]),Ne?[...n,["http.request.redirect_start",Re(e.redirectStart)],["http.request.fetch_start",Re(e.fetchStart)],["http.request.domain_lookup_start",Re(e.domainLookupStart)],["http.request.domain_lookup_end",Re(e.domainLookupEnd)],["http.request.connect_start",Re(e.connectStart)],["http.request.secure_connection_start",Re(e.secureConnectionStart)],["http.request.connection_end",Re(e.connectEnd)],["http.request.request_start",Re(e.requestStart)],["http.request.response_start",Re(e.responseStart)],["http.request.response_end",Re(e.responseEnd)]]:n}function $m(e,t){return kr(e,t||Pi)}function Lm(e,t,r,n){if(!as()||!e.fetchData)return;let i=t(e.fetchData.url);if(e.endTimestamp&&i){let g=e.fetchData.__span;if(!g)return;let m=n[g];if(m){if(e.response){m.setHttpStatus(e.response.status);let x=e.response&&e.response.headers&&e.response.headers.get("content-length"),w=parseInt(x);w>0&&m.setData("http.response_content_length",w)}else e.error&&m.setStatus("internal_error");m.finish(),delete n[g]}return}let s=ee(),a=s.getScope(),c=s.getClient(),u=a.getSpan(),{method:d,url:l}=e.fetchData,p=i&&u?u.startChild({data:{url:l,type:"fetch","http.method":d},description:`${d} ${l}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(p&&(e.fetchData.__span=p.spanId,n[p.spanId]=p),r(e.fetchData.url)&&c){let g=e.args[0];e.args[1]=e.args[1]||{};let m=e.args[1];m.headers=Bm(g,c,a,m,p)}return p}function Bm(e,t,r,n,i){let s=i||r.getSpan(),a=s&&s.transaction,{traceId:c,sampled:u,dsc:d}=r.getPropagationContext(),l=s?s.toTraceparent():rs(c,void 0,u),p=a?a.getDynamicSamplingContext():d||kn(c,t,r),g=ji(p),m=typeof Request<"u"&&Be(e,Request)?e.headers:n.headers;if(m)if(typeof Headers<"u"&&Be(m,Headers)){let x=new Headers(m);return x.append("sentry-trace",l),g&&x.append(Ii,g),x}else if(Array.isArray(m)){let x=[...m,["sentry-trace",l]];return g&&x.push([Ii,g]),x}else{let x="baggage"in m?m.baggage:void 0,w=[];return Array.isArray(x)?w.push(...x):x&&w.push(x),g&&w.push(g),V(T({},m),{"sentry-trace":l,baggage:w.length>0?w.join(","):void 0})}else return{"sentry-trace":l,baggage:g}}function Mm(e,t,r,n){let i=e.xhr,s=i&&i[kt];if(!as()||i&&i.__sentry_own_request__||!i||!s)return;let a=t(s.url);if(e.endTimestamp&&a){let p=i.__sentry_xhr_span_id__;if(!p)return;let g=n[p];g&&(g.setHttpStatus(s.status_code),g.finish(),delete n[p]);return}let c=ee(),u=c.getScope(),d=u.getSpan(),l=a&&d?d.startChild({data:V(T({},s.data),{type:"xhr","http.method":s.method,url:s.url}),description:`${s.method} ${s.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(l&&(i.__sentry_xhr_span_id__=l.spanId,n[i.__sentry_xhr_span_id__]=l),i.setRequestHeader&&r(s.url))if(l){let p=l&&l.transaction,g=p&&p.getDynamicSamplingContext(),m=ji(g);lo(i,l.toTraceparent(),m)}else{let p=c.getClient(),{traceId:g,sampled:m,dsc:x}=u.getPropagationContext(),w=rs(g,void 0,m),I=x||(p?kn(g,p,u):void 0),N=ji(I);lo(i,w,N)}return l}function lo(e,t,r){try{e.setRequestHeader("sentry-trace",t),r&&e.setRequestHeader(Ii,r)}catch{}}function Vm(e,t=!0,r=!0){if(!Y||!Y.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("Could not initialize routing instrumentation due to invalid location");return}let n=Y.location.href,i;t&&(i=e({name:Y.location.pathname,startTimestamp:Ne?Ne/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),r&&me("history",({to:s,from:a})=>{if(a===void 0&&n&&n.indexOf(s)!==-1){n=void 0;return}a!==s&&(n=void 0,i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.finish()),i=e({name:Y.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}var zm="BrowserTracing",qm=T(V(T({},hn),{markBackgroundTransactions:!0,routingInstrumentation:Vm,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{}}),Ai),Gm=class{constructor(e){this.name=zm,this._hasSetTracePropagationTargets=!1,Ah(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options=T(T({},qm),e),this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=xm(),this.options.enableLongTask&&Em(),this.options._experiments.enableInteractions&&Sm()}setupOnce(e,t){this._getCurrentHub=t;let r=t().getClient(),n=r&&r.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:s,startTransactionOnPageLoad:a,markBackgroundTransactions:c,traceFetch:u,traceXHR:d,shouldCreateSpanForRequest:l,enableHTTPTimings:p,_experiments:g}=this.options,m=n&&n.tracePropagationTargets,x=m||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&m&&k.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."),i(w=>{let I=this._createRouteTransaction(w);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(I,w,t),I},a,s),c&&hm(),g.enableInteractions&&this._registerInteractionListener(),Am({traceFetch:u,traceXHR:d,tracePropagationTargets:x,shouldCreateSpanForRequest:l,enableHTTPTimings:p})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let t=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:n,finalTimeout:i,heartbeatInterval:s}=this.options,a=e.op==="pageload",c=a?fo("sentry-trace"):"",u=a?fo("baggage"):"",{traceparentData:d,dynamicSamplingContext:l,propagationContext:p}=ah(c,u),g=V(T(T({},e),d),{metadata:V(T({},e.metadata),{dynamicSamplingContext:d&&!l?{}:l}),trimEnd:!0}),m=typeof r=="function"?r(g):g,x=m===void 0?V(T({},g),{sampled:!1}):m;x.metadata=x.name!==g.name?V(T({},x.metadata),{source:"custom"}):x.metadata,this._latestRouteName=x.name,this._latestRouteSource=x.metadata&&x.metadata.source,x.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Will not send ${x.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.log(`[Tracing] Starting ${x.op} transaction on scope`);let{location:w}=Y,I=Xa(t,x,n,i,!0,{location:w},s),N=t.getScope();return a&&d?N.setPropagationContext(p):N.setPropagationContext({traceId:I.traceId,spanId:I.spanId,parentSpanId:I.parentSpanId,sampled:I.sampled}),I.registerBeforeFinishCallback(P=>{this._collectWebVitals(),jm(P)}),I}_registerInteractionListener(){let e,t=()=>{let{idleTimeout:r,finalTimeout:n,heartbeatInterval:i}=this.options,s="ui.action.click",a=Ur();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:u}=Y,d={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Xa(c,d,r,n,!0,{location:u},i)};["click"].forEach(r=>{addEventListener(r,t,{once:!1,capture:!0})})}};function fo(e){let t=ff(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}var cu={};F.Sentry&&F.Sentry.Integrations&&(cu=F.Sentry.Integrations);T(T(T({},cu),Wc),iu);var Ym="https://d233059272824702afc8c43834c4912d@sentry.hcaptcha.com/6",cn=null;function uu(e,t){if(e===!1)return li(e);if(cn)return li(cn,t);let r=new wp({dsn:Ym,transport:window.fetch?jp:Cp,stackParser:Gp,integrations:[new An,new Yt,new On,new Zn,new Un,new Gm]});return cn=new ss(r),li(cn,t)}function li(e,t={key:"source",value:"@hCaptcha/loader"}){return{addBreadcrumb:r=>{e&&e.addBreadcrumb(r)},captureMessage:r=>{e&&e.withScope(function(n){n.setTag(t.key,t.value),e.captureMessage(r)})},captureException:r=>{e&&e.withScope(function(n){n.setTag(t.key,t.value),e.captureEvent({message:_i,level:"error",extra:r})})}}}function Fm({scriptLocation:e,query:t,loadAsync:r=!0,crossOrigin:n,apihost:i="https://js.hcaptcha.com",cleanup:s=!0,secureApi:a=!1,scriptSource:c=""}={}){let u=Ec(e),d=xc(u);return new Promise((l,p)=>{let g=d.document.createElement("script");g.id=ef,c?g.src=`${c}?onload=${ln}`:a?g.src=`${i}/1/secure-api.js?onload=${ln}`:g.src=`${i}/1/api.js?onload=${ln}`,g.crossOrigin=n,g.async=r;let m=(x,w)=>{try{!a&&s&&u.removeChild(g),w(x)}catch(I){p(I)}};g.onload=x=>m(x,l),g.onerror=x=>m(x,p),g.src+=t!==""?`&${t}`:"",u.appendChild(g)})}var un=[];function Hm(e={cleanup:!0},t){try{t.addBreadcrumb({category:Dt,message:"hCaptcha loader params",data:e});let r=Ec(e.scriptLocation),n=xc(r),i=un.find(({scope:a})=>a===n.window);if(i)return t.addBreadcrumb({category:Dt,message:"hCaptcha already loaded"}),i.promise;let s=new Promise((a,c)=>Ki(this,null,function*(){try{n.window[ln]=()=>{t.addBreadcrumb({category:Dt,message:"hCaptcha script called onload function"}),a(n.window.hcaptcha)};let u=Ql({custom:e.custom,render:e.render,sentry:e.sentry,assethost:e.assethost,imghost:e.imghost,reportapi:e.reportapi,endpoint:e.endpoint,host:e.host,recaptchacompat:e.recaptchacompat,hl:e.hl});yield Fm(T({query:u},e)),t.addBreadcrumb({category:Dt,message:"hCaptcha loaded",data:i})}catch(u){t.addBreadcrumb({category:Dt,message:"hCaptcha failed to load",data:u});let d=un.findIndex(l=>l.scope===n.window);d!==-1&&un.splice(d,1),t.captureException(u),c(new Error(_i))}}));return un.push({promise:s,scope:n.window}),s}catch(r){return t.captureException(r),Promise.reject(new Error(_i))}}function du(e,t=0){return Ki(this,null,function*(){let r=t<2?"Retry loading hCaptcha Api":"Exceeded maximum retries",n=uu(e.sentry);try{return yield Hm(e,n)}catch(i){return n.addBreadcrumb({SENTRY_SOURCE:Dt,message:r,data:{error:i}}),t>=2?(n.captureException(i),Promise.reject(i)):(t+=1,du(e,t))}})}function Wm(){return Ki(this,arguments,function*(e={}){return yield du(e)})}function ho(e){var t=e&&e.ownerDocument||document,r=t.defaultView||t.parentWindow||window;return{document:t,window:r}}function po(e){return e||document.head}var Ct={key:"source",value:"@hCaptcha/react"},xr={mounted:"hCaptcha component mounted",expired:"hCaptcha expired",unmounted:"hCaptcha component unmounted",reset:"hCaptcha reset",removed:"hCaptcha removed"},Km=function(e){Wl(t,e);function t(n){var i;return i=e.call(this,n)||this,i._hcaptcha=void 0,i.renderCaptcha=i.renderCaptcha.bind(he(i)),i.resetCaptcha=i.resetCaptcha.bind(he(i)),i.removeCaptcha=i.removeCaptcha.bind(he(i)),i.isReady=i.isReady.bind(he(i)),i._onReady=null,i.loadCaptcha=i.loadCaptcha.bind(he(i)),i.handleOnLoad=i.handleOnLoad.bind(he(i)),i.handleSubmit=i.handleSubmit.bind(he(i)),i.handleExpire=i.handleExpire.bind(he(i)),i.handleError=i.handleError.bind(he(i)),i.handleOpen=i.handleOpen.bind(he(i)),i.handleClose=i.handleClose.bind(he(i)),i.handleChallengeExpired=i.handleChallengeExpired.bind(he(i)),i.ref=S.createRef(),i.apiScriptRequested=!1,i.sentryHub=null,i.captchaId="",i.state={isApiReady:!1,isRemoved:!1,elementId:n.id},i}var r=t.prototype;return r.componentDidMount=function(){var i=this,s=po(this.props.scriptLocation),a=ho(s);this._hcaptcha=a.window.hcaptcha||void 0;var c=typeof this._hcaptcha<"u";if(this.sentryHub=uu(this.props.sentry,Ct),this.sentryHub.addBreadcrumb({category:Ct.value,message:xr.mounted}),c){this.setState({isApiReady:!0},function(){i.renderCaptcha()});return}this.loadCaptcha()},r.componentWillUnmount=function(){var i=this._hcaptcha,s=this.captchaId;this.isReady()&&(i.reset(s),i.remove(s),this.sentryHub.addBreadcrumb({category:Ct.value,message:xr.unmounted}))},r.shouldComponentUpdate=function(i,s){return!(this.state.isApiReady!==s.isApiReady||this.state.isRemoved!==s.isRemoved)},r.componentDidUpdate=function(i){var s=this,a=["sitekey","size","theme","tabindex","languageOverride","endpoint"],c=a.every(function(u){return i[u]===s.props[u]});c||this.removeCaptcha(function(){s.renderCaptcha()})},r.loadCaptcha=function(){if(!this.apiScriptRequested){var i=this.props,s=i.apihost,a=i.assethost,c=i.endpoint,u=i.host,d=i.imghost,l=i.languageOverride,p=i.reCaptchaCompat,g=i.reportapi,m=i.sentry,x=i.custom,w=i.loadAsync,I=i.scriptLocation,N=i.scriptSource,P=i.secureApi,A=i.cleanup,j=A===void 0?!0:A,Z={render:"explicit",apihost:s,assethost:a,endpoint:c,hl:l,host:u,imghost:d,recaptchacompat:p===!1?"off":null,reportapi:g,sentry:m,custom:x,loadAsync:w,scriptLocation:I,scriptSource:N,secureApi:P,cleanup:j};Wm(Z).then(this.handleOnLoad,this.handleError).catch(this.handleError),this.apiScriptRequested=!0}},r.renderCaptcha=function(i){var s=this,a=this.props.onReady,c=this.state.isApiReady,u=this.captchaId;if(!(!c||u)){var d=Object.assign({"open-callback":this.handleOpen,"close-callback":this.handleClose,"error-callback":this.handleError,"chalexpired-callback":this.handleChallengeExpired,"expired-callback":this.handleExpire,callback:this.handleSubmit},this.props,{hl:this.props.hl||this.props.languageOverride,languageOverride:void 0}),l=this._hcaptcha,p=l.render(this.ref.current,d);this.captchaId=p,this.setState({isRemoved:!1},function(){i&&i(),a&&a(),s._onReady&&s._onReady(p)})}},r.resetCaptcha=function(){var i=this._hcaptcha,s=this.captchaId;this.isReady()&&(i.reset(s),this.sentryHub.addBreadcrumb({category:Ct.value,message:xr.reset}))},r.removeCaptcha=function(i){var s=this._hcaptcha,a=this.captchaId;this.isReady()&&(this.setState({isRemoved:!0},function(){s.remove(a),i&&i()}),this.sentryHub.addBreadcrumb({category:Ct.value,message:xr.removed}))},r.handleOnLoad=function(){var i=this;this.setState({isApiReady:!0},function(){try{var s=po(i.props.scriptLocation),a=ho(s);i._hcaptcha=a.window.hcaptcha,i.renderCaptcha(function(){var c=i.props.onLoad;c&&c()})}catch(c){i.sentryHub.captureException(c)}})},r.handleSubmit=function(i){var s=this.props.onVerify,a=this.state.isRemoved,c=this._hcaptcha,u=this.captchaId;if(!(typeof c>"u"||a)){var d=c.getResponse(u),l=c.getRespKey(u);s&&s(d,l)}},r.handleExpire=function(){var i=this.props.onExpire,s=this._hcaptcha,a=this.captchaId;this.isReady()&&(s.reset(a),i&&i(),this.sentryHub.addBreadcrumb({category:Ct.value,message:xr.expired}))},r.handleError=function(i){var s=this.props.onError,a=this._hcaptcha,c=this.captchaId;this.isReady()&&a.reset(c),s&&s(i)},r.isReady=function(){var i=this.state,s=i.isApiReady,a=i.isRemoved;return s&&!a},r.handleOpen=function(){!this.isReady()||!this.props.onOpen||this.props.onOpen()},r.handleClose=function(){!this.isReady()||!this.props.onClose||this.props.onClose()},r.handleChallengeExpired=function(){!this.isReady()||!this.props.onChalExpired||this.props.onChalExpired()},r.execute=function(i){var s=this;i===void 0&&(i=null),i=typeof i=="object"?i:null;try{var a=this._hcaptcha,c=this.captchaId;if(!this.isReady()){var u,d=new Promise(function(l,p){s._onReady=function(g){try{var m=s._hcaptcha;i&&i.async?m.execute(g,i).then(l).catch(p):l(m.execute(g,i))}catch(x){p(x)}}});return(u=i)!=null&&u.async?d:null}return a.execute(c,i)}catch(l){return this.sentryHub.captureException(l),i&&i.async?Promise.reject(l):null}},r.close=function(){var i=this._hcaptcha,s=this.captchaId;if(this.isReady())return i.close(s)},r.setData=function(i){var s=this._hcaptcha,a=this.captchaId;this.isReady()&&(i&&typeof i!="object"&&(i=null),s.setData(a,i))},r.getResponse=function(){var i=this._hcaptcha;return i.getResponse(this.captchaId)},r.getRespKey=function(){var i=this._hcaptcha;return i.getRespKey(this.captchaId)},r.render=function(){var i=this.state.elementId;return S.createElement("div",{ref:this.ref,id:i})},t}(S.Component);const ht=typeof window>"u"?null:window.matchMedia("(prefers-color-scheme: dark)");function Xm(){const[e,t]=S.useState(ht!=null&&ht.matches?"dark":"light");return S.useEffect(()=>{if(!ht)return;const r=()=>{t(ht.matches?"dark":"light")};return ht.addEventListener("change",r),()=>{ht.removeEventListener("change",r)}},[]),e}function Jm({siteKey:e,token:t,onToken:r,prevLabel:n,onPrev:i,nextLabel:s,onNext:a,ref:c,invalid:u,children:d,...l}){const p=S.useRef(null),g=Xm(),[m,x]=S.useState(t),w=S.useCallback(()=>{var P;(P=p.current)==null||P.execute()},[]),I=S.useCallback((P,A)=>{x(P),r(P,A)},[r]),N=S.useCallback(P=>{if(m)return a(P);if(p.current)p.current.execute();else throw new Error("Unable to load hCaptcha")},[m,a]);return f.jsx(zt,{...l,cancelLabel:n,onCancel:i,submitLabel:s,onSubmit:N,append:d,invalid:u||!m,children:f.jsx(Km,{theme:g,sitekey:e,onLoad:w,onVerify:I,ref:Qe([c,p])})})}function Qm({customizationData:{availableUserDomains:e=[],hcaptchaSiteKey:t=void 0,inviteCodeRequired:r=!0,links:n}={},onValidateNewHandle:i,onDone:s,onBack:a,backLabel:c,title:u,subtitle:d,...l}){const{i18n:p,_:g}=q(),[m,x]=S.useState(void 0),[w,I]=S.useState(void 0),[N,P]=S.useState(void 0),A=t==null?void 0:N||!1,j=S.useCallback(Z=>{if(m&&w&&A!==!1)return s({...m,handle:w,hcaptchaToken:A},Z)},[m,w,A,s]);return f.jsxs(Ee,{...l,title:u??p._({id:"IS0nrP"}),subtitle:d??f.jsx(C,{id:"qjBGxf"}),children:[f.jsx(Vl,{doneLabel:f.jsx(C,{id:"e+RpCP"}),onBack:a,backLabel:c,onDone:j,steps:[{invalid:!w,titleRender:()=>f.jsx(C,{id:"khEQ02"}),contentRender:({prev:Z,prevLabel:B,next:M,nextLabel:K,invalid:H})=>f.jsx(Hl,{className:"grow",invalid:H,domains:e,handle:w,onHandle:I,prevLabel:B,onPrev:Z,nextLabel:K,onNext:async ce=>{if(w&&await i({handle:w},ce),!ce.aborted)return M(ce)},children:f.jsx(si,{links:n})})},{invalid:!m,titleRender:()=>f.jsx(C,{id:"gdRnT7"}),contentRender:({prev:Z,prevLabel:B,next:M,nextLabel:K,invalid:H})=>f.jsx(ql,{className:"grow",invalid:H,prevLabel:B,onPrev:Z,nextLabel:K,onNext:M,inviteCodeRequired:r,credentials:m,onCredentials:x,children:f.jsx(si,{links:n})})},t!=null&&{invalid:A===!1,titleRender:()=>f.jsx(C,{id:"aIar4b"}),contentRender:({prev:Z,prevLabel:B,next:M,nextLabel:K,invalid:H})=>f.jsx(Jm,{className:"grow",invalid:H,siteKey:t,token:N,onToken:P,prevLabel:B,onPrev:Z,nextLabel:K,onNext:M,children:f.jsx(si,{links:n})})}]}),f.jsx(zl,{className:"mt-4",links:n})]})}function e_({onSignUp:e,onSignIn:t,onCancel:r,...n}){const{i18n:i,_:s}=q();return f.jsxs(_d,{...n,title:n.title??i._({id:"OX6vme"}),children:[e&&f.jsx(se,{className:"m-1 w-60 min-w-min max-w-full",color:t?"primary":void 0,onClick:e,children:f.jsx(C,{id:"mpt9T+"})}),t&&f.jsx(se,{className:"m-1 w-60 min-w-min max-w-full",color:e?void 0:"primary",onClick:t,children:f.jsx(C,{id:"yKDCQ1"})}),r&&f.jsx(se,{className:"m-1 w-60 min-w-min max-w-full",onClick:r,children:f.jsx(C,{id:"dEgA5A"})})]})}function t_(e,t,r,n){return e==="create"&&t?1:r||!t||n?2:0}function r_({authorizeData:e,initialSessions:t,customizationData:r,...n}){var Ht;const{i18n:i,_:s}=q(),a=e.loginHint!=null,c=!!t.length,u=!!((Ht=r==null?void 0:r.availableUserDomains)!=null&&Ht.length),d=!a&&u,l=t_(e.promptMode,u,a,c),[p,g]=S.useState(l),m=Tt(g,5),x=Tt(g,2),w=Tt(g,3),I=Tt(g,1),N=Tt(g,4),[P,A]=S.useState(void 0),{sessions:j,selectSub:Z,doValidateNewHandle:B,doSignUp:M,doSignIn:K,doInitiatePasswordReset:H,doConfirmResetPassword:ce,doConsent:z,doReject:re}=Sd({sessions:t,onRedirected:m}),G=!d||j.length?2:0,ue=Tt(g,G),Ft=d?I:void 0,_e=j.find(Me=>Me.selected&&!Me.loginRequired);if(S.useEffect(()=>{_e&&(_e.consentRequired?N():z(_e.account.sub))},[_e,z,N]),S.useEffect(()=>{p===1&&!d&&g(G)},[p,G,!d]),S.useEffect(()=>{p===4&&!_e&&g(G)},[p,G,!_e]),S.useEffect(()=>{p===0&&G!==0&&g(G)},[p,G]),p===0)return f.jsx(e_,{...n,customizationData:r,onSignIn:x,onSignUp:Ft,onCancel:re});if(p===1)return f.jsx(Qm,{...n,customizationData:r,onValidateNewHandle:B,onBack:ue,onDone:M});if(p===3)return f.jsx(Al,{...n,emailDefault:P,onresetPasswordRequest:H,onResetPasswordConfirm:ce,onBack:ue});if(p===2)return f.jsx($l,{...n,loginHint:e.loginHint,sessions:j,selectSub:Z,onSignIn:K,onSignUp:Ft,onBack:G===2?re:ue,backLabel:G===2?i._({id:"dEgA5A"}):void 0,onForgotPassword:Me=>{w(),A(Me)}});if(p===4)return _e?f.jsx(El,{...n,clientId:e.clientId,clientMetadata:e.clientMetadata,clientTrusted:e.clientTrusted,clientFirstParty:e.clientFirstParty,permissionSets:e.permissionSets,account:_e.account,scope:e.scope,onConsent:Me=>z(_e.account.sub,Me),onReject:re,onBack:a?void 0:()=>{Z(null),ue()}}):null;if(p===5)return f.jsx(Ee,{...n,title:n.title??i._({id:"UCOd1e"}),children:f.jsx(C,{id:"qq6QQ5"})});throw new Error("Unexpected application state")}const{__authorizeData:En,__customizationData:mo,__sessions:n_}=window,pt=new URL(window.location.href);pt.pathname==="/oauth/authorize"&&!pt.searchParams.has("request_uri")&&(pt.search="",pt.searchParams.set("client_id",En.clientId),pt.searchParams.set("request_uri",En.requestUri),window.history.replaceState(history.state,"",pt.pathname+pt.search));const i_=document.getElementById("root");var _o;ud.createRoot(i_).render(f.jsx(S.StrictMode,{children:f.jsx(dd,{userLocales:(_o=En.uiLocales)==null?void 0:_o.split(" "),children:f.jsx(yd,{fallbackRender:({error:e})=>f.jsx(gd,{error:e,customizationData:mo}),children:f.jsx(r_,{authorizeData:En,customizationData:mo,initialSessions:n_})})})}))});export default s_();
|
|
20
|
+
//# sourceMappingURL=authorization-page-B4QH37VO.js.map
|