@atlasauth/embed 0.13.0 → 0.15.0

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/embed.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";(()=>{var $s=Object.create;var Nt=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var zs=Object.getOwnPropertyNames;var Bs=Object.getPrototypeOf,Hs=Object.prototype.hasOwnProperty;var js=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ws=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zs(t))!Hs.call(e,o)&&o!==n&&Nt(e,o,{get:()=>t[o],enumerable:!(r=Ns(t,o))||r.enumerable});return e};var Ks=(e,t,n)=>(n=e!=null?$s(Bs(e)):{},Ws(t||!e||!e.__esModule?Nt(n,"default",{value:e,enumerable:!0}):n,e));var k=(e,t,n)=>js(e,typeof t!="symbol"?t+"":t,n);var Yo=zt(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.ForbiddenError=void 0;pe.evaluate=On;pe.hasFromClaims=Cl;pe.protectFromClaims=Al;function Sl(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function On(e,t={}){var o,i,s,l;if(!e)return{allowed:!1,reason:"signed_out"};if(t.plan!==void 0&&e.pla!==t.plan)return{allowed:!1,reason:"missing_entitlement"};if(t.feature!==void 0&&!((o=e.fea)!=null?o:[]).includes(t.feature))return{allowed:!1,reason:"missing_entitlement"};let n=new Set((i=e.app_permissions)!=null?i:[]);if(t.appRole!==void 0&&!((s=e.app_roles)!=null?s:[]).includes(t.appRole))return{allowed:!1,reason:"missing_permission"};if(t.appPermission!==void 0&&!n.has(t.appPermission))return{allowed:!1,reason:"missing_permission"};if(t.anyAppPermission&&!t.anyAppPermission.some(a=>n.has(a)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(a=>n.has(a)))return{allowed:!1,reason:"missing_permission"};if(!Sl(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((l=e.org_permissions)!=null?l:[]);return t.role!==void 0&&e.org_role!==t.role?{allowed:!1,reason:"missing_permission"}:t.permission!==void 0&&!r.has(t.permission)?{allowed:!1,reason:"missing_permission"}:t.anyPermission&&!t.anyPermission.some(a=>r.has(a))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(a=>r.has(a))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function Cl(e,t={}){return On(e,t).allowed}var at=class extends Error{constructor(n,r){super(n==="signed_out"?"Not signed in.":n==="no_organization"?"No active organization for this authorization check.":n==="missing_entitlement"?"Missing the required plan or feature.":"Missing the required permission or role.");k(this,"reason");k(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};pe.ForbiddenError=at;function Al(e,t={}){let n=On(e,t);if(!n.allowed)throw new at(n.reason,t)}});var Jo=zt(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.PERMISSION_KEY_PATTERN=Y.ROLE_KEY_PATTERN=void 0;Y.isRoleKey=El;Y.isPermissionKey=Pl;Y.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;Y.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function El(e){return Y.ROLE_KEY_PATTERN.test(e)}function Pl(e){return Y.PERMISSION_KEY_PATTERN.test(e)}});var Zo=zt(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.isPermissionKey=N.isRoleKey=N.PERMISSION_KEY_PATTERN=N.ROLE_KEY_PATTERN=N.ForbiddenError=N.protectFromClaims=N.hasFromClaims=N.evaluate=void 0;var lt=Yo();Object.defineProperty(N,"evaluate",{enumerable:!0,get:function(){return lt.evaluate}});Object.defineProperty(N,"hasFromClaims",{enumerable:!0,get:function(){return lt.hasFromClaims}});Object.defineProperty(N,"protectFromClaims",{enumerable:!0,get:function(){return lt.protectFromClaims}});Object.defineProperty(N,"ForbiddenError",{enumerable:!0,get:function(){return lt.ForbiddenError}});var ct=Jo();Object.defineProperty(N,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return ct.ROLE_KEY_PATTERN}});Object.defineProperty(N,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return ct.PERMISSION_KEY_PATTERN}});Object.defineProperty(N,"isRoleKey",{enumerable:!0,get:function(){return ct.isRoleKey}});Object.defineProperty(N,"isPermissionKey",{enumerable:!0,get:function(){return ct.isPermissionKey}})});var Dc=30*24*60*60*1e3;function pr(e){if(typeof BroadcastChannel=="undefined")return null;let t=new BroadcastChannel(e);return{post:n=>t.postMessage(n),subscribe(n){let r=o=>n(o.data);return t.addEventListener("message",r),()=>t.removeEventListener("message",r)},close:()=>t.close()}}function fr(e){if(typeof window=="undefined"||typeof window.localStorage=="undefined")return null;let t=`atlas:${e}`;return{post(n){try{window.localStorage.setItem(t,JSON.stringify({message:n,at:Date.now()})),window.localStorage.removeItem(t)}catch{}},subscribe(n){let r=o=>{if(!(o.key!==t||!o.newValue))try{n(JSON.parse(o.newValue).message)}catch{}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},close:()=>{}}}function z(e){var t,n,r;switch(e.status){case"needs_identifier":return{kind:"collect_identifier"};case"needs_first_factor":return{kind:"collect_first_factor",strategies:(t=e.supported_first_factors)!=null?t:[]};case"needs_second_factor":return{kind:"collect_second_factor"};case"needs_mfa_enrollment":return{kind:"enroll_second_factor"};case"needs_email_verification":return{kind:"collect_email_code"};case"needs_captcha":return{kind:"collect_captcha"};case"needs_oauth_callback":return{kind:"await_oauth"};case"needs_new_password":return{kind:"collect_new_password"};case"needs_policy_acceptance":return{kind:"accept_policies",policies:(n=e.pending_policies)!=null?n:[]};case"complete":return{kind:"done",sessionId:(r=e.created_session_id)!=null?r:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function gr(e){return e.status==="complete"||e.status==="abandoned"}function mr(e){if(!e||typeof e!="object")return[];let t=e.errors;return Array.isArray(t)?t.filter(n=>!!n&&typeof n.message=="string").map(n=>{let r={code:n.code,message:n.message,param:n.param},o=n.reason;typeof o=="string"&&o!==""&&(r.reason=o);let i=n.meta;return i&&typeof i=="object"&&!Array.isArray(i)&&(r.meta=i),r}):[]}function Ge(e){var r;let t=["email_code","email_link"].filter(o=>e.includes(o)),n=e.includes("password");return{password:n,email:t,autoSend:n?null:(r=t[0])!=null?r:null}}var rd=Object.freeze(["form_password_incorrect","form_code_incorrect","form_code_already_used","form_code_expired","form_code_max_attempts","form_link_invalid","form_identifier_not_found","form_identifier_exists","form_password_pwned","form_password_too_short","form_password_too_long","form_password_requires_uppercase","form_password_requires_lowercase","form_password_requires_number","form_password_requires_symbol","form_password_not_allowed","form_password_contains_identifier","form_password_same_as_current","form_password_reused","password_expired","email_not_verified","sign_in_token_invalid","too_many_attempts","too_many_requests","captcha_required","captcha_failed","captcha_unavailable","email_delivery_unavailable","strategy_disabled","sign_up_restricted","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked"]);function qs(e){return`error.${e}`}var Vs="Something went wrong. Please try again.",Gs=/^[a-z][a-z0-9_]{0,63}$/;function Ys(e,t){let n=!0,r=e.replace(/\{(\w+)\}/g,(o,i)=>{let s=t&&Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;return typeof s=="string"&&s!==""?s:typeof s=="number"&&Number.isFinite(s)?String(s):(n=!1,o)});return n?r:null}function Bt(e,t){if(!e)return null;let n;if(typeof e=="function"?n=e(t):n=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,typeof n!="string")return null;let r=n.trim();return r===""||r===t?null:n}function hr(e,t,n){var i,s;let r=typeof e=="string"?{message:e}:e!=null?e:{},o=typeof r.reason=="string"?r.reason:"";if(o&&Gs.test(o)){let l=Bt(t,qs(o)),a=l?Ys(l,r.meta):null;if(a)return a}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(i=Bt(t,"error.generic"))!=null?i:Bt(n,"error.generic"))!=null?s:Vs}function yr(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Ht="atlas:oauth",Js="atlas_popup_result",br="atlas:oauth";function Zs(e){return`${br}:${e}`}function kr(){let e=new Uint8Array(16),t=globalThis.crypto;if(t!=null&&t.getRandomValues)t.getRandomValues(e);else for(let r=0;r<e.length;r++)e[r]=Math.floor(Math.random()*256);let n="";for(let r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Xs(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id!="string"?!1:t.type==="atlas:oauth:result"?!!t.result&&typeof t.result=="object":t.type==="atlas:oauth:signed_in"||t.type==="atlas:oauth:ack"}function Qs(e){var t;try{return(t=pr(e))!=null?t:fr(e)}catch{return null}}function vr(e,t,n){let r=Qs(e);if(!r)return Promise.resolve(!1);let o=kr();return new Promise(i=>{let s=!1,l=c=>{s||(s=!0,clearTimeout(d),a(),r.close(),i(c))},a=r.subscribe(c=>{Xs(c)&&c.type==="atlas:oauth:ack"&&c.id===o&&l(!0)}),d=setTimeout(()=>l(!1),n);try{r.post({...t,id:o})}catch{l(!1)}})}function ea(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(Js);if(!t)return null;try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(n+"=".repeat((4-n.length%4)%4)),o=Uint8Array.from(r,l=>l.charCodeAt(0)),i=JSON.parse(new TextDecoder().decode(o));if(!i||typeof i!="object")return null;let s=i;return s.v!==1||typeof s.n!="string"||!s.n||typeof s.type!="string"||!s.type.startsWith("atlas:oauth:")?null:{nonce:s.n,payload:s}}catch{return null}}async function _r(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=ea(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Ht}catch{}let r=await vr(Zs(n.nonce),{type:"atlas:oauth:result",result:n.payload},(i=e.ackTimeoutMs)!=null?i:1500);return r&&wr(t),{payload:n.payload,delivered:r}}async function xr(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Ht)return!1;let n=await vr(br,{type:"atlas:oauth:signed_in"},(i=e.ackTimeoutMs)!=null?i:1500),r=!1;try{r=!!t.opener&&!t.opener.closed}catch{r=!1}return!n&&!r?!1:(wr(t),!0)}function wr(e){try{e.close()}catch{}}var ta=["__atlas_attempt","__atlas_ticket","__atlas_status","__atlas_policy_token"];function Sr(e){var r;if(!e||typeof e!="object")return null;let t=e,n=o=>typeof o=="string"?o:void 0;switch(t.type){case"atlas:oauth:complete":return{ticket:n(t.ticket),attemptId:n(t.attemptId)};case"atlas:oauth:error":return{error:(r=n(t.code))!=null?r:"error",continuationUrl:n(t.continuationUrl)};case"atlas:oauth:continue":return{status:n(t.status),attemptId:n(t.attemptId),continuationUrl:n(t.continuationUrl),...n(t.policyToken)?{policyToken:n(t.policyToken)}:{}};default:return null}}var cd=5*6e4;function Cr(e){let t=new URLSearchParams(e),n=t.get("__atlas_attempt");if(!n)return null;let r=t.get("__atlas_ticket"),o=t.get("__atlas_status");if(!r&&!o)return null;let i=t.get("__atlas_policy_token");return{attemptId:n,...r?{ticket:r}:{},...o?{status:o}:{},...o==="needs_policy_acceptance"&&i?{policyToken:i}:{}}}function Ye(e){let t=new URL(e);for(let n of ta)t.searchParams.delete(n);return t.toString()}async function Ar(e,t={}){let n=t.locale?`?locale=${encodeURIComponent(t.locale)}`:"",r=await e.request(`/v1/client/policies${n}`,{method:"GET"});return r.ok&&r.data?{ok:!0,data:r.data}:{ok:!1,errors:r.errors}}function Er(e,t){var o;let n=typeof((o=e.attempt)==null?void 0:o.policy_acceptance_token)=="string"?e.attempt.policy_acceptance_token:null,r=e.policyToken||n;return{policy_acceptances:t,...r?{policy_acceptance_token:r}:e.pollSecret?{poll_secret:e.pollSecret}:{}}}var Pr="0.21.0";var Tr={name:"@atlasauth/js",version:Pr},Ir="x-atlas-sdk",na="atlas-sdk-advisory";function Or(e){return`${e.name}/${e.version}`}function ra(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(i=>i.trim()),o=i=>{var s,l;return(l=(s=r.find(a=>a.startsWith(`${i}=`)))==null?void 0:s.slice(i.length+1))!=null?l:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var Rr=new Set;function Lr(e,t,n=oa){var i,s,l,a,d;let r=null;try{r=(l=(s=(i=e==null?void 0:e.headers)==null?void 0:i.get)==null?void 0:s.call(i,na))!=null?l:null}catch{return[]}let o=[];for(let c of ra(r)){let u=`${t.name}|${(a=c.reason)!=null?a:""}|${(d=c.min)!=null?d:""}`;Rr.has(u)||(Rr.add(u),o.push(c),n(`[Atlas] ${t.name} ${t.version} has a known problem${c.reason?` (${c.reason})`:""}${c.min?` fixed in ${c.min}. Upgrade ${t.name} to ${c.min} or later`:". Upgrade it"} \u2014 with a 0.x version a caret range does not move past your lockfile on its own. Details: https://atlasauth.net/v1/sdk_advisories/${encodeURIComponent(t.name)}`))}return o}function oa(e){typeof console!="undefined"&&console.warn(e)}var ye="__atlas_dev_session:",Dr="/v1/client/tickets/exchange",Fr="/v1/client",Mr=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,ia=/^\/v1\/client\/sessions\/[^/]+\/revoke$/;function de(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}function zr(e){return e.startsWith("pk_test_")&&de()!==null}function Br(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e))!=null?n:null}catch{return null}}var Wt=":sid";function Ur(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=de())==null||r.setItem(ye+e,t),typeof n=="string"&&n&&((o=de())==null||o.setItem(ye+e+Wt,n))}catch{}}function sa(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e+Wt))!=null?n:null}catch{return null}}function Je(e){var t,n;try{(t=de())==null||t.removeItem(ye+e),(n=de())==null||n.removeItem(ye+e+Wt)}catch{}}function aa(e){try{let t=typeof e=="string"?e:e instanceof URL?e.href:e.url;return new URL(t,"https://invalid.example").pathname}catch{return null}}function $r(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function jt(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var Nr=Symbol.for("atlas.devBrowser");function Kt(e,t){if(!e.startsWith("pk_test_")||t[Nr])return t;let n=async(r,o)=>{var u,f;if(!zr(e))return t(r,o);let i=aa(r),s=((u=o==null?void 0:o.method)!=null?u:"GET").toUpperCase(),l=o,a=!1;if(i===Dr&&s==="POST"&&typeof(o==null?void 0:o.body)=="string")try{let p=JSON.parse(o.body);p&&typeof p=="object"&&!Array.isArray(p)&&(l={...o,body:JSON.stringify({...p,return_refresh_token:!0})})}catch{}let d=Br(e);if(d&&(i===Fr&&s==="GET"||i&&Mr.test(i)&&s==="POST")){let p=new Headers(l==null?void 0:l.headers);p.has("x-refresh-token")||p.set("x-refresh-token",d),l={...l,headers:p},a=!0}let c=await t(r,l);if(!i)return c;if(i===Dr&&c.ok){let p=await jt(c);Ur(e,p==null?void 0:p.refresh_token,p==null?void 0:p.id)}else if(i&&Mr.test(i))c.ok?Ur(e,(f=await jt(c))==null?void 0:f.refresh_token,$r(i)):a&&c.status===401&&Je(e);else if(i===Fr&&a&&c.ok){let p=await jt(c);p&&p.session===null&&Je(e)}else if(i&&ia.test(i)&&(c.ok||c.status===404)){let p=sa(e);(!p||p===$r(i))&&Je(e)}return c};return n[Nr]=!0,n}function qt(e){let t=e==null?void 0:e.mfa;return{totp:t?t.totp:!0,sms:t?t.sms:!1,emailCode:(e==null?void 0:e.emailSecondFactor)===!0,totpCodes:t?t.totpCodes:2}}async function la(e,t,n){let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_mfa_enrollment`,n.strategy==="phone_code"?{strategy:"phone_code",phone:n.phone}:{strategy:"totp"}),o=r.data;if(!r.ok||!o||typeof o.factor_id!="string")return{enrollment:null,errors:r.errors,status:r.status};let i=l=>typeof l=="string"&&l?l:void 0,s={strategy:n.strategy,factorId:o.factor_id};if(n.strategy==="totp"){i(o.secret)&&(s.secret=i(o.secret)),i(o.uri)&&(s.uri=i(o.uri));let l=i(o.qr_code);l&&/^data:image\//.test(l)&&(s.qrCode=l)}else i(o.phone)&&(s.phone=i(o.phone));return{enrollment:s,errors:[],status:r.status}}function Hr(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function ca(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function jr(e,t){let n=()=>typeof t=="function"?t():t,r=p=>{let g=[];return p.totp&&g.push("totp"),p.sms&&g.push("phone_code"),g.length?g:["totp"]},o=()=>{let p=n();return{options:r(p),method:null,enrollment:null,busy:!1,errors:[],totpCodes:p.totpCodes}},i=o(),s=null,l="",a=0,d=new Set,c=p=>{i={...i,...p};for(let g of d)g(i)},u=async p=>{let g=s;if(!g)return;let y=a;c({busy:!0,errors:[]});let m=await la(e,g,p);if(y===a){if(m.enrollment){c({busy:!1,enrollment:m.enrollment,errors:[]});return}if(ca(m.errors,m.status)&&i.options.length>1){let S=i.options.filter(E=>E!==p.strategy);c({busy:!1,options:S,method:null,enrollment:null,errors:m.errors}),S.length===1&&await f.choose(S[0]);return}c({busy:!1,errors:m.errors})}},f={get state(){return i},subscribe(p){return d.add(p),()=>d.delete(p)},start(p){p!==s&&(a+=1,s=p,l="",i=o(),c({}),i.options.length===1&&f.choose(i.options[0]))},async choose(p){i.options.includes(p)&&(c({method:p,enrollment:null,errors:[]}),p==="totp"&&await u({strategy:"totp"}))},async sendPhone(p){let g=p.trim();if(!g){c({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}l=g,await u({strategy:"phone_code",phone:g})},async resend(){i.method==="phone_code"&&l&&await u({strategy:"phone_code",phone:l})},async submit(p){var m,S,E,A;if(i.method==="phone_code"&&!i.enrollment)return await f.sendPhone((m=p.phone)!=null?m:""),null;let g=i.enrollment;return g?g.strategy==="phone_code"?{factorId:g.factorId,enrollStrategy:"phone_code",code:(S=p.code)!=null?S:""}:{factorId:g.factorId,code:(E=p.code)!=null?E:"",secondCode:(A=p.secondCode)!=null?A:""}:null},reset(){a+=1,s=null,l="",i=o(),c({})}};return f}function Wr(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function Kr(e,t,n){var o,i;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_second_factor`,{strategy:n});if(!r.ok){let s=r.errors[0],l=new Error((o=s==null?void 0:s.message)!=null?o:"Could not send the code.");throw s!=null&&s.code&&(l.code=s.code),l}return{sentTo:typeof((i=r.data)==null?void 0:i.sent_to)=="string"?r.data.sent_to:""}}function qr(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function Te(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function Vr(e){return{...e,recoveryCodes:null}}function da(e){return`${e.join(`
1
+ "use strict";(()=>{var Ma=Object.create;var fn=Object.defineProperty;var Ua=Object.getOwnPropertyDescriptor;var za=Object.getOwnPropertyNames;var Na=Object.getPrototypeOf,Ba=Object.prototype.hasOwnProperty;var ja=(e,t,n)=>t in e?fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var bt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ha=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of za(t))!Ba.call(e,o)&&o!==n&&fn(e,o,{get:()=>t[o],enumerable:!(r=Ua(t,o))||r.enumerable});return e};var qa=(e,t,n)=>(n=e!=null?Ma(Na(e)):{},Ha(t||!e||!e.__esModule?fn(n,"default",{value:e,enumerable:!0}):n,e));var v=(e,t,n)=>ja(e,typeof t!="symbol"?t+"":t,n);var ji=bt(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.ForbiddenError=void 0;Ee.evaluate=ur;Ee.hasFromClaims=Dc;Ee.protectFromClaims=Lc;function Fc(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function ur(e,t={}){var o,i,s,a;if(!e)return{allowed:!1,reason:"signed_out"};if(t.plan!==void 0&&e.pla!==t.plan)return{allowed:!1,reason:"missing_entitlement"};if(t.feature!==void 0&&!((o=e.fea)!=null?o:[]).includes(t.feature))return{allowed:!1,reason:"missing_entitlement"};let n=new Set((i=e.app_permissions)!=null?i:[]);if(t.appRole!==void 0&&!((s=e.app_roles)!=null?s:[]).includes(t.appRole))return{allowed:!1,reason:"missing_permission"};if(t.appPermission!==void 0&&!n.has(t.appPermission))return{allowed:!1,reason:"missing_permission"};if(t.anyAppPermission&&!t.anyAppPermission.some(l=>n.has(l)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(l=>n.has(l)))return{allowed:!1,reason:"missing_permission"};if(!Fc(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((a=e.org_permissions)!=null?a:[]);return t.role!==void 0&&e.org_role!==t.role?{allowed:!1,reason:"missing_permission"}:t.permission!==void 0&&!r.has(t.permission)?{allowed:!1,reason:"missing_permission"}:t.anyPermission&&!t.anyPermission.some(l=>r.has(l))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(l=>r.has(l))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function Dc(e,t={}){return ur(e,t).allowed}var Lt=class extends Error{constructor(n,r){super(n==="signed_out"?"Not signed in.":n==="no_organization"?"No active organization for this authorization check.":n==="missing_entitlement"?"Missing the required plan or feature.":"Missing the required permission or role.");v(this,"reason");v(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};Ee.ForbiddenError=Lt;function Lc(e,t={}){let n=ur(e,t);if(!n.allowed)throw new Lt(n.reason,t)}});var Hi=bt(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.PERMISSION_KEY_PATTERN=ce.ROLE_KEY_PATTERN=void 0;ce.isRoleKey=$c;ce.isPermissionKey=Mc;ce.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;ce.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function $c(e){return ce.ROLE_KEY_PATTERN.test(e)}function Mc(e){return ce.PERMISSION_KEY_PATTERN.test(e)}});var Gi=bt(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.FilterCompileError=void 0;pe.likeToRegExp=Ki;pe.evalFilter=fr;pe.filterToSql=Nc;pe.filterToPrisma=Bc;pe.filterToDrizzle=jc;var J=class extends Error{};pe.FilterCompileError=J;var pr={eq:"=",ne:"<>",lt:"<",lte:"<=",gt:">",gte:">="},Wi=e=>{if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(typeof t.type=="string"&&typeof t.id=="string"&&Object.keys(t).length===2)return`${t.type}::${t.id}`}return e};function Be(e,t){let n=t.split("."),r=e[n[0]];for(let o of n.slice(1)){if(r===null||typeof r!="object"||Array.isArray(r))return;r=r[o]}return r===null?void 0:Wi(r)}function Re(e,t){if("value"in e)return e.value;if("field"in e){let o=Be(t,e.field);return typeof o=="string"||typeof o=="number"||typeof o=="boolean"?o:void 0}if("neg"in e){let o=Re(e.neg,t);return typeof o=="number"?-o:void 0}let n=Re(e.left,t),r=Re(e.right,t);if(!(typeof n!="number"||typeof r!="number"))return e.arith==="add"?n+r:e.arith==="sub"?n-r:n*r}function qi(e,t,n){return e==="eq"?t===n:e==="ne"?t!==n:typeof t!="number"||typeof n!="number"?!1:e==="lt"?t<n:e==="lte"?t<=n:e==="gt"?t>n:t>=n}function Ki(e){return new RegExp(`^${e.split("*").map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")}$`,"s")}function fr(e,t){switch(e.op){case"true":return!0;case"false":return!1;case"and":return e.args.every(n=>fr(n,t));case"or":return e.args.some(n=>fr(n,t));case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{let n=Re({field:e.field},t),r="ref"in e?Re({field:e.ref},t):e.value;return n!==void 0&&r!==void 0&&qi(e.op,n,r)}case"cmp":{let n=Re(e.left,t),r=Re(e.right,t);return n!==void 0&&r!==void 0&&qi(e.cmp,n,r)}case"in":case"not_in":{let n=Be(t,e.field);return n===void 0||Array.isArray(n)?!1:e.values.includes(n)===(e.op==="in")}case"contains":case"not_contains":{let n=Be(t,e.field);return Array.isArray(n)?n.map(Wi).includes(e.value)===(e.op==="contains"):!1}case"like":case"not_like":{let n=Be(t,e.field);return typeof n=="string"&&Ki(e.pattern).test(n)===(e.op==="like")}case"exists":return Be(t,e.field)!==void 0;case"missing":return Be(t,e.field)===void 0;case"relation":case"not_relation":throw new J("Unresolved relation condition: ask the server to resolve it (resolve_relations).")}}var Uc=/^[A-Za-z_][A-Za-z0-9_$]*$/,zc=/^[A-Za-z0-9_]+$/,gr=class{constructor(t,n){v(this,"o");v(this,"d");v(this,"params",[]);v(this,"kindOf",t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string");this.o=t,this.d=n}quote(t){let n=t.split(".");if(n.length>2||!n.every(o=>Uc.test(o)))throw new J(`"${t}" is not a safe column name (letters, digits and underscore, optionally table.column).`);let r=this.d==="mysql"?"`":'"';return n.map(o=>`${r}${o}${r}`).join(".")}param(t){var n;return this.params.push(t),this.d==="postgres"?`$${((n=this.o.paramOffset)!=null?n:0)+this.params.length}`:"?"}spec(t){var i;let n=this.o.columns[t];if(n===void 0)throw new J(`No column is mapped for field "${t}".`);let r=typeof n=="string"?{column:n}:n,o=this.quote(r.column);if(r.json!==void 0){let s=r.json.split(".");if(!s.every(a=>zc.test(a)))throw new J(`"${r.json}" is not a safe JSON path.`);return{col:o,kind:r.kind==="array"||r.kind==="json"?"json":"scalar",path:s}}return{col:o,kind:(i=r.kind)!=null?i:"scalar"}}scalar(t,n){let{col:r,path:o}=this.spec(t);if(!o)return r;if(this.d==="sqlite")return`json_extract(${r}, '$.${o.join(".")}')`;if(this.d==="mysql"){let s=`JSON_UNQUOTE(JSON_EXTRACT(${r}, '$.${o.join(".")}'))`;return n==="number"?`CAST(${s} AS DECIMAL(38,10))`:s}let i=`(${r} #>> '{${o.join(",")}}')`;return n==="number"?`${i}::numeric`:n==="boolean"?`${i}::boolean`:i}setExpr(t){let{col:n,kind:r,path:o}=this.spec(t);if(o)return this.d==="postgres"?{sql:`(${n} #> '{${o.join(",")}}')`,native:!1}:this.d==="mysql"?{sql:`JSON_EXTRACT(${n}, '$.${o.join(".")}')`,native:!1}:{sql:`json_extract(${n}, '$.${o.join(".")}')`,native:!1};let i=r==="scalar"?this.d==="postgres"?"array":"json":r;return{sql:n,native:i==="array"}}term(t,n="number"){return"field"in t?this.scalar(t.field,n):"value"in t?this.param(t.value):"neg"in t?`(-${this.term(t.neg)})`:`(${this.term(t.left)} ${t.arith==="add"?"+":t.arith==="sub"?"-":"*"} ${this.term(t.right)})`}likePattern(t){return t.split("*").map(n=>n.replace(/[\\%_]/g,"\\$&")).join("%")}build(t){switch(t.op){case"true":return"(1 = 1)";case"false":return"(1 = 0)";case"and":case"or":return t.args.length===0?t.op==="and"?"(1 = 1)":"(1 = 0)":`(${t.args.map(n=>this.build(n)).join(t.op==="and"?" AND ":" OR ")})`;case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{if("ref"in t)return`(${this.scalar(t.field,"string")} ${pr[t.op]} ${this.scalar(t.ref,"string")})`;let n=this.kindOf(t.value);return`(${this.scalar(t.field,n)} ${pr[t.op]} ${this.param(t.value)})`}case"cmp":return`(${this.term(t.left)} ${pr[t.cmp]} ${this.term(t.right)})`;case"in":case"not_in":{if(t.values.length===0)return t.op==="in"?"(1 = 0)":"(1 = 1)";let n=this.kindOf(t.values[0]),r=this.scalar(t.field,n);if(this.d==="postgres"&&t.values.every(i=>typeof i=="string"))return t.op==="in"?`(${r} = ANY(${this.param(t.values)}))`:`(${r} <> ALL(${this.param(t.values)}))`;let o=t.values.map(i=>this.param(i)).join(", ");return`(${r} ${t.op==="in"?"IN":"NOT IN"} (${o}))`}case"contains":case"not_contains":{let n=t.op==="not_contains",{sql:r,native:o}=this.setExpr(t.field),i;return this.d==="postgres"?i=o?`${this.param(t.value)} = ANY(${r})`:`${r} @> ${this.param(JSON.stringify([t.value]))}::jsonb`:this.d==="mysql"?i=`JSON_CONTAINS(${r}, ${this.param(JSON.stringify(t.value))})`:i=`EXISTS (SELECT 1 FROM json_each(${r}) WHERE value = ${this.param(t.value)})`,n?`(${this.d==="sqlite"?`${r} IS NOT NULL AND `:""}NOT ${i})`:`(${i})`}case"like":case"not_like":{let n=this.scalar(t.field,"string"),r=t.op==="not_like"?"NOT ":"";if(this.d==="sqlite")return`(${n} ${r}GLOB ${this.param(t.pattern.replace(/[?[]/g,"[$&]"))})`;let o=this.param(this.likePattern(t.pattern));return this.d==="mysql"?`(${n} ${r}LIKE BINARY ${o} ESCAPE '\\\\')`:`(${n} ${r}LIKE ${o} ESCAPE '\\')`}case"exists":case"missing":{let{col:n,path:r}=this.spec(t.field);return`(${r?this.scalar(t.field,"string"):n} IS ${t.op==="exists"?"NOT ":""}NULL)`}case"relation":case"not_relation":throw new J("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}}};function Nc(e,t){var o;let n=new gr(t,(o=t.dialect)!=null?o:"postgres");return{text:n.build(e),params:n.params}}var re=(e,t)=>e.split(".").reduceRight((n,r)=>({[r]:n}),t);function Bc(e,t){let n=o=>{let i=t.fields[o];if(i===void 0)throw new J(`No Prisma field is mapped for "${o}".`);return i},r=o=>{switch(o.op){case"true":return{};case"false":return{OR:[]};case"and":return{AND:o.args.map(r)};case"or":return{OR:o.args.map(r)};case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{if("ref"in o)throw new J("Comparing two fields has no Prisma form; use filterToSql.");let i=o.op==="eq"?{equals:o.value}:o.op==="ne"?{not:o.value}:{[o.op]:o.value};return re(n(o.field),i)}case"cmp":throw new J("Arithmetic has no Prisma form; use filterToSql.");case"in":return re(n(o.field),{in:o.values});case"not_in":return{AND:[re(n(o.field),{notIn:o.values}),re(n(o.field),{not:null})]};case"contains":return re(n(o.field),{has:o.value});case"not_contains":return{AND:[{NOT:re(n(o.field),{has:o.value})},re(n(o.field),{not:null})]};case"exists":return re(n(o.field),{not:null});case"missing":return re(n(o.field),{equals:null});case"like":case"not_like":{let i=/^(\*?)([^*]*)(\*?)$/.exec(o.pattern);if(!i)throw new J(`Pattern "${o.pattern}" has no Prisma form (only x, x*, *x and *x*); use filterToSql.`);let[,s,a,l]=i,c=s&&l?{contains:a}:s?{endsWith:a}:l?{startsWith:a}:{equals:a},d=re(n(o.field),c);return o.op==="like"?d:{AND:[{NOT:d},re(n(o.field),{not:null})]}}case"relation":case"not_relation":throw new J("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}};return r(e)}function jc(e,t){let{ops:n,columns:r}=t,{sql:o}=n,i=c=>{if(!(c in r))throw new J(`No Drizzle column is mapped for "${c}".`);return r[c]},s=c=>{if("field"in c)return i(c.field);if("value"in c)return o`${c.value}`;if("neg"in c)return o`(-${s(c.neg)})`;let[d,u]=[s(c.left),s(c.right)];return c.arith==="add"?o`(${d} + ${u})`:c.arith==="sub"?o`(${d} - ${u})`:o`(${d} * ${u})`},a=c=>c.split("*").map(d=>d.replace(/[\\%_]/g,"\\$&")).join("%"),l=c=>{var d;switch(c.op){case"true":return o`(1 = 1)`;case"false":return o`(1 = 0)`;case"and":return c.args.length?n.and(...c.args.map(l)):o`(1 = 1)`;case"or":return c.args.length?n.or(...c.args.map(l)):o`(1 = 0)`;case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":return n[c.op](i(c.field),"ref"in c?i(c.ref):c.value);case"cmp":{let[u,p]=[s(c.left),s(c.right)];switch(c.cmp){case"eq":return o`${u} = ${p}`;case"ne":return o`${u} <> ${p}`;case"lt":return o`${u} < ${p}`;case"lte":return o`${u} <= ${p}`;case"gt":return o`${u} > ${p}`;case"gte":return o`${u} >= ${p}`}}case"in":return c.values.length?n.inArray(i(c.field),c.values):o`(1 = 0)`;case"not_in":return c.values.length?n.and(n.notInArray(i(c.field),c.values),n.isNotNull(i(c.field))):o`(1 = 1)`;case"contains":case"not_contains":{let u=i(c.field),p=(d=t.arrayFields)!=null&&d.includes(c.field)?o`${c.value} = ANY(${u})`:o`${u} @> ${JSON.stringify([c.value])}::jsonb`;return c.op==="contains"?p:n.and(n.isNotNull(u),o`NOT (${p})`)}case"like":return n.like(i(c.field),a(c.pattern));case"not_like":return n.notLike(i(c.field),a(c.pattern));case"exists":return n.isNotNull(i(c.field));case"missing":return n.isNull(i(c.field));case"relation":case"not_relation":throw new J("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}};return l(e)}});var Vi=bt(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.likeToRegExp=z.filterToSql=z.filterToPrisma=z.filterToDrizzle=z.evalFilter=z.FilterCompileError=z.isPermissionKey=z.isRoleKey=z.PERMISSION_KEY_PATTERN=z.ROLE_KEY_PATTERN=z.ForbiddenError=z.protectFromClaims=z.hasFromClaims=z.evaluate=void 0;var $t=ji();Object.defineProperty(z,"evaluate",{enumerable:!0,get:function(){return $t.evaluate}});Object.defineProperty(z,"hasFromClaims",{enumerable:!0,get:function(){return $t.hasFromClaims}});Object.defineProperty(z,"protectFromClaims",{enumerable:!0,get:function(){return $t.protectFromClaims}});Object.defineProperty(z,"ForbiddenError",{enumerable:!0,get:function(){return $t.ForbiddenError}});var Mt=Hi();Object.defineProperty(z,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return Mt.ROLE_KEY_PATTERN}});Object.defineProperty(z,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return Mt.PERMISSION_KEY_PATTERN}});Object.defineProperty(z,"isRoleKey",{enumerable:!0,get:function(){return Mt.isRoleKey}});Object.defineProperty(z,"isPermissionKey",{enumerable:!0,get:function(){return Mt.isPermissionKey}});var je=Gi();Object.defineProperty(z,"FilterCompileError",{enumerable:!0,get:function(){return je.FilterCompileError}});Object.defineProperty(z,"evalFilter",{enumerable:!0,get:function(){return je.evalFilter}});Object.defineProperty(z,"filterToDrizzle",{enumerable:!0,get:function(){return je.filterToDrizzle}});Object.defineProperty(z,"filterToPrisma",{enumerable:!0,get:function(){return je.filterToPrisma}});Object.defineProperty(z,"filterToSql",{enumerable:!0,get:function(){return je.filterToSql}});Object.defineProperty(z,"likeToRegExp",{enumerable:!0,get:function(){return je.likeToRegExp}})});var Vd=30*24*60*60*1e3;function qr(e){if(typeof BroadcastChannel=="undefined")return null;let t=new BroadcastChannel(e);return{post:n=>t.postMessage(n),subscribe(n){let r=o=>n(o.data);return t.addEventListener("message",r),()=>t.removeEventListener("message",r)},close:()=>t.close()}}function Wr(e){if(typeof window=="undefined"||typeof window.localStorage=="undefined")return null;let t=`atlas:${e}`;return{post(n){try{window.localStorage.setItem(t,JSON.stringify({message:n,at:Date.now()})),window.localStorage.removeItem(t)}catch{}},subscribe(n){let r=o=>{if(!(o.key!==t||!o.newValue))try{n(JSON.parse(o.newValue).message)}catch{}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},close:()=>{}}}function Z(e){var t,n,r,o;switch(e.status){case"needs_identifier":return{kind:"collect_identifier"};case"needs_first_factor":return{kind:"collect_first_factor",strategies:(t=e.supported_first_factors)!=null?t:[]};case"needs_second_factor":return{kind:"collect_second_factor"};case"needs_mfa_enrollment":return{kind:"enroll_second_factor"};case"needs_email_verification":return{kind:"collect_email_code"};case"needs_captcha":return{kind:"collect_captcha"};case"needs_oauth_callback":return{kind:"await_oauth"};case"needs_new_password":return{kind:"collect_new_password"};case"needs_policy_acceptance":return{kind:"accept_policies",policies:(n=e.pending_policies)!=null?n:[]};case"needs_required_action":return{kind:"complete_required_action",actions:(r=e.pending_required_actions)!=null?r:[]};case"complete":return{kind:"done",sessionId:(o=e.created_session_id)!=null?o:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function Kr(e){return e.status==="complete"||e.status==="abandoned"}function Gr(e){if(!e||typeof e!="object")return[];let t=e.errors;return Array.isArray(t)?t.filter(n=>!!n&&typeof n.message=="string").map(n=>{let r={code:n.code,message:n.message,param:n.param},o=n.reason;typeof o=="string"&&o!==""&&(r.reason=o);let i=n.meta;return i&&typeof i=="object"&&!Array.isArray(i)&&(r.meta=i),r}):[]}function kt(e){var r;let t=["email_code","email_link"].filter(o=>e.includes(o)),n=e.includes("password");return{password:n,email:t,autoSend:n?null:(r=t[0])!=null?r:null}}var yu=Object.freeze(["form_password_incorrect","form_code_incorrect","form_code_already_used","form_code_expired","form_code_max_attempts","form_link_invalid","form_identifier_not_found","form_identifier_exists","form_password_pwned","form_password_too_short","form_password_too_long","form_password_requires_uppercase","form_password_requires_lowercase","form_password_requires_number","form_password_requires_symbol","form_password_not_allowed","form_password_contains_identifier","form_password_same_as_current","form_password_reused","password_expired","email_not_verified","sign_in_token_invalid","too_many_attempts","too_many_requests","captcha_required","captcha_failed","captcha_unavailable","email_delivery_unavailable","strategy_disabled","sign_up_restricted","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked"]);function Wa(e){return`error.${e}`}var Ka="Something went wrong. Please try again.",Ga=/^[a-z][a-z0-9_]{0,63}$/;function Va(e,t){let n=!0,r=e.replace(/\{(\w+)\}/g,(o,i)=>{let s=t&&Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;return typeof s=="string"&&s!==""?s:typeof s=="number"&&Number.isFinite(s)?String(s):(n=!1,o)});return n?r:null}function gn(e,t){if(!e)return null;let n;if(typeof e=="function"?n=e(t):n=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,typeof n!="string")return null;let r=n.trim();return r===""||r===t?null:n}function Vr(e,t,n){var i,s;let r=typeof e=="string"?{message:e}:e!=null?e:{},o=typeof r.reason=="string"?r.reason:"";if(o&&Ga.test(o)){let a=gn(t,Wa(o)),l=a?Va(a,r.meta):null;if(l)return l}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(i=gn(t,"error.generic"))!=null?i:gn(n,"error.generic"))!=null?s:Ka}function Yr(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var mn="atlas:oauth",Ya="atlas_popup_result",Jr="atlas:oauth";function Ja(e){return`${Jr}:${e}`}function Qr(){let e=new Uint8Array(16),t=globalThis.crypto;if(t!=null&&t.getRandomValues)t.getRandomValues(e);else for(let r=0;r<e.length;r++)e[r]=Math.floor(Math.random()*256);let n="";for(let r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Qa(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id!="string"?!1:t.type==="atlas:oauth:result"?!!t.result&&typeof t.result=="object":t.type==="atlas:oauth:signed_in"||t.type==="atlas:oauth:ack"}function Za(e){var t;try{return(t=qr(e))!=null?t:Wr(e)}catch{return null}}function Zr(e,t,n){let r=Za(e);if(!r)return Promise.resolve(!1);let o=Qr();return new Promise(i=>{let s=!1,a=d=>{s||(s=!0,clearTimeout(c),l(),r.close(),i(d))},l=r.subscribe(d=>{Qa(d)&&d.type==="atlas:oauth:ack"&&d.id===o&&a(!0)}),c=setTimeout(()=>a(!1),n);try{r.post({...t,id:o})}catch{a(!1)}})}function Xa(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(Ya);if(!t)return null;try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(n+"=".repeat((4-n.length%4)%4)),o=Uint8Array.from(r,a=>a.charCodeAt(0)),i=JSON.parse(new TextDecoder().decode(o));if(!i||typeof i!="object")return null;let s=i;return s.v!==1||typeof s.n!="string"||!s.n||typeof s.type!="string"||!s.type.startsWith("atlas:oauth:")?null:{nonce:s.n,payload:s}}catch{return null}}async function Xr(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=Xa(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=mn}catch{}let r=await Zr(Ja(n.nonce),{type:"atlas:oauth:result",result:n.payload},(i=e.ackTimeoutMs)!=null?i:1500);return r&&to(t),{payload:n.payload,delivered:r}}async function eo(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==mn)return!1;let n=await Zr(Jr,{type:"atlas:oauth:signed_in"},(i=e.ackTimeoutMs)!=null?i:1500),r=!1;try{r=!!t.opener&&!t.opener.closed}catch{r=!1}return!n&&!r?!1:(to(t),!0)}function to(e){try{e.close()}catch{}}var el=["__atlas_attempt","__atlas_ticket","__atlas_status","__atlas_policy_token"];function no(e){var r;if(!e||typeof e!="object")return null;let t=e,n=o=>typeof o=="string"?o:void 0;switch(t.type){case"atlas:oauth:complete":return{ticket:n(t.ticket),attemptId:n(t.attemptId)};case"atlas:oauth:error":return{error:(r=n(t.code))!=null?r:"error",continuationUrl:n(t.continuationUrl)};case"atlas:oauth:continue":return{status:n(t.status),attemptId:n(t.attemptId),continuationUrl:n(t.continuationUrl),...n(t.policyToken)?{policyToken:n(t.policyToken)}:{}};default:return null}}var wu=5*6e4;function ro(e){let t=new URLSearchParams(e),n=t.get("__atlas_attempt");if(!n)return null;let r=t.get("__atlas_ticket"),o=t.get("__atlas_status");if(!r&&!o)return null;let i=t.get("__atlas_policy_token");return{attemptId:n,...r?{ticket:r}:{},...o?{status:o}:{},...(o==="needs_policy_acceptance"||o==="needs_required_action")&&i?{policyToken:i}:{}}}function _t(e){let t=new URL(e);for(let n of el)t.searchParams.delete(n);return t.toString()}async function oo(e,t={}){let n=t.locale?`?locale=${encodeURIComponent(t.locale)}`:"",r=await e.request(`/v1/client/policies${n}`,{method:"GET"});return r.ok&&r.data?{ok:!0,data:r.data}:{ok:!1,errors:r.errors}}function io(e,t){var o;let n=typeof((o=e.attempt)==null?void 0:o.policy_acceptance_token)=="string"?e.attempt.policy_acceptance_token:null,r=e.policyToken||n;return{policy_acceptances:t,...r?{policy_acceptance_token:r}:e.pollSecret?{poll_secret:e.pollSecret}:{}}}var so="0.27.0";var lo={name:"@atlasauth/js",version:so},co="x-atlas-sdk",tl="atlas-sdk-advisory";function uo(e){return`${e.name}/${e.version}`}function nl(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(i=>i.trim()),o=i=>{var s,a;return(a=(s=r.find(l=>l.startsWith(`${i}=`)))==null?void 0:s.slice(i.length+1))!=null?a:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var ao=new Set;function po(e,t,n=rl){var i,s,a,l,c;let r=null;try{r=(a=(s=(i=e==null?void 0:e.headers)==null?void 0:i.get)==null?void 0:s.call(i,tl))!=null?a:null}catch{return[]}let o=[];for(let d of nl(r)){let u=`${t.name}|${(l=d.reason)!=null?l:""}|${(c=d.min)!=null?c:""}`;ao.has(u)||(ao.add(u),o.push(d),n(`[Atlas] ${t.name} ${t.version} has a known problem${d.reason?` (${d.reason})`:""}${d.min?` fixed in ${d.min}. Upgrade ${t.name} to ${d.min} or later`:". Upgrade it"} \u2014 with a 0.x version a caret range does not move past your lockfile on its own. Details: https://atlasauth.net/v1/sdk_advisories/${encodeURIComponent(t.name)}`))}return o}function rl(e){typeof console!="undefined"&&console.warn(e)}var De="__atlas_dev_session:",kn="/v1/client/tickets/exchange",fo="/v1/client",go=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,ol=/^\/v1\/client\/sessions\/[^/]+\/revoke$/,hn=new Map,il={getItem:e=>{var t;return(t=hn.get(e))!=null?t:null},setItem:(e,t)=>void hn.set(e,t),removeItem:e=>void hn.delete(e)},_n="local";function vn(e){_n=e!=null?e:"local"}function Ce(){if(_n==="memory")return il;try{let e=globalThis,t=_n==="session"?e.sessionStorage:e.localStorage;return t&&typeof t.getItem=="function"?t:null}catch{return null}}function ko(e){return e.startsWith("pk_test_")&&Ce()!==null}function _o(e){var t,n;try{return(n=(t=Ce())==null?void 0:t.getItem(De+e))!=null?n:null}catch{return null}}var xn=":sid";function mo(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=Ce())==null||r.setItem(De+e,t),typeof n=="string"&&n&&((o=Ce())==null||o.setItem(De+e+xn,n))}catch{}}function sl(e){var t,n;try{return(n=(t=Ce())==null?void 0:t.getItem(De+e+xn))!=null?n:null}catch{return null}}function vt(e){var t,n;try{(t=Ce())==null||t.removeItem(De+e),(n=Ce())==null||n.removeItem(De+e+xn)}catch{}}function vo(e){try{let t=typeof e=="string"?e:e instanceof URL?e.href:e.url;return new URL(t,"https://invalid.example").pathname}catch{return null}}function ho(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function yn(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var bn=Symbol.for("atlas.devBrowser"),al=1e4,yo=new WeakMap;function ll(e){if(typeof(e==null?void 0:e.body)!="string")return null;try{let t=JSON.parse(e.body);return typeof t.attempt_id=="string"&&typeof t.ticket=="string"?`${t.attempt_id}\0${t.ticket}`:null}catch{return null}}function bo(e,t,n,r){var a,l;let o=((a=n==null?void 0:n.method)!=null?a:"GET").toUpperCase()==="POST"&&vo(t)===kn?ll(n):null;if(!o)return r();let i=(l=yo.get(e))!=null?l:new Map;yo.set(e,i);let s=i.get(o);if(!s){s=r(),i.set(o,s);let c=()=>{i.get(o)===s&&i.delete(o)};s.then(d=>{var p;if(!d.ok)return c();let u=setTimeout(c,al);(p=u.unref)==null||p.call(u)},c)}return s.then(c=>c.clone())}function wn(e,t){if(t[bn])return t;if(!e.startsWith("pk_test_")){let o=(i,s)=>bo(t,i,s,()=>t(i,s));return o[bn]=!0,o}let n=(o,i)=>bo(t,o,i,()=>r(o,i)),r=async(o,i)=>{var p,f;if(!ko(e))return t(o,i);let s=vo(o),a=((p=i==null?void 0:i.method)!=null?p:"GET").toUpperCase(),l=i,c=!1;if(s===kn&&a==="POST"&&typeof(i==null?void 0:i.body)=="string")try{let g=JSON.parse(i.body);g&&typeof g=="object"&&!Array.isArray(g)&&(l={...i,body:JSON.stringify({...g,return_refresh_token:!0})})}catch{}let d=_o(e);if(d&&(s===fo&&a==="GET"||s&&go.test(s)&&a==="POST")){let g=new Headers(l==null?void 0:l.headers);g.has("x-refresh-token")||g.set("x-refresh-token",d),l={...l,headers:g},c=!0}let u=await t(o,l);if(!s)return u;if(s===kn&&u.ok){let g=await yn(u);mo(e,g==null?void 0:g.refresh_token,g==null?void 0:g.id)}else if(s&&go.test(s))u.ok?mo(e,(f=await yn(u))==null?void 0:f.refresh_token,ho(s)):c&&u.status===401&&vt(e);else if(s===fo&&c&&u.ok){let g=await yn(u);g&&g.session===null&&vt(e)}else if(s&&ol.test(s)&&(u.ok||u.status===404)){let g=sl(e);(!g||g===ho(s))&&vt(e)}return u};return n[bn]=!0,n}function Sn(e){let t=e==null?void 0:e.mfa;return{totp:t?t.totp:!0,sms:t?t.sms:!1,emailCode:(e==null?void 0:e.emailSecondFactor)===!0,totpCodes:t?t.totpCodes:2,...(t==null?void 0:t.duo)===!0?{duo:!0}:{}}}async function cl(e,t,n){let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_mfa_enrollment`,n.strategy==="phone_code"?{strategy:"phone_code",phone:n.phone}:{strategy:"totp"}),o=r.data;if(!r.ok||!o||typeof o.factor_id!="string")return{enrollment:null,errors:r.errors,status:r.status};let i=a=>typeof a=="string"&&a?a:void 0,s={strategy:n.strategy,factorId:o.factor_id};if(n.strategy==="totp"){i(o.secret)&&(s.secret=i(o.secret)),i(o.uri)&&(s.uri=i(o.uri));let a=i(o.qr_code);a&&/^data:image\//.test(a)&&(s.qrCode=a)}else i(o.phone)&&(s.phone=i(o.phone));return{enrollment:s,errors:[],status:r.status}}function xo(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function dl(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function wo(e,t){let n=()=>typeof t=="function"?t():t,r=f=>{let g=[];return f.totp&&g.push("totp"),f.sms&&g.push("phone_code"),g.length?g:["totp"]},o=()=>{let f=n();return{options:r(f),method:null,enrollment:null,busy:!1,errors:[],totpCodes:f.totpCodes}},i=o(),s=null,a="",l=0,c=new Set,d=f=>{i={...i,...f};for(let g of c)g(i)},u=async f=>{let g=s;if(!g)return;let m=l;d({busy:!0,errors:[]});let h=await cl(e,g,f);if(m===l){if(h.enrollment){d({busy:!1,enrollment:h.enrollment,errors:[]});return}if(dl(h.errors,h.status)&&i.options.length>1){let w=i.options.filter(P=>P!==f.strategy);d({busy:!1,options:w,method:null,enrollment:null,errors:h.errors}),w.length===1&&await p.choose(w[0]);return}d({busy:!1,errors:h.errors})}},p={get state(){return i},subscribe(f){return c.add(f),()=>c.delete(f)},start(f){f!==s&&(l+=1,s=f,a="",i=o(),d({}),i.options.length===1&&p.choose(i.options[0]))},async choose(f){i.options.includes(f)&&(d({method:f,enrollment:null,errors:[]}),f==="totp"&&await u({strategy:"totp"}))},async sendPhone(f){let g=f.trim();if(!g){d({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}a=g,await u({strategy:"phone_code",phone:g})},async resend(){i.method==="phone_code"&&a&&await u({strategy:"phone_code",phone:a})},async submit(f){var h,w,P,A;if(i.method==="phone_code"&&!i.enrollment)return await p.sendPhone((h=f.phone)!=null?h:""),null;let g=i.enrollment;return g?g.strategy==="phone_code"?{factorId:g.factorId,enrollStrategy:"phone_code",code:(w=f.code)!=null?w:""}:{factorId:g.factorId,code:(P=f.code)!=null?P:"",secondCode:(A=f.secondCode)!=null?A:""}:null},reset(){l+=1,s=null,a="",i=o(),d({})}};return p}function So(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function Co(e,t,n){var o,i;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_second_factor`,{strategy:n});if(!r.ok){let s=r.errors[0],a=new Error((o=s==null?void 0:s.message)!=null?o:"Could not send the code.");throw s!=null&&s.code&&(a.code=s.code),a}return{sentTo:typeof((i=r.data)==null?void 0:i.sent_to)=="string"?r.data.sent_to:""}}function Ao(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function Qe(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function Po(e){return{...e,recoveryCodes:null}}function ul(e){return`${e.join(`
2
2
  `)}
3
- `}async function Gr(e){var n;let t=(n=globalThis.navigator)==null?void 0:n.clipboard;if(!(t!=null&&t.writeText))return!1;try{return await t.writeText(e.join(`
4
- `)),!0}catch{return!1}}function Vt(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function Yr(e,t="recovery-codes.txt"){var r;if(!Vt())return!1;let n=URL.createObjectURL(new Blob([da(e)],{type:"text/plain;charset=utf-8"}));try{let o=document.createElement("a");return o.href=n,o.download=t,o.rel="noopener",o.style.display="none",((r=document.body)!=null?r:document.documentElement).appendChild(o),o.click(),o.remove(),!0}catch{return!1}finally{setTimeout(()=>URL.revokeObjectURL(n),0)}}var ua=/^[A-Za-z0-9_-]{3,64}$/,ue=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Gt=e=>typeof e=="string"&&ua.test(e.trim())?e.trim():null,Jt=["referalli","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Qr=["atlasconsent","cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode","gpc"];function v(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function G(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function Ie(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`)){let o=r.slice(t.length+1);try{return decodeURIComponent(o)}catch{return o}}}return null}function eo(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e=="string"&&e&&e.length<=40){if(/^\d{9,13}$/.test(e))return eo(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function re(e,t,n,r,o){let i={source:e,code:Gt(t),clickId:Gt(n),anonId:Gt(r)},s=eo(o);return s&&(i.capturedAt=s),i.code||i.clickId||i.anonId?i:null}var pa={referalli:({win:e})=>{var r,o;let t=v(e,"aff"),n=G(v(t,"getReferral"),t);return ue(n)?re("referalli",n.code,(r=n.clickId)!=null?r:n.click_id,(o=n.anonId)!=null?o:n.anon_id,n.ts):null},rewardful:({win:e})=>{let t=v(e,"Rewardful");return re("rewardful",v(v(t,"affiliate"),"token"),v(t,"referral"),null)},tolt:({win:e})=>re("tolt",null,v(e,"tolt_referral"),null),promotekit:({win:e})=>re("promotekit",null,v(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>re("firstpromoter",Ie(e,"_fprom_ref"),Ie(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>re("partnerstack",Ie(e,"ps_partner_key"),Ie(e,"ps_xid"),null),dub:({cookies:e})=>re("dub",null,Ie(e,"dub_id"),null)};function Zt(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return ue(t)?re("custom",t.code,(n=t.clickId)!=null?n:t.click_id,(r=t.anonId)!=null?r:t.anon_id,(o=t.capturedAt)!=null?o:t.ts):null}function Oe(e,t){for(let n of t){let o=pa[n==="referally"?"referalli":n];if(!o)continue;let i=null;try{i=o(e)}catch{i=null}if(i)return i}return null}var fa={necessary:"necessary",essential:"necessary",strictly_necessary:"necessary",preferences:"preferences",functional:"preferences",functionality:"preferences",personalization:"preferences",statistics:"statistics",analytics:"statistics",performance:"statistics",marketing:"marketing",advertising:"marketing",advertisement:"marketing",targeting:"marketing",ads:"marketing"};function to(e){var t;return(t=fa[e.trim().toLowerCase()])!=null?t:null}var ne=e=>typeof e=="boolean"?e:void 0;function Z(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let i=to(r),s=i?e[i]:void 0;return s?t(s):void 0}}var Yt=null,Jr=!1;function Xt(e){let t=v(e,"__tcfapi");Jr||typeof t!="function"||(Jr=!0,G(t,e,"addEventListener",2,(n,r)=>{r&&ue(n)&&(Yt=n)}))}function ga(e){if(Yt)return Yt;let t=null;return G(v(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&ue(n)&&(t=n)}),t}var Zr={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Xr=(e,t)=>Array.isArray(e)&&e.includes(t),ma={atlasconsent:{present:e=>v(v(e,"__atlasConsent"),"version")===1&&typeof v(v(e,"__atlasConsent"),"has")=="function",ask:(e,t)=>{let n=v(e,"__atlasConsent"),r=G(v(n,"has"),n,t);return r===!0?!0:r===!1?!1:void 0}},cookiemunch:{present:e=>ue(v(v(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=v(v(e,"CookieMunch"),"consent");return Z(Zr,r=>ne(v(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=v(e,"OnetrustActiveGroups"))!=null?t:v(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=v(e,"OnetrustActiveGroups"))!=null?r:v(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(i=>i.trim()).filter(Boolean);return Z({necessary:"C0001",statistics:"C0002",preferences:"C0003",marketing:"C0004"},i=>/^C\d{4}$/.test(i)||n.includes(i)?n.includes(i):void 0)(e,t)}},cookiebot:{present:e=>!v(e,"CookieMunch")&&ue(v(v(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=v(v(e,"Cookiebot"),"consent");return Z(Zr,r=>ne(v(n,r)))(e,t)}},didomi:{present:e=>typeof v(v(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=v(e,"Didomi"),r=v(v(G(v(n,"getUserStatus"),n),"purposes"),"global"),o=v(r,"enabled"),i=v(r,"disabled");return Z({marketing:"cookies",statistics:"measure_content_performance"},s=>Xr(o,s)?!0:Xr(i,s)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof v(v(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=v(e,"UC_UI"),r=G(v(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return Z({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let i=r.filter(s=>v(s,"categorySlug")===o);return i.length?i.every(s=>v(v(s,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof v(v(v(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=v(v(e,"Osano"),"cm"),r=G(v(n,"getConsent"),n);return Z({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var s;let i=(s=v(r,o))!=null?s:v(r,o.toUpperCase());return i==="ACCEPT"?!0:i==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof v(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=v(G(v(e,"getCkyConsent"),e),"categories");return Z({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>ne(v(n,r)))(e,t)}},complianz:{present:e=>typeof v(e,"cmplz_has_consent")=="function",ask:(e,t)=>Z({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>ne(G(v(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof v(v(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=v(e,"klaro"),r=v(G(v(n,"getManager"),n),"consents");return ne(v(r,t))}},tcf:{present:e=>typeof v(e,"__tcfapi")=="function",ask:e=>{var n;let t=ga(e);if(t)return t.gdprApplies===!1?!0:(n=ne(v(v(v(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>ue(v(v(v(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=v(v(v(e,"google_tag_data"),"ics"),"entries");return Z({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var i;let o=v(n,r);return(i=ne(v(o,"update")))!=null?i:ne(v(o,"default"))})(e,t)}},gpc:{present:e=>v(v(e,"navigator"),"globalPrivacyControl")===!0,ask:(e,t)=>t==="marketing"||t==="referrals"?!1:void 0}};function ha(e){let t=e;if(typeof e=="function")try{t=e()}catch{t=void 0}if(t==="granted"||t===!0)return!0;if(t==="denied"||t===!1)return!1}function Qt(e,t,n={}){let r=n.provider||"auto",o=()=>{let l=ha(n.appConsent);return l===void 0?{granted:!1,by:"none"}:{granted:l,by:"app"}};if(r==="app")return o();let i=r==="auto"?Qr:[r],s=t.filter(l=>typeof l=="string"&&l.trim().length>0);for(let l of i){let a=ma[l],d=!1;try{d=!!a&&a.present(e)}catch{d=!1}if(!(!a||!d)){for(let c of s){let u;try{u=a.ask(e,c)}catch{u=void 0}if(u!==void 0)return{granted:u,by:l}}return{granted:!1,by:l}}}return o()}var no=new Set(["referalli","rewardful","tolt","promotekit"]),ro=["referalli"],oo=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,contextCookies:[],consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),ya=/^[A-Za-z0-9_-]{3,64}$/,ba=/^[A-Za-z0-9_.-]{1,40}$/,ka=/^[A-Za-z0-9_.-]{1,64}$/,Le=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function oe(e){if(typeof e!="string")return null;let t=e.trim();return ya.test(t)?t:null}function io(e){var i;let t=Le(e)&&Le(e.referrals)?e.referrals:e;if(!Le(t)||t.enabled!==!0)return{...oo,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(s=>typeof s=="string"&&ba.test(s)).slice(0,10):[],r=Array.isArray(t.browser_sources)?t.browser_sources.filter(s=>typeof s=="string"&&/^[a-z0-9_]{1,40}$/.test(s)).map(s=>s==="referally"?"referalli":s).slice(0,20):[...ro],o=(Array.isArray(t.context_cookies)?t.context_cookies:typeof t.context_cookie=="string"?[t.context_cookie]:[]).filter(s=>typeof s=="string"&&ka.test(s)).filter((s,l,a)=>a.indexOf(s)===l).slice(0,5);return{enabled:!0,sources:r,consentProvider:typeof t.consent_provider=="string"&&/^[a-z0-9_]{1,40}$/.test(t.consent_provider)?t.consent_provider:"auto",urlParams:n.length?n:["ref","via","aff"],contextCookie:(i=o[0])!=null?i:null,contextCookies:o,consentCategory:typeof t.consent_category=="string"&&t.consent_category?t.consent_category:"referrals",consentFallbackCategory:typeof t.consent_fallback_category=="string"&&t.consent_fallback_category?t.consent_fallback_category:null,challengeReferredSignups:t.challenge_referred_signups==="always"?"always":"inherit",codeLookupUrl:typeof t.code_lookup_url=="string"&&/^https?:\/\//i.test(t.code_lookup_url)&&t.code_lookup_url.includes("{code}")?t.code_lookup_url:null,signupCodeField:t.signup_code_field===!0}}function va(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=oe(n.get(r));if(o)return o}return null}function _a(e,t){let n=[],r=o=>{o&&!n.includes(o)&&n.push(o)};for(let o of e)r(o);for(let o of e){let i;try{i=new URLSearchParams(o)}catch{continue}for(let s of["redirect_url","after_url","redirect_url_complete","after_sign_up_url","after_sign_in_url"]){let l=i.get(s);if(l)try{r(new URL(l,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function Ze(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e!="string"||!e||e.length>40)return null;if(/^\d{9,13}$/.test(e))return Ze(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function xa(e,t=Date.now()){var s,l,a;if(typeof e!="string"||!e||e.length>4096)return null;let n=e;try{n=decodeURIComponent(e)}catch{}let r=d=>{if(!d.startsWith("{"))return null;try{let c=JSON.parse(d);return Le(c)?c:null}catch{return null}},o=(s=r(e.trim()))!=null?s:r(n.trim());if(o){let d=Ze(o.exp);if(d&&Date.parse(d)<=t)return null;let c={code:oe(o.code),clickId:oe((l=o.clickId)!=null?l:o.click_id),anonId:oe((a=o.anonId)!=null?a:o.anon_id)},u=Ze(o.ts);return u&&(c.capturedAt=u),c.code||c.clickId||c.anonId?c:null}let i=oe(n);return i?{code:null,clickId:i,anonId:null}:null}function wa(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`))return r.slice(t.length+1)}return null}var Sa=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Ca(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!Sa.some(i=>t.get(i)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:oe(t.get("ref")),clickId:oe(t.get("ref_click_id")),anonId:oe(t.get("ref_anon_id")),consentGranted:n},o=Ze(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function en(e,t,n,r){var a;let i=!!(e.clickId||e.anonId)?t():null,s=!!(i!=null&&i.granted),l={code:e.code,click_id:s?e.clickId:null,anon_id:s?e.anonId:null,consent:s?"granted":"not_required",captured_at:(a=e.capturedAt)!=null?a:n,source:r,...i?{consent_by:i.by}:{}};return l.code||l.click_id||l.anon_id?l:null}function Aa(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function Ea(e,t,n,r){var g,y,m;if(!e.enabled)return null;let o=(g=t.capturedAt)!=null?g:new Date().toISOString(),i=Aa(t),s,l=()=>s!=null?s:s=Qt(i,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),a=S=>S?en(S,l,o,S.source):null,d=(y=e.sources)!=null?y:ro,c={win:i,cookies:t.cookies},u=a(Zt(r));if(u)return u;let f=a(Oe(c,d.filter(S=>no.has(S))));if(f)return f;let p=_a(t.searches,t.base);for(let S of p){let E=Ca(S);if(!E)continue;let A=en(E,()=>E.consentGranted?{granted:!0,by:"url"}:l(),o,"url");if(A)return A}for(let S of p){let E=va(S,e.urlParams);if(E)return{code:E,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}for(let S of(m=e.contextCookies)!=null?m:e.contextCookie?[e.contextCookie]:[]){let E=xa(wa(t.cookies,S)),A=E?en(E,l,o,"cookie"):null;if(A)return A}return a(Oe(c,d.filter(S=>!no.has(S))))}var Pa=new Set(["/v1/client/sign_ups","/v1/client/sign_ups/passkey","/v1/client/sign_ins","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/id_token/nonce","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/client/sign_ins/passkey/finish","/v1/oauth/telegram","/v1/oauth/siwe/nonce","/v1/oauth/siwe/verify","/v1/oauth/siws/nonce","/v1/oauth/siws/verify","/v1/oauth/siwf/nonce","/v1/oauth/siwf/verify"]),Ra=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function so(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return Pa.has(t)||Ra.test(t)}var ve=()=>typeof window=="undefined"?null:window,Xe=[],ke=null;function nn(){var t,n;let e=(n=(t=ve())==null?void 0:t.location)==null?void 0:n.search;!e||Xe.includes(e)||(Xe.push(e),ke!=null||(ke=new Date().toISOString()))}nn();ve()&&Xt(ve());var tn={};var be=new Map;function ao(e,t){return`${e!=null?e:""}|${t}`}function lo(e,t){!Le(t)||!("referrals"in t)||be.set(e,Promise.resolve(io(t)))}function co(e){let t=be.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(be.get(n)===t&&be.delete(n),{...oo,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?io(o.data):r()).catch(r),be.set(n,t)}return t}function uo(e){var n,r,o;let t=ve();return be.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||Xe.length>0||Zt(rn(e).referralSource)!==null||Oe({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},Jt)!==null}function rn(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:tn.referral,referralConsent:(r=t.referralConsent)!=null?r:tn.referralConsent,referralSource:(o=t.referralSource)!=null?o:tn.referralSource}}async function on(e){var r,o,i,s,l;let t=ve();if(!t)return null;let n=rn(e);if(n.referral===!1)return null;try{let a=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!uo(e))return null;let d=await co(e);return d.enabled?(Xt(t),Ea(d,{searches:[a,...Xe],cookies:(s=(i=t.document)==null?void 0:i.cookie)!=null?s:null,win:t,base:(l=t.location)==null?void 0:l.href,capturedAt:ke!=null?ke:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function sn(e){if(!ve()||rn(e).referral===!1||!uo(e))return!1;try{if((await co(e)).challengeReferredSignups!=="always")return!1;let n=await on(e);return!!(n!=null&&n.code)}catch{return!1}}var po=typeof window!="undefined",De=()=>typeof navigator!="undefined"?navigator:void 0;function D(e,t){try{return e()}catch{return t}}function Ta(){return D(()=>{if(!po||typeof document=="undefined")return{vendor:null,renderer:null};let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{vendor:null,renderer:null};let n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,o=n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null;return{vendor:r!=null?r:null,renderer:o!=null?o:null}},{vendor:null,renderer:null})}function Ia(){return D(()=>{if(typeof document=="undefined")return null;let e=document.createElement("canvas");e.width=220,e.height=40;let t=e.getContext("2d");return t?(t.textBaseline="top",t.font="14px 'Arial'",t.fillStyle="#f60",t.fillRect(0,0,60,20),t.fillStyle="#069",t.fillText("Atlas anti-bot \u2708 1.0",2,15),cn(e.toDataURL())):null},null)}function Oa(){var l;let e=De(),t=po?window:{},n=(l=e==null?void 0:e.userAgent)!=null?l:"",r=D(()=>(e==null?void 0:e.webdriver)===!0,!1),o=D(()=>"chrome"in t&&!!t.chrome,!1),i=/headless/i.test(n)||/chrome/i.test(n)&&!o&&D(()=>{var a,d;return((d=(a=e==null?void 0:e.plugins)==null?void 0:a.length)!=null?d:0)===0},!1),s=D(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(a=>a.startsWith("cdc_")||a.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:i,hasChrome:o,automationHint:s}}function La(){let e=De(),t=Ta(),n=Oa(),r=D(()=>{var i;return Array.from((i=e==null?void 0:e.languages)!=null?i:[])},[]),o=t.renderer;return{screenWidth:D(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.width)!=null?s:null},null),screenHeight:D(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.height)!=null?s:null},null),colorDepth:D(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.colorDepth)!=null?s:null},null),pixelRatio:D(()=>{var i;return(i=window.devicePixelRatio)!=null?i:null},null),timezone:D(()=>{var i;return(i=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?i:null},null),timezoneOffset:D(()=>new Date().getTimezoneOffset(),null),language:D(()=>{var i;return(i=e==null?void 0:e.language)!=null?i:null},null),languages:r,platform:D(()=>{var i;return(i=e==null?void 0:e.platform)!=null?i:null},null),hardwareConcurrency:D(()=>{var i;return(i=e==null?void 0:e.hardwareConcurrency)!=null?i:null},null),deviceMemory:D(()=>{var i;return(i=e==null?void 0:e.deviceMemory)!=null?i:null},null),maxTouchPoints:D(()=>{var i;return(i=e==null?void 0:e.maxTouchPoints)!=null?i:null},null),touchSupport:D(()=>{var i;return((i=e==null?void 0:e.maxTouchPoints)!=null?i:0)>0||"ontouchstart"in window},!1),cookieEnabled:D(()=>{var i;return(i=e==null?void 0:e.cookieEnabled)!=null?i:null},null),doNotTrack:D(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:D(()=>{var i,s;return(s=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?s:null},null),pointerType:D(()=>{var i,s;return(s=(i=window.matchMedia)==null?void 0:i.call(window,"(pointer: fine)"))!=null&&s.matches?"fine":"coarse"},null),webdriver:n.webdriver,headless:n.headless,hasChrome:n.hasChrome,webglSoftware:o?/swiftshader|llvmpipe|software|basic render/i.test(o):!1,automationHint:n.automationHint}}function Da(){var e;return(e=D(()=>{var o,i;let t=De(),n=typeof window!="undefined"?window:void 0,r=(i=(o=t==null?void 0:t.doNotTrack)!=null?o:t==null?void 0:t.msDoNotTrack)!=null?i:n==null?void 0:n.doNotTrack;return r==="1"||r==="yes"},!1))!=null?e:!1}function ln(){return D(()=>{let e=()=>{var r,o;return"d_"+cn(String(Math.random())+String(Date.now())+((o=(r=De())==null?void 0:r.userAgent)!=null?o:""))};if(Da())return e();if(typeof localStorage=="undefined")return null;let t="__atlas_did",n=localStorage.getItem(t);return n||(n=e(),localStorage.setItem(t,n)),n},null)}function Fa(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,Ia()];return cn(t.map(n=>n==null?"":String(n)).join("|"))}function cn(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")}var Qe=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,an=e=>{let t=Qe(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},et=class{constructor(t){k(this,"start",Date.now());k(this,"firstInteraction",null);k(this,"moves",0);k(this,"distance",0);k(this,"maxSpeed",0);k(this,"speeds",[]);k(this,"lastX",null);k(this,"lastY",null);k(this,"lastMoveT",0);k(this,"netDx",0);k(this,"netDy",0);k(this,"keyCount",0);k(this,"downAt",new Map);k(this,"dwell",[]);k(this,"flight",[]);k(this,"lastUpAt",null);k(this,"pastes",0);k(this,"backspaces",0);k(this,"focusChanges",0);k(this,"scrolls",0);k(this,"target");k(this,"bound",[]);this.target=t!=null?t:typeof document!="undefined"?document:void 0,this.attach()}mark(){this.firstInteraction===null&&(this.firstInteraction=Date.now()-this.start)}attach(){let t=this.target;if(!t)return;let n=(r,o)=>{D(()=>t.addEventListener(r,o,{passive:!0}),void 0),this.bound.push([r,o])};n("pointermove",r=>this.onMove(r)),n("mousemove",r=>this.onMove(r)),n("keydown",r=>this.onKeyDown(r)),n("keyup",r=>this.onKeyUp(r)),n("paste",()=>{this.mark(),this.pastes+=1}),n("focusin",()=>{this.mark(),this.focusChanges+=1}),n("scroll",()=>{this.mark(),this.scrolls+=1})}onMove(t){var i,s;this.mark();let n=(i=t.clientX)!=null?i:0,r=(s=t.clientY)!=null?s:0,o=Date.now();if(this.lastX!==null&&this.lastY!==null){let l=n-this.lastX,a=r-this.lastY,d=Math.hypot(l,a);this.distance+=d,this.netDx+=l,this.netDy+=a;let c=o-this.lastMoveT;if(c>0){let u=d/c;this.speeds.push(u),u>this.maxSpeed&&(this.maxSpeed=u)}}this.moves+=1,this.lastX=n,this.lastY=r,this.lastMoveT=o}onKeyDown(t){this.mark(),this.keyCount+=1,t.key==="Backspace"&&(this.backspaces+=1),this.downAt.set(t.code||t.key||String(this.keyCount),Date.now()),this.lastUpAt!==null&&this.flight.push(Date.now()-this.lastUpAt)}onKeyUp(t){let n=t.code||t.key||"",r=this.downAt.get(n),o=Date.now();r!==void 0&&(this.dwell.push(o-r),this.downAt.delete(n)),this.lastUpAt=o}snapshot(){let t=Math.hypot(this.netDx,this.netDy);return{mouseMoves:this.moves,mouseDistance:Math.round(this.distance),mouseAvgSpeed:Qe(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:an(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:Qe(this.dwell),keyAvgFlightMs:Qe(this.flight),keyDwellVariance:an(this.dwell),keyFlightVariance:an(this.flight),pasteCount:this.pastes,backspaceCount:this.backspaces,timeToFirstInteractionMs:this.firstInteraction,timeToSubmitMs:Date.now()-this.start,focusChanges:this.focusChanges,scrollCount:this.scrolls,hadPointerMove:this.moves>0,hadKeydown:this.keyCount>0,interactionCount:this.moves+this.keyCount+this.scrolls+this.focusChanges}}stop(){let t=this.target;if(t){for(let[n,r]of this.bound)D(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function fo(e){return D(async()=>{var a,d,c;let t=La(),n={attempt_id:e.attemptId,kind:(a=e.kind)!=null?a:"telemetry",device_id:ln(),device_fingerprint:Fa(t),device:t,behavior:(d=e.recorder)==null?void 0:d.snapshot()},r=`${e.api}/v1/client/telemetry?publishable_key=${encodeURIComponent(e.publishableKey)}`,o=JSON.stringify(n),i=De();if(!e.fetchImpl&&i&&typeof i.sendBeacon=="function"&&typeof Blob!="undefined"&&i.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let s=(c=e.fetchImpl)!=null?c:typeof fetch!="undefined"?fetch:void 0;return s?(await s(r,{method:"POST",headers:{"content-type":"application/json","x-publishable-key":e.publishableKey},body:o,keepalive:!0,credentials:"include"})).ok:!1},Promise.resolve(!1))}var Ma=["checkbox","scroll","link"];function j(e){return typeof e=="string"&&e!==""?e:null}function Ua(e){return typeof e=="number"&&Number.isFinite(e)?new Date(e).toISOString():j(e)}function un(e){var a,d,c,u,f;if(!e||typeof e!="object")return null;let t=e,n=[t.version,t.current_version].find(p=>p&&typeof p=="object"),r=p=>t[p]!==void 0?t[p]:n==null?void 0:n[p],o=(a=j(t.key))!=null?a:j(t.policy),i=(d=j(r("version_id")))!=null?d:j(n==null?void 0:n.id);if(!o||!i)return null;let s=Ma.includes(t.display)?t.display:"checkbox",l=(c=j(typeof t.version=="string"?t.version:n==null?void 0:n.version))!=null?c:"";return{key:o,title:(u=j(t.title))!=null?u:o,display:s,required:t.required!==!1,appliesTo:t.applies_to==="sign_in_and_sign_up"?"sign_in_and_sign_up":"sign_up",versionId:i,version:l,contentHtml:j(r("content_html")),contentMarkdown:j(r("content_markdown")),contentUrl:j(r("content_url")),contentSha256:(f=j(r("content_sha256")))!=null?f:"",effectiveAt:Ua(r("effective_at")),summaryOfChanges:j(r("summary_of_changes")),reaccept:typeof t.reaccept=="boolean"?t.reaccept:null}}function $a(e){var n;let t=Array.isArray(e)?e:e&&typeof e=="object"?(n=e.policies)!=null?n:e.data:null;return Array.isArray(t)?t.map(un).filter(r=>r!==null):[]}function pn(e){return!!(e!=null&&e.some(t=>t.code==="POLICY_ACCEPTANCE_REQUIRED"))}async function Fe(e,t={}){let n=await Ar(e,t.locale?{locale:t.locale}:{});if(!n.ok)return[];let r=$a(n.data);return t.signIn?r.filter(o=>o.appliesTo==="sign_in_and_sign_up"):r}function go(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}var _e=class{constructor(t=[],n={}){k(this,"list",[]);k(this,"entries",new Map);k(this,"open",null);k(this,"listeners",new Set);k(this,"now");k(this,"combined");var r;this.combined=n.combined!==!1,this.now=(r=n.now)!=null?r:()=>Date.now(),this.setPolicies(t)}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(){for(let t of[...this.listeners])t()}entry(t){let n=this.list.find(i=>i.key===t),r=n?n.versionId:t,o=this.entries.get(r);return o||(o={checked:!1,scrolledToEnd:!1,viewMs:0,openedAt:null},this.entries.set(r,o)),o}get policies(){return this.list}get viewing(){var t;return(t=this.list.find(n=>n.key===this.open))!=null?t:null}snapshot(){let t=this.checkboxPolicies();return{policies:this.list,combined:this.combined,viewing:this.open,combinedChecked:t.length>0&&t.every(n=>this.isChecked(n.key))}}setPolicies(t){this.list=t,this.open&&!t.some(n=>n.key===this.open)&&(this.open=null),this.emit()}checkboxPolicies(){return this.list.filter(t=>t.display==="checkbox")}scrollPolicies(){return this.list.filter(t=>t.display==="scroll")}linkPolicies(){return this.list.filter(t=>t.display==="link")}isChecked(t){let n=this.list.find(r=>r.key===t);return n?n.display==="link"?!0:this.entry(t).checked:!1}setChecked(t,n){this.entry(t).checked=n,this.emit()}setAllChecked(t){for(let n of this.checkboxPolicies())this.entry(n.key).checked=t;this.emit()}acceptScroll(t){let n=this.entry(t);n.checked=!0,n.scrolledToEnd=!0,this.emit()}pendingScroll(){var t;return(t=this.scrollPolicies().find(n=>!this.isChecked(n.key)))!=null?t:null}openDocument(t){this.open&&this.closeDocument(),this.list.some(n=>n.key===t)&&(this.open=t,this.entry(t).openedAt=this.now(),this.emit())}closeDocument(){this.open&&(this.stopClock(this.open),this.open=null,this.emit())}startClock(t){let n=this.entry(t);n.openedAt===null&&(n.openedAt=this.now())}stopClock(t){let n=this.entry(t);n.openedAt!==null&&(n.viewMs+=Math.max(0,this.now()-n.openedAt),n.openedAt=null)}markScrolledToEnd(t){let n=this.entry(t);n.scrolledToEnd||(n.scrolledToEnd=!0,this.emit())}hasScrolledToEnd(t){return this.entry(t).scrolledToEnd}viewMs(t){let n=this.entry(t);return Math.round(n.viewMs+(n.openedAt!==null?Math.max(0,this.now()-n.openedAt):0))}missing(){return this.list.filter(t=>t.required&&!this.isChecked(t.key))}satisfied(){return this.missing().length===0}canSubmit(){return this.list.every(t=>!t.required||t.display==="scroll"||this.isChecked(t.key))}build(){let t=[];for(let n of this.list){if(!this.isChecked(n.key))continue;let r=this.entry(n.key),o=this.viewMs(n.key);t.push({policy:n.key,version_id:n.versionId,content_sha256:n.contentSha256,display:n.display,...n.display==="scroll"||r.scrolledToEnd?{scrolled_to_end:r.scrolledToEnd}:{},...o>0?{view_ms:o}:{}})}return t}};function Na(e,t=2){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function fn(e,t,n){let r=!1,o=null,i=()=>{r||(r=!0,l(),n())},s=()=>{Na(e)&&i()},l=()=>{o==null||o.disconnect(),e.removeEventListener("scroll",s),typeof window!="undefined"&&window.removeEventListener("resize",s)};return t&&typeof IntersectionObserver!="undefined"&&(o=new IntersectionObserver(a=>{a.some(d=>d.isIntersecting)&&i()},{root:e,threshold:0}),o.observe(t)),e.addEventListener("scroll",s,{passive:!0}),typeof window!="undefined"&&window.addEventListener("resize",s),s(),()=>{r=!0,l()}}var za='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function mo(e,t={}){var s;let n=e.ownerDocument,r=n.activeElement,o=l=>{if(l.key==="Escape"&&t.escape!==!0){l.preventDefault(),l.stopPropagation();return}if(l.key!=="Tab")return;let a=Array.from(e.querySelectorAll(za)).filter(f=>!f.hasAttribute("hidden"));if(a.length===0){l.preventDefault(),e.focus();return}let d=a[0],c=a[a.length-1],u=n.activeElement;l.shiftKey&&(u===d||!e.contains(u))?(l.preventDefault(),c.focus()):!l.shiftKey&&(u===c||!e.contains(u))&&(l.preventDefault(),d.focus())},i=l=>{var a;l.target instanceof Node&&!e.contains(l.target)&&((a=t.initialFocus)!=null?a:e).focus()};return n.addEventListener("keydown",o,!0),n.addEventListener("focusin",i),((s=t.initialFocus)!=null?s:e).focus(),()=>{var l;n.removeEventListener("keydown",o,!0),n.removeEventListener("focusin",i),(l=r==null?void 0:r.focus)==null||l.call(r)}}function Ba(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function dn(e){let t=Ba(e);return t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t=t.replace(/(^|[^*])\*([^*\s][^*]*)\*/g,"$1<em>$2</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t}function Ha(e){let t=e.replace(/\r\n?/g,`
3
+ `}async function Eo(e){var n;let t=(n=globalThis.navigator)==null?void 0:n.clipboard;if(!(t!=null&&t.writeText))return!1;try{return await t.writeText(e.join(`
4
+ `)),!0}catch{return!1}}function Cn(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function Ro(e,t="recovery-codes.txt"){var r;if(!Cn())return!1;let n=URL.createObjectURL(new Blob([ul(e)],{type:"text/plain;charset=utf-8"}));try{let o=document.createElement("a");return o.href=n,o.download=t,o.rel="noopener",o.style.display="none",((r=document.body)!=null?r:document.documentElement).appendChild(o),o.click(),o.remove(),!0}catch{return!1}finally{setTimeout(()=>URL.revokeObjectURL(n),0)}}var pl=/^[A-Za-z0-9_-]{3,64}$/,Ae=e=>!!e&&typeof e=="object"&&!Array.isArray(e),An=e=>typeof e=="string"&&pl.test(e.trim())?e.trim():null,En=["referalli","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Fo=["atlasconsent","cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode","gpc"];function C(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function le(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function Ze(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`)){let o=r.slice(t.length+1);try{return decodeURIComponent(o)}catch{return o}}}return null}function Do(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e=="string"&&e&&e.length<=40){if(/^\d{9,13}$/.test(e))return Do(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function ye(e,t,n,r,o){let i={source:e,code:An(t),clickId:An(n),anonId:An(r)},s=Do(o);return s&&(i.capturedAt=s),i.code||i.clickId||i.anonId?i:null}var fl={referalli:({win:e})=>{var r,o;let t=C(e,"aff"),n=le(C(t,"getReferral"),t);return Ae(n)?ye("referalli",n.code,(r=n.clickId)!=null?r:n.click_id,(o=n.anonId)!=null?o:n.anon_id,n.ts):null},rewardful:({win:e})=>{let t=C(e,"Rewardful");return ye("rewardful",C(C(t,"affiliate"),"token"),C(t,"referral"),null)},tolt:({win:e})=>ye("tolt",null,C(e,"tolt_referral"),null),promotekit:({win:e})=>ye("promotekit",null,C(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>ye("firstpromoter",Ze(e,"_fprom_ref"),Ze(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>ye("partnerstack",Ze(e,"ps_partner_key"),Ze(e,"ps_xid"),null),dub:({cookies:e})=>ye("dub",null,Ze(e,"dub_id"),null)};function Rn(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return Ae(t)?ye("custom",t.code,(n=t.clickId)!=null?n:t.click_id,(r=t.anonId)!=null?r:t.anon_id,(o=t.capturedAt)!=null?o:t.ts):null}function Xe(e,t){for(let n of t){let o=fl[n==="referally"?"referalli":n];if(!o)continue;let i=null;try{i=o(e)}catch{i=null}if(i)return i}return null}var gl={necessary:"necessary",essential:"necessary",strictly_necessary:"necessary",preferences:"preferences",functional:"preferences",functionality:"preferences",personalization:"preferences",statistics:"statistics",analytics:"statistics",performance:"statistics",marketing:"marketing",advertising:"marketing",advertisement:"marketing",targeting:"marketing",ads:"marketing"};function Lo(e){var t;return(t=gl[e.trim().toLowerCase()])!=null?t:null}var he=e=>typeof e=="boolean"?e:void 0;function ue(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let i=Lo(r),s=i?e[i]:void 0;return s?t(s):void 0}}var Pn=null,To=!1;function Tn(e){let t=C(e,"__tcfapi");To||typeof t!="function"||(To=!0,le(t,e,"addEventListener",2,(n,r)=>{r&&Ae(n)&&(Pn=n)}))}function ml(e){if(Pn)return Pn;let t=null;return le(C(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&Ae(n)&&(t=n)}),t}var Io={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Oo=(e,t)=>Array.isArray(e)&&e.includes(t),hl={atlasconsent:{present:e=>C(C(e,"__atlasConsent"),"version")===1&&typeof C(C(e,"__atlasConsent"),"has")=="function",ask:(e,t)=>{let n=C(e,"__atlasConsent"),r=le(C(n,"has"),n,t);return r===!0?!0:r===!1?!1:void 0}},cookiemunch:{present:e=>Ae(C(C(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=C(C(e,"CookieMunch"),"consent");return ue(Io,r=>he(C(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=C(e,"OnetrustActiveGroups"))!=null?t:C(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=C(e,"OnetrustActiveGroups"))!=null?r:C(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(i=>i.trim()).filter(Boolean);return ue({necessary:"C0001",statistics:"C0002",preferences:"C0003",marketing:"C0004"},i=>/^C\d{4}$/.test(i)||n.includes(i)?n.includes(i):void 0)(e,t)}},cookiebot:{present:e=>!C(e,"CookieMunch")&&Ae(C(C(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=C(C(e,"Cookiebot"),"consent");return ue(Io,r=>he(C(n,r)))(e,t)}},didomi:{present:e=>typeof C(C(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=C(e,"Didomi"),r=C(C(le(C(n,"getUserStatus"),n),"purposes"),"global"),o=C(r,"enabled"),i=C(r,"disabled");return ue({marketing:"cookies",statistics:"measure_content_performance"},s=>Oo(o,s)?!0:Oo(i,s)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof C(C(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=C(e,"UC_UI"),r=le(C(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return ue({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let i=r.filter(s=>C(s,"categorySlug")===o);return i.length?i.every(s=>C(C(s,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof C(C(C(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=C(C(e,"Osano"),"cm"),r=le(C(n,"getConsent"),n);return ue({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var s;let i=(s=C(r,o))!=null?s:C(r,o.toUpperCase());return i==="ACCEPT"?!0:i==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof C(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=C(le(C(e,"getCkyConsent"),e),"categories");return ue({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>he(C(n,r)))(e,t)}},complianz:{present:e=>typeof C(e,"cmplz_has_consent")=="function",ask:(e,t)=>ue({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>he(le(C(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof C(C(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=C(e,"klaro"),r=C(le(C(n,"getManager"),n),"consents");return he(C(r,t))}},tcf:{present:e=>typeof C(e,"__tcfapi")=="function",ask:e=>{var n;let t=ml(e);if(t)return t.gdprApplies===!1?!0:(n=he(C(C(C(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>Ae(C(C(C(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=C(C(C(e,"google_tag_data"),"ics"),"entries");return ue({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var i;let o=C(n,r);return(i=he(C(o,"update")))!=null?i:he(C(o,"default"))})(e,t)}},gpc:{present:e=>C(C(e,"navigator"),"globalPrivacyControl")===!0,ask:(e,t)=>t==="marketing"||t==="referrals"?!1:void 0}};function yl(e){let t=e;if(typeof e=="function")try{t=e()}catch{t=void 0}if(t==="granted"||t===!0)return!0;if(t==="denied"||t===!1)return!1}function et(e,t,n={}){let r=n.provider||"auto",o=()=>{let a=yl(n.appConsent);return a===void 0?{granted:!1,by:"none"}:{granted:a,by:"app"}};if(r==="app")return o();let i=r==="auto"?Fo:[r],s=t.filter(a=>typeof a=="string"&&a.trim().length>0);for(let a of i){let l=hl[a],c=!1;try{c=!!l&&l.present(e)}catch{c=!1}if(!(!l||!c)){for(let d of s){let u;try{u=l.ask(e,d)}catch{u=void 0}if(u!==void 0)return{granted:u,by:a}}return{granted:!1,by:a}}}return o()}var $o=new Set(["referalli","rewardful","tolt","promotekit"]),Mo=["referalli"],Uo=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,contextCookies:[],consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),bl=/^[A-Za-z0-9_-]{3,64}$/,kl=/^[A-Za-z0-9_.-]{1,40}$/,_l=/^[A-Za-z0-9_.-]{1,64}$/,tt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function be(e){if(typeof e!="string")return null;let t=e.trim();return bl.test(t)?t:null}function zo(e){var i;let t=tt(e)&&tt(e.referrals)?e.referrals:e;if(!tt(t)||t.enabled!==!0)return{...Uo,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(s=>typeof s=="string"&&kl.test(s)).slice(0,10):[],r=Array.isArray(t.browser_sources)?t.browser_sources.filter(s=>typeof s=="string"&&/^[a-z0-9_]{1,40}$/.test(s)).map(s=>s==="referally"?"referalli":s).slice(0,20):[...Mo],o=(Array.isArray(t.context_cookies)?t.context_cookies:typeof t.context_cookie=="string"?[t.context_cookie]:[]).filter(s=>typeof s=="string"&&_l.test(s)).filter((s,a,l)=>l.indexOf(s)===a).slice(0,5);return{enabled:!0,sources:r,consentProvider:typeof t.consent_provider=="string"&&/^[a-z0-9_]{1,40}$/.test(t.consent_provider)?t.consent_provider:"auto",urlParams:n.length?n:["ref","via","aff"],contextCookie:(i=o[0])!=null?i:null,contextCookies:o,consentCategory:typeof t.consent_category=="string"&&t.consent_category?t.consent_category:"referrals",consentFallbackCategory:typeof t.consent_fallback_category=="string"&&t.consent_fallback_category?t.consent_fallback_category:null,challengeReferredSignups:t.challenge_referred_signups==="always"?"always":"inherit",codeLookupUrl:typeof t.code_lookup_url=="string"&&/^https?:\/\//i.test(t.code_lookup_url)&&t.code_lookup_url.includes("{code}")?t.code_lookup_url:null,signupCodeField:t.signup_code_field===!0}}function vl(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=be(n.get(r));if(o)return o}return null}function xl(e,t){let n=[],r=o=>{o&&!n.includes(o)&&n.push(o)};for(let o of e)r(o);for(let o of e){let i;try{i=new URLSearchParams(o)}catch{continue}for(let s of["redirect_url","after_url","redirect_url_complete","after_sign_up_url","after_sign_in_url"]){let a=i.get(s);if(a)try{r(new URL(a,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function xt(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e!="string"||!e||e.length>40)return null;if(/^\d{9,13}$/.test(e))return xt(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function wl(e,t=Date.now()){var s,a,l;if(typeof e!="string"||!e||e.length>4096)return null;let n=e;try{n=decodeURIComponent(e)}catch{}let r=c=>{if(!c.startsWith("{"))return null;try{let d=JSON.parse(c);return tt(d)?d:null}catch{return null}},o=(s=r(e.trim()))!=null?s:r(n.trim());if(o){let c=xt(o.exp);if(c&&Date.parse(c)<=t)return null;let d={code:be(o.code),clickId:be((a=o.clickId)!=null?a:o.click_id),anonId:be((l=o.anonId)!=null?l:o.anon_id)},u=xt(o.ts);return u&&(d.capturedAt=u),d.code||d.clickId||d.anonId?d:null}let i=be(n);return i?{code:null,clickId:i,anonId:null}:null}function Sl(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`))return r.slice(t.length+1)}return null}var Cl=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Al(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!Cl.some(i=>t.get(i)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:be(t.get("ref")),clickId:be(t.get("ref_click_id")),anonId:be(t.get("ref_anon_id")),consentGranted:n},o=xt(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function In(e,t,n,r){var l;let i=!!(e.clickId||e.anonId)?t():null,s=!!(i!=null&&i.granted),a={code:e.code,click_id:s?e.clickId:null,anon_id:s?e.anonId:null,consent:s?"granted":"not_required",captured_at:(l=e.capturedAt)!=null?l:n,source:r,...i?{consent_by:i.by}:{}};return a.code||a.click_id||a.anon_id?a:null}function Pl(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function El(e,t,n,r){var g,m,h;if(!e.enabled)return null;let o=(g=t.capturedAt)!=null?g:new Date().toISOString(),i=Pl(t),s,a=()=>s!=null?s:s=et(i,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),l=w=>w?In(w,a,o,w.source):null,c=(m=e.sources)!=null?m:Mo,d={win:i,cookies:t.cookies},u=l(Rn(r));if(u)return u;let p=l(Xe(d,c.filter(w=>$o.has(w))));if(p)return p;let f=xl(t.searches,t.base);for(let w of f){let P=Al(w);if(!P)continue;let A=In(P,()=>P.consentGranted?{granted:!0,by:"url"}:a(),o,"url");if(A)return A}for(let w of f){let P=vl(w,e.urlParams);if(P)return{code:P,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}for(let w of(h=e.contextCookies)!=null?h:e.contextCookie?[e.contextCookie]:[]){let P=wl(Sl(t.cookies,w)),A=P?In(P,a,o,"cookie"):null;if(A)return A}return l(Xe(d,c.filter(w=>!$o.has(w))))}var Rl=new Set(["/v1/client/sign_ups","/v1/client/sign_ups/passkey","/v1/client/sign_ins","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/wsfed","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/id_token/nonce","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/client/sign_ins/passkey/finish","/v1/oauth/telegram","/v1/oauth/siwe/nonce","/v1/oauth/siwe/verify","/v1/oauth/siws/nonce","/v1/oauth/siws/verify","/v1/oauth/siwb/nonce","/v1/oauth/siwb/verify","/v1/oauth/siwf/nonce","/v1/oauth/siwf/verify"]),Tl=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function No(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return Rl.has(t)||Tl.test(t)}var Me=()=>typeof window=="undefined"?null:window,wt=[],$e=null;function Fn(){var t,n;let e=(n=(t=Me())==null?void 0:t.location)==null?void 0:n.search;!e||wt.includes(e)||(wt.push(e),$e!=null||($e=new Date().toISOString()))}Fn();Me()&&Tn(Me());var On={};var Le=new Map;function Bo(e,t){return`${e!=null?e:""}|${t}`}function jo(e,t){!tt(t)||!("referrals"in t)||Le.set(e,Promise.resolve(zo(t)))}function Ho(e){let t=Le.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(Le.get(n)===t&&Le.delete(n),{...Uo,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?zo(o.data):r()).catch(r),Le.set(n,t)}return t}function qo(e){var n,r,o;let t=Me();return Le.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||wt.length>0||Rn(Dn(e).referralSource)!==null||Xe({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},En)!==null}function Dn(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:On.referral,referralConsent:(r=t.referralConsent)!=null?r:On.referralConsent,referralSource:(o=t.referralSource)!=null?o:On.referralSource}}async function Ln(e){var r,o,i,s,a;let t=Me();if(!t)return null;let n=Dn(e);if(n.referral===!1)return null;try{let l=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!qo(e))return null;let c=await Ho(e);return c.enabled?(Tn(t),El(c,{searches:[l,...wt],cookies:(s=(i=t.document)==null?void 0:i.cookie)!=null?s:null,win:t,base:(a=t.location)==null?void 0:a.href,capturedAt:$e!=null?$e:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function $n(e){if(!Me()||Dn(e).referral===!1||!qo(e))return!1;try{if((await Ho(e)).challengeReferredSignups!=="always")return!1;let n=await Ln(e);return!!(n!=null&&n.code)}catch{return!1}}var Wo=typeof window!="undefined",nt=()=>typeof navigator!="undefined"?navigator:void 0;function N(e,t){try{return e()}catch{return t}}function Il(){return N(()=>{if(!Wo||typeof document=="undefined")return{vendor:null,renderer:null};let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{vendor:null,renderer:null};let n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,o=n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null;return{vendor:r!=null?r:null,renderer:o!=null?o:null}},{vendor:null,renderer:null})}function Ol(){return N(()=>{if(typeof document=="undefined")return null;let e=document.createElement("canvas");e.width=220,e.height=40;let t=e.getContext("2d");return t?(t.textBaseline="top",t.font="14px 'Arial'",t.fillStyle="#f60",t.fillRect(0,0,60,20),t.fillStyle="#069",t.fillText("Atlas anti-bot \u2708 1.0",2,15),zn(e.toDataURL())):null},null)}function Fl(){var a;let e=nt(),t=Wo?window:{},n=(a=e==null?void 0:e.userAgent)!=null?a:"",r=N(()=>(e==null?void 0:e.webdriver)===!0,!1),o=N(()=>"chrome"in t&&!!t.chrome,!1),i=/headless/i.test(n)||/chrome/i.test(n)&&!o&&N(()=>{var l,c;return((c=(l=e==null?void 0:e.plugins)==null?void 0:l.length)!=null?c:0)===0},!1),s=N(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(l=>l.startsWith("cdc_")||l.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:i,hasChrome:o,automationHint:s}}function Dl(){let e=nt(),t=Il(),n=Fl(),r=N(()=>{var i;return Array.from((i=e==null?void 0:e.languages)!=null?i:[])},[]),o=t.renderer;return{screenWidth:N(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.width)!=null?s:null},null),screenHeight:N(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.height)!=null?s:null},null),colorDepth:N(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.colorDepth)!=null?s:null},null),pixelRatio:N(()=>{var i;return(i=window.devicePixelRatio)!=null?i:null},null),timezone:N(()=>{var i;return(i=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?i:null},null),timezoneOffset:N(()=>new Date().getTimezoneOffset(),null),language:N(()=>{var i;return(i=e==null?void 0:e.language)!=null?i:null},null),languages:r,platform:N(()=>{var i;return(i=e==null?void 0:e.platform)!=null?i:null},null),hardwareConcurrency:N(()=>{var i;return(i=e==null?void 0:e.hardwareConcurrency)!=null?i:null},null),deviceMemory:N(()=>{var i;return(i=e==null?void 0:e.deviceMemory)!=null?i:null},null),maxTouchPoints:N(()=>{var i;return(i=e==null?void 0:e.maxTouchPoints)!=null?i:null},null),touchSupport:N(()=>{var i;return((i=e==null?void 0:e.maxTouchPoints)!=null?i:0)>0||"ontouchstart"in window},!1),cookieEnabled:N(()=>{var i;return(i=e==null?void 0:e.cookieEnabled)!=null?i:null},null),doNotTrack:N(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:N(()=>{var i,s;return(s=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?s:null},null),pointerType:N(()=>{var i,s;return(s=(i=window.matchMedia)==null?void 0:i.call(window,"(pointer: fine)"))!=null&&s.matches?"fine":"coarse"},null),webdriver:n.webdriver,headless:n.headless,hasChrome:n.hasChrome,webglSoftware:o?/swiftshader|llvmpipe|software|basic render/i.test(o):!1,automationHint:n.automationHint}}function Ll(){var e;return(e=N(()=>{var o,i;let t=nt(),n=typeof window!="undefined"?window:void 0,r=(i=(o=t==null?void 0:t.doNotTrack)!=null?o:t==null?void 0:t.msDoNotTrack)!=null?i:n==null?void 0:n.doNotTrack;return r==="1"||r==="yes"},!1))!=null?e:!1}function Un(){return N(()=>{let e=()=>{var r,o;return"d_"+zn(String(Math.random())+String(Date.now())+((o=(r=nt())==null?void 0:r.userAgent)!=null?o:""))};if(Ll())return e();if(typeof localStorage=="undefined")return null;let t="__atlas_did",n=localStorage.getItem(t);return n||(n=e(),localStorage.setItem(t,n)),n},null)}function $l(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,Ol()];return zn(t.map(n=>n==null?"":String(n)).join("|"))}function zn(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")}var St=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,Mn=e=>{let t=St(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},Ct=class{constructor(t){v(this,"start",Date.now());v(this,"firstInteraction",null);v(this,"moves",0);v(this,"distance",0);v(this,"maxSpeed",0);v(this,"speeds",[]);v(this,"lastX",null);v(this,"lastY",null);v(this,"lastMoveT",0);v(this,"netDx",0);v(this,"netDy",0);v(this,"keyCount",0);v(this,"downAt",new Map);v(this,"dwell",[]);v(this,"flight",[]);v(this,"lastUpAt",null);v(this,"pastes",0);v(this,"backspaces",0);v(this,"focusChanges",0);v(this,"scrolls",0);v(this,"target");v(this,"bound",[]);this.target=t!=null?t:typeof document!="undefined"?document:void 0,this.attach()}mark(){this.firstInteraction===null&&(this.firstInteraction=Date.now()-this.start)}attach(){let t=this.target;if(!t)return;let n=(r,o)=>{N(()=>t.addEventListener(r,o,{passive:!0}),void 0),this.bound.push([r,o])};n("pointermove",r=>this.onMove(r)),n("mousemove",r=>this.onMove(r)),n("keydown",r=>this.onKeyDown(r)),n("keyup",r=>this.onKeyUp(r)),n("paste",()=>{this.mark(),this.pastes+=1}),n("focusin",()=>{this.mark(),this.focusChanges+=1}),n("scroll",()=>{this.mark(),this.scrolls+=1})}onMove(t){var i,s;this.mark();let n=(i=t.clientX)!=null?i:0,r=(s=t.clientY)!=null?s:0,o=Date.now();if(this.lastX!==null&&this.lastY!==null){let a=n-this.lastX,l=r-this.lastY,c=Math.hypot(a,l);this.distance+=c,this.netDx+=a,this.netDy+=l;let d=o-this.lastMoveT;if(d>0){let u=c/d;this.speeds.push(u),u>this.maxSpeed&&(this.maxSpeed=u)}}this.moves+=1,this.lastX=n,this.lastY=r,this.lastMoveT=o}onKeyDown(t){this.mark(),this.keyCount+=1,t.key==="Backspace"&&(this.backspaces+=1),this.downAt.set(t.code||t.key||String(this.keyCount),Date.now()),this.lastUpAt!==null&&this.flight.push(Date.now()-this.lastUpAt)}onKeyUp(t){let n=t.code||t.key||"",r=this.downAt.get(n),o=Date.now();r!==void 0&&(this.dwell.push(o-r),this.downAt.delete(n)),this.lastUpAt=o}snapshot(){let t=Math.hypot(this.netDx,this.netDy);return{mouseMoves:this.moves,mouseDistance:Math.round(this.distance),mouseAvgSpeed:St(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:Mn(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:St(this.dwell),keyAvgFlightMs:St(this.flight),keyDwellVariance:Mn(this.dwell),keyFlightVariance:Mn(this.flight),pasteCount:this.pastes,backspaceCount:this.backspaces,timeToFirstInteractionMs:this.firstInteraction,timeToSubmitMs:Date.now()-this.start,focusChanges:this.focusChanges,scrollCount:this.scrolls,hadPointerMove:this.moves>0,hadKeydown:this.keyCount>0,interactionCount:this.moves+this.keyCount+this.scrolls+this.focusChanges}}stop(){let t=this.target;if(t){for(let[n,r]of this.bound)N(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function Ko(e){return N(async()=>{var l,c,d;let t=Dl(),n={attempt_id:e.attemptId,kind:(l=e.kind)!=null?l:"telemetry",device_id:Un(),device_fingerprint:$l(t),device:t,behavior:(c=e.recorder)==null?void 0:c.snapshot()},r=`${e.api}/v1/client/telemetry?publishable_key=${encodeURIComponent(e.publishableKey)}`,o=JSON.stringify(n),i=nt();if(!e.fetchImpl&&i&&typeof i.sendBeacon=="function"&&typeof Blob!="undefined"&&i.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let s=(d=e.fetchImpl)!=null?d:typeof fetch!="undefined"?fetch:void 0;return s?(await s(r,{method:"POST",headers:{"content-type":"application/json","x-publishable-key":e.publishableKey},body:o,keepalive:!0,credentials:"include"})).ok:!1},Promise.resolve(!1))}var Ml=[/^\/v1\/client\/sign_ups(\?|$)/,/^\/v1\/client\/sign_ins(\?|$)/,/^\/v1\/client\/me\/phone_numbers(\?|$)/,/^\/v1\/client\/me\/phone_numbers\/[^/]+\/prepare_verification(\?|$)/],Go=(e,t)=>t==="POST"&&Ml.some(n=>n.test(e));function Ul(e,t){let n=t.platform==="ios"?{p:"ios",n:e,a:t.assertion,r:t.receipt}:t.platform==="ios_devicecheck"?{p:"ios_dc",n:e,t:t.deviceToken}:{p:"android",n:e,t:t.integrityToken};return btoa(JSON.stringify(n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Vo(e,t){let n=await e.request("/v1/client/attestation/challenge",{method:"POST",body:"{}"});return!n.ok||!n.data?null:Ul(n.data.nonce,await t.prove(n.data.nonce))}var zl=["checkbox","scroll","link"];function te(e){return typeof e=="string"&&e!==""?e:null}function Nl(e){return typeof e=="number"&&Number.isFinite(e)?new Date(e).toISOString():te(e)}function Bn(e){var l,c,d,u,p;if(!e||typeof e!="object")return null;let t=e,n=[t.version,t.current_version].find(f=>f&&typeof f=="object"),r=f=>t[f]!==void 0?t[f]:n==null?void 0:n[f],o=(l=te(t.key))!=null?l:te(t.policy),i=(c=te(r("version_id")))!=null?c:te(n==null?void 0:n.id);if(!o||!i)return null;let s=zl.includes(t.display)?t.display:"checkbox",a=(d=te(typeof t.version=="string"?t.version:n==null?void 0:n.version))!=null?d:"";return{key:o,title:(u=te(t.title))!=null?u:o,display:s,required:t.required!==!1,appliesTo:t.applies_to==="sign_in_and_sign_up"?"sign_in_and_sign_up":"sign_up",versionId:i,version:a,contentHtml:te(r("content_html")),contentMarkdown:te(r("content_markdown")),contentUrl:te(r("content_url")),contentSha256:(p=te(r("content_sha256")))!=null?p:"",effectiveAt:Nl(r("effective_at")),summaryOfChanges:te(r("summary_of_changes")),reaccept:typeof t.reaccept=="boolean"?t.reaccept:null}}function Bl(e){var n;let t=Array.isArray(e)?e:e&&typeof e=="object"?(n=e.policies)!=null?n:e.data:null;return Array.isArray(t)?t.map(Bn).filter(r=>r!==null):[]}function jn(e){return!!(e!=null&&e.some(t=>t.code==="POLICY_ACCEPTANCE_REQUIRED"))}async function rt(e,t={}){let n=await oo(e,t.locale?{locale:t.locale}:{});if(!n.ok)return[];let r=Bl(n.data);return t.signIn?r.filter(o=>o.appliesTo==="sign_in_and_sign_up"):r}function Yo(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}var Ue=class{constructor(t=[],n={}){v(this,"list",[]);v(this,"entries",new Map);v(this,"open",null);v(this,"listeners",new Set);v(this,"now");v(this,"combined");var r;this.combined=n.combined!==!1,this.now=(r=n.now)!=null?r:()=>Date.now(),this.setPolicies(t)}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(){for(let t of[...this.listeners])t()}entry(t){let n=this.list.find(i=>i.key===t),r=n?n.versionId:t,o=this.entries.get(r);return o||(o={checked:!1,scrolledToEnd:!1,viewMs:0,openedAt:null},this.entries.set(r,o)),o}get policies(){return this.list}get viewing(){var t;return(t=this.list.find(n=>n.key===this.open))!=null?t:null}snapshot(){let t=this.checkboxPolicies();return{policies:this.list,combined:this.combined,viewing:this.open,combinedChecked:t.length>0&&t.every(n=>this.isChecked(n.key))}}setPolicies(t){this.list=t,this.open&&!t.some(n=>n.key===this.open)&&(this.open=null),this.emit()}checkboxPolicies(){return this.list.filter(t=>t.display==="checkbox")}scrollPolicies(){return this.list.filter(t=>t.display==="scroll")}linkPolicies(){return this.list.filter(t=>t.display==="link")}isChecked(t){let n=this.list.find(r=>r.key===t);return n?n.display==="link"?!0:this.entry(t).checked:!1}setChecked(t,n){this.entry(t).checked=n,this.emit()}setAllChecked(t){for(let n of this.checkboxPolicies())this.entry(n.key).checked=t;this.emit()}acceptScroll(t){let n=this.entry(t);n.checked=!0,n.scrolledToEnd=!0,this.emit()}pendingScroll(){var t;return(t=this.scrollPolicies().find(n=>!this.isChecked(n.key)))!=null?t:null}openDocument(t){this.open&&this.closeDocument(),this.list.some(n=>n.key===t)&&(this.open=t,this.entry(t).openedAt=this.now(),this.emit())}closeDocument(){this.open&&(this.stopClock(this.open),this.open=null,this.emit())}startClock(t){let n=this.entry(t);n.openedAt===null&&(n.openedAt=this.now())}stopClock(t){let n=this.entry(t);n.openedAt!==null&&(n.viewMs+=Math.max(0,this.now()-n.openedAt),n.openedAt=null)}markScrolledToEnd(t){let n=this.entry(t);n.scrolledToEnd||(n.scrolledToEnd=!0,this.emit())}hasScrolledToEnd(t){return this.entry(t).scrolledToEnd}viewMs(t){let n=this.entry(t);return Math.round(n.viewMs+(n.openedAt!==null?Math.max(0,this.now()-n.openedAt):0))}missing(){return this.list.filter(t=>t.required&&!this.isChecked(t.key))}satisfied(){return this.missing().length===0}canSubmit(){return this.list.every(t=>!t.required||t.display==="scroll"||this.isChecked(t.key))}build(){let t=[];for(let n of this.list){if(!this.isChecked(n.key))continue;let r=this.entry(n.key),o=this.viewMs(n.key);t.push({policy:n.key,version_id:n.versionId,content_sha256:n.contentSha256,display:n.display,...n.display==="scroll"||r.scrolledToEnd?{scrolled_to_end:r.scrolledToEnd}:{},...o>0?{view_ms:o}:{}})}return t}};function jl(e,t=2){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function Hn(e,t,n){let r=!1,o=null,i=()=>{r||(r=!0,a(),n())},s=()=>{jl(e)&&i()},a=()=>{o==null||o.disconnect(),e.removeEventListener("scroll",s),typeof window!="undefined"&&window.removeEventListener("resize",s)};return t&&typeof IntersectionObserver!="undefined"&&(o=new IntersectionObserver(l=>{l.some(c=>c.isIntersecting)&&i()},{root:e,threshold:0}),o.observe(t)),e.addEventListener("scroll",s,{passive:!0}),typeof window!="undefined"&&window.addEventListener("resize",s),s(),()=>{r=!0,a()}}var Hl='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function Jo(e,t={}){var s;let n=e.ownerDocument,r=n.activeElement,o=a=>{if(a.key==="Escape"&&t.escape!==!0){a.preventDefault(),a.stopPropagation();return}if(a.key!=="Tab")return;let l=Array.from(e.querySelectorAll(Hl)).filter(p=>!p.hasAttribute("hidden"));if(l.length===0){a.preventDefault(),e.focus();return}let c=l[0],d=l[l.length-1],u=n.activeElement;a.shiftKey&&(u===c||!e.contains(u))?(a.preventDefault(),d.focus()):!a.shiftKey&&(u===d||!e.contains(u))&&(a.preventDefault(),c.focus())},i=a=>{var l;a.target instanceof Node&&!e.contains(a.target)&&((l=t.initialFocus)!=null?l:e).focus()};return n.addEventListener("keydown",o,!0),n.addEventListener("focusin",i),((s=t.initialFocus)!=null?s:e).focus(),()=>{var a;n.removeEventListener("keydown",o,!0),n.removeEventListener("focusin",i),(a=r==null?void 0:r.focus)==null||a.call(r)}}function ql(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Nn(e){let t=ql(e);return t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t=t.replace(/(^|[^*])\*([^*\s][^*]*)\*/g,"$1<em>$2</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t}function Wl(e){let t=e.replace(/\r\n?/g,`
5
5
  `).split(`
6
- `),n=[],r=[],o=null,i=()=>{r.length&&n.push(`<p>${dn(r.join(" "))}</p>`),r=[]},s=()=>{o&&n.push(`</${o}>`),o=null};for(let l of t){let a=/^(#{1,6})\s+(.*)$/.exec(l),d=/^\s*[-*+]\s+(.*)$/.exec(l),c=/^\s*\d+[.)]\s+(.*)$/.exec(l);if(a){i(),s();let u=a[1].length;n.push(`<h${u}>${dn(a[2])}</h${u}>`)}else if(d||c){i();let u=d?"ul":"ol";o!==u&&(s(),n.push(`<${u}>`),o=u),n.push(`<li>${dn((d!=null?d:c)[1])}</li>`)}else l.trim()===""?(i(),s()):(s(),r.push(l.trim()))}return i(),s(),n.join(`
7
- `)}function ho(e){return e.contentHtml?e.contentHtml:e.contentMarkdown?Ha(e.contentMarkdown):""}function yo(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)}var ja=Object.freeze({"policy.agreeCombined":"I agree to the {policies}","policy.agreeOne":"I agree to the {policy}","policy.clickwrap":"By continuing you agree to the {policies}.","policy.and":"and","policy.read":"Read the {policy}","policy.viewerBack":"Back","policy.version":"Version {version}","policy.effective":"Effective {date}","policy.scrollHint":"Scroll to the end to accept","policy.accept":"Accept","policy.decline":"Decline","policy.summaryTitle":"What changed","policy.reacceptTitle":"{policy} has been updated","policy.reacceptIntro":"Please review and accept the updated terms to continue.","policy.pendingTitle":"Accept to continue","policy.pendingIntro":"Please accept the following to continue signing in.","policy.required":"Please accept the {policy} to continue.","policy.requiredGeneric":"Please accept the required policies to continue.","policy.declined":"You need to accept the {policy} to use this app.","policy.loading":"Loading\u2026","policy.bannerTitle":"Updated policies","policy.bannerBody":"We have updated: {policies}. Please review and accept.","policy.bannerGrace":"Accept by {date} to keep your access.","policy.bannerReview":"Review and accept","policy.submit":"Accept and continue"});function bo(e){return(t,n={})=>{var i;let r=e(t,n);return r&&r!==t?r:((i=ja[t])!=null?i:t).replace(/\{(\w+)\}/g,(s,l)=>{var a;return(a=n[l])!=null?a:s})}}function gn(e,t){let n=e.indexOf(`{${t}}`);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length+2)]}async function ko(e,t,n={}){let r=Array.isArray(t==null?void 0:t.pending_policies)?t.pending_policies:[];if(r.length===0){let i=await Fe(e,n);return new _e(i.filter(s=>s.required),n)}let o=r.map(un).filter(i=>i!==null);if(o.some(i=>!i.contentHtml&&!i.contentMarkdown)){let i=await Fe(e,n);o=o.map((s,l)=>{var u,f,p,g;let a=i.find(y=>y.key===s.key);if(!a)return s;let d=(u=r.find(y=>{var m;return((m=un(y))==null?void 0:m.key)===s.key}))!=null?u:r[l],c=y=>d[y]!==void 0&&d[y]!==null;return{...a,...c("title")?{title:s.title}:{},...c("display")?{display:s.display}:{},versionId:s.versionId,version:s.version||a.version,contentHtml:(f=s.contentHtml)!=null?f:a.contentHtml,contentMarkdown:(p=s.contentMarkdown)!=null?p:a.contentMarkdown,contentSha256:s.contentSha256||a.contentSha256,summaryOfChanges:(g=s.summaryOfChanges)!=null?g:a.summaryOfChanges,reaccept:s.reaccept}})}return new _e(o.map(i=>({...i,required:!0})),n)}function vo(e){if(typeof e!="string")return null;let t=e.trim().replace(/_/g,"-");return/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/.test(t)?t:null}var Wa=new Set(["/v1/client/sign_ups","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwf/verify"]),tt=class{constructor(t){this.options=t;nn()}get referralCacheKey(){return ao(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get publishableKey(){return this.options.publishableKey}urlFor(t){return`${this.options.baseUrl||(typeof window!="undefined"?window.location.origin:"")}${t}`}get locale(){return vo(this.options.locale)}get frontendApiOrigin(){let t=this.options.baseUrl;if(!t)return"";try{return new URL(t).origin}catch{return""}}async request(t,n={}){var d,c,u,f,p;let r=Kt(this.options.publishableKey,(d=this.options.fetchImpl)!=null?d:fetch),o=this.locale,i=(c=this.options.sdk)!=null?c:Tr,s;try{s=await r(`${(u=this.options.baseUrl)!=null?u:""}${t}`,{...n,credentials:(f=n.credentials)!=null?f:"include",headers:{"x-publishable-key":this.options.publishableKey,[Ir]:Or(i),...o?{"accept-language":o}:{},...n.body?{"content-type":"application/json"}:{},...n.headers}})}catch{return{ok:!1,status:0,data:null,errors:[{code:"NETWORK",reason:"network",message:"We could not reach the server."}]}}Lr(s,i);let l=null;try{l=await s.json()}catch{}let a=t.split("?")[0];return s.ok&&((p=n.method)!=null?p:"GET")==="GET"&&(a==="/v1/client/environment"||a==="/v1/appearance")&&lo(this.referralCacheKey,l),{ok:s.ok,status:s.status,data:s.ok?l:null,errors:s.ok?[]:mr(l)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&so(t)){let i=await on(this);i&&(r={...r,referral:i})}let o=t.split("?")[0];if(o!==void 0&&Wa.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let i=ln();i&&(r={...r,device_id:i})}return this.request(t,{method:"POST",body:r===void 0?void 0:JSON.stringify(r)})}get(t){return this.request(t,{method:"GET"})}};var B={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function Ka(e,t){var o,i,s,l,a,d,c,u,f,p,g,y,m;if(!e)return{path:"/v1/client/sign_ins",body:{identifier:(o=t.identifier)!=null?o:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};let n=z(e),r=(i=e.id)!=null?i:"";switch(n.kind){case"collect_identifier":return{path:"/v1/client/sign_ins",body:{identifier:(s=t.identifier)!=null?s:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};case"collect_first_factor":return t.code?{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"email_code",code:t.code}}:{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"password",password:(l=t.password)!=null?l:""}};case"collect_second_factor":return{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(a=t.code)!=null?a:"",...t.remember_device==="true"?{remember_device:!0}:{}}};case"enroll_second_factor":return t.enrollStrategy==="phone_code"?{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(d=t.factorId)!=null?d:"",code:(c=t.code)!=null?c:""}}:{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(u=t.factorId)!=null?u:"",codes:[(f=t.code)!=null?f:"",(p=t.secondCode)!=null?p:""]}};case"collect_email_code":return{path:`/v1/client/sign_ups/${r}/attempt_verification`,body:{code:(g=t.code)!=null?g:""}};case"collect_captcha":return t.captcha_token?{path:"/v1/client/sign_ins",body:{identifier:(y=t.identifier)!=null?y:"",captcha_token:t.captcha_token}}:null;case"collect_new_password":return{path:`/v1/client/password_resets/${r}/set_new_password`,body:{password:(m=t.password)!=null?m:""}};case"accept_policies":return{path:`/v1/client/sign_ins/${r}/accept_policies`,body:Er({policyToken:t.policy_acceptance_token,attempt:e,pollSecret:t.poll_secret},go(t.policy_acceptances))};case"await_oauth":case"done":case"restart":case"unknown":return null}}function nt(e){return e?{...B,attempt:{id:e.id,status:e.status},...e.policyToken?{policyToken:e.policyToken}:{}}:B}async function Me(e,t,n){var u,f,p,g;let r=t.attempt?z(t.attempt).kind==="accept_policies":!1,o={};r&&t.policyToken&&n.policy_acceptance_token===void 0&&(o.policy_acceptance_token=t.policyToken),r&&t.pollSecret&&n.poll_secret===void 0&&(o.poll_secret=t.pollSecret);let i=Ka(t.attempt,{...n,...o});if(!i)return t;let s=await e.post(i.path,i.body);if(!s.ok||!s.data)return{...t,busy:!1,errors:s.errors};let{backup_codes:l,...a}=s.data,d=qr(l),c=a.id===((u=t.attempt)==null?void 0:u.id)&&a.status===((f=t.attempt)==null?void 0:f.status);return{attempt:a,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(p=a.ticket)!=null?p:null,prepared:c&&(g=t.prepared)!=null?g:null,...d?{recoveryCodes:d}:{},...a.policy_acceptance_token?{policyToken:a.policy_acceptance_token}:{}}}async function mn(e,t){var o,i;let n=t.fields&&Object.keys(t.fields).length>0,r=await e.post("/v1/client/sign_ups",{email:t.email,password:t.password,...n?{fields:t.fields}:{},...t.consent?{consent:!0}:{},...t.captchaToken?{captcha_token:t.captchaToken}:{},...t.username?{username:t.username}:{},...t.policyAcceptances&&t.policyAcceptances.length>0?{policy_acceptances:t.policyAcceptances}:{}});return!r.ok||!r.data?{...B,busy:!1,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,pollSecret:(o=r.data.poll_secret)!=null?o:B.pollSecret,ticket:(i=r.data.ticket)!=null?i:null,...r.data.policy_acceptance_token?{policyToken:r.data.policy_acceptance_token}:{}}}async function _o(e,t){var o;let n=(o=t.attempt)==null?void 0:o.id;if(!n)return t;let r=await e.post(`/v1/client/sign_ups/${n}/prepare_verification`,{});return r.ok?{...t,busy:!1,errors:[]}:{...t,busy:!1,errors:r.errors}}function rt(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function xo(e,t,n){var i,s,l;let r=(i=t.attempt)==null?void 0:i.id;if(!r)return t;let o=await e.post(`/v1/client/sign_ins/${r}/prepare_first_factor`,{strategy:n});return o.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(s=o.data)==null?void 0:s.poll_secret)!=null?l:null,prepared:n}:{...t,busy:!1,errors:o.errors}}async function wo(e,t){var i,s,l;let n=(i=t.attempt)==null?void 0:i.id;if(!n||!t.pollSecret)return{state:t,ticket:null};let r=((s=t.attempt)==null?void 0:s.object)==="sign_up_attempt"?"sign_ups":"sign_ins",o=await e.get(`/v1/client/${r}/${n}?poll_secret=${encodeURIComponent(t.pollSecret)}`);return!o.ok||!o.data?{state:t,ticket:null}:{state:{...t,attempt:o.data},ticket:(l=o.data.ticket)!=null?l:null}}function hn(e){var r;if(!e.pollSecret||!e.attempt||gr(e.attempt))return!1;let t=e.attempt;return!(t.object==="sign_up_attempt"&&t.status==="needs_first_factor"&&((r=t.supported_first_factors)!=null?r:[]).includes("passkey"))}var Ud=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});var qa=`.atlas-policy-consent{display:flex;flex-direction:column;gap:8px;font-size:.875rem;}
6
+ `),n=[],r=[],o=null,i=()=>{r.length&&n.push(`<p>${Nn(r.join(" "))}</p>`),r=[]},s=()=>{o&&n.push(`</${o}>`),o=null};for(let a of t){let l=/^(#{1,6})\s+(.*)$/.exec(a),c=/^\s*[-*+]\s+(.*)$/.exec(a),d=/^\s*\d+[.)]\s+(.*)$/.exec(a);if(l){i(),s();let u=l[1].length;n.push(`<h${u}>${Nn(l[2])}</h${u}>`)}else if(c||d){i();let u=c?"ul":"ol";o!==u&&(s(),n.push(`<${u}>`),o=u),n.push(`<li>${Nn((c!=null?c:d)[1])}</li>`)}else a.trim()===""?(i(),s()):(s(),r.push(a.trim()))}return i(),s(),n.join(`
7
+ `)}function Qo(e){return e.contentHtml?e.contentHtml:e.contentMarkdown?Wl(e.contentMarkdown):""}function Zo(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)}var Kl=Object.freeze({"policy.agreeCombined":"I agree to the {policies}","policy.agreeOne":"I agree to the {policy}","policy.clickwrap":"By continuing you agree to the {policies}.","policy.and":"and","policy.read":"Read the {policy}","policy.viewerBack":"Back","policy.version":"Version {version}","policy.effective":"Effective {date}","policy.scrollHint":"Scroll to the end to accept","policy.accept":"Accept","policy.decline":"Decline","policy.summaryTitle":"What changed","policy.reacceptTitle":"{policy} has been updated","policy.reacceptIntro":"Please review and accept the updated terms to continue.","policy.pendingTitle":"Accept to continue","policy.pendingIntro":"Please accept the following to continue signing in.","policy.required":"Please accept the {policy} to continue.","policy.requiredGeneric":"Please accept the required policies to continue.","policy.declined":"You need to accept the {policy} to use this app.","policy.loading":"Loading\u2026","policy.bannerTitle":"Updated policies","policy.bannerBody":"We have updated: {policies}. Please review and accept.","policy.bannerGrace":"Accept by {date} to keep your access.","policy.bannerReview":"Review and accept","policy.submit":"Accept and continue"});function Xo(e){return(t,n={})=>{var i;let r=e(t,n);return r&&r!==t?r:((i=Kl[t])!=null?i:t).replace(/\{(\w+)\}/g,(s,a)=>{var l;return(l=n[a])!=null?l:s})}}function qn(e,t){let n=e.indexOf(`{${t}}`);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length+2)]}async function ei(e,t,n={}){let r=Array.isArray(t==null?void 0:t.pending_policies)?t.pending_policies:[];if(r.length===0){let i=await rt(e,n);return new Ue(i.filter(s=>s.required),n)}let o=r.map(Bn).filter(i=>i!==null);if(o.some(i=>!i.contentHtml&&!i.contentMarkdown)){let i=await rt(e,n);o=o.map((s,a)=>{var u,p,f,g;let l=i.find(m=>m.key===s.key);if(!l)return s;let c=(u=r.find(m=>{var h;return((h=Bn(m))==null?void 0:h.key)===s.key}))!=null?u:r[a],d=m=>c[m]!==void 0&&c[m]!==null;return{...l,...d("title")?{title:s.title}:{},...d("display")?{display:s.display}:{},versionId:s.versionId,version:s.version||l.version,contentHtml:(p=s.contentHtml)!=null?p:l.contentHtml,contentMarkdown:(f=s.contentMarkdown)!=null?f:l.contentMarkdown,contentSha256:s.contentSha256||l.contentSha256,summaryOfChanges:(g=s.summaryOfChanges)!=null?g:l.summaryOfChanges,reaccept:s.reaccept}})}return new Ue(o.map(i=>({...i,required:!0})),n)}function ti(e){if(typeof e!="string")return null;let t=e.trim().replace(/_/g,"-");return/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/.test(t)?t:null}var Gl=new Set(["/v1/client/sign_ups","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/wsfed","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/game_platform","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwb/verify","/v1/oauth/siwf/verify"]),At=class{constructor(t){this.options=t;Fn(),t.persistence&&vn(t.persistence)}get referralCacheKey(){return Bo(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get publishableKey(){return this.options.publishableKey}urlFor(t){return`${this.options.baseUrl||(typeof window!="undefined"?window.location.origin:"")}${t}`}get locale(){return ti(this.options.locale)}get frontendApiOrigin(){let t=this.options.baseUrl;if(!t)return"";try{return new URL(t).origin}catch{return""}}async request(t,n={}){var u,p,f,g,m,h;let r=wn(this.options.publishableKey,(u=this.options.fetchImpl)!=null?u:fetch),o=this.locale,i=(p=this.options.sdk)!=null?p:lo,s,a=this.options.attestation,l=a&&Go(t,((f=n.method)!=null?f:"GET").toUpperCase())?await Vo(this,a):null;try{s=await r(`${(g=this.options.baseUrl)!=null?g:""}${t}`,{...n,credentials:(m=n.credentials)!=null?m:"include",headers:{"x-publishable-key":this.options.publishableKey,[co]:uo(i),...o?{"accept-language":o}:{},...l?{"atlas-attestation":l}:{},...n.body?{"content-type":"application/json"}:{},...n.headers}})}catch{return{ok:!1,status:0,data:null,errors:[{code:"NETWORK",reason:"network",message:"We could not reach the server."}]}}po(s,i);let c=null;try{c=await s.json()}catch{}let d=t.split("?")[0];return s.ok&&((h=n.method)!=null?h:"GET")==="GET"&&(d==="/v1/client/environment"||d==="/v1/appearance")&&jo(this.referralCacheKey,c),{ok:s.ok,status:s.status,data:s.ok?c:null,errors:s.ok?[]:Gr(c)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&No(t)){let i=await Ln(this);i&&(r={...r,referral:i})}let o=t.split("?")[0];if(o!==void 0&&Gl.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let i=Un();i&&(r={...r,device_id:i})}return this.request(t,{method:"POST",body:r===void 0?void 0:JSON.stringify(r)})}get(t){return this.request(t,{method:"GET"})}};var X={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function Vl(e,t){var o,i,s,a,l,c,d,u,p,f,g,m,h,w,P,A,S;if(!e)return{path:"/v1/client/sign_ins",body:{identifier:(o=t.identifier)!=null?o:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};let n=Z(e),r=(i=e.id)!=null?i:"";switch(n.kind){case"collect_identifier":return{path:"/v1/client/sign_ins",body:{identifier:(s=t.identifier)!=null?s:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};case"collect_first_factor":return t.code?{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"email_code",code:t.code}}:{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"password",password:(a=t.password)!=null?a:""}};case"collect_second_factor":return t.strategy==="duo"?{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{strategy:"duo",...t.remember_device==="true"?{remember_device:!0}:{}}}:{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(l=t.code)!=null?l:"",...t.strategy==="custom_challenge"?{strategy:"custom_challenge"}:{},...t.remember_device==="true"?{remember_device:!0}:{}}};case"enroll_second_factor":return t.enrollStrategy==="phone_code"?{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(c=t.factorId)!=null?c:"",code:(d=t.code)!=null?d:""}}:{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(u=t.factorId)!=null?u:"",codes:[(p=t.code)!=null?p:"",(f=t.secondCode)!=null?f:""]}};case"collect_email_code":return{path:`/v1/client/sign_ups/${r}/attempt_verification`,body:{code:(g=t.code)!=null?g:""}};case"collect_captcha":return t.captcha_token?{path:"/v1/client/sign_ins",body:{identifier:(m=t.identifier)!=null?m:"",captcha_token:t.captcha_token}}:null;case"collect_new_password":return{path:`/v1/client/password_resets/${r}/set_new_password`,body:{password:(h=t.password)!=null?h:""}};case"accept_policies":return{path:`/v1/client/sign_ins/${r}/accept_policies`,body:io({policyToken:t.policy_acceptance_token,attempt:e,pollSecret:t.poll_secret},Yo(t.policy_acceptances))};case"complete_required_action":{let y=(P=(w=e==null?void 0:e.pending_required_actions)==null?void 0:w[0])==null?void 0:P.action,b={action:(S=(A=t.action)!=null?A:y)!=null?S:""};for(let k of["password","first_name","last_name","username","step","code","redirect_url","required_action_token","poll_secret"])t[k]!==void 0&&(b[k]=t[k]);let x={};for(let[k,R]of Object.entries(t))k.startsWith("field:")&&(x[k.slice(6)]=R);return Object.keys(x).length>0&&(b.fields=x),t.skip==="true"&&(b.skip=!0),{path:`/v1/client/sign_ins/${r}/required_actions`,body:b}}case"await_oauth":case"done":case"restart":case"unknown":return null}}function Pt(e){return e?{...X,attempt:{id:e.id,status:e.status},...e.policyToken?{policyToken:e.policyToken}:{}}:X}async function ot(e,t,n){var p,f,g,m,h;let r=t.attempt?Z(t.attempt).kind:null,o=r==="accept_policies"||r==="complete_required_action",i={};r==="accept_policies"&&t.policyToken&&n.policy_acceptance_token===void 0&&(i.policy_acceptance_token=t.policyToken),r==="complete_required_action"&&t.policyToken&&n.required_action_token===void 0&&(i.required_action_token=t.policyToken),o&&t.pollSecret&&n.poll_secret===void 0&&(i.poll_secret=t.pollSecret);let s=Vl(t.attempt,{...n,...i});if(!s)return t;let a=await e.post(s.path,s.body);if(!a.ok||!a.data)return{...t,busy:!1,errors:a.errors};let{backup_codes:l,...c}=a.data,d=Ao(l),u=c.id===((p=t.attempt)==null?void 0:p.id)&&c.status===((f=t.attempt)==null?void 0:f.status);return{attempt:c,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(g=c.ticket)!=null?g:null,prepared:u&&(m=t.prepared)!=null?m:null,...d?{recoveryCodes:d}:{},...c.policy_acceptance_token||c.required_action_token?{policyToken:(h=c.policy_acceptance_token)!=null?h:c.required_action_token}:u&&t.policyToken&&c.status==="needs_required_action"?{policyToken:t.policyToken}:{}}}async function Wn(e,t){var o,i,s;let n=t.fields&&Object.keys(t.fields).length>0,r=await e.post("/v1/client/sign_ups",{email:t.email,password:t.password,...n?{fields:t.fields}:{},...t.consent?{consent:!0}:{},...t.captchaToken?{captcha_token:t.captchaToken}:{},...t.username?{username:t.username}:{},...t.policyAcceptances&&t.policyAcceptances.length>0?{policy_acceptances:t.policyAcceptances}:{}});return!r.ok||!r.data?{...X,busy:!1,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,pollSecret:(o=r.data.poll_secret)!=null?o:X.pollSecret,ticket:(i=r.data.ticket)!=null?i:null,...r.data.policy_acceptance_token||r.data.required_action_token?{policyToken:(s=r.data.policy_acceptance_token)!=null?s:r.data.required_action_token}:{}}}async function ni(e,t){var o;let n=(o=t.attempt)==null?void 0:o.id;if(!n)return t;let r=await e.post(`/v1/client/sign_ups/${n}/prepare_verification`,{});return r.ok?{...t,busy:!1,errors:[]}:{...t,busy:!1,errors:r.errors}}function Et(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function ri(e,t,n,r={}){var s,a,l,c,d;let o=(s=t.attempt)==null?void 0:s.id;if(!o)return t;let i=await e.post(`/v1/client/sign_ins/${o}/prepare_first_factor`,{strategy:n,...r.crossDevice&&n==="email_link"?{cross_device:!0}:{}});return i.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(a=i.data)==null?void 0:a.poll_secret)!=null?l:null,prepared:n,matchCode:(d=(c=i.data)==null?void 0:c.match_code)!=null?d:null}:{...t,busy:!1,errors:i.errors}}async function oi(e,t){var i,s,a;let n=(i=t.attempt)==null?void 0:i.id;if(!n||!t.pollSecret)return{state:t,ticket:null};let r=((s=t.attempt)==null?void 0:s.object)==="sign_up_attempt"?"sign_ups":"sign_ins",o=await e.get(`/v1/client/${r}/${n}?poll_secret=${encodeURIComponent(t.pollSecret)}`);return!o.ok||!o.data?{state:t,ticket:null}:{state:{...t,attempt:o.data},ticket:(a=o.data.ticket)!=null?a:null}}function Kn(e){var r;if(!e.pollSecret||!e.attempt||Kr(e.attempt))return!1;let t=e.attempt;return!(t.object==="sign_up_attempt"&&t.status==="needs_first_factor"&&((r=t.supported_first_factors)!=null?r:[]).includes("passkey"))}var Xu=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});var Yl=`.atlas-policy-consent{display:flex;flex-direction:column;gap:8px;font-size:.875rem;}
8
8
  .atlas-policy-row{display:flex;gap:8px;align-items:flex-start;}
9
9
  .atlas-policy-link{padding:0;font:inherit;color:var(--atlas-color-primary,#5b5bd6);background:none;border:0;cursor:pointer;text-decoration:underline;}
10
10
  .atlas-policy-clickwrap{margin:0;font-size:.8125rem;color:var(--atlas-color-muted,#666);text-align:center;}
@@ -24,18 +24,18 @@
24
24
  .atlas-policy-actions button{min-height:40px;padding:8px 16px;font:inherit;font-weight:600;border-radius:var(--atlas-border-radius,8px);cursor:pointer;border:1px solid var(--atlas-color-border,#e4e4e9);background:transparent;color:inherit;}
25
25
  .atlas-policy-actions button.atlas-policy-accept{color:var(--atlas-color-text-on-primary,#fff);background:var(--atlas-color-primary,#5b5bd6);border-color:transparent;}
26
26
  .atlas-policy-actions button:disabled{opacity:.55;cursor:not-allowed;}
27
- .atlas-policy-banner{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;padding:10px 14px;font-size:.875rem;border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);background:var(--atlas-color-surface,rgba(91,91,214,.08));}`,So="atlas-policy-styles";function vn(e=document){if(e.getElementById(So))return;let t=e.createElement("style");t.id=So,t.textContent=qa,e.head.appendChild(t)}var Va=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","FORM","LINK","META","BASE","SVG","MATH"]);function Ga(e){if(typeof document=="undefined"||typeof document.createElement!="function")return e.replace(/&/g,"&amp;").replace(/</g,"&lt;");let t=document.createElement("template");t.innerHTML=e;let n=r=>{for(let o of Array.from(r.children)){if(Va.has(o.tagName.toUpperCase())){o.remove();continue}for(let i of Array.from(o.attributes)){let s=i.name.toLowerCase(),l=i.value.trim().toLowerCase().replace(/[\s\u0000-\u001f]/g,"");(s.startsWith("on")||s==="style"||(s==="href"||s==="src"||s==="xlink:href")&&/^(javascript|data|vbscript):/.test(l))&&o.removeAttribute(i.name)}o.tagName==="A"&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer")),n(o)}};return n(t.content),t.innerHTML}function Co(e){return Ga(ho(e))}function O(e,t,n,r={},o){let i=e.createElement(t);n&&(i.className=n);for(let[s,l]of Object.entries(r))i.setAttribute(s,l);return o!==void 0&&(i.textContent=o),i}var $=(...e)=>e.filter(Boolean).join(" "),bn=0,yn=new WeakSet,ot=new WeakMap;function kn(e,t,n,r){var i;let o=O(e,"button",$("atlas-policy-link",(i=r.classes)==null?void 0:i.link),{type:"button","data-atlas-policy-open":t.key,"aria-haspopup":"dialog"},t.title);return o.addEventListener("click",s=>{s.preventDefault(),n.openDocument(t.key)}),o}function Ao(e,t,n,r){let[o,i]=gn(t,"policies"),s=e.createDocumentFragment();return s.append(o),n.forEach((l,a)=>{a>0&&s.append(a===n.length-1?` ${r} `:", "),s.append(l)}),s.append(i),s}function _n(e,t,n){var d;let r=(d=n.document)!=null?d:e.ownerDocument,{t:o,classes:i}=n,s=null,l=()=>{s==null||s(),s=null,e.textContent="",e.className=$("atlas-policy-consent",i==null?void 0:i.root),e.setAttribute("data-atlas-policies","");let c=t.viewing;if(c){e.append(Ya(r,c,t,n,p=>s=p));return}let u=t.checkboxPolicies();if(u.length===0)return;let f=o("policy.and");if(t.combined){let p=`atlas-policy-${++bn}`,g=O(r,"div","atlas-policy-row atlas-consent"),y=O(r,"input",$("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:p,name:"policies","data-atlas-policy-all":""});y.checked=t.snapshot().combinedChecked,y.addEventListener("change",()=>t.setAllChecked(y.checked));let m=O(r,"label",$("atlas-text",i==null?void 0:i.text),{for:p});m.append(Ao(r,o("policy.agreeCombined"),u.map(S=>kn(r,S,t,n)),f)),g.append(y,m),e.append(g)}else for(let p of u){let g=`atlas-policy-${++bn}`,y=O(r,"div","atlas-policy-row atlas-consent"),m=O(r,"input",$("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:g,name:`policy_${p.key}`,"data-atlas-policy-box":p.key});m.checked=t.isChecked(p.key),m.addEventListener("change",()=>t.setChecked(p.key,m.checked));let S=O(r,"label",$("atlas-text",i==null?void 0:i.text),{for:g}),[E,A]=gn(o("policy.agreeOne"),"policy");S.append(E,kn(r,p,t,n),A),y.append(m,S),e.append(y)}},a=t.subscribe(l);return l(),{render:l,destroy(){a(),s==null||s(),e.textContent=""}}}function xn(e,t,n){var a;let r=(a=n.document)!=null?a:e.ownerDocument,{t:o,classes:i}=n,s=()=>{e.textContent="";let d=t.linkPolicies();e.hidden=d.length===0,d.length!==0&&(e.className=$("atlas-policy-clickwrap",i==null?void 0:i.text),e.setAttribute("data-atlas-policy-clickwrap",""),e.append(Ao(r,o("policy.clickwrap"),d.map(c=>kn(r,c,t,n)),o("policy.and"))))},l=t.subscribe(s);return s(),{render:s,destroy(){l(),e.textContent=""}}}function Ya(e,t,n,r,o){let{t:i,classes:s}=r,l=O(e,"div",$("atlas-policy-viewer",s==null?void 0:s.viewer),{role:"region","aria-label":t.title,"data-atlas-policy-viewer":t.key}),a=O(e,"div","atlas-policy-viewer-head");a.append(O(e,"strong",void 0,{},t.title));let d=O(e,"button",$("atlas-policy-link",s==null?void 0:s.link),{type:"button","data-atlas-policy-back":""},i("policy.viewerBack"));d.addEventListener("click",()=>n.closeDocument()),a.append(d);let c=[t.version?i("policy.version",{version:t.version}):"",t.effectiveAt?i("policy.effective",{date:yo(t.effectiveAt)}):""].filter(Boolean).join(" \xB7 "),u=O(e,"div",$("atlas-policy-body",s==null?void 0:s.viewerBody),{tabindex:"0","data-atlas-policy-content":""});u.innerHTML=Co(t);let f=O(e,"span","atlas-policy-sentinel",{"aria-hidden":"true"});return u.append(f),l.append(a),c&&l.append(O(e,"p","atlas-policy-meta",{},c)),l.append(u),o(fn(u,f,()=>n.markScrolledToEnd(t.key))),l}function Ja(e,t){var _,C;let n=(_=t.document)!=null?_:document,{t:r,classes:o,controller:i}=t,s=++bn,l=`atlas-policy-title-${s}`,a=`atlas-policy-hint-${s}`,d=O(n,"div",$("atlas-policy-overlay",o==null?void 0:o.overlay),{"data-atlas-policy-modal":e.key}),c=O(n,"div",$("atlas-policy-modal",o==null?void 0:o.modal),{role:"dialog","aria-modal":"true","aria-labelledby":l,"aria-describedby":a,tabindex:"-1"});if(c.append(O(n,"h2",void 0,{id:l},t.reaccept&&e.reaccept!==!1?r("policy.reacceptTitle",{policy:e.title}):e.title)),t.reaccept&&e.reaccept!==!1&&e.summaryOfChanges){let w=O(n,"div",$("atlas-policy-summary",o==null?void 0:o.summary),{"data-atlas-policy-summary":""});w.append(O(n,"strong",void 0,{},r("policy.summaryTitle")),O(n,"span",void 0,{},e.summaryOfChanges)),c.append(w)}let u=O(n,"div",$("atlas-policy-body",o==null?void 0:o.viewerBody),{tabindex:"0",role:"region","aria-label":e.title,"data-atlas-policy-content":""});u.innerHTML=Co(e);let f=O(n,"span","atlas-policy-sentinel",{"aria-hidden":"true","data-atlas-policy-end":""});u.append(f);let p=O(n,"p","atlas-policy-hint",{id:a,"aria-live":"polite"},r("policy.scrollHint")),g=O(n,"div","atlas-policy-actions"),y=O(n,"button",$(o==null?void 0:o.button),{type:"button","data-atlas-policy-decline":""},r("policy.decline")),m=O(n,"button",$("atlas-policy-accept",o==null?void 0:o.primaryButton),{type:"button","data-atlas-policy-accept":"",disabled:"","aria-disabled":"true"},r("policy.accept"));g.append(y,m),c.append(u,p,g),d.append(c),((C=t.container)!=null?C:n.body).append(d);let S=!1,E=fn(u,f,()=>{S=!0,m.disabled=!1,m.removeAttribute("disabled"),m.setAttribute("aria-disabled","false"),p.textContent="",i==null||i.markScrolledToEnd(e.key)});i==null||i.startClock(e.key);let A=mo(c,{initialFocus:u}),x=!1,b=()=>{x||(x=!0,E(),A(),i==null||i.stopClock(e.key),d.remove())};return m.addEventListener("click",()=>{S&&(b(),t.onAccept())}),y.addEventListener("click",()=>{b(),t.onDecline()}),{close:b,get acceptEnabled(){return S}}}function wn(e,t){return new Promise(n=>{let r=()=>{let o=e.pendingScroll();if(!o){n(!0);return}Ja(o,{...t,controller:e,onAccept:()=>{e.acceptScroll(o.key),r()},onDecline:()=>n(!1)})};r()})}function Eo(e,t,n){var E;let r=(E=n.document)!=null?E:e.ownerDocument,{t:o,classes:i}=n,s=!1,l=!0;e.textContent="",e.setAttribute("data-atlas-policy-step","");let a=t.policies.some(A=>A.display!=="scroll");e.append(O(r,"p",$("atlas-text",i==null?void 0:i.text),{},o("policy.pendingIntro")));let d=O(r,"div"),c=O(r,"p"),u=_n(d,t,n),f=xn(c,t,n);e.append(d);let p=null,g=()=>{p&&(p.disabled=s||!t.canSubmit()||t.pendingScroll()!==null)};a&&(p=O(r,"button",$("atlas-button",i==null?void 0:i.primaryButton),{type:"button","data-atlas-policy-continue":""},o("policy.submit")),p.addEventListener("click",()=>n.onSubmit(t.build())),e.append(p)),e.append(c);let y=t.subscribe(g);g();let m={hasOthers:a,onSubmit:n.onSubmit,onDecline:n.onDecline};return ot.set(t,m),(()=>{!l||yn.has(t)||!t.pendingScroll()||(yn.add(t),wn(t,{...n,reaccept:!0}).then(A=>{yn.delete(t);let x=ot.get(t);if(x)if(A)x.hasOthers||x.onSubmit(t.build());else{let b=t.policies.find(_=>_.display==="scroll"&&!t.isChecked(_.key));b&&x.onDecline(b)}}))})(),{render(){u.render(),f.render(),g()},setBusy(A){s=A,g()},destroy(){l=!1,ot.get(t)===m&&ot.delete(t),y(),u.destroy(),f.destroy(),e.textContent=""}}}function To(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function Io(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.id!="string"||typeof t.status!="string"?null:{attemptId:t.id,status:t.status,...typeof t.ticket=="string"?{ticket:t.ticket}:{}}}var Po="https://accounts.google.com/gsi/client",it=null;function Za(){return typeof process!="undefined"&&!1}var Ro=new Set,Xa=!1;function Qa(e){return it||(it=new Promise((t,n)=>{if(e.querySelector(`script[src="${Po}"]`)){t();return}let r=e.createElement("script");r.src=Po,r.async=!0,r.defer=!0,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("Failed to load Google Identity Services."))),e.head.appendChild(r)}),it)}async function Oo(e){var E,A,x,b,_,C;let t=(E=e.host)!=null?E:window,n=t.document;await Qa(n);let r=(x=(A=t.google)==null?void 0:A.accounts)==null?void 0:x.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:w=>{var T;w.credential?(Xa=!0,e.onCredential(w.credential)):(T=e.onError)==null||T.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let i=(b=e.visible)!=null?b:!1,s=n.createElement("div");i||s.setAttribute("aria-hidden","true");let l=.004;s.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${i?1:l};overflow:hidden;`,e.wrapper.appendChild(s);let a={provider:"google",wrapper:e.wrapper,overlay:s};Ro.add(a);let d=w=>{let T=w==null?void 0:w.style;T&&(T.width!=="100%"&&(T.width="100%"),T.height!=="100%"&&(T.height="100%"))},c=()=>{d(s.firstElementChild);let w=s.querySelector("iframe");d(w);let T=w==null?void 0:w.style;T&&T.margin!=="0px"&&(T.margin="0")},u=()=>{var L;let w=Math.round(e.wrapper.getBoundingClientRect().width)||320,T=Math.max(200,Math.min(400,w));s.replaceChildren(),r.renderButton(s,{type:"standard",theme:"outline",size:(L=e.size)!=null?L:"large",text:"continue_with",width:T}),c(),p()},f=w=>({width:w.width,height:w.height,top:w.top,left:w.left,right:w.right,bottom:w.bottom}),p=()=>{if(Za()&&typeof window!="undefined")try{let w=e.wrapper.getBoundingClientRect(),T=s.getBoundingClientRect(),L=T.left<=w.left+1&&T.top<=w.top+1&&T.right>=w.right-1&&T.bottom>=w.bottom-1,te=s.querySelector("iframe"),H=te==null?void 0:te.getBoundingClientRect(),K=!!H&&H.width>=8&&H.height>=8;(!L||!K)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:L,iframeOk:K,wrapper:f(w),overlay:f(T),iframe:H?{width:H.width,height:H.height}:null})}catch{}};u();let g,y=(_=t.ResizeObserver)!=null?_:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;y&&(g=new y(()=>u()),g.observe(e.wrapper));let m,S=(C=t.MutationObserver)!=null?C:typeof MutationObserver!="undefined"?MutationObserver:void 0;return S&&(m=new S(()=>c()),m.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{g==null||g.disconnect(),m==null||m.disconnect(),Ro.delete(a),s.remove(),o||(e.wrapper.style.position="")}}}var el=()=>{let e=globalThis.navigator;if(!e||!e.credentials)throw new Error("WebAuthn is not available in this environment.");return e};function Ue(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r=0;r<t.length;r+=1)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Lo(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),o=new Uint8Array(r.length);for(let i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return o.buffer}function xe(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function Uo(){var t;let e=globalThis.PublicKeyCredential;try{return await((t=e==null?void 0:e.isConditionalMediationAvailable)==null?void 0:t.call(e))===!0}catch{return!1}}function Do(e){return typeof e=="string"?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Fo(e){return{first:Do(e.first),...e.second!==void 0?{second:Do(e.second)}:{}}}function tl(e,t){if(!e)return;let n={};return e.eval&&(n.eval=Fo(e.eval)),t==="get"&&e.evalByCredential&&(n.evalByCredential=Object.fromEntries(Object.entries(e.evalByCredential).map(([r,o])=>[r,Fo(o)]))),{prf:n}}var Mo=e=>e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):void 0;function nl(e){var i,s,l,a;let t=(s=(i=e.getClientExtensionResults)==null?void 0:i.call(e))!=null?s:{},n={credentialId:Ue(e.rawId)},r=t.prf;if(r&&typeof r=="object"){let d=Mo((l=r.results)==null?void 0:l.first),c=Mo((a=r.results)==null?void 0:a.second);n.prf={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{},...d?{results:{first:d,...c?{second:c}:{}}}:{}}}let o=t.credProps;return o&&typeof o=="object"&&(n.credProps=typeof o.rk=="boolean"?{rk:o.rk}:{}),n}async function Sn(e,t={}){var l,a;let n=(l=t.host)!=null?l:el(),r=(a=e.allowCredentials)!=null?a:[],o={challenge:Lo(e.challenge),rpId:e.rpId,allowCredentials:r.map(d=>({type:d.type,id:Lo(d.id)})),userVerification:e.userVerification,timeout:e.timeout,...rl(tl(t.prf,"get"),e.extensions)},i=await n.credentials.get({publicKey:o,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!i)throw new Error("Passkey sign-in was cancelled.");let s=i.response;return t.onExtensionResults&&t.onExtensionResults(nl(i)),{handle:e.handle,challenge:e.challenge,credential_id:Ue(i.rawId),authenticator_data:Ue(s.authenticatorData),client_data_json:Ue(s.clientDataJSON),signature:Ue(s.signature)}}function rl(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0;return!e&&!n?{}:{extensions:{...n!=null?n:{},...e!=null?e:{}}}}var ol={checking:"Checking your browser\u2026",verified:"Security check complete.",puzzlePrompt:"Select every picture that shows the same shape as this one. Colour and size don't matter.",confirm:"Confirm",tile:"Picture {n}",alternative:"Can't do the picture check? Use a longer automatic check instead."},il={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function Cn(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(il)){let i=t(o);typeof i=="string"&&i.trim()&&i!==o&&(n[r]=i)}return n}var sl=e=>{let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++)n+=(t[r]<16?"0":"")+t[r].toString(16);return n},st=2e3;async function al(e,t,n,r=()=>!1){let o=new TextEncoder;for(let i=t;i<=n;i+=st){if(r())return null;let s=Math.min(n,i+st-1),l=[];for(let d=i;d<=s;d++)l.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${d}`)));let a=await Promise.all(l);for(let d=0;d<a.length;d++)if(sl(a[d])===e.challenge)return i+d}return null}var ll=`
27
+ .atlas-policy-banner{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;padding:10px 14px;font-size:.875rem;border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);background:var(--atlas-color-surface,rgba(91,91,214,.08));}`,ii="atlas-policy-styles";function Jn(e=document){if(e.getElementById(ii))return;let t=e.createElement("style");t.id=ii,t.textContent=Yl,e.head.appendChild(t)}var Jl=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","FORM","LINK","META","BASE","SVG","MATH"]);function Ql(e){if(typeof document=="undefined"||typeof document.createElement!="function")return e.replace(/&/g,"&amp;").replace(/</g,"&lt;");let t=document.createElement("template");t.innerHTML=e;let n=r=>{for(let o of Array.from(r.children)){if(Jl.has(o.tagName.toUpperCase())){o.remove();continue}for(let i of Array.from(o.attributes)){let s=i.name.toLowerCase(),a=i.value.trim().toLowerCase().replace(/[\s\u0000-\u001f]/g,"");(s.startsWith("on")||s==="style"||(s==="href"||s==="src"||s==="xlink:href")&&/^(javascript|data|vbscript):/.test(a))&&o.removeAttribute(i.name)}o.tagName==="A"&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer")),n(o)}};return n(t.content),t.innerHTML}function si(e){return Ql(Qo(e))}function U(e,t,n,r={},o){let i=e.createElement(t);n&&(i.className=n);for(let[s,a]of Object.entries(r))i.setAttribute(s,a);return o!==void 0&&(i.textContent=o),i}var V=(...e)=>e.filter(Boolean).join(" "),Vn=0,Gn=new WeakSet,Rt=new WeakMap;function Yn(e,t,n,r){var i;let o=U(e,"button",V("atlas-policy-link",(i=r.classes)==null?void 0:i.link),{type:"button","data-atlas-policy-open":t.key,"aria-haspopup":"dialog"},t.title);return o.addEventListener("click",s=>{s.preventDefault(),n.openDocument(t.key)}),o}function ai(e,t,n,r){let[o,i]=qn(t,"policies"),s=e.createDocumentFragment();return s.append(o),n.forEach((a,l)=>{l>0&&s.append(l===n.length-1?` ${r} `:", "),s.append(a)}),s.append(i),s}function Qn(e,t,n){var c;let r=(c=n.document)!=null?c:e.ownerDocument,{t:o,classes:i}=n,s=null,a=()=>{s==null||s(),s=null,e.textContent="",e.className=V("atlas-policy-consent",i==null?void 0:i.root),e.setAttribute("data-atlas-policies","");let d=t.viewing;if(d){e.append(Zl(r,d,t,n,f=>s=f));return}let u=t.checkboxPolicies();if(u.length===0)return;let p=o("policy.and");if(t.combined){let f=`atlas-policy-${++Vn}`,g=U(r,"div","atlas-policy-row atlas-consent"),m=U(r,"input",V("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:f,name:"policies","data-atlas-policy-all":""});m.checked=t.snapshot().combinedChecked,m.addEventListener("change",()=>t.setAllChecked(m.checked));let h=U(r,"label",V("atlas-text",i==null?void 0:i.text),{for:f});h.append(ai(r,o("policy.agreeCombined"),u.map(w=>Yn(r,w,t,n)),p)),g.append(m,h),e.append(g)}else for(let f of u){let g=`atlas-policy-${++Vn}`,m=U(r,"div","atlas-policy-row atlas-consent"),h=U(r,"input",V("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:g,name:`policy_${f.key}`,"data-atlas-policy-box":f.key});h.checked=t.isChecked(f.key),h.addEventListener("change",()=>t.setChecked(f.key,h.checked));let w=U(r,"label",V("atlas-text",i==null?void 0:i.text),{for:g}),[P,A]=qn(o("policy.agreeOne"),"policy");w.append(P,Yn(r,f,t,n),A),m.append(h,w),e.append(m)}},l=t.subscribe(a);return a(),{render:a,destroy(){l(),s==null||s(),e.textContent=""}}}function Zn(e,t,n){var l;let r=(l=n.document)!=null?l:e.ownerDocument,{t:o,classes:i}=n,s=()=>{e.textContent="";let c=t.linkPolicies();e.hidden=c.length===0,c.length!==0&&(e.className=V("atlas-policy-clickwrap",i==null?void 0:i.text),e.setAttribute("data-atlas-policy-clickwrap",""),e.append(ai(r,o("policy.clickwrap"),c.map(d=>Yn(r,d,t,n)),o("policy.and"))))},a=t.subscribe(s);return s(),{render:s,destroy(){a(),e.textContent=""}}}function Zl(e,t,n,r,o){let{t:i,classes:s}=r,a=U(e,"div",V("atlas-policy-viewer",s==null?void 0:s.viewer),{role:"region","aria-label":t.title,"data-atlas-policy-viewer":t.key}),l=U(e,"div","atlas-policy-viewer-head");l.append(U(e,"strong",void 0,{},t.title));let c=U(e,"button",V("atlas-policy-link",s==null?void 0:s.link),{type:"button","data-atlas-policy-back":""},i("policy.viewerBack"));c.addEventListener("click",()=>n.closeDocument()),l.append(c);let d=[t.version?i("policy.version",{version:t.version}):"",t.effectiveAt?i("policy.effective",{date:Zo(t.effectiveAt)}):""].filter(Boolean).join(" \xB7 "),u=U(e,"div",V("atlas-policy-body",s==null?void 0:s.viewerBody),{tabindex:"0","data-atlas-policy-content":""});u.innerHTML=si(t);let p=U(e,"span","atlas-policy-sentinel",{"aria-hidden":"true"});return u.append(p),a.append(l),d&&a.append(U(e,"p","atlas-policy-meta",{},d)),a.append(u),o(Hn(u,p,()=>n.markScrolledToEnd(t.key))),a}function Xl(e,t){var b,x;let n=(b=t.document)!=null?b:document,{t:r,classes:o,controller:i}=t,s=++Vn,a=`atlas-policy-title-${s}`,l=`atlas-policy-hint-${s}`,c=U(n,"div",V("atlas-policy-overlay",o==null?void 0:o.overlay),{"data-atlas-policy-modal":e.key}),d=U(n,"div",V("atlas-policy-modal",o==null?void 0:o.modal),{role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-describedby":l,tabindex:"-1"});if(d.append(U(n,"h2",void 0,{id:a},t.reaccept&&e.reaccept!==!1?r("policy.reacceptTitle",{policy:e.title}):e.title)),t.reaccept&&e.reaccept!==!1&&e.summaryOfChanges){let k=U(n,"div",V("atlas-policy-summary",o==null?void 0:o.summary),{"data-atlas-policy-summary":""});k.append(U(n,"strong",void 0,{},r("policy.summaryTitle")),U(n,"span",void 0,{},e.summaryOfChanges)),d.append(k)}let u=U(n,"div",V("atlas-policy-body",o==null?void 0:o.viewerBody),{tabindex:"0",role:"region","aria-label":e.title,"data-atlas-policy-content":""});u.innerHTML=si(e);let p=U(n,"span","atlas-policy-sentinel",{"aria-hidden":"true","data-atlas-policy-end":""});u.append(p);let f=U(n,"p","atlas-policy-hint",{id:l,"aria-live":"polite"},r("policy.scrollHint")),g=U(n,"div","atlas-policy-actions"),m=U(n,"button",V(o==null?void 0:o.button),{type:"button","data-atlas-policy-decline":""},r("policy.decline")),h=U(n,"button",V("atlas-policy-accept",o==null?void 0:o.primaryButton),{type:"button","data-atlas-policy-accept":"",disabled:"","aria-disabled":"true"},r("policy.accept"));g.append(m,h),d.append(u,f,g),c.append(d),((x=t.container)!=null?x:n.body).append(c);let w=!1,P=Hn(u,p,()=>{w=!0,h.disabled=!1,h.removeAttribute("disabled"),h.setAttribute("aria-disabled","false"),f.textContent="",i==null||i.markScrolledToEnd(e.key)});i==null||i.startClock(e.key);let A=Jo(d,{initialFocus:u}),S=!1,y=()=>{S||(S=!0,P(),A(),i==null||i.stopClock(e.key),c.remove())};return h.addEventListener("click",()=>{w&&(y(),t.onAccept())}),m.addEventListener("click",()=>{y(),t.onDecline()}),{close:y,get acceptEnabled(){return w}}}function Xn(e,t){return new Promise(n=>{let r=()=>{let o=e.pendingScroll();if(!o){n(!0);return}Xl(o,{...t,controller:e,onAccept:()=>{e.acceptScroll(o.key),r()},onDecline:()=>n(!1)})};r()})}function li(e,t,n){var P;let r=(P=n.document)!=null?P:e.ownerDocument,{t:o,classes:i}=n,s=!1,a=!0;e.textContent="",e.setAttribute("data-atlas-policy-step","");let l=t.policies.some(A=>A.display!=="scroll");e.append(U(r,"p",V("atlas-text",i==null?void 0:i.text),{},o("policy.pendingIntro")));let c=U(r,"div"),d=U(r,"p"),u=Qn(c,t,n),p=Zn(d,t,n);e.append(c);let f=null,g=()=>{f&&(f.disabled=s||!t.canSubmit()||t.pendingScroll()!==null)};l&&(f=U(r,"button",V("atlas-button",i==null?void 0:i.primaryButton),{type:"button","data-atlas-policy-continue":""},o("policy.submit")),f.addEventListener("click",()=>n.onSubmit(t.build())),e.append(f)),e.append(d);let m=t.subscribe(g);g();let h={hasOthers:l,onSubmit:n.onSubmit,onDecline:n.onDecline};return Rt.set(t,h),(()=>{!a||Gn.has(t)||!t.pendingScroll()||(Gn.add(t),Xn(t,{...n,reaccept:!0}).then(A=>{Gn.delete(t);let S=Rt.get(t);if(S)if(A)S.hasOthers||S.onSubmit(t.build());else{let y=t.policies.find(b=>b.display==="scroll"&&!t.isChecked(b.key));y&&S.onDecline(y)}}))})(),{render(){u.render(),p.render(),g()},setBusy(A){s=A,g()},destroy(){a=!1,Rt.get(t)===h&&Rt.delete(t),m(),u.destroy(),p.destroy(),e.textContent=""}}}function ui(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function pi(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.id!="string"||typeof t.status!="string"?null:{attemptId:t.id,status:t.status,...typeof t.ticket=="string"?{ticket:t.ticket}:{}}}var ci="https://accounts.google.com/gsi/client",Tt=null;function ec(){return typeof process!="undefined"&&!1}var di=new Set,tc=!1;function nc(e){return Tt||(Tt=new Promise((t,n)=>{if(e.querySelector(`script[src="${ci}"]`)){t();return}let r=e.createElement("script");r.src=ci,r.async=!0,r.defer=!0,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("Failed to load Google Identity Services."))),e.head.appendChild(r)}),Tt)}async function fi(e){var P,A,S,y,b,x;let t=(P=e.host)!=null?P:window,n=t.document;await nc(n);let r=(S=(A=t.google)==null?void 0:A.accounts)==null?void 0:S.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:k=>{var R;k.credential?(tc=!0,e.onCredential(k.credential)):(R=e.onError)==null||R.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let i=(y=e.visible)!=null?y:!1,s=n.createElement("div");i||s.setAttribute("aria-hidden","true");let a=.004;s.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${i?1:a};overflow:hidden;`,e.wrapper.appendChild(s);let l={provider:"google",wrapper:e.wrapper,overlay:s};di.add(l);let c=k=>{let R=k==null?void 0:k.style;R&&(R.width!=="100%"&&(R.width="100%"),R.height!=="100%"&&(R.height="100%"))},d=()=>{c(s.firstElementChild);let k=s.querySelector("iframe");c(k);let R=k==null?void 0:k.style;R&&R.margin!=="0px"&&(R.margin="0")},u=()=>{var E;let k=Math.round(e.wrapper.getBoundingClientRect().width)||320,R=Math.max(200,Math.min(400,k));s.replaceChildren(),r.renderButton(s,{type:"standard",theme:"outline",size:(E=e.size)!=null?E:"large",text:"continue_with",width:R}),d(),f()},p=k=>({width:k.width,height:k.height,top:k.top,left:k.left,right:k.right,bottom:k.bottom}),f=()=>{if(ec()&&typeof window!="undefined")try{let k=e.wrapper.getBoundingClientRect(),R=s.getBoundingClientRect(),E=R.left<=k.left+1&&R.top<=k.top+1&&R.right>=k.right-1&&R.bottom>=k.bottom-1,j=s.querySelector("iframe"),W=j==null?void 0:j.getBoundingClientRect(),T=!!W&&W.width>=8&&W.height>=8;(!E||!T)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:E,iframeOk:T,wrapper:p(k),overlay:p(R),iframe:W?{width:W.width,height:W.height}:null})}catch{}};u();let g,m=(b=t.ResizeObserver)!=null?b:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;m&&(g=new m(()=>u()),g.observe(e.wrapper));let h,w=(x=t.MutationObserver)!=null?x:typeof MutationObserver!="undefined"?MutationObserver:void 0;return w&&(h=new w(()=>d()),h.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{g==null||g.disconnect(),h==null||h.disconnect(),di.delete(l),s.remove(),o||(e.wrapper.style.position="")}}}var rc=()=>{let e=globalThis.navigator;if(!e||!e.credentials)throw new Error("WebAuthn is not available in this environment.");return e};function it(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r=0;r<t.length;r+=1)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function gi(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),o=new Uint8Array(r.length);for(let i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return o.buffer}function Pe(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function er(){var t;let e=globalThis.PublicKeyCredential;try{return await((t=e==null?void 0:e.isConditionalMediationAvailable)==null?void 0:t.call(e))===!0}catch{return!1}}function mi(e){return typeof e=="string"?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function hi(e){return{first:mi(e.first),...e.second!==void 0?{second:mi(e.second)}:{}}}function oc(e,t){if(!e)return;let n={};return e.eval&&(n.eval=hi(e.eval)),t==="get"&&e.evalByCredential&&(n.evalByCredential=Object.fromEntries(Object.entries(e.evalByCredential).map(([r,o])=>[r,hi(o)]))),{prf:n}}var yi=e=>e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):void 0;function ic(e){var i,s,a,l;let t=(s=(i=e.getClientExtensionResults)==null?void 0:i.call(e))!=null?s:{},n={credentialId:it(e.rawId)},r=t.prf;if(r&&typeof r=="object"){let c=yi((a=r.results)==null?void 0:a.first),d=yi((l=r.results)==null?void 0:l.second);n.prf={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{},...c?{results:{first:c,...d?{second:d}:{}}}:{}}}let o=t.credProps;return o&&typeof o=="object"&&(n.credProps=typeof o.rk=="boolean"?{rk:o.rk}:{}),n}async function st(e,t={}){var a,l;let n=(a=t.host)!=null?a:rc(),r=(l=e.allowCredentials)!=null?l:[],o={challenge:gi(e.challenge),rpId:e.rpId,allowCredentials:r.map(c=>({type:c.type,id:gi(c.id)})),userVerification:e.userVerification,timeout:e.timeout,...Array.isArray(e.hints)&&e.hints.length?{hints:e.hints}:{},...sc(oc(t.prf,"get"),e.extensions)},i=await n.credentials.get({publicKey:o,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!i)throw new Error("Passkey sign-in was cancelled.");let s=i.response;return t.onExtensionResults&&t.onExtensionResults(ic(i)),{handle:e.handle,challenge:e.challenge,credential_id:it(i.rawId),authenticator_data:it(s.authenticatorData),client_data_json:it(s.clientDataJSON),signature:it(s.signature)}}function sc(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0;return!e&&!n?{}:{extensions:{...n!=null?n:{},...e!=null?e:{}}}}async function bi(e,t){let n=await e.get(`/v1/client/password_resets/${encodeURIComponent(t)}/security_questions`);return n.ok&&n.data?{required:n.data.required,questions:n.data.questions}:null}var ac={checking:"Checking your browser\u2026",verified:"Security check complete.",puzzlePrompt:"Select every picture that shows the same shape as this one. Colour and size don't matter.",confirm:"Confirm",tile:"Picture {n}",alternative:"Can't do the picture check? Use a longer automatic check instead."},lc={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function tr(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(lc)){let i=t(o);typeof i=="string"&&i.trim()&&i!==o&&(n[r]=i)}return n}var cc=e=>{let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++)n+=(t[r]<16?"0":"")+t[r].toString(16);return n},It=2e3;async function dc(e,t,n,r=()=>!1){let o=new TextEncoder;for(let i=t;i<=n;i+=It){if(r())return null;let s=Math.min(n,i+It-1),a=[];for(let c=i;c<=s;c++)a.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${c}`)));let l=await Promise.all(a);for(let c=0;c<l.length;c++)if(cc(l[c])===e.challenge)return i+c}return null}var uc=`
28
28
  self.onmessage = async function (e) {
29
29
  var d = e.data, enc = new TextEncoder();
30
30
  function hex(buf) { var b = new Uint8Array(buf), s = ''; for (var i = 0; i < b.length; i++) s += (b[i] < 16 ? '0' : '') + b[i].toString(16); return s; }
31
- for (var start = d.from; start <= d.to; start += ${st}) {
32
- var end = Math.min(d.to, start + ${st} - 1), batch = [];
31
+ for (var start = d.from; start <= d.to; start += ${It}) {
32
+ var end = Math.min(d.to, start + ${It} - 1), batch = [];
33
33
  for (var n = start; n <= end; n++) batch.push(crypto.subtle.digest('SHA-256', enc.encode(d.salt + n)));
34
34
  var hs = await Promise.all(batch);
35
35
  for (var i = 0; i < hs.length; i++) if (hex(hs[i]) === d.challenge) { self.postMessage({ n: start + i }); return; }
36
36
  }
37
37
  self.postMessage({ n: null });
38
- };`;async function cl(e,t={}){var i,s,l,a;let n=(i=t.cancelled)!=null?i:()=>!1,r=globalThis;if(t.workers!==!1&&r.Worker&&r.Blob&&((s=r.URL)!=null&&s.createObjectURL)){let d=await dl(e,Math.max(1,Math.min(4,(a=(l=r.navigator)==null?void 0:l.hardwareConcurrency)!=null?a:2)),n).catch(()=>{});if(d!==void 0){if(d===null)throw new Error("captcha: no solution");return{n:d,worker:!0}}}let o=await al(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function dl(e,t,n){let r=URL.createObjectURL(new Blob([ll],{type:"text/javascript"})),o=[],i=()=>{for(let s of o)s.terminate();URL.revokeObjectURL(r)};return new Promise((s,l)=>{let a=t,d=Math.ceil((e.maxnumber+1)/t),c=setInterval(()=>{n()&&(clearInterval(c),i(),s(null))},100),u=f=>{clearInterval(c),i(),f instanceof Error?l(f):s(f)};try{for(let f=0;f<t;f++){let p=new Worker(r);o.push(p),p.onmessage=y=>{var m;typeof((m=y.data)==null?void 0:m.n)=="number"?u(y.data.n):--a===0&&u(null)},p.onerror=()=>u(new Error("captcha: worker failed"));let g=f*d;p.postMessage({salt:e.salt,challenge:e.challenge,from:g,to:Math.min(e.maxnumber,g+d-1)})}}catch(f){u(f instanceof Error?f:new Error("captcha: worker failed"))}})}var ul=e=>{let t=new TextEncoder().encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function pl(e){return`atlas1.${ul(JSON.stringify(e))}`}async function fl(e,t=!1){let n=t?`${e}${e.includes("?")?"&":"?"}accessible=true`:e,r=await fetch(n,{method:"GET",credentials:"omit"});if(!r.ok)throw new Error(`captcha: challenge refused (${r.status})`);return await r.json()}function $o(e,t){let n=e.createElement("img");return n.src=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`,n.alt="",n.width=64,n.height=64,n.style.cssText="display:block;width:64px;height:64px;border-radius:6px",n}function gl(e,t,n,r){let o=e.ownerDocument;return new Promise((i,s)=>{e.replaceChildren();let l=o.createElement("div");l.setAttribute("role","group"),l.setAttribute("data-atlas-captcha-puzzle",""),l.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let a=o.createElement("p");a.style.cssText="margin:0;font-size:13px;text-align:center",a.textContent=n.puzzlePrompt,l.append(a,$o(o,t.interactive.example));let d=o.createElement("div");d.style.cssText="display:grid;grid-template-columns:repeat(3,72px);gap:6px";let c=0;t.interactive.tiles.forEach((f,p)=>{let g=o.createElement("button");g.type="button",g.setAttribute("aria-pressed","false"),g.setAttribute("aria-label",n.tile.replace("{n}",String(p+1))),g.setAttribute("data-atlas-captcha-tile",String(p)),g.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",g.append($o(o,f)),g.addEventListener("click",()=>{c^=1<<p;let y=(c&1<<p)!==0;g.setAttribute("aria-pressed",y?"true":"false"),g.style.borderColor=y?"currentColor":"transparent"}),d.append(g)});let u=o.createElement("button");if(u.type="button",u.setAttribute("data-atlas-captcha-confirm",""),u.textContent=n.confirm,u.addEventListener("click",()=>r()?s(new Error("captcha: widget removed")):i(c)),l.append(d,u),t.accessible_alternative){let f=o.createElement("button");f.type="button",f.setAttribute("data-atlas-captcha-alternative",""),f.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",f.textContent=n.alternative,f.addEventListener("click",()=>i("accessible")),l.append(f)}e.append(l)})}function An(e,t){var p,g;let n={...ol,...t.labels},r=(p=t.mode)!=null?p:"managed",o=e.ownerDocument,i=(g=t.fetchChallenge)!=null?g:y=>t.challengeUrl?fl(t.challengeUrl,y):Promise.reject(new Error("captcha: no challenge URL")),s=!1,l=0,a=()=>s,d=o.createElement("div");d.setAttribute("role","status"),d.setAttribute("aria-live","polite"),d.setAttribute("data-atlas-captcha-provider","atlas"),d.style.cssText="font-size:13px;opacity:.85;text-align:center",e.append(d);let c=y=>{d.replaceChildren(),d.textContent=y},u=async y=>{let m=await i(y);if(s)throw new Error("captcha: widget removed");l=Date.parse(m.expires_at)||0,(r==="visible"||m.interactive)&&c(n.checking);let S=Date.now(),E=cl(m,{workers:t.workers,cancelled:a}).then(C=>({...C,ms:Date.now()-S}));E.catch(()=>{});let A;if(m.interactive){let C=await gl(d,m,n,a);if(C==="accessible")return c(n.checking),u(!0);A=C,c(n.checking)}let{n:x,worker:b,ms:_}=await E;if(s)throw new Error("captcha: widget removed");return(r==="visible"||A!==void 0)&&c(n.verified),pl({t:m.token,n:x,ms:_,...b?{w:1}:{},...A!==void 0?{sel:A}:{}})},f=u(!1);return f.catch(()=>{}),{token:f,stale:()=>l>0&&Date.now()>l-15e3,remove(){s=!0,d.remove()}}}var ml=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function $e(e,t){return!e||!ml.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function we(e){return!!e&&e.enabled===!0&&$e(e.provider,e)}var hl=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function En(e){return!!e&&typeof e.code=="string"&&hl.includes(e.code)}var yl={turnstile:{src:()=>"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",global:"turnstile"},hcaptcha:{src:()=>"https://js.hcaptcha.com/1/api.js?render=explicit",global:"hcaptcha"},recaptcha:{src:()=>"https://www.google.com/recaptcha/api.js?render=explicit",global:"grecaptcha"},recaptcha_v3:{src:e=>`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},recaptcha_enterprise:{src:e=>`https://www.google.com/recaptcha/enterprise.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},captchafox:{src:()=>"https://cdn.captchafox.com/api.js?render=explicit",global:"captchafox"}};function No(e,t,n){let r=yl[e];if(!r)return Promise.reject(new Error(`captcha: ${e} is not renderable`));if(n[r.global])return Promise.resolve(n[r.global]);let o=n.document,i=`__atlasCaptchaLoad_${e}`,s=n[i];if(s)return s;let l=new Promise((a,d)=>{var p,g;let c=()=>{n[r.global]?a(n[r.global]):d(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),f=o.querySelector(`script[src="${u}"]`);if(f){if(n[r.global])return a(n[r.global]);f.addEventListener("load",c,{once:!0}),f.addEventListener("error",()=>d(new Error(`captcha: ${e} script failed`)),{once:!0});return}f=o.createElement("script"),f.src=u,f.async=!0,f.defer=!0,f.addEventListener("load",c,{once:!0}),f.addEventListener("error",()=>d(new Error(`captcha: ${e} script failed`)),{once:!0}),((g=(p=o.head)!=null?p:o.body)!=null?g:o.documentElement).appendChild(f)});return n[i]=l,l.catch(()=>{n[i]===l&&delete n[i]}),l}function bl(e,t,n,r,o){return new Promise((i,s)=>{let l=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:a=>i(a),"error-callback":()=>s(new Error("captcha: turnstile error")),"timeout-callback":()=>s(new Error("captcha: turnstile timeout"))});o(()=>{var a;return(a=e.remove)==null?void 0:a.call(e,l)}),r==="invisible"&&e.execute&&e.execute(l)})}function kl(e,t,n,r,o){return new Promise((i,s)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:a=>i(a),"error-callback":()=>s(new Error("captcha: hcaptcha error"))});if(o(()=>{var a;return(a=e.remove)==null?void 0:a.call(e,l)}),r==="invisible"){let a=e.execute(l,{async:!0});a&&typeof a.then=="function"&&a.then(d=>i(d.response),s)}})}function vl(e,t,n,r,o){return new Promise((i,s)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:a=>i(a),"error-callback":()=>s(new Error("captcha: recaptcha error"))});if(o(()=>{var a;return(a=e.reset)==null?void 0:a.call(e,l)}),r==="invisible"&&e.execute){let a=e.execute(void 0,{widgetId:l});a&&typeof a.then=="function"&&a.then(i,s)}})}function _l(e,t,n,r,o){return new Promise((i,s)=>{let l=()=>s(new Error("captcha: captchafox error"));Promise.resolve(e.render(t,{sitekey:n,mode:r==="invisible"?"hidden":"inline",onVerify:a=>i(a),onError:l,onFail:l})).then(a=>{o(()=>{var d;return(d=e.remove)==null?void 0:d.call(e,a)}),r==="invisible"&&e.execute&&Promise.resolve(e.execute(a)).then(d=>{typeof d=="string"&&d&&i(d)},l)},l)})}async function zo(e,t=globalThis.fetch){let n=await t(e,{method:"POST",credentials:"same-origin",headers:{accept:"application/json"}});if(!n.ok)throw new Error(`captcha: BotID attestation route answered ${n.status}`);let r=await n.json();if(typeof r.token!="string"||!r.token)throw new Error("captcha: BotID attestation missing");return r.token}function xl(e,t){let n=()=>{let r=e.execute(t,{action:"submit"});return r&&typeof r.then=="function"?r:Promise.reject(new Error("captcha: recaptcha v3 execute returned no promise"))};return new Promise((r,o)=>{e.ready?e.ready(()=>n().then(r,o)):n().then(r,o)})}function Bo(e,t,n={}){var f,p,g,y,m,S,E,A,x;let r=(f=e.provider)!=null?f:"";if(r==="atlas")return An(t,{challengeUrl:e.challengeUrl,mode:(p=e.widget)!=null?p:"managed",...n.atlas});if(r==="vercel_botid"){let b=!1,_=(y=(g=t.ownerDocument)==null?void 0:g.defaultView)!=null?y:globalThis,C=e.attestationUrl?zo(e.attestationUrl,(m=_.fetch)==null?void 0:m.bind(_)).then(w=>{if(b)throw new Error("captcha: widget removed");return w}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return C.catch(()=>{}),{token:C,remove(){b=!0}}}let o=(S=e.siteKey)!=null?S:"",i=(E=e.widget)!=null?E:"managed",s=(x=(A=t.ownerDocument)==null?void 0:A.defaultView)!=null?x:globalThis,l=!1,a=null,d=null,c=b=>{a=b};return{token:new Promise((b,_)=>{d=_,No(r,o,s).then(C=>{if(l)throw new Error("captcha: widget removed");switch(r){case"turnstile":return bl(C,t,o,i,c);case"hcaptcha":return kl(C,t,o,i,c);case"recaptcha":return vl(C,t,o,i,c);case"recaptcha_v3":case"recaptcha_enterprise":return xl(C,o);case"captchafox":return _l(C,t,o,i,c);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(b,_)}),remove(){if(!l){l=!0;try{a==null||a()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);d==null||d(new Error("captcha: widget removed"))}}}}async function Pn(e,t,n){return Bo(e,t,n).token}var wl="/v1/client/sign_ins/passkey/begin",Ho=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function Rn(e,t={}){var a;let n=d=>e.post(wl,d?{captcha_token:d}:{}),r=(a=t.captcha)!=null?a:null,o=r?await Ho(r,{retry:!1}):null,i=await n(o);if(i.ok||!r)return i;let s=i.errors.find(d=>En(d));if(!s)return i;let l=await Ho(r,{retry:!0,refused:s.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return l?n(l):i}var Ne={attempt:null,errors:[],busy:!1,ticket:null};async function jo(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...Ne,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,ticket:null}}async function Wo(e,t,n){var l,a,d,c;let r=t.attempt;if(!r)return t;let o=null,i={};switch(r.status){case"needs_email_verification":o=`/v1/client/password_resets/${r.id}/attempt_verification`,i={code:(l=n.code)!=null?l:""};break;case"needs_second_factor":o=`/v1/client/password_resets/${r.id}/attempt_second_factor`,i={code:(a=n.code)!=null?a:""};break;case"needs_new_password":o=`/v1/client/password_resets/${r.id}/set_new_password`,i={password:(d=n.password)!=null?d:""};break;default:return t}let s=await e.post(o,i);return!s.ok||!s.data?{...t,busy:!1,errors:s.errors}:{attempt:{id:s.data.id,status:s.data.status},errors:[],busy:!1,ticket:(c=s.data.ticket)!=null?c:null}}function Se(e){var n;let t=(n=e.attempt)==null?void 0:n.status;if(!t)return"request";switch(t){case"needs_email_verification":return"collect_email_code";case"needs_second_factor":return"collect_second_factor";case"needs_new_password":return"collect_new_password";case"complete":return"done";default:return"unknown"}}async function Ko(e,t){let n=t.attempt;if(!(n!=null&&n.poll_secret))return t;let r=await e.get(`/v1/client/password_resets/${n.id}?poll_secret=${encodeURIComponent(n.poll_secret)}`);return!r.ok||!r.data?t:{...t,attempt:{id:r.data.id,status:r.data.status,poll_secret:n.poll_secret}}}var Tu=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),Vo="This app can't send email right now. Try another sign-in method or contact the app owner.";var ze=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var Tn=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),qo=e=>e==="link"||e==="both"?e:"code";function In(e){var o;let t=ze(e)&&ze(e.account)?e.account:null;if(!t)return{...Tn};let n=ze(t.username)?t.username:null,r=(i,s)=>typeof i=="number"&&Number.isInteger(i)?i:s;return{username:n?{minLength:r(n.min_length,3),maxLength:r(n.max_length,30),charset:n.charset==="alphanumeric"||n.charset==="alphanumeric_underscore"?n.charset:"default",requiredAtSignUp:n.required_at_sign_up===!0}:null,lastSignInMethod:t.last_sign_in_method===!0,emailVerification:qo(t.email_verification),passwordReset:qo(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...ze(t.mfa)?{mfa:{totp:t.mfa.totp!==!1,sms:t.mfa.sms===!0,totpCodes:Number((o=t.mfa.totp_codes)!=null?o:t.mfa.totpCodes)>=2?2:1}}:{},passkeySignUp:ze(t.passkey_sign_up)?{email:t.passkey_sign_up.email==="off"||t.passkey_sign_up.email==="optional"?t.passkey_sign_up.email:"required"}:null}}function Go(e){let t={...e};for(let n of["signUp","signIn"]){let r=t[n];r&&r.provider&&!r.enabled&&(t[n]={...r,enabled:!0})}return t}var ie=Ks(Zo());var Xo=["auto","light","dark"],fe=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],dt=["none","uppercase"],Qo={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,golden:1.618,"minor-seventh":1.778,octave:2},ei=Object.keys(Qo),ut=["none","sm","md","lg","xl"],pt=["compact","comfortable","spacious"],ft=["solid","glass","outline","none"],gt=["narrow","normal","wide"],mt=["center","left","right","split"],ht=["left","right"],yt=["card","page","hidden"],bt=["sm","md","lg"],kt=["solid","outline","soft","gradient"],vt=["list","grid","icons"],_t=["outline","filled","underline"],ti=["linear","radial"],Ln=["cover","contain"],Dn=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],Be=["none","dots","grid","noise"],xt=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],Fn=/^#[0-9a-fA-F]{6}$/,Mn=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var W="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",wt="Georgia, Cambria, 'Times New Roman', Times, serif",Un="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",q="wght@400;500;600;700;800",ni=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${W}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:wt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:Un,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:W,google:`Inter:${q}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:W,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:W,google:`Open+Sans:${q}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:W,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:W,google:`Montserrat:${q}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:W,google:`Poppins:${q}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:W,google:`Nunito:${q}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:W,google:`Work+Sans:${q}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:W,google:`DM+Sans:${q}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:W,google:`Manrope:${q}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:wt,google:`Source+Serif+4:${q}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:wt,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:wt,google:`Playfair+Display:${q}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:Un,google:`JetBrains+Mono:${q}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:Un,google:"IBM+Plex+Mono:wght@400;500;600;700"}],ri=ni.map(e=>e.id),oi=new Map(ni.map(e=>[e.id,e])),Rl=/^custom-[a-f0-9]{32}$/;function St(e){return typeof e=="string"&&Rl.test(e)}function Tl(e){return`Brand ${e.slice(7,15)}`}function $n(e){return St(e)?{id:e,label:"Brand font",family:Tl(e),category:"sans-serif",fallback:W,google:null}:typeof e=="string"?oi.get(e):void 0}function Nn(e){var n;let t=(n=$n(e))!=null?n:oi.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function ii(e){if(St(e))return`/v1/design/fonts/${e}.css`;let t=$n(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var zn=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ge=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),U=e=>t=>typeof t=="string"&&e.includes(t),X=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,ai=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,He=e=>typeof e=="string"&&Fn.test(e),Bn=e=>typeof e=="string"&&Mn.test(e);function se(e,t=[]){return n=>{if(!zn(n))return!1;for(let r of Object.keys(n)){if(!ge(e,r))return!1;let o=n[r];if(o===void 0){if(t.includes(r))return!1;continue}if(!e[r](o))return!1}return t.every(r=>ge(n,r)&&n[r]!==void 0)}}var Il=U(ri),si=e=>Il(e)||St(e),Hn={palette:Object.fromEntries(fe.map(e=>[e,He])),paletteDark:Object.fromEntries(fe.map(e=>[e,He])),typography:{font:si,headingFont:si,baseSize:X(12,20),headingWeight:X(400,800,100),bodyWeight:X(300,600,100),letterCase:U(dt),scale:U(ei)},shape:{radius:X(0,32),controlRadius:X(0,999),borderWidth:X(0,3)},elevation:{cardShadow:U(ut)},spacing:{density:U(pt)},card:{style:U(ft),blur:X(0,40),width:U(gt)},layout:{position:U(mt),splitImageSide:U(ht),logoPlacement:U(yt),logoSize:U(bt)},buttons:{style:U(kt),socialLayout:U(vt)},inputs:{style:U(_t)},logo:{assetId:Bn,darkAssetId:Bn}},Ol=e=>{if(!se({type:U(ti),angle:X(0,360),stops:()=>!0},["type","stops"])(e))return!1;let t=e.stops;return Array.isArray(t)&&t.length>=2&&t.length<=4&&t.every(se({color:He,at:ai(0,100)},["color","at"]))},Ll=se({assetId:Bn,fit:U(Ln),position:U(Dn),overlay:se({color:He,opacity:ai(0,1)},["color","opacity"]),blur:X(0,20)},["assetId"]),jn={color:He,gradient:Ol,image:Ll,pattern:U(Be)},je={version:e=>e===1,preset:U(xt),colorScheme:U(Xo),background:se(jn),backgroundDark:se(jn),...Object.fromEntries(Object.entries(Hn).map(([e,t])=>[e,se(t)]))};function li(e,t){return ge(je,e)&&je[e](t)}var ci=se(je);function di(e,t=()=>{},n=""){let r=(...i)=>[n,...i].filter(Boolean).join(".");if(e==null)return{};if(!zn(e))return t({path:n||"(root)",message:"must be an object"}),{};let o={};for(let[i,s]of Object.entries(e)){if(s===void 0)continue;if(!ge(je,i)){t({path:r(i),message:"Unknown setting."});continue}if(je[i](s)){o[i]=s;continue}let l=ge(Hn,i)?Hn[i]:i==="background"||i==="backgroundDark"?jn:null;if(!l||!zn(s)){t({path:r(i),message:"Invalid value."});continue}let a={};for(let[d,c]of Object.entries(s))c!==void 0&&(ge(l,d)&&l[d](c)?a[d]=c:t({path:r(i,d),message:ge(l,d)?"Invalid value.":"Unknown setting."}));Object.keys(a).length&&(o[i]=a)}return o}var Dl=new Set(["__proto__","constructor","prototype"]),ui=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Wn(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(Dl.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let i=n[r];n[r]=ui(i)&&ui(o)?Wn(i,o):o}return n}function M(e){let t=e.split(" ");if(t.length!==fe.length)throw new Error(`palette spec needs ${fe.length} slots: ${e}`);let n={};return t.forEach((r,o)=>{r!=="-"&&(n[fe[o]]=r)}),n}var pi={version:1,preset:"minimal",colorScheme:"auto",palette:M("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:M("#fafafa #18181b #818cf8 #09090b #18181b #fafafa #a1a1aa #3f3f46 #f87171 #4ade80 #09090b #fafafa"),typography:{font:"inter",headingFont:"inter",baseSize:15,headingWeight:600,bodyWeight:400,letterCase:"none",scale:"perfect-fourth"},shape:{radius:12,controlRadius:8,borderWidth:1},elevation:{cardShadow:"md"},spacing:{density:"comfortable"},card:{style:"solid",blur:16,width:"normal"},layout:{position:"center",splitImageSide:"left",logoPlacement:"card",logoSize:"md"},buttons:{style:"solid",socialLayout:"list"},inputs:{style:"outline"},background:{},backgroundDark:{},logo:{}},fi={minimal:{design:{}},atlas:{design:{palette:M("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:M("#7455fa #ffffff #46c7ff #070811 #0f1120 #eef0f6 #959bb0 #262a40 #ff6b6b #43d9a0 #0b0d17 #eef0f6"),typography:{font:"system",headingFont:"system",headingWeight:600},shape:{radius:14,controlRadius:9,borderWidth:1},elevation:{cardShadow:"lg"},buttons:{style:"gradient"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#f6f5ff",at:0},{color:"#eef6ff",at:100}]}},backgroundDark:{gradient:{type:"radial",stops:[{color:"#1a1440",at:0},{color:"#070811",at:70}]},pattern:"grid"}}},glass:{design:{palette:M("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:M("#a5b4fc - #f472b6 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),shape:{radius:20,controlRadius:12},elevation:{cardShadow:"xl"},card:{style:"glass",blur:20},background:{gradient:{type:"linear",angle:135,stops:[{color:"#6366f1",at:0},{color:"#ec4899",at:55},{color:"#f59e0b",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#1e1b4b",at:0},{color:"#4c1d95",at:55},{color:"#831843",at:100}]}}}},midnight:{design:{colorScheme:"dark",palette:M("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:M("#60a5fa - #a78bfa #0b1020 #121a2f #e6eaf5 #94a3b8 #24314f #f87171 #34d399 #0e1528 #e6eaf5"),typography:{font:"manrope",headingFont:"manrope"},shape:{radius:16,controlRadius:10},elevation:{cardShadow:"lg"},backgroundDark:{pattern:"dots"}}},editorial:{design:{palette:M("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:M("#e07a5f - #d4a64a #16130f #1f1b16 #f2ebe0 #a89f92 #3a332a - - #16130f #f2ebe0"),typography:{font:"source-serif",headingFont:"playfair-display",baseSize:16,headingWeight:700,scale:"golden"},shape:{radius:4,controlRadius:2},elevation:{cardShadow:"sm"},inputs:{style:"underline"}}},terminal:{design:{colorScheme:"dark",palette:M("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:M("#39ff14 #031003 #00e5ff #0a0f0a #0d140d #c8f7c5 #7fb57b #2c5a2c #ff5555 #39ff14 #050805 #c8f7c5"),typography:{font:"jetbrains-mono",headingFont:"jetbrains-mono",baseSize:14,letterCase:"uppercase",scale:"major-second"},shape:{radius:0,controlRadius:0,borderWidth:1},elevation:{cardShadow:"none"},card:{style:"outline"},buttons:{style:"outline"},backgroundDark:{pattern:"grid"}}},sunrise:{design:{palette:M("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:M("#fb923c - #f472b6 #1a0f0a #24150f #fdebe1 #c4a092 #4a2e22 - - #1a0f0a #fdebe1"),typography:{font:"poppins",headingFont:"poppins"},shape:{radius:20,controlRadius:999},elevation:{cardShadow:"lg"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#fff1e6",at:0},{color:"#ffe4ec",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:160,stops:[{color:"#2a1209",at:0},{color:"#2a0f1c",at:100}]}}}},forest:{design:{palette:M("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:M("#4ade80 - #facc15 #0c1510 #13201a #e3efe6 #9db5a4 #2a3d31 - - #0c1510 #e3efe6"),typography:{font:"dm-sans",headingFont:"dm-sans"},shape:{radius:10,controlRadius:8},inputs:{style:"filled"}}},grape:{design:{palette:M("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:M("#c084fc - #f472b6 #12081f #1c1030 #f3e8ff #b4a3cf #3b2559 - - #12081f #f3e8ff"),typography:{font:"nunito",headingFont:"nunito",headingWeight:800},shape:{radius:24,controlRadius:14},buttons:{socialLayout:"grid"},background:{pattern:"dots"},backgroundDark:{pattern:"dots"}}},slate:{design:{palette:M("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:M("#cbd5e1 - #38bdf8 #0f172a #1e293b #f1f5f9 #94a3b8 #334155 - - #0f172a #f1f5f9"),typography:{font:"work-sans",headingFont:"work-sans"},shape:{radius:8,controlRadius:6},elevation:{cardShadow:"sm"},spacing:{density:"compact"},inputs:{style:"filled"}}},"split-photo":{design:{layout:{position:"split",splitImageSide:"left",logoPlacement:"page"},card:{style:"none",width:"normal"},elevation:{cardShadow:"none"},shape:{radius:0,controlRadius:8},background:{gradient:{type:"linear",angle:135,stops:[{color:"#0f172a",at:0},{color:"#334155",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#020617",at:0},{color:"#1e293b",at:100}]}}}},bold:{design:{palette:M("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:M("#a5b4fc - #facc15 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),typography:{font:"montserrat",headingFont:"montserrat",baseSize:17,headingWeight:800,letterCase:"uppercase",scale:"octave"},shape:{radius:24,controlRadius:999,borderWidth:0},elevation:{cardShadow:"xl"},spacing:{density:"spacious"},card:{width:"wide"}}}};var Ce=(e,t,n)=>Math.min(n,Math.max(t,e));function Ae(e){if(!e||typeof e!="string")return null;let t=e.trim().toLowerCase();if(t==="transparent")return{r:0,g:0,b:0,a:0};let n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let a=n[1];if((a.length===3||a.length===4)&&(a=[...a].map(c=>c+c).join("")),a.length!==6&&a.length!==8)return null;let d=c=>parseInt(a.slice(c,c+2),16);return{r:d(0),g:d(2),b:d(4),a:a.length===8?d(6)/255:1}}let r=/^rgba?\(([^)]+)\)$/.exec(t);if(!r)return null;let o=r[1].replace("/"," ").split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let i=a=>a.endsWith("%")?parseFloat(a)/100*255:parseFloat(a),s=a=>a===void 0?1:a.endsWith("%")?parseFloat(a)/100:parseFloat(a),l={r:Ce(i(o[0]),0,255),g:Ce(i(o[1]),0,255),b:Ce(i(o[2]),0,255),a:Ce(s(o[3]),0,1)};return[l.r,l.g,l.b,l.a].some(Number.isNaN)?null:l}var Ct=e=>Ce(Math.round(e),0,255).toString(16).padStart(2,"0");function Et(e){return`#${Ct(e.r)}${Ct(e.g)}${Ct(e.b)}`}function Fl(e){let t=n=>{let r=n/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function At(e){let t=Ae(e);return t?Fl(t):null}function We(e,t){let n=At(e),r=At(t);if(n===null||r===null)return 1;let o=Math.max(n,r),i=Math.min(n,r);return(o+.05)/(i+.05)}var Ml=4.5,Ul=3;function gi(e){var t;return((t=At(e))!=null?t:0)>.179?"#111827":"#ffffff"}function $l(e,t,n){let r=e/255,o=t/255,i=n/255,s=Math.max(r,o,i),l=Math.min(r,o,i),a=(s+l)/2;if(s===l)return[0,0,a];let d=s-l,c=a>.5?d/(2-s-l):d/(s+l);return[s===r?((o-i)/d+(o<i?6:0))/6:s===o?((i-r)/d+2)/6:((r-o)/d+4)/6,c,a]}function Nl(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=l=>{let a=l;return a<0&&(a+=1),a>1&&(a-=1),a<1/6?o+(r-o)*6*a:a<1/2?r:a<2/3?o+(r-o)*(2/3-a)*6:o};return`#${(t===0?[n,n,n]:[i(e+1/3),i(e),i(e-1/3)]).map(l=>Ct(Ce(l,0,1)*255)).join("")}`}function zl(e,t,n=Ml){var u;let r=Ae(e);if(!r||t.length===0)return e;let o=f=>t.every(p=>We(f,p)>=n);if(o(e))return e;let s=((u=At(t[0]))!=null?u:1)>.179?-.01:.01,[l,a,d]=$l(r.r,r.g,r.b),c=e;for(let f=1;f<=100;f+=1){let p=d+s*f;if(p<0||p>1)break;if(c=Nl(l,a,p),o(c))return c}return c}function mi(e,t){return zl(e,t,Ul)}var Bl=["primary","accent","danger","success"],le=e=>JSON.parse(JSON.stringify(e));function yi(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(ci(e))return le(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&li(n,r)&&(t[n]=le(r));return t}function hi(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return t.primary&&!t.primaryInk&&(n.primaryInk=gi(t.primary)),n}function Kn(e,t,n){var i,s,l;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=hi(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let a of Bl){let d=t.palette[a];d&&d!==r[a]&&!((i=t.paletteDark)!=null&&i[a])&&(o={...o!=null?o:{},[a]:d})}t.palette.primaryInk&&!((s=t.paletteDark)!=null&&s.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=hi(e.paletteDark,o),t.typography){let a=t.typography;e.typography={...e.typography,...ae(a),headingFont:(l=a.headingFont)!=null?l:a.font?a.font:e.typography.headingFont}}if(t.shape&&(e.shape={...e.shape,...ae(t.shape)}),t.elevation&&(e.elevation={...e.elevation,...ae(t.elevation)}),t.spacing&&(e.spacing={...e.spacing,...ae(t.spacing)}),t.card&&(e.card={...e.card,...ae(t.card)}),t.layout&&(e.layout={...e.layout,...ae(t.layout)}),t.buttons&&(e.buttons={...e.buttons,...ae(t.buttons)}),t.inputs&&(e.inputs={...e.inputs,...ae(t.inputs)}),t.background&&(e.background=le(t.background)),t.backgroundDark)e.backgroundDark=le(t.backgroundDark);else if(t.background&&n.carryBrand){let a={};t.background.gradient&&(a.gradient=le(t.background.gradient)),t.background.image&&(a.image=le(t.background.image)),t.background.pattern&&(a.pattern=t.background.pattern),e.backgroundDark=a}t.logo&&(e.logo=le(t.logo))}function ae(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function qn(e){return typeof e=="string"&&xt.includes(e)}function Ke(e){let t=yi(e),n=qn(t.preset)?t.preset:"minimal",r=le(pi);return r.preset=n,Kn(r,fi[n].design,{carryBrand:!1}),Kn(r,t,{carryBrand:!0}),r}function bi(e,t){let n=Ke(e),r=yi(t);return delete r.preset,Kn(n,r,{carryBrand:!0}),n}var Hl=Object.freeze({"--atlas-color-primary":"--atlas-host-accent","--atlas-color-primary-ink":"--atlas-host-accent-ink","--atlas-color-surface":"--atlas-host-surface","--atlas-card-background":"--atlas-host-surface","--atlas-color-text":"--atlas-host-ink","--atlas-color-border":"--atlas-host-line","--atlas-radius-control":"--atlas-host-radius","--atlas-font-body":"--atlas-host-font","--atlas-focus-outline-color":"--atlas-host-focus-ring"});function Vn(e){var o,i,s,l,a,d,c,u,f,p,g,y,m,S;let t=(E,A,x)=>typeof A=="string"&&E.includes(A)?A:x,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(mt,(i=e==null?void 0:e.layout)==null?void 0:i.position,"center"),"data-atlas-split-side":t(ht,(s=e==null?void 0:e.layout)==null?void 0:s.splitImageSide,"left"),"data-atlas-logo":t(yt,(l=e==null?void 0:e.layout)==null?void 0:l.logoPlacement,"card"),"data-atlas-logo-size":t(bt,(a=e==null?void 0:e.layout)==null?void 0:a.logoSize,"md"),"data-atlas-card":t(ft,(d=e==null?void 0:e.card)==null?void 0:d.style,"solid"),"data-atlas-card-width":t(gt,(c=e==null?void 0:e.card)==null?void 0:c.width,"normal"),"data-atlas-shadow":t(ut,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(pt,(f=e==null?void 0:e.spacing)==null?void 0:f.density,"comfortable"),"data-atlas-button":t(kt,(p=e==null?void 0:e.buttons)==null?void 0:p.style,"solid"),"data-atlas-social":t(vt,(g=e==null?void 0:e.buttons)==null?void 0:g.socialLayout,"list"),"data-atlas-input":t(_t,(y=e==null?void 0:e.inputs)==null?void 0:y.style,"outline"),"data-atlas-pattern":t(Be,n.pattern,"none"),"data-atlas-pattern-dark":t(Be,(m=e==null?void 0:e.backgroundDark)==null?void 0:m.pattern,"none"),"data-atlas-letter-case":t(dt,(S=e==null?void 0:e.typography)==null?void 0:S.letterCase,"none")};return((e==null?void 0:e.colorScheme)==="dark"||(e==null?void 0:e.colorScheme)==="light")&&(r["data-atlas-theme"]=e.colorScheme),r}function ki(e){var n,r;let t=new Set;for(let o of[(n=e==null?void 0:e.typography)==null?void 0:n.font,(r=e==null?void 0:e.typography)==null?void 0:r.headingFont]){let i=ii(o);i&&t.add(i)}return[...t]}var mf=Object.freeze([...new Set(Object.values(Hl))]);function Gn(){try{return typeof process!="undefined"&&!1}catch{return!1}}var _i=e=>{Gn()&&console.warn(`[atlas] ${e}`)},vi=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function jl(e,t=_i,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):di(e,r=>t(r.message==="Unknown setting."&&r.path.split(".").length===n.split(".").length+1?`${r.path} is not a design setting; ignored.`:`${r.path} is invalid; ignored.`),n)}function xi(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)}var Wl=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Kl(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Wl.test(n)?[]:ki(e).map(r=>`${n}${r}`)}function ql(e){if(!(!vi(e)||!vi(e.resolved)))return e.resolved}function wi(e){var d,c,u;let t=(d=e.warn)!=null?d:_i,n=ql(e.instance),r=jl(e.design,t,"appearance.design"),o,i=(c=e.preset)!=null?c:r.preset;i!==void 0&&(qn(i)?o=i:t(`appearance.preset "${String(i)}" is not a preset; ignored.`));let s=o!==void 0||Object.keys(r).some(f=>f!=="preset");if(!n&&!s)return null;let l=o?Ke({preset:o}):n?Ke(n):Ke({}),a=Wn((u=e.tokensDesign)!=null?u:{},r);return bi(l,a)}function Si(e,t){return Kl(e,t)}var Ci=null;function Vl(e){var t,n;if(Ci)return Ci;try{let r=(t=e.querySelector)==null?void 0:t.call(e,'meta[name="csp-nonce"]'),o=r==null?void 0:r.getAttribute("content");if(o)return o;let i=(n=e.querySelector)==null?void 0:n.call(e,"script[nonce]"),s=i?i.nonce||i.getAttribute("nonce"):null;if(s)return s}catch{}return null}var Ai=new WeakMap,Ei=new WeakMap;function Pt(e,t){let n=Vl(e);if(n){t.setAttribute("nonce",n);try{t.nonce=n}catch{}}}function Rt(e,t,n){var o;let r=globalThis.CSSStyleSheet;if(r&&Array.isArray(e.adoptedStyleSheets)&&typeof((o=r.prototype)==null?void 0:o.replaceSync)=="function")try{let i=Ai.get(e);i||Ai.set(e,i=new Map);let s=Ei.get(e);s||Ei.set(e,s=new Map),s.set(t,n);let l=i.get(t);return l?l.replaceSync(n):(l=new r,i.set(t,l),l.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]),!0}catch{}return!1}var Pi=new Set,Ri=e=>{var t;!Gn()||Pi.has(e)||(Pi.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function Ti(e){var r,o;if(!e||typeof e!="object")return null;let t=e,n=(o=t.design)!=null?o:(r=t.appearance)==null?void 0:r.design;return n&&typeof n=="object"&&n.resolved?n:null}function Ii(e,t,n,r){var o,i;for(let s of(o=r==null?void 0:r.attributes)!=null?o:[])s in n.attributes||t.removeAttribute(s);for(let s of(i=r==null?void 0:r.style)!=null?i:[])s in n.style||t.style.removeProperty(s);for(let[s,l]of Object.entries(n.style))t.style.setProperty(s,l);for(let[s,l]of Object.entries(n.attributes))t.setAttribute(s,l);if(n.css){let s=e;if(!Rt(s,`design:${n.key}`,n.css)&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(a=>a.getAttribute("data-atlas-design")===n.key)){let a=e.createElement("style");a.setAttribute("data-atlas-design",n.key),Pt(s,a),a.textContent=n.css,e.head.appendChild(a)}}if(n.fontStylesheets.length){let s=new Set(Array.from(e.head.querySelectorAll("link[data-atlas-font]")).map(l=>l.getAttribute("href")));for(let l of n.fontStylesheets){if(s.has(l))continue;let a=e.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",l),a.setAttribute("data-atlas-font",""),e.head.appendChild(a)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var Gl=["boxes","single"];function Li(e,t){for(let n of[t,e])if(n&&Gl.includes(n))return n;return"boxes"}var Di=8,Yl=["solid","outline","soft","ghost"],Jl=["none","scale","lift","glow","ripple"],Zl=["none","sm","md","lg"],Xl=["comfortable","compact"],Ql=["outline","filled","underline"],ec=["slow","normal","fast"],tc=["spinner","skeleton","dots","bar"],Fi={slow:280,normal:160,fast:80};function Tt(e,t){let n=(r,o,...i)=>{for(let s of i)if(s!==void 0&&r.includes(s))return s;return o};return{buttonStyle:n(Yl,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Jl,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(Zl,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n(Xl,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(Ql,"outline",t==null?void 0:t.inputStyle,e==null?void 0:e.inputStyle),animations:typeof(t==null?void 0:t.animations)=="boolean"?t.animations:typeof(e==null?void 0:e.animations)=="boolean"?e.animations:!0,motionSpeed:n(ec,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(tc,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var nc=["block","compact","icon"],rc=["sm","md","lg"],oc=["list","grid","carousel"],ic=["auto","always","never"];function Yn(e,t){var r,o,i;let n=(s,...l)=>{for(let a of l)if(a!==void 0&&s.includes(a))return a;return s[0]};return{variant:n(nc,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(rc,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(oc,t==null?void 0:t.layout,e==null?void 0:e.layout),labels:{...(o=e==null?void 0:e.labels)!=null?o:{},...(i=t==null?void 0:t.labels)!=null?i:{}},search:n(ic,t==null?void 0:t.search,e==null?void 0:e.search)}}var Q={colorPrimary:"#5b5bd6",colorText:"#1c1c1f",colorBackground:"#ffffff",colorAccent:"#5b5bd6",colorCard:"#ffffff",colorBorder:"#e4e4e9",borderRadius:"10px",fontFamily:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};function sc(e){return e?{colorPrimary:e.colorPrimary||Q.colorPrimary,colorText:e.colorText||Q.colorText,colorBackground:e.colorBackground||Q.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||Q.colorAccent,colorCard:e.colorCard||e.colorBackground||Q.colorCard,colorBorder:e.colorBorder||Q.colorBorder,borderRadius:e.borderRadius||Q.borderRadius,fontFamily:e.fontStack||Q.fontFamily}:Q}function Mi(e,t){var o;let n={...sc(e)},r=(o=t==null?void 0:t.variables)!=null?o:{};for(let[i,s]of Object.entries(r))s!==void 0&&(n[i]=s);return n}function Ui(e){let t={};for(let[n,r]of Object.entries(e))t[`--atlas-embed-${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}`]=r;return t}function $i(e){let t=Ae(e);if(!t)return"#ffffff";let n=Et(t);return We("#ffffff",n)>=We("#111111",n)?"#ffffff":"#111111"}function Ni(e,t){let n=Ae(e);if(!n)return e;let r=Et(n),o=t.map(i=>Ae(i)).filter(i=>!!i&&i.a>0).map(Et);return o.length===0||o.every(i=>We(r,i)>=3)?e:mi(r,o)}function zi(e,t,n){var o;let r=(o=n==null?void 0:n.elements)==null?void 0:o[e];return r?`${t} ${r}`:t}function Bi(e,t){var s,l;let n=(s=t==null?void 0:t.providerOrder)!=null?s:[],r=new Set((l=t==null?void 0:t.providerHidden)!=null?l:[]),o=new Set(e.filter(a=>!r.has(a))),i=[];for(let a of n)o.has(a)&&!i.includes(a)&&i.push(a);for(let a of e)o.has(a)&&!i.includes(a)&&i.push(a);return i}var Oi={google:"Google",github:"GitHub",gitlab:"GitLab",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",twitter:"X",twitter_v1:"X",x:"X",slack:"Slack",spotify:"Spotify",twitch:"Twitch",notion:"Notion",linear:"Linear",steam:"Steam"};function It(e){return Oi[e]?Oi[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var ac="0.13.0",Hi={name:"@atlasauth/embed",version:ac};function lc(e,t){return(n,r)=>{let o=typeof n=="string"?n:n.toString(),i;try{i=new URL(o)}catch{return t(n,r)}return i.searchParams.has("publishable_key")||i.searchParams.set("publishable_key",e),t(i.toString(),r)}}function ji(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new tt({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:lc(e.publishableKey,t),locale:e.locale,sdk:Hi,referral:e.referral,referralConsent:e.referralConsent})}async function Wi(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var Jn="atlas-embed-styles",Ki=`
38
+ };`;async function pc(e,t={}){var i,s,a,l;let n=(i=t.cancelled)!=null?i:()=>!1,r=globalThis;if(t.workers!==!1&&r.Worker&&r.Blob&&((s=r.URL)!=null&&s.createObjectURL)){let c=await fc(e,Math.max(1,Math.min(4,(l=(a=r.navigator)==null?void 0:a.hardwareConcurrency)!=null?l:2)),n).catch(()=>{});if(c!==void 0){if(c===null)throw new Error("captcha: no solution");return{n:c,worker:!0}}}let o=await dc(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function fc(e,t,n){let r=URL.createObjectURL(new Blob([uc],{type:"text/javascript"})),o=[],i=()=>{for(let s of o)s.terminate();URL.revokeObjectURL(r)};return new Promise((s,a)=>{let l=t,c=Math.ceil((e.maxnumber+1)/t),d=setInterval(()=>{n()&&(clearInterval(d),i(),s(null))},100),u=p=>{clearInterval(d),i(),p instanceof Error?a(p):s(p)};try{for(let p=0;p<t;p++){let f=new Worker(r);o.push(f),f.onmessage=m=>{var h;typeof((h=m.data)==null?void 0:h.n)=="number"?u(m.data.n):--l===0&&u(null)},f.onerror=()=>u(new Error("captcha: worker failed"));let g=p*c;f.postMessage({salt:e.salt,challenge:e.challenge,from:g,to:Math.min(e.maxnumber,g+c-1)})}}catch(p){u(p instanceof Error?p:new Error("captcha: worker failed"))}})}var gc=e=>{let t=new TextEncoder().encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function mc(e){return`atlas1.${gc(JSON.stringify(e))}`}async function hc(e,t=!1){let n=t?`${e}${e.includes("?")?"&":"?"}accessible=true`:e,r=await fetch(n,{method:"GET",credentials:"omit"});if(!r.ok)throw new Error(`captcha: challenge refused (${r.status})`);return await r.json()}function ki(e,t){let n=e.createElement("img");return n.src=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`,n.alt="",n.width=64,n.height=64,n.style.cssText="display:block;width:64px;height:64px;border-radius:6px",n}function yc(e,t,n,r){let o=e.ownerDocument;return new Promise((i,s)=>{e.replaceChildren();let a=o.createElement("div");a.setAttribute("role","group"),a.setAttribute("data-atlas-captcha-puzzle",""),a.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let l=o.createElement("p");l.style.cssText="margin:0;font-size:13px;text-align:center",l.textContent=n.puzzlePrompt,a.append(l,ki(o,t.interactive.example));let c=o.createElement("div");c.style.cssText="display:grid;grid-template-columns:repeat(3,72px);gap:6px";let d=0;t.interactive.tiles.forEach((p,f)=>{let g=o.createElement("button");g.type="button",g.setAttribute("aria-pressed","false"),g.setAttribute("aria-label",n.tile.replace("{n}",String(f+1))),g.setAttribute("data-atlas-captcha-tile",String(f)),g.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",g.append(ki(o,p)),g.addEventListener("click",()=>{d^=1<<f;let m=(d&1<<f)!==0;g.setAttribute("aria-pressed",m?"true":"false"),g.style.borderColor=m?"currentColor":"transparent"}),c.append(g)});let u=o.createElement("button");if(u.type="button",u.setAttribute("data-atlas-captcha-confirm",""),u.textContent=n.confirm,u.addEventListener("click",()=>r()?s(new Error("captcha: widget removed")):i(d)),a.append(c,u),t.accessible_alternative){let p=o.createElement("button");p.type="button",p.setAttribute("data-atlas-captcha-alternative",""),p.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",p.textContent=n.alternative,p.addEventListener("click",()=>i("accessible")),a.append(p)}e.append(a)})}function nr(e,t){var f,g;let n={...ac,...t.labels},r=(f=t.mode)!=null?f:"managed",o=e.ownerDocument,i=(g=t.fetchChallenge)!=null?g:m=>t.challengeUrl?hc(t.challengeUrl,m):Promise.reject(new Error("captcha: no challenge URL")),s=!1,a=0,l=()=>s,c=o.createElement("div");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.setAttribute("data-atlas-captcha-provider","atlas"),c.style.cssText="font-size:13px;opacity:.85;text-align:center",e.append(c);let d=m=>{c.replaceChildren(),c.textContent=m},u=async m=>{let h=await i(m);if(s)throw new Error("captcha: widget removed");a=Date.parse(h.expires_at)||0,(r==="visible"||h.interactive)&&d(n.checking);let w=Date.now(),P=pc(h,{workers:t.workers,cancelled:l}).then(x=>({...x,ms:Date.now()-w}));P.catch(()=>{});let A;if(h.interactive){let x=await yc(c,h,n,l);if(x==="accessible")return d(n.checking),u(!0);A=x,d(n.checking)}let{n:S,worker:y,ms:b}=await P;if(s)throw new Error("captcha: widget removed");return(r==="visible"||A!==void 0)&&d(n.verified),mc({t:h.token,n:S,ms:b,...y?{w:1}:{},...A!==void 0?{sel:A}:{}})},p=u(!1);return p.catch(()=>{}),{token:p,stale:()=>a>0&&Date.now()>a-15e3,remove(){s=!0,c.remove()}}}var bc=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function at(e,t){return!e||!bc.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function ze(e){return!!e&&e.enabled===!0&&at(e.provider,e)}var kc=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function rr(e){return!!e&&typeof e.code=="string"&&kc.includes(e.code)}var _c={turnstile:{src:()=>"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",global:"turnstile"},hcaptcha:{src:()=>"https://js.hcaptcha.com/1/api.js?render=explicit",global:"hcaptcha"},recaptcha:{src:()=>"https://www.google.com/recaptcha/api.js?render=explicit",global:"grecaptcha"},recaptcha_v3:{src:e=>`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},recaptcha_enterprise:{src:e=>`https://www.google.com/recaptcha/enterprise.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},captchafox:{src:()=>"https://cdn.captchafox.com/api.js?render=explicit",global:"captchafox"}};function _i(e,t,n){let r=_c[e];if(!r)return Promise.reject(new Error(`captcha: ${e} is not renderable`));if(n[r.global])return Promise.resolve(n[r.global]);let o=n.document,i=`__atlasCaptchaLoad_${e}`,s=n[i];if(s)return s;let a=new Promise((l,c)=>{var f,g;let d=()=>{n[r.global]?l(n[r.global]):c(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),p=o.querySelector(`script[src="${u}"]`);if(p){if(n[r.global])return l(n[r.global]);p.addEventListener("load",d,{once:!0}),p.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0});return}p=o.createElement("script"),p.src=u,p.async=!0,p.defer=!0,p.addEventListener("load",d,{once:!0}),p.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0}),((g=(f=o.head)!=null?f:o.body)!=null?g:o.documentElement).appendChild(p)});return n[i]=a,a.catch(()=>{n[i]===a&&delete n[i]}),a}function vc(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: turnstile error")),"timeout-callback":()=>s(new Error("captcha: turnstile timeout"))});o(()=>{var l;return(l=e.remove)==null?void 0:l.call(e,a)}),r==="invisible"&&e.execute&&e.execute(a)})}function xc(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: hcaptcha error"))});if(o(()=>{var l;return(l=e.remove)==null?void 0:l.call(e,a)}),r==="invisible"){let l=e.execute(a,{async:!0});l&&typeof l.then=="function"&&l.then(c=>i(c.response),s)}})}function wc(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: recaptcha error"))});if(o(()=>{var l;return(l=e.reset)==null?void 0:l.call(e,a)}),r==="invisible"&&e.execute){let l=e.execute(void 0,{widgetId:a});l&&typeof l.then=="function"&&l.then(i,s)}})}function Sc(e,t,n,r,o){return new Promise((i,s)=>{let a=()=>s(new Error("captcha: captchafox error"));Promise.resolve(e.render(t,{sitekey:n,mode:r==="invisible"?"hidden":"inline",onVerify:l=>i(l),onError:a,onFail:a})).then(l=>{o(()=>{var c;return(c=e.remove)==null?void 0:c.call(e,l)}),r==="invisible"&&e.execute&&Promise.resolve(e.execute(l)).then(c=>{typeof c=="string"&&c&&i(c)},a)},a)})}async function vi(e,t=globalThis.fetch){let n=await t(e,{method:"POST",credentials:"same-origin",headers:{accept:"application/json"}});if(!n.ok)throw new Error(`captcha: BotID attestation route answered ${n.status}`);let r=await n.json();if(typeof r.token!="string"||!r.token)throw new Error("captcha: BotID attestation missing");return r.token}function Cc(e,t){let n=()=>{let r=e.execute(t,{action:"submit"});return r&&typeof r.then=="function"?r:Promise.reject(new Error("captcha: recaptcha v3 execute returned no promise"))};return new Promise((r,o)=>{e.ready?e.ready(()=>n().then(r,o)):n().then(r,o)})}function xi(e,t,n={}){var p,f,g,m,h,w,P,A,S;let r=(p=e.provider)!=null?p:"";if(r==="atlas")return nr(t,{challengeUrl:e.challengeUrl,mode:(f=e.widget)!=null?f:"managed",...n.atlas});if(r==="vercel_botid"){let y=!1,b=(m=(g=t.ownerDocument)==null?void 0:g.defaultView)!=null?m:globalThis,x=e.attestationUrl?vi(e.attestationUrl,(h=b.fetch)==null?void 0:h.bind(b)).then(k=>{if(y)throw new Error("captcha: widget removed");return k}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return x.catch(()=>{}),{token:x,remove(){y=!0}}}let o=(w=e.siteKey)!=null?w:"",i=(P=e.widget)!=null?P:"managed",s=(S=(A=t.ownerDocument)==null?void 0:A.defaultView)!=null?S:globalThis,a=!1,l=null,c=null,d=y=>{l=y};return{token:new Promise((y,b)=>{c=b,_i(r,o,s).then(x=>{if(a)throw new Error("captcha: widget removed");switch(r){case"turnstile":return vc(x,t,o,i,d);case"hcaptcha":return xc(x,t,o,i,d);case"recaptcha":return wc(x,t,o,i,d);case"recaptcha_v3":case"recaptcha_enterprise":return Cc(x,o);case"captchafox":return Sc(x,t,o,i,d);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(y,b)}),remove(){if(!a){a=!0;try{l==null||l()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);c==null||c(new Error("captcha: widget removed"))}}}}async function or(e,t,n){return xi(e,t,n).token}var Ac="/v1/client/sign_ins/passkey/begin",wi=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function ir(e,t={}){var l;let n=c=>e.post(Ac,c?{captcha_token:c}:{}),r=(l=t.captcha)!=null?l:null,o=r?await wi(r,{retry:!1}):null,i=await n(o);if(i.ok||!r)return i;let s=i.errors.find(c=>rr(c));if(!s)return i;let a=await wi(r,{retry:!0,refused:s.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return a?n(a):i}var Si="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",Pp=BigInt("0x"+Si),Ep=BigInt(0),Rp=BigInt(1),Tp=BigInt(5),Ip=Si.length/2,Op=new TextEncoder;var Ot=class extends Error{constructor(n,r,o,i,s,a){super(o);v(this,"code");v(this,"status");v(this,"param");v(this,"reason");v(this,"meta");this.name="OrganizationRequestError",this.status=n,this.code=r,this.param=i,s&&(this.reason=s),a&&(this.meta=a)}get needsReverification(){return this.code==="STEP_UP_REQUIRED"}};var G=encodeURIComponent,F=e=>`/v1/client/organizations/${G(e)}`;async function D(e,t,n={}){var o,i;let r=await e.request(t,n);if(!r.ok||!r.data){let s=r.errors[0];throw new Ot(r.status,(o=s==null?void 0:s.code)!=null?o:"UNKNOWN",(i=s==null?void 0:s.message)!=null?i:"The request failed.",s==null?void 0:s.param,s==null?void 0:s.reason,s==null?void 0:s.meta)}return r.data}var L=(e,t)=>t===void 0?{method:e}:{method:e,body:JSON.stringify(t)},$={getSso:(e,t)=>D(e,`${F(t)}/sso_connection`,L("GET")),saveSso:(e,t,n)=>D(e,`${F(t)}/sso_connection`,L("PATCH",n)),getDirectory:(e,t)=>D(e,`${F(t)}/directory`,L("GET")),createDirectoryToken:(e,t)=>D(e,`${F(t)}/directory/tokens`,L("POST")),revokeDirectoryToken:(e,t,n)=>D(e,`${F(t)}/directory/tokens/${G(n)}`,L("DELETE")),listDomains:async(e,t)=>(await D(e,`${F(t)}/domains`,L("GET"))).data,addDomain:(e,t,n)=>D(e,`${F(t)}/domains`,L("POST",{domain:n})),verifyDomain:(e,t,n)=>D(e,`${F(t)}/domains/${G(n)}/verify`,L("POST")),removeDomain:(e,t,n)=>D(e,`${F(t)}/domains/${G(n)}`,L("DELETE")),listLogStreams:async(e,t)=>(await D(e,`${F(t)}/log_streams`,L("GET"))).data,addLogStream:(e,t,n)=>D(e,`${F(t)}/log_streams`,L("POST",n)),removeLogStream:(e,t,n)=>D(e,`${F(t)}/log_streams/${G(n)}`,L("DELETE")),listApiKeys:async(e,t)=>(await D(e,`${F(t)}/api_keys`,L("GET"))).data,createApiKey:(e,t,n={})=>D(e,`${F(t)}/api_keys`,L("POST",n)),revokeApiKey:(e,t,n)=>D(e,`${F(t)}/api_keys/${G(n)}`,L("DELETE")),getIpAllowlist:(e,t)=>D(e,`${F(t)}/ip_allowlist`,L("GET")),setIpAllowlist:(e,t,n)=>D(e,`${F(t)}/ip_allowlist`,L("PATCH",{entries:n})),listWebhooks:async(e,t)=>(await D(e,`${F(t)}/webhook_endpoints`,L("GET"))).data,createWebhook:(e,t,n)=>D(e,`${F(t)}/webhook_endpoints`,L("POST",n)),updateWebhook:(e,t,n,r)=>D(e,`${F(t)}/webhook_endpoints/${G(n)}`,L("PATCH",r)),deleteWebhook:(e,t,n)=>D(e,`${F(t)}/webhook_endpoints/${G(n)}`,L("DELETE")),rotateWebhookSecret:(e,t,n)=>D(e,`${F(t)}/webhook_endpoints/${G(n)}/rotate_secret`,L("POST")),webhookDeliveries:async(e,t,n)=>(await D(e,`${F(t)}/webhook_endpoints/${G(n)}/deliveries`,L("GET"))).data,listAppEventTypes:async(e,t)=>(await D(e,`${F(t)}/app_event_types`,L("GET"))).data,listAppWebhooks:async(e,t)=>(await D(e,`${F(t)}/app_webhook_endpoints`,L("GET"))).data,createAppWebhook:(e,t,n)=>D(e,`${F(t)}/app_webhook_endpoints`,L("POST",n)),updateAppWebhook:(e,t,n,r)=>D(e,`${F(t)}/app_webhook_endpoints/${G(n)}`,L("PATCH",r)),deleteAppWebhook:(e,t,n)=>D(e,`${F(t)}/app_webhook_endpoints/${G(n)}`,L("DELETE")),revealAppWebhookSecret:(e,t,n)=>D(e,`${F(t)}/app_webhook_endpoints/${G(n)}/reveal_secret`,L("POST")),rotateAppWebhookSecret:(e,t,n)=>D(e,`${F(t)}/app_webhook_endpoints/${G(n)}/rotate_secret`,L("POST")),testAppWebhook:(e,t,n)=>D(e,`${F(t)}/app_webhook_endpoints/${G(n)}/test?wait=10s`,L("POST")),appWebhookDeliveries:async(e,t,n)=>(await D(e,`${F(t)}/app_webhook_endpoints/${G(n)}/deliveries`,L("GET"))).data,redeliverAppWebhook:(e,t,n,r)=>D(e,`${F(t)}/app_webhook_endpoints/${G(n)}/deliveries/${G(r)}/redeliver`,L("POST")),replayAppWebhook:(e,t,n,r="failing_since")=>D(e,`${F(t)}/app_webhook_endpoints/${G(n)}/replay`,L("POST",{since:r}))};var sr=e=>{let t=typeof e=="string"?Number(e):e;return typeof t=="number"&&Number.isFinite(t)?t:0};function Ci(e,t,n){try{return new Intl.NumberFormat(n,{style:"currency",currency:t.toUpperCase()}).format(e/100)}catch{return`${(e/100).toFixed(2)} ${t.toUpperCase()}`}}function Ai(e,t={}){var d,u;let n=e.interval==="year"?"year":"month",r=(d=t.interval)!=null?d:n,o=e.annual_available&&e.annual_amount!=null?sr(e.annual_amount):null,i=r===n?sr(e.amount):r==="year"&&o!==null?o:sr(e.amount),s=r===n||r==="year"&&o!==null?r:n,a=e.promotion&&!(e.promotion.ends_at!==void 0&&e.promotion.ends_at<=((u=t.now)!=null?u:Date.now()))?e.promotion:null,l=i;a!=null&&a.percent_off?l=Math.round(i*(1-a.percent_off/100)):a!=null&&a.amount_off&&(l=Math.max(0,i-a.amount_off));let c=a!==null&&l<i;return{price:Ci(l,e.currency,t.locale),...c?{originalPrice:Ci(i,e.currency,t.locale)}:{},interval:s,free:l===0&&i===0,trialDays:e.trial_days&&e.trial_days>0?e.trial_days:null,...a?{promotionLabel:a.label}:{},...a!=null&&a.code?{promotionCode:a.code}:{},amount:l}}async function Pi(e,t={}){var o;let n=await e.get("/v1/client/billing/plans"),r=n.ok&&n.data?(o=n.data.data)!=null?o:[]:[];return t.audience?r.filter(i=>i.audience===t.audience):r}async function Ei(e,t){var r,o,i,s;let n=await e.post("/v1/client/billing/checkout",{plan_id:t.planId,...t.orgId?{org_id:t.orgId}:{},...t.interval?{interval:t.interval}:{},success_url:t.successUrl,cancel_url:(r=t.cancelUrl)!=null?r:t.successUrl});return n.ok&&((o=n.data)!=null&&o.url)?{url:n.data.url}:{url:null,error:(s=(i=n.errors[0])==null?void 0:i.message)!=null?s:"Could not start checkout."}}var Ft="atlas_marketing",Oi=90*24*60*6e4,Ri={enabled:!1,params:[],consentCategory:"marketing"},Ti=new Map;function Ec(e){let t=e.referralCacheKey,n=Ti.get(t);return n||(n=e.get("/v1/client/marketing").then(r=>{var s;let o=r.ok?(s=r.data)==null?void 0:s.capture:void 0;return o!=null&&o.enabled?{enabled:!0,params:Array.isArray(o.params)?o.params.filter(a=>typeof a=="string"):[],consentCategory:typeof o.consent_category=="string"?o.consent_category:"marketing"}:Ri}).catch(()=>Ri),Ti.set(t,n)),n}var Rc=()=>typeof window=="undefined"?null:window,ar=()=>{try{return typeof localStorage=="undefined"?null:localStorage}catch{return null}},Ii=e=>{if(!e)return null;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?`${t.origin}${t.pathname}`:null}catch{return null}};function Tc(e,t,n=new Date){var s,a,l,c,d;let r=new URLSearchParams((a=(s=t.location)==null?void 0:s.search)!=null?a:""),o={};for(let u of e.params.length?e.params:[]){let p=r.get(u);p&&p.trim()&&(o[u]=p.trim().slice(0,200))}if(Object.keys(o).length===0)return null;let i=(l=t.location)!=null&&l.origin?`${t.location.origin}${(c=t.location.pathname)!=null?c:"/"}`:null;return{params:o,landing_url:Ii(i),referrer:Ii((d=t.document)==null?void 0:d.referrer),captured_at:n.toISOString()}}var lr=e=>{try{let t=e==null?void 0:e.getItem(Ft);if(!t)return null;let n=JSON.parse(t);return n.expires_at!==void 0&&n.expires_at<Date.now()?(e==null||e.removeItem(Ft),null):n.first_touch&&n.last_touch?n:null}catch{return null}};function Ic(e={}){return lr(e.storage===void 0?ar():e.storage)}function Oc(e,t,n){return et(t,[e.consentCategory],{provider:"auto",appConsent:n.consent})}async function Dt(e,t={}){var l,c;let n=t.win===void 0?Rc():t.win,r=t.storage===void 0?ar():t.storage;if(!n||!r||!((l=n.location)!=null&&l.search)||n.location.search==="?")return!1;let o=await Ec(e);if(!o.enabled)return!1;let i=Tc(o,n);if(!i||!Oc(o,n,t).granted)return!1;let s=lr(r),a={first_touch:(c=s==null?void 0:s.first_touch)!=null?c:i,last_touch:i,expires_at:Date.now()+Oi};try{return r.setItem(Ft,JSON.stringify(a)),!0}catch{return!1}}async function Fi(e,t={}){var i;let n=t.storage===void 0?ar():t.storage,r=lr(n);if(!r||r.sent)return!1;let o=await e.post("/v1/client/me/marketing",{...r.last_touch,first_touch:r.first_touch});if(!o.ok)return!1;try{n==null||n.setItem(Ft,JSON.stringify({...r,sent:!0,expires_at:Date.now()+Oi}))}catch{}return((i=o.data)==null?void 0:i.recorded)===!0}async function Di(e,t,n={}){var i,s;let r=Ic(n),o=await e.post("/v1/client/marketing/leads",{email:t.email,...t.name?{name:t.name}:{},...t.form?{form:t.form}:{},consent:t.consent===!0,...t.website?{website:t.website}:{},...r?{marketing:{...r.first_touch}}:{}});return o.ok?{ok:!0}:{ok:!1,error:(s=(i=o.errors[0])==null?void 0:i.message)!=null?s:"Could not submit."}}var lt={attempt:null,errors:[],busy:!1,ticket:null};async function Li(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...lt,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,ticket:null}}async function $i(e,t,n,r={}){var l,c,d,u,p;let o=t.attempt;if(!o)return t;let i=null,s={};switch(o.status){case"needs_email_verification":i=`/v1/client/password_resets/${o.id}/attempt_verification`,s={code:(l=n.code)!=null?l:""};break;case"needs_second_factor":i=`/v1/client/password_resets/${o.id}/attempt_second_factor`,s={code:(c=n.code)!=null?c:""};break;case"needs_new_password":i=`/v1/client/password_resets/${o.id}/set_new_password`,s={password:(d=n.password)!=null?d:"",...(u=n.securityAnswers)!=null&&u.length?{security_answers:n.securityAnswers}:{}};break;default:return t}let a=await e.post(i,s);return!a.ok||!a.data?{...t,busy:!1,errors:a.errors}:{attempt:{id:a.data.id,status:a.data.status},errors:[],busy:!1,ticket:(p=a.data.ticket)!=null?p:null,...r.askQuestions?await Mi(e,a.data.id,a.data.status):{}}}async function Mi(e,t,n){if(n!=="needs_new_password")return{};let r=await bi(e,t);return r!=null&&r.required?{securityQuestions:r.questions}:{}}function Ne(e){var n;let t=(n=e.attempt)==null?void 0:n.status;if(!t)return"request";switch(t){case"needs_email_verification":return"collect_email_code";case"needs_second_factor":return"collect_second_factor";case"needs_new_password":return"collect_new_password";case"complete":return"done";default:return"unknown"}}async function Ui(e,t,n={}){let r=t.attempt;if(!(r!=null&&r.poll_secret))return t;let o=await e.get(`/v1/client/password_resets/${r.id}?poll_secret=${encodeURIComponent(r.poll_secret)}`);return!o.ok||!o.data?t:{...t,attempt:{id:o.data.id,status:o.data.status,poll_secret:r.poll_secret},...n.askQuestions?await Mi(e,o.data.id,o.data.status):{}}}var xf=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),Ni="This app can't send email right now. Try another sign-in method or contact the app owner.";var ct=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var cr=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),zi=e=>e==="link"||e==="both"?e:"code";function dr(e){var o;let t=ct(e)&&ct(e.account)?e.account:null;if(!t)return{...cr};let n=ct(t.username)?t.username:null,r=(i,s)=>typeof i=="number"&&Number.isInteger(i)?i:s;return{username:n?{minLength:r(n.min_length,3),maxLength:r(n.max_length,30),charset:n.charset==="alphanumeric"||n.charset==="alphanumeric_underscore"?n.charset:"default",requiredAtSignUp:n.required_at_sign_up===!0}:null,lastSignInMethod:t.last_sign_in_method===!0,emailVerification:zi(t.email_verification),passwordReset:zi(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...t.custom_second_factor===!0?{customSecondFactor:!0}:{},...ct(t.mfa)?{mfa:{totp:t.mfa.totp!==!1,sms:t.mfa.sms===!0,totpCodes:Number((o=t.mfa.totp_codes)!=null?o:t.mfa.totpCodes)>=2?2:1,...t.mfa.hotp===!0?{hotp:!0}:{},...t.mfa.yubikey===!0?{yubikey:!0}:{},...t.mfa.duo===!0?{duo:!0}:{},...t.mfa.security_questions===!0?{securityQuestions:!0}:{},...t.mfa.smart_card===!0?{smartCard:!0}:{}}}:{},passkeySignUp:ct(t.passkey_sign_up)?{email:t.passkey_sign_up.email==="off"||t.passkey_sign_up.email==="optional"?t.passkey_sign_up.email:"required"}:null}}function Bi(e){let t={...e};for(let n of["signUp","signIn"]){let r=t[n];r&&r.provider&&!r.enabled&&(t[n]={...r,enabled:!0})}return t}var ke=qa(Vi());var Yf=new TextEncoder;var Yi=["auto","light","dark"],Te=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],Ut=["none","uppercase"],Ji={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,golden:1.618,"minor-seventh":1.778,octave:2},Qi=Object.keys(Ji),zt=["none","sm","md","lg","xl"],Nt=["compact","comfortable","spacious"],Bt=["solid","glass","outline","none"],jt=["narrow","normal","wide"],Ht=["center","left","right","split"],qt=["left","right"],Wt=["card","page","hidden"],Kt=["sm","md","lg"],Gt=["solid","outline","soft","gradient"],Vt=["list","grid","icons"],Yt=["outline","filled","underline"],Zi=["linear","radial"],mr=["cover","contain"],hr=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],dt=["none","dots","grid","noise"],Jt=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],yr=/^#[0-9a-fA-F]{6}$/,br=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var ne="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",Qt="Georgia, Cambria, 'Times New Roman', Times, serif",kr="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",oe="wght@400;500;600;700;800",Xi=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${ne}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:Qt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:kr,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:ne,google:`Inter:${oe}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:ne,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:ne,google:`Open+Sans:${oe}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:ne,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:ne,google:`Montserrat:${oe}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:ne,google:`Poppins:${oe}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:ne,google:`Nunito:${oe}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:ne,google:`Work+Sans:${oe}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:ne,google:`DM+Sans:${oe}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:ne,google:`Manrope:${oe}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:Qt,google:`Source+Serif+4:${oe}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:Qt,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:Qt,google:`Playfair+Display:${oe}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:kr,google:`JetBrains+Mono:${oe}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:kr,google:"IBM+Plex+Mono:wght@400;500;600;700"}],es=Xi.map(e=>e.id),ts=new Map(Xi.map(e=>[e.id,e])),Hc=/^custom-[a-f0-9]{32}$/;function Zt(e){return typeof e=="string"&&Hc.test(e)}function qc(e){return`Brand ${e.slice(7,15)}`}function _r(e){return Zt(e)?{id:e,label:"Brand font",family:qc(e),category:"sans-serif",fallback:ne,google:null}:typeof e=="string"?ts.get(e):void 0}function vr(e){var n;let t=(n=_r(e))!=null?n:ts.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function ns(e){if(Zt(e))return`/v1/design/fonts/${e}.css`;let t=_r(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var xr=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Ie=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),K=e=>t=>typeof t=="string"&&e.includes(t),fe=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,os=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,ut=e=>typeof e=="string"&&yr.test(e),wr=e=>typeof e=="string"&&br.test(e);function _e(e,t=[]){return n=>{if(!xr(n))return!1;for(let r of Object.keys(n)){if(!Ie(e,r))return!1;let o=n[r];if(o===void 0){if(t.includes(r))return!1;continue}if(!e[r](o))return!1}return t.every(r=>Ie(n,r)&&n[r]!==void 0)}}var Wc=K(es),rs=e=>Wc(e)||Zt(e),Sr={palette:Object.fromEntries(Te.map(e=>[e,ut])),paletteDark:Object.fromEntries(Te.map(e=>[e,ut])),typography:{font:rs,headingFont:rs,baseSize:fe(12,20),headingWeight:fe(400,800,100),bodyWeight:fe(300,600,100),letterCase:K(Ut),scale:K(Qi)},shape:{radius:fe(0,32),controlRadius:fe(0,999),borderWidth:fe(0,3)},elevation:{cardShadow:K(zt)},spacing:{density:K(Nt)},card:{style:K(Bt),blur:fe(0,40),width:K(jt)},layout:{position:K(Ht),splitImageSide:K(qt),logoPlacement:K(Wt),logoSize:K(Kt)},buttons:{style:K(Gt),socialLayout:K(Vt)},inputs:{style:K(Yt)},logo:{assetId:wr,darkAssetId:wr}},Kc=e=>{if(!_e({type:K(Zi),angle:fe(0,360),stops:()=>!0},["type","stops"])(e))return!1;let t=e.stops;return Array.isArray(t)&&t.length>=2&&t.length<=4&&t.every(_e({color:ut,at:os(0,100)},["color","at"]))},Gc=_e({assetId:wr,fit:K(mr),position:K(hr),overlay:_e({color:ut,opacity:os(0,1)},["color","opacity"]),blur:fe(0,20)},["assetId"]),Cr={color:ut,gradient:Kc,image:Gc,pattern:K(dt)},pt={version:e=>e===1,preset:K(Jt),colorScheme:K(Yi),background:_e(Cr),backgroundDark:_e(Cr),...Object.fromEntries(Object.entries(Sr).map(([e,t])=>[e,_e(t)]))};function is(e,t){return Ie(pt,e)&&pt[e](t)}var ss=_e(pt);function as(e,t=()=>{},n=""){let r=(...i)=>[n,...i].filter(Boolean).join(".");if(e==null)return{};if(!xr(e))return t({path:n||"(root)",message:"must be an object"}),{};let o={};for(let[i,s]of Object.entries(e)){if(s===void 0)continue;if(!Ie(pt,i)){t({path:r(i),message:"Unknown setting."});continue}if(pt[i](s)){o[i]=s;continue}let a=Ie(Sr,i)?Sr[i]:i==="background"||i==="backgroundDark"?Cr:null;if(!a||!xr(s)){t({path:r(i),message:"Invalid value."});continue}let l={};for(let[c,d]of Object.entries(s))d!==void 0&&(Ie(a,c)&&a[c](d)?l[c]=d:t({path:r(i,c),message:Ie(a,c)?"Invalid value.":"Unknown setting."}));Object.keys(l).length&&(o[i]=l)}return o}var Vc=new Set(["__proto__","constructor","prototype"]),ls=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Ar(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(Vc.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let i=n[r];n[r]=ls(i)&&ls(o)?Ar(i,o):o}return n}function H(e){let t=e.split(" ");if(t.length!==Te.length)throw new Error(`palette spec needs ${Te.length} slots: ${e}`);let n={};return t.forEach((r,o)=>{r!=="-"&&(n[Te[o]]=r)}),n}var cs={version:1,preset:"minimal",colorScheme:"auto",palette:H("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:H("#fafafa #18181b #818cf8 #09090b #18181b #fafafa #a1a1aa #3f3f46 #f87171 #4ade80 #09090b #fafafa"),typography:{font:"inter",headingFont:"inter",baseSize:15,headingWeight:600,bodyWeight:400,letterCase:"none",scale:"perfect-fourth"},shape:{radius:12,controlRadius:8,borderWidth:1},elevation:{cardShadow:"md"},spacing:{density:"comfortable"},card:{style:"solid",blur:16,width:"normal"},layout:{position:"center",splitImageSide:"left",logoPlacement:"card",logoSize:"md"},buttons:{style:"solid",socialLayout:"list"},inputs:{style:"outline"},background:{},backgroundDark:{},logo:{}},ds={minimal:{design:{}},atlas:{design:{palette:H("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:H("#7455fa #ffffff #46c7ff #070811 #0f1120 #eef0f6 #959bb0 #262a40 #ff6b6b #43d9a0 #0b0d17 #eef0f6"),typography:{font:"system",headingFont:"system",headingWeight:600},shape:{radius:14,controlRadius:9,borderWidth:1},elevation:{cardShadow:"lg"},buttons:{style:"gradient"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#f6f5ff",at:0},{color:"#eef6ff",at:100}]}},backgroundDark:{gradient:{type:"radial",stops:[{color:"#1a1440",at:0},{color:"#070811",at:70}]},pattern:"grid"}}},glass:{design:{palette:H("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:H("#a5b4fc - #f472b6 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),shape:{radius:20,controlRadius:12},elevation:{cardShadow:"xl"},card:{style:"glass",blur:20},background:{gradient:{type:"linear",angle:135,stops:[{color:"#6366f1",at:0},{color:"#ec4899",at:55},{color:"#f59e0b",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#1e1b4b",at:0},{color:"#4c1d95",at:55},{color:"#831843",at:100}]}}}},midnight:{design:{colorScheme:"dark",palette:H("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:H("#60a5fa - #a78bfa #0b1020 #121a2f #e6eaf5 #94a3b8 #24314f #f87171 #34d399 #0e1528 #e6eaf5"),typography:{font:"manrope",headingFont:"manrope"},shape:{radius:16,controlRadius:10},elevation:{cardShadow:"lg"},backgroundDark:{pattern:"dots"}}},editorial:{design:{palette:H("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:H("#e07a5f - #d4a64a #16130f #1f1b16 #f2ebe0 #a89f92 #3a332a - - #16130f #f2ebe0"),typography:{font:"source-serif",headingFont:"playfair-display",baseSize:16,headingWeight:700,scale:"golden"},shape:{radius:4,controlRadius:2},elevation:{cardShadow:"sm"},inputs:{style:"underline"}}},terminal:{design:{colorScheme:"dark",palette:H("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:H("#39ff14 #031003 #00e5ff #0a0f0a #0d140d #c8f7c5 #7fb57b #2c5a2c #ff5555 #39ff14 #050805 #c8f7c5"),typography:{font:"jetbrains-mono",headingFont:"jetbrains-mono",baseSize:14,letterCase:"uppercase",scale:"major-second"},shape:{radius:0,controlRadius:0,borderWidth:1},elevation:{cardShadow:"none"},card:{style:"outline"},buttons:{style:"outline"},backgroundDark:{pattern:"grid"}}},sunrise:{design:{palette:H("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:H("#fb923c - #f472b6 #1a0f0a #24150f #fdebe1 #c4a092 #4a2e22 - - #1a0f0a #fdebe1"),typography:{font:"poppins",headingFont:"poppins"},shape:{radius:20,controlRadius:999},elevation:{cardShadow:"lg"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#fff1e6",at:0},{color:"#ffe4ec",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:160,stops:[{color:"#2a1209",at:0},{color:"#2a0f1c",at:100}]}}}},forest:{design:{palette:H("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:H("#4ade80 - #facc15 #0c1510 #13201a #e3efe6 #9db5a4 #2a3d31 - - #0c1510 #e3efe6"),typography:{font:"dm-sans",headingFont:"dm-sans"},shape:{radius:10,controlRadius:8},inputs:{style:"filled"}}},grape:{design:{palette:H("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:H("#c084fc - #f472b6 #12081f #1c1030 #f3e8ff #b4a3cf #3b2559 - - #12081f #f3e8ff"),typography:{font:"nunito",headingFont:"nunito",headingWeight:800},shape:{radius:24,controlRadius:14},buttons:{socialLayout:"grid"},background:{pattern:"dots"},backgroundDark:{pattern:"dots"}}},slate:{design:{palette:H("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:H("#cbd5e1 - #38bdf8 #0f172a #1e293b #f1f5f9 #94a3b8 #334155 - - #0f172a #f1f5f9"),typography:{font:"work-sans",headingFont:"work-sans"},shape:{radius:8,controlRadius:6},elevation:{cardShadow:"sm"},spacing:{density:"compact"},inputs:{style:"filled"}}},"split-photo":{design:{layout:{position:"split",splitImageSide:"left",logoPlacement:"page"},card:{style:"none",width:"normal"},elevation:{cardShadow:"none"},shape:{radius:0,controlRadius:8},background:{gradient:{type:"linear",angle:135,stops:[{color:"#0f172a",at:0},{color:"#334155",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#020617",at:0},{color:"#1e293b",at:100}]}}}},bold:{design:{palette:H("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:H("#a5b4fc - #facc15 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),typography:{font:"montserrat",headingFont:"montserrat",baseSize:17,headingWeight:800,letterCase:"uppercase",scale:"octave"},shape:{radius:24,controlRadius:999,borderWidth:0},elevation:{cardShadow:"xl"},spacing:{density:"spacious"},card:{width:"wide"}}}};var He=(e,t,n)=>Math.min(n,Math.max(t,e));function qe(e){if(!e||typeof e!="string")return null;let t=e.trim().toLowerCase();if(t==="transparent")return{r:0,g:0,b:0,a:0};let n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let l=n[1];if((l.length===3||l.length===4)&&(l=[...l].map(d=>d+d).join("")),l.length!==6&&l.length!==8)return null;let c=d=>parseInt(l.slice(d,d+2),16);return{r:c(0),g:c(2),b:c(4),a:l.length===8?c(6)/255:1}}let r=/^rgba?\(([^)]+)\)$/.exec(t);if(!r)return null;let o=r[1].replace("/"," ").split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let i=l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l),s=l=>l===void 0?1:l.endsWith("%")?parseFloat(l)/100:parseFloat(l),a={r:He(i(o[0]),0,255),g:He(i(o[1]),0,255),b:He(i(o[2]),0,255),a:He(s(o[3]),0,1)};return[a.r,a.g,a.b,a.a].some(Number.isNaN)?null:a}var Xt=e=>He(Math.round(e),0,255).toString(16).padStart(2,"0");function tn(e){return`#${Xt(e.r)}${Xt(e.g)}${Xt(e.b)}`}function Yc(e){let t=n=>{let r=n/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function en(e){let t=qe(e);return t?Yc(t):null}function ft(e,t){let n=en(e),r=en(t);if(n===null||r===null)return 1;let o=Math.max(n,r),i=Math.min(n,r);return(o+.05)/(i+.05)}var Jc=4.5,Qc=3;function us(e){var t;return((t=en(e))!=null?t:0)>.179?"#111827":"#ffffff"}function Zc(e,t,n){let r=e/255,o=t/255,i=n/255,s=Math.max(r,o,i),a=Math.min(r,o,i),l=(s+a)/2;if(s===a)return[0,0,l];let c=s-a,d=l>.5?c/(2-s-a):c/(s+a);return[s===r?((o-i)/c+(o<i?6:0))/6:s===o?((i-r)/c+2)/6:((r-o)/c+4)/6,d,l]}function Xc(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=a=>{let l=a;return l<0&&(l+=1),l>1&&(l-=1),l<1/6?o+(r-o)*6*l:l<1/2?r:l<2/3?o+(r-o)*(2/3-l)*6:o};return`#${(t===0?[n,n,n]:[i(e+1/3),i(e),i(e-1/3)]).map(a=>Xt(He(a,0,1)*255)).join("")}`}function ed(e,t,n=Jc){var u;let r=qe(e);if(!r||t.length===0)return e;let o=p=>t.every(f=>ft(p,f)>=n);if(o(e))return e;let s=((u=en(t[0]))!=null?u:1)>.179?-.01:.01,[a,l,c]=Zc(r.r,r.g,r.b),d=e;for(let p=1;p<=100;p+=1){let f=c+s*p;if(f<0||f>1)break;if(d=Xc(a,l,f),o(d))return d}return d}function ps(e,t){return ed(e,t,Qc)}var td=["primary","accent","danger","success"],xe=e=>JSON.parse(JSON.stringify(e));function gs(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(ss(e))return xe(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&is(n,r)&&(t[n]=xe(r));return t}function fs(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return t.primary&&!t.primaryInk&&(n.primaryInk=us(t.primary)),n}function Pr(e,t,n){var i,s,a;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=fs(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let l of td){let c=t.palette[l];c&&c!==r[l]&&!((i=t.paletteDark)!=null&&i[l])&&(o={...o!=null?o:{},[l]:c})}t.palette.primaryInk&&!((s=t.paletteDark)!=null&&s.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=fs(e.paletteDark,o),t.typography){let l=t.typography;e.typography={...e.typography,...ve(l),headingFont:(a=l.headingFont)!=null?a:l.font?l.font:e.typography.headingFont}}if(t.shape&&(e.shape={...e.shape,...ve(t.shape)}),t.elevation&&(e.elevation={...e.elevation,...ve(t.elevation)}),t.spacing&&(e.spacing={...e.spacing,...ve(t.spacing)}),t.card&&(e.card={...e.card,...ve(t.card)}),t.layout&&(e.layout={...e.layout,...ve(t.layout)}),t.buttons&&(e.buttons={...e.buttons,...ve(t.buttons)}),t.inputs&&(e.inputs={...e.inputs,...ve(t.inputs)}),t.background&&(e.background=xe(t.background)),t.backgroundDark)e.backgroundDark=xe(t.backgroundDark);else if(t.background&&n.carryBrand){let l={};t.background.gradient&&(l.gradient=xe(t.background.gradient)),t.background.image&&(l.image=xe(t.background.image)),t.background.pattern&&(l.pattern=t.background.pattern),e.backgroundDark=l}t.logo&&(e.logo=xe(t.logo))}function ve(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function Er(e){return typeof e=="string"&&Jt.includes(e)}function gt(e){let t=gs(e),n=Er(t.preset)?t.preset:"minimal",r=xe(cs);return r.preset=n,Pr(r,ds[n].design,{carryBrand:!1}),Pr(r,t,{carryBrand:!0}),r}function ms(e,t){let n=gt(e),r=gs(t);return delete r.preset,Pr(n,r,{carryBrand:!0}),n}var nd=Object.freeze({"--atlas-color-primary":"--atlas-host-accent","--atlas-color-primary-ink":"--atlas-host-accent-ink","--atlas-color-surface":"--atlas-host-surface","--atlas-card-background":"--atlas-host-surface","--atlas-color-text":"--atlas-host-ink","--atlas-color-border":"--atlas-host-line","--atlas-radius-control":"--atlas-host-radius","--atlas-font-body":"--atlas-host-font","--atlas-focus-outline-color":"--atlas-host-focus-ring"});function Rr(e){var o,i,s,a,l,c,d,u,p,f,g,m,h,w;let t=(P,A,S)=>typeof A=="string"&&P.includes(A)?A:S,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(Ht,(i=e==null?void 0:e.layout)==null?void 0:i.position,"center"),"data-atlas-split-side":t(qt,(s=e==null?void 0:e.layout)==null?void 0:s.splitImageSide,"left"),"data-atlas-logo":t(Wt,(a=e==null?void 0:e.layout)==null?void 0:a.logoPlacement,"card"),"data-atlas-logo-size":t(Kt,(l=e==null?void 0:e.layout)==null?void 0:l.logoSize,"md"),"data-atlas-card":t(Bt,(c=e==null?void 0:e.card)==null?void 0:c.style,"solid"),"data-atlas-card-width":t(jt,(d=e==null?void 0:e.card)==null?void 0:d.width,"normal"),"data-atlas-shadow":t(zt,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(Nt,(p=e==null?void 0:e.spacing)==null?void 0:p.density,"comfortable"),"data-atlas-button":t(Gt,(f=e==null?void 0:e.buttons)==null?void 0:f.style,"solid"),"data-atlas-social":t(Vt,(g=e==null?void 0:e.buttons)==null?void 0:g.socialLayout,"list"),"data-atlas-input":t(Yt,(m=e==null?void 0:e.inputs)==null?void 0:m.style,"outline"),"data-atlas-pattern":t(dt,n.pattern,"none"),"data-atlas-pattern-dark":t(dt,(h=e==null?void 0:e.backgroundDark)==null?void 0:h.pattern,"none"),"data-atlas-letter-case":t(Ut,(w=e==null?void 0:e.typography)==null?void 0:w.letterCase,"none")};return((e==null?void 0:e.colorScheme)==="dark"||(e==null?void 0:e.colorScheme)==="light")&&(r["data-atlas-theme"]=e.colorScheme),r}function hs(e){var n,r;let t=new Set;for(let o of[(n=e==null?void 0:e.typography)==null?void 0:n.font,(r=e==null?void 0:e.typography)==null?void 0:r.headingFont]){let i=ns(o);i&&t.add(i)}return[...t]}var Nm=Object.freeze([...new Set(Object.values(nd))]);function Tr(){try{return typeof process!="undefined"&&!1}catch{return!1}}var bs=e=>{Tr()&&console.warn(`[atlas] ${e}`)},ys=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function rd(e,t=bs,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):as(e,r=>t(r.message==="Unknown setting."&&r.path.split(".").length===n.split(".").length+1?`${r.path} is not a design setting; ignored.`:`${r.path} is invalid; ignored.`),n)}function ks(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)}var od=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function id(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!od.test(n)?[]:hs(e).map(r=>`${n}${r}`)}function sd(e){if(!(!ys(e)||!ys(e.resolved)))return e.resolved}function _s(e){var c,d,u;let t=(c=e.warn)!=null?c:bs,n=sd(e.instance),r=rd(e.design,t,"appearance.design"),o,i=(d=e.preset)!=null?d:r.preset;i!==void 0&&(Er(i)?o=i:t(`appearance.preset "${String(i)}" is not a preset; ignored.`));let s=o!==void 0||Object.keys(r).some(p=>p!=="preset");if(!n&&!s)return null;let a=o?gt({preset:o}):n?gt(n):gt({}),l=Ar((u=e.tokensDesign)!=null?u:{},r);return ms(a,l)}function vs(e,t){return id(e,t)}var xs=null;function ad(e){var t,n;if(xs)return xs;try{let r=(t=e.querySelector)==null?void 0:t.call(e,'meta[name="csp-nonce"]'),o=r==null?void 0:r.getAttribute("content");if(o)return o;let i=(n=e.querySelector)==null?void 0:n.call(e,"script[nonce]"),s=i?i.nonce||i.getAttribute("nonce"):null;if(s)return s}catch{}return null}var ws=new WeakMap,Ss=new WeakMap;function nn(e,t){let n=ad(e);if(n){t.setAttribute("nonce",n);try{t.nonce=n}catch{}}}function rn(e,t,n){var o;let r=globalThis.CSSStyleSheet;if(r&&Array.isArray(e.adoptedStyleSheets)&&typeof((o=r.prototype)==null?void 0:o.replaceSync)=="function")try{let i=ws.get(e);i||ws.set(e,i=new Map);let s=Ss.get(e);s||Ss.set(e,s=new Map),s.set(t,n);let a=i.get(t);return a?a.replaceSync(n):(a=new r,i.set(t,a),a.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]),!0}catch{}return!1}var Cs=new Set,As=e=>{var t;!Tr()||Cs.has(e)||(Cs.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function Ps(e){var r,o;if(!e||typeof e!="object")return null;let t=e,n=(o=t.design)!=null?o:(r=t.appearance)==null?void 0:r.design;return n&&typeof n=="object"&&n.resolved?n:null}function Es(e,t,n,r){var o,i;for(let s of(o=r==null?void 0:r.attributes)!=null?o:[])s in n.attributes||t.removeAttribute(s);for(let s of(i=r==null?void 0:r.style)!=null?i:[])s in n.style||t.style.removeProperty(s);for(let[s,a]of Object.entries(n.style))t.style.setProperty(s,a);for(let[s,a]of Object.entries(n.attributes))t.setAttribute(s,a);if(n.css){let s=e;if(!rn(s,`design:${n.key}`,n.css)&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(l=>l.getAttribute("data-atlas-design")===n.key)){let l=e.createElement("style");l.setAttribute("data-atlas-design",n.key),nn(s,l),l.textContent=n.css,e.head.appendChild(l)}}if(n.fontStylesheets.length){let s=new Set(Array.from(e.head.querySelectorAll("link[data-atlas-font]")).map(a=>a.getAttribute("href")));for(let a of n.fontStylesheets){if(s.has(a))continue;let l=e.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("href",a),l.setAttribute("data-atlas-font",""),e.head.appendChild(l)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var ld=["boxes","single"];function Ts(e,t){for(let n of[t,e])if(n&&ld.includes(n))return n;return"boxes"}var Is=8,cd=["solid","outline","soft","ghost"],dd=["none","scale","lift","glow","ripple"],ud=["none","sm","md","lg"],pd=["comfortable","compact"],fd=["outline","filled","underline"],gd=["slow","normal","fast"],md=["spinner","skeleton","dots","bar"],Os={slow:280,normal:160,fast:80};function on(e,t){let n=(r,o,...i)=>{for(let s of i)if(s!==void 0&&r.includes(s))return s;return o};return{buttonStyle:n(cd,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(dd,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(ud,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n(pd,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(fd,"outline",t==null?void 0:t.inputStyle,e==null?void 0:e.inputStyle),animations:typeof(t==null?void 0:t.animations)=="boolean"?t.animations:typeof(e==null?void 0:e.animations)=="boolean"?e.animations:!0,motionSpeed:n(gd,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(md,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var hd=["block","compact","icon"],yd=["sm","md","lg"],bd=["list","grid","carousel"],kd=["auto","always","never"];function Ir(e,t){var r,o,i;let n=(s,...a)=>{for(let l of a)if(l!==void 0&&s.includes(l))return l;return s[0]};return{variant:n(hd,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(yd,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(bd,t==null?void 0:t.layout,e==null?void 0:e.layout),labels:{...(o=e==null?void 0:e.labels)!=null?o:{},...(i=t==null?void 0:t.labels)!=null?i:{}},search:n(kd,t==null?void 0:t.search,e==null?void 0:e.search)}}var ge={colorPrimary:"#5b5bd6",colorText:"#1c1c1f",colorBackground:"#ffffff",colorAccent:"#5b5bd6",colorCard:"#ffffff",colorBorder:"#e4e4e9",borderRadius:"10px",fontFamily:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};function _d(e){return e?{colorPrimary:e.colorPrimary||ge.colorPrimary,colorText:e.colorText||ge.colorText,colorBackground:e.colorBackground||ge.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||ge.colorAccent,colorCard:e.colorCard||e.colorBackground||ge.colorCard,colorBorder:e.colorBorder||ge.colorBorder,borderRadius:e.borderRadius||ge.borderRadius,fontFamily:e.fontStack||ge.fontFamily}:ge}function Fs(e,t){var o;let n={..._d(e)},r=(o=t==null?void 0:t.variables)!=null?o:{};for(let[i,s]of Object.entries(r))s!==void 0&&(n[i]=s);return n}function Ds(e){let t={};for(let[n,r]of Object.entries(e))t[`--atlas-embed-${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}`]=r;return t}function Ls(e){let t=qe(e);if(!t)return"#ffffff";let n=tn(t);return ft("#ffffff",n)>=ft("#111111",n)?"#ffffff":"#111111"}function $s(e,t){let n=qe(e);if(!n)return e;let r=tn(n),o=t.map(i=>qe(i)).filter(i=>!!i&&i.a>0).map(tn);return o.length===0||o.every(i=>ft(r,i)>=3)?e:ps(r,o)}function Ms(e,t,n){var o;let r=(o=n==null?void 0:n.elements)==null?void 0:o[e];return r?`${t} ${r}`:t}function Us(e,t){var s,a;let n=(s=t==null?void 0:t.providerOrder)!=null?s:[],r=new Set((a=t==null?void 0:t.providerHidden)!=null?a:[]),o=new Set(e.filter(l=>!r.has(l))),i=[];for(let l of n)o.has(l)&&!i.includes(l)&&i.push(l);for(let l of e)o.has(l)&&!i.includes(l)&&i.push(l);return i}var Rs={google:"Google",github:"GitHub",gitlab:"GitLab",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",twitter:"X",twitter_v1:"X",x:"X",slack:"Slack",spotify:"Spotify",twitch:"Twitch",notion:"Notion",linear:"Linear",steam:"Steam"};function sn(e){return Rs[e]?Rs[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var vd="0.15.0",zs={name:"@atlasauth/embed",version:vd};function xd(e,t){return(n,r)=>{let o=typeof n=="string"?n:n.toString(),i;try{i=new URL(o)}catch{return t(n,r)}return i.searchParams.has("publishable_key")||i.searchParams.set("publishable_key",e),t(i.toString(),r)}}function we(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new At({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:xd(e.publishableKey,t),locale:e.locale,sdk:zs,referral:e.referral,referralConsent:e.referralConsent})}async function Ns(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var Or="atlas-embed-styles",Bs=`
39
39
  /* The host page's --atlas-host-* variables (shared UI-kit names) restyle the widget
40
40
  where the page sets them; explicit --atlas-embed-* settings still win. */
41
41
  .atlas-embed-root {
@@ -410,4 +410,5 @@ form > .atlas-embed-step-back { display: block; width: 100%; text-align: center;
410
410
  .atlas-embed-loadbar::before { position: static; width: 100%; }
411
411
  }
412
412
  @keyframes atlas-embed-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
413
- `,qi=new WeakSet;function Vi(e=document){var n;if(qi.has(e)||e.querySelector(`style[data-${Jn}]`))return;if(Rt(e,Jn,Ki)){qi.add(e);return}let t=e.createElement("style");t.setAttribute(`data-${Jn}`,""),Pt(e,t),t.textContent=Ki,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function Gi(e,t,n={}){var u;let r=wi({instance:(t==null?void 0:t.instanceDesign)===!1?null:e,preset:t==null?void 0:t.preset,design:t==null?void 0:t.design,warn:Ri});if(!r)return null;let i=r.colorScheme==="dark"||r.colorScheme==="auto"&&!!n.prefersDark?r.paletteDark:r.palette,s={colorPrimary:i.primary,colorText:i.text,colorBackground:i.background,colorAccent:i.accent,colorCard:i.surface,colorBorder:i.border,borderRadius:`${Math.min(r.shape.controlRadius,24)}px`,fontFamily:Nn(r.typography.font)};for(let[f,p]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))p!==void 0&&(s[f]=p);let l=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,a={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":l,density:r.spacing.density==="compact"?"compact":"comfortable",inputStyle:r.inputs.style},d=r.buttons.socialLayout==="icons"?{variant:"icon",layout:"grid"}:{layout:r.buttons.socialLayout==="grid"?"grid":"list"},c=xi(JSON.stringify(r));return{render:{style:{},attributes:{...Vn(r),"data-atlas-design":c},css:"",key:c,fontStylesheets:Si(r,n.frontendApi)},tokens:s,interaction:a,socialButtons:d,resolved:r}}var Yi=new Set(["bluesky"]),Ji='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>',Zi='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg>',me={"sign-in":{title:"Sign in",submit:"Continue"},"sign-up":{title:"Create your account",submit:"Continue"}};function I(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function h(e,t,n,r){let o=I(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-form-error")||o.classList.contains("atlas-embed-error"))&&o.setAttribute("role","alert"),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&cc(e,o),o}function R(e,t,n){return zi(t,n,e.options.appearance)}function cc(e,t){e.interaction.buttonEffect!=="ripple"||!e.interaction.animations||t.addEventListener("pointerdown",n=>{let r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),i=I(e).createElement("span");i.className="atlas-embed-ripple",i.style.width=i.style.height=`${o}px`,i.style.left=`${n.clientX-r.left-o/2}px`,i.style.top=`${n.clientY-r.top-o/2}px`,i.addEventListener("animationend",()=>i.remove()),t.appendChild(i)})}function Ee(e,t){let n=h(e,"button",R(e,"buttonPrimary","atlas-embed-button"));if(n.type="submit",n.disabled=e.busy,e.busy){n.setAttribute("data-busy",""),n.setAttribute("aria-label",t);let r=h(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function Xi(e,t=typeof window!="undefined"?window.location.origin:""){if(!e||typeof e!="string")return null;if(e.startsWith("/")&&!e.startsWith("//"))try{return t?new URL(e,t).toString():e}catch{return null}let n;try{n=new URL(e)}catch{return null}return t&&n.origin===t||n.protocol==="https:"?n.toString():null}async function qe(e,t,n=!1){var l,a,d;let r=e.captchaFlows[t];if(!(n?!!r&&$e(r.provider,r):we(r))||!r)return null;let i=(l=e.root.ownerDocument)!=null?l:document,s=i.createElement("div");s.className="atlas-embed-captcha",((d=(a=e.root.parentElement)!=null?a:i.body)!=null?d:i.documentElement).appendChild(s);try{return await Pn(r,s,{atlas:{labels:Cn(e.options.localization)}})}catch{return null}finally{s.remove()}}var Zn=new WeakMap;async function dc(e){let t=Zn.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=_r({win:e}).catch(()=>null);Zn.set(e,n),n.finally(()=>Zn.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function ts(e){var o,i;let t=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null;if(!t)return!1;let n=await dc(t);if(n!=null&&n.delivered)return Pe(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let s=Sr(n.payload);if(s!=null&&s.ticket&&s.attemptId)return await Qi(e,t,s.attemptId,s.ticket),!0;if(s!=null&&s.continuationUrl)return t.location.replace(s.continuationUrl),!0}let r=Cr(t.location.search);return r?r.ticket?(await Qi(e,t,r.attemptId,r.ticket,()=>es(e,t)),!0):(r.status&&(e.state=nt({id:r.attemptId,status:r.status,...r.policyToken?{policyToken:r.policyToken}:{}}),es(e,t)),!1):!1}async function Qi(e,t,n,r,o){let i=await ce(e,n,r);o==null||o(),!(i&&await xr({win:t}).catch(()=>!1))&&await V(e,n)}function es(e,t){try{t.history.replaceState({},t.document.title,Ye(t.location.href))}catch{}}async function ce(e,t,n){return e.options.preview?!1:(await e.client.post("/v1/client/tickets/exchange",{attempt_id:t,ticket:n,remember:e.remember})).ok}async function V(e,t){var o,i;let n=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=Xi(e.options.redirect,n?n.location.origin:void 0);if(e.root.dispatchEvent(new CustomEvent("atlas:complete",{bubbles:!0,detail:{attemptId:t,redirected:!!r}})),e.options.preview){Pe(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}Pe(e,"You are signed in.")}function Ve(e,t){fo({api:e.options.frontendApi,publishableKey:e.options.publishableKey,attemptId:t!=null?t:void 0,kind:e.mode==="sign-up"?"sign_up":"sign_in",recorder:e.recorder,fetchImpl:e.options.fetchImpl})}async function he(e,t,n){var l,a,d,c,u;if(e.busy)return;if((l=e.conditionalAbort)==null||l.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,Ve(e,(a=e.state.attempt)==null?void 0:a.id),P(e),e.state=await Me(e.client,e.state,t),e.state.attempt&&z(e.state.attempt).kind==="collect_captcha"){let f=await qe(e,"signIn",!0);f&&(e.state=await Me(e.client,e.state,{identifier:(c=(d=e.enteredIdentifier)!=null?d:t.identifier)!=null?c:"",captcha_token:f}))}let r=e.state.attempt?z(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await Ot(e,n,!1):e.state={...e.state,errors:[{code:"STRATEGY_DISABLED",message:"That sign-in method is not available for this account."}]}:(r==null?void 0:r.kind)==="collect_first_factor"&&t.password&&e.state.errors.length===0&&(e.state=await Me(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?z(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...B,errors:e.state.errors});let i=e.state.attempt?z(e.state.attempt):null;if((i==null?void 0:i.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let f=Ge(e.emailDeliveryAvailable?i.strategies:i.strategies.filter(p=>p!=="email_code"&&p!=="email_link")).autoSend;f&&await Ot(e,f,!1)}let s=e.state.attempt;if(Te(e.state)){P(e);return}if((s==null?void 0:s.status)==="complete"){let f=(u=s.id)!=null?u:null;e.state.ticket&&f&&await ce(e,f,e.state.ticket),await V(e,f);return}P(e)}async function ns(e){var n,r;if(e.busy||!Te(e.state))return;e.state=Vr(e.state);let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.busy=!0;try{e.state.ticket&&t&&await ce(e,t,e.state.ticket)}finally{e.busy=!1}await V(e,t)}async function Ot(e,t,n=!0){var i;if(n){if(e.busy)return;e.busy=!0,P(e)}let r=(i=e.state.prepared)!=null?i:null,o=await xo(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&os(e),n&&(e.busy=!1,P(e))}async function rs(e){e.busy||(e.busy=!0,P(e),e.state=await _o(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,P(e))}function os(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var i,s;if(!hn(e.state)){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let t=(i=e.state.attempt)==null?void 0:i.status,{state:n,ticket:r}=await wo(e.client,e.state);if(e.state=n,!r&&n.attempt&&n.attempt.status!==t&&P(e),!r||!n.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let o=(s=n.attempt.id)!=null?s:null;o&&await ce(e,o,r),await V(e,o)})()},2e3)}async function Lt(e,t,n){var l,a,d;Ve(e);let r=(a=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?a:typeof window!="undefined"?window:null,o=r?Ye(r.location.href):e.options.frontendApi,i=await e.client.post("/v1/client/sign_ins/oauth",{provider:t,redirect_url:o,...n?{identifier:n}:{}}),s=(d=i.data)==null?void 0:d.authorization_url;s&&r?r.location.assign(s):(e.handlePrompt=null,ee(e,i.errors))}async function Xn(e,t,n={}){var l,a,d;Ve(e);let r=(a=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?a:typeof window!="undefined"?window:null,o=r?Ye(r.location.href):e.options.frontendApi;if(n.popup&&r){await pc(e,t,r,o);return}let i=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),s=(d=i.data)==null?void 0:d.authorization_url;s&&r?r.location.assign(s):ee(e,i.errors)}function uc(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function pc(e,t,n,r){var u;let o=n.open("about:blank","atlas-sso","width=480,height=640,menubar=no,toolbar=no,location=no,status=no");if(!o){await Xn(e,t);return}let i=r.includes("?")?"&":"?",s=`${r}${i}__atlas_display=popup`,l=uc(e),a=f=>{if(f.origin!==l)return;let p=f.data;if(!(!p||p.type!=="atlas-sso")){n.removeEventListener("message",a);try{o.close()}catch{}if(p.error){ee(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(p.status==="complete"&&p.ticket&&p.attempt_id){let g=p.attempt_id,y=p.ticket;(async()=>(await ce(e,g,y),await V(e,g)))();return}p.attempt_id&&p.status&&(e.state=nt({id:p.attempt_id,status:p.status,...typeof p.policy_token=="string"?{policyToken:p.policy_token}:{}}),P(e))}};n.addEventListener("message",a);let d=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:s}),c=(u=d.data)==null?void 0:u.authorization_url;if(c)try{o.location.assign(c)}catch{try{o.close()}catch{}n.removeEventListener("message",a),n.location.assign(c)}else{n.removeEventListener("message",a);try{o.close()}catch{}ee(e,d.errors)}}async function is(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",To({provider:t,idToken:n})),o=Io(r.data);if(!o){ee(e,r.errors);return}if(o.status==="complete"&&o.ticket){await ce(e,o.attemptId,o.ticket),await V(e,o.attemptId);return}let i=r.data,s=nt({id:o.attemptId,status:o.status,...typeof(i==null?void 0:i.policy_acceptance_token)=="string"?{policyToken:i.policy_acceptance_token}:{}});e.state=o.status==="needs_policy_acceptance"&&s.attempt&&Array.isArray(i==null?void 0:i.pending_policies)?{...s,attempt:{...s.attempt,pending_policies:i.pending_policies}}:s,P(e)}function ss(e){e.resetFlow={...Ne},P(e)}async function Qn(e,t){var r,o,i;if(e.busy||!e.resetFlow)return;if(e.busy=!0,Ve(e),P(e),Se(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let s=await qe(e,"passwordReset");e.resetFlow=await jo(e.client,(r=t.email)!=null?r:"",s!=null?s:void 0),(o=e.resetFlow.attempt)!=null&&o.poll_secret&&fc(e)}else e.resetFlow=await Wo(e.client,e.resetFlow,{code:t.code,password:t.password});e.busy=!1;let n=e.resetFlow;if(((i=n==null?void 0:n.attempt)==null?void 0:i.status)==="complete"){let s=n.attempt.id;e.resetFlow=null,n.ticket?(await ce(e,s,n.ticket),await V(e,s)):(e.flash="Password updated. Sign in with your new password.",e.state=B,P(e));return}P(e)}function fc(e){var n,r;e.linkPoll&&clearInterval(e.linkPoll);let t=(r=(n=e.resetFlow)==null?void 0:n.attempt)==null?void 0:r.id;e.linkPoll=setInterval(()=>{(async()=>{var s;let o=e.resetFlow;if(!(o!=null&&o.attempt)||o.attempt.id!==t||o.attempt.status!=="needs_email_verification"){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let i=await Ko(e.client,o);e.resetFlow!==o||((s=i.attempt)==null?void 0:s.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=i,P(e))})()},2e3)}async function er(e,t,n=!0){var d;if(e.busy)return;e.busy=!0,Ve(e),P(e);let{identifier:r,password:o,...i}=t,s={};for(let[c,u]of Object.entries(i))u&&(s[c]=u);let l=await qe(e,"signUp");e.state=await mn(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:s,consent:n,captchaToken:l!=null?l:void 0,policyAcceptances:e.policies.build()}),e.busy=!1,await as(e);let a=e.state.attempt;if((a==null?void 0:a.status)==="complete"){let c=(d=a.id)!=null?d:null;e.state.ticket&&c&&await ce(e,c,e.state.ticket),await V(e,c);return}hn(e.state)&&os(e),P(e)}var gc={"mfa.enrollChoose":"Set up a second step for signing in.","mfa.enrollTotpOption":"Use an authenticator app","mfa.enrollSmsOption":"Use text messages","mfa.enrollScan":"Scan this QR code with your authenticator app, or enter the setup key.","mfa.enrollQrAlt":"QR code for your authenticator app","mfa.enrollSetupKey":"Setup key","mfa.enrollPreparing":"Setting up\u2026","mfa.enrollFirstCodeLabel":"Code from your authenticator app","mfa.enrollSecondCodeLabel":"The next code it shows","mfa.phoneLabel":"Mobile number","mfa.phoneHint":"Include the country code, for example +14155550101.","mfa.sendCode":"Text me a code","mfa.codeTextedTo":"Enter the code we texted to {phone}.","mfa.codeLabel":"Code","mfa.smsCodeOption":"Text me a code instead","mfa.recoveryCodesTitle":"Save your recovery codes","mfa.recoveryCodesHelp":"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.","mfa.recoveryCodesCopy":"Copy codes","mfa.recoveryCodesCopied":"Copied.","mfa.recoveryCodesDownload":"Download as .txt","mfa.recoveryCodesSaved":"I've saved my codes","signIn.emailCodeOption":"Email me a code instead","signIn.codeSentTo":"We sent a code to {email}. Enter it below.","signIn.resendCode":"Resend code","signIn.sending":"Sending\u2026"};function F(e,t,n={}){var s;let r=e.options.localization,o=typeof r=="function"?r(t):r&&typeof r=="object"?r[t]:void 0;return(typeof o=="string"&&o.trim()?o:(s=gc[t])!=null?s:t).replace(/\{(\w+)\}/g,(l,a)=>{var d;return(d=n[a])!=null?d:l})}function ls(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=jr(e.client,()=>qt(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>P(e)))),e.enrollment.start(t),e.enrollment):null}function cs(e,t,n,r){var a;let o=ls(e);if(!o)return r;let i=o.state,s=(d,c)=>{let u=h(e,"button","atlas-embed-step-back",F(e,d==="totp"?"mfa.enrollTotpOption":"mfa.enrollSmsOption"));u.type="button",u.setAttribute("data-atlas-mfa-method",d),u.disabled=e.busy||i.busy,u.addEventListener("click",()=>void o.choose(d)),Array.isArray(c)?c.push(u):c.appendChild(u)};if(i.method===null){t.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.enrollChoose")));for(let d of i.options)s(d,t)}else if(i.method==="totp"){let d=i.enrollment;if(d){if(t.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.enrollScan"))),d.qrCode){let c=I(e).createElement("img");c.className="atlas-embed-mfa-qr",c.setAttribute("data-atlas","mfa-qr"),c.src=d.qrCode,c.alt=F(e,"mfa.enrollQrAlt"),c.width=180,c.height=180,t.appendChild(c)}if(d.secret){let c=h(e,"p","atlas-embed-note",`${F(e,"mfa.enrollSetupKey")}: `);c.setAttribute("data-atlas","mfa-setup-key"),c.appendChild(h(e,"code","atlas-embed-mfa-key",Hr(d.secret))),t.appendChild(c)}n.addCodeField("code",F(e,"mfa.enrollFirstCodeLabel"),!0),i.totpCodes>=2&&n.addCodeField("secondCode",F(e,"mfa.enrollSecondCodeLabel"),!1)}else{let c=h(e,"p","atlas-embed-note",i.busy?F(e,"mfa.enrollPreparing"):"");c.setAttribute("aria-live","polite"),t.appendChild(c)}}else if(!i.enrollment)n.addField("phone",F(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.phoneHint")));else{let d=h(e,"p","atlas-embed-note",F(e,"mfa.codeTextedTo",{phone:(a=i.enrollment.phone)!=null?a:""}));d.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(d),n.addCodeField("code",F(e,"mfa.codeLabel"),!0);let c=h(e,"button","atlas-embed-step-back",F(e,"signIn.resendCode"));c.type="button",c.setAttribute("data-atlas-resend",""),c.disabled=e.busy||i.busy,c.addEventListener("click",()=>void o.resend()),n.trailing.push(c)}for(let d of i.errors){let c=h(e,"p","atlas-embed-error",e.errorText(d));c.setAttribute("role","alert"),t.appendChild(c)}if(i.method!==null&&i.options.length>1)for(let d of i.options.filter(c=>c!==i.method))s(d,n.trailing);let l=Wr(i);return l===null?null:l==="mfa.sendCode"?F(e,"mfa.sendCode"):r}async function ds(e,t){let n=ls(e);if(!n)return;let r=await n.submit(t);r&&await he(e,r)}function us(e,t){var s;let n=(s=e.state.attempt)==null?void 0:s.id;if(!n)return;let r=qt(e.account),o=e.secondFactorCode&&e.secondFactorCode.attemptId===n?e.secondFactorCode:null,i=[];r.sms&&i.push("sms"),r.emailCode&&i.push("email_code");for(let l of i){let a=l==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===l&&o.sentTo!==void 0){let u=h(e,"p","atlas-embed-note",l==="sms"?F(e,"mfa.codeTextedTo",{phone:o.sentTo}):F(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${a}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let d=(o==null?void 0:o.strategy)===l&&o.busy===!0,c=h(e,"button","atlas-embed-step-back",d?F(e,"signIn.sending"):F(e,l==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(c.type="button",c.setAttribute("data-atlas",a),c.disabled=e.busy||d,c.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:l,busy:!0},P(e),Kr(e.client,n,l).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:l,sentTo:u},P(e)},u=>{e.secondFactorCode={attemptId:n,strategy:l,error:u instanceof Error?u.message:String(u)},P(e)})}),t.push(c),(o==null?void 0:o.strategy)===l&&o.error){let u=h(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function ps(e,t){var s,l;let n=h(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(h(e,"h2",R(e,"title","atlas-embed-title"),F(e,"mfa.recoveryCodesTitle"))),n.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.recoveryCodesHelp")));let r=h(e,"ul","atlas-embed-recovery-list");r.setAttribute("data-atlas","recovery-codes-list"),r.setAttribute("style","list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center");for(let a of t){let d=h(e,"li");d.appendChild(h(e,"code","atlas-embed-mfa-key",a)),r.appendChild(d)}n.appendChild(r);let o=((s=I(e).defaultView)!=null?s:globalThis).navigator;if((l=o==null?void 0:o.clipboard)!=null&&l.writeText){let a=h(e,"button","atlas-embed-step-back",F(e,"mfa.recoveryCodesCopy"));a.type="button",a.setAttribute("data-atlas","recovery-codes-copy"),a.addEventListener("click",()=>{Gr(t).then(d=>{if(!d||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let c=h(e,"p","atlas-embed-note",F(e,"mfa.recoveryCodesCopied"));c.setAttribute("data-atlas","recovery-codes-copied"),c.setAttribute("aria-live","polite"),n.insertBefore(c,i)})}),n.appendChild(a)}if(Vt()){let a=h(e,"button","atlas-embed-step-back",F(e,"mfa.recoveryCodesDownload"));a.type="button",a.setAttribute("data-atlas","recovery-codes-download"),a.addEventListener("click",()=>Yr(t)),n.appendChild(a)}let i=h(e,"button",R(e,"buttonPrimary","atlas-embed-button"),F(e,"mfa.recoveryCodesSaved"));return i.type="button",i.setAttribute("data-atlas","recovery-codes-saved"),i.disabled=e.busy,i.addEventListener("click",()=>{i.disabled=!0,ns(e)}),n.appendChild(i),n}function Dt(e){return bo((t,n)=>F(e,t,n!=null?n:{}))}async function fs(e){e.mode==="sign-up"&&(vn(I(e)),e.policies.setPolicies(await Fe(e.client)))}function tr(e){return{link:"atlas-embed-consent-link",text:"atlas-embed-consent-text"}}function gs(e){for(let t of e.policyDispose.splice(0))t()}function ms(e,t){let n=e.policies;if(n.policies.length===0)return null;let r=Dt(e),o=I(e),i=h(e,"div"),s=h(e,"p");return e.policyDispose.push(_n(i,n,{t:r,document:o,classes:tr(e)}).destroy),e.policyDispose.push(xn(s,n,{t:r,document:o,classes:tr(e)}).destroy),e.policyDispose.push(n.subscribe(t)),{consent:i,clickwrap:s,canSubmit:()=>n.canSubmit(),async read(){return n.pendingScroll()?wn(n,{t:r,document:o,container:e.root}):!0}}}async function as(e){pn(e.state.errors)&&e.policies.setPolicies(await Fe(e.client))}function hs(e){var a;let t=Dt(e),n=I(e),r=h(e,"div","atlas-embed-policies");vn(n);let o=e.state.attempt,i=(a=o==null?void 0:o.id)!=null?a:null;(!e.pendingPolicies||e.pendingPolicies.attemptId!==i)&&(e.pendingPolicies={attemptId:i,controller:null},ko(e.client,o,{}).then(d=>{var c;((c=e.pendingPolicies)==null?void 0:c.attemptId)===i&&(e.pendingPolicies={attemptId:i,controller:d},P(e))}));let s=e.pendingPolicies.attemptId===i?e.pendingPolicies.controller:null;if(!s)return r.appendChild(h(e,"p","atlas-embed-note",t("policy.loading"))),r;let l=Eo(r,s,{t,document:n,container:e.root,classes:tr(e),onSubmit:d=>{e.pendingPolicies=null,he(e,{policy_acceptances:JSON.stringify(d)})},onDecline:d=>{e.pendingPolicies=null,e.state={attempt:null,errors:[{code:"POLICY_DECLINED",message:t("policy.declined",{policy:d.title})}],busy:!1,pollSecret:null,ticket:null},P(e)}});return l.setBusy(e.busy),e.policyDispose.push(l.destroy),r}function ys(e){var p;let t=e.resetFlow,n=Se(t),r=h(e,"div","atlas-embed-reset");r.appendChild(h(e,"h1",R(e,"title","atlas-embed-title"),"Reset your password"));let o=I(e).createElement("form"),i=t.errors,s=new Map,l=i.find(g=>!g.param);l&&o.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(l)));let a=null,d="Continue",c=!0,u=e.account.passwordReset;switch(n){case"request":a=u==="link"?"Enter your email and we\u2019ll send you a reset link.":u==="both"?"Enter your email and we\u2019ll send you a reset link and code.":"Enter your email and we\u2019ll send you a reset code.",d=u==="link"?"Send reset link":"Send reset code",Ft(e,o,s,i,"email","Email address","email","username");{let g=s.get("email");g&&(e.enteredIdentifier&&(g.value=e.enteredIdentifier),g.setAttribute("data-atlas-autofocus",""))}break;case"collect_email_code":if(u==="link"){c=!1,a="Check your email";let g=h(e,"p","atlas-embed-note",e.enteredIdentifier?`We sent a reset link to ${e.enteredIdentifier}. Open it on any device; this page continues on its own.`:"We sent you a reset link. Open it on any device; this page continues on its own.");g.setAttribute("data-atlas-link-sent",""),o.appendChild(g);let y=h(e,"button","atlas-embed-step-back","Send another link");y.type="button",y.setAttribute("data-atlas-resend",""),y.disabled=e.busy,y.addEventListener("click",()=>{var m;e.resetFlow={...Ne},Qn(e,{email:(m=e.enteredIdentifier)!=null?m:""})}),o.appendChild(y);break}a=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",nr(e,o,s,i,"code","Reset code",!0);break;case"collect_second_factor":a="Enter the code from your authenticator app",nr(e,o,s,i,"code","Two-factor code",!0);break;case"collect_new_password":a="Choose a new password",d="Set new password",Ft(e,o,s,i,"password","New password","password","new-password"),(p=s.get("password"))==null||p.setAttribute("data-atlas-autofocus","");break;default:c=!1,o.appendChild(h(e,"p","atlas-embed-note","You\u2019re all set."))}a&&r.appendChild(h(e,"p",R(e,"subtitle","atlas-embed-subtitle"),a)),r.appendChild(o),c&&o.appendChild(Ee(e,d));let f=h(e,"button","atlas-embed-step-back","Back to sign in");return f.type="button",f.addEventListener("click",()=>{e.resetFlow=null,P(e)}),o.appendChild(f),o.addEventListener("submit",g=>{g.preventDefault();let y={};for(let[m,S]of s)y[m]=S.value;Qn(e,y)}),r}function Ft(e,t,n,r,o,i,s,l){let a=h(e,"label",R(e,"field","atlas-embed-field"));a.appendChild(h(e,"span",R(e,"label","atlas-embed-label"),i));let d=I(e).createElement("input");if(d.className=R(e,"input","atlas-embed-input"),d.type=s,d.name=o,d.setAttribute("autocomplete",l),s==="password"){let c=h(e,"div","atlas-embed-password");c.appendChild(d);let u=h(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",f=>{f.preventDefault();let p=d.type==="password";d.type=p?"text":"password",u.textContent=p?"Hide":"Show",u.setAttribute("aria-label",p?"Hide password":"Show password")}),c.appendChild(u),a.appendChild(c)}else a.appendChild(d);for(let c of r.filter(u=>u.param===o))a.appendChild(h(e,"span",R(e,"error","atlas-embed-error"),e.errorText(c)));n.set(o,d),t.appendChild(a)}function nr(e,t,n,r,o,i,s){var g;if(e.codeInputStyle==="single"){Ft(e,t,n,r,o,i,"text","one-time-code"),s&&((g=n.get(o))==null||g.setAttribute("data-atlas-autofocus",""));return}let a=h(e,"div",R(e,"field","atlas-embed-field"));a.appendChild(h(e,"span",R(e,"label","atlas-embed-label"),i));let d=h(e,"div","atlas-embed-code");d.setAttribute("role","group"),d.setAttribute("aria-label",i);let c=I(e).createElement("input");c.type="hidden",c.name=o,n.set(o,c);let u=[],f=()=>{c.value=u.map(y=>y.value).join("")},p=()=>{c.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let y=0;y<6;y++){let m=I(e).createElement("input");m.className="atlas-embed-code-box",m.type="text",m.setAttribute("inputmode","numeric"),m.setAttribute("autocomplete",y===0?"one-time-code":"off"),m.setAttribute("aria-label",`${i} digit ${y+1}`),m.maxLength=1,s&&y===0&&m.setAttribute("data-atlas-autofocus",""),m.addEventListener("input",()=>{m.value=m.value.replace(/\D/g,"").slice(0,1),f(),m.value&&y<5&&u[y+1].focus(),p()}),m.addEventListener("keydown",S=>{S.key==="Backspace"&&!m.value&&y>0&&u[y-1].focus()}),m.addEventListener("paste",S=>{var A,x,b;S.preventDefault();let E=((x=(A=S.clipboardData)==null?void 0:A.getData("text"))!=null?x:"").replace(/\D/g,"").slice(0,6);for(let _=0;_<6;_++)u[_].value=(b=E[_])!=null?b:"";f(),u[Math.min(E.length,5)].focus(),p()}),u.push(m),d.appendChild(m)}a.appendChild(d),a.appendChild(c);for(let y of r.filter(m=>m.param===o))a.appendChild(h(e,"span",R(e,"error","atlas-embed-error"),e.errorText(y)));t.appendChild(a)}function bs(e,t){var f,p,g,y,m,S,E,A,x;let n=I(e).createElement("form"),r=e.state.errors.find(b=>!b.param);r&&n.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(r)));let o=new Map,i=e.state.errors,s=(b,_,C,w)=>Ft(e,n,o,i,b,_,C,w),l=(b,_,C)=>nr(e,n,o,i,b,_,C),a=!0,d=me[e.mode].submit,c=[];switch(t){case"collect_identifier":if(s("identifier","Email address","email",e.passkeyEnabled&&xe()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){s("password","Password","password","current-password");let b=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?b.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&b.push("email_link");for(let _ of b){let C=h(e,"button","atlas-embed-step-back",_==="email_code"?"Email me a code instead":"Email me a sign-in link instead");C.type="button",C.setAttribute("data-strategy",_),C.disabled=e.busy,C.addEventListener("click",()=>{var T;let w=o.get("identifier");if(!w.value.trim()){(T=w.reportValidity)==null||T.call(w),w.focus();return}he(e,{identifier:w.value},_)}),c.push(C)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let b=h(e,"label","atlas-embed-remember"),_=I(e).createElement("input");_.type="checkbox",_.className="atlas-embed-remember-check",_.checked=e.remember,_.addEventListener("change",()=>{e.remember=_.checked}),b.appendChild(_),b.appendChild(h(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(b)}break;case"collect_first_factor":{let b=e.state.attempt?(f=z(e.state.attempt).strategies)!=null?f:[]:[],_=Ge(e.emailDeliveryAvailable?b:b.filter(L=>L!=="email_code"&&L!=="email_link")),C=(p=e.state.prepared)!=null?p:null,w=(m=(y=e.enteredIdentifier)!=null?y:(g=e.state.attempt)==null?void 0:g.identifier)!=null?m:"",T=(L,te,H)=>{let K=h(e,"button","atlas-embed-step-back",te);return K.type="button",K.setAttribute(H,H==="data-strategy"?L:""),K.disabled=e.busy,K.addEventListener("click",()=>void Ot(e,L)),K};if(C==="email_code"){let L=h(e,"p","atlas-embed-note",w?`We sent a code to ${w}. Enter it below.`:"We sent you a code. Enter it below.");L.setAttribute("data-atlas-code-sent",""),n.appendChild(L),l("code","Verification code",!0),c.push(T("email_code","Resend code","data-atlas-resend"))}else if(C==="email_link"){a=!1;let L=h(e,"p","atlas-embed-note",w?`We sent a sign-in link to ${w}. Open it on any device to continue.`:"Check your email for a sign-in link.");L.setAttribute("data-atlas-link-sent",""),n.appendChild(L),c.push(T("email_link","Resend link","data-atlas-resend"))}else if(!_.password&&_.email.length>0){a=!1;for(let L of _.email)c.push(T(L,L==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{s("password","Password","password","current-password");for(let L of _.email)c.push(T(L,L==="email_code"?"Email me a code instead":"Email me a sign-in link instead","data-strategy"))}break}case"collect_second_factor":if(e.backupCodeMode?s("code","Backup code","text","one-time-code"):l("code","Two-factor code",!0),e.trustedDeviceEnabled){let b=h(e,"label","atlas-embed-remember"),_=I(e).createElement("input");_.type="checkbox",_.className="atlas-embed-remember-check",_.checked=e.rememberDevice,_.addEventListener("change",()=>{e.rememberDevice=_.checked}),b.appendChild(_),b.appendChild(h(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(b)}us(e,c);break;case"collect_email_code":{let b=rt(e.state.attempt,e.account.emailVerification);if(b){a=!1;let _=(A=(E=e.enteredIdentifier)!=null?E:(S=e.state.attempt)==null?void 0:S.identifier)!=null?A:"",C=h(e,"p","atlas-embed-note",_?`We sent a confirmation link to ${_}. Open it on any device; this page continues on its own.`:"We sent you a confirmation link. Open it on any device; this page continues on its own.");C.setAttribute("data-atlas-link-sent",""),n.appendChild(C)}else l("code","Verification code",!0);if(((x=e.state.attempt)==null?void 0:x.object)==="sign_up_attempt"){let _=h(e,"button","atlas-embed-step-back",b?"Resend link":"Resend code");_.type="button",_.setAttribute("data-atlas-resend",""),_.disabled=e.busy,_.addEventListener("click",()=>void rs(e)),c.push(_)}break}case"collect_new_password":s("password","New password","password","new-password");break;case"enroll_second_factor":{let b=cs(e,n,{addField:s,addCodeField:l,trailing:c},d);b===null?a=!1:d=b;break}default:a=!1,n.appendChild(h(e,"p","atlas-embed-note","Please continue in your application."))}a&&n.appendChild(Ee(e,d));for(let b of c)n.appendChild(b);if(t==="collect_second_factor"){let b=h(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");b.type="button",b.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,P(e)}),n.appendChild(b)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let b=h(e,"button","atlas-embed-step-back","Forgot password?");b.type="button",b.addEventListener("click",()=>ss(e)),n.appendChild(b)}return n.addEventListener("submit",b=>{b.preventDefault();let _={};for(let[C,w]of o)_[C]=w.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(_.remember_device="true"),t==="enroll_second_factor"){ds(e,_);return}he(e,_)}),n}function mc(e){var a;let t=(a=e.appearance)==null?void 0:a.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=I(e),r=h(e,"div","atlas-embed-consent"),o=null;t.required&&(o=n.createElement("input"),o.type="checkbox",o.className="atlas-embed-consent-check",o.setAttribute("aria-label","Agree to the terms and privacy policy"),r.appendChild(o));let i=h(e,"span","atlas-embed-consent-text"),s=(d,c)=>{let u=n.createElement("a");return u.href=d,u.textContent=c,u.target="_blank",u.rel="noopener noreferrer",u.className="atlas-embed-consent-link",u};i.appendChild(n.createTextNode(t.required?"I agree to the ":"By continuing you agree to the "));let l=[];return t.termsUrl&&l.push(s(t.termsUrl,"Terms of Service")),t.privacyUrl&&l.push(s(t.privacyUrl,"Privacy Policy")),l.forEach((d,c)=>{c>0&&i.appendChild(n.createTextNode(" and ")),i.appendChild(d)}),i.appendChild(n.createTextNode(".")),r.appendChild(i),{row:r,checkbox:o}}function ks(e){var d;let t=I(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(h(e,"div","atlas-embed-form-error",Vo)),t;let n=e.state.errors.find(c=>!c.param);n&&t.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(c,u,f)=>{var S,E,A;let p=(S=f.type)!=null?S:"text",g=p==="radio"||p==="multiselect",y=h(e,g?"fieldset":"label",R(e,"field","atlas-embed-field"));y.appendChild(h(e,g?"legend":"span",R(e,"label","atlas-embed-label"),f.required?u:`${u} (optional)`));let m=I(e);if(p==="select"){let x=m.createElement("select");x.className=R(e,"input","atlas-embed-input"),x.name=c;let b=m.createElement("option");b.value="",b.textContent=f.placeholder||"Select\u2026",x.appendChild(b);for(let _ of(E=f.options)!=null?E:[]){let C=m.createElement("option");C.value=_,C.textContent=_,x.appendChild(C)}y.appendChild(x),r.set(c,()=>x.value)}else if(p==="textarea"){let x=m.createElement("textarea");x.className=R(e,"input","atlas-embed-input"),x.name=c,x.rows=3,f.placeholder&&x.setAttribute("placeholder",f.placeholder),y.appendChild(x),r.set(c,()=>x.value)}else if(p==="checkbox"){let x=m.createElement("input");x.type="checkbox",x.name=c,x.className="atlas-embed-checkbox",y.classList.add("atlas-embed-field-checkbox"),y.appendChild(x),r.set(c,()=>x.checked?"true":"")}else if(p==="radio"||p==="multiselect"){let x=m.createElement("div");x.className="atlas-embed-choices";let b=[];for(let _ of(A=f.options)!=null?A:[]){let C=m.createElement("label");C.className="atlas-embed-choice";let w=m.createElement("input");w.type=p==="radio"?"radio":"checkbox",w.name=c,w.value=_,b.push(w),C.appendChild(w),C.appendChild(h(e,"span",void 0,_)),x.appendChild(C)}y.appendChild(x),r.set(c,()=>{var _,C;return p==="radio"?(C=(_=b.find(w=>w.checked))==null?void 0:_.value)!=null?C:"":b.filter(w=>w.checked).map(w=>w.value).join(", ")})}else{let x=m.createElement("input");x.className=R(e,"input","atlas-embed-input"),x.type=p,x.name=c,f.autocomplete&&x.setAttribute("autocomplete",f.autocomplete),f.placeholder&&x.setAttribute("placeholder",f.placeholder),y.appendChild(x),r.set(c,()=>x.value)}for(let x of e.state.errors.filter(b=>b.param===c))y.appendChild(h(e,"span",R(e,"error","atlas-embed-error"),e.errorText(x)));t.appendChild(y)};for(let c of e.signUpFields)o(c.key,c.label,{type:c.type,required:c.required,placeholder:c.placeholder,options:c.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let i,s=ms(e,()=>{i&&(i.disabled=e.busy||!(s!=null&&s.canSubmit()))}),l=s?null:mc(e);l&&t.appendChild(l.row),s&&t.appendChild(s.consent),i=Ee(e,me[e.mode].submit);let a=()=>s?s.canSubmit():!(l!=null&&l.checkbox)||l.checkbox.checked;return i.disabled=e.busy||!a(),(d=l==null?void 0:l.checkbox)==null||d.addEventListener("change",()=>{i.disabled=e.busy||!a()}),t.appendChild(i),s&&t.appendChild(s.clickwrap),t.addEventListener("submit",c=>{c.preventDefault();let u={};for(let[f,p]of r)u[f]=p();if(!s){er(e,u,a());return}s.read().then(f=>{var g,y;if(f){er(e,u,!0);return}let p=(y=(g=e.policies.policies.find(m=>!e.policies.isChecked(m.key)))==null?void 0:g.title)!=null?y:"";e.state={...e.state,errors:[{code:"POLICY_DECLINED",message:Dt(e)("policy.declined",{policy:p})}]},P(e)})}),t}var hc={google:'<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/>',microsoft:'<path fill="#F25022" d="M2 2h9.3v9.3H2z"/><path fill="#7FBA00" d="M12.7 2H22v9.3h-9.3z"/><path fill="#00A4EF" d="M2 12.7h9.3V22H2z"/><path fill="#FFB900" d="M12.7 12.7H22V22h-9.3z"/>'},yc={github:{fill:"currentColor",path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},apple:{fill:"currentColor",path:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"},x:{fill:"currentColor",path:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"},notion:{fill:"currentColor",path:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},facebook:{fill:"#0866FF",path:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},discord:{fill:"#5865F2",path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},gitlab:{fill:"#FC6D26",path:"m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"},spotify:{fill:"#1ED760",path:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"},twitch:{fill:"#9146FF",path:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"},reddit:{fill:"#FF4500",path:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},figma:{fill:"#F24E1E",path:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},dropbox:{fill:"#0061FF",path:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},gitee:{fill:"#C71D23",path:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"}};function vs(e){let t=hc[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=yc[e];return n?`<svg viewBox="0 0 24 24" width="18" height="18" fill="${n.fill}" aria-hidden="true" focusable="false"><path d="${n.path}"/></svg>`:null}function _s(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},P(e),!0)}function xs(e){let t=e.options.passkeyPrf;return t?{prf:t,onExtensionResults:n=>{var s,l,a,d,c;let r={credentialId:n.credentialId,enabled:!!((s=n.prf)!=null&&s.results)||((l=n.prf)==null?void 0:l.enabled)===!0,...(a=n.prf)!=null&&a.results?{results:n.prf.results}:{}},o=(d=e.root.ownerDocument)==null?void 0:d.defaultView,i=(c=o==null?void 0:o.CustomEvent)!=null?c:CustomEvent;e.root.dispatchEvent(new i("atlas:passkey-prf",{detail:r,bubbles:!1}))}}:{}}async function ws(e){var o,i,s;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,P(e);let t=await Rn(e.client,{captcha:({retry:l})=>qe(e,"signIn",l)});if(!t.ok||!t.data){e.busy=!1,ee(e,t.errors);return}let n;try{n=await Sn(t.data,xs(e))}catch{e.busy=!1,P(e);return}let r=await e.client.post("/v1/client/sign_ins/passkey/finish",n);if(e.busy=!1,r.ok&&((i=r.data)==null?void 0:i.status)==="complete"){await V(e,(s=r.data.created_session_id)!=null?s:null);return}r.ok&&_s(e,r.data)||ee(e,r.errors)}async function Ss(e){var r,o,i;if(e.mode!=="sign-in"||!e.passkeyEnabled||!xe())return;let t=!1;try{t=await Uo()}catch{t=!1}if(!t||we(e.captchaFlows.signIn))return;(r=e.conditionalAbort)==null||r.abort();let n=new AbortController;e.conditionalAbort=n;try{let s=await Rn(e.client);if(!s.ok||!s.data||n.signal.aborted)return;let l=await Sn(s.data,{mediation:"conditional",signal:n.signal,...xs(e)});if(n.signal.aborted)return;let a=await e.client.post("/v1/client/sign_ins/passkey/finish",l);a.ok&&((o=a.data)==null?void 0:o.status)==="complete"?await V(e,(i=a.data.created_session_id)!=null?i:null):a.ok&&_s(e,a.data)}catch{}}function Cs(e){let t=h(e,"button",R(e,"socialButton","atlas-embed-social-button"),"Sign in with a passkey");return t.type="button",t.setAttribute("data-atlas-passkey",""),t.disabled=e.busy,t.addEventListener("click",()=>{ws(e)}),t}function rr(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var bc='<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" fill="none"><path d="M12 2 3 21h4l5-11 5 11h4L12 2z" fill="currentColor"/></svg>';function kc(e,t){var l;let{variant:n,labels:r}=e.social,o=(l=r.atlas)!=null?l:n==="block"?"Continue with Atlas":"Atlas",i=h(e,"button",R(e,"socialButton","atlas-embed-social-button"));i.type="button",i.setAttribute("data-atlas-provider","atlas"),i.setAttribute("data-variant",n);let s=I(e).createElement("span");if(s.className="atlas-embed-social-icon",s.innerHTML=bc,i.appendChild(s),n==="icon")i.setAttribute("aria-label","Continue with Atlas"),i.setAttribute("title","Atlas");else{let a=I(e).createElement("span");a.className="atlas-embed-social-label",a.textContent=o,i.appendChild(a)}return i.addEventListener("click",()=>{Xn(e,t,{popup:!0})}),i}function As(e){let t=rr(e),n=h(e,"div","atlas-embed-social");n.setAttribute("data-layout",e.social.layout),n.setAttribute("data-size",e.social.size),n.setAttribute("data-variant",e.social.variant),e.signInWithAtlas.enabled&&e.signInWithAtlas.connection_id&&n.appendChild(kc(e,e.signInWithAtlas.connection_id));for(let d of t){let c=e.nativeProviders.find(f=>f.provider===d),u=d==="google"&&(c!=null&&c.client_id)?xc(e,c.client_id):_c(e,d);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",d),n.appendChild(u)}let r=e.social.layout==="carousel"?vc(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>Di))return r;let i=h(e,"div","atlas-embed-social-field"),s=I(e).createElement("input");s.type="search",s.className="atlas-embed-social-search",s.setAttribute("placeholder","Search sign-in options\u2026"),s.setAttribute("aria-label","Search sign-in options"),s.autocomplete="off";let l=h(e,"div","atlas-embed-social-empty");l.textContent="No matching sign-in options.",l.setAttribute("hidden","");let a=Array.from(n.children);return s.addEventListener("input",()=>{var u;let d=s.value.trim().toLowerCase(),c=0;for(let f of a){let p=(u=f.getAttribute("data-atlas-provider"))!=null?u:"",g=d===""||It(p).toLowerCase().includes(d)||p.toLowerCase().includes(d);f.toggleAttribute("hidden",!g),g&&(c+=1)}l.toggleAttribute("hidden",c!==0),n.dispatchEvent(new Event("scroll"))}),i.appendChild(s),i.appendChild(r),i.appendChild(l),i}function vc(e,t){var d;let n=(d=I(e).defaultView)!=null?d:typeof window!="undefined"?window:null,r=h(e,"div","atlas-embed-carousel"),o=c=>{let u=h(e,"button","atlas-embed-carousel-nav");return u.type="button",u.setAttribute("data-dir",c),u.setAttribute("aria-label",c==="prev"?"Scroll to previous sign-in options":"Scroll to more sign-in options"),u.innerHTML=c==="prev"?Ji:Zi,u.addEventListener("click",()=>{let f=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(c==="prev"?-1:1)*f,behavior:"smooth"})}),u},i=o("prev"),s=o("next"),l=()=>{let c=t.scrollWidth-t.clientWidth,u=c>2;r.setAttribute("data-overflow",u?"true":"false"),i.disabled=!u||t.scrollLeft<=1,s.disabled=!u||t.scrollLeft>=c-1};t.addEventListener("scroll",l,{passive:!0});let a=n&&n.ResizeObserver;return a?new a(l).observe(t):n&&n.addEventListener("resize",l),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(l),l(),r.appendChild(i),r.appendChild(t),r.appendChild(s),r}function Es(e,t,n="button"){var d;let{variant:r,labels:o}=e.social,i=It(t),s=(d=o[t])!=null?d:r==="block"?`Continue with ${i}`:i,l=h(e,n,R(e,"socialButton","atlas-embed-social-button"));n==="button"&&(l.type="button"),l.setAttribute("data-atlas-provider",t),l.setAttribute("data-variant",r);let a=vs(t);if(a){let c=I(e).createElement("span");c.className="atlas-embed-social-icon",c.innerHTML=a,l.appendChild(c)}if(r==="icon")l.setAttribute("aria-label",`Continue with ${i}`),l.setAttribute("title",i);else{let c=I(e).createElement("span");c.className="atlas-embed-social-label",c.textContent=s,l.appendChild(c)}return l}function _c(e,t){let n=Es(e,t);return n.addEventListener("click",()=>{Yi.has(t)?(e.handlePrompt=t,P(e)):Lt(e,t)}),n}function Ps(e,t){let n=It(t),r=I(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let a of e.state.errors.filter(d=>!d.param))r.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(a)));let o=h(e,"label",R(e,"field","atlas-embed-field"));o.appendChild(h(e,"span",R(e,"label","atlas-embed-label"),`${n} handle`));let i=I(e).createElement("input");i.className=R(e,"input","atlas-embed-input"),i.type="text",i.name="identifier",i.placeholder="you.bsky.social",i.setAttribute("autocomplete","username"),i.setAttribute("autocapitalize","none"),i.setAttribute("spellcheck","false"),o.appendChild(i),r.appendChild(o);let s=Ee(e,me[e.mode].submit);r.appendChild(s);let l=h(e,"button","atlas-embed-handle-back","Back");return l.type="button",l.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},P(e)}),r.appendChild(l),r.addEventListener("submit",a=>{a.preventDefault();let d=i.value.trim();if(!d){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},P(e);return}Lt(e,t,d)}),r}function xc(e,t){let n=Es(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),Oo({wrapper:n,clientId:t,onCredential:r=>void is(e,"google",r),onError:()=>Pe(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void Lt(e,"google"))}),n}function Pe(e,t){e.root.textContent="";let n=h(e,"div",R(e,"card","atlas-embed-card"));n.appendChild(h(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function Rs(e){e.root.textContent="";let t=h(e,"div",R(e,"card","atlas-embed-card")),n=e.interaction.loading,r=h(e,"div","atlas-embed-loading");if(r.setAttribute("data-loading",n),r.setAttribute("role","status"),r.setAttribute("aria-label","Loading"),n==="skeleton")for(let i of["title","sub","input","input","button"])r.appendChild(h(e,"div",`atlas-embed-skel atlas-embed-skel-${i}`));else if(n==="dots")for(let i=0;i<3;i+=1)r.appendChild(h(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(h(e,"span","atlas-embed-loadbar")):r.appendChild(h(e,"span","atlas-embed-spinner"));let o=h(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function ee(e,t){e.state={...e.state,errors:[...t]},P(e)}function P(e){var u,f,p,g,y,m,S,E,A,x;gs(e);let t=Array.from(e.root.children).filter(b=>b.hasAttribute("data-atlas-policy-modal"));e.root.textContent="";for(let b of t)e.root.appendChild(b);let n=h(e,"div",R(e,"card","atlas-embed-card")),r=(f=(u=e.appearance)==null?void 0:u.logoUrl)!=null?f:null;if(r){let b=I(e).createElement("img");b.className="atlas-embed-logo",b.src=r,b.alt=(g=(p=e.appearance)==null?void 0:p.applicationName)!=null?g:"",n.appendChild(b)}if(e.resetFlow){let b=`reset_${Se(e.resetFlow)}`;if(n.setAttribute("data-step",b),b!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=b,n.appendChild(ys(e)),(y=e.appearance)!=null&&y.footer&&n.appendChild(h(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let _=n.querySelector("[data-atlas-autofocus]");_ instanceof HTMLElement&&_.focus()}return}let o=Te(e.state);if(o){n.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&n.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",n.appendChild(ps(e,o)),e.root.appendChild(n);return}let i=e.state.attempt?z(e.state.attempt):{kind:"collect_identifier"},s=e.mode==="sign-up"&&!e.state.attempt,l=s||i.kind==="collect_identifier",a=e.handlePrompt?"handle":i.kind;n.setAttribute("data-step",a),a!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=a;let d=(S=(m=e.appearance)==null?void 0:m.headline)!=null?S:me[e.mode].title;n.appendChild(h(e,"h1",R(e,"title","atlas-embed-title"),d));let c=l?null:wc(e,i.kind);if(c?n.appendChild(c):(E=e.appearance)!=null&&E.subheadline&&n.appendChild(h(e,"p",R(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&n.appendChild(h(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){n.appendChild(Ps(e,e.handlePrompt)),(A=e.appearance)!=null&&A.footer&&n.appendChild(h(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n);return}if(l&&(rr(e).length>0||e.signInWithAtlas.enabled)&&(n.appendChild(As(e)),n.appendChild(h(e,"div",R(e,"divider","atlas-embed-divider"),"or"))),n.appendChild(s?ks(e):i.kind==="accept_policies"?hs(e):bs(e,i.kind)),l&&e.mode==="sign-in"&&e.passkeyEnabled&&xe()&&n.appendChild(Cs(e)),(x=e.appearance)!=null&&x.footer&&n.appendChild(h(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let b=n.querySelector("[data-atlas-autofocus]");b instanceof HTMLElement&&b.focus()}}function wc(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":r=rt(e.state.attempt,e.account.emailVerification)?"Check your email":n?`Enter the code we sent to ${n}`:"Enter the code we sent to your email",o=!0;break;case"collect_first_factor":r=n?`Enter the password for ${n}`:"Enter your password",o=!0;break;case"collect_second_factor":r=e.backupCodeMode?"Enter one of your backup codes":"Enter the code from your authenticator app";break;case"collect_new_password":r="Choose a new password";break;case"enroll_second_factor":r=F(e,"mfa.enrollChoose");break;default:return null}let i=h(e,"div","atlas-embed-step-context");if(i.appendChild(h(e,"p",R(e,"subtitle","atlas-embed-subtitle"),r)),o){let s=h(e,"button","atlas-embed-step-back","Use a different email");s.type="button",s.addEventListener("click",()=>Sc(e)),i.appendChild(s)}return i}function Sc(e){e.state=B,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,P(e)}var Re=class{constructor(t,n){this.root=t;this.options=n;k(this,"client");k(this,"mode");k(this,"appearance",null);k(this,"design",null);k(this,"appliedDesign");k(this,"providers",[]);k(this,"nativeProviders",[]);k(this,"signInWithAtlas",{enabled:!1});k(this,"social",Yn(void 0,void 0));k(this,"codeInputStyle","boxes");k(this,"interaction",Tt(void 0,void 0));k(this,"backupCodeMode",!1);k(this,"policies",new _e([]));k(this,"pendingPolicies",null);k(this,"policyDispose",[]);k(this,"enrollment",null);k(this,"secondFactorCode",null);k(this,"enteredIdentifier",null);k(this,"lastStepKind",null);k(this,"signUpFields",[]);k(this,"passwordEnabled",!0);k(this,"emailCodeEnabled",!1);k(this,"emailLinkEnabled",!1);k(this,"emailDeliveryAvailable",!0);k(this,"passkeyEnabled",!1);k(this,"passwordResetEnabled",!0);k(this,"passwordSignUpEnabled",!0);k(this,"conditionalAbort");k(this,"linkPoll",null);k(this,"account",{...Tn});k(this,"rememberMeEnabled",!1);k(this,"remember",!0);k(this,"trustedDeviceEnabled",!1);k(this,"rememberDevice",!1);k(this,"captchaFlows",{});k(this,"captchaHost");k(this,"state",B);k(this,"resetFlow",null);k(this,"flash",null);k(this,"handlePrompt",null);k(this,"busy",!1);k(this,"recorder");var r,o,i;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=Tt(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=ji({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(i=n.locale)!=null?i:yr(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return hr(t,this.options.localization)}async mount(){var r,o,i,s,l,a,d,c,u,f,p,g,y,m,S,E,A,x,b,_,C,w,T,L,te,H,K,ar,lr,cr,dr;if(Vi((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.options.locale&&!this.root.hasAttribute("lang")&&this.root.setAttribute("lang",this.options.locale),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),Rs(this),await ts(this))return;let n=await Wi(this.client);if(n){this.appearance=n.appearance;let Us=(o=n.provider_scopes)!=null?o:{},ur=Ut=>{let $t=Us[Ut];return $t?this.mode==="sign-up"?$t.sign_up:$t.sign_in:!0};this.providers=Bi((i=n.providers)!=null?i:[],n.appearance).filter(ur),this.nativeProviders=((s=n.native_providers)!=null?s:[]).filter(Ut=>ur(Ut.provider)),this.passwordEnabled=(a=(l=n.strategies)==null?void 0:l.password)!=null?a:!0,this.passkeyEnabled=(c=(d=n.strategies)==null?void 0:d.passkey)!=null?c:!1,this.emailCodeEnabled=(f=(u=n.strategies)==null?void 0:u.emailCode)!=null?f:!1,this.emailLinkEnabled=(g=(p=n.strategies)==null?void 0:p.emailLink)!=null?g:!1,this.passwordResetEnabled=(m=(y=n.email_delivery)==null?void 0:y.password_reset)!=null?m:!0,this.emailDeliveryAvailable=(E=(S=n.email_delivery)==null?void 0:S.available)!=null?E:!0,this.passwordSignUpEnabled=(x=(A=n.email_delivery)==null?void 0:A.password_sign_up)!=null?x:!0,this.account=In(n),this.signInWithAtlas=(b=n.sign_in_with_atlas)!=null?b:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(_=n.captchaFlows)!=null?_:{},await sn(this.client)&&(this.captchaFlows=Go(this.captchaFlows)),this.resolveDesign(Ti(n)),this.applyTheme()}this.social=Yn(this.design?{...(C=this.appearance)==null?void 0:C.socialButtons,...this.design.socialButtons}:(w=this.appearance)==null?void 0:w.socialButtons,(T=this.options.appearance)==null?void 0:T.socialButtons),this.codeInputStyle=Li((L=this.appearance)==null?void 0:L.codeInput,(te=this.options.appearance)==null?void 0:te.codeInput),this.interaction=Tt(this.design?{...(H=this.appearance)==null?void 0:H.interaction,...this.design.interaction}:(K=this.appearance)==null?void 0:K.interaction,(ar=this.options.appearance)==null?void 0:ar.interaction),this.applyInteraction(),this.signUpFields=(cr=(lr=this.appearance)==null?void 0:lr.signUpFields)!=null?cr:[],await fs(this);try{this.recorder=new et((dr=this.root.ownerDocument)!=null?dr:document)}catch{}P(this),Ss(this)}applyTheme(){var r,o,i,s,l,a;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:Mi(this.appearance,this.options.appearance),n=Ui(t);for(let[d,c]of Object.entries(n))this.root.style.setProperty(d,c);this.root.style.setProperty("--atlas-embed-color-text-on-primary",$i(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(l=(s=(i=this.options.appearance)==null?void 0:i.variables)==null?void 0:s.colorFocusRing)!=null?l:Ni(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=Ii((a=this.root.ownerDocument)!=null?a:document,this.root,this.design.render,this.appliedDesign))}resolveDesign(t){var o,i,s;let n=(i=(o=this.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=!1;try{r=!!((s=n==null?void 0:n.matchMedia)!=null&&s.call(n,"(prefers-color-scheme: dark)").matches)}catch{}this.design=Gi(t,this.options.appearance,{frontendApi:this.options.frontendApi,prefersDark:r})}applyInteraction(){let t=this.interaction;this.root.setAttribute("data-button-style",t.buttonStyle),this.root.setAttribute("data-button-effect",t.buttonEffect),this.root.setAttribute("data-shadow",t.shadow),this.root.setAttribute("data-density",t.density),this.root.setAttribute("data-input-style",t.inputStyle);let n=t.animations?Fi[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var J={};function Ts(e){J=e}function Is(e){if(!e)return{};let t=e.dataset,n={};return t.atlasKey&&(n.publishableKey=t.atlasKey),t.atlasFapi&&(n.frontendApi=t.atlasFapi),t.atlasRedirect&&(n.redirect=t.atlasRedirect),t.atlasLocale&&(n.locale=t.atlasLocale),n}function Os(e,t){var p,g,y,m,S,E,A,x,b,_,C,w;let n=e.dataset,r=T=>{var L;return(L=e.getAttribute(T))!=null?L:void 0},o=(g=(p=n.atlasKey)!=null?p:r("publishable-key"))!=null?g:J.publishableKey,i=(m=(y=n.atlasFapi)!=null?y:r("frontend-api"))!=null?m:J.frontendApi,s=(E=(S=n.atlasRedirect)!=null?S:r("redirect"))!=null?E:J.redirect;if(!o||!i)return null;let l={publishableKey:o,frontendApi:i,mode:t};s&&(l.redirect=s);let a=(x=(A=n.atlasLocale)!=null?A:r("locale"))!=null?x:J.locale;a&&(l.locale=a);let d=(b=n.atlasPreset)!=null?b:r("preset");d&&(l.appearance={preset:d});let c=(_=n.atlasReferral)!=null?_:r("referral");(c==="off"||c==="false")&&(l.referral=!1);let u=(C=n.atlasReferralConsent)!=null?C:r("referral-consent");(u==="granted"||u==="denied")&&(l.referralConsent=u);let f=(w=n.atlasPasskeyPrf)!=null?w:r("passkey-prf");return f&&(l.passkeyPrf={eval:{first:f}}),l}function Ls(e,t={}){var o,i,s,l,a;let n=(o=t.publishableKey)!=null?o:J.publishableKey,r=(i=t.frontendApi)!=null?i:J.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(s=t.redirect)!=null?s:J.redirect,...((l=t.locale)!=null?l:J.locale)?{locale:(a=t.locale)!=null?a:J.locale}:{},mode:e}}var Mt=class extends HTMLElement{constructor(){super(...arguments);k(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=Os(this,this.mode);if(!n){this.textContent="Atlas: set data-atlas-key (publishable key) and data-atlas-fapi (frontend API origin).";return}this.widget=new Re(this,n),this.widget.mount()}},or=class extends Mt{constructor(){super(...arguments);k(this,"mode","sign-in")}},ir=class extends Mt{constructor(){super(...arguments);k(this,"mode","sign-up")}};function sr(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",or),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",ir))}function Cc(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function Ds(e,t,n){let r=Cc(t);if(!r)return null;let o=Ls(e,n);if(!o)return r.textContent="Atlas: a publishable key and a frontend API origin are required to mount the widget.",null;let i=new Re(r,o);return i.mount(),i}function Fs(e,t={}){return Ds("sign-in",e,t)}function Ms(e,t={}){return Ds("sign-up",e,t)}function Ac(){var t;let e=document.currentScript;return e instanceof HTMLScriptElement?e:(t=document.querySelector("script[data-atlas-key]"))!=null?t:document.querySelector('script[src*="embed.js"]')}function Ec(){Ts(Is(Ac())),sr(),window.Atlas={mountSignIn:Fs,mountSignUp:Ms,defineElements:sr}}Ec();})();
413
+ `,js=new WeakSet;function Hs(e=document){var n;if(js.has(e)||e.querySelector(`style[data-${Or}]`))return;if(rn(e,Or,Bs)){js.add(e);return}let t=e.createElement("style");t.setAttribute(`data-${Or}`,""),nn(e,t),t.textContent=Bs,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function qs(e,t,n={}){var u;let r=_s({instance:(t==null?void 0:t.instanceDesign)===!1?null:e,preset:t==null?void 0:t.preset,design:t==null?void 0:t.design,warn:As});if(!r)return null;let i=r.colorScheme==="dark"||r.colorScheme==="auto"&&!!n.prefersDark?r.paletteDark:r.palette,s={colorPrimary:i.primary,colorText:i.text,colorBackground:i.background,colorAccent:i.accent,colorCard:i.surface,colorBorder:i.border,borderRadius:`${Math.min(r.shape.controlRadius,24)}px`,fontFamily:vr(r.typography.font)};for(let[p,f]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))f!==void 0&&(s[p]=f);let a=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,l={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":a,density:r.spacing.density==="compact"?"compact":"comfortable",inputStyle:r.inputs.style},c=r.buttons.socialLayout==="icons"?{variant:"icon",layout:"grid"}:{layout:r.buttons.socialLayout==="grid"?"grid":"list"},d=ks(JSON.stringify(r));return{render:{style:{},attributes:{...Rr(r),"data-atlas-design":d},css:"",key:d,fontStylesheets:vs(r,n.frontendApi)},tokens:s,interaction:l,socialButtons:c,resolved:r}}var Ws=new Set(["bluesky"]),Ks='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>',Gs='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg>',Oe={"sign-in":{title:"Sign in",submit:"Continue"},"sign-up":{title:"Create your account",submit:"Continue"}};function M(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function _(e,t,n,r){let o=M(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-form-error")||o.classList.contains("atlas-embed-error"))&&o.setAttribute("role","alert"),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&wd(e,o),o}function O(e,t,n){return Ms(t,n,e.options.appearance)}function wd(e,t){e.interaction.buttonEffect!=="ripple"||!e.interaction.animations||t.addEventListener("pointerdown",n=>{let r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),i=M(e).createElement("span");i.className="atlas-embed-ripple",i.style.width=i.style.height=`${o}px`,i.style.left=`${n.clientX-r.left-o/2}px`,i.style.top=`${n.clientY-r.top-o/2}px`,i.addEventListener("animationend",()=>i.remove()),t.appendChild(i)})}function We(e,t){let n=_(e,"button",O(e,"buttonPrimary","atlas-embed-button"));if(n.type="submit",n.disabled=e.busy,e.busy){n.setAttribute("data-busy",""),n.setAttribute("aria-label",t);let r=_(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function Vs(e,t=typeof window!="undefined"?window.location.origin:""){if(!e||typeof e!="string")return null;if(e.startsWith("/")&&!e.startsWith("//"))try{return t?new URL(e,t).toString():e}catch{return null}let n;try{n=new URL(e)}catch{return null}return t&&n.origin===t||n.protocol==="https:"?n.toString():null}async function mt(e,t,n=!1){var a,l,c;let r=e.captchaFlows[t];if(!(n?!!r&&at(r.provider,r):ze(r))||!r)return null;let i=(a=e.root.ownerDocument)!=null?a:document,s=i.createElement("div");s.className="atlas-embed-captcha",((c=(l=e.root.parentElement)!=null?l:i.body)!=null?c:i.documentElement).appendChild(s);try{return await or(r,s,{atlas:{labels:tr(e.options.localization)}})}catch{return null}finally{s.remove()}}var Fr=new WeakMap;async function Sd(e){let t=Fr.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=Xr({win:e}).catch(()=>null);Fr.set(e,n),n.finally(()=>Fr.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function Qs(e){var o,i;let t=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null;if(!t)return!1;let n=await Sd(t);if(n!=null&&n.delivered)return Ke(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let s=no(n.payload);if(s!=null&&s.ticket&&s.attemptId)return await Ys(e,t,s.attemptId,s.ticket),!0;if(s!=null&&s.continuationUrl)return t.location.replace(s.continuationUrl),!0}let r=ro(t.location.search);return r?r.ticket?(await Ys(e,t,r.attemptId,r.ticket,()=>Js(e,t)),!0):(r.status&&(e.state=Pt({id:r.attemptId,status:r.status,...r.policyToken?{policyToken:r.policyToken}:{}}),Js(e,t)),!1):!1}async function Ys(e,t,n,r,o){let i=await Se(e,n,r);o==null||o(),!(i&&await eo({win:t}).catch(()=>!1))&&await ie(e,n)}function Js(e,t){try{t.history.replaceState({},t.document.title,_t(t.location.href))}catch{}}async function Se(e,t,n){return e.options.preview?!1:(await e.client.post("/v1/client/tickets/exchange",{attempt_id:t,ticket:n,remember:e.remember})).ok}async function ie(e,t){var o,i;e.options.preview||await Fi(e.client).catch(()=>{});let n=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=Vs(e.options.redirect,n?n.location.origin:void 0);if(e.root.dispatchEvent(new CustomEvent("atlas:complete",{bubbles:!0,detail:{attemptId:t,redirected:!!r}})),e.options.preview){Ke(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}Ke(e,"You are signed in.")}function ht(e,t){Ko({api:e.options.frontendApi,publishableKey:e.options.publishableKey,attemptId:t!=null?t:void 0,kind:e.mode==="sign-up"?"sign_up":"sign_in",recorder:e.recorder,fetchImpl:e.options.fetchImpl})}async function Fe(e,t,n){var a,l,c,d,u;if(e.busy)return;if((a=e.conditionalAbort)==null||a.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,ht(e,(l=e.state.attempt)==null?void 0:l.id),I(e),e.state=await ot(e.client,e.state,t),e.state.attempt&&Z(e.state.attempt).kind==="collect_captcha"){let p=await mt(e,"signIn",!0);p&&(e.state=await ot(e.client,e.state,{identifier:(d=(c=e.enteredIdentifier)!=null?c:t.identifier)!=null?d:"",captcha_token:p}))}let r=e.state.attempt?Z(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await an(e,n,!1):e.state={...e.state,errors:[{code:"STRATEGY_DISABLED",message:"That sign-in method is not available for this account."}]}:(r==null?void 0:r.kind)==="collect_first_factor"&&t.password&&e.state.errors.length===0&&(e.state=await ot(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?Z(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...X,errors:e.state.errors});let i=e.state.attempt?Z(e.state.attempt):null;if((i==null?void 0:i.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let p=kt(e.emailDeliveryAvailable?i.strategies:i.strategies.filter(f=>f!=="email_code"&&f!=="email_link")).autoSend;p&&await an(e,p,!1)}let s=e.state.attempt;if(Qe(e.state)){I(e);return}if((s==null?void 0:s.status)==="complete"){let p=(u=s.id)!=null?u:null;e.state.ticket&&p&&await Se(e,p,e.state.ticket),await ie(e,p);return}I(e)}async function Zs(e){var n,r;if(e.busy||!Qe(e.state))return;e.state=Po(e.state);let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.busy=!0;try{e.state.ticket&&t&&await Se(e,t,e.state.ticket)}finally{e.busy=!1}await ie(e,t)}async function an(e,t,n=!0){var i;if(n){if(e.busy)return;e.busy=!0,I(e)}let r=(i=e.state.prepared)!=null?i:null,o=await ri(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&ea(e),n&&(e.busy=!1,I(e))}async function Xs(e){e.busy||(e.busy=!0,I(e),e.state=await ni(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,I(e))}function ea(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var i,s;if(!Kn(e.state)){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let t=(i=e.state.attempt)==null?void 0:i.status,{state:n,ticket:r}=await oi(e.client,e.state);if(e.state=n,!r&&n.attempt&&n.attempt.status!==t&&I(e),!r||!n.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let o=(s=n.attempt.id)!=null?s:null;o&&await Se(e,o,r),await ie(e,o)})()},2e3)}async function ln(e,t,n){var a,l,c;ht(e);let r=(l=(a=e.root.ownerDocument)==null?void 0:a.defaultView)!=null?l:typeof window!="undefined"?window:null,o=r?_t(r.location.href):e.options.frontendApi,i=await e.client.post("/v1/client/sign_ins/oauth",{provider:t,redirect_url:o,...n?{identifier:n}:{}}),s=(c=i.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):(e.handlePrompt=null,me(e,i.errors))}async function Dr(e,t,n={}){var a,l,c;ht(e);let r=(l=(a=e.root.ownerDocument)==null?void 0:a.defaultView)!=null?l:typeof window!="undefined"?window:null,o=r?_t(r.location.href):e.options.frontendApi;if(n.popup&&r){await Ad(e,t,r,o);return}let i=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),s=(c=i.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):me(e,i.errors)}function Cd(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function Ad(e,t,n,r){var u;let o=n.open("about:blank","atlas-sso","width=480,height=640,menubar=no,toolbar=no,location=no,status=no");if(!o){await Dr(e,t);return}let i=r.includes("?")?"&":"?",s=`${r}${i}__atlas_display=popup`,a=Cd(e),l=p=>{if(p.origin!==a)return;let f=p.data;if(!(!f||f.type!=="atlas-sso")){n.removeEventListener("message",l);try{o.close()}catch{}if(f.error){me(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(f.status==="complete"&&f.ticket&&f.attempt_id){let g=f.attempt_id,m=f.ticket;(async()=>(await Se(e,g,m),await ie(e,g)))();return}f.attempt_id&&f.status&&(e.state=Pt({id:f.attempt_id,status:f.status,...typeof f.policy_token=="string"?{policyToken:f.policy_token}:{}}),I(e))}};n.addEventListener("message",l);let c=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:s}),d=(u=c.data)==null?void 0:u.authorization_url;if(d)try{o.location.assign(d)}catch{try{o.close()}catch{}n.removeEventListener("message",l),n.location.assign(d)}else{n.removeEventListener("message",l);try{o.close()}catch{}me(e,c.errors)}}async function ta(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",ui({provider:t,idToken:n})),o=pi(r.data);if(!o){me(e,r.errors);return}if(o.status==="complete"&&o.ticket){await Se(e,o.attemptId,o.ticket),await ie(e,o.attemptId);return}let i=r.data,s=Pt({id:o.attemptId,status:o.status,...typeof(i==null?void 0:i.policy_acceptance_token)=="string"?{policyToken:i.policy_acceptance_token}:{}});e.state=o.status==="needs_policy_acceptance"&&s.attempt&&Array.isArray(i==null?void 0:i.pending_policies)?{...s,attempt:{...s.attempt,pending_policies:i.pending_policies}}:s,I(e)}function na(e){e.resetFlow={...lt},I(e)}async function Lr(e,t){var r,o,i,s,a;if(e.busy||!e.resetFlow)return;if(e.busy=!0,ht(e),I(e),Ne(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let l=await mt(e,"passwordReset");e.resetFlow=await Li(e.client,(r=t.email)!=null?r:"",l!=null?l:void 0),(o=e.resetFlow.attempt)!=null&&o.poll_secret&&Pd(e)}else e.resetFlow=await $i(e.client,e.resetFlow,{code:t.code,password:t.password,securityAnswers:((i=e.resetFlow.securityQuestions)!=null?i:[]).map((l,c)=>{var d;return{question:l,answer:(d=t[`security_answer_${c}`])!=null?d:""}})},{askQuestions:((s=e.account.mfa)==null?void 0:s.securityQuestions)===!0});e.busy=!1;let n=e.resetFlow;if(((a=n==null?void 0:n.attempt)==null?void 0:a.status)==="complete"){let l=n.attempt.id;e.resetFlow=null,n.ticket?(await Se(e,l,n.ticket),await ie(e,l)):(e.flash="Password updated. Sign in with your new password.",e.state=X,I(e));return}I(e)}function Pd(e){var n,r;e.linkPoll&&clearInterval(e.linkPoll);let t=(r=(n=e.resetFlow)==null?void 0:n.attempt)==null?void 0:r.id;e.linkPoll=setInterval(()=>{(async()=>{var s,a;let o=e.resetFlow;if(!(o!=null&&o.attempt)||o.attempt.id!==t||o.attempt.status!=="needs_email_verification"){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let i=await Ui(e.client,o,{askQuestions:((s=e.account.mfa)==null?void 0:s.securityQuestions)===!0});e.resetFlow!==o||((a=i.attempt)==null?void 0:a.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=i,I(e))})()},2e3)}async function $r(e,t,n=!0){var c;if(e.busy)return;e.busy=!0,ht(e),I(e);let{identifier:r,password:o,...i}=t,s={};for(let[d,u]of Object.entries(i))u&&(s[d]=u);let a=await mt(e,"signUp");e.state=await Wn(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:s,consent:n,captchaToken:a!=null?a:void 0,policyAcceptances:e.policies.build()}),e.busy=!1,await ra(e);let l=e.state.attempt;if((l==null?void 0:l.status)==="complete"){let d=(c=l.id)!=null?c:null;e.state.ticket&&d&&await Se(e,d,e.state.ticket),await ie(e,d);return}Kn(e.state)&&ea(e),I(e)}var Ed={"mfa.enrollChoose":"Set up a second step for signing in.","mfa.enrollTotpOption":"Use an authenticator app","mfa.enrollSmsOption":"Use text messages","mfa.enrollScan":"Scan this QR code with your authenticator app, or enter the setup key.","mfa.enrollQrAlt":"QR code for your authenticator app","mfa.enrollSetupKey":"Setup key","mfa.enrollPreparing":"Setting up\u2026","mfa.enrollFirstCodeLabel":"Code from your authenticator app","mfa.enrollSecondCodeLabel":"The next code it shows","mfa.phoneLabel":"Mobile number","mfa.phoneHint":"Include the country code, for example +14155550101.","mfa.sendCode":"Text me a code","mfa.codeTextedTo":"Enter the code we texted to {phone}.","mfa.codeLabel":"Code","mfa.smsCodeOption":"Text me a code instead","mfa.recoveryCodesTitle":"Save your recovery codes","mfa.recoveryCodesHelp":"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.","mfa.recoveryCodesCopy":"Copy codes","mfa.recoveryCodesCopied":"Copied.","mfa.recoveryCodesDownload":"Download as .txt","mfa.recoveryCodesSaved":"I've saved my codes","signIn.emailCodeOption":"Email me a code instead","signIn.codeSentTo":"We sent a code to {email}. Enter it below.","signIn.resendCode":"Resend code","signIn.sending":"Sending\u2026"};function B(e,t,n={}){var s;let r=e.options.localization,o=typeof r=="function"?r(t):r&&typeof r=="object"?r[t]:void 0;return(typeof o=="string"&&o.trim()?o:(s=Ed[t])!=null?s:t).replace(/\{(\w+)\}/g,(a,l)=>{var c;return(c=n[l])!=null?c:a})}function oa(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=wo(e.client,()=>Sn(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>I(e)))),e.enrollment.start(t),e.enrollment):null}function ia(e,t,n,r){var l;let o=oa(e);if(!o)return r;let i=o.state,s=(c,d)=>{let u=_(e,"button","atlas-embed-step-back",B(e,c==="totp"?"mfa.enrollTotpOption":"mfa.enrollSmsOption"));u.type="button",u.setAttribute("data-atlas-mfa-method",c),u.disabled=e.busy||i.busy,u.addEventListener("click",()=>void o.choose(c)),Array.isArray(d)?d.push(u):d.appendChild(u)};if(i.method===null){t.appendChild(_(e,"p","atlas-embed-note",B(e,"mfa.enrollChoose")));for(let c of i.options)s(c,t)}else if(i.method==="totp"){let c=i.enrollment;if(c){if(t.appendChild(_(e,"p","atlas-embed-note",B(e,"mfa.enrollScan"))),c.qrCode){let d=M(e).createElement("img");d.className="atlas-embed-mfa-qr",d.setAttribute("data-atlas","mfa-qr"),d.src=c.qrCode,d.alt=B(e,"mfa.enrollQrAlt"),d.width=180,d.height=180,t.appendChild(d)}if(c.secret){let d=_(e,"p","atlas-embed-note",`${B(e,"mfa.enrollSetupKey")}: `);d.setAttribute("data-atlas","mfa-setup-key"),d.appendChild(_(e,"code","atlas-embed-mfa-key",xo(c.secret))),t.appendChild(d)}n.addCodeField("code",B(e,"mfa.enrollFirstCodeLabel"),!0),i.totpCodes>=2&&n.addCodeField("secondCode",B(e,"mfa.enrollSecondCodeLabel"),!1)}else{let d=_(e,"p","atlas-embed-note",i.busy?B(e,"mfa.enrollPreparing"):"");d.setAttribute("aria-live","polite"),t.appendChild(d)}}else if(!i.enrollment)n.addField("phone",B(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(_(e,"p","atlas-embed-note",B(e,"mfa.phoneHint")));else{let c=_(e,"p","atlas-embed-note",B(e,"mfa.codeTextedTo",{phone:(l=i.enrollment.phone)!=null?l:""}));c.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(c),n.addCodeField("code",B(e,"mfa.codeLabel"),!0);let d=_(e,"button","atlas-embed-step-back",B(e,"signIn.resendCode"));d.type="button",d.setAttribute("data-atlas-resend",""),d.disabled=e.busy||i.busy,d.addEventListener("click",()=>void o.resend()),n.trailing.push(d)}for(let c of i.errors){let d=_(e,"p","atlas-embed-error",e.errorText(c));d.setAttribute("role","alert"),t.appendChild(d)}if(i.method!==null&&i.options.length>1)for(let c of i.options.filter(d=>d!==i.method))s(c,n.trailing);let a=So(i);return a===null?null:a==="mfa.sendCode"?B(e,"mfa.sendCode"):r}async function sa(e,t){let n=oa(e);if(!n)return;let r=await n.submit(t);r&&await Fe(e,r)}function aa(e,t){var s;let n=(s=e.state.attempt)==null?void 0:s.id;if(!n)return;let r=Sn(e.account),o=e.secondFactorCode&&e.secondFactorCode.attemptId===n?e.secondFactorCode:null,i=[];r.sms&&i.push("sms"),r.emailCode&&i.push("email_code");for(let a of i){let l=a==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===a&&o.sentTo!==void 0){let u=_(e,"p","atlas-embed-note",a==="sms"?B(e,"mfa.codeTextedTo",{phone:o.sentTo}):B(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${l}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let c=(o==null?void 0:o.strategy)===a&&o.busy===!0,d=_(e,"button","atlas-embed-step-back",c?B(e,"signIn.sending"):B(e,a==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(d.type="button",d.setAttribute("data-atlas",l),d.disabled=e.busy||c,d.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:a,busy:!0},I(e),Co(e.client,n,a).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:a,sentTo:u},I(e)},u=>{e.secondFactorCode={attemptId:n,strategy:a,error:u instanceof Error?u.message:String(u)},I(e)})}),t.push(d),(o==null?void 0:o.strategy)===a&&o.error){let u=_(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function la(e,t){var s,a;let n=_(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(_(e,"h2",O(e,"title","atlas-embed-title"),B(e,"mfa.recoveryCodesTitle"))),n.appendChild(_(e,"p","atlas-embed-note",B(e,"mfa.recoveryCodesHelp")));let r=_(e,"ul","atlas-embed-recovery-list");r.setAttribute("data-atlas","recovery-codes-list"),r.setAttribute("style","list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center");for(let l of t){let c=_(e,"li");c.appendChild(_(e,"code","atlas-embed-mfa-key",l)),r.appendChild(c)}n.appendChild(r);let o=((s=M(e).defaultView)!=null?s:globalThis).navigator;if((a=o==null?void 0:o.clipboard)!=null&&a.writeText){let l=_(e,"button","atlas-embed-step-back",B(e,"mfa.recoveryCodesCopy"));l.type="button",l.setAttribute("data-atlas","recovery-codes-copy"),l.addEventListener("click",()=>{Eo(t).then(c=>{if(!c||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let d=_(e,"p","atlas-embed-note",B(e,"mfa.recoveryCodesCopied"));d.setAttribute("data-atlas","recovery-codes-copied"),d.setAttribute("aria-live","polite"),n.insertBefore(d,i)})}),n.appendChild(l)}if(Cn()){let l=_(e,"button","atlas-embed-step-back",B(e,"mfa.recoveryCodesDownload"));l.type="button",l.setAttribute("data-atlas","recovery-codes-download"),l.addEventListener("click",()=>Ro(t)),n.appendChild(l)}let i=_(e,"button",O(e,"buttonPrimary","atlas-embed-button"),B(e,"mfa.recoveryCodesSaved"));return i.type="button",i.setAttribute("data-atlas","recovery-codes-saved"),i.disabled=e.busy,i.addEventListener("click",()=>{i.disabled=!0,Zs(e)}),n.appendChild(i),n}function cn(e){return Xo((t,n)=>B(e,t,n!=null?n:{}))}async function ca(e){e.mode==="sign-up"&&(Jn(M(e)),e.policies.setPolicies(await rt(e.client)))}function Mr(e){return{link:"atlas-embed-consent-link",text:"atlas-embed-consent-text"}}function da(e){for(let t of e.policyDispose.splice(0))t()}function ua(e,t){let n=e.policies;if(n.policies.length===0)return null;let r=cn(e),o=M(e),i=_(e,"div"),s=_(e,"p");return e.policyDispose.push(Qn(i,n,{t:r,document:o,classes:Mr(e)}).destroy),e.policyDispose.push(Zn(s,n,{t:r,document:o,classes:Mr(e)}).destroy),e.policyDispose.push(n.subscribe(t)),{consent:i,clickwrap:s,canSubmit:()=>n.canSubmit(),async read(){return n.pendingScroll()?Xn(n,{t:r,document:o,container:e.root}):!0}}}async function ra(e){jn(e.state.errors)&&e.policies.setPolicies(await rt(e.client))}function pa(e){var l;let t=cn(e),n=M(e),r=_(e,"div","atlas-embed-policies");Jn(n);let o=e.state.attempt,i=(l=o==null?void 0:o.id)!=null?l:null;(!e.pendingPolicies||e.pendingPolicies.attemptId!==i)&&(e.pendingPolicies={attemptId:i,controller:null},ei(e.client,o,{}).then(c=>{var d;((d=e.pendingPolicies)==null?void 0:d.attemptId)===i&&(e.pendingPolicies={attemptId:i,controller:c},I(e))}));let s=e.pendingPolicies.attemptId===i?e.pendingPolicies.controller:null;if(!s)return r.appendChild(_(e,"p","atlas-embed-note",t("policy.loading"))),r;let a=li(r,s,{t,document:n,container:e.root,classes:Mr(e),onSubmit:c=>{e.pendingPolicies=null,Fe(e,{policy_acceptances:JSON.stringify(c)})},onDecline:c=>{e.pendingPolicies=null,e.state={attempt:null,errors:[{code:"POLICY_DECLINED",message:t("policy.declined",{policy:c.title})}],busy:!1,pollSecret:null,ticket:null},I(e)}});return a.setBusy(e.busy),e.policyDispose.push(a.destroy),r}function fa(e){var f,g;let t=e.resetFlow,n=Ne(t),r=_(e,"div","atlas-embed-reset");r.appendChild(_(e,"h1",O(e,"title","atlas-embed-title"),"Reset your password"));let o=M(e).createElement("form"),i=t.errors,s=new Map,a=i.find(m=>!m.param);a&&o.appendChild(_(e,"div","atlas-embed-form-error",e.errorText(a)));let l=null,c="Continue",d=!0,u=e.account.passwordReset;switch(n){case"request":l=u==="link"?"Enter your email and we\u2019ll send you a reset link.":u==="both"?"Enter your email and we\u2019ll send you a reset link and code.":"Enter your email and we\u2019ll send you a reset code.",c=u==="link"?"Send reset link":"Send reset code",yt(e,o,s,i,"email","Email address","email","username");{let m=s.get("email");m&&(e.enteredIdentifier&&(m.value=e.enteredIdentifier),m.setAttribute("data-atlas-autofocus",""))}break;case"collect_email_code":if(u==="link"){d=!1,l="Check your email";let m=_(e,"p","atlas-embed-note",e.enteredIdentifier?`We sent a reset link to ${e.enteredIdentifier}. Open it on any device; this page continues on its own.`:"We sent you a reset link. Open it on any device; this page continues on its own.");m.setAttribute("data-atlas-link-sent",""),o.appendChild(m);let h=_(e,"button","atlas-embed-step-back","Send another link");h.type="button",h.setAttribute("data-atlas-resend",""),h.disabled=e.busy,h.addEventListener("click",()=>{var w;e.resetFlow={...lt},Lr(e,{email:(w=e.enteredIdentifier)!=null?w:""})}),o.appendChild(h);break}l=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",Ur(e,o,s,i,"code","Reset code",!0);break;case"collect_second_factor":l="Enter the code from your authenticator app",Ur(e,o,s,i,"code","Two-factor code",!0);break;case"collect_new_password":l="Choose a new password",c="Set new password",yt(e,o,s,i,"password","New password","password","new-password"),(f=s.get("password"))==null||f.setAttribute("data-atlas-autofocus",""),((g=t.securityQuestions)!=null?g:[]).forEach((m,h)=>yt(e,o,s,i,`security_answer_${h}`,m,"text","off"));break;default:d=!1,o.appendChild(_(e,"p","atlas-embed-note","You\u2019re all set."))}l&&r.appendChild(_(e,"p",O(e,"subtitle","atlas-embed-subtitle"),l)),r.appendChild(o),d&&o.appendChild(We(e,c));let p=_(e,"button","atlas-embed-step-back","Back to sign in");return p.type="button",p.addEventListener("click",()=>{e.resetFlow=null,I(e)}),o.appendChild(p),o.addEventListener("submit",m=>{m.preventDefault();let h={};for(let[w,P]of s)h[w]=P.value;Lr(e,h)}),r}function yt(e,t,n,r,o,i,s,a){let l=_(e,"label",O(e,"field","atlas-embed-field"));l.appendChild(_(e,"span",O(e,"label","atlas-embed-label"),i));let c=M(e).createElement("input");if(c.className=O(e,"input","atlas-embed-input"),c.type=s,c.name=o,c.setAttribute("autocomplete",a),s==="password"){let d=_(e,"div","atlas-embed-password");d.appendChild(c);let u=_(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",p=>{p.preventDefault();let f=c.type==="password";c.type=f?"text":"password",u.textContent=f?"Hide":"Show",u.setAttribute("aria-label",f?"Hide password":"Show password")}),d.appendChild(u),l.appendChild(d)}else l.appendChild(c);for(let d of r.filter(u=>u.param===o))l.appendChild(_(e,"span",O(e,"error","atlas-embed-error"),e.errorText(d)));n.set(o,c),t.appendChild(l)}function Ur(e,t,n,r,o,i,s){var g;if(e.codeInputStyle==="single"){yt(e,t,n,r,o,i,"text","one-time-code"),s&&((g=n.get(o))==null||g.setAttribute("data-atlas-autofocus",""));return}let l=_(e,"div",O(e,"field","atlas-embed-field"));l.appendChild(_(e,"span",O(e,"label","atlas-embed-label"),i));let c=_(e,"div","atlas-embed-code");c.setAttribute("role","group"),c.setAttribute("aria-label",i);let d=M(e).createElement("input");d.type="hidden",d.name=o,n.set(o,d);let u=[],p=()=>{d.value=u.map(m=>m.value).join("")},f=()=>{d.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let m=0;m<6;m++){let h=M(e).createElement("input");h.className="atlas-embed-code-box",h.type="text",h.setAttribute("inputmode","numeric"),h.setAttribute("autocomplete",m===0?"one-time-code":"off"),h.setAttribute("aria-label",`${i} digit ${m+1}`),h.maxLength=1,s&&m===0&&h.setAttribute("data-atlas-autofocus",""),h.addEventListener("input",()=>{h.value=h.value.replace(/\D/g,"").slice(0,1),p(),h.value&&m<5&&u[m+1].focus(),f()}),h.addEventListener("keydown",w=>{w.key==="Backspace"&&!h.value&&m>0&&u[m-1].focus()}),h.addEventListener("paste",w=>{var A,S,y;w.preventDefault();let P=((S=(A=w.clipboardData)==null?void 0:A.getData("text"))!=null?S:"").replace(/\D/g,"").slice(0,6);for(let b=0;b<6;b++)u[b].value=(y=P[b])!=null?y:"";p(),u[Math.min(P.length,5)].focus(),f()}),u.push(h),c.appendChild(h)}l.appendChild(c),l.appendChild(d);for(let m of r.filter(h=>h.param===o))l.appendChild(_(e,"span",O(e,"error","atlas-embed-error"),e.errorText(m)));t.appendChild(l)}function ga(e,t){var p,f,g,m,h,w,P,A,S;let n=M(e).createElement("form"),r=e.state.errors.find(y=>!y.param);r&&n.appendChild(_(e,"div","atlas-embed-form-error",e.errorText(r)));let o=new Map,i=e.state.errors,s=(y,b,x,k)=>yt(e,n,o,i,y,b,x,k),a=(y,b,x)=>Ur(e,n,o,i,y,b,x),l=!0,c=Oe[e.mode].submit,d=[];switch(t){case"collect_identifier":if(s("identifier","Email address","email",e.passkeyEnabled&&Pe()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){s("password","Password","password","current-password");let y=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?y.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&y.push("email_link");for(let b of y){let x=_(e,"button","atlas-embed-step-back",b==="email_code"?"Email me a code instead":"Email me a sign-in link instead");x.type="button",x.setAttribute("data-strategy",b),x.disabled=e.busy,x.addEventListener("click",()=>{var R;let k=o.get("identifier");if(!k.value.trim()){(R=k.reportValidity)==null||R.call(k),k.focus();return}Fe(e,{identifier:k.value},b)}),d.push(x)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let y=_(e,"label","atlas-embed-remember"),b=M(e).createElement("input");b.type="checkbox",b.className="atlas-embed-remember-check",b.checked=e.remember,b.addEventListener("change",()=>{e.remember=b.checked}),y.appendChild(b),y.appendChild(_(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(y)}break;case"collect_first_factor":{let y=e.state.attempt?(p=Z(e.state.attempt).strategies)!=null?p:[]:[],b=kt(e.emailDeliveryAvailable?y:y.filter(E=>E!=="email_code"&&E!=="email_link")),x=(f=e.state.prepared)!=null?f:null,k=(h=(m=e.enteredIdentifier)!=null?m:(g=e.state.attempt)==null?void 0:g.identifier)!=null?h:"",R=(E,j,W)=>{let T=_(e,"button","atlas-embed-step-back",j);return T.type="button",T.setAttribute(W,W==="data-strategy"?E:""),T.disabled=e.busy,T.addEventListener("click",()=>void an(e,E)),T};if(x==="email_code"){let E=_(e,"p","atlas-embed-note",k?`We sent a code to ${k}. Enter it below.`:"We sent you a code. Enter it below.");E.setAttribute("data-atlas-code-sent",""),n.appendChild(E),a("code","Verification code",!0),d.push(R("email_code","Resend code","data-atlas-resend"))}else if(x==="email_link"){l=!1;let E=_(e,"p","atlas-embed-note",k?`We sent a sign-in link to ${k}. Open it on any device to continue.`:"Check your email for a sign-in link.");E.setAttribute("data-atlas-link-sent",""),n.appendChild(E),d.push(R("email_link","Resend link","data-atlas-resend"))}else if(!b.password&&b.email.length>0){l=!1;for(let E of b.email)d.push(R(E,E==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{s("password","Password","password","current-password");for(let E of b.email)d.push(R(E,E==="email_code"?"Email me a code instead":"Email me a sign-in link instead","data-strategy"))}break}case"collect_second_factor":if(e.backupCodeMode?s("code","Backup code","text","one-time-code"):a("code","Two-factor code",!0),e.trustedDeviceEnabled){let y=_(e,"label","atlas-embed-remember"),b=M(e).createElement("input");b.type="checkbox",b.className="atlas-embed-remember-check",b.checked=e.rememberDevice,b.addEventListener("change",()=>{e.rememberDevice=b.checked}),y.appendChild(b),y.appendChild(_(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(y)}aa(e,d);break;case"collect_email_code":{let y=Et(e.state.attempt,e.account.emailVerification);if(y){l=!1;let b=(A=(P=e.enteredIdentifier)!=null?P:(w=e.state.attempt)==null?void 0:w.identifier)!=null?A:"",x=_(e,"p","atlas-embed-note",b?`We sent a confirmation link to ${b}. Open it on any device; this page continues on its own.`:"We sent you a confirmation link. Open it on any device; this page continues on its own.");x.setAttribute("data-atlas-link-sent",""),n.appendChild(x)}else a("code","Verification code",!0);if(((S=e.state.attempt)==null?void 0:S.object)==="sign_up_attempt"){let b=_(e,"button","atlas-embed-step-back",y?"Resend link":"Resend code");b.type="button",b.setAttribute("data-atlas-resend",""),b.disabled=e.busy,b.addEventListener("click",()=>void Xs(e)),d.push(b)}break}case"collect_new_password":s("password","New password","password","new-password");break;case"enroll_second_factor":{let y=ia(e,n,{addField:s,addCodeField:a,trailing:d},c);y===null?l=!1:c=y;break}default:l=!1,n.appendChild(_(e,"p","atlas-embed-note","Please continue in your application."))}l&&n.appendChild(We(e,c));for(let y of d)n.appendChild(y);if(t==="collect_second_factor"){let y=_(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");y.type="button",y.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,I(e)}),n.appendChild(y)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let y=_(e,"button","atlas-embed-step-back","Forgot password?");y.type="button",y.addEventListener("click",()=>na(e)),n.appendChild(y)}return n.addEventListener("submit",y=>{y.preventDefault();let b={};for(let[x,k]of o)b[x]=k.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(b.remember_device="true"),t==="enroll_second_factor"){sa(e,b);return}Fe(e,b)}),n}function Rd(e){var l;let t=(l=e.appearance)==null?void 0:l.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=M(e),r=_(e,"div","atlas-embed-consent"),o=null;t.required&&(o=n.createElement("input"),o.type="checkbox",o.className="atlas-embed-consent-check",o.setAttribute("aria-label","Agree to the terms and privacy policy"),r.appendChild(o));let i=_(e,"span","atlas-embed-consent-text"),s=(c,d)=>{let u=n.createElement("a");return u.href=c,u.textContent=d,u.target="_blank",u.rel="noopener noreferrer",u.className="atlas-embed-consent-link",u};i.appendChild(n.createTextNode(t.required?"I agree to the ":"By continuing you agree to the "));let a=[];return t.termsUrl&&a.push(s(t.termsUrl,"Terms of Service")),t.privacyUrl&&a.push(s(t.privacyUrl,"Privacy Policy")),a.forEach((c,d)=>{d>0&&i.appendChild(n.createTextNode(" and ")),i.appendChild(c)}),i.appendChild(n.createTextNode(".")),r.appendChild(i),{row:r,checkbox:o}}function ma(e){var c;let t=M(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(_(e,"div","atlas-embed-form-error",Ni)),t;let n=e.state.errors.find(d=>!d.param);n&&t.appendChild(_(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(d,u,p)=>{var w,P,A;let f=(w=p.type)!=null?w:"text",g=f==="radio"||f==="multiselect",m=_(e,g?"fieldset":"label",O(e,"field","atlas-embed-field"));m.appendChild(_(e,g?"legend":"span",O(e,"label","atlas-embed-label"),p.required?u:`${u} (optional)`));let h=M(e);if(f==="select"){let S=h.createElement("select");S.className=O(e,"input","atlas-embed-input"),S.name=d;let y=h.createElement("option");y.value="",y.textContent=p.placeholder||"Select\u2026",S.appendChild(y);for(let b of(P=p.options)!=null?P:[]){let x=h.createElement("option");x.value=b,x.textContent=b,S.appendChild(x)}m.appendChild(S),r.set(d,()=>S.value)}else if(f==="textarea"){let S=h.createElement("textarea");S.className=O(e,"input","atlas-embed-input"),S.name=d,S.rows=3,p.placeholder&&S.setAttribute("placeholder",p.placeholder),m.appendChild(S),r.set(d,()=>S.value)}else if(f==="checkbox"){let S=h.createElement("input");S.type="checkbox",S.name=d,S.className="atlas-embed-checkbox",m.classList.add("atlas-embed-field-checkbox"),m.appendChild(S),r.set(d,()=>S.checked?"true":"")}else if(f==="radio"||f==="multiselect"){let S=h.createElement("div");S.className="atlas-embed-choices";let y=[];for(let b of(A=p.options)!=null?A:[]){let x=h.createElement("label");x.className="atlas-embed-choice";let k=h.createElement("input");k.type=f==="radio"?"radio":"checkbox",k.name=d,k.value=b,y.push(k),x.appendChild(k),x.appendChild(_(e,"span",void 0,b)),S.appendChild(x)}m.appendChild(S),r.set(d,()=>{var b,x;return f==="radio"?(x=(b=y.find(k=>k.checked))==null?void 0:b.value)!=null?x:"":y.filter(k=>k.checked).map(k=>k.value).join(", ")})}else{let S=h.createElement("input");S.className=O(e,"input","atlas-embed-input"),S.type=f,S.name=d,p.autocomplete&&S.setAttribute("autocomplete",p.autocomplete),p.placeholder&&S.setAttribute("placeholder",p.placeholder),m.appendChild(S),r.set(d,()=>S.value)}for(let S of e.state.errors.filter(y=>y.param===d))m.appendChild(_(e,"span",O(e,"error","atlas-embed-error"),e.errorText(S)));t.appendChild(m)};for(let d of e.signUpFields)o(d.key,d.label,{type:d.type,required:d.required,placeholder:d.placeholder,options:d.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let i,s=ua(e,()=>{i&&(i.disabled=e.busy||!(s!=null&&s.canSubmit()))}),a=s?null:Rd(e);a&&t.appendChild(a.row),s&&t.appendChild(s.consent),i=We(e,Oe[e.mode].submit);let l=()=>s?s.canSubmit():!(a!=null&&a.checkbox)||a.checkbox.checked;return i.disabled=e.busy||!l(),(c=a==null?void 0:a.checkbox)==null||c.addEventListener("change",()=>{i.disabled=e.busy||!l()}),t.appendChild(i),s&&t.appendChild(s.clickwrap),t.addEventListener("submit",d=>{d.preventDefault();let u={};for(let[p,f]of r)u[p]=f();if(!s){$r(e,u,l());return}s.read().then(p=>{var g,m;if(p){$r(e,u,!0);return}let f=(m=(g=e.policies.policies.find(h=>!e.policies.isChecked(h.key)))==null?void 0:g.title)!=null?m:"";e.state={...e.state,errors:[{code:"POLICY_DECLINED",message:cn(e)("policy.declined",{policy:f})}]},I(e)})}),t}var Td={google:'<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/>',microsoft:'<path fill="#F25022" d="M2 2h9.3v9.3H2z"/><path fill="#7FBA00" d="M12.7 2H22v9.3h-9.3z"/><path fill="#00A4EF" d="M2 12.7h9.3V22H2z"/><path fill="#FFB900" d="M12.7 12.7H22V22h-9.3z"/>'},Id={github:{fill:"currentColor",path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},apple:{fill:"currentColor",path:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"},x:{fill:"currentColor",path:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"},notion:{fill:"currentColor",path:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},facebook:{fill:"#0866FF",path:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},discord:{fill:"#5865F2",path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},gitlab:{fill:"#FC6D26",path:"m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"},spotify:{fill:"#1ED760",path:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"},twitch:{fill:"#9146FF",path:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"},reddit:{fill:"#FF4500",path:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},figma:{fill:"#F24E1E",path:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},dropbox:{fill:"#0061FF",path:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},gitee:{fill:"#C71D23",path:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"}};function ha(e){let t=Td[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=Id[e];return n?`<svg viewBox="0 0 24 24" width="18" height="18" fill="${n.fill}" aria-hidden="true" focusable="false"><path d="${n.path}"/></svg>`:null}function ya(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},I(e),!0)}function ba(e){let t=e.options.passkeyPrf;return t?{prf:t,onExtensionResults:n=>{var s,a,l,c,d;let r={credentialId:n.credentialId,enabled:!!((s=n.prf)!=null&&s.results)||((a=n.prf)==null?void 0:a.enabled)===!0,...(l=n.prf)!=null&&l.results?{results:n.prf.results}:{}},o=(c=e.root.ownerDocument)==null?void 0:c.defaultView,i=(d=o==null?void 0:o.CustomEvent)!=null?d:CustomEvent;e.root.dispatchEvent(new i("atlas:passkey-prf",{detail:r,bubbles:!1}))}}:{}}async function ka(e){var o,i,s;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,I(e);let t=await ir(e.client,{captcha:({retry:a})=>mt(e,"signIn",a)});if(!t.ok||!t.data){e.busy=!1,me(e,t.errors);return}let n;try{n=await st(t.data,ba(e))}catch{e.busy=!1,I(e);return}let r=await e.client.post("/v1/client/sign_ins/passkey/finish",n);if(e.busy=!1,r.ok&&((i=r.data)==null?void 0:i.status)==="complete"){await ie(e,(s=r.data.created_session_id)!=null?s:null);return}r.ok&&ya(e,r.data)||me(e,r.errors)}async function _a(e){var r,o,i;if(e.mode!=="sign-in"||!e.passkeyEnabled||!Pe())return;let t=!1;try{t=await er()}catch{t=!1}if(!t||ze(e.captchaFlows.signIn))return;(r=e.conditionalAbort)==null||r.abort();let n=new AbortController;e.conditionalAbort=n;try{let s=await ir(e.client);if(!s.ok||!s.data||n.signal.aborted)return;let a=await st(s.data,{mediation:"conditional",signal:n.signal,...ba(e)});if(n.signal.aborted)return;let l=await e.client.post("/v1/client/sign_ins/passkey/finish",a);l.ok&&((o=l.data)==null?void 0:o.status)==="complete"?await ie(e,(i=l.data.created_session_id)!=null?i:null):l.ok&&ya(e,l.data)}catch{}}function va(e){let t=_(e,"button",O(e,"socialButton","atlas-embed-social-button"),"Sign in with a passkey");return t.type="button",t.setAttribute("data-atlas-passkey",""),t.disabled=e.busy,t.addEventListener("click",()=>{ka(e)}),t}function zr(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var Od='<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" fill="none"><path d="M12 2 3 21h4l5-11 5 11h4L12 2z" fill="currentColor"/></svg>';function Fd(e,t){var a;let{variant:n,labels:r}=e.social,o=(a=r.atlas)!=null?a:n==="block"?"Continue with Atlas":"Atlas",i=_(e,"button",O(e,"socialButton","atlas-embed-social-button"));i.type="button",i.setAttribute("data-atlas-provider","atlas"),i.setAttribute("data-variant",n);let s=M(e).createElement("span");if(s.className="atlas-embed-social-icon",s.innerHTML=Od,i.appendChild(s),n==="icon")i.setAttribute("aria-label","Continue with Atlas"),i.setAttribute("title","Atlas");else{let l=M(e).createElement("span");l.className="atlas-embed-social-label",l.textContent=o,i.appendChild(l)}return i.addEventListener("click",()=>{Dr(e,t,{popup:!0})}),i}function xa(e){let t=zr(e),n=_(e,"div","atlas-embed-social");n.setAttribute("data-layout",e.social.layout),n.setAttribute("data-size",e.social.size),n.setAttribute("data-variant",e.social.variant),e.signInWithAtlas.enabled&&e.signInWithAtlas.connection_id&&n.appendChild(Fd(e,e.signInWithAtlas.connection_id));for(let c of t){let d=e.nativeProviders.find(p=>p.provider===c),u=c==="google"&&(d!=null&&d.client_id)?$d(e,d.client_id):Ld(e,c);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",c),n.appendChild(u)}let r=e.social.layout==="carousel"?Dd(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>Is))return r;let i=_(e,"div","atlas-embed-social-field"),s=M(e).createElement("input");s.type="search",s.className="atlas-embed-social-search",s.setAttribute("placeholder","Search sign-in options\u2026"),s.setAttribute("aria-label","Search sign-in options"),s.autocomplete="off";let a=_(e,"div","atlas-embed-social-empty");a.textContent="No matching sign-in options.",a.setAttribute("hidden","");let l=Array.from(n.children);return s.addEventListener("input",()=>{var u;let c=s.value.trim().toLowerCase(),d=0;for(let p of l){let f=(u=p.getAttribute("data-atlas-provider"))!=null?u:"",g=c===""||sn(f).toLowerCase().includes(c)||f.toLowerCase().includes(c);p.toggleAttribute("hidden",!g),g&&(d+=1)}a.toggleAttribute("hidden",d!==0),n.dispatchEvent(new Event("scroll"))}),i.appendChild(s),i.appendChild(r),i.appendChild(a),i}function Dd(e,t){var c;let n=(c=M(e).defaultView)!=null?c:typeof window!="undefined"?window:null,r=_(e,"div","atlas-embed-carousel"),o=d=>{let u=_(e,"button","atlas-embed-carousel-nav");return u.type="button",u.setAttribute("data-dir",d),u.setAttribute("aria-label",d==="prev"?"Scroll to previous sign-in options":"Scroll to more sign-in options"),u.innerHTML=d==="prev"?Ks:Gs,u.addEventListener("click",()=>{let p=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(d==="prev"?-1:1)*p,behavior:"smooth"})}),u},i=o("prev"),s=o("next"),a=()=>{let d=t.scrollWidth-t.clientWidth,u=d>2;r.setAttribute("data-overflow",u?"true":"false"),i.disabled=!u||t.scrollLeft<=1,s.disabled=!u||t.scrollLeft>=d-1};t.addEventListener("scroll",a,{passive:!0});let l=n&&n.ResizeObserver;return l?new l(a).observe(t):n&&n.addEventListener("resize",a),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(a),a(),r.appendChild(i),r.appendChild(t),r.appendChild(s),r}function wa(e,t,n="button"){var c;let{variant:r,labels:o}=e.social,i=sn(t),s=(c=o[t])!=null?c:r==="block"?`Continue with ${i}`:i,a=_(e,n,O(e,"socialButton","atlas-embed-social-button"));n==="button"&&(a.type="button"),a.setAttribute("data-atlas-provider",t),a.setAttribute("data-variant",r);let l=ha(t);if(l){let d=M(e).createElement("span");d.className="atlas-embed-social-icon",d.innerHTML=l,a.appendChild(d)}if(r==="icon")a.setAttribute("aria-label",`Continue with ${i}`),a.setAttribute("title",i);else{let d=M(e).createElement("span");d.className="atlas-embed-social-label",d.textContent=s,a.appendChild(d)}return a}function Ld(e,t){let n=wa(e,t);return n.addEventListener("click",()=>{Ws.has(t)?(e.handlePrompt=t,I(e)):ln(e,t)}),n}function Sa(e,t){let n=sn(t),r=M(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let l of e.state.errors.filter(c=>!c.param))r.appendChild(_(e,"div","atlas-embed-form-error",e.errorText(l)));let o=_(e,"label",O(e,"field","atlas-embed-field"));o.appendChild(_(e,"span",O(e,"label","atlas-embed-label"),`${n} handle`));let i=M(e).createElement("input");i.className=O(e,"input","atlas-embed-input"),i.type="text",i.name="identifier",i.placeholder="you.bsky.social",i.setAttribute("autocomplete","username"),i.setAttribute("autocapitalize","none"),i.setAttribute("spellcheck","false"),o.appendChild(i),r.appendChild(o);let s=We(e,Oe[e.mode].submit);r.appendChild(s);let a=_(e,"button","atlas-embed-handle-back","Back");return a.type="button",a.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},I(e)}),r.appendChild(a),r.addEventListener("submit",l=>{l.preventDefault();let c=i.value.trim();if(!c){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},I(e);return}ln(e,t,c)}),r}function $d(e,t){let n=wa(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),fi({wrapper:n,clientId:t,onCredential:r=>void ta(e,"google",r),onError:()=>Ke(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void ln(e,"google"))}),n}function Ke(e,t){e.root.textContent="";let n=_(e,"div",O(e,"card","atlas-embed-card"));n.appendChild(_(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function Ca(e){e.root.textContent="";let t=_(e,"div",O(e,"card","atlas-embed-card")),n=e.interaction.loading,r=_(e,"div","atlas-embed-loading");if(r.setAttribute("data-loading",n),r.setAttribute("role","status"),r.setAttribute("aria-label","Loading"),n==="skeleton")for(let i of["title","sub","input","input","button"])r.appendChild(_(e,"div",`atlas-embed-skel atlas-embed-skel-${i}`));else if(n==="dots")for(let i=0;i<3;i+=1)r.appendChild(_(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(_(e,"span","atlas-embed-loadbar")):r.appendChild(_(e,"span","atlas-embed-spinner"));let o=_(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function me(e,t){e.state={...e.state,errors:[...t]},I(e)}function I(e){var u,p,f,g,m,h,w,P,A,S;da(e);let t=Array.from(e.root.children).filter(y=>y.hasAttribute("data-atlas-policy-modal"));e.root.textContent="";for(let y of t)e.root.appendChild(y);let n=_(e,"div",O(e,"card","atlas-embed-card")),r=(p=(u=e.appearance)==null?void 0:u.logoUrl)!=null?p:null;if(r){let y=M(e).createElement("img");y.className="atlas-embed-logo",y.src=r,y.alt=(g=(f=e.appearance)==null?void 0:f.applicationName)!=null?g:"",n.appendChild(y)}if(e.resetFlow){let y=`reset_${Ne(e.resetFlow)}`;if(n.setAttribute("data-step",y),y!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=y,n.appendChild(fa(e)),(m=e.appearance)!=null&&m.footer&&n.appendChild(_(e,"p",O(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let b=n.querySelector("[data-atlas-autofocus]");b instanceof HTMLElement&&b.focus()}return}let o=Qe(e.state);if(o){n.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&n.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",n.appendChild(la(e,o)),e.root.appendChild(n);return}let i=e.state.attempt?Z(e.state.attempt):{kind:"collect_identifier"},s=e.mode==="sign-up"&&!e.state.attempt,a=s||i.kind==="collect_identifier",l=e.handlePrompt?"handle":i.kind;n.setAttribute("data-step",l),l!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=l;let c=(w=(h=e.appearance)==null?void 0:h.headline)!=null?w:Oe[e.mode].title;n.appendChild(_(e,"h1",O(e,"title","atlas-embed-title"),c));let d=a?null:Md(e,i.kind);if(d?n.appendChild(d):(P=e.appearance)!=null&&P.subheadline&&n.appendChild(_(e,"p",O(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&n.appendChild(_(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){n.appendChild(Sa(e,e.handlePrompt)),(A=e.appearance)!=null&&A.footer&&n.appendChild(_(e,"p",O(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n);return}if(a&&(zr(e).length>0||e.signInWithAtlas.enabled)&&(n.appendChild(xa(e)),n.appendChild(_(e,"div",O(e,"divider","atlas-embed-divider"),"or"))),n.appendChild(s?ma(e):i.kind==="accept_policies"?pa(e):ga(e,i.kind)),a&&e.mode==="sign-in"&&e.passkeyEnabled&&Pe()&&n.appendChild(va(e)),(S=e.appearance)!=null&&S.footer&&n.appendChild(_(e,"p",O(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let y=n.querySelector("[data-atlas-autofocus]");y instanceof HTMLElement&&y.focus()}}function Md(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":r=Et(e.state.attempt,e.account.emailVerification)?"Check your email":n?`Enter the code we sent to ${n}`:"Enter the code we sent to your email",o=!0;break;case"collect_first_factor":r=n?`Enter the password for ${n}`:"Enter your password",o=!0;break;case"collect_second_factor":r=e.backupCodeMode?"Enter one of your backup codes":"Enter the code from your authenticator app";break;case"collect_new_password":r="Choose a new password";break;case"enroll_second_factor":r=B(e,"mfa.enrollChoose");break;default:return null}let i=_(e,"div","atlas-embed-step-context");if(i.appendChild(_(e,"p",O(e,"subtitle","atlas-embed-subtitle"),r)),o){let s=_(e,"button","atlas-embed-step-back","Use a different email");s.type="button",s.addEventListener("click",()=>Ud(e)),i.appendChild(s)}return i}function Ud(e){e.state=X,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,I(e)}var Ge=class{constructor(t,n){this.root=t;this.options=n;v(this,"client");v(this,"mode");v(this,"appearance",null);v(this,"design",null);v(this,"appliedDesign");v(this,"providers",[]);v(this,"nativeProviders",[]);v(this,"signInWithAtlas",{enabled:!1});v(this,"social",Ir(void 0,void 0));v(this,"codeInputStyle","boxes");v(this,"interaction",on(void 0,void 0));v(this,"backupCodeMode",!1);v(this,"policies",new Ue([]));v(this,"pendingPolicies",null);v(this,"policyDispose",[]);v(this,"enrollment",null);v(this,"secondFactorCode",null);v(this,"enteredIdentifier",null);v(this,"lastStepKind",null);v(this,"signUpFields",[]);v(this,"passwordEnabled",!0);v(this,"emailCodeEnabled",!1);v(this,"emailLinkEnabled",!1);v(this,"emailDeliveryAvailable",!0);v(this,"passkeyEnabled",!1);v(this,"passwordResetEnabled",!0);v(this,"passwordSignUpEnabled",!0);v(this,"conditionalAbort");v(this,"linkPoll",null);v(this,"account",{...cr});v(this,"rememberMeEnabled",!1);v(this,"remember",!0);v(this,"trustedDeviceEnabled",!1);v(this,"rememberDevice",!1);v(this,"captchaFlows",{});v(this,"captchaHost");v(this,"state",X);v(this,"resetFlow",null);v(this,"flash",null);v(this,"handlePrompt",null);v(this,"busy",!1);v(this,"recorder");var r,o,i;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=on(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=we({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(i=n.locale)!=null?i:Yr(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return Vr(t,this.options.localization)}async mount(){var r,o,i,s,a,l,c,d,u,p,f,g,m,h,w,P,A,S,y,b,x,k,R,E,j,W,T,Y,ae,Q,Je;if(Hs((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.options.locale&&!this.root.hasAttribute("lang")&&this.root.setAttribute("lang",this.options.locale),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),Ca(this),Dt(this.client).catch(()=>{}),await Qs(this))return;let n=await Ns(this.client);if(n){this.appearance=n.appearance;let $a=(o=n.provider_scopes)!=null?o:{},Hr=un=>{let pn=$a[un];return pn?this.mode==="sign-up"?pn.sign_up:pn.sign_in:!0};this.providers=Us((i=n.providers)!=null?i:[],n.appearance).filter(Hr),this.nativeProviders=((s=n.native_providers)!=null?s:[]).filter(un=>Hr(un.provider)),this.passwordEnabled=(l=(a=n.strategies)==null?void 0:a.password)!=null?l:!0,this.passkeyEnabled=(d=(c=n.strategies)==null?void 0:c.passkey)!=null?d:!1,this.emailCodeEnabled=(p=(u=n.strategies)==null?void 0:u.emailCode)!=null?p:!1,this.emailLinkEnabled=(g=(f=n.strategies)==null?void 0:f.emailLink)!=null?g:!1,this.passwordResetEnabled=(h=(m=n.email_delivery)==null?void 0:m.password_reset)!=null?h:!0,this.emailDeliveryAvailable=(P=(w=n.email_delivery)==null?void 0:w.available)!=null?P:!0,this.passwordSignUpEnabled=(S=(A=n.email_delivery)==null?void 0:A.password_sign_up)!=null?S:!0,this.account=dr(n),this.signInWithAtlas=(y=n.sign_in_with_atlas)!=null?y:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(b=n.captchaFlows)!=null?b:{},await $n(this.client)&&(this.captchaFlows=Bi(this.captchaFlows)),this.resolveDesign(Ps(n)),this.applyTheme()}this.social=Ir(this.design?{...(x=this.appearance)==null?void 0:x.socialButtons,...this.design.socialButtons}:(k=this.appearance)==null?void 0:k.socialButtons,(R=this.options.appearance)==null?void 0:R.socialButtons),this.codeInputStyle=Ts((E=this.appearance)==null?void 0:E.codeInput,(j=this.options.appearance)==null?void 0:j.codeInput),this.interaction=on(this.design?{...(W=this.appearance)==null?void 0:W.interaction,...this.design.interaction}:(T=this.appearance)==null?void 0:T.interaction,(Y=this.options.appearance)==null?void 0:Y.interaction),this.applyInteraction(),this.signUpFields=(Q=(ae=this.appearance)==null?void 0:ae.signUpFields)!=null?Q:[],await ca(this);try{this.recorder=new Ct((Je=this.root.ownerDocument)!=null?Je:document)}catch{}I(this),_a(this)}applyTheme(){var r,o,i,s,a,l;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:Fs(this.appearance,this.options.appearance),n=Ds(t);for(let[c,d]of Object.entries(n))this.root.style.setProperty(c,d);this.root.style.setProperty("--atlas-embed-color-text-on-primary",Ls(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(a=(s=(i=this.options.appearance)==null?void 0:i.variables)==null?void 0:s.colorFocusRing)!=null?a:$s(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=Es((l=this.root.ownerDocument)!=null?l:document,this.root,this.design.render,this.appliedDesign))}resolveDesign(t){var o,i,s;let n=(i=(o=this.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=!1;try{r=!!((s=n==null?void 0:n.matchMedia)!=null&&s.call(n,"(prefers-color-scheme: dark)").matches)}catch{}this.design=qs(t,this.options.appearance,{frontendApi:this.options.frontendApi,prefersDark:r})}applyInteraction(){let t=this.interaction;this.root.setAttribute("data-button-style",t.buttonStyle),this.root.setAttribute("data-button-effect",t.buttonEffect),this.root.setAttribute("data-shadow",t.shadow),this.root.setAttribute("data-density",t.density),this.root.setAttribute("data-input-style",t.inputStyle);let n=t.animations?Os[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var se={};function Aa(e){se=e}function Ve(){return se}function Pa(e){if(!e)return{};let t=e.dataset,n={};return t.atlasKey&&(n.publishableKey=t.atlasKey),t.atlasFapi&&(n.frontendApi=t.atlasFapi),t.atlasRedirect&&(n.redirect=t.atlasRedirect),t.atlasLocale&&(n.locale=t.atlasLocale),n}function Ea(e,t){var f,g,m,h,w,P,A,S,y,b,x,k;let n=e.dataset,r=R=>{var E;return(E=e.getAttribute(R))!=null?E:void 0},o=(g=(f=n.atlasKey)!=null?f:r("publishable-key"))!=null?g:se.publishableKey,i=(h=(m=n.atlasFapi)!=null?m:r("frontend-api"))!=null?h:se.frontendApi,s=(P=(w=n.atlasRedirect)!=null?w:r("redirect"))!=null?P:se.redirect;if(!o||!i)return null;let a={publishableKey:o,frontendApi:i,mode:t};s&&(a.redirect=s);let l=(S=(A=n.atlasLocale)!=null?A:r("locale"))!=null?S:se.locale;l&&(a.locale=l);let c=(y=n.atlasPreset)!=null?y:r("preset");c&&(a.appearance={preset:c});let d=(b=n.atlasReferral)!=null?b:r("referral");(d==="off"||d==="false")&&(a.referral=!1);let u=(x=n.atlasReferralConsent)!=null?x:r("referral-consent");(u==="granted"||u==="denied")&&(a.referralConsent=u);let p=(k=n.atlasPasskeyPrf)!=null?k:r("passkey-prf");return p&&(a.passkeyPrf={eval:{first:p}}),a}function Ra(e,t={}){var o,i,s,a,l;let n=(o=t.publishableKey)!=null?o:se.publishableKey,r=(i=t.frontendApi)!=null?i:se.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(s=t.redirect)!=null?s:se.redirect,...((a=t.locale)!=null?a:se.locale)?{locale:(l=t.locale)!=null?l:se.locale}:{},mode:e}}var dn=class extends HTMLElement{constructor(){super(...arguments);v(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=Ea(this,this.mode);if(!n){this.textContent="Atlas: set data-atlas-key (publishable key) and data-atlas-fapi (frontend API origin).";return}this.widget=new Ge(this,n),this.widget.mount()}},Nr=class extends dn{constructor(){super(...arguments);v(this,"mode","sign-in")}},Br=class extends dn{constructor(){super(...arguments);v(this,"mode","sign-up")}};function jr(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",Nr),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",Br))}function zd(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function Ta(e,t,n){let r=zd(t);if(!r)return null;let o=Ra(e,n);if(!o)return r.textContent="Atlas: a publishable key and a frontend API origin are required to mount the widget.",null;let i=new Ge(r,o);return i.mount(),i}function Ia(e,t={}){return Ta("sign-in",e,t)}function Oa(e,t={}){return Ta("sign-up",e,t)}var q=(e,t={},...n)=>{let r=document.createElement(e);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);for(let o of n)o!==null&&r.append(o);return r};function Ye(e,t,n){let r=q("ul",{class:"atlas-list"});for(let o of e){let i=q("li",{"data-id":o.id},o.text),s=q("button",{type:"button",class:"atlas-button-secondary"},t);s.addEventListener("click",()=>void n(o.id)),i.append(" ",s),r.append(i)}return r}function Fa(e,t){var P,A,S;let n=typeof e=="string"?document.querySelector(e):e,r=Ve(),o=(P=t.publishableKey)!=null?P:r.publishableKey,i=(A=t.frontendApi)!=null?A:r.frontendApi;if(!n)return null;if(!o||!i)return n.textContent="Atlas: a publishable key and a frontend API origin are required.",null;let s=we({publishableKey:o,frontendApi:i,locale:(S=t.locale)!=null?S:r.locale,fetchImpl:t.fetchImpl}),a=t.organizationId,l=null,c=null,d=null,u=!0,p=async y=>{try{await y(),d=null}catch(b){d=b instanceof Error?b.message:"The request failed."}await w()},f=y=>p(async()=>{var x,k;let b=await y();l=(k=(x=b.secret)!=null?x:b.token)!=null?k:null}),g=(y,b="text",x="")=>{let k=q("input",{type:b,placeholder:x,"aria-label":y});return[q("label",{class:"atlas-field"},q("span",{},y),k),k]},m=(y,b,x=!0)=>{let k=q("button",{type:"button",class:x?"atlas-button":"atlas-button-secondary"},y);return k.addEventListener("click",b),k};async function h(){var y,b;switch(t.section){case"domains":{let x=await $.listDomains(s,a),[k,R]=g("Email domain","text","acme.com");return[Ye(x.map(E=>({id:E.id,text:`${E.domain} \u2014 ${E.status}${E.status==="verified"?"":` (TXT ${E.verification.record_name} = ${E.verification.record_value})`}`})),"Remove",E=>p(()=>$.removeDomain(s,a,E))),...x.filter(E=>E.status!=="verified").map(E=>m(`Verify ${E.domain}`,()=>void p(()=>$.verifyDomain(s,a,E.id)),!1)),k,m("Add domain",()=>void p(()=>$.addDomain(s,a,R.value.trim())))]}case"logStreams":{let x=await $.listLogStreams(s,a),[k,R]=g("HTTPS endpoint","url","https://siem.example.com/ingest");return[Ye(x.map(E=>({id:E.id,text:E.url})),"Remove",E=>p(()=>$.removeLogStream(s,a,E))),k,m("Add destination",()=>void f(()=>$.addLogStream(s,a,{url:R.value.trim()})))]}case"apiKeys":{let x=await $.listApiKeys(s,a),[k,R]=g("Key name");return[Ye(x.map(E=>{var j;return{id:E.id,text:`${(j=E.name)!=null?j:E.prefix} (${E.prefix})`}}),"Revoke",E=>p(()=>$.revokeApiKey(s,a,E))),k,m("Create key",()=>void f(()=>$.createApiKey(s,a,{name:R.value.trim()||void 0})))]}case"webhooks":{let x=await $.listWebhooks(s,a),[k,R]=g("HTTPS endpoint","url","https://example.com/hooks/atlas");return[Ye(x.map(E=>({id:E.id,text:`${E.url} \u2014 ${E.health}`})),"Remove",E=>p(()=>$.deleteWebhook(s,a,E))),k,m("Add endpoint",()=>void f(()=>$.createWebhook(s,a,{url:R.value.trim()})))]}case"appWebhooks":{let[x,k]=await Promise.all([$.listAppWebhooks(s,a),$.listAppEventTypes(s,a)]),[R,E]=g("HTTPS endpoint","url","https://example.com/webhooks"),j=k.map(T=>{let Y=q("input",{type:"checkbox",value:T.type,"aria-label":T.type});return{box:Y,el:q("label",{class:"atlas-text"},Y,` ${T.type}${T.description?` \u2014 ${T.description}`:""}`)}}),W=[];for(let T of x){let Y=q("li",{"data-id":T.id,"data-health":T.health},`${T.url} \u2014 ${T.health} \u2014 ${T.enabled_events.includes("*")?"all events":T.enabled_events.join(", ")} `);if(Y.append(m("Send test",()=>void p(async()=>{var Q;let ae=await $.testAppWebhook(s,a,T.id);if(ae.status!=="success")throw new Error(`Test failed: ${(Q=ae.error)!=null?Q:`HTTP ${ae.http_status}`}`)}),!1),T.active?m("Pause",()=>void p(()=>$.updateAppWebhook(s,a,T.id,{active:!1})),!1):m("Enable",()=>void p(async()=>{await $.updateAppWebhook(s,a,T.id,{active:!0}),T.health!=="healthy"&&await $.replayAppWebhook(s,a,T.id)}),!1),m("Reveal secret",()=>void f(()=>$.revealAppWebhookSecret(s,a,T.id)),!1),m("Rotate secret",()=>void f(()=>$.rotateAppWebhookSecret(s,a,T.id)),!1),m("Deliveries",()=>{c=c===T.id?null:T.id,w()},!1),m("Remove",()=>void p(()=>$.deleteAppWebhook(s,a,T.id)),!1)),c===T.id){let ae=await $.appWebhookDeliveries(s,a,T.id);Y.append(Ye(ae.map(Q=>{var Je;return{id:Q.id,text:`${(Je=Q.event_type)!=null?Je:"\u2014"} \xB7 ${Q.status}${Q.http_status?` \xB7 HTTP ${Q.http_status}`:""} \xB7 ${new Date(Q.created_at).toLocaleString()}`}}),"Redeliver",Q=>p(()=>$.redeliverAppWebhook(s,a,T.id,Q))))}W.push(Y)}return[q("ul",{class:"atlas-list"},...W),R,q("fieldset",{class:"atlas-field"},q("legend",{},"Events (none selected = all)"),...j.map(T=>T.el)),m("Add endpoint",()=>{let T=j.filter(Y=>Y.box.checked).map(Y=>Y.box.value);f(()=>$.createAppWebhook(s,a,{url:E.value.trim(),enabled_events:T.length?T:["*"]}))})]}case"directory":{let x=await $.getDirectory(s,a);return[q("p",{},`SCIM base URL: ${x.base_url}`),Ye(x.tokens.map(k=>({id:k.id,text:k.prefix})),"Revoke",k=>p(()=>$.revokeDirectoryToken(s,a,k))),m("Generate token",()=>void f(()=>$.createDirectoryToken(s,a)))]}case"ipAllowlist":{let x=await $.getIpAllowlist(s,a),k=q("textarea",{rows:"5","aria-label":"Sign-in IP allowlist"});return k.value=x.entries.join(`
414
+ `),[q("p",{},`One IP or CIDR per line; empty allows anywhere. Your IP: ${x.your_ip}`),k,m("Save",()=>void p(()=>$.setIpAllowlist(s,a,k.value.split(/[\s,]+/).filter(Boolean))))]}case"sso":{let x=await $.getSso(s,a),k=(b=(y=x.connection)==null?void 0:y.type)!=null?b:"oidc",E=(k==="oidc"?[["oidc_issuer","Issuer URL","text"],["oidc_client_id","Client ID","text"],["oidc_client_secret","Client secret","password"]]:[["saml_metadata_xml","IdP metadata XML","text"],["saml_idp_certificate","IdP certificate (PEM)","text"]]).map(([j,W,T])=>{let[Y,ae]=g(W,T);return{key:j,l:Y,f:ae}});return[q("p",{},x.connection?`${x.connection.type.toUpperCase()} \u2014 ${x.connection.status}`:"No connection yet."),q("p",{},`ACS URL: ${x.sp.acs_url} \xB7 Redirect URI: ${x.sp.oidc_redirect_uri}`),...E.map(j=>j.l),m("Save connection",()=>{let j={};for(let W of E)W.f.value&&(j[W.key]=W.f.value);p(()=>$.saveSso(s,a,{type:k,...j}))})]}}}async function w(){if(!u)return;let y;try{y=await h()}catch(x){let k=x.status;n.replaceChildren(...k===403||k===404?[]:[q("p",{role:"alert"},x instanceof Error?x.message:"The request failed.")]);return}let b=[];d&&b.push(q("p",{role:"alert"},d)),l&&b.push(q("p",{"data-atlas":"one-time-secret"},"Copy this now \u2014 it will not be shown again: ",q("code",{},l))),n.dataset.atlas=`organization-admin-${t.section}`,n.replaceChildren(...b,...y)}return w(),{destroy(){u=!1,n.replaceChildren()}}}var ee=(e,t={},...n)=>{let r=document.createElement(e);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);for(let o of n)o!==null&&r.append(o);return r};function Da(e,t={}){var f,g,m,h;let n=typeof e=="string"?document.querySelector(e):e,r=Ve(),o=(f=t.publishableKey)!=null?f:r.publishableKey,i=(g=t.frontendApi)!=null?g:r.frontendApi;if(!n)return null;if(!o||!i)return n.textContent="Atlas: a publishable key and a frontend API origin are required.",null;let s=we({publishableKey:o,frontendApi:i,locale:(m=t.locale)!=null?m:r.locale,fetchImpl:t.fetchImpl}),a={monthly:"Monthly",yearly:"Yearly",perMonth:"month",perYear:"year",free:"Free",subscribe:"Subscribe",trial:w=>`${w}-day free trial`,useCode:w=>`Use code ${w} at checkout`,...t.labels},l=(h=t.locale)!=null?h:document.documentElement.lang||void 0,c="month",d=[],u=!0,p=()=>{if(!u)return;let w=[];if(d.some(P=>P.annual_available)){let P=ee("div",{role:"group","aria-label":"Billing interval","data-atlas":"pricing-interval"});for(let A of["month","year"]){let S=ee("button",{type:"button",class:"atlas-button-secondary","aria-pressed":String(c===A)},A==="month"?a.monthly:a.yearly);S.addEventListener("click",()=>{c=A,p()}),P.append(S)}w.push(P)}for(let P of d){let A=Ai(P,{interval:c,locale:l}),S=ee("p",{class:"atlas-price"});A.originalPrice&&S.append(ee("s",{"data-atlas":"pricing-original"},A.originalPrice)," "),S.append(A.free?a.free:A.price),A.free||S.append(ee("span",{class:"atlas-interval"},` / ${A.interval==="year"?a.perYear:a.perMonth}`));let y=ee("button",{type:"button",class:"atlas-button"},a.subscribe);y.addEventListener("click",async()=>{var x,k,R,E;let b=await Ei(s,{planId:P.id,orgId:t.organizationId,...P.annual_available?{interval:c}:{},successUrl:(x=t.successUrl)!=null?x:window.location.href});b.url?((k=t.navigate)!=null?k:j=>window.location.assign(j))(b.url):(E=t.onError)==null||E.call(t,(R=b.error)!=null?R:"Could not start checkout.")}),w.push(ee("div",{class:"atlas-card","data-atlas":"pricing-plan"},ee("h3",{class:"atlas-plan-name"},P.name),A.promotionLabel?ee("p",{"data-atlas":"pricing-promotion",class:"atlas-badge"},A.promotionLabel):null,S,A.trialDays?ee("p",{"data-atlas":"pricing-trial",class:"atlas-badge"},a.trial(A.trialDays)):null,A.promotionCode?ee("p",{"data-atlas":"pricing-code"},a.useCode(A.promotionCode)):null,P.features.length?ee("ul",{class:"atlas-list"},...P.features.map(b=>ee("li",{},b))):null,y))}n.dataset.atlas="pricing-table",n.replaceChildren(...w)};return Pi(s,{audience:t.audience}).then(w=>{d=w,p()}),{destroy(){u=!1,n.replaceChildren()}}}var de=(e,t={},...n)=>{let r=document.createElement(e);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);for(let o of n)o!==null&&r.append(o);return r};function La(e,t={}){var P,A,S;let n=typeof e=="string"?document.querySelector(e):e,r=Ve(),o=(P=t.publishableKey)!=null?P:r.publishableKey,i=(A=t.frontendApi)!=null?A:r.frontendApi;if(!n)return null;if(!o||!i)return n.textContent="Atlas: a publishable key and a frontend API origin are required.",null;let s=we({publishableKey:o,frontendApi:i,locale:(S=t.locale)!=null?S:r.locale,fetchImpl:t.fetchImpl});Dt(s).catch(()=>{});let a={email:"Email address",name:"Name",submit:"Subscribe",consent:"I agree to receive emails",thanks:"Thanks \u2014 you are on the list.",invalid:"Enter a valid email address.",failed:"Could not subscribe. Try again.",...t.labels},l=de("form",{class:"atlas-card","data-atlas":"lead-form",novalidate:"true"}),c=(y,b,x,k)=>{let R=de("input",{class:"atlas-input",type:x,name:b,autocomplete:k});return[de("label",{class:"atlas-field"},de("span",{class:"atlas-field-label"},y),R),R]},[d,u]=c(a.name,"name","text","name"),[p,f]=c(a.email,"email","email","email"),g=de("input",{type:"checkbox"}),m=de("input",{name:"website","aria-hidden":"true",tabindex:"-1",autocomplete:"off",style:"position:absolute;left:-10000px;width:1px;height:1px;opacity:0"}),h=de("p",{class:"atlas-error",role:"alert"});h.hidden=!0;let w=de("button",{class:"atlas-button",type:"submit"},a.submit);return t.showName&&l.append(d),l.append(p),t.requireConsent&&(w.disabled=!0,g.addEventListener("change",()=>{w.disabled=!g.checked}),l.append(de("label",{class:"atlas-field"},g,` ${a.consent}`))),l.append(m,h,w),l.addEventListener("submit",async y=>{var k,R;y.preventDefault();let b=f.value.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(b)){h.textContent=a.invalid,h.hidden=!1;return}w.disabled=!0,h.hidden=!0;let x=await Di(s,{email:b,name:u.value.trim()||void 0,form:t.form,consent:g.checked,website:m.value});x.ok?(n.replaceChildren(de("div",{class:"atlas-card","data-atlas":"lead-form",role:"status"},a.thanks)),(k=t.onSubmitted)==null||k.call(t,b)):(w.disabled=t.requireConsent?!g.checked:!1,h.textContent=(R=x.error)!=null?R:a.failed,h.hidden=!1)}),n.replaceChildren(l),{destroy:()=>n.replaceChildren()}}function Nd(){var t;let e=document.currentScript;return e instanceof HTMLScriptElement?e:(t=document.querySelector("script[data-atlas-key]"))!=null?t:document.querySelector('script[src*="embed.js"]')}function Bd(){Aa(Pa(Nd())),jr(),window.Atlas={mountSignIn:Ia,mountSignUp:Oa,mountOrganizationAdmin:Fa,mountPricingTable:Da,mountLeadForm:La,defineElements:jr}}Bd();})();