@atproto/oauth-provider-ui 0.1.2 → 0.1.4
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/dist/authorization-page-CsvVyEAt.js +20 -0
- package/dist/authorization-page-CsvVyEAt.js.map +1 -0
- package/dist/bundle-manifest.json +188 -205
- package/dist/error-page-CmUsrswA.js +2 -0
- package/dist/{error-page-DC6Vc-cv.js.map → error-page-CmUsrswA.js.map} +1 -1
- package/dist/{error-view-MVy7C9l0.js → error-view-mc1HYgnS.js} +2 -2
- package/dist/{error-view-MVy7C9l0.js.map → error-view-mc1HYgnS.js.map} +1 -1
- package/dist/messages-B-BSxKZJ.js +2 -0
- package/dist/messages-B-BSxKZJ.js.map +1 -0
- package/dist/messages-BDmYVllj.js +2 -0
- package/dist/messages-BDmYVllj.js.map +1 -0
- package/dist/messages-BFQgw7LA.js +2 -0
- package/dist/messages-BFQgw7LA.js.map +1 -0
- package/dist/messages-BJEnW4wJ.js +2 -0
- package/dist/messages-BJEnW4wJ.js.map +1 -0
- package/dist/messages-BTnl5AEH.js +2 -0
- package/dist/messages-BTnl5AEH.js.map +1 -0
- package/dist/messages-B_4k2G3W.js +2 -0
- package/dist/messages-B_4k2G3W.js.map +1 -0
- package/dist/messages-BfNTGUAV.js +2 -0
- package/dist/messages-BfNTGUAV.js.map +1 -0
- package/dist/messages-Bfdz-lvW.js +2 -0
- package/dist/messages-Bfdz-lvW.js.map +1 -0
- package/dist/messages-Bh2nTXWZ.js +2 -0
- package/dist/messages-Bh2nTXWZ.js.map +1 -0
- package/dist/messages-Bo0tmoEX.js +2 -0
- package/dist/messages-Bo0tmoEX.js.map +1 -0
- package/dist/messages-BoixY0cv.js +2 -0
- package/dist/messages-BoixY0cv.js.map +1 -0
- package/dist/messages-BsegWm9K.js +2 -0
- package/dist/messages-BsegWm9K.js.map +1 -0
- package/dist/messages-Bvult2nb.js +2 -0
- package/dist/messages-Bvult2nb.js.map +1 -0
- package/dist/messages-CEjJubsH.js +2 -0
- package/dist/messages-CEjJubsH.js.map +1 -0
- package/dist/messages-COr97_fy.js +2 -0
- package/dist/messages-COr97_fy.js.map +1 -0
- package/dist/messages-CRV6FqNx.js +2 -0
- package/dist/messages-CRV6FqNx.js.map +1 -0
- package/dist/messages-C_VBwPDV.js +2 -0
- package/dist/messages-C_VBwPDV.js.map +1 -0
- package/dist/messages-Cb5ULWFW.js +2 -0
- package/dist/messages-Cb5ULWFW.js.map +1 -0
- package/dist/messages-CgI91Ufv.js +2 -0
- package/dist/messages-CgI91Ufv.js.map +1 -0
- package/dist/messages-Cq6uHpCh.js +2 -0
- package/dist/messages-Cq6uHpCh.js.map +1 -0
- package/dist/messages-CwGqQHJc.js +2 -0
- package/dist/messages-CwGqQHJc.js.map +1 -0
- package/dist/messages-CzS7QSMV.js +2 -0
- package/dist/messages-CzS7QSMV.js.map +1 -0
- package/dist/messages-D2_xyQ6d.js +2 -0
- package/dist/messages-D2_xyQ6d.js.map +1 -0
- package/dist/messages-D713Few2.js +2 -0
- package/dist/messages-D713Few2.js.map +1 -0
- package/dist/messages-DBfFAz1q.js +2 -0
- package/dist/messages-DBfFAz1q.js.map +1 -0
- package/dist/messages-DLj6lLDW.js +2 -0
- package/dist/messages-DLj6lLDW.js.map +1 -0
- package/dist/messages-DP46detH.js +2 -0
- package/dist/messages-DP46detH.js.map +1 -0
- package/dist/messages-DlviWTt6.js +2 -0
- package/dist/messages-DlviWTt6.js.map +1 -0
- package/dist/messages-DnpSRZ-f.js +2 -0
- package/dist/messages-DnpSRZ-f.js.map +1 -0
- package/dist/messages-DoylmAN4.js +2 -0
- package/dist/messages-DoylmAN4.js.map +1 -0
- package/dist/messages-G4Nc4Vug.js +2 -0
- package/dist/messages-G4Nc4Vug.js.map +1 -0
- package/dist/messages-_9TzErDw.js +2 -0
- package/dist/messages-_9TzErDw.js.map +1 -0
- package/dist/messages-_aBinmbs.js +2 -0
- package/dist/messages-_aBinmbs.js.map +1 -0
- package/dist/messages-b3VjHdIT.js +2 -0
- package/dist/messages-b3VjHdIT.js.map +1 -0
- package/dist/messages-mFfeKoXu.js +2 -0
- package/dist/messages-mFfeKoXu.js.map +1 -0
- package/package.json +4 -4
- package/dist/authorization-page-Dhx8lvtZ.js +0 -3
- package/dist/authorization-page-Dhx8lvtZ.js.map +0 -1
- package/dist/error-page-DC6Vc-cv.js +0 -2
- package/dist/index-CHPoD7Rp.js +0 -20
- package/dist/index-CHPoD7Rp.js.map +0 -1
- package/dist/messages-B0mgsxS-.js +0 -2
- package/dist/messages-B0mgsxS-.js.map +0 -1
- package/dist/messages-B5g8Fkio.js +0 -2
- package/dist/messages-B5g8Fkio.js.map +0 -1
- package/dist/messages-BCMss-Kt.js +0 -2
- package/dist/messages-BCMss-Kt.js.map +0 -1
- package/dist/messages-BGUrKgyK.js +0 -2
- package/dist/messages-BGUrKgyK.js.map +0 -1
- package/dist/messages-BjxAnLDp.js +0 -2
- package/dist/messages-BjxAnLDp.js.map +0 -1
- package/dist/messages-Bjysz3rI.js +0 -2
- package/dist/messages-Bjysz3rI.js.map +0 -1
- package/dist/messages-BvvEr3UX.js +0 -2
- package/dist/messages-BvvEr3UX.js.map +0 -1
- package/dist/messages-Bz6JOhJf.js +0 -2
- package/dist/messages-Bz6JOhJf.js.map +0 -1
- package/dist/messages-BzL3D1EU.js +0 -2
- package/dist/messages-BzL3D1EU.js.map +0 -1
- package/dist/messages-CAvN5UoW.js +0 -2
- package/dist/messages-CAvN5UoW.js.map +0 -1
- package/dist/messages-CEmswT1Q.js +0 -2
- package/dist/messages-CEmswT1Q.js.map +0 -1
- package/dist/messages-CHYqz0q6.js +0 -2
- package/dist/messages-CHYqz0q6.js.map +0 -1
- package/dist/messages-CRmpdijj.js +0 -2
- package/dist/messages-CRmpdijj.js.map +0 -1
- package/dist/messages-Cdb79R6S.js +0 -2
- package/dist/messages-Cdb79R6S.js.map +0 -1
- package/dist/messages-ChkJ_0WT.js +0 -2
- package/dist/messages-ChkJ_0WT.js.map +0 -1
- package/dist/messages-CqiEX6JJ.js +0 -2
- package/dist/messages-CqiEX6JJ.js.map +0 -1
- package/dist/messages-CxkHjJSR.js +0 -2
- package/dist/messages-CxkHjJSR.js.map +0 -1
- package/dist/messages-D0-cWoJ9.js +0 -2
- package/dist/messages-D0-cWoJ9.js.map +0 -1
- package/dist/messages-D2MnAxYY.js +0 -2
- package/dist/messages-D2MnAxYY.js.map +0 -1
- package/dist/messages-D5TZVsui.js +0 -2
- package/dist/messages-D5TZVsui.js.map +0 -1
- package/dist/messages-DBdV4-iw.js +0 -2
- package/dist/messages-DBdV4-iw.js.map +0 -1
- package/dist/messages-DEK3zybC.js +0 -2
- package/dist/messages-DEK3zybC.js.map +0 -1
- package/dist/messages-DGSM5jkd.js +0 -2
- package/dist/messages-DGSM5jkd.js.map +0 -1
- package/dist/messages-DJgAnSTQ.js +0 -2
- package/dist/messages-DJgAnSTQ.js.map +0 -1
- package/dist/messages-DK7O7sb_.js +0 -2
- package/dist/messages-DK7O7sb_.js.map +0 -1
- package/dist/messages-DRp7qc3j.js +0 -2
- package/dist/messages-DRp7qc3j.js.map +0 -1
- package/dist/messages-DT6xRw0m.js +0 -2
- package/dist/messages-DT6xRw0m.js.map +0 -1
- package/dist/messages-LnzLtU0L.js +0 -2
- package/dist/messages-LnzLtU0L.js.map +0 -1
- package/dist/messages-_Nk2qNGw.js +0 -2
- package/dist/messages-_Nk2qNGw.js.map +0 -1
- package/dist/messages-eHH6nZyF.js +0 -2
- package/dist/messages-eHH6nZyF.js.map +0 -1
- package/dist/messages-iNw8zY2C.js +0 -2
- package/dist/messages-iNw8zY2C.js.map +0 -1
- package/dist/messages-ipc0L8yF.js +0 -2
- package/dist/messages-ipc0L8yF.js.map +0 -1
- package/dist/messages-j7LsWm2F.js +0 -2
- package/dist/messages-j7LsWm2F.js.map +0 -1
- package/dist/messages-mgE_5UEw.js +0 -2
- package/dist/messages-mgE_5UEw.js.map +0 -1
- package/dist/messages-oRd-J5--.js +0 -2
- package/dist/messages-oRd-J5--.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var Ri=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);import{r as m,j as c,c as A,L as ji,A as Ni,u as O,U as ki,T as x,M as Ci,a as St,E as Di,b as Ii,d as Ui,e as Bi,f as br,g as Tt,h as wt,S as Oi,I as $i,i as Yi,C as Un,k as Bn,l as Gi,X as Li,m as Pi,n as Ai,o as Mi,p as Hi}from"./error-view-mc1HYgnS.js";var Gl=Ri((Al,wi)=>{const Sr=m.createContext(null),Yt={didCatch:!1,error:null};class qi extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Yt}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(Yt)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&Fi(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(Yt)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:s,error:a}=this.state;let o=t;if(s){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(l);else if(r)o=m.createElement(r,l);else if(i!==void 0)o=i;else throw a}return m.createElement(Sr.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}function Fi(){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((n,r)=>!Object.is(n,t[r]))}function Vi(e){if(e==null||typeof e.didCatch!="boolean"||typeof e.resetErrorBoundary!="function")throw new Error("ErrorBoundaryContext not found")}function zi(){const e=m.useContext(Sr);Vi(e);const[t,n]=m.useState({error:null,hasError:!1}),r=m.useMemo(()=>({resetBoundary:()=>{e.resetErrorBoundary(),n({error:null,hasError:!1})},showBoundary:i=>n({error:i,hasError:!0})}),[e.resetErrorBoundary]);if(t.hasError)throw t.error;return r}function X({children:e,title:t,subtitle:n,className:r,...i}){return c.jsxs("div",{...i,className:A(r,"flex flex-col items-center","md:flex md:flex-row md:items-center md:justify-stretch","min-w-screen min-h-screen","bg-white text-slate-900","dark:bg-slate-900 dark:text-slate-100"),children:[t&&c.jsx("title",{children:t}),c.jsxs("div",{className:A("px-6 pt-4","w-full","md:max-w-lg","flex flex-row items-start","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:[c.jsxs("div",{className:"grid grow content-center md:justify-items-end",children:[t&&c.jsx("h1",{className:"text-primary text-xl font-semibold md:my-4 md:text-2xl lg:text-5xl",children:t},"title"),n&&c.jsx("p",{className:"hidden max-w-xs text-slate-600 md:block dark:text-slate-400",children:n},"subtitle")]}),c.jsx(ji,{className:"m-1 md:m-2"},"localeSelector")]}),c.jsx("main",{className:"w-full p-6 md:max-w-3xl md:px-12",children:e})]})}function Wi(e,t,n){if(!e)return[t];const r=e.findIndex(n);return r===-1?[...e,t]:[...e.slice(0,r),t,...e.slice(r+1)]}function _e(e,t){const{showBoundary:n}=zi();return m.useCallback(async(...r)=>{try{return await e(...r)}catch(i){throw i instanceof ki&&n(i),i}},t.concat(n))}function Xi({sessions:e=[],onRedirected:t}){const[n]=m.useState(()=>new Ni),[r,i]=m.useState(e),{i18n:s,_:a}=O(),{locale:o}=s,l=m.useCallback(b=>{i(S=>{var T;return b===(((T=S.find(R=>R.selected))==null?void 0:T.account.sub)||null)?S:S.map(R=>({...R,selected:R.account.sub===b}))})},[i]),d=m.useCallback(({account:b,ephemeralToken:S,consentRequired:T=!0,selected:R=!0,loginRequired:k=!1})=>{const D={account:b,ephemeralToken:S,selected:R,loginRequired:k,consentRequired:T};i(q=>Wi(q,D,P=>P.account.sub===b.sub).map(P=>!R||P===D||!P.selected?P:{...P,selected:!1}))},[i]),u=m.useCallback(b=>{window.location.href=String(b),t&&setTimeout(t)},[t]),h=_e(async(b,S)=>{const T=await n.fetch("POST","/sign-in",{...b,locale:o},{signal:S});d(T)},[n,o,d]),p=_e(async(b,S)=>{await n.fetch("POST","/reset-password-request",{...b,locale:o},{signal:S})},[n,o]),_=_e(async(b,S)=>{await n.fetch("POST","/reset-password-confirm",b,{signal:S})},[n]),g=_e(async(b,S)=>{await n.fetch("POST","/verify-handle-availability",b,{signal:S})},[n]),E=_e(async(b,S)=>{const T=await n.fetch("POST","/sign-up",{...b,locale:o},{signal:S});d(T)},[n,o,d]),v=_e(async b=>{var R;const S=(R=r.find(k=>k.account.sub===b))==null?void 0:R.ephemeralToken,{url:T}=await n.fetch("POST","/accept",{sub:b},{bearer:S});u(T)},[n,r,u]),w=_e(async()=>{const{url:b}=await n.fetch("POST","/reject",{});u(b)},[n,u]);return{sessions:r,selectSub:l,doSignIn:h,doInitiatePasswordReset:p,doConfirmResetPassword:_,doValidateNewHandle:g,doSignUp:E,doAccept:v,doReject:w}}function Ee(e,t){return m.useCallback(()=>e(t),[e,t])}function F({color:e="grey",transparent:t=!1,loading:n=void 0,square:r=!1,children:i,className:s,type:a="button",role:o="Button",disabled:l=!1,...d}){return c.jsx("button",{role:o,type:a,disabled:l||n===!0,...d,className:A("cursor-pointer touch-manipulation overflow-hidden truncate rounded-md tracking-wide",r?"p-2":"px-6 py-2",e==="primary"?A("accent-slate-100",t?"text-primary bg-transparent":"bg-primary text-primary-contrast"):e==="grey"?A("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 hn({actions:e,cancel:t,append:n,children:r,prepend:i,disabled:s,inert:a=s,...o}){return c.jsxs("form",{...o,inert:a,className:"flex flex-col space-y-4",children:[i&&c.jsx("div",{children:i},"prepend"),c.jsx("div",{className:"space-y-4",children:r},"children"),n&&c.jsx("div",{children:n},"append"),(e||t)&&c.jsxs("div",{className:"flex flex-row-reverse flex-wrap items-center justify-end space-x-2 space-x-reverse",children:[e,c.jsx("div",{className:"flex-auto"}),t]},"buttons")]})}function Ki({account:e,...t}){return c.jsx("b",{...t,children:e.preferred_username||e.email||e.sub})}const Ji=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 Zi({url:e,proto:t=!1,host:n=!0,path:r=!1,query:i=!1,hash:s=!1,as:a="span",...o}){const l=m.useMemo(()=>e instanceof URL?e:new URL(e),[e]);return c.jsxs(a,{...o,children:[t&&c.jsx(Ye,{value:`${l.protocol}//`,...t===!0?null:t}),n&&c.jsx(Ye,{value:l.host,...n===!0?{faded:!1,bold:!0}:n}),r&&c.jsx(Ye,{value:l.pathname,...r===!0?null:r}),i&&c.jsx(Ye,{value:l.search,...i===!0?null:i}),s&&c.jsx(Ye,{value:l.hash,...s===!0?null:s})]})}function Ye({value:e,faded:t=!0,bold:n=!1}){const r=n?"b":"span";return c.jsx(r,{className:t?"opacity-50":"",children:e})}function Qi({clientId:e,clientMetadata:t,clientTrusted:n,...r}){const i=m.useMemo(()=>{try{return new URL(e)}catch{return null}},[e]);if(n&&t.client_name)return c.jsx("span",{...r,children:t.client_name});if((i==null?void 0:i.protocol)==="http:")return c.jsx("span",{...r,children:c.jsx(x,{id:"eYNzrj"})});if((i==null?void 0:i.protocol)==="https:"){const s=Ji(e);return c.jsx(Zi,{...r,url:i,proto:!s,host:!0,path:!s,query:!s,hash:!1})}return c.jsx("span",{...r,children:e})}function es({clientId:e,clientMetadata:t,clientTrusted:n,account:r,scopeDetails:i,onAccept:s,onReject:a,onBack:o,...l}){const{i18n:d,_:u}=O();return c.jsxs(hn,{...l,onSubmit:h=>{h.preventDefault(),s()},cancel:o&&c.jsx(F,{onClick:o,children:"Back"}),actions:c.jsxs(c.Fragment,{children:[c.jsx(F,{type:"submit",color:"primary",children:c.jsx(x,{id:"yIVrHZ"})}),c.jsx(F,{onClick:a,children:c.jsx(x,{id:"54JiGG"})})]}),children:[n&&t.logo_uri&&c.jsx("div",{className:"flex items-center justify-center",children:c.jsx("img",{src:t.logo_uri,alt:t.client_name,className:"h-16 w-16 rounded-full"})},"logo"),c.jsx("p",{children:c.jsx(x,{id:"BVbdlE",components:{0:c.jsx(Qi,{clientId:e,clientMetadata:t,clientTrusted:n}),1:c.jsx(Ki,{account:r})}})}),c.jsx("p",{children:c.jsx(x,{id:"/aj5l4",components:{0:c.jsx("b",{}),1:c.jsx("a",{role:"link",href:t.tos_uri,rel:"nofollow noopener",target:"_blank",className:"text-primary underline"}),2:c.jsx("a",{role:"link",href:t.policy_uri,rel:"nofollow noopener",target:"_blank",className:"text-primary underline"})}})}),i!=null&&i.length?c.jsx("ul",{className:"list-inside list-disc","aria-label":d._({id:"c7cY3z"}),children:i.map(({scope:h,description:p})=>c.jsx("li",{children:p?c.jsx(Ci,{value:p}):c.jsx(ts,{scope:h})},h))},"scopes"):null]})}function ts({scope:e}){switch(e){case"atproto":return c.jsx(x,{id:"BWM1dL"});case"transition:generic":return c.jsx(x,{id:"myiH7A"});case"transition:chat.bsky":return c.jsx(x,{id:"kJrqQq"});default:return e}}function ns({clientId:e,clientMetadata:t,clientTrusted:n,account:r,scopeDetails:i,onAccept:s,onReject:a,onBack:o,title:l,subtitle:d=c.jsx(x,{id:"QdVx1C",values:{0:r.preferred_username||r.email||r.sub},components:{0:c.jsx("b",{className:"text-slate-800 dark:text-slate-200"})}}),...u}){const{i18n:h,_:p}=O();return c.jsx(X,{...u,title:l??h._({id:"yIVrHZ"}),subtitle:d,children:c.jsx(es,{clientId:e,clientMetadata:t,clientTrusted:n,account:r,scopeDetails:i,onBack:o,onAccept:s,onReject:a})})}const Rt=m.createContext({disabled:!1});Rt.displayName="FieldsetContext";function ae({label:e,children:t,disabled:n,...r}){const i=St({prefix:"fieldset-"}),s=m.useMemo(()=>({disabled:n??!1,labelId:e?i:void 0}),[n,e,i]);return c.jsxs("fieldset",{...r,"aria-labelledby":i,disabled:n,children:[e&&c.jsx("legend",{id:i,className:"mb-1 text-sm font-medium text-slate-600 dark:text-slate-400",children:e},"title"),c.jsx("div",{className:"flex flex-col space-y-4",children:c.jsx(Rt,{value:s,children:t})})]})}function rs(e,{ref:t,onLoading:n,onError:r}={}){const[i,s]=m.useState(!1),[a,o]=m.useState(),l=m.useCallback(_=>{o(_),r==null||r(_)},[r]),d=m.useCallback(_=>{s(_),n==null||n(_)},[n]),u=m.useRef(null),h=m.useRef(null);m.useEffect(()=>(h.current=()=>{var _;(_=u.current)==null||_.abort(),u.current=null,l(void 0),d(!1)},()=>{h.current=null}),[l,d]),m.useImperativeHandle(t,()=>({reset:()=>{var _;return(_=h.current)==null?void 0:_.call(h)}}),[]),m.useEffect(()=>()=>{var _;(_=u.current)==null||_.abort(),u.current=null},[]);const p=m.useCallback(async()=>{var E;(E=u.current)==null||E.abort(),d(!0),l(void 0);const _=new AbortController,{signal:g}=_;u.current=_;try{await e(g)}catch(v){_===u.current?l(v instanceof Error?v:new Error(String(v))):is(g,v)||console.warn("Async action error after abort",v)}finally{_===u.current&&(u.current=null,d(!1)),_.abort()}},[e,d,l]);return{loading:i,error:a,run:p}}function is(e,t){return e.aborted&&(e.reason===t||e.reason===(t==null?void 0:t.cause)||t instanceof DOMException&&t.name==="AbortError")}const ss=({error:e})=>c.jsx(Di,{error:e});function Ue({invalid:e,disabled:t,onSubmit:n,submitLabel:r,onCancel:i=void 0,cancelLabel:s,errorRender:a=ss,ref:o,onLoading:l,onError:d,children:u,...h}){const{run:p,loading:_,error:g}=rs(n,{ref:o,onError:d,onLoading:l}),E=m.useCallback(v=>{v.preventDefault(),v.currentTarget.reportValidity()&&!t&&!e&&p()},[t,e,p]);return c.jsx(hn,{...h,onSubmit:E,disabled:t||_,prepend:g!=null?a({error:g}):void 0,cancel:i&&c.jsx(F,{onClick:i,children:s||c.jsx(x,{id:"dEgA5A"})}),actions:c.jsx(F,{color:"primary",type:"submit",loading:_,disabled:t,children:r||c.jsx(x,{id:"hQRttt"})}),children:u})}const re=8,as=/(\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/,Je=/[A-Z]/,Ze=/[a-z]/,Qe=/[0-9]/,et=/[^a-zA-Z0-9]/;var ye=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 Tr(e){return e.length<re?1:e.length>=re+12?4:e.length>=re+8?ne(e,[et])||ne(e,[Je,Ze,Qe],2)?4:3:e.length>=re&&ne(e,[as])?3:e.length>=re+6?ne(e,[et])||ne(e,[Je,Ze,Qe],2)?3:2:e.length>=re+4?ne(e,[et])||ne(e,[Je,Ze,Qe],2)?2:1:e.length>=re&&(ne(e,[et])||ne(e,[Je,Ze,Qe]))?2:1}function ne(e,t,n=t.length){if(n<1||n>t.length)throw new TypeError("Invalid regexpsCountToMatch");for(const r of t)if(r.test(e)&&(n--,n===0))return!0;return!1}function os({password:e,...t}){const{i18n:n,_:r}=O(),i=Tr(e);return c.jsx("span",{...t,"aria-label":n._({id:"osAB4a"}),children:i===ye.extra?c.jsx(x,{id:"/Ltc/k"}):i===ye.strong?c.jsx(x,{id:"LLx/nr"}):i===ye.moderate?c.jsx(x,{id:"dvYuhh"}):e?c.jsx(x,{id:"9ls/Vs"}):c.jsx(x,{id:"VU3Nrn"})})}function cs({password:e,className:t,...n}){const{i18n:r,_:i}=O(),s=e?Tr(e):0,a="bg-gray-300 dark:bg-slate-500",o=s===ye.extra||s===ye.strong?"bg-success":s===ye.moderate?"bg-warning":"bg-error";return c.jsx("div",{...n,className:A("flex h-1 w-full space-x-2",t),role:"meter","aria-label":r._({id:"xfNKwI"}),"aria-valuemin":0,"aria-valuemax":ye.extra,"aria-valuenow":s,children:Array.from({length:4},(l,d)=>c.jsx("div",{className:`h-1 w-1/4 rounded-sm ${s>d?o:a}`},d))})}function ls(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function fe(e){return t=>{for(const n of e)n&&ls(n,t)}}function us({visible:e,toggleVisible:t,onClick:n,...r}){const{i18n:i,_:s}=O();return c.jsx(F,{...r,square:!0,onClick:a=>{n==null||n(a),a.defaultPrevented||t()},"aria-label":e?i._({id:"vLyv1R"}):i._({id:"huXYDE"}),children:e?c.jsx(Ii,{className:"w-5","aria-hidden":!0}):c.jsx(Ui,{className:"w-5","aria-hidden":!0})})}function gt({icon:e,append:t,bellow:n,className:r,children:i,onFocus:s,onBlur:a,...o}){const[l,d]=m.useState(!1);return c.jsxs("div",{...o,onFocus:u=>{s==null||s(u),u.defaultPrevented||d(!0)},onBlur:u=>{a==null||a(u),u.defaultPrevented||d(!1)},className:A("min-h-12","max-w-full","overflow-hidden","rounded-lg",r),children:[c.jsxs("div",{className:A("px-1","min-h-12 w-full","flex items-center justify-stretch","rounded-lg",n?"rounded-bl-none rounded-br-none":void 0,"outline-hidden","border-2 border-solid border-transparent","focus:border-primary has-focus:border-primary","hover:border-gray-400 hover:focus:border-gray-400","dark:hover:border-gray-500 dark:hover:focus:border-gray-500","has-focus:bg-slate-200 bg-gray-100 focus:bg-slate-200","dark:has-focus:bg-slate-700 dark:bg-slate-800 dark:focus:bg-slate-700","text-slate-600 dark:text-slate-300","accent-primary"),children:[e&&c.jsx("div",{className:A("shrink-0 grow-0","mx-1",l?"text-primary":"text-slate-500"),children:e}),i,c.jsx("div",{className:"ml-1 flex shrink-0 grow-0 items-center",children:t})]}),n&&c.jsx("div",{className:A("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:n})]})}function Be({icon:e,append:t,bellow:n,className:r,onFocus:i,onBlur:s,ref:a,disabled:o,title:l,"aria-label":d=l,"aria-labelledby":u,placeholder:h=d,...p}){const _=m.useContext(Rt),g=m.useRef(null),E=m.useRef(!1);return c.jsx(gt,{icon:e,append:t,bellow:n,className:A("cursor-text",r),tabIndex:-1,onClick:v=>{var w;g.current!==v.target&&(v.preventDefault(),v.stopPropagation(),(w=g.current)==null||w.focus())},onMouseDown:v=>{E.current&&v.target!==g.current&&(v.preventDefault(),v.stopPropagation())},children:c.jsx("input",{...p,disabled:o??_.disabled,title:l,placeholder:h,"aria-label":d,"aria-labelledby":u??_.labelId,ref:fe([a,g]),className:"outline-hidden w-full text-ellipsis bg-transparent bg-clip-padding text-base text-inherit dark:placeholder-gray-500",onFocus:v=>{i==null||i(v),v.defaultPrevented||(E.current=!0)},onBlur:v=>{s==null||s(v),v.defaultPrevented||(E.current=!1)}})})}function wr({autoHide:e=!0,onBlur:t,onChange:n,append:r,autoComplete:i="current-password",icon:s=c.jsx(Bi,{className:"w-5"}),value:a,defaultValue:o=a,ref:l,title:d,dir:u="auto",autoCapitalize:h="none",autoCorrect:p="off",spellCheck:_="false",...g}){const{i18n:E,_:v}=O(),w=m.useRef(null),[b,S]=m.useState(!1),[T,R]=m.useState(typeof o=="string"?o:""),k=m.useCallback(D=>{n==null||n(D),R(D.target.value)},[n]);return c.jsx(Be,{...g,title:d??E._({id:"8ZsakT"}),ref:fe([l,w]),dir:u,autoCapitalize:h,autoCorrect:p,spellCheck:_,icon:s,onBlur:e?D=>{t==null||t(D),D.defaultPrevented||S(!1)}:t,value:T,onChange:k,type:b?"text":"password",autoComplete:i,append:c.jsxs(c.Fragment,{children:[c.jsx(us,{className:"m-1",visible:b,toggleVisible:()=>{var D;S(q=>!q),(D=w.current)==null||D.focus()}}),r]})})}function Rr({password:e="",onPassword:t,onChange:n,autoComplete:r="new-password",minLength:i=re,...s}){const{i18n:a,_:o}=O(),[l,d]=m.useState(e),u=m.useCallback(h=>{const{value:p}=h.target;n==null||n(h),!h.defaultPrevented&&(d(p),t==null||t(h.target.validity.valid?p:void 0))},[n,t]);return c.jsx(wr,{...s,placeholder:a._({id:"3tOlz6"}),"aria-label":a._({id:"0StR7t"}),title:a._({id:"5CqSPX",values:{MIN_PASSWORD_LENGTH:re}}),minLength:i,onChange:u,value:l,autoComplete:r,bellow:c.jsxs(c.Fragment,{children:[c.jsx(cs,{password:l}),c.jsx(os,{className:"grow-1 min-w-max text-xs text-gray-500 dark:text-gray-400",password:l})]})})}const ds="XXXXX-XXXXX";function jr({example:e=ds,onToken:t,icon:n=c.jsx(br,{className:"w-5"}),title:r=e,onChange:i,value:s,defaultValue:a=s,...o}){const{i18n:l,_:d}=O(),[u,h]=m.useState(typeof a=="string"?a:"");return c.jsx(Be,{...o,type:"text",autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",spellCheck:"false",minLength:11,maxLength:11,dir:"auto",icon:n,pattern:"^[A-Z2-7]{5}-[A-Z2-7]{5}$",placeholder:l._({id:"0hTJM+",values:{example:e}}),title:r,value:u,onChange:p=>{const{value:_,selectionEnd:g,selectionStart:E}=p.currentTarget,v=On(_);p.currentTarget.value=v;const w=g??E;if(w!=null){const b=On(_.slice(0,w));p.currentTarget.selectionStart=p.currentTarget.selectionEnd=b.length}h(v),i==null||i(p),p.isDefaultPrevented()||t==null||t(v.length===11?v:null)}})}function On(e){const t=e.toUpperCase().replaceAll(/[^A-Z2-7]/g,"");return t.length<=5?t:`${t.slice(0,5)}-${t.slice(5,10)}`}function hs({onSubmit:e,invalid:t,...n}){const r=St({prefix:"reset-pwd-email-"}),i=m.useRef(null),[s,a]=m.useState(null),[o,l]=m.useState(void 0);return c.jsxs(Ue,{...n,onSubmit:d=>{if(s&&o)return e({token:s,password:o},d)},invalid:t||!s||!o,children:[c.jsx(Tt,{role:"info",children:c.jsx("p",{id:r,className:"text-md",children:c.jsx(x,{id:"imRJNy"})})}),c.jsx(ae,{label:c.jsx(x,{id:"vJgYMA"}),children:c.jsx(jr,{name:"code","aria-labelledby":r,enterKeyHint:"next",required:!0,autoFocus:!0,onToken:d=>{var u;a(d),d&&((u=i.current)==null||u.focus())}})}),c.jsx(ae,{label:c.jsx(x,{id:"/nT6AE"}),children:c.jsx(Rr,{ref:i,name:"password",enterKeyHint:"done",required:!0,password:o,onPassword:l})})]})}function Nr({onEmail:e,autoCapitalize:t="none",autoComplete:n="email",autoCorrect:r="off",dir:i="auto",icon:s=c.jsx(wt,{className:"w-5"}),onBlur:a,onChange:o,pattern:l="^[^@]+@[^@]+\\.[^@]+$",spellCheck:d="false",value:u,defaultValue:h=u,title:p,..._}){const{i18n:g,_:E}=O(),[v,w]=m.useState(typeof h=="string"?h:""),b=m.useCallback(S=>{const T=S.target.value.toLowerCase();w(T),o==null||o(S),e==null||e(S.target.validity.valid?T:void 0)},[o,e]);return c.jsx(Be,{..._,title:p??g._({id:"ATGYL1"}),type:"email",autoCapitalize:t,autoCorrect:r,dir:i,spellCheck:d,icon:s,pattern:l,autoComplete:n,value:v,onChange:b,onBlur:a})}function ps({emailDefault:e,onSubmit:t,invalid:n,ref:r,...i}){const{i18n:s,_:a}=O(),o=St({prefix:"reset-pwd-email-"}),[l,d]=m.useState(e),u=m.useRef(null),h=m.useCallback(p=>{if(l)return t({email:l},p)},[l,t]);return c.jsx(Ue,{...i,ref:fe([r,u]),invalid:n||!l,onSubmit:h,children:c.jsxs(ae,{label:c.jsx(x,{id:"ATGYL1"}),children:[c.jsx(Nr,{name:"email",placeholder:s._({id:"xRPn3U"}),"aria-labelledby":o,title:s._({id:"ATGYL1"}),required:!0,autoFocus:!0,value:l,onEmail:p=>{var _;(_=u.current)==null||_.reset(),d(p)}}),c.jsx(Tt,{role:"info",children:c.jsx("p",{id:o,className:"",children:c.jsx(x,{id:"cHrOqs"})})})]})})}function fs({emailDefault:e,onresetPasswordRequest:t,onResetPasswordConfirm:n,onBack:r,...i}){const{i18n:s,_:a}=O(),[o,l]=m.useState(0);if(o===0)return c.jsxs(X,{...i,title:i.title||s._({id:"dn8X5t"}),subtitle:i.subtitle||c.jsx(x,{id:"Esfg1M"}),children:[c.jsx(ps,{emailDefault:e,submitLabel:c.jsx(x,{id:"hXzOVo"}),onSubmit:async(d,u)=>{await t(d,u),u.aborted||l(1)},cancelLabel:c.jsx(x,{id:"iH8pgl"}),onCancel:r}),c.jsx("hr",{className:"my-5 border-gray-300 dark:border-gray-700"}),c.jsx("center",{children:c.jsx(F,{transparent:!0,onClick:()=>l(1),children:c.jsx(x,{id:"FTT4a4"})})})]});if(o===1)return c.jsx(X,{...i,title:i.title||s._({id:"KbS2K9"}),subtitle:i.subtitle||c.jsx(x,{id:"xg/UcZ"}),children:c.jsx(hs,{submitLabel:c.jsx(x,{id:"hXzOVo"}),onSubmit:async(d,u)=>{await n(d,u),u.aborted||l(2)},cancelLabel:c.jsx(x,{id:"iH8pgl"}),onCancel:r})});if(o===2)return c.jsx(X,{...i,title:i.title||s._({id:"fSy6T1"}),subtitle:i.subtitle||c.jsx(x,{id:"+qGdcW"}),children:c.jsxs("center",{children:[c.jsx("h2",{className:"pb-2 text-xl font-bold",children:c.jsx(x,{id:"DKeVgZ"})}),c.jsx("p",{className:"pb-4",children:c.jsx(x,{id:"67nRLM"})}),c.jsx(F,{color:"primary",onClick:r,children:c.jsx(x,{id:"UaXeX3"})})]})});throw new Error(`Invalid view: ${o}`)}function _s({className:e,children:t,id:n,ref:r,disabled:i,title:s,"aria-label":a=s,"aria-labelledby":o,...l}){const d=St("input-checkbox-"),u=m.useRef(null),h=m.useRef(null),p=m.useContext(Rt),_=n??d;return c.jsx(gt,{className:A("cursor-pointer",e),icon:c.jsx("input",{...l,disabled:i??p.disabled,title:s,"aria-label":a,"aria-labelledby":t?void 0:o??p.labelId,ref:fe([r,h]),id:_,className:"accent-primary outline-hidden",type:"checkbox"}),tabIndex:-1,onClick:({target:g})=>{var E;g!==u.current&&g!==h.current&&((E=h.current)==null||E.click())},children:t&&c.jsx("label",{ref:u,htmlFor:_,className:"block w-full cursor-pointer select-none leading-[1.6]",children:t})})}function tt({usernameDefault:e="",usernameReadonly:t=!1,rememberDefault:n=!1,onSubmit:r,onBack:i,onForgotPassword:s,ref:a,invalid:o,children:l,...d}){const{i18n:u,_:h}=O(),[p,_]=m.useState(e),[g,E]=m.useState(""),[v,w]=m.useState(n),[b,S]=m.useState(null),[T,R]=m.useState(null),[k,D]=m.useState(!1),q=m.useRef(null),P=m.useCallback(()=>{S(null),R(null)},[S,R]),ce=m.useCallback(()=>{var U;P(),(U=q.current)==null||U.reset()},[P,q]),j=m.useCallback(async U=>{try{await r({username:p,password:g,remember:v,...T?{[T.type]:b}:{}},U)}catch(te){if(U.aborted)return;if(te instanceof Oi){R(te);return}throw te instanceof $i&&P(),te}},[p,g,v,T,b,r]);return c.jsxs(Ue,{...d,ref:fe([a,q]),onLoading:D,onCancel:i,cancelLabel:u._({id:"iH8pgl"}),append:l,invalid:o||!p||!g||T!=null&&!b,submitLabel:T?u._({id:"7VpPHA"}):u._({id:"5lWFkC"}),onSubmit:j,children:[c.jsx(ae,{disabled:k,label:c.jsx(x,{id:"sJGljQ"}),children:c.jsx(Be,{icon:c.jsx(wt,{className:"w-5"}),name:"username",type:"text",title:u._({id:"nZx9mr"}),autoCapitalize:"none",autoCorrect:"off",autoComplete:"username",spellCheck:"false",dir:"auto",enterKeyHint:"next",required:!0,readOnly:t,disabled:t,autoFocus:!0,value:p,onChange:U=>{ce(),_(U.target.value)}})}),c.jsx(ae,{disabled:k,label:c.jsx(x,{id:"8ZsakT"}),children:c.jsx(wr,{name:"password",onChange:U=>{ce(),E(U.target.value)},append:s&&c.jsx(F,{className:"text-sm",type:"button",onClick:()=>{s(p!=null&&p.includes("@")?p:void 0)},"aria-label":u._({id:"slOprG"}),children:c.jsx(x,{id:"F4OP4y"})}),enterKeyHint:T?"next":"done",disabled:k,required:!0})}),c.jsxs(Tt,{role:"status",children:[c.jsx("p",{className:"text-md text-primary pb-1 font-bold",children:c.jsx(x,{id:"r6y+jM"})}),c.jsx("p",{className:"text-sm",children:c.jsx(x,{id:"+Z2ZNt"})})]}),c.jsx(_s,{name:"remember",title:u._({id:"1TxdLU"}),enterKeyHint:T?"next":"done",checked:v,onChange:U=>w(U.target.checked),children:c.jsx(x,{id:"1TxdLU"})}),T&&c.jsx(ae,{disabled:k,label:c.jsx(x,{id:"4blS0m"}),children:c.jsxs("div",{children:[c.jsx(jr,{title:u._({id:"ioZOzk"}),enterKeyHint:"done",required:!0,autoFocus:!0,value:b??"",onToken:S}),c.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:c.jsx(x,{id:"B+Yy3b",values:{0:T.hint}})})]})},"2fa")]})}function ms({src:e,alt:t}){const[n,r]=m.useState(!1);return m.useEffect(()=>{r(!1)},[e]),e&&!n?c.jsx("img",{"aria-hidden":!0,src:e,alt:t,className:"-ml-1 h-6 w-6 rounded-full",onError:()=>r(!0)}):c.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:c.jsx(Yi,{className:"-mx-1 -mb-1"})})}function gs({accounts:e,onAccount:t,onOther:n=void 0,onBack:r,children:i,...s}){const{i18n:a,_:o}=O();return c.jsxs(hn,{...s,append:i,actions:null,cancel:r&&c.jsx(F,{onClick:r,children:c.jsx(x,{id:"iH8pgl"})}),children:[c.jsx("p",{className:"text-sm font-medium text-slate-600 dark:text-slate-400",children:c.jsx(x,{id:"FT1MVS"})}),e.map(l=>c.jsx(gt,{tabIndex:0,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&t(l)},onClick:()=>t(l),role:"button","aria-label":a._({id:"N9o7n5",values:{0:l.name}}),icon:c.jsx(ms,{src:l.picture,alt:a._({id:"kfcRb0"})}),append:c.jsx(Un,{"aria-hidden":!0,className:"h-4"}),className:"cursor-pointer",children:c.jsxs("span",{className:"flex flex-wrap items-center",children:[l.name&&c.jsx("span",{className:"mr-2 truncate font-medium","arial-label":a._({id:"6YtxFj"}),children:l.name}),c.jsx("span",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400","arial-label":a._({id:"sJGljQ"}),children:l.preferred_username||l.email||l.sub})]})},l.sub)),n&&c.jsx(gt,{tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&n()},onClick:n,"aria-label":a._({id:"cR9UpQ"}),role:"button",append:c.jsx(Un,{"aria-hidden":!0,className:"h-4"}),icon:c.jsx(wt,{"aria-hidden":!0,className:"h-4"}),className:"cursor-pointer",children:c.jsx("span",{className:"truncate text-slate-700 dark:text-slate-400",children:c.jsx(x,{id:"+TaG50"})})},"other")]})}function ys({loginHint:e,sessions:t,selectSub:n,onSignIn:r,onForgotPassword:i,onBack:s,title:a,subtitle:o,...l}){const{i18n:d,_:u}=O(),h=m.useMemo(()=>t.find(v=>v.selected),[t]),p=m.useCallback(()=>n(null),[n]),_=m.useMemo(()=>t.map(v=>v.account),[t]),[g,E]=m.useState(t.length===0);return a??(a=d._({id:"5lWFkC"})),m.useEffect(()=>{h&&E(!1)},[h]),h?h.loginRequired?c.jsx(X,{...l,title:a,subtitle:o??c.jsx(x,{id:"HaGV2g"}),children:c.jsx(tt,{onSubmit:r,onForgotPassword:i,onBack:p,usernameDefault:h.account.preferred_username||h.account.sub,usernameReadonly:!0,rememberDefault:!0})}):null:e?c.jsx(X,{...l,title:a,subtitle:o??c.jsx(x,{id:"NgaR6B"}),children:c.jsx(tt,{onSubmit:r,onForgotPassword:i,onBack:s,usernameDefault:e,usernameReadonly:!0})}):t.length===0?c.jsx(X,{...l,title:a,subtitle:o??c.jsx(x,{id:"T0KLp4"}),children:c.jsx(tt,{onSubmit:r,onForgotPassword:i,onBack:s})}):g?c.jsx(X,{...l,title:a,subtitle:o??c.jsx(x,{id:"T0KLp4"}),children:c.jsx(tt,{onSubmit:r,onForgotPassword:i,onBack:()=>E(!1)})}):c.jsx(X,{...l,title:a,subtitle:o??c.jsx(x,{id:"o3dwub"}),children:c.jsx(gs,{accounts:_,onAccount:v=>n(v.sub),onOther:()=>E(!0),onBack:s})})}const ie=e=>e!=null&&e!==!1,vs=e=>ie(e)&&e.invalid===!0,xs=e=>!ie(e)||e.invalid===!1;function Es(e){const t=e.findIndex(ie),n=e.findLastIndex(ie),r=e.findIndex(vs),[i,s]=m.useState(t),a=m.useCallback(S=>S!==-1&&e[S]?(s(S),!0):!1,[e.map(ie).join()]),o=e.findLastIndex((S,T)=>ie(S)&&T<i),l=e.findIndex((S,T)=>ie(S)&&T>i),d=m.useCallback(()=>a(t),[a,t]),u=m.useCallback(()=>a(n),[a,n]),h=m.useCallback(()=>a(o),[a,o]),p=m.useCallback(()=>a(l),[a,l]),_=m.useCallback(()=>a(r),[a,r]),g=i+1+e.reduce((S,T,R)=>R>=i||ie(T)?S:S-1,0),E=e.filter(ie).length,v=e.every(xs),w=i===-1||!e[i]?void 0:e[i],b=i===-1;return m.useEffect(()=>{b&&d()},[b]),{current:w,currentPosition:g,count:E,completed:v,atFirst:g===1,atLast:g===E,toFirst:d,toLast:u,toPrev:h,toNext:p,toRequired:_}}function bs({prevLabel:e,nextLabel:t,onBack:n,backLabel:r,onDone:i,doneLabel:s,steps:a,className:o,...l}){var k,D;const{atFirst:d,atLast:u,count:h,current:p,currentPosition:_,completed:g,toNext:E,toPrev:v,toRequired:w}=Es(a),b=m.useCallback(()=>{E()||w()},[E,w]),S={current:!0,invalid:p?p.invalid:!1,prevLabel:d&&r||e||c.jsx(x,{id:"iH8pgl"}),prev:d?n:v,nextLabel:u&&s||t||c.jsx(x,{id:"hXzOVo"}),next:u&&g?i:b},T=(k=p==null?void 0:p.titleRender)==null?void 0:k.call(p,S),R=(D=p==null?void 0:p.contentRender)==null?void 0:D.call(p,S);return c.jsxs("div",{className:A(o,"flex flex-col"),...l,children:[c.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:c.jsx(x,{id:"BEx8rG",values:{currentPosition:_,count:h}})}),T&&c.jsx("h2",{className:"mb-4 text-xl font-medium",children:T}),R]})}function Ss({links:e,className:t,...n}){const r=e==null?void 0:e.find(i=>i.rel==="help");return r?c.jsx("p",{...n,className:A("rounded-md bg-slate-100 p-3 text-sm text-slate-800 dark:bg-slate-800 dark:text-slate-400",t),children:c.jsx(x,{id:"87VTIH",components:{0:c.jsx("a",{role:"link",href:r.href,rel:r.rel,target:"_blank",className:"text-primary"})}})}):null}function Ts({inviteCodeRequired:e=!0,credentials:t,onCredentials:n,onNext:r,nextLabel:i,onPrev:s,prevLabel:a,children:o,ref:l,invalid:d,...u}){const{i18n:h,_:p}=O(),[_,g]=m.useState(t==null?void 0:t.email),[E,v]=m.useState(t==null?void 0:t.password),[w,b]=m.useState(t==null?void 0:t.inviteCode),S=m.useRef(null),T=()=>{var k;return(k=S.current)==null?void 0:k.reset()},R=m.useMemo(()=>_&&E&&(!e||w)?{email:_,password:E,inviteCode:e?w:void 0}:void 0,[_,E,w,e]);return m.useEffect(()=>{n==null||n(R)},[R,n]),c.jsxs(Ue,{...u,ref:fe([l,S]),invalid:d||!R,onCancel:s,cancelLabel:a,onSubmit:r,submitLabel:i,append:o,children:[e&&c.jsx(ae,{label:c.jsx(x,{id:"6KlkHI"}),children:c.jsx(Be,{icon:c.jsx(br,{className:"w-5"}),autoFocus:!0,name:"inviteCode",title:h._({id:"6KlkHI"}),placeholder:h._({id:"jxqcgY"}),required:!0,value:w||"",onChange:k=>{b(k.target.value||void 0),T()},enterKeyHint:"next"})}),c.jsx(ae,{label:c.jsx(x,{id:"O3oNi5"}),children:c.jsx(Nr,{autoFocus:!e,name:"email",enterKeyHint:"next",required:!0,defaultValue:_,onEmail:k=>{g(k),T()}})}),c.jsx(ae,{label:c.jsx(x,{id:"8ZsakT"}),children:c.jsx(Rr,{name:"password",enterKeyHint:"next",required:!0,password:E,onPassword:k=>{v(k),T()}})})]})}function Gt({links:e,className:t,...n}){const r=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 c.jsx("p",{className:A("text-sm text-slate-500 dark:text-slate-400",t),...n,children:c.jsx(x,{id:"mBUXx0",values:{0:r?c.jsx(Bn,{className:"text-primary underline",link:r,children:c.jsx(x,{id:"xowcRf"})}):c.jsx(x,{id:"xowcRf"}),1:i?c.jsx(Bn,{className:"text-primary underline",link:i,children:c.jsx(x,{id:"LcET2C"})}):c.jsx(x,{id:"LcET2C"})}})})}const ws=18,kr=3,Cr=30,Rs=e=>kr+e.length<=Cr&&e.startsWith(".")&&!e.endsWith(".");function js(e){const t=kr,n=Math.min(ws,Cr-e.length),r=m.useCallback(i=>{const s=i.length>=t&&i.length<=n,a=/^[a-z0-9][a-z0-9-]+[a-z0-9]$/g.test(i);return{validLength:s,validCharset:a,valid:s&&a}},[n,t]);return{minLength:t,maxLength:n,validateSegment:r}}function Ns({domains:e,onNext:t,nextLabel:n,onPrev:r,prevLabel:i,handle:s,onHandle:a,invalid:o,children:l,ref:d,...u}){const{i18n:h,_:p}=O(),_=e.filter(Rs),g=m.useRef(null),[E,v]=m.useState(()=>{const j=_.findIndex(U=>s==null?void 0:s.endsWith(U));return j===-1?0:j}),[w,b]=m.useState(()=>(s==null?void 0:s.split(".")[0])||"");m.useEffect(()=>{v(j=>Math.min(j,_.length-1))},[_.length]);const S=_[E]||_[0]||null,{minLength:T,maxLength:R,validateSegment:k}=js(S),D=k(w),q=S&&D.valid?`${w}${S}`:void 0;m.useEffect(()=>{var j;(j=g.current)==null||j.reset(),a==null||a(q)},[a,q]);const P=m.useRef(null),ce=`@${w}${S}`;return c.jsxs(Ue,{...u,ref:fe([d,g]),onCancel:r,cancelLabel:i,onSubmit:t,submitLabel:n,invalid:o||!q,append:l,children:[c.jsxs("div",{children:[c.jsx($n,{hasValue:!!w,valid:D.validLength,children:c.jsx(x,{id:"4Rgp24",values:{minLength:T,maxLength:R}})}),c.jsx($n,{hasValue:!!w,valid:D.validCharset,children:c.jsx(x,{id:"yDlXDJ"})})]}),c.jsx(Be,{ref:P,icon:c.jsx(wt,{className:"w-5"}),name:"handle",type:"text",title:h._({id:"LX2sHe"}),pattern:"[a-z0-9][a-z0-9\\-]+[a-z0-9]",minLength:T,maxLength:R,autoCapitalize:"none",autoCorrect:"off",autoComplete:"off",dir:"auto",enterKeyHint:"done",autoFocus:!0,required:!0,value:w,onChange:j=>{const U=j.target.value.toLowerCase(),te=j.target.selectionStart,Xe=j.target.selectionEnd;j.target.value=U,j.target.setSelectionRange(te,Xe),b(U)},append:_.length>1&&c.jsx("select",{onClick:j=>j.stopPropagation(),onMouseDown:j=>j.stopPropagation(),value:E,"aria-label":h._({id:"HB+TbB"}),onChange:j=>{var U;v(Number(j.target.value)),(U=P.current)==null||U.focus()},className:A("block w-full","text-sm","rounded-lg p-2","bg-white dark:bg-slate-600"),children:_.map((j,U)=>c.jsx("option",{value:U,children:j},j))}),bellow:c.jsx(x,{id:"r/b/p8",values:{0:w.length?c.jsx("strong",{className:"text-gray-800 dark:text-gray-200",children:ce}):c.jsx("span",{"aria-hidden":!0,className:"w-24 rounded-md bg-gray-300 p-2 dark:bg-slate-600"})}})}),c.jsx(Tt,{role:"status",children:c.jsx("p",{className:"text-md",children:c.jsx(x,{id:"B9VwbO"})})})]})}function $n({valid:e,hasValue:t,children:n,className:r,...i}){const{i18n:s,_:a}=O();return c.jsxs("div",{...i,className:A("flex flex-row items-center gap-2",r),children:[t?c.jsx(c.Fragment,{children:e?c.jsx(Gi,{className:"text-success inline-block h-4 w-4",title:s._({id:"nfagfM"})}):c.jsx(Li,{className:"text-error inline-block h-4 w-4",title:s._({id:"JHB/Ky"})})}):c.jsx("div",{"aria-hidden":!0,className:"flex h-4 w-4 items-center justify-center",children:c.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-300 dark:bg-slate-600"})}),c.jsx("div",{className:"text-sm",children:n})]})}function V(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ft(e,t){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Ft(e,t)}function ks(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ft(e,t)}var Dr=Object.defineProperty,Cs=Object.defineProperties,Ds=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,Ur=Object.prototype.propertyIsEnumerable,Yn=(e,t,n)=>t in e?Dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))Ir.call(t,n)&&Yn(e,n,t[n]);if(yt)for(var n of yt(t))Ur.call(t,n)&&Yn(e,n,t[n]);return e},N=(e,t)=>Cs(e,Ds(t)),Is=(e,t)=>{var n={};for(var r in e)Ir.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yt)for(var r of yt(e))t.indexOf(r)<0&&Ur.call(e,r)&&(n[r]=e[r]);return n},Br=(e,t)=>{for(var n in t)Dr(e,n,{get:t[n],enumerable:!0})},pn=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{o(n.next(l))}catch(d){i(d)}},a=l=>{try{o(n.throw(l))}catch(d){i(d)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);o((n=n.apply(e,t)).next())});function Us(e){return Object.entries(e).filter(([,t])=>t||t===!1).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(String(n))}`).join("&")}function Or(e){let t=e&&e.ownerDocument||document,n=t.defaultView||t.parentWindow||window;return{document:t,window:n}}function $r(e){return e||document.head}var Bs="hCaptcha-script",pt="hCaptchaOnLoad",Vt="script-error",Te="@hCaptcha/loader",Yr=Object.prototype.toString;function Gr(e){switch(Yr.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return oe(e,Error)}}function Oe(e,t){return Yr.call(e)===`[object ${t}]`}function fn(e){return Oe(e,"ErrorEvent")}function Gn(e){return Oe(e,"DOMError")}function Os(e){return Oe(e,"DOMException")}function he(e){return Oe(e,"String")}function Lr(e){return e===null||typeof e!="object"&&typeof e!="function"}function Ne(e){return Oe(e,"Object")}function jt(e){return typeof Event<"u"&&oe(e,Event)}function $s(e){return typeof Element<"u"&&oe(e,Element)}function Ys(e){return Oe(e,"RegExp")}function _n(e){return!!(e&&e.then&&typeof e.then=="function")}function Gs(e){return Ne(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Pr(e){return typeof e=="number"&&e!==e}function oe(e,t){try{return e instanceof t}catch{return!1}}function Ar(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function Re(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ln(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let i=e[r];try{Ar(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ls(e,t,n=!1){return he(e)?Ys(t)?t.test(e):he(t)?n?e===t:e.includes(t):!1:!1}function He(e,t=[],n=!1){return t.some(r=>Ls(e,r,n))}function Ps(e,t,n=250,r,i,s,a){if(!s.exception||!s.exception.values||!a||!oe(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=As(zt(e,t,i,a.originalException,r,s.exception.values,o,0),n))}function zt(e,t,n,r,i,s,a,o){if(s.length>=n+1)return s;let l=[...s];if(oe(r[i],Error)){Pn(a,o);let d=e(t,r[i]),u=l.length;An(d,i,u,o),l=zt(e,t,n,r[i],i,[d,...l],d,u)}return Array.isArray(r.errors)&&r.errors.forEach((d,u)=>{if(oe(d,Error)){Pn(a,o);let h=e(t,d),p=l.length;An(h,`errors[${u}]`,p,o),l=zt(e,t,n,d,i,[h,...l],h,p)}}),l}function Pn(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=N(f({},e.mechanism),{is_exception_group:!0,exception_id:t})}function An(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=N(f({},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function As(e,t){return e.map(n=>(n.value&&(n.value=Re(n.value,t)),n))}function nt(e){return e&&e.Math==Math?e:void 0}var Y=typeof globalThis=="object"&&nt(globalThis)||typeof window=="object"&&nt(window)||typeof self=="object"&&nt(self)||typeof global=="object"&&nt(global)||function(){return this}()||{};function qe(){return Y}function Mr(e,t,n){let r=n||Y,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}var ft=qe(),Ms=80;function ke(e,t={}){try{let n=e,r=5,i=[],s=0,a=0,o=" > ",l=o.length,d,u=Array.isArray(t)?t:t.keyAttrs,h=!Array.isArray(t)&&t.maxStringLength||Ms;for(;n&&s++<r&&(d=Hs(n,u),!(d==="html"||s>1&&a+i.length*l+d.length>=h));)i.push(d),a+=d.length,n=n.parentNode;return i.reverse().join(o)}catch{return"<unknown>"}}function Hs(e,t){let n=e,r=[],i,s,a,o,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());let d=t&&t.length?t.filter(h=>n.getAttribute(h)).map(h=>[h,n.getAttribute(h)]):null;if(d&&d.length)d.forEach(h=>{r.push(`[${h[0]}="${h[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&he(i))for(s=i.split(/\s+/),l=0;l<s.length;l++)r.push(`.${s[l]}`);let u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],o=n.getAttribute(a),o&&r.push(`[${a}="${o}"]`);return r.join("")}function qs(){try{return ft.document.location.href}catch{return""}}function Fs(e){return ft.document&&ft.document.querySelector?ft.document.querySelector(e):null}var Vs="Sentry Logger ",Wt=["debug","info","warn","error","log","assert","trace"],vt={};function Hr(e){if(!("console"in Y))return e();let t=Y.console,n={},r=Object.keys(vt);r.forEach(i=>{let s=vt[i];n[i]=t[i],t[i]=s});try{return e()}finally{r.forEach(i=>{t[i]=n[i]})}}function zs(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Wt.forEach(n=>{t[n]=(...r)=>{e&&Hr(()=>{Y.console[n](`${Vs}[${n}]:`,...r)})}}):Wt.forEach(n=>{t[n]=()=>{}}),t}var y=zs(),Ws=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Xs(e){return e==="http"||e==="https"}function Nt(e,t=!1){let{host:n,path:r,pass:i,port:s,projectId:a,protocol:o,publicKey:l}=e;return`${o}://${l}${t&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${a}`}function Ks(e){let t=Ws.exec(e);if(!t){console.error(`Invalid Sentry Dsn: ${e}`);return}let[n,r,i="",s,a="",o]=t.slice(1),l="",d=o,u=d.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),d=u.pop()),d){let h=d.match(/^\d+/);h&&(d=h[0])}return qr({host:s,pass:i,path:l,projectId:d,port:a,protocol:n,publicKey:r})}function qr(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Js(e){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(y.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Xs(r)?t&&isNaN(parseInt(t,10))?(y.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(y.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(y.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Zs(e){let t=typeof e=="string"?Ks(e):qr(e);if(!(!t||!Js(t)))return t}var Q=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 M(e,t,n){if(!(t in e))return;let r=e[t],i=n(r);typeof i=="function"&&Fr(i,r),e[t]=i}function mn(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Fr(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,mn(e,"__sentry_original__",t)}catch{}}function gn(e){return e.__sentry_original__}function Qs(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Vr(e){if(Gr(e))return f({message:e.message,name:e.name,stack:e.stack},Hn(e));if(jt(e)){let t=f({type:e.type,target:Mn(e.target),currentTarget:Mn(e.currentTarget)},Hn(e));return typeof CustomEvent<"u"&&oe(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Mn(e){try{return $s(e)?ke(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Hn(e){if(typeof e=="object"&&e!==null){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function ea(e,t=40){let n=Object.keys(Vr(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Re(n[0],t);for(let r=n.length;r>0;r--){let i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length?i:Re(i,t)}return""}function de(e){return Xt(e,new Map)}function Xt(e,t){if(Ne(e)){let n=t.get(e);if(n!==void 0)return n;let r={};t.set(e,r);for(let i of Object.keys(e))typeof e[i]<"u"&&(r[i]=Xt(e[i],t));return r}if(Array.isArray(e)){let n=t.get(e);if(n!==void 0)return n;let r=[];return t.set(e,r),e.forEach(i=>{r.push(Xt(i,t))}),r}return e}var zr=50,qn=/\(error: (.*)\)/,Fn=/captureMessage|captureException/;function ta(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let i=[],s=n.split(`
|
|
2
|
+
`);for(let a=r;a<s.length;a++){let o=s[a];if(o.length>1024)continue;let l=qn.test(o)?o.replace(qn,"$1"):o;if(!l.match(/\S*Error: /)){for(let d of t){let u=d(l);if(u){i.push(u);break}}if(i.length>=zr)break}}return na(i)}}function na(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),Fn.test(t[t.length-1].function||"")&&(t.pop(),Fn.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,zr).map(n=>N(f({},n),{filename:n.filename||t[t.length-1].filename,function:n.function||"?"}))}var Lt="<anonymous>";function pe(e){try{return!e||typeof e!="function"?Lt:e.name||Lt}catch{return Lt}}var Kt=qe();function ra(){if(!("fetch"in Kt))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Jt(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ia(){if(!ra())return!1;if(Jt(Kt.fetch))return!0;let e=!1,t=Kt.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=Jt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}var rt=qe();function sa(){let e=rt.chrome,t=e&&e.app&&e.app.runtime,n="history"in rt&&!!rt.history.pushState&&!!rt.history.replaceState;return!t&&n}var L=qe(),we="__sentry_xhr_v2__",Pe={},Vn={};function aa(e){if(!Vn[e])switch(Vn[e]=!0,e){case"console":oa();break;case"dom":_a();break;case"xhr":ua();break;case"fetch":ca();break;case"history":da();break;case"error":ma();break;case"unhandledrejection":ga();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("unknown instrumentation type:",e);return}}function W(e,t){Pe[e]=Pe[e]||[],Pe[e].push(t),aa(e)}function K(e,t){if(!(!e||!Pe[e]))for(let n of Pe[e]||[])try{n(t)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${pe(n)}
|
|
5
|
+
Error:`,r)}}function oa(){"console"in Y&&Wt.forEach(function(e){e in Y.console&&M(Y.console,e,function(t){return vt[e]=t,function(...n){K("console",{args:n,level:e});let r=vt[e];r&&r.apply(Y.console,n)}})})}function ca(){ia()&&M(Y,"fetch",function(e){return function(...t){let{method:n,url:r}=la(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return K("fetch",f({},i)),e.apply(Y,t).then(s=>(K("fetch",N(f({},i),{endTimestamp:Date.now(),response:s})),s),s=>{throw K("fetch",N(f({},i),{endTimestamp:Date.now(),error:s})),s})}})}function Zt(e,t){return!!e&&typeof e=="object"&&!!e[t]}function zn(e){return typeof e=="string"?e:e?Zt(e,"url")?e.url:e.toString?e.toString():"":""}function la(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:zn(n),method:Zt(r,"method")?String(r.method).toUpperCase():"GET"}}let t=e[0];return{url:zn(t),method:Zt(t,"method")?String(t.method).toUpperCase():"GET"}}function ua(){if(!L.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;M(e,"open",function(t){return function(...n){let r=n[1],i=this[we]={method:he(n[0])?n[0].toUpperCase():n[0],url:n[1],request_headers:{}};he(r)&&i.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let s=()=>{let a=this[we];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}K("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?M(this,"onreadystatechange",function(a){return function(...o){return s(),a.apply(this,o)}}):this.addEventListener("readystatechange",s),M(this,"setRequestHeader",function(a){return function(...o){let[l,d]=o,u=this[we];return u&&(u.request_headers[l.toLowerCase()]=d),a.apply(this,o)}}),t.apply(this,n)}}),M(e,"send",function(t){return function(...n){let r=this[we];return r&&n[0]!==void 0&&(r.body=n[0]),K("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),t.apply(this,n)}})}var it;function da(){if(!sa())return;let e=L.onpopstate;L.onpopstate=function(...n){let r=L.location.href,i=it;if(it=r,K("history",{from:i,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){let i=r.length>2?r[2]:void 0;if(i){let s=it,a=String(i);it=a,K("history",{from:s,to:a})}return n.apply(this,r)}}M(L.history,"pushState",t),M(L.history,"replaceState",t)}var ha=1e3,st,at;function pa(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}function fa(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 Wn(e,t=!1){return n=>{if(!n||at===n||fa(n))return;let r=n.type==="keypress"?"input":n.type;st===void 0?(e({event:n,name:r,global:t}),at=n):pa(at,n)&&(e({event:n,name:r,global:t}),at=n),clearTimeout(st),st=L.setTimeout(()=>{st=void 0},ha)}}function _a(){if(!L.document)return;let e=K.bind(null,"dom"),t=Wn(e,!0);L.document.addEventListener("click",t,!1),L.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let r=L[n]&&L[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(M(r,"addEventListener",function(i){return function(s,a,o){if(s==="click"||s=="keypress")try{let l=this,d=l.__sentry_instrumentation_handlers__=l.__sentry_instrumentation_handlers__||{},u=d[s]=d[s]||{refCount:0};if(!u.handler){let h=Wn(e);u.handler=h,i.call(this,s,h,o)}u.refCount++}catch{}return i.call(this,s,a,o)}}),M(r,"removeEventListener",function(i){return function(s,a,o){if(s==="click"||s=="keypress")try{let l=this,d=l.__sentry_instrumentation_handlers__||{},u=d[s];u&&(u.refCount--,u.refCount<=0&&(i.call(this,s,u.handler,o),u.handler=void 0,delete d[s]),Object.keys(d).length===0&&delete l.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,o)}}))})}var ot=null;function ma(){ot=L.onerror,L.onerror=function(e,t,n,r,i){return K("error",{column:r,error:i,line:n,msg:e,url:t}),ot&&!ot.__SENTRY_LOADER__?ot.apply(this,arguments):!1},L.onerror.__SENTRY_INSTRUMENTED__=!0}var ct=null;function ga(){ct=L.onunhandledrejection,L.onunhandledrejection=function(e){return K("unhandledrejection",e),ct&&!ct.__SENTRY_LOADER__?ct.apply(this,arguments):!0},L.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function ya(){let e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(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 r(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[n,r]}function H(){let e=Y,t=e.crypto||e.msCrypto,n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>t.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function Wr(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function ue(e){let{message:t,event_id:n}=e;if(t)return t;let r=Wr(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Qt(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function Me(e,t){let n=Wr(e);if(!n)return;let r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism=f(f(f({},r),i),t),t&&"data"in t){let s=f(f({},i&&i.data),t.data);n.mechanism.data=s}}function Xn(e){if(e&&e.__sentry_captured__)return!0;try{mn(e,"__sentry_captured__",!0)}catch{}return!1}function va(e){return Array.isArray(e)?e:[e]}function xa(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Ea(){return"npm"}function ba(){return!xa()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Sa(e,t){return e.require(t)}function le(e,t=100,n=1/0){try{return en("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Xr(e,t=3,n=100*1024){let r=le(e,t);return ja(r)>n?Xr(e,t-1,n):r}function en(e,t,n=1/0,r=1/0,i=ya()){let[s,a]=i;if(t==null||["number","boolean","string"].includes(typeof t)&&!Pr(t))return t;let o=Ta(e,t);if(!o.startsWith("[object "))return o;if(t.__sentry_skip_normalization__)return t;let l=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(l===0)return o.replace("object ","");if(s(t))return"[Circular ~]";let d=t;if(d&&typeof d.toJSON=="function")try{let _=d.toJSON();return en("",_,l-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},h=0,p=Vr(t);for(let _ in p){if(!Object.prototype.hasOwnProperty.call(p,_))continue;if(h>=r){u[_]="[MaxProperties ~]";break}let g=p[_];u[_]=en(_,g,l-1,r,i),h++}return a(t),u}function Ta(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(Ar(t))return"[VueViewModel]";if(Gs(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${pe(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=wa(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function wa(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Ra(e){return~-encodeURI(e).split(/%..|./).length}function ja(e){return Ra(JSON.stringify(e))}var se;(function(e){e[e.PENDING=0]="PENDING";let t=1;e[e.RESOLVED=t]="RESOLVED";let n=2;e[e.REJECTED=n]="REJECTED"})(se||(se={}));function ve(e){return new z(t=>{t(e)})}function yn(e){return new z((t,n)=>{n(e)})}var z=class{constructor(e){z.prototype.__init.call(this),z.prototype.__init2.call(this),z.prototype.__init3.call(this),z.prototype.__init4.call(this),this._state=se.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new z((n,r)=>{this._handlers.push([!1,i=>{if(!e)n(i);else try{n(e(i))}catch(s){r(s)}},i=>{if(!t)r(i);else try{n(t(i))}catch(s){r(s)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new z((t,n)=>{let r,i;return this.then(s=>{i=!1,r=s,e&&e()},s=>{i=!0,r=s,e&&e()}).then(()=>{if(i){n(r);return}t(r)})})}__init(){this._resolve=e=>{this._setResult(se.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(se.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===se.PENDING){if(_n(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===se.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===se.RESOLVED&&t[1](this._value),this._state===se.REJECTED&&t[2](this._value),t[0]=!0)})}}};function Na(e){let t=[];function n(){return e===void 0||t.length<e}function r(a){return t.splice(t.indexOf(a),1)[0]}function i(a){if(!n())return yn(new Q("Not adding Promise because buffer limit was reached."));let o=a();return t.indexOf(o)===-1&&t.push(o),o.then(()=>r(o)).then(null,()=>r(o).then(null,()=>{})),o}function s(a){return new z((o,l)=>{let d=t.length;if(!d)return o(!0);let u=setTimeout(()=>{a&&a>0&&o(!1)},a);t.forEach(h=>{ve(h).then(()=>{--d||(clearTimeout(u),o(!0))},l)})})}return{$:t,add:i,drain:s}}function Pt(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}var ka=["fatal","error","warning","log","info","debug"];function Ca(e){return e==="warn"?"warning":ka.includes(e)?e:"log"}var Kr=qe(),tn={nowSeconds:()=>Date.now()/1e3};function Da(){let{performance:e}=Kr;if(!e||!e.now)return;let t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}function Ia(){try{return Sa(wi,"perf_hooks").performance}catch{return}}var At=ba()?Ia():Da(),Kn=At===void 0?tn:{nowSeconds:()=>(At.timeOrigin+At.now())/1e3},kt=tn.nowSeconds.bind(tn),xe=Kn.nowSeconds.bind(Kn),ee=(()=>{let{performance:e}=Kr;if(!e||!e.now)return;let t=3600*1e3,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,s=i<t,a=e.timing&&e.timing.navigationStart,o=typeof a=="number"?Math.abs(a+n-r):t,l=o<t;return s||l?i<=o?e.timeOrigin:a:r})(),nn="baggage",Jr="sentry-",Ua=/^sentry-/,Ba=8192;function Oa(e){if(!he(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce((r,i)=>{let s=Jn(i);return f(f({},r),s)},{});else{if(!e)return;t=Jn(e)}let n=Object.entries(t).reduce((r,[i,s])=>{if(i.match(Ua)){let a=i.slice(Jr.length);r[a]=s}return r},{});if(Object.keys(n).length>0)return n}function rn(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,i])=>(i&&(n[`${Jr}${r}`]=i),n),{});return $a(t)}function Jn(e){return e.split(",").map(t=>t.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((t,[n,r])=>(t[n]=r,t),{})}function $a(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],i)=>{let s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,a=i===0?s:`${t},${s}`;return a.length>Ba?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):a},"")}var Ya=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ga(e){if(!e)return;let t=e.match(Ya);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function La(e,t){let n=Ga(e),r=Oa(t),{traceId:i,parentSpanId:s,parentSampled:a}=n||{},o={traceId:i||H(),spanId:H().substring(16),sampled:a};return s&&(o.parentSpanId=s),r&&(o.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:o}}function vn(e=H(),t=H().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Fe(e,t=[]){return[e,t]}function Pa(e,t){let[n,r]=e;return[n,[...r,t]]}function Zn(e,t){let n=e[1];for(let r of n){let i=r[0].type;if(t(r,i))return!0}return!1}function sn(e,t){return(t||new TextEncoder).encode(e)}function Aa(e,t){let[n,r]=e,i=JSON.stringify(n);function s(a){typeof i=="string"?i=typeof a=="string"?i+a:[sn(i,t),a]:i.push(typeof a=="string"?sn(a,t):a)}for(let a of r){let[o,l]=a;if(s(`
|
|
6
|
+
${JSON.stringify(o)}
|
|
7
|
+
`),typeof l=="string"||l instanceof Uint8Array)s(l);else{let d;try{d=JSON.stringify(l)}catch{d=JSON.stringify(le(l))}s(d)}}return typeof i=="string"?i:Ma(i)}function Ma(e){let t=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(t),r=0;for(let i of e)n.set(i,r),r+=i.length;return n}function Ha(e,t){let n=typeof e.data=="string"?sn(e.data,t):e.data;return[de({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}var qa={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 Qn(e){return qa[e]}function Zr(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Fa(e,t,n,r){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return f(f(f({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:Nt(r)}),i&&{trace:de(f({},i))})}function Va(e,t,n){let r=[{type:"client_report"},{timestamp:kt(),discarded_events:e}];return Fe(t?{dsn:t}:{},[r])}function za(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function Wa(e,t){return e[t]||e.all||0}function Xa(e,t,n=Date.now()){return Wa(e,t)>n}function Ka(e,{statusCode:t,headers:n},r=Date.now()){let i=f({},e),s=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(s)for(let o of s.trim().split(",")){let[l,d]=o.split(":",2),u=parseInt(l,10),h=(isNaN(u)?60:u)*1e3;if(!d)i.all=r+h;else for(let p of d.split(";"))i[p]=r+h}else a?i.all=r+za(a,r):t===429&&(i.all=r+60*1e3);return i}var xn="production";function En(){return Mr("globalEventProcessors",()=>[])}function Ja(e){En().push(e)}function xt(e,t,n,r=0){return new z((i,s)=>{let a=e[r];if(t===null||typeof a!="function")i(t);else{let o=a(f({},t),n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&o===null&&y.log(`Event processor "${a.id}" dropped event`),_n(o)?o.then(l=>xt(e,l,n,r+1).then(i)).then(null,s):xt(e,o,n,r+1).then(i).then(null,s)}})}function Za(e){let t=xe(),n={sid:H(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>eo(n)};return e&&Ce(n,e),n}function Ce(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||xe(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:H()),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 n=e.timestamp-e.started;e.duration=n>=0?n: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 Qa(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Ce(e,n)}function eo(e){return de({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 to=100,je=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=er()}static clone(e){let t=new je;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags=f({},e._tags),t._extra=f({},e._extra),t._contexts=f({},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=f({},e._sdkProcessingMetadata),t._propagationContext=f({},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&&Ce(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=f(f({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=N(f({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=f(f({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=N(f({},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 je?t:this}return e instanceof je?(this._tags=f(f({},this._tags),e._tags),this._extra=f(f({},this._extra),e._extra),this._contexts=f(f({},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)):Ne(e)&&(e=e,this._tags=f(f({},this._tags),e.tags),this._extra=f(f({},this._extra),e.extra),this._contexts=f(f({},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=er(),this}addBreadcrumb(e,t){let n=typeof t=="number"?t:to;if(n<=0)return this;let r=f({timestamp:kt()},e),i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):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={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra=f(f({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=f(f({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=f(f({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=f(f({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=f({trace:this._span.getTraceContext()},e.contexts);let s=this._span.transaction;if(s){e.sdkProcessingMetadata=f({dynamicSamplingContext:s.getDynamicSamplingContext()},e.sdkProcessingMetadata);let a=s.name;a&&(e.tags=f({transaction:a},e.tags))}}this._applyFingerprint(e);let r=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...r];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata=N(f(f({},e.sdkProcessingMetadata),this._sdkProcessingMetadata),{propagationContext:this._propagationContext}),xt([...n||[],...En(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=f(f({},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?va(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function er(){return{traceId:H(),spanId:H().substring(16)}}var Qr=4,no=100,bn=class{constructor(e,t=new je,n=Qr){this._version=n,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=je.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 n=this._lastEventId=t&&t.event_id?t.event_id:H(),r=new Error("Sentry syntheticException");return this._withClient((i,s)=>{i.captureException(e,N(f({originalException:e,syntheticException:r},t),{event_id:n}),s)}),n}captureMessage(e,t,n){let r=this._lastEventId=n&&n.event_id?n.event_id:H(),i=new Error(e);return this._withClient((s,a)=>{s.captureMessage(e,t,N(f({originalException:e,syntheticException:i},n),{event_id:r}),a)}),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:H();return e.type||(this._lastEventId=n),this._withClient((r,i)=>{r.captureEvent(e,N(f({},t),{event_id:n}),i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:n,client:r}=this.getStackTop();if(!r)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:s=no}=r.getOptions&&r.getOptions()||{};if(s<=0)return;let a=kt(),o=f({timestamp:a},e),l=i?Hr(()=>i(o,t)):o;l!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",l,t),n.addBreadcrumb(l,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:n}=this.getStackTop();n&&e(t)}run(e){let t=tr(this);try{e(this)}finally{tr(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){let n=this._callExtensionMethod("startTransaction",e,t);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!n){let r=this.getClient();console.warn(r?`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 n}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&&Qa(t),this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=xn}=n&&n.getOptions()||{},{userAgent:s}=Y.navigator||{},a=Za(f(f({release:r,environment:i,user:t.getUser()},s&&{userAgent:s}),e)),o=t.getSession&&t.getSession();return o&&o.status==="ok"&&Ce(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(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){let{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){let n=Ve().__SENTRY__;if(n&&n.extensions&&typeof n.extensions[e]=="function")return n.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function Ve(){return Y.__SENTRY__=Y.__SENTRY__||{extensions:{},hub:void 0},Y}function tr(e){let t=Ve(),n=an(t);return ei(t,e),n}function G(){let e=Ve();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return ro(e)}function ro(e=Ve()){return(!io(e)||an(e).isOlderThan(Qr))&&ei(e,new bn),an(e)}function io(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function an(e){return Mr("hub",()=>new bn,e)}function ei(e,t){if(!e)return!1;let n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}function Sn(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=G().getClient(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function ze(e){return G().getScope().getTransaction()}var nr=!1;function so(){nr||(nr=!0,W("error",on),W("unhandledrejection",on))}function on(){let e=ze();if(e){let t="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}on.tag="sentry_tracingErrorCallback";var ti=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},ni=class{constructor(e={}){this.traceId=e.traceId||H(),this.spanId=e.spanId||H().substring(16),this.startTimestamp=e.startTimestamp||xe(),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 ni(N(f({},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 n=e&&e.op||"< unknown op >",r=t.transaction.name||"< unknown name >",i=t.transaction.spanId,s=`[Tracing] Starting '${n}' span on transaction '${r}' (${i}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:s},y.log(s)}return t}setTag(e,t){return this.tags=N(f({},this.tags),{[e]:t}),this}setData(e,t){return this.data=N(f({},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=ao(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&&y.log(t.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:xe()}toTraceparent(){return vn(this.traceId,this.spanId,this.sampled)}toContext(){return de({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 de({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 de({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 ao(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 Ct(e,t,n){let r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:s}=n&&n.getUser()||{},a=de({environment:r.environment||xn,release:r.release,user_segment:s,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}var ri=class extends ni{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||G(),this._name=e.name||"",this.metadata=N(f({source:"custom"},e.metadata),{spanMetadata:{}}),this._trimEnd=e.trimEnd,this.transaction=this;let n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext=f({},n))}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 ti(e)),this.spanRecorder.add(this)}setContext(e,t){t===null?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,n=""){this._measurements[e]={value:t,unit:n}}setMetadata(e){this.metadata=f(f({},this.metadata),e)}finish(e){let t=this._finishTransaction(e);if(t)return this._hub.captureEvent(t)}toContext(){let e=super.toContext();return de(N(f({},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||G(),t=e.getClient();if(!t)return{};let n=e.getScope(),r=Ct(this.traceId,t,n),i=this.metadata.sampleRate;i!==void 0&&(r.sample_rate=`${i}`);let s=this.metadata.source;return s&&s!=="url"&&(r.transaction=this.name),this.sampled!==void 0&&(r.sampled=String(this.sampled)),r}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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__)&&y.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","transaction");return}let n=this.spanRecorder?this.spanRecorder.spans.filter(s=>s!==this&&s.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((s,a)=>s.endTimestamp&&a.endTimestamp?s.endTimestamp>a.endTimestamp?s:a:s).endTimestamp);let r=this.metadata,i=f({contexts:N(f({},this._contexts),{trace:this.getTraceContext()}),spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:N(f({},r),{dynamicSamplingContext:this.getDynamicSamplingContext()})},r.source&&{transaction_info:{source:r.source}});return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}},_t={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},oo="finishReason",be=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],co=class extends ti{constructor(e,t,n,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp=typeof t=="number"?t:xe(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},lo=class extends ri{constructor(e,t,n=_t.idleTimeout,r=_t.finalTimeout,i=_t.heartbeatInterval,s=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=i,this._onScope=s,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=be[4],s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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=be[3],this.finish())},this._finalTimeout)}finish(e=xe()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(oo,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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__)&&y.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));let n=t.startTimestamp<e,r=(this._finalTimeout+this._idleTimeout)/1e3,i=t.endTimestamp-this.startTimestamp<r;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let s=JSON.stringify(t,void 0,2);n?i||y.log("[Tracing] discarding Span since it finished after Transaction final timeout",s):y.log("[Tracing] discarding Span since it happened after Transaction was finished",s)}return n&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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=r=>{this._finished||this._pushActivity(r)},n=r=>{this._finished||this._popActivity(r)};this.spanRecorder=new co(t,n,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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=be[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=be[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let t=xe();this._idleTimeoutCanceledPermanently?(this._finishReason=be[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__)&&y.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=be[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function uo(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function ii(e,t,n){if(!Sn(t))return e.sampled=!1,e;if(e.sampled!==void 0)return e.setMetadata({sampleRate:Number(e.sampled)}),e;let r;return typeof t.tracesSampler=="function"?(r=t.tracesSampler(n),e.setMetadata({sampleRate:Number(r)})):n.parentSampled!==void 0?r=n.parentSampled:typeof t.tracesSampleRate<"u"?(r=t.tracesSampleRate,e.setMetadata({sampleRate:Number(r)})):(r=1,e.setMetadata({sampleRate:r})),ho(r)?r?(e.sampled=Math.random()<r,e.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] starting ${e.op} transaction - ${e.name}`),e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),e)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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__)&&y.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)}function ho(e){return Pr(e)||!(typeof e=="number"||typeof e=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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__)&&y.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function po(e,t){let n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",s=e.instrumenter||"sentry";i!==s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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 ri(e,this);return a=ii(a,r,f({parentSampled:e.parentSampled,transactionContext:e},t)),a.sampled&&a.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",a),a}function rr(e,t,n,r,i,s,a){let o=e.getClient(),l=o&&o.getOptions()||{},d=new lo(t,e,n,r,a,i);return d=ii(d,l,f({parentSampled:t.parentSampled,transactionContext:t},s)),d.sampled&&d.initSpanRecorder(l._experiments&&l._experiments.maxSpans),o&&o.emit&&o.emit("startTransaction",d),d}function fo(){let e=Ve();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=po),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=uo),so())}function _o(e,t){return G().captureException(e,{captureContext:t})}function mo(e){G().withScope(e)}var go="7";function yo(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function vo(e){return`${yo(e)}${e.projectId}/envelope/`}function xo(e,t){return Qs(f({sentry_key:e.publicKey,sentry_version:go},t&&{sentry_client:`${t.name}/${t.version}`}))}function Eo(e,t={}){let n=typeof t=="string"?t:t.tunnel,r=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return n||`${vo(e)}?${xo(e,r)}`}function bo(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 So(e,t,n,r){let i=Zr(n),s=f(f({sent_at:new Date().toISOString()},i&&{sdk:i}),!!r&&t&&{dsn:Nt(t)}),a="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Fe(s,[a])}function To(e,t,n,r){let i=Zr(n),s=e.type&&e.type!=="replay_event"?e.type:"event";bo(e,n&&n.sdk);let a=Fa(e,i,r,t);return delete e.sdkProcessingMetadata,Fe(a,[[{type:s},e]])}var ir=[];function wo(e,t){let n={};return t.forEach(r=>{r&&si(e,r,n)}),n}function si(e,t,n){if(n[t.name]=t,ir.indexOf(t.name)===-1&&(t.setupOnce(Ja,G),ir.push(t.name)),e.on&&typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,s)=>r(i,s,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){let r=t.processEvent.bind(t),i=Object.assign((s,a)=>r(s,a,e),{id:t.name});e.addEventProcessor(i)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`Integration installed: ${t.name}`)}function Ro(e,t,n,r,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,o=N(f({},t),{event_id:t.event_id||n.event_id||H(),timestamp:t.timestamp||kt()}),l=n.integrations||e.integrations.map(p=>p.name);jo(o,e),Co(o,l),t.type===void 0&&No(o,e.stackParser);let d=r;n.captureContext&&(d=je.clone(d).update(n.captureContext));let u=ve(o),h=i&&i.getEventProcessors?i.getEventProcessors():[];if(d){if(d.getAttachments){let p=[...n.attachments||[],...d.getAttachments()];p.length&&(n.attachments=p)}u=d.applyToEvent(o,n,h)}else u=xt([...h,...En()],o,n);return u.then(p=>(p&&ko(p),typeof s=="number"&&s>0?Do(p,s,a):p))}function jo(e,t){let{environment:n,release:r,dist:i,maxValueLength:s=250}=t;"environment"in e||(e.environment="environment"in t?n:xn),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&i!==void 0&&(e.dist=i),e.message&&(e.message=Re(e.message,s));let a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Re(a.value,s));let o=e.request;o&&o.url&&(o.url=Re(o.url,s))}var sr=new WeakMap;function No(e,t){let n=Y._sentryDebugIds;if(!n)return;let r,i=sr.get(t);i?r=i:(r=new Map,sr.set(t,r));let s=Object.keys(n).reduce((a,o)=>{let l,d=r.get(o);d?l=d:(l=t(o),r.set(o,l));for(let u=l.length-1;u>=0;u--){let h=l[u];if(h.filename){a[h.filename]=n[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 ko(e){let t={};try{e.exception.values.forEach(r=>{r.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 n=e.debug_meta.images;Object.keys(t).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:t[r]})})}function Co(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Do(e,t,n){if(!e)return null;let r=f(f(f(f(f({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>f(f({},i),i.data&&{data:le(i.data,t,n)}))}),e.user&&{user:le(e.user,t,n)}),e.contexts&&{contexts:le(e.contexts,t,n)}),e.extra&&{extra:le(e.extra,t,n)});return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=le(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>(i.data&&(i.data=le(i.data,t,n)),i))),r}var ar="Not capturing exception because it's already been captured.",Io=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=Zs(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("No DSN provided, client will not send events."),this._dsn){let t=Eo(this._dsn,e);this._transport=e.transport(N(f({recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}}captureException(e,t,n){if(Xn(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(ar);return}let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(i=>this._captureEvent(i,t,n)).then(i=>{r=i})),r}captureMessage(e,t,n,r){let i=n&&n.event_id,s=Lr(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(s.then(a=>this._captureEvent(a,n,r)).then(a=>{i=a})),i}captureEvent(e,t,n){if(t&&t.originalException&&Xn(t.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(ar);return}let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(i=>{r=i})),r}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Ce(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(n=>t.flush(e).then(r=>n&&r)):ve(!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=wo(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__)&&y.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){si(this,e,this._integrations)}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=To(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of t.attachments||[])n=Pa(n,Ha(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let r=this._sendEnvelope(n);r&&r.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let t=So(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){let r=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+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(n=>n(...t))}_updateSessionFromEvent(e,t){let n=!1,r=!1,i=t.exception&&t.exception.values;if(i){r=!0;for(let a of i){let o=a.mechanism;if(o&&o.handled===!1){n=!0;break}}}let s=e.status==="ok";(s&&e.errors===0||s&&n)&&(Ce(e,N(f({},n&&{status:"crashed"}),{errors:e.errors||Number(r||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new z(t=>{let n=0,r=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),t(!0)):(n+=r,e&&n>=e&&(clearInterval(i),t(!1)))},r)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n){let r=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),this.emit("preprocessEvent",e,t),Ro(r,e,t,n,this).then(s=>{if(s===null)return s;let{propagationContext:a}=s.sdkProcessingMetadata||{};if(!(s.contexts&&s.contexts.trace)&&a){let{traceId:o,spanId:l,parentSpanId:d,dsc:u}=a;s.contexts=f({trace:{trace_id:o,span_id:l,parent_span_id:d}},s.contexts);let h=u||Ct(o,this,n);s.sdkProcessingMetadata=f({dynamicSamplingContext:h},s.sdkProcessingMetadata)}return s})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(r=>r.event_id,r=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=r;i.logLevel==="log"?y.log(i.message):y.warn(i)}})}_processEvent(e,t,n){let r=this.getOptions(),{sampleRate:i}=r,s=oi(e),a=ai(e),o=e.type||"error",l=`before send for type \`${o}\``;if(a&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),yn(new Q(`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,n).then(u=>{if(u===null)throw this.recordDroppedEvent("event_processor",d,e),new Q("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return u;let h=Bo(r,u,t);return Uo(h,l)}).then(u=>{if(u===null)throw this.recordDroppedEvent("before_send",d,e),new Q(`${l} returned \`null\`, will not send event.`,"log");let h=n&&n.getSession();!s&&h&&this._updateSessionFromEvent(h,u);let p=u.transaction_info;if(s&&p&&u.transaction!==e.transaction){let _="custom";u.transaction_info=N(f({},p),{source:_})}return this.sendEvent(u,t),u}).then(null,u=>{throw u instanceof Q?u:(this.captureException(u,{data:{__sentry__:!0},originalException:u}),new Q(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
12
|
+
Reason: ${u}`))})}_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__)&&y.error("Error while sending event:",t)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{let[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}};function Uo(e,t){let n=`${t} must return \`null\` or a valid event.`;if(_n(e))return e.then(r=>{if(!Ne(r)&&r!==null)throw new Q(n);return r},r=>{throw new Q(`${t} rejected with ${r}`)});if(!Ne(e)&&e!==null)throw new Q(n);return e}function Bo(e,t,n){let{beforeSend:r,beforeSendTransaction:i}=e;return ai(t)&&r?r(t,n):oi(t)&&i?i(t,n):t}function ai(e){return e.type===void 0}function oi(e){return e.type==="transaction"}var Oo=30;function ci(e,t,n=Na(e.bufferSize||Oo)){let r={},i=a=>n.drain(a);function s(a){let o=[];if(Zn(a,(h,p)=>{let _=Qn(p);if(Xa(r,_)){let g=or(h,p);e.recordDroppedEvent("ratelimit_backoff",_,g)}else o.push(h)}),o.length===0)return ve();let l=Fe(a[0],o),d=h=>{Zn(l,(p,_)=>{let g=or(p,_);e.recordDroppedEvent(h,Qn(_),g)})},u=()=>t({body:Aa(l,e.textEncoder)}).then(h=>(h.statusCode!==void 0&&(h.statusCode<200||h.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Sentry responded with status code ${h.statusCode} to sent event.`),r=Ka(r,h),h),h=>{throw d("network_error"),h});return n.add(u).then(h=>h,h=>{if(h instanceof Q)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error("Skipped sending event because buffer is full."),d("queue_overflow"),ve();throw h})}return s.__sentry__baseTransport__=!0,{send:s,flush:i}}function or(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}var cr="7.73.0",li={};Br(li,{FunctionToString:()=>Tn,InboundFilters:()=>wn});var lr,Tn=class{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=Tn.id}setupOnce(){lr=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=gn(this)||this;return lr.apply(t,e)}}catch{}}};Tn.__initStatic();var $o=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Yo=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/],wn=class{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=wn.id,this._options=e}setupOnce(e,t){}processEvent(e,t,n){let r=n.getOptions(),i=Go(this._options,r);return Lo(e,i)?null:e}};wn.__initStatic();function Go(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:$o],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Yo],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function Lo(e,t){return t.ignoreInternal&&Fo(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to being internal Sentry Error.
|
|
13
|
+
Event: ${ue(e)}`),!0):Po(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
14
|
+
Event: ${ue(e)}`),!0):Ao(e,t.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
15
|
+
Event: ${ue(e)}`),!0):Mo(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
16
|
+
Event: ${ue(e)}.
|
|
17
|
+
Url: ${Et(e)}`),!0):Ho(e,t.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
18
|
+
Event: ${ue(e)}.
|
|
19
|
+
Url: ${Et(e)}`),!0)}function Po(e,t){return e.type||!t||!t.length?!1:qo(e).some(n=>He(n,t))}function Ao(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let n=e.transaction;return n?He(n,t):!1}function Mo(e,t){if(!t||!t.length)return!1;let n=Et(e);return n?He(n,t):!1}function Ho(e,t){if(!t||!t.length)return!0;let n=Et(e);return n?He(n,t):!0}function qo(e){let t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.length===0&&y.error(`Could not extract message for event ${ue(e)}`),t}function Fo(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function Vo(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Et(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?Vo(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error(`Cannot extract url for event ${ue(e)}`),null}}var I=Y,cn=0;function ui(){return cn>0}function zo(){cn++,setTimeout(()=>{cn--})}function De(e,t={},n){if(typeof e!="function")return e;try{let i=e.__sentry_wrapped__;if(i)return i;if(gn(e))return e}catch{return e}let r=function(){let i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);let s=i.map(a=>De(a,t));return e.apply(this,s)}catch(s){throw zo(),mo(a=>{a.addEventProcessor(o=>(t.mechanism&&(Qt(o,void 0),Me(o,t.mechanism)),o.extra=N(f({},o.extra),{arguments:i}),o)),_o(s)}),s}};try{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}catch{}Fr(r,e),mn(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function di(e,t){let n=Rn(e,t),r={type:t&&t.name,value:Jo(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Wo(e,t,n,r){let i=G().getClient(),s=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:jt(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:ec(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Xr(t,s)}};if(n){let o=Rn(e,n);o.length&&(a.exception.values[0].stacktrace={frames:o})}return a}function Mt(e,t){return{exception:{values:[di(e,t)]}}}function Rn(e,t){let n=t.stacktrace||t.stack||"",r=Ko(t);try{return e(n,r)}catch{}return[]}var Xo=/Minified React error #\d+;/i;function Ko(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(Xo.test(e.message))return 1}return 0}function Jo(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function Zo(e,t,n,r){let i=n&&n.syntheticException||void 0,s=jn(e,t,i,r);return Me(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),ve(s)}function Qo(e,t,n="info",r,i){let s=r&&r.syntheticException||void 0,a=ln(e,t,s,i);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),ve(a)}function jn(e,t,n,r,i){let s;if(fn(t)&&t.error)return Mt(e,t.error);if(Gn(t)||Os(t)){let a=t;if("stack"in t)s=Mt(e,t);else{let o=a.name||(Gn(a)?"DOMError":"DOMException"),l=a.message?`${o}: ${a.message}`:o;s=ln(e,l,n,r),Qt(s,l)}return"code"in a&&(s.tags=N(f({},s.tags),{"DOMException.code":`${a.code}`})),s}return Gr(t)?Mt(e,t):Ne(t)||jt(t)?(s=Wo(e,t,n,i),Me(s,{synthetic:!0}),s):(s=ln(e,t,n,r),Qt(s,`${t}`),Me(s,{synthetic:!0}),s)}function ln(e,t,n,r){let i={message:t};if(r&&n){let s=Rn(e,n);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]})}return i}function ec(e,{isUnhandledRejection:t}){let n=ea(e),r=t?"promise rejection":"exception";return fn(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:jt(e)?`Event \`${tc(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function tc(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function nc(e,{metadata:t,tunnel:n,dsn:r}){let i=f(f({event_id:e.event_id,sent_at:new Date().toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:Nt(r)}),s=rc(e);return Fe(i,[s])}function rc(e){return[{type:"user_report"},e]}var ic=class extends Io{constructor(e){let t=I.SENTRY_SDK_SOURCE||Ea();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:cr}],version:cr},super(e),e.sendClientReports&&I.document&&I.document.addEventListener("visibilitychange",()=>{I.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return Zo(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return Qo(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("SDK not enabled, will not capture user feedback.");return}let t=nc(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("Sending outcomes:",e);let t=Va(e,this._options.tunnel&&Nt(this._dsn));this._sendEnvelope(t)}},Le;function sc(){if(Le)return Le;if(Jt(I.fetch))return Le=I.fetch.bind(I);let e=I.document,t=I.fetch;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);let r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return Le=t.bind(I)}function ac(){Le=void 0}function oc(e,t=sc()){let n=0,r=0;function i(s){let a=s.body.length;n+=a,r++;let o=f({body:s.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);try{return t(e.url,o).then(l=>(n-=a,r--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return ac(),n-=a,r--,yn(l)}}return ci(e,i)}var cc=4;function lc(e){function t(n){return new z((r,i)=>{let s=new XMLHttpRequest;s.onerror=i,s.onreadystatechange=()=>{s.readyState===cc&&r({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(n.body)})}return ci(e,t)}var Dt="?",uc=30,dc=40,hc=50;function Nn(e,t,n,r){let i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var pc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fc=/\((\S*)(?::(\d+))(?::(\d+))\)/,_c=e=>{let t=pc.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){let i=fc.exec(t[2]);i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3])}let[n,r]=hi(t[1]||Dt,t[2]);return Nn(r,n,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},mc=[uc,_c],gc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,vc=e=>{let t=gc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=yc.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let n=t[3],r=t[1]||Dt;return[r,n]=hi(r,n),Nn(n,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},xc=[hc,vc],Ec=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,bc=e=>{let t=Ec.exec(e);return t?Nn(t[2],t[1]||Dt,+t[3],t[4]?+t[4]:void 0):void 0},Sc=[dc,bc],Tc=[mc,xc,Sc],wc=ta(...Tc),hi=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Dt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},$e=class{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=$e.id,this._options=f({onerror:!0,onunhandledrejection:!0},e),this._installFunc={onerror:Rc,onunhandledrejection:jc}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let t in e){let n=this._installFunc[t];n&&e[t]&&(Cc(t),n(),this._installFunc[t]=void 0)}}};$e.__initStatic();function Rc(){W("error",e=>{let[t,n,r]=_i();if(!t.getIntegration($e))return;let{msg:i,url:s,line:a,column:o,error:l}=e;if(ui()||l&&l.__sentry_own_request__)return;let d=l===void 0&&he(i)?kc(i,s,a,o):pi(jn(n,l||i,void 0,r,!1),s,a,o);d.level="error",fi(t,l,d,"onerror")})}function jc(){W("unhandledrejection",e=>{let[t,n,r]=_i();if(!t.getIntegration($e))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch{}if(ui()||i&&i.__sentry_own_request__)return!0;let s=Lr(i)?Nc(i):jn(n,i,void 0,r,!0);s.level="error",fi(t,i,s,"onunhandledrejection")})}function Nc(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function kc(e,t,n,r){let i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,s=fn(e)?e.message:e,a="Error",o=s.match(i);return o&&(a=o[1],s=o[2]),pi({exception:{values:[{type:a,value:s}]}},t,n,r)}function pi(e,t,n,r){let i=e.exception=e.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},o=a.stacktrace=a.stacktrace||{},l=o.frames=o.frames||[],d=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=he(t)&&t.length>0?t:qs();return l.length===0&&l.push({colno:d,filename:h,function:"?",in_app:!0,lineno:u}),e}function Cc(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`Global Handler attached: ${e}`)}function fi(e,t,n,r){Me(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function _i(){let e=G(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}var Dc=["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"],kn=class{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=kn.id,this._options=f({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}setupOnce(){this._options.setTimeout&&M(I,"setTimeout",ur),this._options.setInterval&&M(I,"setInterval",ur),this._options.requestAnimationFrame&&M(I,"requestAnimationFrame",Ic),this._options.XMLHttpRequest&&"XMLHttpRequest"in I&&M(XMLHttpRequest.prototype,"send",Uc);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:Dc).forEach(Bc)}};kn.__initStatic();function ur(e){return function(...t){let n=t[0];return t[0]=De(n,{mechanism:{data:{function:pe(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Ic(e){return function(t){return e.apply(this,[De(t,{mechanism:{data:{function:"requestAnimationFrame",handler:pe(e)},handled:!1,type:"instrument"}})])}}function Uc(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&M(n,r,function(i){let s={mechanism:{data:{function:r,handler:pe(i)},handled:!1,type:"instrument"}},a=gn(i);return a&&(s.mechanism.data.handler=pe(a)),De(i,s)})}),e.apply(this,t)}}function Bc(e){let t=I,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(M(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=De(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:pe(s),target:e},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,De(s,{mechanism:{data:{function:"addEventListener",handler:pe(s),target:e},handled:!1,type:"instrument"}}),a])}}),M(n,"removeEventListener",function(r){return function(i,s,a){let o=s;try{let l=o&&o.__sentry_wrapped__;l&&r.call(this,i,l,a)}catch{}return r.call(this,i,o,a)}}))}var lt=1024,It=class{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=It.id,this.options=f({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}setupOnce(){if(this.options.console&&W("console",Yc),this.options.dom&&W("dom",$c(this.options.dom)),this.options.xhr&&W("xhr",Gc),this.options.fetch&&W("fetch",Lc),this.options.history&&W("history",Pc),this.options.sentry){let e=G().getClient();e&&e.on&&e.on("beforeSendEvent",Oc)}}};It.__initStatic();function Oc(e){G().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:ue(e)},{event:e})}function $c(e){function t(n){let r,i=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>lt&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`\`dom.maxStringLength\` cannot exceed ${lt}, but a value of ${s} was configured. Sentry will use ${lt} instead.`),s=lt),typeof i=="string"&&(i=[i]);try{let a=n.event;r=Ac(a)?ke(a.target,{keyAttrs:i,maxStringLength:s}):ke(a,{keyAttrs:i,maxStringLength:s})}catch{r="<unknown>"}r.length!==0&&G().addBreadcrumb({category:`ui.${n.name}`,message:r},{event:n.event,name:n.name,global:n.global})}return t}function Yc(e){let t={category:"console",data:{arguments:e.args,logger:"console"},level:Ca(e.level),message:Ln(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message=`Assertion failed: ${Ln(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1);else return;G().addBreadcrumb(t,{input:e.args,level:e.level})}function Gc(e){let{startTimestamp:t,endTimestamp:n}=e,r=e.xhr[we];if(!t||!n||!r)return;let{method:i,url:s,status_code:a,body:o}=r,l={method:i,url:s,status_code:a},d={xhr:e.xhr,input:o,startTimestamp:t,endTimestamp:n};G().addBreadcrumb({category:"xhr",data:l,type:"http"},d)}function Lc(e){let{startTimestamp:t,endTimestamp:n}=e;if(n&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let r=e.fetchData,i={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};G().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{let r=N(f({},e.fetchData),{status_code:e.response&&e.response.status}),i={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};G().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function Pc(e){let t=e.from,n=e.to,r=Pt(I.location.href),i=Pt(t),s=Pt(n);i.path||(i=r),r.protocol===s.protocol&&r.host===s.host&&(n=s.relative),r.protocol===i.protocol&&r.host===i.host&&(t=i.relative),G().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}function Ac(e){return!!e&&!!e.target}var Mc="cause",Hc=5,Ut=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=Ut.id,this._key=e.key||Mc,this._limit=e.limit||Hc}setupOnce(){}preprocessEvent(e,t,n){let r=n.getOptions();Ps(di,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}};Ut.__initStatic();var Bt=class{static __initStatic(){this.id="HttpContext"}constructor(){this.name=Bt.id}setupOnce(){}preprocessEvent(e){if(!I.navigator&&!I.location&&!I.document)return;let t=e.request&&e.request.url||I.location&&I.location.href,{referrer:n}=I.document||{},{userAgent:r}=I.navigator||{},i=f(f(f({},e.request&&e.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),s=N(f(f({},e.request),t&&{url:t}),{headers:i});e.request=s}};Bt.__initStatic();var Ot=class{static __initStatic(){this.id="Dedupe"}constructor(){this.name=Ot.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(qc(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}};Ot.__initStatic();function qc(e,t){return t?!!(Fc(e,t)||Vc(e,t)):!1}function Fc(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!gi(e,t)||!mi(e,t))}function Vc(e,t){let n=dr(t),r=dr(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!gi(e,t)||!mi(e,t))}function mi(e,t){let n=hr(e),r=hr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function gi(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function dr(e){return e.exception&&e.exception.values&&e.exception.values[0]}function hr(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}var yi={};Br(yi,{Breadcrumbs:()=>It,Dedupe:()=>Ot,GlobalHandlers:()=>$e,HttpContext:()=>Bt,LinkedErrors:()=>Ut,TryCatch:()=>kn});var C=Y;function zc(){C&&C.document?C.document.addEventListener("visibilitychange",()=>{let e=ze();if(C.document.hidden&&e){let t="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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__)&&y.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Cn=(e,t,n)=>{let r,i;return s=>{t.value>=0&&(s||n)&&(i=t.value-(r||0),(i||r===void 0)&&(r=t.value,t.delta=i,e(t)))}},Wc=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,Xc=()=>{let e=C.performance.timing,t=C.performance.navigation.type,n={entryType:"navigation",startTime:0,type:t==2?"back_forward":t===1?"reload":"navigate"};for(let r in e)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(e[r]-e.navigationStart,0));return n},vi=()=>C.__WEB_VITALS_POLYFILL__?C.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||Xc()):C.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],xi=()=>{let e=vi();return e&&e.activationStart||0},Dn=(e,t)=>{let n=vi(),r="navigate";return n&&(C.document.prerendering||xi()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:e,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:Wc(),navigationType:r}},We=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(i=>{t(i.getEntries())});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch{}},$t=(e,t)=>{let n=r=>{(r.type==="pagehide"||C.document.visibilityState==="hidden")&&(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},Kc=e=>{let t=Dn("CLS",0),n,r=0,i=[],s=o=>{o.forEach(l=>{if(!l.hadRecentInput){let d=i[0],u=i[i.length-1];r&&i.length!==0&&l.startTime-u.startTime<1e3&&l.startTime-d.startTime<5e3?(r+=l.value,i.push(l)):(r=l.value,i=[l]),r>t.value&&(t.value=r,t.entries=i,n&&n())}})},a=We("layout-shift",s);if(a){n=Cn(e,t);let o=()=>{s(a.takeRecords()),n(!0)};return $t(o),o}},mt=-1,Jc=()=>C.document.visibilityState==="hidden"&&!C.document.prerendering?0:1/0,Zc=()=>{$t(({timeStamp:e})=>{mt=e},!0)},In=()=>(mt<0&&(mt=Jc(),Zc()),{get firstHiddenTime(){return mt}}),Qc=e=>{let t=In(),n=Dn("FID"),r,i=o=>{o.startTime<t.firstHiddenTime&&(n.value=o.processingStart-o.startTime,n.entries.push(o),r(!0))},s=o=>{o.forEach(i)},a=We("first-input",s);r=Cn(e,n),a&&$t(()=>{s(a.takeRecords()),a.disconnect()},!0)},pr={},el=e=>{let t=In(),n=Dn("LCP"),r,i=a=>{let o=a[a.length-1];if(o){let l=Math.max(o.startTime-xi(),0);l<t.firstHiddenTime&&(n.value=l,n.entries=[o],r())}},s=We("largest-contentful-paint",i);if(s){r=Cn(e,n);let a=()=>{pr[n.id]||(i(s.takeRecords()),s.disconnect(),pr[n.id]=!0,r(!0))};return["keydown","click"].forEach(o=>{addEventListener(o,a,{once:!0,capture:!0})}),$t(a,!0),a}};function Ht(e){return typeof e=="number"&&isFinite(e)}function Ie(e,t){var n=t,{startTimestamp:r}=n,i=Is(n,["startTimestamp"]);return r&&e.startTimestamp>r&&(e.startTimestamp=r),e.startChild(f({startTimestamp:r},i))}function $(e){return e/1e3}function Ei(){return C&&C.addEventListener&&C.performance}var fr=0,B={},Z,Ae;function tl(){let e=Ei();if(e&&ee){e.mark&&C.performance.mark("sentry-tracing-init"),al();let t=il(),n=sl();return()=>{t&&t(),n&&n()}}return()=>{}}function nl(){We("longtask",e=>{for(let t of e){let n=ze();if(!n)return;let r=$(ee+t.startTime),i=$(t.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function rl(){We("event",e=>{for(let t of e){let n=ze();if(!n)return;if(t.name==="click"){let r=$(ee+t.startTime),i=$(t.duration);n.startChild({description:ke(t.target),op:`ui.interaction.${t.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}}},{durationThreshold:0})}function il(){return Kc(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding CLS"),B.cls={value:e.value,unit:""},Ae=t)})}function sl(){return el(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding LCP"),B.lcp={value:e.value,unit:"millisecond"},Z=t)})}function al(){Qc(e=>{let t=e.entries.pop();if(!t)return;let n=$(ee),r=$(t.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding FID"),B.fid={value:e.value,unit:"millisecond"},B["mark.fid"]={value:n+r,unit:"second"}})}function ol(e){let t=Ei();if(!t||!C.performance.getEntries||!ee)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Tracing] Adding & adjusting spans using Performance API");let n=$(ee),r=t.getEntries(),i,s;if(r.slice(fr).forEach(a=>{let o=$(a.startTime),l=$(a.duration);if(!(e.op==="navigation"&&n+o<e.startTimestamp))switch(a.entryType){case"navigation":{ll(e,a,n),i=n+$(a.responseStart),s=n+$(a.requestStart);break}case"mark":case"paint":case"measure":{cl(e,a,o,l,n);let d=In(),u=a.startTime<d.firstHiddenTime;a.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding FP"),B.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding FCP"),B.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{let d=a.name.replace(C.location.origin,"");dl(e,a,d,o,l,n);break}}}),fr=Math.max(r.length-1,0),hl(e),e.op==="pageload"){typeof i=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding TTFB"),B.ttfb={value:(i-e.startTimestamp)*1e3,unit:"millisecond"},typeof s=="number"&&s<=i&&(B["ttfb.requestTime"]={value:(i-s)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(o=>{if(!B[o]||n>=e.startTimestamp)return;let l=B[o].value,d=n+$(l),u=Math.abs((d-e.startTimestamp)*1e3),h=u-l;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Measurements] Normalized ${o} from ${l} to ${u} (${h})`),B[o].value=u});let a=B["mark.fid"];a&&B.fid&&(Ie(e,{description:"first input delay",endTimestamp:a.value+$(B.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:a.value}),delete B["mark.fid"]),"fcp"in B||delete B.cls,Object.keys(B).forEach(o=>{e.setMeasurement(o,B[o].value,B[o].unit)}),pl(e)}Z=void 0,Ae=void 0,B={}}function cl(e,t,n,r,i){let s=i+n,a=s+r;return Ie(e,{description:t.name,endTimestamp:a,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s}),s}function ll(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{ut(e,t,r,n)}),ut(e,t,"secureConnection",n,"TLS/SSL","connectEnd"),ut(e,t,"fetch",n,"cache","domainLookupStart"),ut(e,t,"domainLookup",n,"DNS"),ul(e,t,n)}function ut(e,t,n,r,i,s){let a=s?t[s]:t[`${n}End`],o=t[`${n}Start`];!o||!a||Ie(e,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+$(o),endTimestamp:r+$(a)})}function ul(e,t,n){Ie(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+$(t.requestStart),endTimestamp:n+$(t.responseEnd)}),Ie(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+$(t.responseStart),endTimestamp:n+$(t.responseEnd)})}function dl(e,t,n,r,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+r,l=o+i;Ie(e,{description:n,endTimestamp:l,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:o,data:a})}function hl(e){let t=C.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),Ht(n.rtt)&&(B["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Ht(t.deviceMemory)&&e.setTag("deviceMemory",`${t.deviceMemory} GB`),Ht(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}function pl(e){Z&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding LCP Data"),Z.element&&e.setTag("lcp.element",ke(Z.element)),Z.id&&e.setTag("lcp.id",Z.id),Z.url&&e.setTag("lcp.url",Z.url.trim().slice(0,200)),e.setTag("lcp.size",Z.size)),Ae&&Ae.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log("[Measurements] Adding CLS Data"),Ae.sources.forEach((t,n)=>e.setTag(`cls.source.${n+1}`,ke(t.node))))}var un=["localhost",/^\/(?!\/)/],dn={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:un,tracePropagationTargets:un};function fl(e){let{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:s,enableHTTPTimings:a}=f({traceFetch:dn.traceFetch,traceXHR:dn.traceXHR},e),o=typeof s=="function"?s:u=>!0,l=u=>yl(u,r||i),d={};t&&W("fetch",u=>{let h=vl(u,o,l,d);a&&h&&_r(h)}),n&&W("xhr",u=>{let h=El(u,o,l,d);a&&h&&_r(h)})}function _l(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function _r(e){let t=e.data.url,n=new PerformanceObserver(r=>{r.getEntries().forEach(i=>{_l(i)&&i.name.endsWith(t)&&(gl(i).forEach(s=>e.setData(...s)),n.disconnect())})});n.observe({entryTypes:["resource"]})}function ml(e){let t="unknown",n="unknown",r="";for(let i of e){if(i==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function J(e=0){return((ee||performance.timeOrigin)+e)/1e3}function gl(e){let{name:t,version:n}=ml(e.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",t]),ee?[...r,["http.request.redirect_start",J(e.redirectStart)],["http.request.fetch_start",J(e.fetchStart)],["http.request.domain_lookup_start",J(e.domainLookupStart)],["http.request.domain_lookup_end",J(e.domainLookupEnd)],["http.request.connect_start",J(e.connectStart)],["http.request.secure_connection_start",J(e.secureConnectionStart)],["http.request.connection_end",J(e.connectEnd)],["http.request.request_start",J(e.requestStart)],["http.request.response_start",J(e.responseStart)],["http.request.response_end",J(e.responseEnd)]]:r}function yl(e,t){return He(e,t||un)}function vl(e,t,n,r){if(!Sn()||!e.fetchData)return;let i=t(e.fetchData.url);if(e.endTimestamp&&i){let p=e.fetchData.__span;if(!p)return;let _=r[p];if(_){if(e.response){_.setHttpStatus(e.response.status);let g=e.response&&e.response.headers&&e.response.headers.get("content-length"),E=parseInt(g);E>0&&_.setData("http.response_content_length",E)}else e.error&&_.setStatus("internal_error");_.finish(),delete r[p]}return}let s=G(),a=s.getScope(),o=s.getClient(),l=a.getSpan(),{method:d,url:u}=e.fetchData,h=i&&l?l.startChild({data:{url:u,type:"fetch","http.method":d},description:`${d} ${u}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(h&&(e.fetchData.__span=h.spanId,r[h.spanId]=h),n(e.fetchData.url)&&o){let p=e.args[0];e.args[1]=e.args[1]||{};let _=e.args[1];_.headers=xl(p,o,a,_,h)}return h}function xl(e,t,n,r,i){let s=i||n.getSpan(),a=s&&s.transaction,{traceId:o,sampled:l,dsc:d}=n.getPropagationContext(),u=s?s.toTraceparent():vn(o,void 0,l),h=a?a.getDynamicSamplingContext():d||Ct(o,t,n),p=rn(h),_=typeof Request<"u"&&oe(e,Request)?e.headers:r.headers;if(_)if(typeof Headers<"u"&&oe(_,Headers)){let g=new Headers(_);return g.append("sentry-trace",u),p&&g.append(nn,p),g}else if(Array.isArray(_)){let g=[..._,["sentry-trace",u]];return p&&g.push([nn,p]),g}else{let g="baggage"in _?_.baggage:void 0,E=[];return Array.isArray(g)?E.push(...g):g&&E.push(g),p&&E.push(p),N(f({},_),{"sentry-trace":u,baggage:E.length>0?E.join(","):void 0})}else return{"sentry-trace":u,baggage:p}}function El(e,t,n,r){let i=e.xhr,s=i&&i[we];if(!Sn()||i&&i.__sentry_own_request__||!i||!s)return;let a=t(s.url);if(e.endTimestamp&&a){let h=i.__sentry_xhr_span_id__;if(!h)return;let p=r[h];p&&(p.setHttpStatus(s.status_code),p.finish(),delete r[h]);return}let o=G(),l=o.getScope(),d=l.getSpan(),u=a&&d?d.startChild({data:N(f({},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(u&&(i.__sentry_xhr_span_id__=u.spanId,r[i.__sentry_xhr_span_id__]=u),i.setRequestHeader&&n(s.url))if(u){let h=u&&u.transaction,p=h&&h.getDynamicSamplingContext(),_=rn(p);mr(i,u.toTraceparent(),_)}else{let h=o.getClient(),{traceId:p,sampled:_,dsc:g}=l.getPropagationContext(),E=vn(p,void 0,_),v=g||(h?Ct(p,h,l):void 0),w=rn(v);mr(i,E,w)}return u}function mr(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(nn,n)}catch{}}function bl(e,t=!0,n=!0){if(!C||!C.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("Could not initialize routing instrumentation due to invalid location");return}let r=C.location.href,i;t&&(i=e({name:C.location.pathname,startTimestamp:ee?ee/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&W("history",({to:s,from:a})=>{if(a===void 0&&r&&r.indexOf(s)!==-1){r=void 0;return}a!==s&&(r=void 0,i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.finish()),i=e({name:C.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}var Sl="BrowserTracing",Tl=f(N(f({},_t),{markBackgroundTransactions:!0,routingInstrumentation:bl,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{}}),dn),wl=class{constructor(e){this.name=Sl,this._hasSetTracePropagationTargets=!1,fo(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options=f(f({},Tl),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=tl(),this.options.enableLongTask&&nl(),this.options._experiments.enableInteractions&&rl()}setupOnce(e,t){this._getCurrentHub=t;let n=t().getClient(),r=n&&n.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:s,startTransactionOnPageLoad:a,markBackgroundTransactions:o,traceFetch:l,traceXHR:d,shouldCreateSpanForRequest:u,enableHTTPTimings:h,_experiments:p}=this.options,_=r&&r.tracePropagationTargets,g=_||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&_&&y.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(E=>{let v=this._createRouteTransaction(E);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(v,E,t),v},a,s),o&&zc(),p.enableInteractions&&this._registerInteractionListener(),fl({traceFetch:l,traceXHR:d,tracePropagationTargets:g,shouldCreateSpanForRequest:u,enableHTTPTimings:h})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let t=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:s}=this.options,a=e.op==="pageload",o=a?gr("sentry-trace"):"",l=a?gr("baggage"):"",{traceparentData:d,dynamicSamplingContext:u,propagationContext:h}=La(o,l),p=N(f(f({},e),d),{metadata:N(f({},e.metadata),{dynamicSamplingContext:d&&!u?{}:u}),trimEnd:!0}),_=typeof n=="function"?n(p):p,g=_===void 0?N(f({},p),{sampled:!1}):_;g.metadata=g.name!==p.name?N(f({},g.metadata),{source:"custom"}):g.metadata,this._latestRouteName=g.name,this._latestRouteSource=g.metadata&&g.metadata.source,g.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] Will not send ${g.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.log(`[Tracing] Starting ${g.op} transaction on scope`);let{location:E}=C,v=rr(t,g,r,i,!0,{location:E},s),w=t.getScope();return a&&d?w.setPropagationContext(h):w.setPropagationContext({traceId:v.traceId,spanId:v.spanId,parentSpanId:v.parentSpanId,sampled:v.sampled}),v.registerBeforeFinishCallback(b=>{this._collectWebVitals(),ol(b)}),v}_registerInteractionListener(){let e,t=()=>{let{idleTimeout:n,finalTimeout:r,heartbeatInterval:i}=this.options,s="ui.action.click",a=ze();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.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__)&&y.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`);return}let o=this._getCurrentHub(),{location:l}=C,d={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=rr(o,d,n,r,!0,{location:l},i)};["click"].forEach(n=>{addEventListener(n,t,{once:!1,capture:!0})})}};function gr(e){let t=Fs(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}var bi={};I.Sentry&&I.Sentry.Integrations&&(bi=I.Sentry.Integrations);f(f(f({},bi),li),yi);var Rl="https://d233059272824702afc8c43834c4912d@sentry.hcaptcha.com/6",dt=null;function Si(e,t){if(e===!1)return qt(e);if(dt)return qt(dt,t);let n=new ic({dsn:Rl,transport:window.fetch?oc:lc,stackParser:wc,integrations:[new It,new $e,new Ut,new Ot,new Bt,new wl]});return dt=new bn(n),qt(dt,t)}function qt(e,t={key:"source",value:"@hCaptcha/loader"}){return{addBreadcrumb:n=>{e&&e.addBreadcrumb(n)},captureMessage:n=>{e&&e.withScope(function(r){r.setTag(t.key,t.value),e.captureMessage(n)})},captureException:n=>{e&&e.withScope(function(r){r.setTag(t.key,t.value),e.captureEvent({message:Vt,level:"error",extra:n})})}}}function jl({scriptLocation:e,query:t,loadAsync:n=!0,crossOrigin:r,apihost:i="https://js.hcaptcha.com",cleanup:s=!0,secureApi:a=!1,scriptSource:o=""}={}){let l=$r(e),d=Or(l);return new Promise((u,h)=>{let p=d.document.createElement("script");p.id=Bs,o?p.src=`${o}?onload=${pt}`:a?p.src=`${i}/1/secure-api.js?onload=${pt}`:p.src=`${i}/1/api.js?onload=${pt}`,p.crossOrigin=r,p.async=n;let _=(g,E)=>{try{!a&&s&&l.removeChild(p),E(g)}catch(v){h(v)}};p.onload=g=>_(g,u),p.onerror=g=>_(g,h),p.src+=t!==""?`&${t}`:"",l.appendChild(p)})}var ht=[];function Nl(e={cleanup:!0},t){try{t.addBreadcrumb({category:Te,message:"hCaptcha loader params",data:e});let n=$r(e.scriptLocation),r=Or(n),i=ht.find(({scope:a})=>a===r.window);if(i)return t.addBreadcrumb({category:Te,message:"hCaptcha already loaded"}),i.promise;let s=new Promise((a,o)=>pn(this,null,function*(){try{r.window[pt]=()=>{t.addBreadcrumb({category:Te,message:"hCaptcha script called onload function"}),a(r.window.hcaptcha)};let l=Us({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 jl(f({query:l},e)),t.addBreadcrumb({category:Te,message:"hCaptcha loaded",data:i})}catch(l){t.addBreadcrumb({category:Te,message:"hCaptcha failed to load",data:l});let d=ht.findIndex(u=>u.scope===r.window);d!==-1&&ht.splice(d,1),t.captureException(l),o(new Error(Vt))}}));return ht.push({promise:s,scope:r.window}),s}catch(n){return t.captureException(n),Promise.reject(new Error(Vt))}}function Ti(e,t=0){return pn(this,null,function*(){let n=t<2?"Retry loading hCaptcha Api":"Exceeded maximum retries",r=Si(e.sentry);try{return yield Nl(e,r)}catch(i){return r.addBreadcrumb({SENTRY_SOURCE:Te,message:n,data:{error:i}}),t>=2?(r.captureException(i),Promise.reject(i)):(t+=1,Ti(e,t))}})}function kl(){return pn(this,arguments,function*(e={}){return yield Ti(e)})}function yr(e){var t=e&&e.ownerDocument||document,n=t.defaultView||t.parentWindow||window;return{document:t,window:n}}function vr(e){return e||document.head}var Se={key:"source",value:"@hCaptcha/react"},Ge={mounted:"hCaptcha component mounted",expired:"hCaptcha expired",unmounted:"hCaptcha component unmounted",reset:"hCaptcha reset",removed:"hCaptcha removed"},Cl=function(e){ks(t,e);function t(r){var i;return i=e.call(this,r)||this,i._hcaptcha=void 0,i.renderCaptcha=i.renderCaptcha.bind(V(i)),i.resetCaptcha=i.resetCaptcha.bind(V(i)),i.removeCaptcha=i.removeCaptcha.bind(V(i)),i.isReady=i.isReady.bind(V(i)),i._onReady=null,i.loadCaptcha=i.loadCaptcha.bind(V(i)),i.handleOnLoad=i.handleOnLoad.bind(V(i)),i.handleSubmit=i.handleSubmit.bind(V(i)),i.handleExpire=i.handleExpire.bind(V(i)),i.handleError=i.handleError.bind(V(i)),i.handleOpen=i.handleOpen.bind(V(i)),i.handleClose=i.handleClose.bind(V(i)),i.handleChallengeExpired=i.handleChallengeExpired.bind(V(i)),i.ref=m.createRef(),i.apiScriptRequested=!1,i.sentryHub=null,i.captchaId="",i.state={isApiReady:!1,isRemoved:!1,elementId:r.id},i}var n=t.prototype;return n.componentDidMount=function(){var i=this,s=vr(this.props.scriptLocation),a=yr(s);this._hcaptcha=a.window.hcaptcha||void 0;var o=typeof this._hcaptcha<"u";if(this.sentryHub=Si(this.props.sentry,Se),this.sentryHub.addBreadcrumb({category:Se.value,message:Ge.mounted}),o){this.setState({isApiReady:!0},function(){i.renderCaptcha()});return}this.loadCaptcha()},n.componentWillUnmount=function(){var i=this._hcaptcha,s=this.captchaId;this.isReady()&&(i.reset(s),i.remove(s),this.sentryHub.addBreadcrumb({category:Se.value,message:Ge.unmounted}))},n.shouldComponentUpdate=function(i,s){return!(this.state.isApiReady!==s.isApiReady||this.state.isRemoved!==s.isRemoved)},n.componentDidUpdate=function(i){var s=this,a=["sitekey","size","theme","tabindex","languageOverride","endpoint"],o=a.every(function(l){return i[l]===s.props[l]});o||this.removeCaptcha(function(){s.renderCaptcha()})},n.loadCaptcha=function(){if(!this.apiScriptRequested){var i=this.props,s=i.apihost,a=i.assethost,o=i.endpoint,l=i.host,d=i.imghost,u=i.languageOverride,h=i.reCaptchaCompat,p=i.reportapi,_=i.sentry,g=i.custom,E=i.loadAsync,v=i.scriptLocation,w=i.scriptSource,b=i.secureApi,S=i.cleanup,T=S===void 0?!0:S,R={render:"explicit",apihost:s,assethost:a,endpoint:o,hl:u,host:l,imghost:d,recaptchacompat:h===!1?"off":null,reportapi:p,sentry:_,custom:g,loadAsync:E,scriptLocation:v,scriptSource:w,secureApi:b,cleanup:T};kl(R).then(this.handleOnLoad,this.handleError).catch(this.handleError),this.apiScriptRequested=!0}},n.renderCaptcha=function(i){var s=this,a=this.props.onReady,o=this.state.isApiReady,l=this.captchaId;if(!(!o||l)){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}),u=this._hcaptcha,h=u.render(this.ref.current,d);this.captchaId=h,this.setState({isRemoved:!1},function(){i&&i(),a&&a(),s._onReady&&s._onReady(h)})}},n.resetCaptcha=function(){var i=this._hcaptcha,s=this.captchaId;this.isReady()&&(i.reset(s),this.sentryHub.addBreadcrumb({category:Se.value,message:Ge.reset}))},n.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:Se.value,message:Ge.removed}))},n.handleOnLoad=function(){var i=this;this.setState({isApiReady:!0},function(){try{var s=vr(i.props.scriptLocation),a=yr(s);i._hcaptcha=a.window.hcaptcha,i.renderCaptcha(function(){var o=i.props.onLoad;o&&o()})}catch(o){i.sentryHub.captureException(o)}})},n.handleSubmit=function(i){var s=this.props.onVerify,a=this.state.isRemoved,o=this._hcaptcha,l=this.captchaId;if(!(typeof o>"u"||a)){var d=o.getResponse(l),u=o.getRespKey(l);s&&s(d,u)}},n.handleExpire=function(){var i=this.props.onExpire,s=this._hcaptcha,a=this.captchaId;this.isReady()&&(s.reset(a),i&&i(),this.sentryHub.addBreadcrumb({category:Se.value,message:Ge.expired}))},n.handleError=function(i){var s=this.props.onError,a=this._hcaptcha,o=this.captchaId;this.isReady()&&a.reset(o),s&&s(i)},n.isReady=function(){var i=this.state,s=i.isApiReady,a=i.isRemoved;return s&&!a},n.handleOpen=function(){!this.isReady()||!this.props.onOpen||this.props.onOpen()},n.handleClose=function(){!this.isReady()||!this.props.onClose||this.props.onClose()},n.handleChallengeExpired=function(){!this.isReady()||!this.props.onChalExpired||this.props.onChalExpired()},n.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 l,d=new Promise(function(u,h){s._onReady=function(p){try{var _=s._hcaptcha;i&&i.async?_.execute(p,i).then(u).catch(h):u(_.execute(p,i))}catch(g){h(g)}}});return(l=i)!=null&&l.async?d:null}return a.execute(o,i)}catch(u){return this.sentryHub.captureException(u),i&&i.async?Promise.reject(u):null}},n.close=function(){var i=this._hcaptcha,s=this.captchaId;if(this.isReady())return i.close(s)},n.setData=function(i){var s=this._hcaptcha,a=this.captchaId;this.isReady()&&(i&&typeof i!="object"&&(i=null),s.setData(a,i))},n.getResponse=function(){var i=this._hcaptcha;return i.getResponse(this.captchaId)},n.getRespKey=function(){var i=this._hcaptcha;return i.getRespKey(this.captchaId)},n.render=function(){var i=this.state.elementId;return m.createElement("div",{ref:this.ref,id:i})},t}(m.Component);const me=typeof window>"u"?null:window.matchMedia("(prefers-color-scheme: dark)");function Dl(){const[e,t]=m.useState(me!=null&&me.matches?"dark":"light");return m.useEffect(()=>{if(!me)return;const n=()=>{t(me.matches?"dark":"light")};return me.addEventListener("change",n),()=>{me.removeEventListener("change",n)}},[]),e}function Il({siteKey:e,token:t,onToken:n,prevLabel:r,onPrev:i,nextLabel:s,onNext:a,ref:o,invalid:l,children:d,...u}){const h=m.useRef(null),p=Dl(),[_,g]=m.useState(t),E=m.useCallback(()=>{var b;(b=h.current)==null||b.execute()},[]),v=m.useCallback((b,S)=>{g(b),n(b,S)},[n]),w=m.useCallback(b=>{if(_)return a(b);if(h.current)h.current.execute();else throw new Error("Unable to load hCaptcha")},[_,a]);return c.jsx(Ue,{...u,cancelLabel:r,onCancel:i,submitLabel:s,onSubmit:w,append:d,invalid:l||!_,children:c.jsx(Cl,{theme:p,sitekey:e,onLoad:E,onVerify:v,ref:fe([o,h])})})}function Ul({customizationData:{availableUserDomains:e=[],hcaptchaSiteKey:t=void 0,inviteCodeRequired:n=!0,links:r}={},onValidateNewHandle:i,onDone:s,onBack:a,...o}){const{i18n:l,_:d}=O(),[u,h]=m.useState(void 0),[p,_]=m.useState(void 0),[g,E]=m.useState(void 0),v=t==null?void 0:g||!1,w=m.useCallback(b=>{if(u&&p&&v!==!1)return s({...u,handle:p,hcaptchaToken:v},b)},[u,p,v,s]);return c.jsxs(X,{...o,title:o.title??l._({id:"IS0nrP"}),subtitle:o.subtitle??c.jsx(x,{id:"qjBGxf"}),children:[c.jsx(bs,{doneLabel:c.jsx(x,{id:"e+RpCP"}),onBack:a,onDone:w,steps:[{invalid:!p,titleRender:()=>c.jsx(x,{id:"khEQ02"}),contentRender:({prev:b,prevLabel:S,next:T,nextLabel:R,invalid:k})=>c.jsx(Ns,{className:"grow",invalid:k,domains:e,handle:p,onHandle:_,prevLabel:S,onPrev:b,nextLabel:R,onNext:async D=>{if(p&&await i({handle:p},D),!D.aborted)return T(D)},children:c.jsx(Gt,{links:r})})},{invalid:!u,titleRender:()=>c.jsx(x,{id:"gdRnT7"}),contentRender:({prev:b,prevLabel:S,next:T,nextLabel:R,invalid:k})=>c.jsx(Ts,{className:"grow",invalid:k,prevLabel:S,onPrev:b,nextLabel:R,onNext:T,inviteCodeRequired:n,credentials:u,onCredentials:h,children:c.jsx(Gt,{links:r})})},t!=null&&{invalid:v===!1,titleRender:()=>c.jsx(x,{id:"aIar4b"}),contentRender:({prev:b,prevLabel:S,next:T,nextLabel:R,invalid:k})=>c.jsx(Il,{className:"grow",invalid:k,siteKey:t,token:g,onToken:E,prevLabel:S,onPrev:b,nextLabel:R,onNext:T,children:c.jsx(Gt,{links:r})})}]}),c.jsx(Ss,{className:"mt-4",links:r})]})}function Bl({onSignUp:e,onSignIn:t,onCancel:n,...r}){const{i18n:i,_:s}=O();return c.jsxs(Pi,{...r,title:r.title??i._({id:"OX6vme"}),children:[e&&c.jsx(F,{className:"m-1 w-60 min-w-min max-w-full",color:t?"primary":void 0,onClick:e,children:c.jsx(x,{id:"mpt9T+"})}),t&&c.jsx(F,{className:"m-1 w-60 min-w-min max-w-full",color:e?void 0:"primary",onClick:t,children:c.jsx(x,{id:"5lWFkC"})}),n&&c.jsx(F,{className:"m-1 w-60 min-w-min max-w-full",onClick:n,children:c.jsx(x,{id:"dEgA5A"})})]})}function Ol({authorizeData:e,sessions:t,customizationData:n,...r}){var Xe;const{i18n:i,_:s}=O(),a=(e==null?void 0:e.loginHint)!=null,o=a?2:0,[l,d]=m.useState(o),u=Ee(d,5),h=Ee(d,2),p=Ee(d,3),_=Ee(d,1),g=Ee(d,4),E=Ee(d,0),[v,w]=m.useState(void 0),{sessions:b,selectSub:S,doValidateNewHandle:T,doSignUp:R,doSignIn:k,doInitiatePasswordReset:D,doConfirmResetPassword:q,doAccept:P,doReject:ce}=Xi({sessions:t,onRedirected:u}),j=b.find(Ke=>Ke.selected&&!Ke.loginRequired);m.useEffect(()=>{j&&(j.consentRequired?g():P(j.account.sub))},[j,P,g]);const U=!!((Xe=n==null?void 0:n.availableUserDomains)!=null&&Xe.length)&&!e.loginHint,te=l===1&&!U||l===4&&!j;if(m.useEffect(()=>{te&&E()},[te,E]),l===0)return c.jsx(Bl,{...r,customizationData:n,onSignIn:h,onSignUp:U?_:void 0,onCancel:()=>ce()});if(l===1)return c.jsx(Ul,{...r,customizationData:n,onValidateNewHandle:T,onBack:E,onDone:R});if(l===3)return c.jsx(fs,{...r,emailDefault:v,onresetPasswordRequest:D,onResetPasswordConfirm:q,onBack:a?h:E});if(l===2)return c.jsx(ys,{...r,loginHint:e.loginHint,sessions:b,selectSub:S,onSignIn:k,onBack:a?()=>ce():E,onForgotPassword:Ke=>{p(),w(Ke)}});if(l===4)return j?c.jsx(ns,{...r,clientId:e.clientId,clientMetadata:e.clientMetadata,clientTrusted:e.clientTrusted,account:j.account,scopeDetails:e.scopeDetails,onAccept:()=>P(j.account.sub),onReject:()=>ce(),onBack:a?void 0:()=>{S(null),d(b.length?2:0)}}):null;if(l===5)return c.jsx(X,{...r,title:r.title??i._({id:"UCOd1e"}),children:c.jsx(x,{id:"qq6QQ5"})});throw new Error("Unexpected application state")}const{__authorizeData:bt,__sessions:$l,__customizationData:xr}=window,ge=new URL(window.location.href);ge.pathname==="/oauth/authorize"&&!ge.searchParams.has("request_uri")&&(ge.search="",ge.searchParams.set("client_id",bt.clientId),ge.searchParams.set("request_uri",bt.requestUri),window.history.replaceState(history.state,"",ge.pathname+ge.search));const Yl=document.getElementById("root");var Er;Ai.createRoot(Yl).render(c.jsx(m.StrictMode,{children:c.jsx(Mi,{userLocales:(Er=bt.uiLocales)==null?void 0:Er.split(" "),children:c.jsx(qi,{fallbackRender:({error:e})=>c.jsx(Hi,{error:e,customizationData:xr}),children:c.jsx(Ol,{customizationData:xr,authorizeData:bt,sessions:$l})})})}))});export default Gl();
|
|
20
|
+
//# sourceMappingURL=authorization-page-CsvVyEAt.js.map
|