@atproto/oauth-provider-ui 0.4.1 → 0.4.2
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/authorization-page-LIoylbC_.js +20 -0
- package/dist/authorization-page-LIoylbC_.js.map +1 -0
- package/dist/bundle-manifest.json +81 -81
- package/dist/error-page-D8SBeYrV.js +2 -0
- package/dist/{error-page-BSIrbq_G.js.map → error-page-D8SBeYrV.js.map} +1 -1
- package/dist/{error-view-BrIEEpo5.js → error-view-CMXZ7-XO.js} +14 -14
- package/dist/{error-view-BrIEEpo5.js.map → error-view-CMXZ7-XO.js.map} +1 -1
- package/package.json +5 -5
- 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
|
@@ -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,j as f,c as re,L as Ju,A as Qu,u as q,U as ed,C as td,a as Ir,b as Mt,g as rd,T as C,E as nd,d as jr,e as id,B as go,f as yo,h as Ss,R as sd,i as ad,N as ws,k as Ts,l as dn,m as od,n as cd,o as ud,p as dd,q as vo,S as ld,I as fd,s as hd,t as Is,v as js,X as pd,w as md,x as _d,y as gd,z as yd}from"./error-view-CMXZ7-XO.js";var a_=Xu((u_,lu)=>{const bo=S.createContext(null),Vn={didCatch:!1,error:null};class vd 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&&bd(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 o=t;if(s){const u={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")o=r(u);else if(n)o=S.createElement(n,u);else if(i!==void 0)o=i;else throw a}return S.createElement(bo.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}function bd(){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 xd(e){if(e==null||typeof e.didCatch!="boolean"||typeof e.resetErrorBoundary!="function")throw new Error("ErrorBoundaryContext not found")}function Ed(){const e=S.useContext(bo);xd(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 Ee({customizationData:e,title:t,subtitle:r,htmlTitle:n=typeof t=="string"?t:void 0,className:i,children:s,...a}){return f.jsxs("div",{...a,className:re(i,"flex flex-col items-center","md:flex md:flex-row md:items-center md:justify-stretch","min-w-screen min-h-screen"),children:[n&&f.jsx("title",{children:n}),f.jsxs("div",{className:re("px-6 pt-4","w-full","md:max-w-lg","flex flex-row items-center","md:flex-col md:items-end","md:self-stretch","md:max-w-fix md:w-1/2 md:p-4","md:text-right","md:dark:border-r md:dark:border-slate-700","md:bg-slate-100 md:dark:bg-slate-800"),children:[f.jsxs("div",{className:"grid grow content-center md:justify-items-end",children:[t&&f.jsx("h1",{className:"text-primary text-xl font-semibold md:my-4 md:text-2xl lg:text-5xl",children:t},"title"),r&&f.jsx("p",{className:"hidden max-w-xs text-slate-600 md:block dark:text-slate-400",children:r},"subtitle")]}),f.jsx(Ju,{className:"m-1 md:m-2"},"localeSelector")]}),f.jsx("main",{className:"w-full p-6 md:max-w-3xl md:px-12",children:s})]})}function Sd(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}=Ed();return S.useCallback(async(...n)=>{try{return await e(...n)}catch(i){throw i instanceof ed&&r(i),i}},t.concat(r))}function wd({sessions:e=[],onRedirected:t}){const[r]=S.useState(()=>new Qu),[n,i]=S.useState(e),{i18n:s,_:a}=q(),{locale:o}=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=>Sd(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:o},{signal:A});d(j)},[r,o,d]),g=nt(async(P,A)=>{await r.fetch("POST","/reset-password-request",{...P,locale:o},{signal:A})},[r,o]),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:o},{signal:A});d(j)},[r,o,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 Td({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(td,{className:"size-4"})})}function ae({color:e="grey",transparent:t=!1,loading:r=void 0,shape:n="rounded",children:i,className:s,type:a="button",role:o="Button",disabled:u=!1,...d}){const l=a==="submit"||d.onClick!=null;return f.jsx("button",{role:o,type:a,disabled:u||r===!0,tabIndex:(d==null?void 0:d.tabIndex)??(l?0:-1),...d,className:re("touch-manipulation overflow-hidden","truncate tracking-wide",l?"cursor-pointer":null,n==="circle"?"rounded-full":"rounded-md",n==="circle"?"size-8":null,n==="rounded"?"px-6 py-2":n==="padded"?"p-2":void 0,"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",e==="primary"?re("accent-slate-100",t?"text-primary bg-transparent":"bg-primary text-primary-contrast"):e==="grey"?re("accent-primary","text-slate-600 dark:text-slate-300","hover:bg-gray-200 dark:hover:bg-gray-700",t?"bg-transparent":"bg-gray-100 dark:bg-gray-800"):void 0,"disabled:opacity-50",s),children:i})}function Id(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 jd(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,...o}){const{i18n:u,_:d}=q(),[l,p]=S.useState(!1),g=S.useCallback(()=>p(!1),[]),m=S.useRef(null);jd(g),Id(m,g);const x=a!=null,w=Ir("details-card-");return f.jsxs("div",{ref:m,className:s,...o,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(ae,{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,o,u){Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"positional",{enumerable:!0,configurable:!0,writable:!0,value:o}),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 o=this.params.getAll(a);return o.length>1?null:o[0]}getMulti(a){var o;if((o=this.params)!=null&&o.has(a))return this.params.getAll(a)}toString(){var o;let a=this.prefix;return this.positional!==void 0&&(a+=`:${i(encodeURIComponent(this.positional))}`),(o=this.params)!=null&&o.size&&(a+=`?${i(this.params.toString())}`),a}static fromString(a){const o=a.indexOf("?"),u=a.indexOf(":"),d=(0,e.minIdx)(o,u);if(d===-1)return new t(a);const l=a.slice(0,d),p=u!==-1?o===-1?decodeURIComponent(a.slice(u+1)):u<o?decodeURIComponent(a.slice(u+1,o)):void 0:void 0,g=o!==-1&&o<a.length-1?new URLSearchParams(a.slice(o+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 o=0;o<a;o++)if(s.charCodeAt(o)===37){const u=s.slice(o,o+3),d=n.get(u);d&&(s=`${s.slice(0,o)}${d}${s.slice(o+u.length)}`,o+=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 o of this.schemaKeys){const u=i[o];if(u===void 0)continue;const d=this.schema[o],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(o===this.positionalName&&l.length===1)a=String(l[0]);else{const p=new Set(l.map(String));for(const g of p)s.append(o,g)}else o===this.positionalName?a=String(l):s.set(o,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 o=this.schema[a],u=o.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(o.multiple){if(!u.length||!u.every(o.validate))return null}else if(!o.validate(u))return null;s[a]=u}else if(a===this.positionalName&&i.positional!==void 0){const{positional:d}=i;if(!o.validate(d))return null;s[a]=o.multiple?[d]:d}else{if(o.required)return null;s[a]=o.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(o,u){Object.defineProperty(this,"attr",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"action",{enumerable:!0,configurable:!0,writable:!0,value:u})}matches(o){return this.attr===o.attr&&(this.action.includes("manage")||this.action.includes(o.action))}toString(){return s.parser.format(this)}static fromString(o){if(!(0,n.isScopeStringFor)(o,"account"))return null;const u=r.ScopeStringSyntax.fromString(o);return s.fromSyntax(u)}static fromSyntax(o){const u=s.parser.parse(o);return u?new s(u.attr,u.action):null}static scopeNeededFor(o){return s.parser.format({attr:o.attr,action:[o.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 Rd(){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(o){const u=o.indexOf("/");return!(u===-1||u===0||u===o.length-1||o.includes("/",u+1)||o.includes(" "))}function t(o){return e(o)&&!o.includes("*")}function r(o){return typeof o!="string"?!1:o==="*/*"?!0:e(o)?!o.includes("*")||o.endsWith("/*"):!1}function n(o,u){return o==="*/*"?!0:o.endsWith("/*")?u.startsWith(o.slice(0,-1)):o===u}function i(o,u){return t(u)&&n(o,u)}function s(o,u){for(const d of o)if(n(d,u))return!0;return!1}function a(o,u){return t(u)&&s(o,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=Rd(),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(o).sort()}},"accept")});function a(u){return typeof u=="string"?u.toLowerCase():u}function o(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(o){Object.defineProperty(this,"attr",{enumerable:!0,configurable:!0,writable:!0,value:o})}matches(o){return this.attr==="*"||this.attr===o.attr}toString(){return s.parser.format(this)}static fromString(o){if(!(0,n.isScopeStringFor)(o,"identity"))return null;const u=r.ScopeStringSyntax.fromString(o);return s.fromSyntax(u)}static fromSyntax(o){const u=s.parser.parse(o);return u?new s(u.attr):null}static scopeNeededFor(o){return s.parser.format(o)}}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 o(u,d=" | "){return u.map(l=>typeof l=="string"?`'${l}'`:l).join(d)}i.joinValues=o,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 Oi(){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:[]},o=u=>{for(const d of u.issues)if(d.code==="invalid_union")d.unionErrors.map(o);else if(d.code==="invalid_return_type")o(d.returnTypeError);else if(d.code==="invalid_arguments")o(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 o(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 o of this.issues)o.path.length>0?(s[o.path[0]]=s[o.path[0]]||[],s[o.path[0]].push(i(o))):a.push(i(o));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=Oi(),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 Ui(){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=Ui(),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 o=m=>({status:"dirty",value:m});e.DIRTY=o;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 Cd(){return Ms||(Ms=1,Object.defineProperty(Kn,"__esModule",{value:!0})),Kn}var E={},fr={},Vs;function Dd(){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 Nd(){if(zs)return E;zs=1;var e=E&&E.__classPrivateFieldGet||function(y,c,h,_){if(h==="a"&&!_)throw new TypeError("Private accessor was defined without a getter");if(typeof c=="function"?y!==c||!_:!c.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:c.get(y)},t=E&&E.__classPrivateFieldSet||function(y,c,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 c=="function"?y!==c||!v:!c.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:c.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=Ui(),s=Dd(),a=So(),o=In(),u=Oi();class d{constructor(c,h,_,v){this._cachedPath=[],this.parent=c,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,c)=>{if((0,a.isValid)(c))return{success:!0,data:c.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:c,invalid_type_error:h,required_error:_,description:v}=y;if(c&&(h||_))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return c?{errorMap:c,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(c){return(0,o.getParsedType)(c.data)}_getOrReturnCtx(c,h){return h||{common:c.parent.common,data:c.data,parsedType:(0,o.getParsedType)(c.data),schemaErrorMap:this._def.errorMap,path:c.path,parent:c.parent}}_processInputParams(c){return{status:new a.ParseStatus,ctx:{common:c.parent.common,data:c.data,parsedType:(0,o.getParsedType)(c.data),schemaErrorMap:this._def.errorMap,path:c.path,parent:c.parent}}}_parseSync(c){const h=this._parse(c);if((0,a.isAsync)(h))throw new Error("Synchronous parse encountered promise.");return h}_parseAsync(c){const h=this._parse(c);return Promise.resolve(h)}parse(c,h){const _=this.safeParse(c,h);if(_.success)return _.data;throw _.error}safeParse(c,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:c,parsedType:(0,o.getParsedType)(c)},b=this._parseSync({data:c,path:v.path,parent:v});return l(v,b)}"~validate"(c){var h,_;const v={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:c,parsedType:(0,o.getParsedType)(c)};if(!this["~standard"].async)try{const b=this._parseSync({data:c,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:c,path:[],parent:v}).then(b=>(0,a.isValid)(b)?{value:b.value}:{issues:v.common.issues})}async parseAsync(c,h){const _=await this.safeParseAsync(c,h);if(_.success)return _.data;throw _.error}async safeParseAsync(c,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:c,parsedType:(0,o.getParsedType)(c)},v=this._parse({data:c,path:_.path,parent:_}),b=await((0,a.isAsync)(v)?v:Promise.resolve(v));return l(_,b)}refine(c,h){const _=v=>typeof h=="string"||typeof h>"u"?{message:h}:typeof h=="function"?h(v):h;return this._refinement((v,b)=>{const D=c(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(c,h){return this._refinement((_,v)=>c(_)?!0:(v.addIssue(typeof h=="function"?h(_,v):h),!1))}_refinement(c){return new ve({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:c}})}superRefine(c){return this._refinement(c)}constructor(c){this.spa=this.safeParseAsync,this._def=c,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(c){return Jt.create([this,c],this._def)}and(c){return Qt.create(this,c,this._def)}transform(c){return new ve({...p(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:c}})}default(c){const h=typeof c=="function"?c:()=>c;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(c){const h=typeof c=="function"?c:()=>c;return new sr({...p(this._def),innerType:this,catchValue:h,typeName:L.ZodCatch})}describe(c){const h=this.constructor;return new h({...this._def,description:c})}pipe(c){return ar.create(this,c)}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]))$/,ue=/^(([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}=))?$/,ne=/^([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])))",de=new RegExp(`^${G}$`);function Ft(y){let c="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return y.precision?c=`${c}\\.\\d{${y.precision}}`:y.precision==null&&(c=`${c}(\\.\\d+)?`),c}function _e(y){return new RegExp(`^${Ft(y)}$`)}function Ht(y){let c=`${G}T${Ft(y)}`;const h=[];return h.push(y.local?"Z?":"Z"),y.offset&&h.push("([+-]\\d{2}:?\\d{2})"),c=`${c}(${h.join("|")})`,new RegExp(`^${c}$`)}E.datetimeRegex=Ht;function Me(y,c){return!!((c==="v4"||!c)&&M.test(y)||(c==="v6"||!c)&&H.test(y))}function fu(y,c){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||c&&v.alg!==c)}catch{return!1}}function hu(y,c){return!!((c==="v4"||!c)&&K.test(y)||(c==="v6"||!c)&&ue.test(y))}class ge extends g{_parse(c){if(this._def.coerce&&(c.data=String(c.data)),this._getType(c)!==o.ZodParsedType.string){const b=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(b,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.string,received:b.parsedType}),a.INVALID}const _=new a.ParseStatus;let v;for(const b of this._def.checks)if(b.kind==="min")c.data.length<b.value&&(v=this._getOrReturnCtx(c,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")c.data.length>b.value&&(v=this._getOrReturnCtx(c,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=c.data.length>b.value,R=c.data.length<b.value;(D||R)&&(v=this._getOrReturnCtx(c,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(c.data)||(v=this._getOrReturnCtx(c,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(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"emoji",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="uuid")I.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"uuid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="nanoid")N.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"nanoid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="cuid")m.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"cuid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="cuid2")x.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"cuid2",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="ulid")w.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"ulid",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty());else if(b.kind==="url")try{new URL(c.data)}catch{v=this._getOrReturnCtx(c,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(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"regex",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty())):b.kind==="trim"?c.data=c.data.trim():b.kind==="includes"?c.data.includes(b.value,b.position)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:{includes:b.value,position:b.position},message:b.message}),_.dirty()):b.kind==="toLowerCase"?c.data=c.data.toLowerCase():b.kind==="toUpperCase"?c.data=c.data.toUpperCase():b.kind==="startsWith"?c.data.startsWith(b.value)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:{startsWith:b.value},message:b.message}),_.dirty()):b.kind==="endsWith"?c.data.endsWith(b.value)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:{endsWith:b.value},message:b.message}),_.dirty()):b.kind==="datetime"?Ht(b).test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:"datetime",message:b.message}),_.dirty()):b.kind==="date"?de.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:"date",message:b.message}),_.dirty()):b.kind==="time"?_e(b).test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.invalid_string,validation:"time",message:b.message}),_.dirty()):b.kind==="duration"?A.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"duration",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="ip"?Me(c.data,b.version)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"ip",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="jwt"?fu(c.data,b.alg)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"jwt",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="cidr"?hu(c.data,b.version)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"cidr",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="base64"?z.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"base64",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):b.kind==="base64url"?ne.test(c.data)||(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{validation:"base64url",code:u.ZodIssueCode.invalid_string,message:b.message}),_.dirty()):o.util.assertNever(b);return{status:_.value,value:c.data}}_regex(c,h,_){return this.refinement(v=>c.test(v),{validation:h,code:u.ZodIssueCode.invalid_string,...s.errorUtil.errToObj(_)})}_addCheck(c){return new ge({...this._def,checks:[...this._def.checks,c]})}email(c){return this._addCheck({kind:"email",...s.errorUtil.errToObj(c)})}url(c){return this._addCheck({kind:"url",...s.errorUtil.errToObj(c)})}emoji(c){return this._addCheck({kind:"emoji",...s.errorUtil.errToObj(c)})}uuid(c){return this._addCheck({kind:"uuid",...s.errorUtil.errToObj(c)})}nanoid(c){return this._addCheck({kind:"nanoid",...s.errorUtil.errToObj(c)})}cuid(c){return this._addCheck({kind:"cuid",...s.errorUtil.errToObj(c)})}cuid2(c){return this._addCheck({kind:"cuid2",...s.errorUtil.errToObj(c)})}ulid(c){return this._addCheck({kind:"ulid",...s.errorUtil.errToObj(c)})}base64(c){return this._addCheck({kind:"base64",...s.errorUtil.errToObj(c)})}base64url(c){return this._addCheck({kind:"base64url",...s.errorUtil.errToObj(c)})}jwt(c){return this._addCheck({kind:"jwt",...s.errorUtil.errToObj(c)})}ip(c){return this._addCheck({kind:"ip",...s.errorUtil.errToObj(c)})}cidr(c){return this._addCheck({kind:"cidr",...s.errorUtil.errToObj(c)})}datetime(c){var h,_;return typeof c=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:c}):this._addCheck({kind:"datetime",precision:typeof(c==null?void 0:c.precision)>"u"?null:c==null?void 0:c.precision,offset:(h=c==null?void 0:c.offset)!==null&&h!==void 0?h:!1,local:(_=c==null?void 0:c.local)!==null&&_!==void 0?_:!1,...s.errorUtil.errToObj(c==null?void 0:c.message)})}date(c){return this._addCheck({kind:"date",message:c})}time(c){return typeof c=="string"?this._addCheck({kind:"time",precision:null,message:c}):this._addCheck({kind:"time",precision:typeof(c==null?void 0:c.precision)>"u"?null:c==null?void 0:c.precision,...s.errorUtil.errToObj(c==null?void 0:c.message)})}duration(c){return this._addCheck({kind:"duration",...s.errorUtil.errToObj(c)})}regex(c,h){return this._addCheck({kind:"regex",regex:c,...s.errorUtil.errToObj(h)})}includes(c,h){return this._addCheck({kind:"includes",value:c,position:h==null?void 0:h.position,...s.errorUtil.errToObj(h==null?void 0:h.message)})}startsWith(c,h){return this._addCheck({kind:"startsWith",value:c,...s.errorUtil.errToObj(h)})}endsWith(c,h){return this._addCheck({kind:"endsWith",value:c,...s.errorUtil.errToObj(h)})}min(c,h){return this._addCheck({kind:"min",value:c,...s.errorUtil.errToObj(h)})}max(c,h){return this._addCheck({kind:"max",value:c,...s.errorUtil.errToObj(h)})}length(c,h){return this._addCheck({kind:"length",value:c,...s.errorUtil.errToObj(h)})}nonempty(c){return this.min(1,s.errorUtil.errToObj(c))}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(c=>c.kind==="datetime")}get isDate(){return!!this._def.checks.find(c=>c.kind==="date")}get isTime(){return!!this._def.checks.find(c=>c.kind==="time")}get isDuration(){return!!this._def.checks.find(c=>c.kind==="duration")}get isEmail(){return!!this._def.checks.find(c=>c.kind==="email")}get isURL(){return!!this._def.checks.find(c=>c.kind==="url")}get isEmoji(){return!!this._def.checks.find(c=>c.kind==="emoji")}get isUUID(){return!!this._def.checks.find(c=>c.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(c=>c.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(c=>c.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(c=>c.kind==="cuid2")}get isULID(){return!!this._def.checks.find(c=>c.kind==="ulid")}get isIP(){return!!this._def.checks.find(c=>c.kind==="ip")}get isCIDR(){return!!this._def.checks.find(c=>c.kind==="cidr")}get isBase64(){return!!this._def.checks.find(c=>c.kind==="base64")}get isBase64url(){return!!this._def.checks.find(c=>c.kind==="base64url")}get minLength(){let c=null;for(const h of this._def.checks)h.kind==="min"&&(c===null||h.value>c)&&(c=h.value);return c}get maxLength(){let c=null;for(const h of this._def.checks)h.kind==="max"&&(c===null||h.value<c)&&(c=h.value);return c}}E.ZodString=ge,ge.create=y=>{var c;return new ge({checks:[],typeName:L.ZodString,coerce:(c=y==null?void 0:y.coerce)!==null&&c!==void 0?c:!1,...p(y)})};function pu(y,c){const h=(y.toString().split(".")[1]||"").length,_=(c.toString().split(".")[1]||"").length,v=h>_?h:_,b=parseInt(y.toFixed(v).replace(".","")),D=parseInt(c.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(c){if(this._def.coerce&&(c.data=Number(c.data)),this._getType(c)!==o.ZodParsedType.number){const b=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(b,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.number,received:b.parsedType}),a.INVALID}let _;const v=new a.ParseStatus;for(const b of this._def.checks)b.kind==="int"?o.util.isInteger(c.data)||(_=this._getOrReturnCtx(c,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:b.message}),v.dirty()):b.kind==="min"?(b.inclusive?c.data<b.value:c.data<=b.value)&&(_=this._getOrReturnCtx(c,_),(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?c.data>b.value:c.data>=b.value)&&(_=this._getOrReturnCtx(c,_),(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(c.data,b.value)!==0&&(_=this._getOrReturnCtx(c,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.not_multiple_of,multipleOf:b.value,message:b.message}),v.dirty()):b.kind==="finite"?Number.isFinite(c.data)||(_=this._getOrReturnCtx(c,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.not_finite,message:b.message}),v.dirty()):o.util.assertNever(b);return{status:v.value,value:c.data}}gte(c,h){return this.setLimit("min",c,!0,s.errorUtil.toString(h))}gt(c,h){return this.setLimit("min",c,!1,s.errorUtil.toString(h))}lte(c,h){return this.setLimit("max",c,!0,s.errorUtil.toString(h))}lt(c,h){return this.setLimit("max",c,!1,s.errorUtil.toString(h))}setLimit(c,h,_,v){return new Ve({...this._def,checks:[...this._def.checks,{kind:c,value:h,inclusive:_,message:s.errorUtil.toString(v)}]})}_addCheck(c){return new Ve({...this._def,checks:[...this._def.checks,c]})}int(c){return this._addCheck({kind:"int",message:s.errorUtil.toString(c)})}positive(c){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s.errorUtil.toString(c)})}negative(c){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s.errorUtil.toString(c)})}nonpositive(c){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s.errorUtil.toString(c)})}nonnegative(c){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s.errorUtil.toString(c)})}multipleOf(c,h){return this._addCheck({kind:"multipleOf",value:c,message:s.errorUtil.toString(h)})}finite(c){return this._addCheck({kind:"finite",message:s.errorUtil.toString(c)})}safe(c){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s.errorUtil.toString(c)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s.errorUtil.toString(c)})}get minValue(){let c=null;for(const h of this._def.checks)h.kind==="min"&&(c===null||h.value>c)&&(c=h.value);return c}get maxValue(){let c=null;for(const h of this._def.checks)h.kind==="max"&&(c===null||h.value<c)&&(c=h.value);return c}get isInt(){return!!this._def.checks.find(c=>c.kind==="int"||c.kind==="multipleOf"&&o.util.isInteger(c.value))}get isFinite(){let c=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"&&(c===null||_.value<c)&&(c=_.value)}return Number.isFinite(h)&&Number.isFinite(c)}}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(c){if(this._def.coerce)try{c.data=BigInt(c.data)}catch{return this._getInvalidInput(c)}if(this._getType(c)!==o.ZodParsedType.bigint)return this._getInvalidInput(c);let _;const v=new a.ParseStatus;for(const b of this._def.checks)b.kind==="min"?(b.inclusive?c.data<b.value:c.data<=b.value)&&(_=this._getOrReturnCtx(c,_),(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?c.data>b.value:c.data>=b.value)&&(_=this._getOrReturnCtx(c,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.too_big,type:"bigint",maximum:b.value,inclusive:b.inclusive,message:b.message}),v.dirty()):b.kind==="multipleOf"?c.data%b.value!==BigInt(0)&&(_=this._getOrReturnCtx(c,_),(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.not_multiple_of,multipleOf:b.value,message:b.message}),v.dirty()):o.util.assertNever(b);return{status:v.value,value:c.data}}_getInvalidInput(c){const h=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.bigint,received:h.parsedType}),a.INVALID}gte(c,h){return this.setLimit("min",c,!0,s.errorUtil.toString(h))}gt(c,h){return this.setLimit("min",c,!1,s.errorUtil.toString(h))}lte(c,h){return this.setLimit("max",c,!0,s.errorUtil.toString(h))}lt(c,h){return this.setLimit("max",c,!1,s.errorUtil.toString(h))}setLimit(c,h,_,v){return new ze({...this._def,checks:[...this._def.checks,{kind:c,value:h,inclusive:_,message:s.errorUtil.toString(v)}]})}_addCheck(c){return new ze({...this._def,checks:[...this._def.checks,c]})}positive(c){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(c)})}negative(c){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(c)})}nonpositive(c){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(c)})}nonnegative(c){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(c)})}multipleOf(c,h){return this._addCheck({kind:"multipleOf",value:c,message:s.errorUtil.toString(h)})}get minValue(){let c=null;for(const h of this._def.checks)h.kind==="min"&&(c===null||h.value>c)&&(c=h.value);return c}get maxValue(){let c=null;for(const h of this._def.checks)h.kind==="max"&&(c===null||h.value<c)&&(c=h.value);return c}}E.ZodBigInt=ze,ze.create=y=>{var c;return new ze({checks:[],typeName:L.ZodBigInt,coerce:(c=y==null?void 0:y.coerce)!==null&&c!==void 0?c:!1,...p(y)})};class Wt extends g{_parse(c){if(this._def.coerce&&(c.data=!!c.data),this._getType(c)!==o.ZodParsedType.boolean){const _=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.boolean,received:_.parsedType}),a.INVALID}return(0,a.OK)(c.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(c){if(this._def.coerce&&(c.data=new Date(c.data)),this._getType(c)!==o.ZodParsedType.date){const b=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(b,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.date,received:b.parsedType}),a.INVALID}if(isNaN(c.data.getTime())){const b=this._getOrReturnCtx(c);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"?c.data.getTime()<b.value&&(v=this._getOrReturnCtx(c,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"?c.data.getTime()>b.value&&(v=this._getOrReturnCtx(c,v),(0,a.addIssueToContext)(v,{code:u.ZodIssueCode.too_big,message:b.message,inclusive:!0,exact:!1,maximum:b.value,type:"date"}),_.dirty()):o.util.assertNever(b);return{status:_.value,value:new Date(c.data.getTime())}}_addCheck(c){return new et({...this._def,checks:[...this._def.checks,c]})}min(c,h){return this._addCheck({kind:"min",value:c.getTime(),message:s.errorUtil.toString(h)})}max(c,h){return this._addCheck({kind:"max",value:c.getTime(),message:s.errorUtil.toString(h)})}get minDate(){let c=null;for(const h of this._def.checks)h.kind==="min"&&(c===null||h.value>c)&&(c=h.value);return c!=null?new Date(c):null}get maxDate(){let c=null;for(const h of this._def.checks)h.kind==="max"&&(c===null||h.value<c)&&(c=h.value);return c!=null?new Date(c):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(c){if(this._getType(c)!==o.ZodParsedType.symbol){const _=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.symbol,received:_.parsedType}),a.INVALID}return(0,a.OK)(c.data)}}E.ZodSymbol=$r,$r.create=y=>new $r({typeName:L.ZodSymbol,...p(y)});class Kt extends g{_parse(c){if(this._getType(c)!==o.ZodParsedType.undefined){const _=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.undefined,received:_.parsedType}),a.INVALID}return(0,a.OK)(c.data)}}E.ZodUndefined=Kt,Kt.create=y=>new Kt({typeName:L.ZodUndefined,...p(y)});class Xt extends g{_parse(c){if(this._getType(c)!==o.ZodParsedType.null){const _=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.null,received:_.parsedType}),a.INVALID}return(0,a.OK)(c.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(c){return(0,a.OK)(c.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(c){return(0,a.OK)(c.data)}}E.ZodUnknown=tt,tt.create=y=>new tt({typeName:L.ZodUnknown,...p(y)});class ke extends g{_parse(c){const h=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:o.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(c){if(this._getType(c)!==o.ZodParsedType.undefined){const _=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.void,received:_.parsedType}),a.INVALID}return(0,a.OK)(c.data)}}E.ZodVoid=Lr,Lr.create=y=>new Lr({typeName:L.ZodVoid,...p(y)});class ye extends g{_parse(c){const{ctx:h,status:_}=this._processInputParams(c),v=this._def;if(h.parsedType!==o.ZodParsedType.array)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:o.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(c,h){return new ye({...this._def,minLength:{value:c,message:s.errorUtil.toString(h)}})}max(c,h){return new ye({...this._def,maxLength:{value:c,message:s.errorUtil.toString(h)}})}length(c,h){return new ye({...this._def,exactLength:{value:c,message:s.errorUtil.toString(h)}})}nonempty(c){return this.min(1,c)}}E.ZodArray=ye,ye.create=(y,c)=>new ye({type:y,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...p(c)});function xt(y){if(y instanceof W){const c={};for(const h in y.shape){const _=y.shape[h];c[h]=Ie.create(xt(_))}return new W({...y._def,shape:()=>c})}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(c=>xt(c))):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 c=this._def.shape(),h=o.util.objectKeys(c);return this._cached={shape:c,keys:h}}_parse(c){if(this._getType(c)!==o.ZodParsedType.object){const O=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(O,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.object,received:O.parsedType}),a.INVALID}const{status:_,ctx:v}=this._processInputParams(c),{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],se=v.data[O];U.push({key:{status:"valid",value:O},value:$._parse(new d(v,se,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 se=v.data[$];U.push({key:{status:"valid",value:$},value:O._parse(new d(v,se,v.path,$)),alwaysSet:$ in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const O=[];for(const $ of U){const se=await $.key,zr=await $.value;O.push({key:se,value:zr,alwaysSet:$.alwaysSet})}return O}).then(O=>a.ParseStatus.mergeObjectSync(_,O)):a.ParseStatus.mergeObjectSync(_,U)}get shape(){return this._def.shape()}strict(c){return s.errorUtil.errToObj,new W({...this._def,unknownKeys:"strict",...c!==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(c).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(c){return new W({...this._def,shape:()=>({...this._def.shape(),...c})})}merge(c){return new W({unknownKeys:c._def.unknownKeys,catchall:c._def.catchall,shape:()=>({...this._def.shape(),...c._def.shape()}),typeName:L.ZodObject})}setKey(c,h){return this.augment({[c]:h})}catchall(c){return new W({...this._def,catchall:c})}pick(c){const h={};return o.util.objectKeys(c).forEach(_=>{c[_]&&this.shape[_]&&(h[_]=this.shape[_])}),new W({...this._def,shape:()=>h})}omit(c){const h={};return o.util.objectKeys(this.shape).forEach(_=>{c[_]||(h[_]=this.shape[_])}),new W({...this._def,shape:()=>h})}deepPartial(){return xt(this)}partial(c){const h={};return o.util.objectKeys(this.shape).forEach(_=>{const v=this.shape[_];c&&!c[_]?h[_]=v:h[_]=v.optional()}),new W({...this._def,shape:()=>h})}required(c){const h={};return o.util.objectKeys(this.shape).forEach(_=>{if(c&&!c[_])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(o.util.objectKeys(this.shape))}}E.ZodObject=W,W.create=(y,c)=>new W({shape:()=>y,unknownKeys:"strip",catchall:ke.create(),typeName:L.ZodObject,...p(c)}),W.strictCreate=(y,c)=>new W({shape:()=>y,unknownKeys:"strict",catchall:ke.create(),typeName:L.ZodObject,...p(c)}),W.lazycreate=(y,c)=>new W({shape:y,unknownKeys:"strip",catchall:ke.create(),typeName:L.ZodObject,...p(c)});class Jt extends g{_parse(c){const{ctx:h}=this._processInputParams(c),_=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,c)=>new Jt({options:y,typeName:L.ZodUnion,...p(c)});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?o.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(c){const{ctx:h}=this._processInputParams(c);if(h.parsedType!==o.ZodParsedType.object)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:o.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(c,h,_){const v=new Map;for(const b of h){const D=Pe(b.shape[c]);if(!D.length)throw new Error(`A discriminator value for key \`${c}\` could not be extracted from all schema options`);for(const R of D){if(v.has(R))throw new Error(`Discriminator property ${String(c)} has duplicate value ${String(R)}`);v.set(R,b)}}return new Br({typeName:L.ZodDiscriminatedUnion,discriminator:c,options:h,optionsMap:v,...p(_)})}}E.ZodDiscriminatedUnion=Br;function Ln(y,c){const h=(0,o.getParsedType)(y),_=(0,o.getParsedType)(c);if(y===c)return{valid:!0,data:y};if(h===o.ZodParsedType.object&&_===o.ZodParsedType.object){const v=o.util.objectKeys(c),b=o.util.objectKeys(y).filter(R=>v.indexOf(R)!==-1),D={...y,...c};for(const R of b){const U=Ln(y[R],c[R]);if(!U.valid)return{valid:!1};D[R]=U.data}return{valid:!0,data:D}}else if(h===o.ZodParsedType.array&&_===o.ZodParsedType.array){if(y.length!==c.length)return{valid:!1};const v=[];for(let b=0;b<y.length;b++){const D=y[b],R=c[b],U=Ln(D,R);if(!U.valid)return{valid:!1};v.push(U.data)}return{valid:!0,data:v}}else return h===o.ZodParsedType.date&&_===o.ZodParsedType.date&&+y==+c?{valid:!0,data:y}:{valid:!1}}class Qt extends g{_parse(c){const{status:h,ctx:_}=this._processInputParams(c),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,c,h)=>new Qt({left:y,right:c,typeName:L.ZodIntersection,...p(h)});class Te extends g{_parse(c){const{status:h,ctx:_}=this._processInputParams(c);if(_.parsedType!==o.ZodParsedType.array)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.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(c){return new Te({...this._def,rest:c})}}E.ZodTuple=Te,Te.create=(y,c)=>{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(c)})};class er extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(c){const{status:h,ctx:_}=this._processInputParams(c);if(_.parsedType!==o.ZodParsedType.object)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.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(c,h,_){return h instanceof g?new er({keyType:c,valueType:h,typeName:L.ZodRecord,...p(_)}):new er({keyType:ge.create(),valueType:c,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(c){const{status:h,ctx:_}=this._processInputParams(c);if(_.parsedType!==o.ZodParsedType.map)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.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,c,h)=>new Mr({valueType:c,keyType:y,typeName:L.ZodMap,...p(h)});class rt extends g{_parse(c){const{status:h,ctx:_}=this._processInputParams(c);if(_.parsedType!==o.ZodParsedType.set)return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.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(c,h){return new rt({...this._def,minSize:{value:c,message:s.errorUtil.toString(h)}})}max(c,h){return new rt({...this._def,maxSize:{value:c,message:s.errorUtil.toString(h)}})}size(c,h){return this.min(c,h).max(c,h)}nonempty(c){return this.min(1,c)}}E.ZodSet=rt,rt.create=(y,c)=>new rt({valueType:y,minSize:null,maxSize:null,typeName:L.ZodSet,...p(c)});class Et extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(c){const{ctx:h}=this._processInputParams(c);if(h.parsedType!==o.ZodParsedType.function)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:o.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}),se=await Reflect.apply(D,this,$);return await R._def.returns._def.type.parseAsync(se,b).catch(Mn=>{throw O.addIssue(v(se,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),se=R._def.returns.safeParse($,b);if(!se.success)throw new u.ZodError([v($,se.error)]);return se.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...c){return new Et({...this._def,args:Te.create(c).rest(tt.create())})}returns(c){return new Et({...this._def,returns:c})}implement(c){return this.parse(c)}strictImplement(c){return this.parse(c)}static create(c,h,_){return new Et({args:c||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(c){const{ctx:h}=this._processInputParams(c);return this._def.getter()._parse({data:h.data,path:h.path,parent:h})}}E.ZodLazy=tr,tr.create=(y,c)=>new tr({getter:y,typeName:L.ZodLazy,...p(c)});class rr extends g{_parse(c){if(c.data!==this._def.value){const h=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(h,{received:h.data,code:u.ZodIssueCode.invalid_literal,expected:this._def.value}),a.INVALID}return{status:"valid",value:c.data}}get value(){return this._def.value}}E.ZodLiteral=rr,rr.create=(y,c)=>new rr({value:y,typeName:L.ZodLiteral,...p(c)});function _s(y,c){return new qe({values:y,typeName:L.ZodEnum,...p(c)})}class qe extends g{constructor(){super(...arguments),r.set(this,void 0)}_parse(c){if(typeof c.data!="string"){const h=this._getOrReturnCtx(c),_=this._def.values;return(0,a.addIssueToContext)(h,{expected:o.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(c.data)){const h=this._getOrReturnCtx(c),_=this._def.values;return(0,a.addIssueToContext)(h,{received:h.data,code:u.ZodIssueCode.invalid_enum_value,options:_}),a.INVALID}return(0,a.OK)(c.data)}get options(){return this._def.values}get enum(){const c={};for(const h of this._def.values)c[h]=h;return c}get Values(){const c={};for(const h of this._def.values)c[h]=h;return c}get Enum(){const c={};for(const h of this._def.values)c[h]=h;return c}extract(c,h=this._def){return qe.create(c,{...this._def,...h})}exclude(c,h=this._def){return qe.create(this.options.filter(_=>!c.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(c){const h=o.util.getValidEnumValues(this._def.values),_=this._getOrReturnCtx(c);if(_.parsedType!==o.ZodParsedType.string&&_.parsedType!==o.ZodParsedType.number){const v=o.util.objectValues(h);return(0,a.addIssueToContext)(_,{expected:o.util.joinValues(v),received:_.parsedType,code:u.ZodIssueCode.invalid_type}),a.INVALID}if(e(this,n,"f")||t(this,n,new Set(o.util.getValidEnumValues(this._def.values)),"f"),!e(this,n,"f").has(c.data)){const v=o.util.objectValues(h);return(0,a.addIssueToContext)(_,{received:_.data,code:u.ZodIssueCode.invalid_enum_value,options:v}),a.INVALID}return(0,a.OK)(c.data)}get enum(){return this._def.values}}E.ZodNativeEnum=nr,n=new WeakMap,nr.create=(y,c)=>new nr({values:y,typeName:L.ZodNativeEnum,...p(c)});class St extends g{unwrap(){return this._def.type}_parse(c){const{ctx:h}=this._processInputParams(c);if(h.parsedType!==o.ZodParsedType.promise&&h.common.async===!1)return(0,a.addIssueToContext)(h,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.promise,received:h.parsedType}),a.INVALID;const _=h.parsedType===o.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,c)=>new St({type:y,typeName:L.ZodPromise,...p(c)});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(c){const{status:h,ctx:_}=this._processInputParams(c),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);o.util.assertNever(v)}}E.ZodEffects=ve,E.ZodTransformer=ve,ve.create=(y,c,h)=>new ve({schema:y,typeName:L.ZodEffects,effect:c,...p(h)}),ve.createWithPreprocess=(y,c,h)=>new ve({schema:c,effect:{type:"preprocess",transform:y},typeName:L.ZodEffects,...p(h)});class Ie extends g{_parse(c){return this._getType(c)===o.ZodParsedType.undefined?(0,a.OK)(void 0):this._def.innerType._parse(c)}unwrap(){return this._def.innerType}}E.ZodOptional=Ie,Ie.create=(y,c)=>new Ie({innerType:y,typeName:L.ZodOptional,...p(c)});class Ge extends g{_parse(c){return this._getType(c)===o.ZodParsedType.null?(0,a.OK)(null):this._def.innerType._parse(c)}unwrap(){return this._def.innerType}}E.ZodNullable=Ge,Ge.create=(y,c)=>new Ge({innerType:y,typeName:L.ZodNullable,...p(c)});class ir extends g{_parse(c){const{ctx:h}=this._processInputParams(c);let _=h.data;return h.parsedType===o.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,c)=>new ir({innerType:y,typeName:L.ZodDefault,defaultValue:typeof c.default=="function"?c.default:()=>c.default,...p(c)});class sr extends g{_parse(c){const{ctx:h}=this._processInputParams(c),_={...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,c)=>new sr({innerType:y,typeName:L.ZodCatch,catchValue:typeof c.catch=="function"?c.catch:()=>c.catch,...p(c)});class Vr extends g{_parse(c){if(this._getType(c)!==o.ZodParsedType.nan){const _=this._getOrReturnCtx(c);return(0,a.addIssueToContext)(_,{code:u.ZodIssueCode.invalid_type,expected:o.ZodParsedType.nan,received:_.parsedType}),a.INVALID}return{status:"valid",value:c.data}}}E.ZodNaN=Vr,Vr.create=y=>new Vr({typeName:L.ZodNaN,...p(y)}),E.BRAND=Symbol("zod_brand");class Bn extends g{_parse(c){const{ctx:h}=this._processInputParams(c),_=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(c){const{status:h,ctx:_}=this._processInputParams(c);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(c,h){return new ar({in:c,out:h,typeName:L.ZodPipeline})}}E.ZodPipeline=ar;class or extends g{_parse(c){const h=this._def.innerType._parse(c),_=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,c)=>new or({innerType:y,typeName:L.ZodReadonly,...p(c)});function gs(y,c){const h=typeof y=="function"?y(c):typeof y=="string"?{message:y}:y;return typeof h=="string"?{message:h}:h}function ys(y,c={},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 se=gs(c,_),zr=($=(O=se.fatal)!==null&&O!==void 0?O:h)!==null&&$!==void 0?$:!0;v.addIssue({code:"custom",...se,fatal:zr})}});if(!R){const U=gs(c,_),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,c={message:`Input not instance of ${y.name}`})=>ys(h=>h instanceof y,c);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 o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}: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(Ui(),e),r(So(),e),r(Cd(),e),r(In(),e),r(Nd(),e),r(Oi(),e)}(ot)),ot}var Ys;function Zi(){return Ys||(Ys=1,function(e){var t=be&&be.__createBinding||(Object.create?function(a,o,u,d){d===void 0&&(d=u);var l=Object.getOwnPropertyDescriptor(o,u);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[u]}}),Object.defineProperty(a,d,l)}:function(a,o,u,d){d===void 0&&(d=u),a[d]=o[u]}),r=be&&be.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=be&&be.__importStar||function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var u in a)u!=="default"&&Object.prototype.hasOwnProperty.call(a,u)&&t(o,a,u);return r(o,a),o},i=be&&be.__exportStar||function(a,o){for(var u in a)u!=="default"&&!Object.prototype.hasOwnProperty.call(o,u)&&t(o,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,o){super(i,{cause:o}),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 $i(){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 o=i;o<s;o++)if(a=n.charCodeAt(o),!(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(o+2>=s||!t(n.charCodeAt(o+1))||!t(n.charCodeAt(o+2)))return!1;o+=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 kd(){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(!o(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(!o(u.charCodeAt(d)))throw new e.InvalidDidError(u,`Invalid character at position ${d}`)}const o=u=>u>=97&&u<=122||u>=50&&u<=55;return Ye}var Xn={},le={},Ks;function Li(){if(Ks)return le;Ks=1,Object.defineProperty(le,"__esModule",{value:!0}),le.didSchema=le.DID_PREFIX=void 0,le.assertDidMethod=i,le.extractDidMethod=s,le.assertDidMsid=a,le.assertDid=o,le.isDid=u,le.asDid=d;const e=Zi(),t=Cr(),r="did:";le.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 o(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 o(l),!0}catch(p){if(p instanceof t.DidError)return!1;throw p}}function d(l){return o(l),l}return le.didSchema=e.z.string().superRefine((l,p)=>{try{return o(l),!0}catch(g){return p.addIssue({code:e.z.ZodIssueCode.custom,message:g instanceof Error?g.message:"Unexpected error"}),!1}}),le}var Xs;function Pd(){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=o,e.urlToDidWeb=u,e.buildDidWebUrl=d;const t=Cr(),r=Li(),n=$i();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 o(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 o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}: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(kd(),e),r(Pd(),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 Ad(){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=o,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=Zi(),r=Cr(),n=$i(),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 o(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 Od(){return ta||(ta=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.didDocumentValidator=e.didDocumentSchema=void 0;const t=Zi(),r=Li(),n=$i(),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"})]),o=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,o]);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(o).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 o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}: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(Ad(),e),r(Od(),e),r(Cr(),e),r(Li(),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 o=e.length-1;o>=0;o--)(a=e[o])&&(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 o=n.kind,u=o==="getter"?"get":o==="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])(o==="accessor"?{get:l.get,set:l.set}:l[u],x);if(o==="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))&&(o==="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 o(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(o,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=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(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 Bi(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(o){a={error:o}}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(Bi(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,o=s.length;a<o;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),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(m){return function(x){return Promise.resolve(x).then(m,p)}}function o(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(o,u){a=e[s](a),i(o,u,a.done,a.value)})}}function i(s,a,o,u){Promise.resolve(u).then(function(d){s({value:d,done:o})},a)}}function Go(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Ud=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 Ud(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 Zd=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 Zd(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 $d={__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:Bi,__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},Ld=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:Bi,__rest:Ro,__rewriteRelativeImportExtension:Qo,__runInitializers:ko,__setFunctionName:Ao,__spread:Lo,__spreadArray:Mo,__spreadArrays:Bo,__values:_n,default:$d},Symbol.toStringTag,{value:"Module"})),ec=rd(Ld);var pr={},Fe={},na;function Mi(){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:o}=s.split(":");if(a<3)throw new i("DID requires prefix, method, and method-specific content");if(!/^[a-z]+$/.test(o))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 Vi(){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=o,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 o(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 zi(){if(sa)return pr;sa=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.ensureValidAtIdentifier=r,pr.isValidAtIdentifier=n;const e=Mi(),t=Vi();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={},fe={},aa;function qi(){if(aa)return fe;aa=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.InvalidNsidError=fe.NSID=void 0,fe.ensureValidNsid=t,fe.parseNsid=r,fe.isValidNsid=n,fe.validateNsid=i,fe.ensureValidNsidRegex=l,fe.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(".")}}fe.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(o(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 o(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 fe.InvalidNsidError=g,fe}var jt={},oa;function Bd(){if(oa)return jt;oa=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.ensureValidAtUri=i,jt.ensureValidAtUriRegex=s,jt.isValidAtUri=a;const e=zi(),t=Mi(),r=Vi(),n=qi();function i(o){const u=o.indexOf("#");if(u!==-1){if(o.charCodeAt(u+1)!==47)throw new Error("ATURI fragment must be non-empty and start with slash");if(o.includes("#",u+1))throw new Error('ATURI can have at most one "#", separating fragment out');const I=o.slice(u+1);if(!/^\/[a-zA-Z0-9._~:@!$&')(*+,;=%[\]/-]*$/.test(I))throw new Error("Disallowed characters in ATURI fragment (ASCII)")}const d=u===-1?o:o.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(o){const u=/^at:\/\/(?<authority>[a-zA-Z0-9._:%-]+)(\/(?<collection>[a-zA-Z0-9-.]+)(\/(?<rkey>[a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(#(?<fragment>\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/,d=o.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(o.length>8*1024)throw new Error("ATURI is far too long")}function a(o){try{s(o)}catch{return!1}return!0}return jt}var ca;function Md(){return ca||(ca=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AtUri=e.ATP_URI_REGEX=void 0;const t=ec,r=zi(),n=qi();t.__exportStar(Bd(),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},o(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 o(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 Vd(){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 o=a.toISOString();if(t(o))return o;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 zd(){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 qd(){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(o){if(o.length>e||o.length<t)throw new a(`record key must be ${t} to ${e} characters`);if(r.has(o))throw new a('record key can not be "." or ".."');if(!n.test(o))throw new a("record key syntax not valid (regex)")}function s(o){return o.length>=t&&o.length<=e&&n.test(o)&&!r.has(o)}class a extends Error{}return lt.InvalidRecordKeyError=a,lt}var ft={},fa;function Gd(){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 Yd(){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 Fd(){return pa||(pa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ec;t.__exportStar(zi(),e),t.__exportStar(Md(),e),t.__exportStar(Vd(),e),t.__exportStar(Mi(),e),t.__exportStar(Vi(),e),t.__exportStar(qi(),e),t.__exportStar(zd(),e),t.__exportStar(qd(),e),t.__exportStar(Gd(),e),t.__exportStar(Yd(),e)}(Qn)),Qn}var ma;function Gi(){if(ma)return hr;ma=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.isNsid=void 0;const e=Fd(),t=r=>typeof r=="string"&&(0,e.isValidNsid)(r);return hr.isNsid=t,hr}var _r={},_a;function Hd(){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=Gi();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 o{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 o.parser.format(this)}static fromString(l){if(!(0,i.isScopeStringFor)(l,"repo"))return null;const p=n.ScopeStringSyntax.fromString(l);return o.fromSyntax(p)}static fromSyntax(l){const p=o.parser.parse(l);return p?new o(p.collection,p.action):null}static scopeNeededFor(l){return o.parser.format({collection:[l.collection],action:[l.action]})}}e.RepoPermission=o,Object.defineProperty(o,"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=Gi();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 o=d=>d==="*"||(0,t.isAtprotoAudience)(d);e.isAudParam=o;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=Gi();Object.defineProperty(e,"isNsid",{enumerable:!0,get:function(){return r.isNsid}});const n=Vt(),i=Hd(),s=vt(),a=yt(),o=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 o.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")?o.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 Wd(){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(),o=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||o.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,o.RepoPermission,u.RpcPermission]){const w=x.fromString(m);if(w)return w.toString()}return null}}(zn)),zn}var gr={},xa;function Yi(){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=Yi();Object.defineProperty(e,"ScopeMissingError",{enumerable:!0,get:function(){return t.ScopeMissingError}});const r=Sn(),n=wn(),i=Tn(),s=Dr(),a=Nr();class o 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 o(g==null?void 0:g.split(" "))}}e.ScopesSet=o;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=Yi(),t=Sn(),r=wn(),n=Tn(),i=Dr(),s=Nr(),a=rc();class o{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=o,vr}var wa;function Kd(){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 Xd(){return Ta||(Ta=1,function(e){var t=it&&it.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}: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(Wd(),e),r(Yi(),e),r(Kd(),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 oe=Xd();const Fi=S.forwardRef(({className:e,invalid:t,disabled:r,...n},i)=>f.jsx("input",{...n,type:"checkbox",ref:i,disabled:r,className:re(["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])}));Fi.displayName="Checkbox";function Jd({scope:e,permissionSets:t,clientTrusted:r=!1,clientFirstParty:n=!1,allowEmail:i,onAllowEmail:s,className:a="",...o}){const u=S.useMemo(()=>Array.from(new Set(e==null?void 0:e.split(" ").map(l=>oe.IncludeScope.fromString(l)).filter(l=>l!=null))),[e]),d=S.useMemo(()=>new oe.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}`,...o,role:"list",children:[f.jsx(rl,{permissions:d,allowEmail:i,onAllowEmail:s}),f.jsx(ol,{permissions:d}),f.jsx(nl,{permissions:d}),f.jsx(sl,{permissions:d}),f.jsx(al,{permissions:d}),f.jsx(Qd,{includeScopes:u,permissionSets:t}),f.jsx(il,{permissions:d}),(!n||!r)&&f.jsx(tl,{className:"mt-2",permissions:d})]})}function Qd({includeScopes:e,permissionSets:t}){return e.length?f.jsx(f.Fragment,{children:e.map((r,n)=>f.jsx(el,{includeScope:r,permissionSet:t[r.nsid]},n))}):null}function el({includeScope:e,permissionSet:t}){const{nsid:r}=e,n=S.useMemo(()=>t?new oe.ScopePermissionsTransition(e.toScopes(t)):null,[e,t]);return f.jsxs(we,{role:"listitem",image:oc(r)?f.jsx(go,{className:"size-6"}):Hi(r)?f.jsx(yo,{className:"size-6"}):r.startsWith("com.atproto.moderation.")?f.jsx(sd,{className:"size-6"}):f.jsx(ad,{className:"size-6"}),title:f.jsx(Ss,{object:t,property:"title",fallback:r}),description:f.jsx(Ss,{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 tl({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 rl({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(nd,{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(Fi,{className:"m-2",checked:t,onChange:a=>r(a.target.checked)})})}):null}function nl({permissions:e}){const{i18n:t,_:r}=q();return e.allowsAccount({attr:"status",action:"manage"})?f.jsx(we,{role:"listitem",image:f.jsx(id,{className:"size-6"}),title:t._({id:"AeXO77"}),description:t._({id:"NKHn7N"})}):null}function il({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=oe.RpcPermission.fromString(n);if(i){if(r=!0,ac(i.aud)||i.lxm.every(pi))continue;return!1}const s=oe.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(ul,{permissions:e}),f.jsx(cl,{permissions:e})]})}function sl({permissions:e}){const t=S.useMemo(()=>e.scopes.some(ll),[e]),r=S.useMemo(()=>e.scopes.some(fl),[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 al({permissions:e}){const{i18n:t,_:r}=q();return S.useMemo(()=>e.hasTransitionChatBsky||e.scopes.some(dl),[e])?f.jsx(we,{role:"listitem",image:f.jsx(yo,{className:"size-6"}),title:t._({id:"AHZflp"}),description:t._({id:"yZDyOS"})}):null}function ol({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(jr,{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 cl({permissions:e}){const{i18n:t,_:r}=q();return e.hasTransitionGeneric?f.jsx(we,{role:"listitem",image:f.jsx(Ts,{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=>oe.RpcPermission.fromString(n)!=null)?f.jsxs(we,{role:"listitem",image:f.jsx(Ts,{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=oe.RpcPermission.fromString(s);if(!a)continue;let o=i.get(a.aud);o||i.set(a.aud,o=new Set);for(const u of a.lxm)o.add(u)}return Array.from(i.entries()).sort(([s],[a])=>s.localeCompare(a)).map(([s,a])=>[s,a.has("*")?["*"]:Array.from(a).sort((o,u)=>o.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,o,u)=>f.jsxs("tr",{className:"text-xs",children:[f.jsx("td",{className:o>0?"pt-1":void 0,children:f.jsx(hl,{lxm:a})}),o===0&&f.jsx("td",{className:"align-top",rowSpan:u.length,children:f.jsx(pl,{aud:i})})]},a)))})]}):null}function ul({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(ws,{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=>oe.RepoPermission.fromString(n)!=null)?f.jsxs(we,{role:"listitem",image:f.jsx(ws,{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=oe.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 oe.BlobPermission(["*/*"])]:Array.from(e.scopes.map(d=>oe.BlobPermission.fromString(d))).filter(d=>d!=null),[e]);if(!s.size)return null;const o=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(ml,{coll:d})}),f.jsx("td",{className:"text-center",children:o!=null&&o.create||l.create?f.jsx(dn,{className:"inline-block size-3"}):null}),f.jsx("td",{className:"text-center",children:o!=null&&o.update||l.update?f.jsx(dn,{className:"inline-block size-3"}):null}),f.jsx("td",{className:"text-center",children:o!=null&&o.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 Hi(e){return e.startsWith("chat.bsky.")}function dl(e){if(e==="transition:chat.bsky")return!0;const t=oe.RpcPermission.fromString(e);return!t||ac(t.aud)?!1:t.lxm.includes("*")||t.lxm.some(Hi)}function pi(e){return e==="*"?!1:e==="com.atproto.moderation.createReport"||oc(e)||Hi(e)}function ll(e){if(e==="transition:generic")return!0;const t=oe.RepoPermission.fromString(e);return t?t.collection.includes("*")||t.collection.some(pi):!1}function fl(e){if(e==="transition:generic")return!0;const t=oe.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 hl({lxm:e,...t}){return e==="*"?f.jsx(Nt,{...t,children:f.jsx(C,{id:"P5xSNt"})}):f.jsx(cc,{...t,nsid:e})}function pl({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 ml({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 Wi({actions:e,cancel:t,append:r,children:n,prepend:i,disabled:s,inert:a=s,...o}){return f.jsxs("form",{...o,inert:a,className:"flex flex-col gap-4",children:[i&&f.jsx("div",{children:i},"prepend"),f.jsx("div",{className:"space-y-4",children:n},"children"),r&&f.jsx("div",{children:r},"append"),(e||t)&&f.jsxs("div",{className:"flex flex-row-reverse flex-wrap items-center justify-end space-x-2 space-x-reverse",children:[e,f.jsx("div",{className:"flex-auto"}),t]},"buttons")]})}function Ra({account:e,...t}){return f.jsx("b",{...t,children:e.preferred_username||e.email||e.sub})}const _l=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 gl({url:e,proto:t=!1,host:r=!0,path:n=!1,query:i=!1,hash:s=!1,as:a="span",...o}){const u=S.useMemo(()=>e instanceof URL?e:new URL(e),[e]);return f.jsxs(a,{...o,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 yl({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=_l(e);return f.jsx(gl,{...n,url:i,proto:!s,host:!0,path:!s,query:!s,hash:!1})}return f.jsx("span",{...n,children:e})}function vl(e){return e.startsWith("transition:")}function bl(e){const t=oe.AccountPermission.fromString(e);return t?t.matches({attr:"email",action:"read"}):!1}function xl(e){return e==null?void 0:e.split(" ").filter(t=>!bl(t)).join(" ")}function El({clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:i,account:s,scope:a,onConsent:o,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(vl));return f.jsxs(Wi,{...m,onSubmit:A=>{A.preventDefault();const j=P&&!I?xl(a):a;o(j)},cancel:p&&f.jsx(ae,{onClick:p,children:g||f.jsx(C,{id:"iH8pgl"})}),actions:f.jsxs(f.Fragment,{children:[f.jsx(ae,{type:"submit",color:"primary",children:u||f.jsx(C,{id:"yIVrHZ"})}),f.jsx(ae,{onClick:d,children:l||f.jsx(C,{id:"54JiGG"})})]}),children:[f.jsx(we,{image:f.jsx(Td,{clientId:e,clientMetadata:t,clientTrusted:r}),title:f.jsx(yl,{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(Jd,{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 Sl({clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:i,account:s,scope:a,onConsent:o,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(El,{clientId:e,clientMetadata:t,clientTrusted:r,clientFirstParty:n,permissionSets:i,account:s,scope:a,onBack:d,onConsent:o,onReject:u})})}const Rn=S.createContext({disabled:!1});Rn.displayName="FieldsetContext";function Le({label:e,children:t,disabled:r,...n}){const i=Ir({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 wl(e,{ref:t,onLoading:r,onError:n}={}){const[i,s]=S.useState(!1),[a,o]=S.useState(),u=S.useCallback(m=>{o(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))):Tl(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 Tl(e,t){return e.aborted&&(e.reason===t||e.reason===(t==null?void 0:t.cause)||t instanceof DOMException&&t.name==="AbortError")}const Il=({error:e})=>f.jsx(od,{error:e});function zt({invalid:e,disabled:t,onSubmit:r,submitLabel:n,onCancel:i=void 0,cancelLabel:s,errorRender:a=Il,ref:o,onLoading:u,onError:d,children:l,...p}){const{run:g,loading:m,error:x}=wl(r,{ref:o,onError:d,onLoading:u}),w=S.useCallback(I=>{I.preventDefault(),I.currentTarget.reportValidity()&&!t&&!e&&g()},[t,e,g]);return f.jsx(Wi,{...p,onSubmit:w,disabled:t||m,prepend:x!=null?a({error:x}):void 0,cancel:i&&f.jsx(ae,{onClick:i,children:s||f.jsx(C,{id:"dEgA5A"})}),actions:f.jsx(ae,{color:"primary",type:"submit",loading:m,disabled:t,children:n||f.jsx(C,{id:"hQRttt"})}),children:l})}const Ue=8,jl=/(\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,[jl])?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 Rl({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 Cl({password:e,className:t,...r}){const{i18n:n,_:i}=q(),s=e?dc(e):0,a="bg-gray-300 dark:bg-slate-500",o=s===mt.extra||s===mt.strong?"bg-success":s===mt.moderate?"bg-warning":"bg-error";return f.jsx("div",{...r,className:re("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?o:a}`},d))})}function Dl(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Qe(e){return t=>{for(const r of e)r&&Dl(r,t)}}function Nl({visible:e,toggleVisible:t,onClick:r,...n}){const{i18n:i,_:s}=q();return f.jsx(ae,{...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(cd,{className:"w-5","aria-hidden":!0}):f.jsx(ud,{className:"w-5","aria-hidden":!0})})}function gn({icon:e,append:t,bellow:r,actionable:n,className:i,children:s,onFocus:a,onBlur:o,...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=>{o==null||o(p),p.defaultPrevented||l(!1)},className:re("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:re("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:re("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:re("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:o,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:re("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:o??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(dd,{className:"w-5"}),value:a,defaultValue:o=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 o=="string"?o:""),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(Nl,{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,_:o}=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(Cl,{password:u}),f.jsx(Rl,{className:"grow-1 min-w-max text-xs text-gray-500 dark:text-gray-400",password:u})]})})}const kl="XXXXX-XXXXX";function hc({example:e=kl,onToken:t,icon:r=f.jsx(vo,{className:"w-5"}),title:n=e,onChange:i,value:s,defaultValue:a=s,...o}){const{i18n:u,_:d}=q(),[l,p]=S.useState(typeof a=="string"?a:"");return f.jsx(qt,{...o,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 Pl({onSubmit:e,invalid:t,...r}){const n=Ir({prefix:"reset-pwd-email-"}),i=S.useRef(null),[s,a]=S.useState(null),[o,u]=S.useState(void 0);return f.jsxs(zt,{...r,onSubmit:d=>{if(s&&o)return e({token:s,password:o},d)},invalid:t||!s||!o,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:o,onPassword:u})})]})}function pc({onEmail:e,autoCapitalize:t="none",autoComplete:r="email",autoCorrect:n="off",dir:i="auto",icon:s=f.jsx(jr,{className:"w-5"}),onBlur:a,onChange:o,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),o==null||o(A),e==null||e(A.target.validity.valid?j:void 0)},[o,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 Al({emailDefault:e,onSubmit:t,invalid:r,ref:n,...i}){const{i18n:s,_:a}=q(),o=Ir({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":o,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:o,children:f.jsx(C,{id:"cHrOqs"})})]})})}function Ol({emailDefault:e,onresetPasswordRequest:t,onResetPasswordConfirm:r,onBack:n,...i}){const{i18n:s,_:a}=q(),[o,u]=S.useState(0);if(o===0)return f.jsxs(Ee,{...i,title:i.title||s._({id:"dn8X5t"}),subtitle:i.subtitle||f.jsx(C,{id:"Esfg1M"}),children:[f.jsx(Al,{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(ae,{transparent:!0,onClick:()=>u(1),children:f.jsx(C,{id:"FTT4a4"})})})]});if(o===1)return f.jsx(Ee,{...i,title:i.title||s._({id:"KbS2K9"}),subtitle:i.subtitle||f.jsx(C,{id:"xg/UcZ"}),children:f.jsx(Pl,{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(o===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(ae,{color:"primary",onClick:n,children:f.jsx(C,{id:"UaXeX3"})})]})});throw new Error(`Invalid view: ${o}`)}function Ul({className:e,children:t,id:r,ref:n,disabled:i,title:s,"aria-label":a=s,"aria-labelledby":o,...u}){const d=Ir("input-checkbox-"),l=S.useRef(null),p=S.useRef(null),g=S.useContext(Rn),m=r??d;return f.jsx(gn,{className:re("cursor-pointer",e),icon:f.jsx(Fi,{...u,disabled:i??g.disabled,title:s,"aria-label":a,"aria-labelledby":t?void 0:o??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:o,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),ue=S.useCallback(()=>{j(null),B(null)},[j,B]),z=S.useCallback(()=>{var G;ue(),(G=H.current)==null||G.reset()},[ue,H]),ne=S.useCallback(async G=>{try{await n({username:m,password:w,remember:N,...Z?{[Z.type]:A}:{}},G)}catch(de){if(G.aborted)return;if(de instanceof ld){B(de);return}throw de instanceof fd&&ue(),de}},[m,w,N,Z,A,n]);return f.jsxs(zt,{...l,ref:Qe([o,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:ne,children:[f.jsx(Le,{disabled:M,label:f.jsx(C,{id:"sJGljQ"}),children:f.jsx(qt,{icon:f.jsx(jr,{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(ae,{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(Ul,{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 Zl({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:"-ml-1 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(hd,{className:"-mx-1 -mb-1"})})}function $l({accounts:e,onAccount:t,onOther:r=void 0,onBack:n,onSignUp:i,backLabel:s,children:a,...o}){const{i18n:u,_:d}=q();return f.jsxs(Wi,{...o,append:a,actions:i&&f.jsx(ae,{onClick:i,color:"primary",transparent:!0,children:f.jsx(C,{id:"e+RpCP"})}),cancel:n&&f.jsx(ae,{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(Zl,{src:l.picture,alt:u._({id:"kfcRb0"})}),append:f.jsx(Is,{"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(Is,{"aria-hidden":!0,className:"h-4"}),icon:f.jsx(jr,{"aria-hidden":!0,className:"h-4"}),children:f.jsx("span",{className:"truncate text-slate-700 dark:text-slate-400",children:f.jsx(C,{id:"+TaG50"})})},"other")]})}function Ll({loginHint:e,sessions:t,selectSub:r,onSignIn:n,onSignUp:i,onForgotPassword:s,onBack:a,backLabel:o,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:o,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:o})}):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($l,{accounts:w,onAccount:P=>r(P.sub),onOther:()=>N(!0),onBack:a,backLabel:o,onSignUp:i})})}const Ze=e=>e!=null&&e!==!1,Bl=e=>Ze(e)&&e.invalid===!0,Ml=e=>!Ze(e)||e.invalid===!1;function Vl(e){const t=e.findIndex(Ze),r=e.findLastIndex(Ze),n=e.findIndex(Bl),[i,s]=S.useState(t),a=S.useCallback(A=>A!==-1&&e[A]?(s(A),!0):!1,[e.map(Ze).join()]),o=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(o),[a,o]),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(Ml),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 zl({prevLabel:e,nextLabel:t,onBack:r,backLabel:n,onDone:i,doneLabel:s,steps:a,className:o,...u}){var B,M;const{atFirst:d,atLast:l,count:p,current:g,currentPosition:m,completed:x,toNext:w,toPrev:I,toRequired:N}=Vl(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:re(o,"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 ql({links:e,className:t,...r}){const n=e==null?void 0:e.find(i=>i.rel==="help");return n?f.jsx("p",{...r,className:re("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 Gl({inviteCodeRequired:e=!0,credentials:t,onCredentials:r,onNext:n,nextLabel:i,onPrev:s,prevLabel:a,children:o,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:o,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:re("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 Yl=18,mc=3,_c=30,Fl=e=>mc+e.length<=_c&&e.startsWith(".")&&!e.endsWith(".");function Hl(e){const t=mc,r=Math.min(Yl,_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 Wl({domains:e,onNext:t,nextLabel:r,onPrev:n,prevLabel:i,handle:s,onHandle:a,invalid:o,children:u,ref:d,...l}){const{i18n:p,_:g}=q(),m=e.filter(Fl),x=S.useRef(null),[w,I]=S.useState(()=>{const z=m.findIndex(ne=>s==null?void 0:s.endsWith(ne));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}=Hl(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),ue=`@${N}${A}`;return f.jsxs(zt,{...l,ref:Qe([d,x]),onCancel:n,cancelLabel:i,onSubmit:t,submitLabel:r,invalid:o||!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(jr,{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 ne=z.target.value.toLowerCase(),G=z.target.selectionStart,de=z.target.selectionEnd;z.target.value=ne,z.target.setSelectionRange(G,de),P(ne)},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 ne;I(Number(z.target.value)),(ne=H.current)==null||ne.focus()},className:re("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,ne)=>f.jsx("option",{value:ne,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:ue}):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:re("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(pd,{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 Kl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,mi(e,t)}var gc=Object.defineProperty,Xl=Object.defineProperties,Jl=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)=>Xl(e,Jl(t)),Ql=(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{o(r.next(u))}catch(d){i(d)}},a=u=>{try{o(r.throw(u))}catch(d){i(d)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,a);o((r=r.apply(e,t)).next())});function ef(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 tf="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 rf(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 nf(e){return typeof Element<"u"&&Be(e,Element)}function sf(e){return Gt(e,"RegExp")}function Ji(e){return!!(e&&e.then&&typeof e.then=="function")}function af(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 of(e,t,r=!1){return Xe(e)?sf(t)?t.test(e):Xe(t)?r?e===t:e.includes(t):!1:!1}function kr(e,t=[],r=!1){return t.some(n=>of(e,n,r))}function cf(e,t,r=250,n,i,s,a){if(!s.exception||!s.exception.values||!a||!Be(a.originalException,Error))return;let o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=uf(gi(e,t,i,a.originalException,n,s.exception.values,o,0),r))}function gi(e,t,r,n,i,s,a,o){if(s.length>=r+1)return s;let u=[...s];if(Be(n[i],Error)){Aa(a,o);let d=e(t,n[i]),l=u.length;Oa(d,i,l,o),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,o);let p=e(t,d),g=u.length;Oa(p,`errors[${l}]`,g,o),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 uf(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(),df=80;function Zt(e,t={}){try{let r=e,n=5,i=[],s=0,a=0,o=" > ",u=o.length,d,l=Array.isArray(t)?t:t.keyAttrs,p=!Array.isArray(t)&&t.maxStringLength||df;for(;r&&s++<n&&(d=lf(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(o)}catch{return"<unknown>"}}function lf(e,t){let r=e,n=[],i,s,a,o,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],o=r.getAttribute(a),o&&n.push(`[${a}="${o}"]`);return n.join("")}function ff(){try{return fn.document.location.href}catch{return""}}function hf(e){return fn.document&&fn.document.querySelector?fn.document.querySelector(e):null}var pf="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 mf(){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](`${pf}[${r}]:`,...n)})}}):yi.forEach(r=>{t[r]=()=>{}}),t}var k=mf(),_f=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function gf(e){return e==="http"||e==="https"}function Dn(e,t=!1){let{host:r,path:n,pass:i,port:s,projectId:a,protocol:o,publicKey:u}=e;return`${o}://${u}${t&&i?`:${i}`:""}@${r}${s?`:${s}`:""}/${n&&`${n}/`}${a}`}function yf(e){let t=_f.exec(e);if(!t){console.error(`Invalid Sentry Dsn: ${e}`);return}let[r,n,i="",s,a="",o]=t.slice(1),u="",d=o,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 vf(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+$/)?gf(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 bf(e){let t=typeof e=="string"?yf(e):Dc(e);if(!(!t||!vf(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 ie(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 xf(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 nf(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 Ef(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 Sf(...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 o=s[a];if(o.length>1024)continue;let u=$a.test(o)?o.replace($a,"$1"):o;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 wf(i)}}function wf(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 Tf(){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 If(){if(!Tf())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 jf(){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 Rf(e){if(!Ba[e])switch(Ba[e]=!0,e){case"console":Cf();break;case"dom":Zf();break;case"xhr":kf();break;case"fetch":Df();break;case"history":Pf();break;case"error":$f();break;case"unhandledrejection":Lf();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),Rf(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 Cf(){"console"in Q&&yi.forEach(function(e){e in Q.console&&ie(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 Df(){If()&&ie(Q,"fetch",function(e){return function(...t){let{method:r,url:n}=Nf(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 Nf(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 kf(){if(!te.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;ie(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"?ie(this,"onreadystatechange",function(a){return function(...o){return s(),a.apply(this,o)}}):this.addEventListener("readystatechange",s),ie(this,"setRequestHeader",function(a){return function(...o){let[u,d]=o,l=this[kt];return l&&(l.request_headers[u.toLowerCase()]=d),a.apply(this,o)}}),t.apply(this,r)}}),ie(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 Pf(){if(!jf())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)}}ie(te.history,"pushState",t),ie(te.history,"replaceState",t)}var Af=1e3,tn,rn;function Of(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}function Uf(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||Uf(r))return;let n=r.type==="keypress"?"input":r.type;tn===void 0?(e({event:r,name:n,global:t}),rn=r):Of(rn,r)&&(e({event:r,name:n,global:t}),rn=r),clearTimeout(tn),tn=te.setTimeout(()=>{tn=void 0},Af)}}function Zf(){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")||(ie(n,"addEventListener",function(i){return function(s,a,o){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,o)}l.refCount++}catch{}return i.call(this,s,a,o)}}),ie(n,"removeEventListener",function(i){return function(s,a,o){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,o),l.handler=void 0,delete d[s]),Object.keys(d).length===0&&delete u.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,o)}}))})}var nn=null;function $f(){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 Lf(){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 Bf(){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 ce(){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 Mf(e){return Array.isArray(e)?e:[e]}function Vf(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function zf(){return"npm"}function qf(){return!Vf()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Gf(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 Wf(n)>r?Oc(e,t-1,r):n}function wi(e,t,r=1/0,n=1/0,i=Bf()){let[s,a]=i;if(t==null||["number","boolean","string"].includes(typeof t)&&!Ic(t))return t;let o=Yf(e,t);if(!o.startsWith("[object "))return o;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 o.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 Yf(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(af(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=Ff(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Ff(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Hf(e){return~-encodeURI(e).split(/%..|./).length}function Wf(e){return Hf(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 Kf(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 o=a();return t.indexOf(o)===-1&&t.push(o),o.then(()=>n(o)).then(null,()=>n(o).then(null,()=>{})),o}function s(a){return new pe((o,u)=>{let d=t.length;if(!d)return o(!0);let l=setTimeout(()=>{a&&a>0&&o(!1)},a);t.forEach(p=>{_t(p).then(()=>{--d||(clearTimeout(l),o(!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 Xf=["fatal","error","warning","log","info","debug"];function Jf(e){return e==="warn"?"warning":Xf.includes(e)?e:"log"}var Uc=Pr(),Ti={nowSeconds:()=>Date.now()/1e3};function Qf(){let{performance:e}=Uc;if(!e||!e.now)return;let t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}function eh(){try{return Gf(lu,"perf_hooks").performance}catch{return}}var ci=qf()?eh():Qf(),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,o=typeof a=="number"?Math.abs(a+r-n):t,u=o<t;return s||u?i<=o?e.timeOrigin:a:n})(),Ii="baggage",Zc="sentry-",th=/^sentry-/,rh=8192;function nh(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(th)){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 ih(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 ih(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>rh?((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 sh=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function ah(e){if(!e)return;let t=e.match(sh);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 oh(e,t){let r=ah(e),n=nh(t),{traceId:i,parentSpanId:s,parentSampled:a}=r||{},o={traceId:i||ce(),spanId:ce().substring(16),sampled:a};return s&&(o.parentSpanId=s),n&&(o.dsc=n),{traceparentData:r,dynamicSamplingContext:n,propagationContext:o}}function rs(e=ce(),t=ce().substring(16),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${e}-${t}${n}`}function Ar(e,t=[]){return[e,t]}function ch(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 uh(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[o,u]=a;if(s(`
|
|
6
|
+
${JSON.stringify(o)}
|
|
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:dh(i)}function dh(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 lh(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 fh={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 fh[e]}function $c(e){if(!e||!e.sdk)return;let{name:t,version:r}=e.sdk;return{name:t,version:r}}function hh(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 ph(e,t,r){let n=[{type:"client_report"},{timestamp:Nn(),discarded_events:e}];return Ar(t?{dsn:t}:{},[n])}function mh(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 _h(e,t){return e[t]||e.all||0}function gh(e,t,r=Date.now()){return _h(e,t)>r}function yh(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 o of s.trim().split(",")){let[u,d]=o.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+mh(a,n):t===429&&(i.all=n+60*1e3);return i}var ns="production";function is(){return Rc("globalEventProcessors",()=>[])}function vh(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 o=a(T({},t),r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&o===null&&k.log(`Event processor "${a.id}" dropped event`),Ji(o)?o.then(u=>bn(e,u,r,n+1).then(i)).then(null,s):bn(e,o,r,n+1).then(i).then(null,s)}})}function bh(e){let t=gt(),r={sid:ce(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Eh(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:ce()),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 xh(e,t){let r={};e.status==="ok"&&(r={status:"exited"}),$t(e,r)}function Eh(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 Sh=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:Sh;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?Mf(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function Ha(){return{traceId:ce(),spanId:ce().substring(16)}}var Lc=4,wh=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:ce(),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:ce(),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:ce();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=wh}=n.getOptions&&n.getOptions()||{};if(s<=0)return;let a=Nn(),o=T({timestamp:a},e),u=i?Cc(()=>i(o,t)):o;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&&xh(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=bh(T(T({release:n,environment:i,user:t.getUser()},s&&{userAgent:s}),e)),o=t.getSession&&t.getSession();return o&&o.status==="ok"&&$t(o,{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 Th(e)}function Th(e=Or()){return(!Ih(e)||Ci(e).isOlderThan(Lc))&&Bc(e,new ss),Ci(e)}function Ih(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 jh(){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||ce(),this.spanId=e.spanId||ce().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=Rh(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 Rh(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},Ch="finishReason",Rt=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],Dh=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)}},Nh=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(Ch,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 Dh(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 kh(){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})),Ph(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 Ph(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 Ah(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 o=e.getClient(),u=o&&o.getOptions()||{},d=new Nh(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),o&&o.emit&&o.emit("startTransaction",d),d}function Oh(){let e=Or();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=Ah),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=kh),jh())}function Uh(e,t){return ee().captureException(e,{captureContext:t})}function Zh(e){ee().withScope(e)}var $h="7";function Lh(e){let t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function Bh(e){return`${Lh(e)}${e.projectId}/envelope/`}function Mh(e,t){return xf(T({sentry_key:e.publicKey,sentry_version:$h},t&&{sentry_client:`${t.name}/${t.version}`}))}function Vh(e,t={}){let r=typeof t=="string"?t:t.tunnel,n=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return r||`${Bh(e)}?${Mh(e,n)}`}function zh(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 qh(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 Gh(e,t,r,n){let i=$c(r),s=e.type&&e.type!=="replay_event"?e.type:"event";zh(e,r&&r.sdk);let a=hh(e,i,n,t);return delete e.sdkProcessingMetadata,Ar(a,[[{type:s},e]])}var Ja=[];function Yh(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(vh,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 Fh(e,t,r,n,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,o=V(T({},t),{event_id:t.event_id||r.event_id||ce(),timestamp:t.timestamp||Nn()}),u=r.integrations||e.integrations.map(g=>g.name);Hh(o,e),Xh(o,u),t.type===void 0&&Wh(o,e.stackParser);let d=n;r.captureContext&&(d=At.clone(d).update(r.captureContext));let l=_t(o),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(o,r,p)}else l=bn([...p,...is()],o,r);return l.then(g=>(g&&Kh(g),typeof s=="number"&&s>0?Jh(g,s,a):g))}function Hh(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 o=e.request;o&&o.url&&(o.url=Pt(o.url,s))}var Qa=new WeakMap;function Wh(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,o)=>{let u,d=n.get(o);d?u=d:(u=t(o),n.set(o,u));for(let l=u.length-1;l>=0;l--){let p=u[l];if(p.filename){a[p.filename]=r[o];break}}return a},{});try{e.exception.values.forEach(a=>{a.stacktrace.frames.forEach(o=>{o.filename&&(o.debug_id=s[o.filename])})})}catch{}}function Kh(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 Xh(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Jh(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.",Qh=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=bf(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn("No DSN provided, client will not send events."),this._dsn){let t=Vh(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=Yh(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=Gh(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of t.attachments||[])r=ch(r,lh(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=qh(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 o=a.mechanism;if(o&&o.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),Fh(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:o,spanId:u,parentSpanId:d,dsc:l}=a;s.contexts=T({trace:{trace_id:o,span_id:u,parent_span_id:d}},s.contexts);let p=l||kn(o,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),o=e.type||"error",u=`before send for type \`${o}\``;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=o==="replay_event"?"replay":o;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=tp(n,l,t);return ep(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 ep(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 tp(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 rp=30;function Hc(e,t,r=Kf(e.bufferSize||rp)){let n={},i=a=>r.drain(a);function s(a){let o=[];if(Ya(a,(p,g)=>{let m=Fa(g);if(gh(n,m)){let x=to(p,g);e.recordDroppedEvent("ratelimit_backoff",m,x)}else o.push(p)}),o.length===0)return _t();let u=Ar(a[0],o),d=p=>{Ya(u,(g,m)=>{let x=to(g,m);e.recordDroppedEvent(p,Fa(m),x)})},l=()=>t({body:uh(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=yh(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 np=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ip=[/^.*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=sp(this._options,n);return ap(e,i)?null:e}};cs.__initStatic();function sp(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:np],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:ip],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function ap(e,t){return t.ignoreInternal&&fp(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&k.warn(`Event dropped due to being internal Sentry Error.
|
|
13
|
+
Event: ${We(e)}`),!0):op(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):cp(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):up(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):dp(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 op(e,t){return e.type||!t||!t.length?!1:lp(e).some(r=>kr(r,t))}function cp(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let r=e.transaction;return r?kr(r,t):!1}function up(e,t){if(!t||!t.length)return!1;let r=xn(e);return r?kr(r,t):!1}function dp(e,t){if(!t||!t.length)return!0;let r=xn(e);return r?kr(r,t):!0}function lp(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 fp(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function hp(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?hp(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 pp(){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 pp(),Zh(a=>{a.addEventProcessor(o=>(t.mechanism&&(Si(o,void 0),Tr(o,t.mechanism)),o.extra=V(T({},o.extra),{arguments:i}),o)),Uh(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:yp(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function mp(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:xp(t,{isUnhandledRejection:n})}]},extra:{__serialized__:Oc(t,s)}};if(r){let o=us(e,r);o.length&&(a.exception.values[0].stacktrace={frames:o})}return a}function ui(e,t){return{exception:{values:[Xc(e,t)]}}}function us(e,t){let r=t.stacktrace||t.stack||"",n=gp(t);try{return e(r,n)}catch{}return[]}var _p=/Minified React error #\d+;/i;function gp(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(_p.test(e.message))return 1}return 0}function yp(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function vp(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 bp(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)||rf(t)){let a=t;if("stack"in t)s=ui(e,t);else{let o=a.name||(ka(a)?"DOMError":"DOMException"),u=a.message?`${o}: ${a.message}`:o;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=mp(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 xp(e,{isUnhandledRejection:t}){let r=Ef(e),n=t?"promise rejection":"exception";return Xi(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Cn(e)?`Event \`${Ep(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Ep(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Sp(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=wp(e);return Ar(i,[s])}function wp(e){return[{type:"user_report"},e]}var Tp=class extends Qh{constructor(e){let t=F.SENTRY_SDK_SOURCE||zf();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 vp(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return bp(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=Sp(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=ph(e,this._options.tunnel&&Dn(this._dsn));this._sendEnvelope(t)}},Er;function Ip(){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 jp(){Er=void 0}function Rp(e,t=Ip()){let r=0,n=0;function i(s){let a=s.body.length;r+=a,n++;let o=T({body:s.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15},e.fetchOptions);try{return t(e.url,o).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 jp(),r-=a,n--,ts(u)}}return Hc(e,i)}var Cp=4;function Dp(e){function t(r){return new pe((n,i)=>{let s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===Cp&&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="?",Np=30,kp=40,Pp=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 Ap=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Op=/\((\S*)(?::(\d+))(?::(\d+))\)/,Up=e=>{let t=Ap.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){let i=Op.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)}},Zp=[Np,Up],$p=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Lp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bp=e=>{let t=$p.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=Lp.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)}},Mp=[Pp,Bp],Vp=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,zp=e=>{let t=Vp.exec(e);return t?ls(t[2],t[1]||Pn,+t[3],t[4]?+t[4]:void 0):void 0},qp=[kp,zp],Gp=[Zp,Mp,qp],Yp=Sf(...Gp),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:Fp,onunhandledrejection:Hp}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let t in e){let r=this._installFunc[t];r&&e[t]&&(Xp(t),r(),this._installFunc[t]=void 0)}}};Yt.__initStatic();function Fp(){me("error",e=>{let[t,r,n]=tu();if(!t.getIntegration(Yt))return;let{msg:i,url:s,line:a,column:o,error:u}=e;if(Kc()||u&&u.__sentry_own_request__)return;let d=u===void 0&&Xe(i)?Kp(i,s,a,o):Qc(ds(r,u||i,void 0,n,!1),s,a,o);d.level="error",eu(t,u,d,"onerror")})}function Hp(){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)?Wp(i):ds(r,i,void 0,n,!0);s.level="error",eu(t,i,s,"onunhandledrejection")})}function Wp(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Kp(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",o=s.match(i);return o&&(a=o[1],s=o[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]||{},o=a.stacktrace=a.stacktrace||{},u=o.frames=o.frames||[],d=isNaN(parseInt(n,10))?void 0:n,l=isNaN(parseInt(r,10))?void 0:r,p=Xe(t)&&t.length>0?t:ff();return u.length===0&&u.push({colno:d,filename:p,function:"?",in_app:!0,lineno:l}),e}function Xp(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 Jp=["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&&ie(F,"setTimeout",io),this._options.setInterval&&ie(F,"setInterval",io),this._options.requestAnimationFrame&&ie(F,"requestAnimationFrame",Qp),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&ie(XMLHttpRequest.prototype,"send",em);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:Jp).forEach(tm)}};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 Qp(e){return function(t){return e.apply(this,[Lt(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Je(e)},handled:!1,type:"instrument"}})])}}function em(e){return function(...t){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&ie(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 tm(e){let t=F,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(ie(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])}}),ie(r,"removeEventListener",function(n){return function(i,s,a){let o=s;try{let u=o&&o.__sentry_wrapped__;u&&n.call(this,i,u,a)}catch{}return n.call(this,i,o,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",im),this.options.dom&&me("dom",nm(this.options.dom)),this.options.xhr&&me("xhr",sm),this.options.fetch&&me("fetch",am),this.options.history&&me("history",om),this.options.sentry){let e=ee().getClient();e&&e.on&&e.on("beforeSendEvent",rm)}}};An.__initStatic();function rm(e){ee().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:We(e)},{event:e})}function nm(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=cm(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 im(e){let t={category:"console",data:{arguments:e.args,logger:"console"},level:Jf(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 sm(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:o}=n,u={method:i,url:s,status_code:a},d={xhr:e.xhr,input:o,startTimestamp:t,endTimestamp:r};ee().addBreadcrumb({category:"xhr",data:u,type:"http"},d)}function am(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 om(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 cm(e){return!!e&&!!e.target}var um="cause",dm=5,On=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=On.id,this._key=e.key||um,this._limit=e.limit||dm}setupOnce(){}preprocessEvent(e,t,r){let n=r.getOptions();cf(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(lm(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 lm(e,t){return t?!!(fm(e,t)||hm(e,t)):!1}function fm(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 hm(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 pm(){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)))}},mm=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,_m=()=>{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]||_m()):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:mm(),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)},gm=e=>{let t=ps("CLS",0),r,n=0,i=[],s=o=>{o.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 o=()=>{s(a.takeRecords()),r(!0)};return $n(o),o}},pn=-1,ym=()=>Y.document.visibilityState==="hidden"&&!Y.document.prerendering?0:1/0,vm=()=>{$n(({timeStamp:e})=>{pn=e},!0)},ms=()=>(pn<0&&(pn=ym(),vm()),{get firstHiddenTime(){return pn}}),bm=e=>{let t=ms(),r=ps("FID"),n,i=o=>{o.startTime<t.firstHiddenTime&&(r.value=o.processingStart-o.startTime,r.entries.push(o),n(!0))},s=o=>{o.forEach(i)},a=Zr("first-input",s);n=hs(e,r),a&&$n(()=>{s(a.takeRecords()),a.disconnect()},!0)},oo={},xm=e=>{let t=ms(),r=ps("LCP"),n,i=a=>{let o=a[a.length-1];if(o){let u=Math.max(o.startTime-au(),0);u<t.firstHiddenTime&&(r.value=u,r.entries=[o],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(o=>{addEventListener(o,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=Ql(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 Em(){let e=ou();if(e&&Ne){e.mark&&Y.performance.mark("sentry-tracing-init"),jm();let t=Tm(),r=Im();return()=>{t&&t(),r&&r()}}return()=>{}}function Sm(){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 wm(){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 Tm(){return gm(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 Im(){return xm(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 jm(){bm(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 Rm(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 o=J(a.startTime),u=J(a.duration);if(!(e.op==="navigation"&&r+o<e.startTimestamp))switch(a.entryType){case"navigation":{Dm(e,a,r),i=r+J(a.responseStart),s=r+J(a.requestStart);break}case"mark":case"paint":case"measure":{Cm(e,a,o,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,"");km(e,a,d,o,u,r);break}}}),co=Math.max(n.length-1,0),Pm(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(o=>{if(!X[o]||r>=e.startTimestamp)return;let u=X[o].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 ${o} from ${u} to ${l} (${p})`),X[o].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(o=>{e.setMeasurement(o,X[o].value,X[o].unit)}),Am(e)}Ce=void 0,wr=void 0,X={}}function Cm(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 Dm(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"),Nm(e,t,r)}function on(e,t,r,n,i,s){let a=s?t[s]:t[`${r}End`],o=t[`${r}Start`];!o||!a||Bt(e,{op:"browser",origin:"auto.browser.browser.metrics",description:i||r,startTimestamp:n+J(o),endTimestamp:n+J(a)})}function Nm(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 km(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 o=s+n,u=o+i;Bt(e,{description:r,endTimestamp:u,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:o,data:a})}function Pm(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 Am(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 Om(e){let{traceFetch:t,traceXHR:r,tracePropagationTargets:n,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:a}=T({traceFetch:Ai.traceFetch,traceXHR:Ai.traceXHR},e),o=typeof s=="function"?s:l=>!0,u=l=>Lm(l,n||i),d={};t&&me("fetch",l=>{let p=Bm(l,o,u,d);a&&p&&uo(p)}),r&&me("xhr",l=>{let p=Vm(l,o,u,d);a&&p&&uo(p)})}function Um(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=>{Um(i)&&i.name.endsWith(t)&&($m(i).forEach(s=>e.setData(...s)),r.disconnect())})});r.observe({entryTypes:["resource"]})}function Zm(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 $m(e){let{name:t,version:r}=Zm(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 Lm(e,t){return kr(e,t||Pi)}function Bm(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(),o=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)&&o){let g=e.args[0];e.args[1]=e.args[1]||{};let m=e.args[1];m.headers=Mm(g,o,a,m,p)}return p}function Mm(e,t,r,n,i){let s=i||r.getSpan(),a=s&&s.transaction,{traceId:o,sampled:u,dsc:d}=r.getPropagationContext(),l=s?s.toTraceparent():rs(o,void 0,u),p=a?a.getDynamicSamplingContext():d||kn(o,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 Vm(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 o=ee(),u=o.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=o.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 zm(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 qm="BrowserTracing",Gm=T(V(T({},hn),{markBackgroundTransactions:!0,routingInstrumentation:zm,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{}}),Ai),Ym=class{constructor(e){this.name=qm,this._hasSetTracePropagationTargets=!1,Oh(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options=T(T({},Gm),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=Em(),this.options.enableLongTask&&Sm(),this.options._experiments.enableInteractions&&wm()}setupOnce(e,t){this._getCurrentHub=t;let r=t().getClient(),n=r&&r.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:s,startTransactionOnPageLoad:a,markBackgroundTransactions:o,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),o&&pm(),g.enableInteractions&&this._registerInteractionListener(),Om({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",o=a?fo("sentry-trace"):"",u=a?fo("baggage"):"",{traceparentData:d,dynamicSamplingContext:l,propagationContext:p}=oh(o,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(),Rm(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 o=this._getCurrentHub(),{location:u}=Y,d={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=Xa(o,d,r,n,!0,{location:u},i)};["click"].forEach(r=>{addEventListener(r,t,{once:!1,capture:!0})})}};function fo(e){let t=hf(`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 Fm="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 Tp({dsn:Fm,transport:window.fetch?Rp:Dp,stackParser:Yp,integrations:[new An,new Yt,new On,new Zn,new Un,new Ym]});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 Hm({scriptLocation:e,query:t,loadAsync:r=!0,crossOrigin:n,apihost:i="https://js.hcaptcha.com",cleanup:s=!0,secureApi:a=!1,scriptSource:o=""}={}){let u=Ec(e),d=xc(u);return new Promise((l,p)=>{let g=d.document.createElement("script");g.id=tf,o?g.src=`${o}?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 Wm(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,o)=>Ki(this,null,function*(){try{n.window[ln]=()=>{t.addBreadcrumb({category:Dt,message:"hCaptcha script called onload function"}),a(n.window.hcaptcha)};let u=ef({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 Hm(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),o(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 Wm(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 Km(){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"},Xm=function(e){Kl(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 o=typeof this._hcaptcha<"u";if(this.sentryHub=uu(this.props.sentry,Ct),this.sentryHub.addBreadcrumb({category:Ct.value,message:xr.mounted}),o){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"],o=a.every(function(u){return i[u]===s.props[u]});o||this.removeCaptcha(function(){s.renderCaptcha()})},r.loadCaptcha=function(){if(!this.apiScriptRequested){var i=this.props,s=i.apihost,a=i.assethost,o=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:o,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};Km(Z).then(this.handleOnLoad,this.handleError).catch(this.handleError),this.apiScriptRequested=!0}},r.renderCaptcha=function(i){var s=this,a=this.props.onReady,o=this.state.isApiReady,u=this.captchaId;if(!(!o||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 o=i.props.onLoad;o&&o()})}catch(o){i.sentryHub.captureException(o)}})},r.handleSubmit=function(i){var s=this.props.onVerify,a=this.state.isRemoved,o=this._hcaptcha,u=this.captchaId;if(!(typeof o>"u"||a)){var d=o.getResponse(u),l=o.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,o=this.captchaId;this.isReady()&&a.reset(o),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,o=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(o,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 Jm(){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 Qm({siteKey:e,token:t,onToken:r,prevLabel:n,onPrev:i,nextLabel:s,onNext:a,ref:o,invalid:u,children:d,...l}){const p=S.useRef(null),g=Jm(),[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(Xm,{theme:g,sitekey:e,onLoad:w,onVerify:I,ref:Qe([o,p])})})}function e_({customizationData:{availableUserDomains:e=[],hcaptchaSiteKey:t=void 0,inviteCodeRequired:r=!0,links:n}={},onValidateNewHandle:i,onDone:s,onBack:a,backLabel:o,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(zl,{doneLabel:f.jsx(C,{id:"e+RpCP"}),onBack:a,backLabel:o,onDone:j,steps:[{invalid:!w,titleRender:()=>f.jsx(C,{id:"khEQ02"}),contentRender:({prev:Z,prevLabel:B,next:M,nextLabel:K,invalid:H})=>f.jsx(Wl,{className:"grow",invalid:H,domains:e,handle:w,onHandle:I,prevLabel:B,onPrev:Z,nextLabel:K,onNext:async ue=>{if(w&&await i({handle:w},ue),!ue.aborted)return M(ue)},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(Gl,{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(Qm,{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(ql,{className:"mt-4",links:n})]})}function t_({onSignUp:e,onSignIn:t,onCancel:r,...n}){const{i18n:i,_:s}=q();return f.jsxs(md,{...n,title:n.title??i._({id:"OX6vme"}),children:[e&&f.jsx(ae,{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(ae,{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(ae,{className:"m-1 w-60 min-w-min max-w-full",onClick:r,children:f.jsx(C,{id:"dEgA5A"})})]})}function r_(e,t,r,n){return e==="create"&&t?1:r||!t||n?2:0}function n_({authorizeData:e,initialSessions:t,customizationData:r,...n}){var Ht;const{i18n:i,_:s}=q(),a=e.loginHint!=null,o=!!t.length,u=!!((Ht=r==null?void 0:r.availableUserDomains)!=null&&Ht.length),d=!a&&u,l=r_(e.promptMode,u,a,o),[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:ue,doConsent:z,doReject:ne}=wd({sessions:t,onRedirected:m}),G=!d||j.length?2:0,de=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(t_,{...n,customizationData:r,onSignIn:x,onSignUp:Ft,onCancel:ne});if(p===1)return f.jsx(e_,{...n,customizationData:r,onValidateNewHandle:B,onBack:de,onDone:M});if(p===3)return f.jsx(Ol,{...n,emailDefault:P,onresetPasswordRequest:H,onResetPasswordConfirm:ue,onBack:de});if(p===2)return f.jsx(Ll,{...n,loginHint:e.loginHint,sessions:j,selectSub:Z,onSignIn:K,onSignUp:Ft,onBack:G===2?ne:de,backLabel:G===2?i._({id:"dEgA5A"}):void 0,onForgotPassword:Me=>{w(),A(Me)}});if(p===4)return _e?f.jsx(Sl,{...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:ne,onBack:a?void 0:()=>{Z(null),de()}}):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:i_}=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 s_=document.getElementById("root");var _o;_d.createRoot(s_).render(f.jsx(S.StrictMode,{children:f.jsx(gd,{userLocales:(_o=En.uiLocales)==null?void 0:_o.split(" "),children:f.jsx(vd,{fallbackRender:({error:e})=>f.jsx(yd,{error:e,customizationData:mo}),children:f.jsx(n_,{authorizeData:En,customizationData:mo,initialSessions:i_})})})}))});export default a_();
|
|
20
|
+
//# sourceMappingURL=authorization-page-LIoylbC_.js.map
|