PageSourceSearch

https://www.gamedeveloper.com/assets/src-kIyB8UZk.js

js gamedeveloper.com collected 2026-09-24 08:28:17 UTC 94,526 bytes, 65 lines download raw bytes

1import{o as e,t}from"./rolldown-runtime-C0FnF6B9.js";import{a as n}from"./vendor-html-parser-DOJ8foyv.js";import{n as r,t as i}from"./vendor-react-BREUBCH4.js";import{h as a,p as o}from"./vendor-react-router-D-KYiz2C.js";import{Bt as s,Ct as c,Et as l,F as u,L as d,Ut as f,Vt as p,Y as m,Z as h,bt as g,zt as ee}from"./errorBoundary-CheDi6wM.js";import{S as _,v,w as y}from"./src-FD65B_Ks.js";import{C as te,b as ne,d as b,g as re,h as ie,s as ae,u as oe,x as se,y as ce}from"./index.es-CZ6BWE4M.js";var le=function(e){return e.WEBINAR=`webinar`,e.SLIDESHOW=`slideshow`,e.WHITE_PAPER=`white_paper`,e.MULTI_SECTION_ARTICLE=`multi_section_article`,e.VIDEO=`video`,e.ARTICLE=`article`,e.JOURNAL=`journal`,e.RECIPE=`recipe`,e.PODCAST=`podcast`,e.PUBLICATION_ISSUE=`publication_issue`,e.ENHANCED_LIST_LANDING_PAGE=`enhanced_list_landing_page`,e.ENHANCED_LIST_CHILD_PAGE=`enhanced_list_child_page`,e}({}),ue=`download`,de=`read`,fe=`non-gated`,pe=(e,t)=>{if(typeof window>`u`)return;window.scmNotifications=window.scmNotifications??[],window.scmReady=window.scmReady??{};let n={key:e,loggedAt:new Date,...t},r=new CustomEvent(`key`,{detail:n});window.dispatchEvent(r),window.scmNotifications.push(n),window.scmReady[e]=!0},me=()=>{typeof window>`u`||Object.hasOwn(window,`scmNotifications`)||(window.scmNotifications=[],window.scmReady={})},he={Path:{passport:`/iiris-passport/passport-loader.js`,tracker:`/iiris-tracker/v3.0/iris-t.js`,target:`/iiris-target/v4/iiris-target.js`},Base:{prod:`https://widgets.iiris.com`,uat:`https://widgets-uat.iiris.com`,dev:`https://widgets-dev.iiris.com`}},ge=({env:e,type:t})=>{let{Base:n,Path:r}=he;switch(e){case`preview`:return n.dev+r[t];case`prod`:return n.prod+r[t];default:return n.uat+r[t]}},x=e(n()),S=i(),_e=e=>{let t=(0,S.c)(11),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n,{clientIdForELN:i,environment:a}=m.useAuth(),o=r.contentType||ne.SiteRegistration,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=b(),t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=te(r),t[3]=r,t[4]=c);let l;t[5]!==i||t[6]!==r.actionPoint||t[7]!==a||t[8]!==o||t[9]!==c?(l={siteName:i,environment:a,contentType:o,...ce,...s,eventTriggered:c,actionPoint:r.actionPoint},t[5]=i,t[6]=r.actionPoint,t[7]=a,t[8]=o,t[9]=c,t[10]=l):l=t[10];let u=l;return oe(se.SITE_REGISTRATION,u)},ve=[{rel:`stylesheet`,href:`https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css`}],ye=`passport-loader`,be=`identity-script`,xe=`profilemanager-script`,Se=`irisRegisterBtn`,Ce=`irisLoginBtn`,we=`irisLogoutBtn`,Te=`irisReloadBtn`,Ee=`ping_auth_flow`,De=e=>{let t=document.createElement(`script`);t.async=!0,t.addEventListener(`load`,function(){let e=setInterval(()=>{if(window.IIRISTracker&&window.IIRISTracker.initConfig){clearInterval(e),window.IIRISTracker.initConfig({config:{snowplow:{appId:`staging-testautomation.scmdemo.informagt.com`,cDomain:`c-stage.informagt.com`,contentTagEnabled:!1},td:{lob:`im_na`,domain:`informagt`}}});let t=new Event(`trackerLoaded`);window.dispatchEvent(t)}},50);setTimeout(()=>{clearInterval(e)},3e3)}),t.src=ge({env:e==`prod`?`uat`:e,type:`tracker`}),document.head.appendChild(t)},C={state:`ping_state`,codeVerifier:`ping_code_verifier`,redirectUri:`ping_redirect_uri`,returnTo:`ping_return_to`},Oe={user:`scm_ping_user`},w=e(t(((e,t)=>{(function(n){var r;if(typeof define==`function`&&define.amd&&(define(n),r=!0),typeof e==`object`&&(t.exports=n(),r=!0),!r){var i=window.Cookies,a=window.Cookies=n();a.noConflict=function(){return window.Cookies=i,a}}})(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2}
1)+/g,decodeURIComponent)}function n(r){function i(){}function a(t,n,a){if(!(typeof document>`u`)){a=e({path:`/`},i.defaults,a),typeof a.expires==`number`&&(a.expires=new Date(new Date*1+a.expires*864e5)),a.expires=a.expires?a.expires.toUTCString():``;try{var o=JSON.stringify(n);/^[\{\[]/.test(o)&&(n=o)}catch{}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s=``;for(var c in a)a[c]&&(s+=`; `+c,a[c]!==!0&&(s+=`=`+a[c].split(`;`)[0]));return document.cookie=t+`=`+n+s}}function o(e,n){if(!(typeof document>`u`)){for(var i={},a=document.cookie?document.cookie.split(`; `):[],o=0;o<a.length;o++){var s=a[o].split(`=`),c=s.slice(1).join(`=`);!n&&c.charAt(0)===`"`&&(c=c.slice(1,-1));try{var l=t(s[0]);if(c=(r.read||r)(c,l)||t(c),n)try{c=JSON.parse(c)}catch{}if(i[l]=c,e===l)break}catch{}}return e?i[e]:i}}return i.set=a,i.get=function(e){return o(e,!1)},i.getJSON=function(e){return o(e,!0)}
1,i.remove=function(t,n){a(t,``,e(n,{expires:-1}))},i.defaults={},i.withConverter=n,i}return n(function(){})})}))()),ke=e=>{if(typeof e!=`object`||!e)return null;let t={};return h.forEach(n=>{e[n]&&(t[n]=e[n])}),t},Ae={first_name:`first name is required`,last_name:`last name is required`,social_accounts:`social accounts is required when social login is true`};function je(e){let t=[];if(e.first_name||t.push(Ae.first_name),e.last_name||t.push(Ae.last_name),e.is_social_login&&e.is_social_login!==`false`&&!e.social_accounts?.length&&t.push(Ae.social_accounts),t.length)throw Error(t.join())}var T=new class{brand;env;init=(e,t)=>{this.brand=e,this.env=t};scriptLoaded=()=>{d.dispatch(u.auth.scriptLoaded())};userUpdated=(e,t)=>{let n=ke(e.user);t&&v.utils.pushToDataLayer({user:n,_clear:!0,event:_.LOGIN}),d.dispatch(u.auth.updateUser({...e,dataLayerUser:n}))};userPatched=e=>{let{token:t}=d.getState().auth,n=ke(e);d.dispatch(u.auth.updateUser({user:e,dataLayerUser:n,token:t}))};userClear=e=>{let{dataLayerUser:t,user:n}=d.getState().auth;n!==null&&(e&&v.utils.pushToDataLayer({user:t,_clear:!0,event:_.LOGOUT}),d.dispatch(u.auth.clearUser()))};updateAuthFlow=e=>{d.dispatch(u.auth.patch({authFlow:e}))};authenticationStarted=()=>{d.dispatch(u.auth.patch({authenticationPending:!0}))};authenticationFinished=()=>{d.dispatch(u.auth.patch({authenticationPending:!1}))};patch=e=>{d.dispatch(u.auth.patch(e))}};function Me(e){this.message=e}Me.prototype=Error(),Me.prototype.name=`InvalidCharacterError`,typeof window<`u`&&window.atob&&window.atob.bind(window);function Ne(e){this.message=e}Ne.prototype=Error(),Ne.prototype.name=`InvalidTokenError`;var Pe=e=>e?e.startsWith(`Bearer`)?e:`Bearer ${e}`:``,Fe=async({token:e,user:t,withNewsletterPromo:n=!1,onRegisterComplete:r,eln:i})=>{if(t){if(T.userUpdated({withNewsletterPromo:n,user:t,token:e,authFlow:`register`},!0),i)try{await i.putUserRegistration({iirisProfileId:t.id,accessToken:Pe(e)}),r?.()}catch{r?.(ie)}else r?.();T.updateAuthFlow(`login`)}},Ie=({token:e,user:t})=>{t&&T.userUpdated({user:t,token:e,authFlow:`login`},!0)},Le=({success:e,token:t,user:n})=>{e&&n&&t?T.userUpdated({user:n,token:t,authFlow:`login`}):(w.default.remove(`ECOM_USER_SESSION`,{path:`/`}),T.userClear(!1))},Re=({success:e})=>{e&&(w.default.remove(`ECOM_USER_SESSION`,{path:`/`}),T.userClear(!0))},ze=class{baseUrl;brand;iirisBrandConfigId;constructor(e,t,n){this.baseUrl=e,this.brand=t,this.iirisBrandConfigId=n??``}async putUserRegistration({iirisProfileId:e,accessToken:t}){return fetch(`${this.baseUrl}/v1/user-registrations/${e}`,{method:`PUT`,headers:{Authorization:t,"x-site-id":s(this.brand),"x-product-id":this.iirisBrandConfigId},body:JSON.stringify(Ve())})}async patchUserModification({iirisProfileId:e,accessToken:t}){return fetch(`${this.baseUrl}/v1/user-registrations/${e}`,{method:`PATCH`,headers:{Authorization:t,"x-site-id":s(this.brand),"x-product-id":this.iirisBrandConfigId},body:JSON.stringify(Ve())})}async postGatedContentFormData(e){let{userId:t,userEmail:n,contentType:r,contentUid:i,accessToken:a,isBodyGated:o}=e;return fetch(`${this.baseUrl}/v1/gated-content-form-data`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:a||``,"x-site-id":s(this.brand),"x-product-id":this.iirisBrandConfigId},body:JSON.stringify(Be({userEmail:n,userId:t,contentType:r,contentUid:i,isBodyGated:o}))})}};function Be(e){let{userEmail:t,userId:n,contentType:r,contentUid:i,isBodyGated:a}=e;return ae(t,n,r,i,a?de:ue)}function Ve(){let e=w.default.get(`utm_parameters`);return{meta:{tracking:e?e.split(`,`).map(e=>e.split(`:`)).map(([e,t])=>({key:e,value:t})):[]}}}var He=()=>{let e=(0,S.c)(3),t=a(),{pathname:n}=o(),r;return e[0]!==t||e[1]!==n?(r=e=>{t({pathname:n,search:e===void 0?``:e},{preventScrollReset:!0,state:{withSpinner:!0}})},e[0]=t,e[1]=n,e[2]=r):r=e[2],r},Ue=async(e,t=()=>{})=>{try{let n=await We()?.getTaxonomyData(`countries?locale=en`),r;return Array.isArray(n)?r=n.find(t=>t.id===e):n?.data&&(r=n.data.find(t=>t.id===e)),t(r),r}catch(e){console.error(e);return}};function We(){if(typeof window<`u`){let e=window.IIRISProfileMgr;if(!e)throw Error(`The IIRISProfileMgr doesn't exist`);return e}return{}}var Ge=[`referrer`,`withNewsletterPromo`,`withPayment`,`withPromptForConsent`],Ke=`prepared-login`,qe=e=>{if(e){let t={};return Ge.forEach(n=>{f(e,n)&&(t[n]=e[n])}),sessionStorage.setItem(Ke,JSON.stringify(t)),null}let t=sessionStorage.getItem(Ke);return sessionStorage.removeItem(Ke),t?JSON.parse(t):{}},Je=class{attempts=0;retries=0;identityReady=!1;profileReady=!1;source;constructor(e,t){this.source=ge({env:e===`prod`&&t===p.TEST_AUTOMATION?`uat`:e,type:`passport`}),this.attempts=0,this.retries=0,this.identityReady=!1,this.profileReady=!1,e!==`prod`&&(this.logger=e=>{console.log(`%c[iris]: `,`color:orangered`,e)})}script(){let e=document.createElement(`script`);return e.id=ye,e.src=this.source,e.setAttribute(`data-testid`,ye),e}isProfileMgrReady(e=!1){if(this.profileReady)return!0;let t=document.getElementById(xe);if(!t?.id)return!1;let n=typeof window<`u`?window.IIRISProfileMgr:{};return this.profileReady=f(n,`getIIRISProfile`),e&&!this.profileReady&&this.reloadScript(t),this.profileReady}isIdentityReady(e=!1){if(this.identityReady)return!0;let t=document.getElementById(be);if(!t?.id)return!1;let n=document.getElementById(Se)?.id,r=document.getElementById(Te)?.id;return this.identityReady=!!(n||r),e&&!this.identityReady&&this.reloadScript(t),this.identityReady}
1checkReady(){let e=++this.attempts>10;return e&&(this.attempts=0,++this.retries),this.isIdentityReady(e)&&this.isProfileMgrReady(e)}reloadScript(e){if(e?.id){this.logger(`reloading ${e.id}`);let t=e.cloneNode(),n=e.parentElement;e.remove(),n?.appendChild(t)}}root(){return document.getElementById(`script-list`)}logger=()=>{}},E=r(),Ye=e=>{let t=(0,S.c)(5),{env:n}=e,r=(0,x.useRef)(null),{brand:i}=m.useAuth(),a;t[0]!==i||t[1]!==n?(a=()=>{let e=new Je(n,i),t=setInterval(()=>{e.logger(`Interval check: #${e.attempts}`),e.checkReady()&&(e.logger(`Scripts ready`),pe(`IRIS_READY`),T.scriptLoaded(),clearInterval(t)),e.retries>3&&clearInterval(t)},500);return r.current?.appendChild(e.script()),e.logger(`Appended passport`),()=>{clearInterval(t)}},t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],t[3]=o):o=t[3],(0,x.useEffect)(a,o);let s;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,E.jsx)(`div`,{ref:r,id:`script-list`,suppressHydrationWarning:!0}),t[4]=s):s=t[4],s},Xe=(e,t)=>{let n=document.querySelector(e);if(n)return t(n),()=>{};let r=new MutationObserver(()=>{let n=document.querySelector(e);n&&(r.disconnect(),t(n))});r.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>r.disconnect(),2e4);return()=>{r.disconnect(),clearTimeout(i)}};function Ze(){let e=new Uint8Array(32);return crypto.getRandomValues(e),tt(e)}async function Qe(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return tt(new Uint8Array(n))}async function $e(){let e=Ze();return{codeVerifier:e,codeChallenge:await Qe(e)}}function et(){let e=new Uint8Array(32);return crypto.getRandomValues(e),tt(e)}function tt(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}var nt={TOKEN_AUTH_METHOD:`none`,RESPONSE_TYPE:`code`,CODE_CHALLENGE_METHOD:`S256`,ID_TOKEN_API_ENDPOINT:`/api/auth/id-token`,PROFILE_TARGET:`_blank`},rt=`/sso/callback/ping`,it=`/sso/logout/ping`,at=class{authServerConfig=null;client;constructor(e){this.client={client_id:e,token_endpoint_auth_method:`none`}}setAuthServerConfig(e){this.authServerConfig=e}isReady(){return this.authServerConfig!==null}ensureReady(){if(!this.isReady())throw Error(`${this.getAdapterName()} not initialized`)}async login(){this.ensureReady(),await this.startOAuthFlow({promptParam:this.getPromptParam(),promptValue:this.getLoginPromptValue()})}async register(){this.ensureReady(),await this.startOAuthFlow({promptParam:this.getPromptParam(),promptValue:this.getRegisterPromptValue()})}async logout(){if(this.clearOAuthSession(),this.authServerConfig?.endSessionEndpoint&&typeof window<`u`)try{let e=await fetch(nt.ID_TOKEN_API_ENDPOINT);if(!e.ok)throw Error(`Failed to retrieve id_token for logout: ${e.status}`);let t=await e.json();if(t.error)throw Error(`Failed to retrieve id_token for logout: ${t.error}`);let n=new URL(this.authServerConfig.endSessionEndpoint);if(t.idToken)n.searchParams.set(`id_token_hint`,t.idToken);else throw Error(`Failed to retrieve id_token for logout: missing id_token in response`);n.searchParams.set(this.getLogoutRedirectParam(),`${window.location.origin}${this.getLogoutRedirectPath()}`),n.searchParams.set(`client_id`,this.client.client_id),window.location.href=n.toString()}catch(e){console.error(`Error during logout:`,e),window.location.href=this.getLogoutRedirectPath()}}buildAuthorizationUrl(e,t,n){let r=new URL(this.authServerConfig?.authorizationEndpoint||``);return r.searchParams.set(`client_id`,this.client.client_id),r.searchParams.set(`response_type`,nt.RESPONSE_TYPE),r.searchParams.set(`redirect_uri`,this.getRedirectUri()),r.searchParams.set(`scope`,this.getScope()),r.searchParams.set(`state`,t),r.searchParams.set(`code_challenge`,n),r.searchParams.set(`code_challenge_method`,nt.CODE_CHALLENGE_METHOD),e.promptValue&&r.searchParams.set(e.promptParam,e.promptValue),r}async startOAuthFlow(e){if(!this.authServerConfig)throw Error(`Authorization server not initialized`);let{codeVerifier:t,codeChallenge:n}=await $e(),r=et(),i=typeof window<`u`?window.location.pathname+window.location.search:`/`;if(this.saveOAuthSession({state:r,codeVerifier:t,redirectUri:this.getRedirectUri(),returnTo:i}),!this.authServerConfig?.authorizationEndpoint)throw Error(`Authorization server or endpoint not initialized`);let a=this.buildAuthorizationUrl(e,r,n);this.addCustomAuthParams(a);let o=a.toString();window.location.href=o}addCustomAuthParams(e){}};function ot(){return typeof window<`u`&&(window.location.hostname===`localhost`||window.location.hostname===`127.0.0.1`)?``:`Secure; `}function st(e){document.cookie=`${Ee}=${e}; ${ot()}SameSite=Lax; Path=/; Max-Age=600`}function ct(){let e=document.cookie.split(`; `).find(e=>e.startsWith(`${Ee}=`))?.slice(Ee.length+1);return document.cookie=`${Ee}=; Max-Age=0; Path=/`,e===`register`||e===`login`?e:null}var lt=class extends at{config;constructor(e){super(e.clientId),this.config=e}async initialize(){let e=new URL(this.config.authorizationEndpoint).origin;this.setAuthServerConfig({issuer:e,authorizationEndpoint:this.config.authorizationEndpoint,tokenEndpoint:this.config.tokenEndpoint,endSessionEndpoint:this.config.endSessionEndpoint})}getAdapterName(){return`PingOAuthAdapter`}getLogoutRedirectPath(){return it}saveOAuthSession({state:e,codeVerifier:t,redirectUri:n,returnTo:r}){let i=`${ot()}SameSite=Lax; Path=/; Max-Age=600`;document.cookie=`${C.state}=${encodeURIComponent(e)}; ${i}`,document.cookie=`${C.codeVerifier}=${encodeURIComponent(t)}; ${i}`,document.cookie=`${C.redirectUri}=${encodeURIComponent(n)}; ${i}`,document.cookie=`${C.returnTo}=${encodeURIComponent(r)}; ${i}`}getOAuthSession(){let e=l(C.state),t=l(C.codeVerifier),n=l(C.redirectUri);return!e||!t||!n?null:{state:e,codeVerifier:t,redirectUri:n}}clearOAuthSession(){document.cookie=`${C.state}=; Max-Age=0; Path=/`,document.cookie=`${C.codeVerifier}=; Max-Age=0; Path=/`,document.cookie=`${C.redirectUri}=; Max-Age=0; Path=/`,document.cookie=`${C.returnTo}=; Max-Age=0; Path=/`}getRedirectUri(){return typeof window<`u`?`${window.location.origin}${rt}`:this.config.redirectUri}getScope(){return this.config.scope}getPromptParam(){return`prompt`}getLoginPromptValue(){return``}getRegisterPromptValue(){return`create`}getLogoutRedirectParam(){return`post_logout_redirect_uri`}openProfile(){if(!window.open(this.config.profileUri,`_blank`))throw Error(`Profile window was blocked`)}};function ut(e){switch(e.provider){case`ping`:return new lt(e);case`iiris`:throw Error(`IIRIS adapter not yet implemented - use inline IIRIS for now`);default:throw Error(`Unknown auth provider: ${e.provider}`)}}function dt(e){if(!e)return null;try{let t=JSON.parse(decodeURIComponent(e));
1return!t||typeof t.id!=`string`||!t.id?null:{id:t.id,business_email:t.business_email??``,first_name:t.first_name??``,last_name:t.last_name??``}}catch{return null}}function ft(e){return{...e,company:``,country:``,country_name:``,state:``,state_name:``,is_social_login:!1,business_type:``,job_function:``,job_title:``,social_accounts:[],business_types:[],job_functions:[],product_categories:[],metadata:{updated_on:``}}}var pt=async e=>{let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)},D=e=>{v.utils.pushToDataLayer({data:e,_clear:!0,event:_.REGISTRATION},!0)},mt=(0,x.createContext)({}),ht=e=>{let t=(0,S.c)(5),n;t[0]===e?n=t[1]:(n=e.enabled&&e.authenticationConfigId?(0,E.jsx)(gt,{...e}):(0,E.jsx)(mt.Provider,{value:{login:vt,logout:yt,openProfile:bt,register:xt,initRegistrationCallbacks:St,updateUserProfile:Ct},children:e.children}),t[0]=e,t[1]=n);let r;return t[2]!==e.theme||t[3]!==n?(r=(0,E.jsx)(`main`,{"data-theme":e.theme,className:`Provider`,children:n}),t[2]=e.theme,t[3]=n,t[4]=r):r=t[4],r},gt=({children:e,withEln:t,standaloneRegistrationPage:n=!1})=>{let{brand:r,isLoaded:i,environment:o,platformServiceBaseUrl:s,iirisBrandConfigId:u,oAuthConfig:d}=m.useAuth(),f=m.useFeatureToggles().enablePingSSO,[h,ee]=(0,x.useState)(null);(0,x.useEffect)(()=>{if(!f)return;let e=dt(l(Oe.user));if(!e){T.userClear();return}let t=ct()??`login`;T.userUpdated({user:ft(e),authFlow:t})},[f]);let _=()=>f&&d&&d.profileUri?ut({provider:`ping`,...d,profileUri:d.profileUri}):null;(0,x.useEffect)(()=>{let e=_();if(!e){ee(null);return}e.initialize().then(()=>{ee(e)}).catch(e=>{console.error(`Failed to initialize OAuth adapter:`,e),ee(null)})},[f,d]);let v=(0,x.useRef)(void 0),te=a();T.init(r,o);let ne=(0,x.useCallback)(({withPayment:e=!1,withPromptForConsent:t=!1})=>{let n=[];e&&n.push(`redirectToPayment=true`),t&&n.push(`withPromptForConsent=true`),te({pathname:sessionStorage.getItem(`previousURL`)||`/`,search:n.length?`?`+n.join(`&`):void 0},{replace:e,preventScrollReset:!0,state:{withSpinner:!0}})},[]),b=(0,x.useMemo)(()=>t?new ze(s,r,u):void 0,[t,s,r]),ae=async({token:e,user:t,withNewsletterPromo:n,onRegisterComplete:r})=>{if(t){T.userUpdated({withNewsletterPromo:n,user:t,token:e,authFlow:`register`},!0);try{r?.(),await b?.putUserRegistration({iirisProfileId:t.id,accessToken:Pe(e)})}catch{r?.(ie)}T.updateAuthFlow(`login`)}},oe=({token:e,user:t})=>{T.userUpdated({user:t,token:e,authFlow:`login`},!0)},se=(e={})=>{if(i){let{referrer:t=``,withNewsletterPromo:n=!0,withPayment:r=!1,withPromptForConsent:i,isGatedContent:a,isExternalFormFlow:o,contentType:s,isPaidProductTaxonomy:c}=e;te(`/register`,{state:{referrer:t,withPayment:r,withNewsletterPromo:n,withPromptForConsent:i,isGatedContent:a,isExternalFormFlow:o,contentType:s,isPaidProductTaxonomy:c,sourceUrl:window.location.href}})}},ce=(e={})=>{if(i){let{onClose:t,onRegistrationSuccess:n,onLoginSuccess:r,withNewsletterPromo:i=!0,onRegisterComplete:a}=e;T.authenticationStarted();let o=Xe(`.iiris-modal-box .iiris-close-icon`,e=>{e.addEventListener(`click`,e=>{e.isTrusted&&(T.authenticationFinished(),o(),t?.())})});g.module({irisRegisterCallback:async e=>{T.authenticationFinished(),e.success&&e.user?(ae({...e,withNewsletterPromo:i,onRegisterComplete:a}),n?.(e.user)):e.success||a?.(re),o()},irisLoginCallback:e=>{T.authenticationFinished(),e.success&&e.user&&(oe(e),r?.(e.user)),o()}}),document.getElementById(Se)?.click()}};c(()=>{r===p.TEST_AUTOMATION&&De(o),g.module({irisProfileMgrCallback:({success:e,token:t,user:n})=>{e&&n&&t?T.userUpdated({user:n,token:t,authFlow:`login`}):(w.default.remove(`ECOM_USER_SESSION`,{path:`/`}),T.userClear(!1))},scmBusinessEvtCallback:async(e,t)=>{let{business_email:n,email:r,id:i=``}=t.metadata?JSON.parse(t.metadata):{},{formId:a}=e,o=a===`registration`&&e.status.includes(`dropout`),s=n||r,c=s?await pt(s):``,l=e=>({name:v.current||``,user_id:i,email_hashed:c,email:s,capture_tool:`IIRIS`,status:e});a===`registration`&&!o&&D(l(y.SUCCESS)),a===`progressive`&&D(l(y.REG_ADDITIONAL_INFO))},irisLogoutCallback:({success:e})=>{e&&(w.default.remove(`ECOM_USER_SESSION`,{path:`/`}),T.userClear(!0))}})},[]);let le=(0,x.useMemo)(()=>({updateUserProfile:async(e,t)=>{je(t);let n=(await We()?.setIIRISProfile(t))?.data?.pop();b&&await b.patchUserModification(e),n&&T.userPatched(n)},initRegistrationCallbacks:({referrer:e,withNewsletterPromo:t,withPayment:n,withPromptForConsent:r,onRegisterComplete:i})=>{v.current=e,g.module({irisRegisterCallback:async e=>{e.success&&e.user?(ae({...e,withNewsletterPromo:t,onRegisterComplete:i}),ne({withPayment:n,withPromptForConsent:r})):e.success||i?.(re)},irisLoginCallback:e=>{e.success&&e.user&&(oe(e),ne({withPayment:n,withPromptForConsent:r}))}})},register:e=>{if(h&&h.isReady()){st(`register`),h.register();return}v.current=e?.referrer,D({name:e?.referrer,status:y.ATTEMPT}),(n?se:ce)(e)},login:(e={})=>
1{if(h&&h.isReady()){st(`login`),h.login();return}if(i){qe(e);let{onRegistrationSuccess:t,onLoginSuccess:n,withNewsletterPromo:r=!0,onRegisterComplete:i}=e;T.authenticationStarted();let a=Xe(`.iiris-modal-box .iiris-close-icon`,e=>{e.addEventListener(`click`,e=>{e.isTrusted&&(T.authenticationFinished(),a())})});g.module({irisRegisterCallback:async e=>{T.authenticationFinished(),e.success&&e.user?(ae({...e,withNewsletterPromo:r,onRegisterComplete:i}),t?.(e.user)):e.success||i?.(re),a()},irisLoginCallback:e=>{T.authenticationFinished(),e.success&&e.user&&(oe(e),n?.(e.user)),a()}}),document.getElementById(Ce)?.click()}},logout:()=>{if(T.userClear(!0),h&&h.isReady()){h.logout();return}if(f){window.location.href=it;return}document.getElementById(we)?.click()},openProfile:()=>{if(h&&h.isReady()){h.openProfile?.();return}},eln:b}),[i,b,h,f,d]);return(0,E.jsxs)(mt.Provider,{value:le,children:[e,!f&&(0,E.jsx)(Ye,{env:o})]})},_t=()=>(0,x.useContext)(mt);function vt(){return!0}function yt(){return!0}function bt(){return!0}function xt(){return!0}function St(){return!0}async function Ct(){}var wt=e=>{let t=(0,S.c)(2),n;return t[0]===e?n=t[1]:(n=(0,E.jsx)(`div`,{id:`iiris-identity`,suppressHydrationWarning:!0,"data-testid":`iris-identity`,...e}),t[0]=e,t[1]=n),n},Tt=function(e,t){var n=(0,x.useRef)(function(){});(0,x.useEffect)(function(){n.current=e}),(0,x.useEffect)(function(){if(t!==null){var e=setInterval(function(){return n.current()},t||0);return function(){return clearInterval(e)}}},[t])};function Et(e){let t=(0,S.c)(9),{check:n,intervalMs:r,maxAttempts:i}=e,a=r===void 0?100:r,o=i===void 0?100:i,s;t[0]===n?s=t[1]:(s=()=>typeof window>`u`?!1:n(),t[0]=n,t[1]=s);let[c,l]=(0,x.useState)(s),u=(0,x.useRef)(0),[d,f]=(0,x.useState)(void 0),p;t[2]!==n||t[3]!==a||t[4]!==o?(p=()=>{if(n()){l(!0);return}u.current+=1,u.current>=o&&f(`Condition not met after ${o*a/1e3} seconds`)},t[2]=n,t[3]=a,t[4]=o,t[5]=p):p=t[5],Tt(p,c||d?null:a);let m;return t[6]!==d||t[7]!==c?(m={isReady:c,error:d},t[6]=d,t[7]=c,t[8]=m):m=t[8],m}var Dt;function O(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var k=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ot=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Dt=globalThis).__zod_globalConfig??(Dt.__zod_globalConfig={});var kt=globalThis.__zod_globalConfig;function A(e){return e&&Object.assign(kt,e),kt}function At(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function jt(e,t){return typeof t==`bigint`?t.toString():t}function Mt(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Nt(e){return e==null}function Pt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ft(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var It=Symbol(`evaluating`);function j(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==It)return r===void 0&&(r=It,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function M(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function N(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Lt(e){return JSON.stringify(e)}function Rt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var zt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Bt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Vt=Mt(()=>{if(kt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function P(e){if(Bt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Bt(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ht(e){return P(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Ut=new Set([`string`,`number`,`symbol`]);function F(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function I(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function L(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Wt(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Gt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Kt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return I(e,N(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return M(this,`shape`,e),e},checks:[]}))}function qt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return I(e,N(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return M(this,`shape`,r),r},checks:[]}))}function Jt(e,t){if(!P(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot over
1write keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return I(e,N(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return M(this,`shape`,n),n}}))}function Yt(e,t){if(!P(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return I(e,N(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return M(this,`shape`,n),n}}))}function Xt(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return I(e,N(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return M(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Zt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return I(t,N(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return M(this,`shape`,i),i},checks:[]}))}function Qt(e,t,n){return I(t,N(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return M(this,`shape`,i),i}}))}function R(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function $t(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function en(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function tn(e){return typeof e==`string`?e:e?.message}function z(e,t,n){let r=e.message?e.message:tn(e.inst?._zod.def?.error?.(e))??tn(t?.error?.(e))??tn(n.customError?.(e))??tn(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function nn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function B(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var rn=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,jt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},an=O(`$ZodError`,rn),on=O(`$ZodError`,rn,{Parent:Error});function sn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function cn(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var ln=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new k;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>z(e,a,A())));throw zt(t,i?.callee),t}return o.value},un=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>z(e,a,A())));throw zt(t,i?.callee),t}return o.value},dn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new k;return a.issues.length?{success:!1,error:new(e??an)(a.issues.map(e=>z(e,i,A())))}:{success:!0,data:a.value}}
1,fn=dn(on),pn=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>z(e,i,A())))}:{success:!0,data:a.value}},mn=pn(on),hn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ln(e)(t,n,i)},gn=e=>(t,n,r)=>ln(e)(t,n,r),_n=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return un(e)(t,n,i)},vn=e=>async(t,n,r)=>un(e)(t,n,r),yn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dn(e)(t,n,i)},bn=e=>(t,n,r)=>dn(e)(t,n,r),xn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return pn(e)(t,n,i)},Sn=e=>async(t,n,r)=>pn(e)(t,n,r),Cn=/^[cC][0-9a-z]{6,}$/,wn=/^[0-9a-z]+$/,Tn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,En=/^[0-9a-vA-V]{20}$/,Dn=/^[A-Za-z0-9]{27}$/,On=/^[a-zA-Z0-9_-]{21}$/,kn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,An=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Mn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Nn=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Pn(){return new RegExp(Nn,`u`)}var Fn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,In=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ln=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Rn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bn=/^[A-Za-z0-9_-]*$/,Vn=/^https?$/,Hn=/^\+[1-9]\d{6,14}$/,Un=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Wn=RegExp(`^${Un}$`);function Gn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kn(e){return RegExp(`^${Gn(e)}$`)}function qn(e){let t=Gn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Un}T(?:${r})$`)}var Jn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yn=/^-?\d+$/,Xn=/^-?\d+(?:\.\d+)?$/,Zn=/^(?:true|false)$/i,Qn=/^[^A-Z]*$/,$n=/^[^a-z]*$/,V=O(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),er={number:`number`,bigint:`bigint`,object:`date`},tr=O(`$ZodCheckLessThan`,(e,t)=>{V.init(e,t);let n=er[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nr=O(`$ZodCheckGreaterThan`,(e,t)=>{V.init(e,t);let n=er[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rr=O(`$ZodCheckMultipleOf`,(e,t)=>{V.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Ft(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ir=O(`$ZodCheckNumberFormat`,(e,t)=>{V.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Gt[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>
10?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ar=O(`$ZodCheckMaxLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Nt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=nn(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),or=O(`$ZodCheckMinLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Nt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=nn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sr=O(`$ZodCheckLengthEquals`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Nt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=nn(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),cr=O(`$ZodCheckStringFormat`,(e,t)=>{var n,r;V.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),lr=O(`$ZodCheckRegex`,(e,t)=>{cr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ur=O(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Qn,cr.init(e,t)}),dr=O(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=$n,cr.init(e,t)}),fr=O(`$ZodCheckIncludes`,(e,t)=>{V.init(e,t);let n=F(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),pr=O(`$ZodCheckStartsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`^${F(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mr=O(`$ZodCheckEndsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`.*${F(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),hr=O(`$ZodCheckOverwrite`,(e,t)=>{V.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),gr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>`  ${e}`)];return new e(...t,n.join(`
3`))}},_r={major:4,minor:4,patch:3},H=O(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_r;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=R(e),i;for(let a of t){if(a._zod.def.when){if($t(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new k;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=R(e,t))});else{if(e.issues.length===t)continue;r||=R(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>
3{if(R(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new k;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new k;return o.then(e=>t(e,r,a))}return t(o,r,a)}}j(e,`~standard`,()=>({validate:t=>{try{let n=fn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return mn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),vr=O(`$ZodString`,(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Jn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),U=O(`$ZodStringFormat`,(e,t)=>{cr.init(e,t),vr.init(e,t)}),yr=O(`$ZodGUID`,(e,t)=>{t.pattern??=An,U.init(e,t)}),br=O(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=jn(e)}else t.pattern??=jn();U.init(e,t)}),xr=O(`$ZodEmail`,(e,t)=>{t.pattern??=Mn,U.init(e,t)}),Sr=O(`$ZodURL`,(e,t)=>{U.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Vn.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Cr=O(`$ZodEmoji`,(e,t)=>{t.pattern??=Pn(),U.init(e,t)}),wr=O(`$ZodNanoID`,(e,t)=>{t.pattern??=On,U.init(e,t)}),Tr=O(`$ZodCUID`,(e,t)=>{t.pattern??=Cn,U.init(e,t)}),Er=O(`$ZodCUID2`,(e,t)=>{t.pattern??=wn,U.init(e,t)}),Dr=O(`$ZodULID`,(e,t)=>{t.pattern??=Tn,U.init(e,t)}),Or=O(`$ZodXID`,(e,t)=>{t.pattern??=En,U.init(e,t)}),kr=O(`$ZodKSUID`,(e,t)=>{t.pattern??=Dn,U.init(e,t)}),Ar=O(`$ZodISODateTime`,(e,t)=>{t.pattern??=qn(t),U.init(e,t)}),jr=O(`$ZodISODate`,(e,t)=>{t.pattern??=Wn,U.init(e,t)}),Mr=O(`$ZodISOTime`,(e,t)=>{t.pattern??=Kn(t),U.init(e,t)}),Nr=O(`$ZodISODuration`,(e,t)=>{t.pattern??=kn,U.init(e,t)}),Pr=O(`$ZodIPv4`,(e,t)=>{t.pattern??=Fn,U.init(e,t),e._zod.bag.format=`ipv4`}),Fr=O(`$ZodIPv6`,(e,t)=>{t.pattern??=In,U.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ir=O(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ln,U.init(e,t)}),Lr=O(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Rn,U.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Rr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var zr=O(`$ZodBase64`,(e,t)=>{t.pattern??=zn,U.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Rr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Br(e){if(!Bn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Rr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Vr=O(`$ZodBase64URL`,(e,t)=>{t.pattern??=Bn,U.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Br(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Hr=O(`$ZodE164`,(e,t)=>{t.pattern??=Hn,U.init(e,t)});function Ur(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Wr=O(`$ZodJWT`,(e,t)=>{U.init(e,t),e._zod.check=n=>{Ur(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Gr=O(`$ZodNumber`,(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Kr=O(`$ZodNumberFormat`,(e,t)=>{ir.init(e,t),Gr.init(e,t)}
3),qr=O(`$ZodBoolean`,(e,t)=>{H.init(e,t),e._zod.pattern=Zn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Jr=O(`$ZodUnknown`,(e,t)=>{H.init(e,t),e._zod.parse=e=>e}),Yr=O(`$ZodNever`,(e,t)=>{H.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Xr(e,t,n){e.issues.length&&t.issues.push(...en(n,e.issues)),t.value[n]=e.value}var Zr=O(`$ZodArray`,(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Xr(t,n,e))):Xr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Qr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...en(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function $r(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Wt(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ei(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Qr(e,n,i,t,u,d))):Qr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var ti=O(`$ZodObject`,(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Mt(()=>$r(t));j(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Bt,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Qr(n,t,e,s,r,i))):Qr(a,t,e,s,r,i)}return i?ei(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ni=O(`$ZodObjectJIT`,(e,t)=>{ti.init(e,t);let n=e._zod.parse,r=Mt(()=>$r(t)),i=e=>{let t=new gr([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Lt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Lt(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
4        if (${n}.issues.length) {
5          if (${o} in input) {
6            payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
7              ...iss,
8              path: iss.path ? [${o}, ...iss.path] : [${o}]
9            })));
10          }
11        }
12        
13        if (${n}.value === undefined) {
14          if (${o} in input) {
15            newResult[${o}] = undefined;
16          }
17        } else {
18          newResult[${o}] = ${n}.value;
19        }
20        
21      `):c?t.write(`
22        if (${n}.issues.length) {
23          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
24            ...iss,
25            path: iss.path ? [${o}, ...iss.path] : [${o}]
26          })));
27        }
28        
29        if (${n}.value === undefined) {
30          if (${o} in input) {
31            newResult[${o}] = undefined;
32          }
33        } else {
34          newResult[${o}] = ${n}.value;
35        }
36        
37      `):t.write(`
38        const ${n}_present = ${o} in input;
39        if (${n}.issues.length) {
40          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
41            ...iss,
42            path: iss.path ? [${o}, ...iss.path] : [${o}]
43          })));
44        }
45        if (!${n}_present && !${n}.issues.length) {
46          payload.issues.push({
47            code: "invalid_type",
48            expected: "nonoptional",
49            input: undefined,
50            path: [${o}]
51          });
52        }
53
54        if (${n}_present) {
55          if (${n}.value === undefined) {
56            newResult[${o}] = undefined;
57          } else {
58            newResult[${o}] = ${n}.value;
59          }
60        }
61
62      `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Bt,s=!kt.jitless,c=s&&Vt.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?ei([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ri(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!R(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>z(e,r,A())))}),t)}var ii=O(`$ZodUnion`,(e,t)=>{H.init(e,t),j(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),j(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),j(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),j(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Pt(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ri(t,r,e,i)):ri(o,r,e,i)}}),ai=O(`$ZodIntersection`,(e,t)=>{H.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>si(e,t,n)):si(e,i,a)}});function oi(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(P(e)&&P(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=oi(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=oi(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function si(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),R(e))return e;let o=oi(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var ci=O(`$ZodEnum`,(e,t)=>{H.init(e,t);let n=At(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ut.has(typeof e)).map(e=>typeof e==`string`?F(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),li=O(`$ZodLiteral`,(e,t)=>{if(H.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?F(e):e?F(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ui=O(`$ZodTransform`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ot(e.constructor.name);
vendor: 6,553 bytes, line 62
62let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new k;return n.value=i,n.fallback=!0,n}});function di(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var fi=O(`$ZodOptional`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,j(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),j(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Pt(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>di(e,r)):di(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),pi=O(`$ZodExactOptional`,(e,t)=>{fi.init(e,t),j(e._zod,`values`,()=>t.innerType._zod.values),j(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),mi=O(`$ZodNullable`,(e,t)=>{H.init(e,t),j(e._zod,`optin`,()=>t.innerType._zod.optin),j(e._zod,`optout`,()=>t.innerType._zod.optout),j(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Pt(e.source)}|null)$`):void 0}),j(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),hi=O(`$ZodDefault`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,j(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>gi(e,t)):gi(r,t)}});function gi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var _i=O(`$ZodPrefault`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,j(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),vi=O(`$ZodNonOptional`,(e,t)=>{H.init(e,t),j(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>yi(t,e)):yi(i,e)}});function yi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var bi=O(`$ZodCatch`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,j(e._zod,`optout`,()=>t.innerType._zod.optout),j(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>z(e,n,A()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>z(e,n,A()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),xi=O(`$ZodPipe`,(e,t)=>{H.init(e,t),j(e._zod,`values`,()=>t.in._zod.values),j(e._zod,`optin`,()=>t.in._zod.optin),j(e._zod,`optout`,()=>t.out._zod.optout),j(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Si(e,t.in,n)):Si(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Si(e,t.out,n)):Si(r,t.out,n)}});function Si(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Ci=O(`$ZodReadonly`,(e,t)=>{H.init(e,t),j(e._zod,`propValues`,()=>t.innerType._zod.propValues),j(e._zod,`values`,()=>t.innerType._zod.values),j(e._zod,`optin`,()=>t.innerType?._zod?.optin),j(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(wi):wi(r)}});function wi(e){return e.value=Object.freeze(e.value),e}var Ti=O(`$ZodCustom`,(e,t)=>{V.init(e,t),H.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ei(t,n,r,e));Ei(i,n,r,e)}});function Ei(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(B(e))}}var Di,Oi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ki(){return new Oi}(Di=globalThis).__zod_globalRegistry??(Di.__zod_globalRegistry=ki());var Ai=globalThis.__zod_globalRegistry;function ji(e,t){return new e({type:`string`,...L(t)})}function Mi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...L(t)})}function Ni(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...L(t)})}function Pi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...L(t)})}function Fi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...L(t)})}function Ii(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...L(t)})}function Li(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...L(t)})}function Ri(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...L(t)})}function zi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...L(t)})}function Bi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...L(t)})}function Vi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...L(t)})}function Hi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...L(t)})}function Ui(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...L(t)})}function Wi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...L(t)})}
vendor: 3,593 bytes, line 62
62function Gi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...L(t)})}function Ki(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...L(t)})}function qi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...L(t)})}function Ji(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...L(t)})}function Yi(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...L(t)})}function Xi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...L(t)})}function Zi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...L(t)})}function Qi(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...L(t)})}function $i(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...L(t)})}function ea(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...L(t)})}function ta(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...L(t)})}function na(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...L(t)})}function ra(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...L(t)})}function ia(e,t){return new e({type:`number`,checks:[],...L(t)})}function aa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...L(t)})}function oa(e,t){return new e({type:`boolean`,...L(t)})}function sa(e){return new e({type:`unknown`})}function ca(e,t){return new e({type:`never`,...L(t)})}function la(e,t){return new tr({check:`less_than`,...L(t),value:e,inclusive:!1})}function ua(e,t){return new tr({check:`less_than`,...L(t),value:e,inclusive:!0})}function da(e,t){return new nr({check:`greater_than`,...L(t),value:e,inclusive:!1})}function fa(e,t){return new nr({check:`greater_than`,...L(t),value:e,inclusive:!0})}function pa(e,t){return new rr({check:`multiple_of`,...L(t),value:e})}function ma(e,t){return new ar({check:`max_length`,...L(t),maximum:e})}function ha(e,t){return new or({check:`min_length`,...L(t),minimum:e})}function ga(e,t){return new sr({check:`length_equals`,...L(t),length:e})}function _a(e,t){return new lr({check:`string_format`,format:`regex`,...L(t),pattern:e})}function va(e){return new ur({check:`string_format`,format:`lowercase`,...L(e)})}function ya(e){return new dr({check:`string_format`,format:`uppercase`,...L(e)})}function ba(e,t){return new fr({check:`string_format`,format:`includes`,...L(t),includes:e})}function xa(e,t){return new pr({check:`string_format`,format:`starts_with`,...L(t),prefix:e})}function Sa(e,t){return new mr({check:`string_format`,format:`ends_with`,...L(t),suffix:e})}function W(e){return new hr({check:`overwrite`,tx:e})}function Ca(e){return W(t=>t.normalize(e))}function wa(){return W(e=>e.trim())}function Ta(){return W(e=>e.toLowerCase())}function Ea(){return W(e=>e.toUpperCase())}function Da(){return W(e=>Rt(e))}function Oa(e,t,n){return new e({type:`array`,element:t,...L(n)})}function ka(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...L(n)})}function Aa(e,t){let n=ja(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(B(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(B(r))}},e(t.value,t)),t);return n}function ja(e,t){let n=new V({check:`custom`,...L(t)});return n._zod.check=e,n}function Ma(e){let t=e?.target??`draft-2020-12`;
62return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ai,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function G(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,G(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&K(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Na(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
63
64Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Pa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>
640&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ia(t,`input`,e.processors),output:Ia(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function K(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return K(r.element,n);if(r.type===`set`)return K(r.valueType,n);if(r.type===`lazy`)return K(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return K(r.innerType,n);if(r.type===`intersection`)return K(r.left,n)||K(r.right,n);if(r.type===`record`||r.type===`map`)return K(r.keyType,n)||K(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:K(r.in,n)||K(r.out,n);if(r.type===`object`){for(let e in r.shape)if(K(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(K(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(K(e,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}var Fa=(e,t={})=>n=>{let r=Ma({...n,processors:t});return G(e,r),Na(r,e),Pa(r,e)},Ia=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ma({...i??{},target:a,io:t,processors:n});return G(e,o),Na(o,e),Pa(o,e)},La={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ra=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=La[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},za=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Ba=(e,t,n,r)=>{n.type=`boolean`},Va=(e,t,n,r)=>{n.not={}},Ha=(e,t,n,r)=>{let i=e._zod.def,a=At(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ua=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Wa=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ga=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=G(a.element,t,{...r,path:[...r.path,`items`]})},qa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=G(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>
640&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=G(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ja=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>G(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ya=(e,t,n,r)=>{let i=e._zod.def,a=G(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=G(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Xa=(e,t,n,r)=>{let i=e._zod.def,a=G(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Za=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Qa=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},$a=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},eo=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},to=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;G(o,t,r);let s=t.seen.get(e);s.ref=o},no=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ro=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},io=O(`ZodISODateTime`,(e,t)=>{Ar.init(e,t),X.init(e,t)});function ao(e){return ea(io,e)}var oo=O(`ZodISODate`,(e,t)=>{jr.init(e,t),X.init(e,t)});function so(e){return ta(oo,e)}var co=O(`ZodISOTime`,(e,t)=>{Mr.init(e,t),X.init(e,t)});function lo(e){return na(co,e)}var uo=O(`ZodISODuration`,(e,t)=>{Nr.init(e,t),X.init(e,t)});function fo(e){return ra(uo,e)}var q=O(`ZodError`,(e,t)=>{an.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>cn(e,t)},flatten:{value:t=>sn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,jt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,jt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),po=ln(q),mo=un(q),ho=dn(q),go=pn(q),_o=hn(q),vo=gn(q),yo=_n(q),bo=vn(q),xo=yn(q),So=bn(q),Co=xn(q),wo=Sn(q),To=new WeakMap;function Eo(e,t,n){let r=Object.getPrototypeOf(e),i=To.get(r);if(i||(i=new Set,To.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var J=O(`ZodType`,(e,t)=>(H.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ia(e,`input`),output:Ia(e,`output`)}}),e.toJSONSchema=Fa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>po(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ho(e,t,n),e.parseAsync=async(t,n)=>mo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>go(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>_o(e,t,n),e.decode=(t,n)=>vo(e,t,n),e.encodeAsync=async(t,n)=>yo(e,t,n),e.decodeAsync=async(t,n)=>bo(e,t,n),e.safeEncode=(t,n)=>xo(e,t,n),e.safeDecode=(t,n)=>So(e,t,n),e.safeEncodeAsync=async(t,n)=>Co(e,t,n),e.safeDecodeAsync=async(t,n)=>wo(e,t,n),Eo(e,`ZodType`,{check(...e){let t=this.def;return this.clone(N(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return I(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Rs(e,t))},superRefine(e,t){return this.check(zs(e,t))},overwrite(e){return this.check(W(e))},optional(){return bs(this)},exactOptional(){return Ss(this)},nullable(){return ws(this)},nullish(){return bs(ws(this))},nonoptional(e){return As(this,e)},array(){return Z(this)},or(e){return us([this,e])},and(e){return fs(this,e)},transform(e){return Ps(this,vs(e))},default(e){return Es(this,e)},prefault(e){return Os(this,e)},catch(e){return Ms(this,e)},pipe(e){return Ps(this,e)},readonly(){return Is(this)},describe(e){let t=this.clone();return Ai.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ai.get(this);let t=this.clone();return Ai.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Ai.get(e)?.description},configurable:!0}),e)),Do=O(`_ZodString`,(e,t)=>{vr.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Eo(e,`_ZodString`,{regex(...e){return this.check(_a(...e))},includes(...e){return this.check(ba(...e))},startsWith(...e){return this.check(xa(...e))},endsWith(...e){return this.check(Sa(...e))},min(...e){return this.check(ha(...e))},max(...e){return this.check(ma(...e))},length(...e){return this.check(ga(...e))},nonempty(...e){return this.check(ha(1,...e))},lowercase(e){return this.check(va(e))},uppercase(e){return this.check(ya(e))},trim(){return this.check(wa())},normalize(...e){return this.check(Ca(...e))},toLowerCase(){return this.check(Ta())},toUpperCase(){return this.check(Ea())},slugify(){return this.check(Da())}})}),Oo=O(`ZodString`,(e,t)=>{vr.init(e,t),Do.init(e,t),e.email=t=>e.check(Mi(ko,t)),e.url=t=>e.check(Ri(No,t)),e.jwt=t=>e.check($i(Yo,t)),e.emoji=t=>e.check(zi(Fo,t)),e.guid=t=>e.check(Ni(jo,t)),e.uuid=t=>e.check(Pi(Mo,t)),e.uuidv4=t=>e.check(Fi(Mo,t)),e.uuidv6=t=>e.check(Ii(Mo,t)),e.uuidv7=t=>e.check(Li(Mo,t)),e.nanoid=t=>e.check(Bi(Io,t)),e.guid=t=>e.check(Ni(jo,t)),e.cuid=t=>e.check(Vi(Lo,t)),e.cuid2=t=>e.check(Hi(Ro,t)),e.ulid=t=>e.check(Ui(zo,t)),e.base64=t=>e.check(Xi(Ko,t)),e.base64url=t=>e.check(Zi(qo,t)),e.xid=t=>e.check(Wi(Bo,t)),e.ksuid=t=>e.check(Gi(Vo,t)),e.ipv4=t=>e.check(Ki(Ho,t)),e.ipv6=t=>e.check(qi(Uo,t)),e.cidrv4=t=>e.check(Ji(Wo,t)),e.cidrv6=t=>e.check(Yi(Go,t)),e.e164=t=>e.check(Qi(Jo,t)),e.datetime=t=>e.check(ao(t)),e.date=t=>e.check(so(t)),e.time=t=>e.check(lo(t)),e.duration=t=>e.check(fo(t))});function Y(e){return ji(Oo,e)}var X=O(`ZodStringFormat`,(e,t)=>{U.init(e,t),Do.init(e,t)}),ko=O(`ZodEmail`,(e,t)=>{xr.init(e,t),X.init(e,t)});function Ao(e){return Mi(ko,e)}
64var jo=O(`ZodGUID`,(e,t)=>{yr.init(e,t),X.init(e,t)}),Mo=O(`ZodUUID`,(e,t)=>{br.init(e,t),X.init(e,t)}),No=O(`ZodURL`,(e,t)=>{Sr.init(e,t),X.init(e,t)});function Po(e){return Ri(No,e)}var Fo=O(`ZodEmoji`,(e,t)=>{Cr.init(e,t),X.init(e,t)}),Io=O(`ZodNanoID`,(e,t)=>{wr.init(e,t),X.init(e,t)}),Lo=O(`ZodCUID`,(e,t)=>{Tr.init(e,t),X.init(e,t)}),Ro=O(`ZodCUID2`,(e,t)=>{Er.init(e,t),X.init(e,t)}),zo=O(`ZodULID`,(e,t)=>{Dr.init(e,t),X.init(e,t)}),Bo=O(`ZodXID`,(e,t)=>{Or.init(e,t),X.init(e,t)}),Vo=O(`ZodKSUID`,(e,t)=>{kr.init(e,t),X.init(e,t)}),Ho=O(`ZodIPv4`,(e,t)=>{Pr.init(e,t),X.init(e,t)}),Uo=O(`ZodIPv6`,(e,t)=>{Fr.init(e,t),X.init(e,t)}),Wo=O(`ZodCIDRv4`,(e,t)=>{Ir.init(e,t),X.init(e,t)}),Go=O(`ZodCIDRv6`,(e,t)=>{Lr.init(e,t),X.init(e,t)}),Ko=O(`ZodBase64`,(e,t)=>{zr.init(e,t),X.init(e,t)}),qo=O(`ZodBase64URL`,(e,t)=>{Vr.init(e,t),X.init(e,t)}),Jo=O(`ZodE164`,(e,t)=>{Hr.init(e,t),X.init(e,t)}),Yo=O(`ZodJWT`,(e,t)=>{Wr.init(e,t),X.init(e,t)}),Xo=O(`ZodNumber`,(e,t)=>{Gr.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r),Eo(e,`ZodNumber`,{gt(e,t){return this.check(da(e,t))},gte(e,t){return this.check(fa(e,t))},min(e,t){return this.check(fa(e,t))},lt(e,t){return this.check(la(e,t))},lte(e,t){return this.check(ua(e,t))},max(e,t){return this.check(ua(e,t))},int(e){return this.check($o(e))},safe(e){return this.check($o(e))},positive(e){return this.check(da(0,e))},nonnegative(e){return this.check(fa(0,e))},negative(e){return this.check(la(0,e))},nonpositive(e){return this.check(ua(0,e))},multipleOf(e,t){return this.check(pa(e,t))},step(e,t){return this.check(pa(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Zo(e){return ia(Xo,e)}var Qo=O(`ZodNumberFormat`,(e,t)=>{Kr.init(e,t),Xo.init(e,t)});function $o(e){return aa(Qo,e)}var es=O(`ZodBoolean`,(e,t)=>{qr.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function ts(e){return oa(es,e)}var ns=O(`ZodUnknown`,(e,t)=>{Jr.init(e,t),J.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rs(){return sa(ns)}var is=O(`ZodNever`,(e,t)=>{Yr.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r)});function as(e){return ca(is,e)}var os=O(`ZodArray`,(e,t)=>{Zr.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e.element=t.element,Eo(e,`ZodArray`,{min(e,t){return this.check(ha(e,t))},nonempty(e){return this.check(ha(1,e))},max(e,t){return this.check(ma(e,t))},length(e,t){return this.check(ga(e,t))},unwrap(){return this.element}})});function Z(e,t){return Oa(os,e,t)}var ss=O(`ZodObject`,(e,t)=>{ni.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),j(e,`shape`,()=>t.shape),Eo(e,`ZodObject`,{keyof(){return ms(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:rs()})},loose(){return this.clone({...this._zod.def,catchall:rs()})},strict(){return this.clone({...this._zod.def,catchall:as()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Jt(this,e)},safeExtend(e){return Yt(this,e)},merge(e){return Xt(this,e)},pick(e){return Kt(this,e)},omit(e){return qt(this,e)},partial(...e){return Zt(ys,this,e[0])},required(...e){return Qt(ks,this,e[0])}})});function Q(e,t){return new ss({type:`object`,shape:e??{},...L(t)})}function cs(e,t){return new ss({type:`object`,shape:e,catchall:rs(),...L(t)})}var ls=O(`ZodUnion`,(e,t)=>{ii.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),e.options=t.options});function us(e,t){return new ls({type:`union`,options:e,...L(t)})}var ds=O(`ZodIntersection`,(e,t)=>{ai.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r)});function fs(e,t){return new ds({type:`intersection`,left:e,right:t})}var ps=O(`ZodEnum`,(e,t)=>{ci.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ps({...t,checks:[],...L(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ps({...t,checks:[],...L(r),entries:i})}});function ms(e,t){return new ps({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}var hs=O(`ZodLiteral`,(e,t)=>{li.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if
64(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gs(e,t){return new hs({type:`literal`,values:Array.isArray(e)?e:[e],...L(t)})}var _s=O(`ZodTransform`,(e,t)=>{ui.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ot(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(B(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(B(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function vs(e){return new _s({type:`transform`,transform:e})}var ys=O(`ZodOptional`,(e,t)=>{fi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bs(e){return new ys({type:`optional`,innerType:e})}var xs=O(`ZodExactOptional`,(e,t)=>{pi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ss(e){return new xs({type:`optional`,innerType:e})}var Cs=O(`ZodNullable`,(e,t)=>{mi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ws(e){return new Cs({type:`nullable`,innerType:e})}var Ts=O(`ZodDefault`,(e,t)=>{hi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Es(e,t){return new Ts({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ht(t)}})}var Ds=O(`ZodPrefault`,(e,t)=>{_i.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Os(e,t){return new Ds({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ht(t)}})}var ks=O(`ZodNonOptional`,(e,t)=>{vi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function As(e,t){return new ks({type:`nonoptional`,innerType:e,...L(t)})}var js=O(`ZodCatch`,(e,t)=>{bi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ms(e,t){return new js({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ns=O(`ZodPipe`,(e,t)=>{xi.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.in=t.in,e.out=t.out});function Ps(e,t){return new Ns({type:`pipe`,in:e,out:t})}var Fs=O(`ZodReadonly`,(e,t)=>{Ci.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Is(e){return new Fs({type:`readonly`,innerType:e})}var Ls=O(`ZodCustom`,(e,t)=>{Ti.init(e,t),J.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function Rs(e,t={}){return ka(Ls,e,t)}function zs(e,t){return Aa(e,t)}var $=()=>Y().nullish().transform(e=>e??``),Bs=Q({social_type:Y(),social_email:Ao()}),Vs=Q({id:Y(),division:Y(),brand:Y()}),Hs=Q({id:Y(),division:Y(),brand:Y()}),Us=Q({categories:Z(Q({id:Y(),name:Y()})),division:Y(),brand:Y()}),Ws=Q({updated_on:Y()}),Gs=cs({id:Y(),business_email:Ao(),first_name:Y(),last_name:$(),company:$(),country:$(),country_name:$(),state:$(),state_name:$(),is_social_login:ts().default(!1),business_type:$(),job_function:$(),job_title:$(),social_accounts:Z(Bs).optional().default([]),business_types:Z(Vs).optional().default([]),job_functions:Z(Hs).optional().default([]),product_categories:Z(Us).optional().default([]),metadata:Ws.default({updated_on:``})}),Ks=Q({id_token:Y().optional(),access_token:Y(),refresh_token:Y().optional(),expires_in:Zo().optional(),token_type:Y().optional()}),qs=Q({success:gs(!0),data:Q({user:Gs,token:Ks})}),Js=Q({success:ts(),data:Q({user:Gs.nullish(),token:Ks.optional()}).optional()});function Ys(e,t,n){let r=e.safeParse(t);if(!r.success){D({name:`content_cta`,status:y.FAIL,error_code:r.error.message,capture_tool:`IIRIS`}),console.error(`[IIRIS] ${n} validation failed:`,r.error.issues,`Received data:`,t);return}return r.data}function Xs(e){return{success:e.success,user:e.data?.user??null,token:e.data?.token?.access_token??``}}var Zs=`iiris-sdk-container`,Qs=(0,ee.cn)(`IIRISPassportForm`);function $s(e){if(!e)throw Error(`IIRISPassport SDK not available. Ensure the IIRIS script is loaded.`)}var ec={error(e,t,n){let r=t instanceof Error?t:Error(String(t));n?console.error(`[IIRISPassportForm] ${e}`,n,r):console.error(`[IIRISPassportForm] ${e}`,r)}},tc=({configId:e,containerId:t=Zs,formType:n=`register`,className:r,options:i={},onFormLoad:a})=>{let[o,s]=(0,x.useState)(void 0),[c,l]=(0,x.useState)(!1),{isReady:u,error:d}=Et({check:()=>!!window.IIRISPassport,intervalMs:100,maxAttempts:100}),{eln:f}=_t(),{onRegistrationSuccess:p,onRegisterComplete:m,withNewsletterPromo:h,onLoginSuccess:g}=i,ee=async e=>{let t=Ys(qs,e,`registration`);if(!t){m?.(re);return}let n=Xs(t);p?.(t.data.user),await Fe({...n,withNewsletterPromo:h,eln:f,onRegisterComplete:m});let r=t.data.user?.business_email,i=r?await pt(r):``;D({name:`content_cta`,user_id:t.data.user?.id,email_hashed:i,capture_tool:`IIRIS`,status:y.SUCCESS,userId:t.data.user?.id,email:i,iirisProfileId:t.data.user?.iirisProfileId})},_=async e=>{let t=Ys(qs,e,`login`);t&&(await Ie(Xs(t)),g?.(t.data.user))},v=async e=>{let t=Ys(Js,e,`profile manager`);t&&await Le(Xs(t))},te=async e=>{let t=Ys(Js,e,`logout`);t&&await Re(Xs(t))},ne=async(e,t)=>{let n=t.metadata?JSON.parse(t.metadata):{},{business_email:r,email:i,id:a=``}=n,{formId:o}=e,s=r||i,c=s?await pt(s):``;o===`progressive`&&D({name:`content_cta`,user_id:a,email_hashed:c,capture_tool:`IIRIS`,status:y.REG_ADDITIONAL_INFO,email:s,iirisProfileId:n.iirisProfileId})};return(0,x.useEffect)(()=>
64{if(!e||e.trim()===``){s(`Configuration error: configId is required`);return}if(d){s(`Failed to load authentication service. Please refresh the page.`),console.error(`[IIRISPassportForm] SDK load error:`,d);return}return u?((async()=>{try{$s(window.IIRISPassport),window.IIRISPassport.registerCallbacks({fn1:ee,fn2:_,fn3:v,fn4:te,fn5:ne}),await window.IIRISPassport.getPassportSDKForm({containerId:t,responseType:`code`,formType:n}),l(!0),D({name:`content_cta`,status:y.ATTEMPT}),a?.()}catch(r){ec.error(`Failed to load SDK form:`,r,{configId:e,containerId:t,formType:n}),s(`Failed to load authentication form. Please try again.`)}})(),()=>{if(c&&window.IIRISPassport?.unmount)try{window.IIRISPassport.unmount(t),l(!1)}catch(e){ec.error(`Failed to unmount form:`,e)}}):void 0},[e,t,n,u,d]),(0,E.jsxs)(`div`,{className:Qs({className:r}),children:[o&&(0,E.jsx)(`div`,{className:Qs(`Error`),role:`alert`,children:o}),(0,E.jsx)(`div`,{id:t,"data-configid":e,suppressHydrationWarning:!0,"data-testid":`iiris-passport-form`})]})};Q({sub:Y(),email:Y(),first_name:Y().optional(),last_name:Y().optional(),given_name:Y().optional(),family_name:Y().optional()}),Q({authorization_endpoint:Po(),token_endpoint:Po(),end_session_endpoint:Po()});export{_t as a,He as c,ge as d,me as f,de as g,fe as h,ht as i,ve as l,le as m,Ao as n,qe as o,ue as p,wt as r,Ue as s,tc as t,_e as u};
65//# sourceMappingURL=src-kIyB8UZk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.