gamestage 0.35.5 → 0.35.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.mjs +64 -64
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -10,10 +10,10 @@
10
10
  * A single bundled file, minified. Nothing here phones home, and inspect,
11
11
  * create and manifest validate all run without an account.
12
12
  */
13
- var gA=Object.defineProperty;var v=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var Ot=(e,t)=>{for(var r in t)gA(e,r,{get:t[r],enumerable:!0})};function zn(e,t={}){let r=e?.trim()||ur;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var ur,$o=v(()=>{"use strict";ur="Round"});function We(e){return kA[e]??e}function Dy(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=We(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var Nt,kA,wl,jy,Yt=v(()=>{"use strict";Nt=["hunt","push","group","predict","bingo","shoot","place"],kA={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};wl={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element",shoot:"gamestage-shoot-element",place:"gamestage-place-element"},jy={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties",place:"Place the Face"}});function _(e,t,r){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);let d=a.prototype,p=Object.keys(d);for(let h=0;h<p.length;h++){let f=p[h];f in s||(s[f]=d[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let d=r?.Parent?new i:this;o(d,s),(l=d._zod).deferred??(l.deferred=[]);for(let p of d._zod.deferred)p();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function Ae(e){return e&&Object.assign(Fn,e),Fn}var My,_l,kl,Et,hn,Fn,Gn=v(()=>{_l=Object.freeze({status:"aborted"});kl=Symbol("zod_brand"),Et=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},hn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(My=globalThis).__zod_globalConfig??(My.__zod_globalConfig={});Fn=globalThis.__zod_globalConfig});var B={};Ot(B,{BIGINT_FORMAT_RANGES:()=>Ol,Class:()=>Sl,NUMBER_FORMAT_RANGES:()=>Pl,aborted:()=>yn,allowsEval:()=>Tl,assert:()=>TA,assertEqual:()=>xA,assertIs:()=>EA,assertNever:()=>$A,assertNotEqual:()=>SA,assignProp:()=>fn,base64ToUint8Array:()=>zy,base64urlToUint8Array:()=>WA,cached:()=>hr,captureStackTrace:()=>aa,cleanEnum:()=>BA,cleanRegex:()=>Io,clone:()=>Xe,cloneDef:()=>IA,createTransparentProxy:()=>LA,defineLazy:()=>pe,esc:()=>ia,escapeRegex:()=>vt,explicitlyAborted:()=>Nl,extend:()=>MA,finalizeIssue:()=>Qe,floatSafeRemainder:()=>El,getElementAtPath:()=>CA,getEnumValues:()=>Ao,getLengthableOrigin:()=>Oo,getParsedType:()=>RA,getSizableOrigin:()=>Po,hexToUint8Array:()=>HA,isObject:()=>Bn,isPlainObject:()=>gn,issue:()=>mr,joinValues:()=>T,jsonStringifyReplacer:()=>pr,merge:()=>zA,mergeDefs:()=>qt,normalizeParams:()=>H,nullish:()=>mn,numKeys:()=>NA,objectClone:()=>AA,omit:()=>jA,optionalKeys:()=>Cl,parsedType:()=>F,partial:()=>FA,pick:()=>DA,prefixIssues:()=>it,primitiveTypes:()=>Il,promiseAllObject:()=>PA,propertyKeyTypes:()=>Co,randomString:()=>OA,required:()=>GA,safeExtend:()=>UA,shallowClone:()=>Al,slugify:()=>$l,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>Fy,uint8ArrayToBase64url:()=>KA,uint8ArrayToHex:()=>ZA,unwrapMessage:()=>To});function xA(e){return e}function SA(e){return e}function EA(e){}function $A(e){throw new Error("Unexpected value in exhaustive check")}function TA(e){}function Ao(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function T(e,t="|"){return e.map(r=>z(r)).join(t)}function pr(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function mn(e){return e==null}function Io(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function El(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function pe(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Uy)return o===void 0&&(o=Uy,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function AA(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function fn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function IA(e){return qt(e._zod.def)}function CA(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function PA(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function OA(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function ia(e){return JSON.stringify(e)}function $l(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gn(e){if(Bn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Bn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Al(e){return gn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function NA(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function H(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 new 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 LA(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function z(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Cl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function DA(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=qt(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return fn(this,"shape",a),a},checks:[]});return Xe(e,i)}function jA(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=qt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return fn(this,"shape",a),a},checks:[]});return Xe(e,i)}function MA(e,t){if(!gn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=qt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return fn(this,"shape",i),i}});return Xe(e,n)}function UA(e,t){if(!gn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=qt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return fn(this,"shape",o),o}});return Xe(e,r)}function zA(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=qt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return fn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Xe(e,r)}function FA(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=qt(t._zod.def,{get shape(){let s=t._zod.def.shape,l={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(l[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)l[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return fn(this,"shape",l),l},checks:[]});return Xe(t,a)}function GA(e,t,r){let o=qt(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return fn(this,"shape",i),i}});return Xe(t,o)}function yn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Nl(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function it(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function To(e){return typeof e=="string"?e:e?.message}function Qe(e,t,r){let o=e.message?e.message:To(e.inst?._zod.def?.error?.(e))??To(t?.error?.(e))??To(r.customError?.(e))??To(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function Po(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Oo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function F(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function mr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function BA(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function zy(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Fy(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function WA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return zy(t+r)}function KA(e){return Fy(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function HA(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function ZA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Uy,aa,Tl,RA,Co,Il,Pl,Ol,Sl,ne=v(()=>{Gn();Uy=Symbol("evaluating");aa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Tl=hr(()=>{if(Fn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});RA=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Co=new Set(["string","number","symbol"]),Il=new Set(["string","number","bigint","boolean","symbol","undefined"]);Pl={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ol={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Sl=class{constructor(...t){}}});function Ro(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Lo(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,d=0;for(;d<s.length;){let p=s[d];d===s.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(t(a))):l[p]=l[p]||{_errors:[]},l=l[p],d++}}}};return o(e),r}function Rl(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(d=>o({issues:d},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let d=[...i,...l.path];if(d.length===0){r.errors.push(t(l));continue}let p=r,h=0;for(;h<d.length;){let f=d[h],y=h===d.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),y&&p.errors.push(t(l)),h++}}};return o(e),r}function By(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Ll(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${By(o.path)}`);return t.join(`
14
- `)}var Gy,No,at,Dl=v(()=>{Gn();ne();Gy=(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,pr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},No=_("$ZodError",Gy),at=_("$ZodError",Gy,{Parent:Error})});var fr,sa,gr,ca,yr,jl,vr,Ml,la,YA,da,qA,ua,JA,pa,XA,ha,QA,ma,e0,fa,t0,ga,n0,Ul=v(()=>{Gn();Dl();ne();fr=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Et;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Qe(l,i,Ae())));throw aa(s,n?.callee),s}return a.value},sa=fr(at),gr=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Qe(l,i,Ae())));throw aa(s,n?.callee),s}return a.value},ca=gr(at),yr=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Et;return i.issues.length?{success:!1,error:new(e??No)(i.issues.map(a=>Qe(a,n,Ae())))}:{success:!0,data:i.value}},jl=yr(at),vr=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Qe(a,n,Ae())))}:{success:!0,data:i.value}},Ml=vr(at),la=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return fr(e)(t,r,n)},YA=la(at),da=e=>(t,r,o)=>fr(e)(t,r,o),qA=da(at),ua=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return gr(e)(t,r,n)},JA=ua(at),pa=e=>async(t,r,o)=>gr(e)(t,r,o),XA=pa(at),ha=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yr(e)(t,r,n)},QA=ha(at),ma=e=>(t,r,o)=>yr(e)(t,r,o),e0=ma(at),fa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vr(e)(t,r,n)},t0=fa(at),ga=e=>async(t,r,o)=>vr(e)(t,r,o),n0=ga(at)});var pt={};Ot(pt,{base64:()=>td,base64url:()=>ya,bigint:()=>cd,boolean:()=>dd,browserEmail:()=>d0,cidrv4:()=>Ql,cidrv6:()=>ed,cuid:()=>zl,cuid2:()=>Fl,date:()=>od,datetime:()=>ad,domain:()=>h0,duration:()=>Hl,e164:()=>rd,email:()=>Vl,emoji:()=>Yl,extendedDuration:()=>r0,guid:()=>Zl,hex:()=>m0,hostname:()=>p0,html5Email:()=>s0,httpProtocol:()=>nd,idnEmail:()=>l0,integer:()=>ld,ipv4:()=>ql,ipv6:()=>Jl,ksuid:()=>Wl,lowercase:()=>hd,mac:()=>Xl,md5_base64:()=>g0,md5_base64url:()=>y0,md5_hex:()=>f0,nanoid:()=>Kl,null:()=>ud,number:()=>va,rfc5322Email:()=>c0,sha1_base64:()=>b0,sha1_base64url:()=>w0,sha1_hex:()=>v0,sha256_base64:()=>k0,sha256_base64url:()=>x0,sha256_hex:()=>_0,sha384_base64:()=>E0,sha384_base64url:()=>$0,sha384_hex:()=>S0,sha512_base64:()=>A0,sha512_base64url:()=>I0,sha512_hex:()=>T0,string:()=>sd,time:()=>id,ulid:()=>Gl,undefined:()=>pd,unicodeEmail:()=>Wy,uppercase:()=>md,uuid:()=>Wn,uuid4:()=>o0,uuid6:()=>i0,uuid7:()=>a0,xid:()=>Bl});function Yl(){return new RegExp(u0,"u")}function Hy(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 id(e){return new RegExp(`^${Hy(e)}$`)}function ad(e){let t=Hy({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ky}T(?:${o})$`)}function Do(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function jo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var zl,Fl,Gl,Bl,Wl,Kl,Hl,r0,Zl,Wn,o0,i0,a0,Vl,s0,c0,Wy,l0,d0,u0,ql,Jl,Xl,Ql,ed,td,ya,p0,h0,nd,rd,Ky,od,sd,cd,ld,va,dd,ud,pd,hd,md,m0,f0,g0,y0,v0,b0,w0,_0,k0,x0,S0,E0,$0,T0,A0,I0,ba=v(()=>{ne();zl=/^[cC][0-9a-z]{6,}$/,Fl=/^[0-9a-z]+$/,Gl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bl=/^[0-9a-vA-V]{20}$/,Wl=/^[A-Za-z0-9]{27}$/,Kl=/^[a-zA-Z0-9_-]{21}$/,Hl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,r0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Zl=/^([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})$/,Wn=e=>e?new 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)$/,o0=Wn(4),i0=Wn(6),a0=Wn(7),Vl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,s0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,c0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Wy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,l0=Wy,d0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,u0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";ql=/^(?:(?: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])$/,Jl=/^(([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}|:))$/,Xl=e=>{let t=vt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ql=/^((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])$/,ed=/^(([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])$/,td=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ya=/^[A-Za-z0-9_-]*$/,p0=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,h0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,nd=/^https?$/,rd=/^\+[1-9]\d{6,14}$/,Ky="(?:(?:\\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])))",od=new RegExp(`^${Ky}$`);sd=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},cd=/^-?\d+n?$/,ld=/^-?\d+$/,va=/^-?\d+(?:\.\d+)?$/,dd=/^(?:true|false)$/i,ud=/^null$/i,pd=/^undefined$/i,hd=/^[^A-Z]*$/,md=/^[^a-z]*$/,m0=/^[0-9a-fA-F]*$/;f0=/^[0-9a-fA-F]{32}$/,g0=Do(22,"=="),y0=jo(22),v0=/^[0-9a-fA-F]{40}$/,b0=Do(27,"="),w0=jo(27),_0=/^[0-9a-fA-F]{64}$/,k0=Do(43,"="),x0=jo(43),S0=/^[0-9a-fA-F]{96}$/,E0=Do(64,""),$0=jo(64),T0=/^[0-9a-fA-F]{128}$/,A0=Do(86,"=="),I0=jo(86)});function Zy(e,t,r){e.issues.length&&t.issues.push(...it(r,e.issues))}var we,Vy,wa,_a,fd,gd,yd,vd,bd,wd,_d,kd,xd,br,Sd,Ed,$d,Td,Ad,Id,Cd,Pd,Od,ka=v(()=>{Gn();ba();ne();we=_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Vy={number:"number",bigint:"bigint",object:"date"},wa=_("$ZodCheckLessThan",(e,t)=>{we.init(e,t);let r=Vy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_a=_("$ZodCheckGreaterThan",(e,t)=>{we.init(e,t);let r=Vy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fd=_("$ZodCheckMultipleOf",(e,t)=>{we.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):El(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gd=_("$ZodCheckNumberFormat",(e,t)=>{we.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Pl[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=ld)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),yd=_("$ZodCheckBigIntFormat",(e,t)=>{we.init(e,t);let[r,o]=Ol[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),vd=_("$ZodCheckMaxSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Po(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),bd=_("$ZodCheckMinSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Po(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),wd=_("$ZodCheckSizeEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Po(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),_d=_("$ZodCheckMaxLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Oo(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),kd=_("$ZodCheckMinLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Oo(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),xd=_("$ZodCheckLengthEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=Oo(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),br=_("$ZodCheckStringFormat",(e,t)=>{var r,o;we.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.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})}):(o=e._zod).check??(o.check=()=>{})}),Sd=_("$ZodCheckRegex",(e,t)=>{br.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ed=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=hd),br.init(e,t)}),$d=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=md),br.init(e,t)}),Td=_("$ZodCheckIncludes",(e,t)=>{we.init(e,t);let r=vt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),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})}}),Ad=_("$ZodCheckStartsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`^${vt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Id=_("$ZodCheckEndsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`.*${vt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});Cd=_("$ZodCheckProperty",(e,t)=>{we.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Zy(n,r,t.property));Zy(o,r,t.property)}}),Pd=_("$ZodCheckMimeType",(e,t)=>{we.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Od=_("$ZodCheckOverwrite",(e,t)=>{we.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Mo,Nd=v(()=>{Mo=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
13
+ var _A=Object.defineProperty;var v=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var Ot=(e,t)=>{for(var r in t)_A(e,r,{get:t[r],enumerable:!0})};function zn(e,t={}){let r=e?.trim()||pr;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var pr,$o=v(()=>{"use strict";pr="Round"});function We(e){return TA[e]??e}function Dy(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=We(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var Nt,TA,wl,jy,Yt=v(()=>{"use strict";Nt=["hunt","push","group","predict","bingo","shoot","place"],TA={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};wl={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element",shoot:"gamestage-shoot-element",place:"gamestage-place-element"},jy={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties",place:"Place the Face"}});function _(e,t,r){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);let d=a.prototype,p=Object.keys(d);for(let h=0;h<p.length;h++){let f=p[h];f in s||(s[f]=d[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let d=r?.Parent?new i:this;o(d,s),(l=d._zod).deferred??(l.deferred=[]);for(let p of d._zod.deferred)p();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function Ae(e){return e&&Object.assign(Fn,e),Fn}var My,_l,kl,Et,hn,Fn,Gn=v(()=>{_l=Object.freeze({status:"aborted"});kl=Symbol("zod_brand"),Et=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},hn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(My=globalThis).__zod_globalConfig??(My.__zod_globalConfig={});Fn=globalThis.__zod_globalConfig});var B={};Ot(B,{BIGINT_FORMAT_RANGES:()=>Ol,Class:()=>Sl,NUMBER_FORMAT_RANGES:()=>Pl,aborted:()=>yn,allowsEval:()=>Tl,assert:()=>OA,assertEqual:()=>AA,assertIs:()=>CA,assertNever:()=>PA,assertNotEqual:()=>IA,assignProp:()=>fn,base64ToUint8Array:()=>zy,base64urlToUint8Array:()=>YA,cached:()=>mr,captureStackTrace:()=>aa,cleanEnum:()=>VA,cleanRegex:()=>Io,clone:()=>Xe,cloneDef:()=>RA,createTransparentProxy:()=>zA,defineLazy:()=>pe,esc:()=>ia,escapeRegex:()=>vt,explicitlyAborted:()=>Nl,extend:()=>BA,finalizeIssue:()=>Qe,floatSafeRemainder:()=>El,getElementAtPath:()=>LA,getEnumValues:()=>Ao,getLengthableOrigin:()=>Oo,getParsedType:()=>UA,getSizableOrigin:()=>Po,hexToUint8Array:()=>JA,isObject:()=>Bn,isPlainObject:()=>gn,issue:()=>fr,joinValues:()=>T,jsonStringifyReplacer:()=>hr,merge:()=>KA,mergeDefs:()=>qt,normalizeParams:()=>H,nullish:()=>mn,numKeys:()=>MA,objectClone:()=>NA,omit:()=>GA,optionalKeys:()=>Cl,parsedType:()=>F,partial:()=>HA,pick:()=>FA,prefixIssues:()=>it,primitiveTypes:()=>Il,promiseAllObject:()=>DA,propertyKeyTypes:()=>Co,randomString:()=>jA,required:()=>ZA,safeExtend:()=>WA,shallowClone:()=>Al,slugify:()=>$l,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>Fy,uint8ArrayToBase64url:()=>qA,uint8ArrayToHex:()=>XA,unwrapMessage:()=>To});function AA(e){return e}function IA(e){return e}function CA(e){}function PA(e){throw new Error("Unexpected value in exhaustive check")}function OA(e){}function Ao(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function T(e,t="|"){return e.map(r=>z(r)).join(t)}function hr(e,t){return typeof t=="bigint"?t.toString():t}function mr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function mn(e){return e==null}function Io(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function El(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function pe(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Uy)return o===void 0&&(o=Uy,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function NA(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function fn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function RA(e){return qt(e._zod.def)}function LA(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function DA(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function jA(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function ia(e){return JSON.stringify(e)}function $l(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gn(e){if(Bn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Bn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Al(e){return gn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function MA(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function H(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 new 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 zA(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function z(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Cl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function FA(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=qt(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return fn(this,"shape",a),a},checks:[]});return Xe(e,i)}function GA(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=qt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return fn(this,"shape",a),a},checks:[]});return Xe(e,i)}function BA(e,t){if(!gn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=qt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return fn(this,"shape",i),i}});return Xe(e,n)}function WA(e,t){if(!gn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=qt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return fn(this,"shape",o),o}});return Xe(e,r)}function KA(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=qt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return fn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Xe(e,r)}function HA(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=qt(t._zod.def,{get shape(){let s=t._zod.def.shape,l={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(l[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)l[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return fn(this,"shape",l),l},checks:[]});return Xe(t,a)}function ZA(e,t,r){let o=qt(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return fn(this,"shape",i),i}});return Xe(t,o)}function yn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Nl(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function it(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function To(e){return typeof e=="string"?e:e?.message}function Qe(e,t,r){let o=e.message?e.message:To(e.inst?._zod.def?.error?.(e))??To(t?.error?.(e))??To(r.customError?.(e))??To(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function Po(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Oo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function F(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function fr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function VA(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function zy(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Fy(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function YA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return zy(t+r)}function qA(e){return Fy(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JA(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function XA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Uy,aa,Tl,UA,Co,Il,Pl,Ol,Sl,ne=v(()=>{Gn();Uy=Symbol("evaluating");aa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Tl=mr(()=>{if(Fn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});UA=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Co=new Set(["string","number","symbol"]),Il=new Set(["string","number","bigint","boolean","symbol","undefined"]);Pl={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ol={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Sl=class{constructor(...t){}}});function Ro(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Lo(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,d=0;for(;d<s.length;){let p=s[d];d===s.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(t(a))):l[p]=l[p]||{_errors:[]},l=l[p],d++}}}};return o(e),r}function Rl(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(d=>o({issues:d},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let d=[...i,...l.path];if(d.length===0){r.errors.push(t(l));continue}let p=r,h=0;for(;h<d.length;){let f=d[h],y=h===d.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),y&&p.errors.push(t(l)),h++}}};return o(e),r}function By(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Ll(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${By(o.path)}`);return t.join(`
14
+ `)}var Gy,No,at,Dl=v(()=>{Gn();ne();Gy=(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,hr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},No=_("$ZodError",Gy),at=_("$ZodError",Gy,{Parent:Error})});var gr,sa,yr,ca,vr,jl,br,Ml,la,e0,da,t0,ua,n0,pa,r0,ha,o0,ma,i0,fa,a0,ga,s0,Ul=v(()=>{Gn();Dl();ne();gr=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Et;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Qe(l,i,Ae())));throw aa(s,n?.callee),s}return a.value},sa=gr(at),yr=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>Qe(l,i,Ae())));throw aa(s,n?.callee),s}return a.value},ca=yr(at),vr=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Et;return i.issues.length?{success:!1,error:new(e??No)(i.issues.map(a=>Qe(a,n,Ae())))}:{success:!0,data:i.value}},jl=vr(at),br=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Qe(a,n,Ae())))}:{success:!0,data:i.value}},Ml=br(at),la=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return gr(e)(t,r,n)},e0=la(at),da=e=>(t,r,o)=>gr(e)(t,r,o),t0=da(at),ua=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yr(e)(t,r,n)},n0=ua(at),pa=e=>async(t,r,o)=>yr(e)(t,r,o),r0=pa(at),ha=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vr(e)(t,r,n)},o0=ha(at),ma=e=>(t,r,o)=>vr(e)(t,r,o),i0=ma(at),fa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return br(e)(t,r,n)},a0=fa(at),ga=e=>async(t,r,o)=>br(e)(t,r,o),s0=ga(at)});var pt={};Ot(pt,{base64:()=>td,base64url:()=>ya,bigint:()=>cd,boolean:()=>dd,browserEmail:()=>f0,cidrv4:()=>Ql,cidrv6:()=>ed,cuid:()=>zl,cuid2:()=>Fl,date:()=>od,datetime:()=>ad,domain:()=>v0,duration:()=>Hl,e164:()=>rd,email:()=>Vl,emoji:()=>Yl,extendedDuration:()=>c0,guid:()=>Zl,hex:()=>b0,hostname:()=>y0,html5Email:()=>p0,httpProtocol:()=>nd,idnEmail:()=>m0,integer:()=>ld,ipv4:()=>ql,ipv6:()=>Jl,ksuid:()=>Wl,lowercase:()=>hd,mac:()=>Xl,md5_base64:()=>_0,md5_base64url:()=>k0,md5_hex:()=>w0,nanoid:()=>Kl,null:()=>ud,number:()=>va,rfc5322Email:()=>h0,sha1_base64:()=>S0,sha1_base64url:()=>E0,sha1_hex:()=>x0,sha256_base64:()=>T0,sha256_base64url:()=>A0,sha256_hex:()=>$0,sha384_base64:()=>C0,sha384_base64url:()=>P0,sha384_hex:()=>I0,sha512_base64:()=>N0,sha512_base64url:()=>R0,sha512_hex:()=>O0,string:()=>sd,time:()=>id,ulid:()=>Gl,undefined:()=>pd,unicodeEmail:()=>Wy,uppercase:()=>md,uuid:()=>Wn,uuid4:()=>l0,uuid6:()=>d0,uuid7:()=>u0,xid:()=>Bl});function Yl(){return new RegExp(g0,"u")}function Hy(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 id(e){return new RegExp(`^${Hy(e)}$`)}function ad(e){let t=Hy({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ky}T(?:${o})$`)}function Do(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function jo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var zl,Fl,Gl,Bl,Wl,Kl,Hl,c0,Zl,Wn,l0,d0,u0,Vl,p0,h0,Wy,m0,f0,g0,ql,Jl,Xl,Ql,ed,td,ya,y0,v0,nd,rd,Ky,od,sd,cd,ld,va,dd,ud,pd,hd,md,b0,w0,_0,k0,x0,S0,E0,$0,T0,A0,I0,C0,P0,O0,N0,R0,ba=v(()=>{ne();zl=/^[cC][0-9a-z]{6,}$/,Fl=/^[0-9a-z]+$/,Gl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bl=/^[0-9a-vA-V]{20}$/,Wl=/^[A-Za-z0-9]{27}$/,Kl=/^[a-zA-Z0-9_-]{21}$/,Hl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,c0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Zl=/^([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})$/,Wn=e=>e?new 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)$/,l0=Wn(4),d0=Wn(6),u0=Wn(7),Vl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,p0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,h0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Wy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,m0=Wy,f0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,g0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";ql=/^(?:(?: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])$/,Jl=/^(([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}|:))$/,Xl=e=>{let t=vt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ql=/^((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])$/,ed=/^(([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])$/,td=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ya=/^[A-Za-z0-9_-]*$/,y0=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,v0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,nd=/^https?$/,rd=/^\+[1-9]\d{6,14}$/,Ky="(?:(?:\\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])))",od=new RegExp(`^${Ky}$`);sd=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},cd=/^-?\d+n?$/,ld=/^-?\d+$/,va=/^-?\d+(?:\.\d+)?$/,dd=/^(?:true|false)$/i,ud=/^null$/i,pd=/^undefined$/i,hd=/^[^A-Z]*$/,md=/^[^a-z]*$/,b0=/^[0-9a-fA-F]*$/;w0=/^[0-9a-fA-F]{32}$/,_0=Do(22,"=="),k0=jo(22),x0=/^[0-9a-fA-F]{40}$/,S0=Do(27,"="),E0=jo(27),$0=/^[0-9a-fA-F]{64}$/,T0=Do(43,"="),A0=jo(43),I0=/^[0-9a-fA-F]{96}$/,C0=Do(64,""),P0=jo(64),O0=/^[0-9a-fA-F]{128}$/,N0=Do(86,"=="),R0=jo(86)});function Zy(e,t,r){e.issues.length&&t.issues.push(...it(r,e.issues))}var we,Vy,wa,_a,fd,gd,yd,vd,bd,wd,_d,kd,xd,wr,Sd,Ed,$d,Td,Ad,Id,Cd,Pd,Od,ka=v(()=>{Gn();ba();ne();we=_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Vy={number:"number",bigint:"bigint",object:"date"},wa=_("$ZodCheckLessThan",(e,t)=>{we.init(e,t);let r=Vy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_a=_("$ZodCheckGreaterThan",(e,t)=>{we.init(e,t);let r=Vy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fd=_("$ZodCheckMultipleOf",(e,t)=>{we.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):El(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gd=_("$ZodCheckNumberFormat",(e,t)=>{we.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Pl[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=ld)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),yd=_("$ZodCheckBigIntFormat",(e,t)=>{we.init(e,t);let[r,o]=Ol[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),vd=_("$ZodCheckMaxSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Po(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),bd=_("$ZodCheckMinSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Po(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),wd=_("$ZodCheckSizeEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Po(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),_d=_("$ZodCheckMaxLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Oo(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),kd=_("$ZodCheckMinLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Oo(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),xd=_("$ZodCheckLengthEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=Oo(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),wr=_("$ZodCheckStringFormat",(e,t)=>{var r,o;we.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.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})}):(o=e._zod).check??(o.check=()=>{})}),Sd=_("$ZodCheckRegex",(e,t)=>{wr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ed=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=hd),wr.init(e,t)}),$d=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=md),wr.init(e,t)}),Td=_("$ZodCheckIncludes",(e,t)=>{we.init(e,t);let r=vt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),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})}}),Ad=_("$ZodCheckStartsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`^${vt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Id=_("$ZodCheckEndsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`.*${vt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});Cd=_("$ZodCheckProperty",(e,t)=>{we.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Zy(n,r,t.property));Zy(o,r,t.property)}}),Pd=_("$ZodCheckMimeType",(e,t)=>{we.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Od=_("$ZodCheckOverwrite",(e,t)=>{we.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Mo,Nd=v(()=>{Mo=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
15
15
  `).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
16
- `))}}});var Rd,Ld=v(()=>{Rd={major:4,minor:4,patch:3}});function ru(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function dv(e){if(!ya.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ru(r)}function uv(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function qy(e,t,r){e.issues.length&&t.issues.push(...it(r,e.issues)),t.value[r]=e.value}function $a(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...it(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function pv(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Cl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function hv(e,t,r,o,n,i){let a=[],s=n.keySet,l=n.catchall._zod,d=l.def.type,p=l.optin==="optional",h=l.optout==="optional";for(let f in t){if(f==="__proto__"||s.has(f))continue;if(d==="never"){a.push(f);continue}let y=l.run({value:t[f],issues:[]},o);y instanceof Promise?e.push(y.then(k=>$a(k,r,f,t,p,h))):$a(y,r,f,t,p,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function Jy(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!yn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Qe(a,o,Ae())))}),t)}function Xy(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Qe(a,o,Ae())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function Dd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(gn(e)&&gn(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=Dd(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=Dd(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Qy(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),yn(e))return e;let a=Dd(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function ev(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function tv(e,t,r){e.issues.length&&t.issues.push(...it(r,e.issues)),t.value[r]=e.value}function nv(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...it(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function rv(e,t,r,o,n,i,a){e.issues.length&&(Co.has(typeof o)?r.issues.push(...it(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>Qe(s,a,Ae()))})),t.issues.length&&(Co.has(typeof o)?r.issues.push(...it(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>Qe(s,a,Ae()))})),r.value.set(e.value,t.value)}function ov(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function iv(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function av(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function sv(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function xa(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Sa(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ea(e,i,t.out,r)):Ea(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ea(e,i,t.in,r)):Ea(e,n,t.in,r)}}function Ea(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function cv(e){return e.value=Object.freeze(e.value),e}function lv(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(mr(n))}}var ae,Kn,ve,jd,Md,Ud,zd,Fd,Gd,Bd,Wd,Kd,Hd,Zd,Vd,Yd,qd,Jd,Xd,Qd,eu,tu,nu,ou,iu,au,su,cu,Ta,lu,Uo,Aa,du,uu,pu,hu,mu,fu,gu,yu,vu,bu,mv,wu,zo,_u,ku,xu,Ia,Su,Eu,$u,Tu,Au,Iu,Cu,Ca,Pu,Ou,Nu,Ru,Lu,Du,ju,Mu,Pa,Fo,Uu,zu,Fu,Gu,Bu,Wu,Ku,Hu=v(()=>{ka();Gn();Nd();Ul();ba();ne();Ld();ne();ae=_("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rd;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,l)=>{let d=yn(a),p;for(let h of s){if(h._zod.def.when){if(Nl(a)||!h._zod.def.when(a))continue}else if(d)continue;let f=a.issues.length,y=h._zod.check(a);if(y instanceof Promise&&l?.async===!1)throw new Et;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,a.issues.length!==f&&(d||(d=yn(a,f)))});else{if(a.issues.length===f)continue;d||(d=yn(a,f))}}return p?p.then(()=>a):a},i=(a,s,l)=>{if(yn(a))return a.aborted=!0,a;let d=n(s,o,l);if(d instanceof Promise){if(l.async===!1)throw new Et;return d.then(p=>e._zod.parse(p,l))}return e._zod.parse(d,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let d=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(p=>i(p,a,s)):i(d,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Et;return l.then(d=>n(d,o,s))}return n(l,o,s)}}pe(e,"~standard",()=>({validate:n=>{try{let i=jl(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ml(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Kn=_("$ZodString",(e,t)=>{ae.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sd(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ve=_("$ZodStringFormat",(e,t)=>{br.init(e,t),Kn.init(e,t)}),jd=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zl),ve.init(e,t)}),Md=_("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Wn(o))}else t.pattern??(t.pattern=Wn());ve.init(e,t)}),Ud=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vl),ve.init(e,t)}),zd=_("$ZodURL",(e,t)=>{ve.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===nd.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Fd=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Yl()),ve.init(e,t)}),Gd=_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Kl),ve.init(e,t)}),Bd=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zl),ve.init(e,t)}),Wd=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Fl),ve.init(e,t)}),Kd=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gl),ve.init(e,t)}),Hd=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bl),ve.init(e,t)}),Zd=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Wl),ve.init(e,t)}),Vd=_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ad(t)),ve.init(e,t)}),Yd=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=od),ve.init(e,t)}),qd=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=id(t)),ve.init(e,t)}),Jd=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hl),ve.init(e,t)}),Xd=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ql),ve.init(e,t),e._zod.bag.format="ipv4"}),Qd=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jl),ve.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),eu=_("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Xl(t.delimiter)),ve.init(e,t),e._zod.bag.format="mac"}),tu=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ql),ve.init(e,t)}),nu=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ed),ve.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});ou=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=td),ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ru(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});iu=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ya),ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{dv(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),au=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rd),ve.init(e,t)});su=_("$ZodJWT",(e,t)=>{ve.init(e,t),e._zod.check=r=>{uv(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),cu=_("$ZodCustomStringFormat",(e,t)=>{ve.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ta=_("$ZodNumber",(e,t)=>{ae.init(e,t),e._zod.pattern=e._zod.bag.pattern??va,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),lu=_("$ZodNumberFormat",(e,t)=>{gd.init(e,t),Ta.init(e,t)}),Uo=_("$ZodBoolean",(e,t)=>{ae.init(e,t),e._zod.pattern=dd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Aa=_("$ZodBigInt",(e,t)=>{ae.init(e,t),e._zod.pattern=cd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),du=_("$ZodBigIntFormat",(e,t)=>{yd.init(e,t),Aa.init(e,t)}),uu=_("$ZodSymbol",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),pu=_("$ZodUndefined",(e,t)=>{ae.init(e,t),e._zod.pattern=pd,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),hu=_("$ZodNull",(e,t)=>{ae.init(e,t),e._zod.pattern=ud,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),mu=_("$ZodAny",(e,t)=>{ae.init(e,t),e._zod.parse=r=>r}),fu=_("$ZodUnknown",(e,t)=>{ae.init(e,t),e._zod.parse=r=>r}),gu=_("$ZodNever",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),yu=_("$ZodVoid",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),vu=_("$ZodDate",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});bu=_("$ZodArray",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],l=t.element._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(d=>qy(d,r,a))):qy(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});mv=_("$ZodObject",(e,t)=>{if(ae.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=hr(()=>pv(t));pe(e._zod,"propValues",()=>{let s=t.shape,l={};for(let d in s){let p=s[d]._zod;if(p.values){l[d]??(l[d]=new Set);for(let h of p.values)l[d].add(h)}}return l});let n=Bn,i=t.catchall,a;e._zod.parse=(s,l)=>{a??(a=o.value);let d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};let p=[],h=a.shape;for(let f of a.keys){let y=h[f],k=y._zod.optin==="optional",D=y._zod.optout==="optional",b=y._zod.run({value:d[f],issues:[]},l);b instanceof Promise?p.push(b.then($=>$a($,s,f,d,k,D))):$a(b,s,f,d,k,D)}return i?hv(p,d,s,l,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),wu=_("$ZodObjectJIT",(e,t)=>{mv.init(e,t);let r=e._zod.parse,o=hr(()=>pv(t)),n=f=>{let y=new Mo(["shape","payload","ctx"]),k=o.value,D=w=>{let C=ia(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};y.write("const input = payload.value;");let b=Object.create(null),$=0;for(let w of k.keys)b[w]=`key_${$++}`;y.write("const newResult = {};");for(let w of k.keys){let C=b[w],N=ia(w),ee=f[w],de=ee?._zod?.optin==="optional",me=ee?._zod?.optout==="optional";y.write(`const ${C} = ${D(w)};`),de&&me?y.write(`
16
+ `))}}});var Rd,Ld=v(()=>{Rd={major:4,minor:4,patch:3}});function ru(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function dv(e){if(!ya.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ru(r)}function uv(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function qy(e,t,r){e.issues.length&&t.issues.push(...it(r,e.issues)),t.value[r]=e.value}function $a(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...it(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function pv(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Cl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function hv(e,t,r,o,n,i){let a=[],s=n.keySet,l=n.catchall._zod,d=l.def.type,p=l.optin==="optional",h=l.optout==="optional";for(let f in t){if(f==="__proto__"||s.has(f))continue;if(d==="never"){a.push(f);continue}let y=l.run({value:t[f],issues:[]},o);y instanceof Promise?e.push(y.then(k=>$a(k,r,f,t,p,h))):$a(y,r,f,t,p,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function Jy(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!yn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Qe(a,o,Ae())))}),t)}function Xy(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Qe(a,o,Ae())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function Dd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(gn(e)&&gn(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=Dd(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=Dd(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Qy(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),yn(e))return e;let a=Dd(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function ev(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function tv(e,t,r){e.issues.length&&t.issues.push(...it(r,e.issues)),t.value[r]=e.value}function nv(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...it(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function rv(e,t,r,o,n,i,a){e.issues.length&&(Co.has(typeof o)?r.issues.push(...it(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>Qe(s,a,Ae()))})),t.issues.length&&(Co.has(typeof o)?r.issues.push(...it(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>Qe(s,a,Ae()))})),r.value.set(e.value,t.value)}function ov(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function iv(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function av(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function sv(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function xa(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Sa(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ea(e,i,t.out,r)):Ea(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ea(e,i,t.in,r)):Ea(e,n,t.in,r)}}function Ea(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function cv(e){return e.value=Object.freeze(e.value),e}function lv(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(fr(n))}}var ae,Kn,ve,jd,Md,Ud,zd,Fd,Gd,Bd,Wd,Kd,Hd,Zd,Vd,Yd,qd,Jd,Xd,Qd,eu,tu,nu,ou,iu,au,su,cu,Ta,lu,Uo,Aa,du,uu,pu,hu,mu,fu,gu,yu,vu,bu,mv,wu,zo,_u,ku,xu,Ia,Su,Eu,$u,Tu,Au,Iu,Cu,Ca,Pu,Ou,Nu,Ru,Lu,Du,ju,Mu,Pa,Fo,Uu,zu,Fu,Gu,Bu,Wu,Ku,Hu=v(()=>{ka();Gn();Nd();Ul();ba();ne();Ld();ne();ae=_("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rd;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,l)=>{let d=yn(a),p;for(let h of s){if(h._zod.def.when){if(Nl(a)||!h._zod.def.when(a))continue}else if(d)continue;let f=a.issues.length,y=h._zod.check(a);if(y instanceof Promise&&l?.async===!1)throw new Et;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,a.issues.length!==f&&(d||(d=yn(a,f)))});else{if(a.issues.length===f)continue;d||(d=yn(a,f))}}return p?p.then(()=>a):a},i=(a,s,l)=>{if(yn(a))return a.aborted=!0,a;let d=n(s,o,l);if(d instanceof Promise){if(l.async===!1)throw new Et;return d.then(p=>e._zod.parse(p,l))}return e._zod.parse(d,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let d=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(p=>i(p,a,s)):i(d,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Et;return l.then(d=>n(d,o,s))}return n(l,o,s)}}pe(e,"~standard",()=>({validate:n=>{try{let i=jl(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ml(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Kn=_("$ZodString",(e,t)=>{ae.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sd(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ve=_("$ZodStringFormat",(e,t)=>{wr.init(e,t),Kn.init(e,t)}),jd=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zl),ve.init(e,t)}),Md=_("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Wn(o))}else t.pattern??(t.pattern=Wn());ve.init(e,t)}),Ud=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vl),ve.init(e,t)}),zd=_("$ZodURL",(e,t)=>{ve.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===nd.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Fd=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Yl()),ve.init(e,t)}),Gd=_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Kl),ve.init(e,t)}),Bd=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zl),ve.init(e,t)}),Wd=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Fl),ve.init(e,t)}),Kd=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gl),ve.init(e,t)}),Hd=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bl),ve.init(e,t)}),Zd=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Wl),ve.init(e,t)}),Vd=_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ad(t)),ve.init(e,t)}),Yd=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=od),ve.init(e,t)}),qd=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=id(t)),ve.init(e,t)}),Jd=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hl),ve.init(e,t)}),Xd=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ql),ve.init(e,t),e._zod.bag.format="ipv4"}),Qd=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jl),ve.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),eu=_("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Xl(t.delimiter)),ve.init(e,t),e._zod.bag.format="mac"}),tu=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ql),ve.init(e,t)}),nu=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ed),ve.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});ou=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=td),ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ru(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});iu=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ya),ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{dv(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),au=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rd),ve.init(e,t)});su=_("$ZodJWT",(e,t)=>{ve.init(e,t),e._zod.check=r=>{uv(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),cu=_("$ZodCustomStringFormat",(e,t)=>{ve.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ta=_("$ZodNumber",(e,t)=>{ae.init(e,t),e._zod.pattern=e._zod.bag.pattern??va,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),lu=_("$ZodNumberFormat",(e,t)=>{gd.init(e,t),Ta.init(e,t)}),Uo=_("$ZodBoolean",(e,t)=>{ae.init(e,t),e._zod.pattern=dd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Aa=_("$ZodBigInt",(e,t)=>{ae.init(e,t),e._zod.pattern=cd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),du=_("$ZodBigIntFormat",(e,t)=>{yd.init(e,t),Aa.init(e,t)}),uu=_("$ZodSymbol",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),pu=_("$ZodUndefined",(e,t)=>{ae.init(e,t),e._zod.pattern=pd,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),hu=_("$ZodNull",(e,t)=>{ae.init(e,t),e._zod.pattern=ud,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),mu=_("$ZodAny",(e,t)=>{ae.init(e,t),e._zod.parse=r=>r}),fu=_("$ZodUnknown",(e,t)=>{ae.init(e,t),e._zod.parse=r=>r}),gu=_("$ZodNever",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),yu=_("$ZodVoid",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),vu=_("$ZodDate",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});bu=_("$ZodArray",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],l=t.element._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(d=>qy(d,r,a))):qy(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});mv=_("$ZodObject",(e,t)=>{if(ae.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=mr(()=>pv(t));pe(e._zod,"propValues",()=>{let s=t.shape,l={};for(let d in s){let p=s[d]._zod;if(p.values){l[d]??(l[d]=new Set);for(let h of p.values)l[d].add(h)}}return l});let n=Bn,i=t.catchall,a;e._zod.parse=(s,l)=>{a??(a=o.value);let d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};let p=[],h=a.shape;for(let f of a.keys){let y=h[f],k=y._zod.optin==="optional",D=y._zod.optout==="optional",b=y._zod.run({value:d[f],issues:[]},l);b instanceof Promise?p.push(b.then($=>$a($,s,f,d,k,D))):$a(b,s,f,d,k,D)}return i?hv(p,d,s,l,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),wu=_("$ZodObjectJIT",(e,t)=>{mv.init(e,t);let r=e._zod.parse,o=mr(()=>pv(t)),n=f=>{let y=new Mo(["shape","payload","ctx"]),k=o.value,D=w=>{let C=ia(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};y.write("const input = payload.value;");let b=Object.create(null),$=0;for(let w of k.keys)b[w]=`key_${$++}`;y.write("const newResult = {};");for(let w of k.keys){let C=b[w],N=ia(w),ee=f[w],de=ee?._zod?.optin==="optional",me=ee?._zod?.optout==="optional";y.write(`const ${C} = ${D(w)};`),de&&me?y.write(`
17
17
  if (${C}.issues.length) {
18
18
  if (${N} in input) {
19
19
  payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
@@ -72,28 +72,28 @@ var gA=Object.defineProperty;var v=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(
72
72
  }
73
73
  }
74
74
 
75
- `)}y.write("payload.value = newResult;"),y.write("return payload;");let S=y.compile();return(w,C)=>S(f,w,C)},i,a=Bn,s=!Fn.jitless,d=s&&Tl.value,p=t.catchall,h;e._zod.parse=(f,y)=>{h??(h=o.value);let k=f.value;return a(k)?s&&d&&y?.async===!1&&y.jitless!==!0?(i||(i=n(t.shape)),f=i(f,y),p?hv([],k,f,y,h,e):f):r(f,y):(f.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),f)}});zo=_("$ZodUnion",(e,t)=>{ae.init(e,t),pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),pe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Io(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(s=>Jy(s,o,e,n)):Jy(a,o,e,n)}});_u=_("$ZodXor",(e,t)=>{zo.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(a.push(l),i=!0):a.push(l)}return i?Promise.all(a).then(s=>Xy(s,o,e,n)):Xy(a,o,e,n)}}),ku=_("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,zo.init(e,t);let r=e._zod.parse;pe(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let d of l)n[s].add(d)}}return n});let o=hr(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Bn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),xu=_("$ZodIntersection",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,d])=>Qy(r,l,d)):Qy(r,i,a)}});Ia=_("$ZodTuple",(e,t)=>{ae.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=ev(r,"optin"),l=ev(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let d=new Array(r.length);for(let p=0;p<r.length;p++){let h=r[p]._zod.run({value:i[p],issues:[]},n);h instanceof Promise?a.push(h.then(f=>{d[p]=f})):d[p]=h}if(t.rest){let p=r.length-1,h=i.slice(r.length);for(let f of h){p++;let y=t.rest._zod.run({value:f,issues:[]},n);y instanceof Promise?a.push(y.then(k=>tv(k,o,p))):tv(y,o,p)}}return a.length?Promise.all(a).then(()=>nv(d,o,r,i,l)):nv(d,o,r,i,l)}});Su=_("$ZodRecord",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!gn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){s.add(typeof d=="number"?d.toString():d);let p=t.keyType._zod.run({value:d,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Qe(y,o,Ae())),input:d,path:[d],inst:e});continue}let h=p.value,f=t.valueType._zod.run({value:n[d],issues:[]},o);f instanceof Promise?i.push(f.then(y=>{y.issues.length&&r.issues.push(...it(d,y.issues)),r.value[h]=y.value})):(f.issues.length&&r.issues.push(...it(d,f.issues)),r.value[h]=f.value)}let l;for(let d in n)s.has(d)||(l=l??[],l.push(d));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&va.test(s)&&l.issues.length){let h=t.keyType._zod.run({value:Number(s),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>Qe(h,o,Ae())),input:s,path:[s],inst:e});continue}let p=t.valueType._zod.run({value:n[s],issues:[]},o);p instanceof Promise?i.push(p.then(h=>{h.issues.length&&r.issues.push(...it(s,h.issues)),r.value[l.value]=h.value})):(p.issues.length&&r.issues.push(...it(s,p.issues)),r.value[l.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Eu=_("$ZodMap",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let l=t.keyType._zod.run({value:a,issues:[]},o),d=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise||d instanceof Promise?i.push(Promise.all([l,d]).then(([p,h])=>{rv(p,h,r,a,n,e,o)})):rv(l,d,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});$u=_("$ZodSet",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(l=>ov(l,r))):ov(s,r)}return i.length?Promise.all(i).then(()=>r):r}});Tu=_("$ZodEnum",(e,t)=>{ae.init(e,t);let r=Ao(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Co.has(typeof n)).map(n=>typeof n=="string"?vt(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Au=_("$ZodLiteral",(e,t)=>{if(ae.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?vt(o):o?vt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Iu=_("$ZodFile",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Cu=_("$ZodTransform",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new hn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Et;return r.value=n,r.fallback=!0,r}});Ca=_("$ZodOptional",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>iv(a,n)):iv(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Pu=_("$ZodExactOptional",(e,t)=>{Ca.init(e,t),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Ou=_("$ZodNullable",(e,t)=>{ae.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)}|null)$`):void 0}),pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Nu=_("$ZodDefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>av(i,t)):av(n,t)}});Ru=_("$ZodPrefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Lu=_("$ZodNonOptional",(e,t)=>{ae.init(e,t),pe(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>sv(i,e)):sv(n,e)}});Du=_("$ZodSuccess",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new hn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),ju=_("$ZodCatch",(e,t)=>{ae.init(e,t),e._zod.optin="optional",pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Qe(a,o,Ae()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Qe(i,o,Ae()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Mu=_("$ZodNaN",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Pa=_("$ZodPipe",(e,t)=>{ae.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>xa(a,t.in,o)):xa(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>xa(i,t.out,o)):xa(n,t.out,o)}});Fo=_("$ZodCodec",(e,t)=>{ae.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Sa(a,t,o)):Sa(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Sa(a,t,o)):Sa(i,t,o)}}});Uu=_("$ZodPreprocess",(e,t)=>{Pa.init(e,t)}),zu=_("$ZodReadonly",(e,t)=>{ae.init(e,t),pe(e._zod,"propValues",()=>t.innerType._zod.propValues),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"optin",()=>t.innerType?._zod?.optin),pe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(cv):cv(n)}});Fu=_("$ZodTemplateLiteral",(e,t)=>{ae.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||Il.has(typeof o))r.push(vt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Gu=_("$ZodFunction",(e,t)=>(ae.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?sa(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?sa(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await ca(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await ca(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Ia({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Bu=_("$ZodPromise",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Wu=_("$ZodLazy",(e,t)=>{ae.init(e,t),pe(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),pe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),pe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),pe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),pe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Ku=_("$ZodCustom",(e,t)=>{we.init(e,t),ae.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>lv(i,r,o,e));lv(n,r,o,e)}})});function fv(){return{localeError:P0()}}var P0,gv=v(()=>{ne();P0=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${z(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${T(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function yv(){return{localeError:O0()}}var O0,vv=v(()=>{ne();O0=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${z(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function bv(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function wv(){return{localeError:N0()}}var N0,_v=v(()=>{ne();N0=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${z(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=bv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=bv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function kv(){return{localeError:R0()}}var R0,xv=v(()=>{ne();R0=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${z(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function Sv(){return{localeError:L0()}}var L0,Ev=v(()=>{ne();L0=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${z(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${T(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function $v(){return{localeError:D0()}}var D0,Tv=v(()=>{ne();D0=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${z(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${T(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function Av(){return{localeError:j0()}}var j0,Iv=v(()=>{ne();j0=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${z(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function Cv(){return{localeError:M0()}}var M0,Pv=v(()=>{ne();M0=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${z(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Ov(){return{localeError:U0()}}var U0,Nv=v(()=>{ne();U0=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${z(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Oa(){return{localeError:z0()}}var z0,Zu=v(()=>{ne();z0=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.values[0])}`:`Invalid option: expected one of ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function Rv(){return{localeError:F0()}}var F0,Lv=v(()=>{ne();F0=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${z(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function Dv(){return{localeError:G0()}}var G0,jv=v(()=>{ne();G0=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${z(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function Mv(){return{localeError:B0()}}var B0,Uv=v(()=>{ne();B0=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${z(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${T(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${T(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function zv(){return{localeError:W0()}}var W0,Fv=v(()=>{ne();W0=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${z(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${T(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function Gv(){return{localeError:K0()}}var K0,Bv=v(()=>{ne();K0=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${z(n.values[0])} attendu`:`Option invalide : une valeur parmi ${T(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Wv(){return{localeError:H0()}}var H0,Kv=v(()=>{ne();H0=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${z(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Hv(){return{localeError:Z0()}}var Z0,Zv=v(()=>{ne();Z0=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=d=>d?e[d]:void 0,o=d=>{let p=r(d);return p?p.label:d??e.unknown.label},n=d=>`\u05D4${o(d)}`,i=d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=d=>d?t[d]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let p=d.expected,h=l[p??""]??o(p),f=F(d.input),y=l[f]??e[f]?.label??f;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${z(d.values[0])}`;let p=d.values.map(y=>z(y));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let h=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${h}`}case"too_big":{let p=a(d.origin),h=n(d.origin??"value");if(d.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${p?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let k=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${k}`}if(d.origin==="array"||d.origin==="set"){let k=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",D=d.inclusive?`${d.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${D}`.trim()}let f=d.inclusive?"<=":"<",y=i(d.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.maximum.toString()}`}case"too_small":{let p=a(d.origin),h=n(d.origin??"value");if(d.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${p?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let k=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${k}`}if(d.origin==="array"||d.origin==="set"){let k=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let b=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let D=d.inclusive?`${d.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${D}`.trim()}let f=d.inclusive?">=":">",y=i(d.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.minimum.toString()}`}case"invalid_format":{let p=d;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let h=s[p.format],f=h?.label??p.format,k=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${k}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${T(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Vv(){return{localeError:V0()}}var V0,Yv=v(()=>{ne();V0=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${z(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function qv(){return{localeError:Y0()}}var Y0,Jv=v(()=>{ne();Y0=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${z(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Xv(e,t,r){return Math.abs(e)===1?t:r}function wr(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function Qv(){return{localeError:q0()}}var q0,eb=v(()=>{ne();q0=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${z(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Xv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Xv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wr(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${T(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${wr(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${wr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function tb(){return{localeError:J0()}}var J0,nb=v(()=>{ne();J0=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${z(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function rb(){return{localeError:X0()}}var X0,ob=v(()=>{ne();X0=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${z(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${T(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function ib(){return{localeError:Q0()}}var Q0,ab=v(()=>{ne();Q0=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${z(n.values[0])}`:`Opzione non valida: atteso uno tra ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${T(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function sb(){return{localeError:eI()}}var eI,cb=v(()=>{ne();eI=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${z(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${T(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${T(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function lb(){return{localeError:tI()}}var tI,db=v(()=>{ne();tI=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${z(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${T(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Na(){return{localeError:nI()}}var nI,Vu=v(()=>{ne();nI=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${z(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${T(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function ub(){return Na()}var pb=v(()=>{Vu()});function hb(){return{localeError:rI()}}var rI,mb=v(()=>{ne();rI=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${z(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${T(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${T(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function fb(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function gb(){return{localeError:oI()}}var Go,oI,yb=v(()=>{ne();Go=e=>e.charAt(0).toUpperCase()+e.slice(1);oI=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${z(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${T(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,fb(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Go(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Go(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,fb(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Go(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Go(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${T(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Go(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function vb(){return{localeError:iI()}}var iI,bb=v(()=>{ne();iI=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function wb(){return{localeError:aI()}}var aI,_b=v(()=>{ne();aI=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${z(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function kb(){return{localeError:sI()}}var sI,xb=v(()=>{ne();sI=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${z(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function Sb(){return{localeError:cI()}}var cI,Eb=v(()=>{ne();cI=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${z(n.values[0])}`:`Ugyldig valg: forventet en av ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function $b(){return{localeError:lI()}}var lI,Tb=v(()=>{ne();lI=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${z(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Ab(){return{localeError:dI()}}var dI,Ib=v(()=>{ne();dI=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${z(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${T(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function Cb(){return{localeError:uI()}}var uI,Pb=v(()=>{ne();uI=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${z(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function Ob(){return{localeError:pI()}}var pI,Nb=v(()=>{ne();pI=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${z(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function Rb(){return{localeError:hI()}}var hI,Lb=v(()=>{ne();hI=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${z(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${T(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function Db(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function jb(){return{localeError:mI()}}var mI,Mb=v(()=>{ne();mI=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${z(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Db(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Db(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function Ub(){return{localeError:fI()}}var fI,zb=v(()=>{ne();fI=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${z(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function Fb(){return{localeError:gI()}}var gI,Gb=v(()=>{ne();gI=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${z(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function Bb(){return{localeError:yI()}}var yI,Wb=v(()=>{ne();yI=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${T(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function Kb(){return{localeError:vI()}}var vI,Hb=v(()=>{ne();vI=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${z(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${T(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function Zb(){return{localeError:bI()}}var bI,Vb=v(()=>{ne();bI=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${z(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function Ra(){return{localeError:wI()}}var wI,Yu=v(()=>{ne();wI=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${z(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function Yb(){return Ra()}var qb=v(()=>{Yu()});function Jb(){return{localeError:_I()}}var _I,Xb=v(()=>{ne();_I=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${z(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${T(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${T(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Qb(){return{localeError:kI()}}var kI,ew=v(()=>{ne();kI=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${z(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function tw(){return{localeError:xI()}}var xI,nw=v(()=>{ne();xI=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${z(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${T(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function rw(){return{localeError:SI()}}var SI,ow=v(()=>{ne();SI=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${z(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function iw(){return{localeError:EI()}}var EI,aw=v(()=>{ne();EI=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${z(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${T(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function sw(){return{localeError:$I()}}var $I,cw=v(()=>{ne();$I=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${z(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${T(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var Bo={};Ot(Bo,{ar:()=>fv,az:()=>yv,be:()=>wv,bg:()=>kv,ca:()=>Sv,cs:()=>$v,da:()=>Av,de:()=>Cv,el:()=>Ov,en:()=>Oa,eo:()=>Rv,es:()=>Dv,fa:()=>Mv,fi:()=>zv,fr:()=>Gv,frCA:()=>Wv,he:()=>Hv,hr:()=>Vv,hu:()=>qv,hy:()=>Qv,id:()=>tb,is:()=>rb,it:()=>ib,ja:()=>sb,ka:()=>lb,kh:()=>ub,km:()=>Na,ko:()=>hb,lt:()=>gb,mk:()=>vb,ms:()=>wb,nl:()=>kb,no:()=>Sb,ota:()=>$b,pl:()=>Cb,ps:()=>Ab,pt:()=>Ob,ro:()=>Rb,ru:()=>jb,sl:()=>Ub,sv:()=>Fb,ta:()=>Bb,th:()=>Kb,tr:()=>Zb,ua:()=>Yb,uk:()=>Ra,ur:()=>Jb,uz:()=>Qb,vi:()=>tw,yo:()=>sw,zhCN:()=>rw,zhTW:()=>iw});var qu=v(()=>{gv();vv();_v();xv();Ev();Tv();Iv();Pv();Nv();Zu();Lv();jv();Uv();Fv();Bv();Kv();Zv();Yv();Jv();eb();nb();ob();ab();cb();db();pb();Vu();mb();yb();bb();_b();xb();Eb();Tb();Ib();Pb();Nb();Lb();Mb();zb();Gb();Wb();Hb();Vb();qb();Yu();Xb();ew();nw();ow();aw();cw()});function Da(){return new La}var lw,Ju,Xu,La,Ue,Wo=v(()=>{Ju=Symbol("ZodOutput"),Xu=Symbol("ZodInput"),La=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(lw=globalThis).__zod_globalRegistry??(lw.__zod_globalRegistry=Da());Ue=globalThis.__zod_globalRegistry});function Qu(e,t){return new e({type:"string",...H(t)})}function ep(e,t){return new e({type:"string",coerce:!0,...H(t)})}function ja(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...H(t)})}function Ko(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...H(t)})}function Ma(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...H(t)})}function Ua(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(t)})}function za(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(t)})}function Fa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(t)})}function Ho(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}function Ga(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...H(t)})}function Ba(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(t)})}function Wa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...H(t)})}function Ka(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(t)})}function Ha(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...H(t)})}function Za(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...H(t)})}function Va(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(t)})}function Ya(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(t)})}function qa(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(t)})}function tp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...H(t)})}function Ja(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(t)})}function Xa(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(t)})}function Qa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...H(t)})}function es(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...H(t)})}function ts(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...H(t)})}function ns(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...H(t)})}function rp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(t)})}function op(e,t){return new e({type:"string",format:"date",check:"string_format",...H(t)})}function ip(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...H(t)})}function ap(e,t){return new e({type:"string",format:"duration",check:"string_format",...H(t)})}function sp(e,t){return new e({type:"number",checks:[],...H(t)})}function cp(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}function lp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}function dp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...H(t)})}function up(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...H(t)})}function pp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...H(t)})}function hp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...H(t)})}function mp(e,t){return new e({type:"boolean",...H(t)})}function fp(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}function gp(e,t){return new e({type:"bigint",...H(t)})}function yp(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}function vp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...H(t)})}function bp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...H(t)})}function wp(e,t){return new e({type:"symbol",...H(t)})}function _p(e,t){return new e({type:"undefined",...H(t)})}function kp(e,t){return new e({type:"null",...H(t)})}function xp(e){return new e({type:"any"})}function Sp(e){return new e({type:"unknown"})}function Ep(e,t){return new e({type:"never",...H(t)})}function $p(e,t){return new e({type:"void",...H(t)})}function Tp(e,t){return new e({type:"date",...H(t)})}function Ap(e,t){return new e({type:"date",coerce:!0,...H(t)})}function Ip(e,t){return new e({type:"nan",...H(t)})}function Rt(e,t){return new wa({check:"less_than",...H(t),value:e,inclusive:!1})}function ht(e,t){return new wa({check:"less_than",...H(t),value:e,inclusive:!0})}function Lt(e,t){return new _a({check:"greater_than",...H(t),value:e,inclusive:!1})}function et(e,t){return new _a({check:"greater_than",...H(t),value:e,inclusive:!0})}function rs(e){return Lt(0,e)}function os(e){return Rt(0,e)}function is(e){return ht(0,e)}function as(e){return et(0,e)}function vn(e,t){return new fd({check:"multiple_of",...H(t),value:e})}function bn(e,t){return new vd({check:"max_size",...H(t),maximum:e})}function Dt(e,t){return new bd({check:"min_size",...H(t),minimum:e})}function Hn(e,t){return new wd({check:"size_equals",...H(t),size:e})}function Zn(e,t){return new _d({check:"max_length",...H(t),maximum:e})}function Jt(e,t){return new kd({check:"min_length",...H(t),minimum:e})}function Vn(e,t){return new xd({check:"length_equals",...H(t),length:e})}function _r(e,t){return new Sd({check:"string_format",format:"regex",...H(t),pattern:e})}function kr(e){return new Ed({check:"string_format",format:"lowercase",...H(e)})}function xr(e){return new $d({check:"string_format",format:"uppercase",...H(e)})}function Sr(e,t){return new Td({check:"string_format",format:"includes",...H(t),includes:e})}function Er(e,t){return new Ad({check:"string_format",format:"starts_with",...H(t),prefix:e})}function $r(e,t){return new Id({check:"string_format",format:"ends_with",...H(t),suffix:e})}function ss(e,t,r){return new Cd({check:"property",property:e,schema:t,...H(r)})}function Tr(e,t){return new Pd({check:"mime_type",mime:e,...H(t)})}function $t(e){return new Od({check:"overwrite",tx:e})}function Ar(e){return $t(t=>t.normalize(e))}function Ir(){return $t(e=>e.trim())}function Cr(){return $t(e=>e.toLowerCase())}function Pr(){return $t(e=>e.toUpperCase())}function Or(){return $t(e=>$l(e))}function Cp(e,t,r){return new e({type:"array",element:t,...H(r)})}function AI(e,t,r){return new e({type:"union",options:t,...H(r)})}function II(e,t,r){return new e({type:"union",options:t,inclusive:!1,...H(r)})}function CI(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...H(o)})}function PI(e,t,r){return new e({type:"intersection",left:t,right:r})}function OI(e,t,r,o){let n=r instanceof ae,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...H(i)})}function NI(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...H(o)})}function RI(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...H(o)})}function LI(e,t,r){return new e({type:"set",valueType:t,...H(r)})}function DI(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...H(r)})}function jI(e,t,r){return new e({type:"enum",entries:t,...H(r)})}function MI(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...H(r)})}function Pp(e,t){return new e({type:"file",...H(t)})}function UI(e,t){return new e({type:"transform",transform:t})}function zI(e,t){return new e({type:"optional",innerType:t})}function FI(e,t){return new e({type:"nullable",innerType:t})}function GI(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Al(r)}})}function BI(e,t,r){return new e({type:"nonoptional",innerType:t,...H(r)})}function WI(e,t){return new e({type:"success",innerType:t})}function KI(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function HI(e,t,r){return new e({type:"pipe",in:t,out:r})}function ZI(e,t){return new e({type:"readonly",innerType:t})}function VI(e,t,r){return new e({type:"template_literal",parts:t,...H(r)})}function YI(e,t){return new e({type:"lazy",getter:t})}function qI(e,t){return new e({type:"promise",innerType:t})}function Op(e,t,r){let o=H(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Np(e,t,r){return new e({type:"custom",check:"custom",fn:t,...H(r)})}function Rp(e,t){let r=dw(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(mr(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(mr(i))}},e(o.value,o)),t);return r}function dw(e,t){let r=new we({check:"custom",...H(t)});return r._zod.check=e,r}function Lp(e){let t=new we({check:"describe"});return t._zod.onattach=[r=>{let o=Ue.get(r)??{};Ue.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Dp(e){let t=new we({check:"meta"});return t._zod.onattach=[r=>{let o=Ue.get(r)??{};Ue.add(r,{...o,...e})}],t._zod.check=()=>{},t}function jp(e,t){let r=H(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(y=>typeof y=="string"?y.toLowerCase():y),n=n.map(y=>typeof y=="string"?y.toLowerCase():y));let i=new Set(o),a=new Set(n),s=e.Codec??Fo,l=e.Boolean??Uo,d=e.String??Kn,p=new d({type:"string",error:r.error}),h=new l({type:"boolean",error:r.error}),f=new s({type:"pipe",in:p,out:h,transform:((y,k)=>{let D=y;return r.case!=="sensitive"&&(D=D.toLowerCase()),i.has(D)?!0:a.has(D)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:k.value,inst:f,continue:!1}),{})}),reverseTransform:((y,k)=>y===!0?o[0]||"true":n[0]||"false"),error:r.error});return f}function Nr(e,t,r,o={}){let n=H(o),i={...H(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}var np,uw=v(()=>{ka();Wo();Hu();ne();np={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function wn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ue,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 ye(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,p);else{let f=a.schema,y=t.processors[n.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(e,t,f,p)}let h=e._zod.parent;h&&(a.ref||(a.ref=h),ye(h,t,p),t.seen.get(h).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&tt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function _n(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let l=o.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let h=e.external.registry.get(a[0])?.id,f=e.external.uri??(k=>k);if(h)return{ref:f(h)};let y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${f("__shared")}#/${s}/${y}`}}if(a[1]===r)return{ref:"#"};let d=`#/${s}/`,p=a[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:d+p}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:d}=n(a);s.def={...s.schema},d&&(s.defId=d);let p=s.schema;for(let h in p)delete p[h];p.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
75
+ `)}y.write("payload.value = newResult;"),y.write("return payload;");let S=y.compile();return(w,C)=>S(f,w,C)},i,a=Bn,s=!Fn.jitless,d=s&&Tl.value,p=t.catchall,h;e._zod.parse=(f,y)=>{h??(h=o.value);let k=f.value;return a(k)?s&&d&&y?.async===!1&&y.jitless!==!0?(i||(i=n(t.shape)),f=i(f,y),p?hv([],k,f,y,h,e):f):r(f,y):(f.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),f)}});zo=_("$ZodUnion",(e,t)=>{ae.init(e,t),pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),pe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Io(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(s=>Jy(s,o,e,n)):Jy(a,o,e,n)}});_u=_("$ZodXor",(e,t)=>{zo.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(a.push(l),i=!0):a.push(l)}return i?Promise.all(a).then(s=>Xy(s,o,e,n)):Xy(a,o,e,n)}}),ku=_("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,zo.init(e,t);let r=e._zod.parse;pe(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let d of l)n[s].add(d)}}return n});let o=mr(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Bn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),xu=_("$ZodIntersection",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,d])=>Qy(r,l,d)):Qy(r,i,a)}});Ia=_("$ZodTuple",(e,t)=>{ae.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=ev(r,"optin"),l=ev(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let d=new Array(r.length);for(let p=0;p<r.length;p++){let h=r[p]._zod.run({value:i[p],issues:[]},n);h instanceof Promise?a.push(h.then(f=>{d[p]=f})):d[p]=h}if(t.rest){let p=r.length-1,h=i.slice(r.length);for(let f of h){p++;let y=t.rest._zod.run({value:f,issues:[]},n);y instanceof Promise?a.push(y.then(k=>tv(k,o,p))):tv(y,o,p)}}return a.length?Promise.all(a).then(()=>nv(d,o,r,i,l)):nv(d,o,r,i,l)}});Su=_("$ZodRecord",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!gn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){s.add(typeof d=="number"?d.toString():d);let p=t.keyType._zod.run({value:d,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>Qe(y,o,Ae())),input:d,path:[d],inst:e});continue}let h=p.value,f=t.valueType._zod.run({value:n[d],issues:[]},o);f instanceof Promise?i.push(f.then(y=>{y.issues.length&&r.issues.push(...it(d,y.issues)),r.value[h]=y.value})):(f.issues.length&&r.issues.push(...it(d,f.issues)),r.value[h]=f.value)}let l;for(let d in n)s.has(d)||(l=l??[],l.push(d));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&va.test(s)&&l.issues.length){let h=t.keyType._zod.run({value:Number(s),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>Qe(h,o,Ae())),input:s,path:[s],inst:e});continue}let p=t.valueType._zod.run({value:n[s],issues:[]},o);p instanceof Promise?i.push(p.then(h=>{h.issues.length&&r.issues.push(...it(s,h.issues)),r.value[l.value]=h.value})):(p.issues.length&&r.issues.push(...it(s,p.issues)),r.value[l.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Eu=_("$ZodMap",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let l=t.keyType._zod.run({value:a,issues:[]},o),d=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise||d instanceof Promise?i.push(Promise.all([l,d]).then(([p,h])=>{rv(p,h,r,a,n,e,o)})):rv(l,d,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});$u=_("$ZodSet",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(l=>ov(l,r))):ov(s,r)}return i.length?Promise.all(i).then(()=>r):r}});Tu=_("$ZodEnum",(e,t)=>{ae.init(e,t);let r=Ao(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Co.has(typeof n)).map(n=>typeof n=="string"?vt(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Au=_("$ZodLiteral",(e,t)=>{if(ae.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?vt(o):o?vt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Iu=_("$ZodFile",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Cu=_("$ZodTransform",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new hn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Et;return r.value=n,r.fallback=!0,r}});Ca=_("$ZodOptional",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>iv(a,n)):iv(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Pu=_("$ZodExactOptional",(e,t)=>{Ca.init(e,t),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Ou=_("$ZodNullable",(e,t)=>{ae.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)}|null)$`):void 0}),pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Nu=_("$ZodDefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>av(i,t)):av(n,t)}});Ru=_("$ZodPrefault",(e,t)=>{ae.init(e,t),e._zod.optin="optional",pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Lu=_("$ZodNonOptional",(e,t)=>{ae.init(e,t),pe(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>sv(i,e)):sv(n,e)}});Du=_("$ZodSuccess",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new hn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),ju=_("$ZodCatch",(e,t)=>{ae.init(e,t),e._zod.optin="optional",pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Qe(a,o,Ae()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Qe(i,o,Ae()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Mu=_("$ZodNaN",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Pa=_("$ZodPipe",(e,t)=>{ae.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>xa(a,t.in,o)):xa(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>xa(i,t.out,o)):xa(n,t.out,o)}});Fo=_("$ZodCodec",(e,t)=>{ae.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Sa(a,t,o)):Sa(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Sa(a,t,o)):Sa(i,t,o)}}});Uu=_("$ZodPreprocess",(e,t)=>{Pa.init(e,t)}),zu=_("$ZodReadonly",(e,t)=>{ae.init(e,t),pe(e._zod,"propValues",()=>t.innerType._zod.propValues),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"optin",()=>t.innerType?._zod?.optin),pe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(cv):cv(n)}});Fu=_("$ZodTemplateLiteral",(e,t)=>{ae.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||Il.has(typeof o))r.push(vt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Gu=_("$ZodFunction",(e,t)=>(ae.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?sa(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?sa(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await ca(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await ca(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Ia({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Bu=_("$ZodPromise",(e,t)=>{ae.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Wu=_("$ZodLazy",(e,t)=>{ae.init(e,t),pe(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),pe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),pe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),pe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),pe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Ku=_("$ZodCustom",(e,t)=>{we.init(e,t),ae.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>lv(i,r,o,e));lv(n,r,o,e)}})});function fv(){return{localeError:D0()}}var D0,gv=v(()=>{ne();D0=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${z(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${T(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function yv(){return{localeError:j0()}}var j0,vv=v(()=>{ne();j0=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${z(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function bv(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function wv(){return{localeError:M0()}}var M0,_v=v(()=>{ne();M0=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${z(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=bv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=bv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function kv(){return{localeError:U0()}}var U0,xv=v(()=>{ne();U0=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${z(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function Sv(){return{localeError:z0()}}var z0,Ev=v(()=>{ne();z0=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${z(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${T(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function $v(){return{localeError:F0()}}var F0,Tv=v(()=>{ne();F0=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${z(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${T(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function Av(){return{localeError:G0()}}var G0,Iv=v(()=>{ne();G0=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${z(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function Cv(){return{localeError:B0()}}var B0,Pv=v(()=>{ne();B0=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${z(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Ov(){return{localeError:W0()}}var W0,Nv=v(()=>{ne();W0=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${z(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Oa(){return{localeError:K0()}}var K0,Zu=v(()=>{ne();K0=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.values[0])}`:`Invalid option: expected one of ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function Rv(){return{localeError:H0()}}var H0,Lv=v(()=>{ne();H0=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${z(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function Dv(){return{localeError:Z0()}}var Z0,jv=v(()=>{ne();Z0=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${z(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function Mv(){return{localeError:V0()}}var V0,Uv=v(()=>{ne();V0=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${z(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${T(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${T(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function zv(){return{localeError:Y0()}}var Y0,Fv=v(()=>{ne();Y0=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${z(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${T(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function Gv(){return{localeError:q0()}}var q0,Bv=v(()=>{ne();q0=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${z(n.values[0])} attendu`:`Option invalide : une valeur parmi ${T(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Wv(){return{localeError:J0()}}var J0,Kv=v(()=>{ne();J0=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${z(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Hv(){return{localeError:X0()}}var X0,Zv=v(()=>{ne();X0=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=d=>d?e[d]:void 0,o=d=>{let p=r(d);return p?p.label:d??e.unknown.label},n=d=>`\u05D4${o(d)}`,i=d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=d=>d?t[d]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let p=d.expected,h=l[p??""]??o(p),f=F(d.input),y=l[f]??e[f]?.label??f;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${z(d.values[0])}`;let p=d.values.map(y=>z(y));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let h=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${h}`}case"too_big":{let p=a(d.origin),h=n(d.origin??"value");if(d.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${p?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let k=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${k}`}if(d.origin==="array"||d.origin==="set"){let k=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",D=d.inclusive?`${d.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${D}`.trim()}let f=d.inclusive?"<=":"<",y=i(d.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.maximum.toString()}`}case"too_small":{let p=a(d.origin),h=n(d.origin??"value");if(d.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${p?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let k=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${k}`}if(d.origin==="array"||d.origin==="set"){let k=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let b=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let D=d.inclusive?`${d.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${D}`.trim()}let f=d.inclusive?">=":">",y=i(d.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${y} ${f}${d.minimum.toString()}`}case"invalid_format":{let p=d;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let h=s[p.format],f=h?.label??p.format,k=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${k}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${T(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Vv(){return{localeError:Q0()}}var Q0,Yv=v(()=>{ne();Q0=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${z(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function qv(){return{localeError:eI()}}var eI,Jv=v(()=>{ne();eI=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${z(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Xv(e,t,r){return Math.abs(e)===1?t:r}function _r(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function Qv(){return{localeError:tI()}}var tI,eb=v(()=>{ne();tI=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${z(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Xv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${_r(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${_r(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Xv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${_r(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${_r(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${T(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${_r(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${_r(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function tb(){return{localeError:nI()}}var nI,nb=v(()=>{ne();nI=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${z(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function rb(){return{localeError:rI()}}var rI,ob=v(()=>{ne();rI=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${z(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${T(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function ib(){return{localeError:oI()}}var oI,ab=v(()=>{ne();oI=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${z(n.values[0])}`:`Opzione non valida: atteso uno tra ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${T(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function sb(){return{localeError:iI()}}var iI,cb=v(()=>{ne();iI=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${z(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${T(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${T(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function lb(){return{localeError:aI()}}var aI,db=v(()=>{ne();aI=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${z(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${T(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Na(){return{localeError:sI()}}var sI,Vu=v(()=>{ne();sI=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${z(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${T(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function ub(){return Na()}var pb=v(()=>{Vu()});function hb(){return{localeError:cI()}}var cI,mb=v(()=>{ne();cI=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${z(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${T(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${T(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function fb(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function gb(){return{localeError:lI()}}var Go,lI,yb=v(()=>{ne();Go=e=>e.charAt(0).toUpperCase()+e.slice(1);lI=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${z(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${T(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,fb(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Go(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Go(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,fb(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Go(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Go(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${T(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Go(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function vb(){return{localeError:dI()}}var dI,bb=v(()=>{ne();dI=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function wb(){return{localeError:uI()}}var uI,_b=v(()=>{ne();uI=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${z(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function kb(){return{localeError:pI()}}var pI,xb=v(()=>{ne();pI=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${z(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function Sb(){return{localeError:hI()}}var hI,Eb=v(()=>{ne();hI=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${z(n.values[0])}`:`Ugyldig valg: forventet en av ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function $b(){return{localeError:mI()}}var mI,Tb=v(()=>{ne();mI=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${z(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Ab(){return{localeError:fI()}}var fI,Ib=v(()=>{ne();fI=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${z(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${T(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function Cb(){return{localeError:gI()}}var gI,Pb=v(()=>{ne();gI=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${z(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function Ob(){return{localeError:yI()}}var yI,Nb=v(()=>{ne();yI=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${z(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function Rb(){return{localeError:vI()}}var vI,Lb=v(()=>{ne();vI=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${z(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${T(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function Db(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function jb(){return{localeError:bI()}}var bI,Mb=v(()=>{ne();bI=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${z(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Db(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Db(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function Ub(){return{localeError:wI()}}var wI,zb=v(()=>{ne();wI=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${z(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function Fb(){return{localeError:_I()}}var _I,Gb=v(()=>{ne();_I=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${z(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function Bb(){return{localeError:kI()}}var kI,Wb=v(()=>{ne();kI=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${T(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function Kb(){return{localeError:xI()}}var xI,Hb=v(()=>{ne();xI=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${z(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${T(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function Zb(){return{localeError:SI()}}var SI,Vb=v(()=>{ne();SI=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${z(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function Ra(){return{localeError:EI()}}var EI,Yu=v(()=>{ne();EI=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${z(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function Yb(){return Ra()}var qb=v(()=>{Yu()});function Jb(){return{localeError:$I()}}var $I,Xb=v(()=>{ne();$I=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${z(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${T(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${T(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Qb(){return{localeError:TI()}}var TI,ew=v(()=>{ne();TI=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${z(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function tw(){return{localeError:AI()}}var AI,nw=v(()=>{ne();AI=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${z(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${T(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function rw(){return{localeError:II()}}var II,ow=v(()=>{ne();II=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${z(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function iw(){return{localeError:CI()}}var CI,aw=v(()=>{ne();CI=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${z(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${T(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function sw(){return{localeError:PI()}}var PI,cw=v(()=>{ne();PI=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=F(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${z(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${T(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var Bo={};Ot(Bo,{ar:()=>fv,az:()=>yv,be:()=>wv,bg:()=>kv,ca:()=>Sv,cs:()=>$v,da:()=>Av,de:()=>Cv,el:()=>Ov,en:()=>Oa,eo:()=>Rv,es:()=>Dv,fa:()=>Mv,fi:()=>zv,fr:()=>Gv,frCA:()=>Wv,he:()=>Hv,hr:()=>Vv,hu:()=>qv,hy:()=>Qv,id:()=>tb,is:()=>rb,it:()=>ib,ja:()=>sb,ka:()=>lb,kh:()=>ub,km:()=>Na,ko:()=>hb,lt:()=>gb,mk:()=>vb,ms:()=>wb,nl:()=>kb,no:()=>Sb,ota:()=>$b,pl:()=>Cb,ps:()=>Ab,pt:()=>Ob,ro:()=>Rb,ru:()=>jb,sl:()=>Ub,sv:()=>Fb,ta:()=>Bb,th:()=>Kb,tr:()=>Zb,ua:()=>Yb,uk:()=>Ra,ur:()=>Jb,uz:()=>Qb,vi:()=>tw,yo:()=>sw,zhCN:()=>rw,zhTW:()=>iw});var qu=v(()=>{gv();vv();_v();xv();Ev();Tv();Iv();Pv();Nv();Zu();Lv();jv();Uv();Fv();Bv();Kv();Zv();Yv();Jv();eb();nb();ob();ab();cb();db();pb();Vu();mb();yb();bb();_b();xb();Eb();Tb();Ib();Pb();Nb();Lb();Mb();zb();Gb();Wb();Hb();Vb();qb();Yu();Xb();ew();nw();ow();aw();cw()});function Da(){return new La}var lw,Ju,Xu,La,Ue,Wo=v(()=>{Ju=Symbol("ZodOutput"),Xu=Symbol("ZodInput"),La=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(lw=globalThis).__zod_globalRegistry??(lw.__zod_globalRegistry=Da());Ue=globalThis.__zod_globalRegistry});function Qu(e,t){return new e({type:"string",...H(t)})}function ep(e,t){return new e({type:"string",coerce:!0,...H(t)})}function ja(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...H(t)})}function Ko(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...H(t)})}function Ma(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...H(t)})}function Ua(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(t)})}function za(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(t)})}function Fa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(t)})}function Ho(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}function Ga(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...H(t)})}function Ba(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(t)})}function Wa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...H(t)})}function Ka(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(t)})}function Ha(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...H(t)})}function Za(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...H(t)})}function Va(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(t)})}function Ya(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(t)})}function qa(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(t)})}function tp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...H(t)})}function Ja(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(t)})}function Xa(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(t)})}function Qa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...H(t)})}function es(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...H(t)})}function ts(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...H(t)})}function ns(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...H(t)})}function rp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(t)})}function op(e,t){return new e({type:"string",format:"date",check:"string_format",...H(t)})}function ip(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...H(t)})}function ap(e,t){return new e({type:"string",format:"duration",check:"string_format",...H(t)})}function sp(e,t){return new e({type:"number",checks:[],...H(t)})}function cp(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}function lp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}function dp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...H(t)})}function up(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...H(t)})}function pp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...H(t)})}function hp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...H(t)})}function mp(e,t){return new e({type:"boolean",...H(t)})}function fp(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}function gp(e,t){return new e({type:"bigint",...H(t)})}function yp(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}function vp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...H(t)})}function bp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...H(t)})}function wp(e,t){return new e({type:"symbol",...H(t)})}function _p(e,t){return new e({type:"undefined",...H(t)})}function kp(e,t){return new e({type:"null",...H(t)})}function xp(e){return new e({type:"any"})}function Sp(e){return new e({type:"unknown"})}function Ep(e,t){return new e({type:"never",...H(t)})}function $p(e,t){return new e({type:"void",...H(t)})}function Tp(e,t){return new e({type:"date",...H(t)})}function Ap(e,t){return new e({type:"date",coerce:!0,...H(t)})}function Ip(e,t){return new e({type:"nan",...H(t)})}function Rt(e,t){return new wa({check:"less_than",...H(t),value:e,inclusive:!1})}function ht(e,t){return new wa({check:"less_than",...H(t),value:e,inclusive:!0})}function Lt(e,t){return new _a({check:"greater_than",...H(t),value:e,inclusive:!1})}function et(e,t){return new _a({check:"greater_than",...H(t),value:e,inclusive:!0})}function rs(e){return Lt(0,e)}function os(e){return Rt(0,e)}function is(e){return ht(0,e)}function as(e){return et(0,e)}function vn(e,t){return new fd({check:"multiple_of",...H(t),value:e})}function bn(e,t){return new vd({check:"max_size",...H(t),maximum:e})}function Dt(e,t){return new bd({check:"min_size",...H(t),minimum:e})}function Hn(e,t){return new wd({check:"size_equals",...H(t),size:e})}function Zn(e,t){return new _d({check:"max_length",...H(t),maximum:e})}function Jt(e,t){return new kd({check:"min_length",...H(t),minimum:e})}function Vn(e,t){return new xd({check:"length_equals",...H(t),length:e})}function kr(e,t){return new Sd({check:"string_format",format:"regex",...H(t),pattern:e})}function xr(e){return new Ed({check:"string_format",format:"lowercase",...H(e)})}function Sr(e){return new $d({check:"string_format",format:"uppercase",...H(e)})}function Er(e,t){return new Td({check:"string_format",format:"includes",...H(t),includes:e})}function $r(e,t){return new Ad({check:"string_format",format:"starts_with",...H(t),prefix:e})}function Tr(e,t){return new Id({check:"string_format",format:"ends_with",...H(t),suffix:e})}function ss(e,t,r){return new Cd({check:"property",property:e,schema:t,...H(r)})}function Ar(e,t){return new Pd({check:"mime_type",mime:e,...H(t)})}function $t(e){return new Od({check:"overwrite",tx:e})}function Ir(e){return $t(t=>t.normalize(e))}function Cr(){return $t(e=>e.trim())}function Pr(){return $t(e=>e.toLowerCase())}function Or(){return $t(e=>e.toUpperCase())}function Nr(){return $t(e=>$l(e))}function Cp(e,t,r){return new e({type:"array",element:t,...H(r)})}function NI(e,t,r){return new e({type:"union",options:t,...H(r)})}function RI(e,t,r){return new e({type:"union",options:t,inclusive:!1,...H(r)})}function LI(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...H(o)})}function DI(e,t,r){return new e({type:"intersection",left:t,right:r})}function jI(e,t,r,o){let n=r instanceof ae,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...H(i)})}function MI(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...H(o)})}function UI(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...H(o)})}function zI(e,t,r){return new e({type:"set",valueType:t,...H(r)})}function FI(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...H(r)})}function GI(e,t,r){return new e({type:"enum",entries:t,...H(r)})}function BI(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...H(r)})}function Pp(e,t){return new e({type:"file",...H(t)})}function WI(e,t){return new e({type:"transform",transform:t})}function KI(e,t){return new e({type:"optional",innerType:t})}function HI(e,t){return new e({type:"nullable",innerType:t})}function ZI(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Al(r)}})}function VI(e,t,r){return new e({type:"nonoptional",innerType:t,...H(r)})}function YI(e,t){return new e({type:"success",innerType:t})}function qI(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function JI(e,t,r){return new e({type:"pipe",in:t,out:r})}function XI(e,t){return new e({type:"readonly",innerType:t})}function QI(e,t,r){return new e({type:"template_literal",parts:t,...H(r)})}function eC(e,t){return new e({type:"lazy",getter:t})}function tC(e,t){return new e({type:"promise",innerType:t})}function Op(e,t,r){let o=H(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Np(e,t,r){return new e({type:"custom",check:"custom",fn:t,...H(r)})}function Rp(e,t){let r=dw(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(fr(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(fr(i))}},e(o.value,o)),t);return r}function dw(e,t){let r=new we({check:"custom",...H(t)});return r._zod.check=e,r}function Lp(e){let t=new we({check:"describe"});return t._zod.onattach=[r=>{let o=Ue.get(r)??{};Ue.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Dp(e){let t=new we({check:"meta"});return t._zod.onattach=[r=>{let o=Ue.get(r)??{};Ue.add(r,{...o,...e})}],t._zod.check=()=>{},t}function jp(e,t){let r=H(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(y=>typeof y=="string"?y.toLowerCase():y),n=n.map(y=>typeof y=="string"?y.toLowerCase():y));let i=new Set(o),a=new Set(n),s=e.Codec??Fo,l=e.Boolean??Uo,d=e.String??Kn,p=new d({type:"string",error:r.error}),h=new l({type:"boolean",error:r.error}),f=new s({type:"pipe",in:p,out:h,transform:((y,k)=>{let D=y;return r.case!=="sensitive"&&(D=D.toLowerCase()),i.has(D)?!0:a.has(D)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:k.value,inst:f,continue:!1}),{})}),reverseTransform:((y,k)=>y===!0?o[0]||"true":n[0]||"false"),error:r.error});return f}function Rr(e,t,r,o={}){let n=H(o),i={...H(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}var np,uw=v(()=>{ka();Wo();Hu();ne();np={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function wn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ue,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 ye(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,p);else{let f=a.schema,y=t.processors[n.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(e,t,f,p)}let h=e._zod.parent;h&&(a.ref||(a.ref=h),ye(h,t,p),t.seen.get(h).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&tt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function _n(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let l=o.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let h=e.external.registry.get(a[0])?.id,f=e.external.uri??(k=>k);if(h)return{ref:f(h)};let y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${f("__shared")}#/${s}/${y}`}}if(a[1]===r)return{ref:"#"};let d=`#/${s}/`,p=a[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:d+p}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:d}=n(a);s.def={...s.schema},d&&(s.defId=d);let p=s.schema;for(let h in p)delete p[h];p.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
76
76
 
77
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function kn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let l=e.seen.get(s);if(l.ref===null)return;let d=l.def??l.schema,p={...d},h=l.ref;if(l.ref=null,h){o(h);let y=e.seen.get(h),k=y.schema;if(k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(k)):Object.assign(d,k),Object.assign(d,p),s._zod.parent===h)for(let b in d)b==="$ref"||b==="allOf"||b in p||delete d[b];if(k.$ref&&y.def)for(let b in d)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(d[b])===JSON.stringify(y.def[b])&&delete d[b]}let f=s._zod.parent;if(f&&f!==h){o(f);let y=e.seen.get(f);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(let k in d)k==="$ref"||k==="allOf"||k in y.def&&JSON.stringify(d[k])===JSON.stringify(y.def[k])&&delete d[k]}e.override({zodSchema:s,jsonSchema:d,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rr(t,"input",e.processors),output:Rr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function tt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return tt(o.element,r);if(o.type==="set")return tt(o.valueType,r);if(o.type==="lazy")return tt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return tt(o.innerType,r);if(o.type==="intersection")return tt(o.left,r)||tt(o.right,r);if(o.type==="record"||o.type==="map")return tt(o.keyType,r)||tt(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:tt(o.in,r)||tt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(tt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(tt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(tt(n,r))return!0;return!!(o.rest&&tt(o.rest,r))}return!1}var Mp,Rr,Zo=v(()=>{Wo();Mp=(e,t={})=>r=>{let o=wn({...r,processors:t});return ye(e,o),_n(o,e),kn(o,e)},Rr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=wn({...n??{},target:i,io:t,processors:r});return ye(e,a),_n(a,e),kn(a,e)}});function us(e,t){if("_idmap"in e){let o=e,n=wn({...t,processors:cs}),i={};for(let l of o._idmap.entries()){let[d,p]=l;ye(p,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let l of o._idmap.entries()){let[d,p]=l;_n(n,p),a[d]=kn(n,p)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:i}}return{schemas:a}}let r=wn({...t,processors:cs});return ye(e,r),_n(r,e),kn(r,e)}var JI,Up,zp,Fp,Gp,Bp,Wp,Kp,Hp,Zp,Vp,Yp,qp,Jp,Xp,Qp,eh,th,nh,rh,oh,ih,ah,sh,ch,lh,ls,dh,uh,ph,hh,mh,fh,gh,yh,vh,bh,wh,ds,_h,cs,Vo=v(()=>{Zo();ne();JI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Up=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:d}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=JI[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),d&&(n.contentEncoding=d),l&&l.size>0){let p=[...l];p.length===1?n.pattern=p[0].source:p.length>1&&(n.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},zp=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:d,exclusiveMinimum:p}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let h=typeof p=="number"&&p>=(i??Number.NEGATIVE_INFINITY),f=typeof d=="number"&&d<=(a??Number.POSITIVE_INFINITY),y=t.target==="draft-04"||t.target==="openapi-3.0";h?y?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),f?y?(n.maximum=d,n.exclusiveMaximum=!0):n.exclusiveMaximum=d:typeof a=="number"&&(n.maximum=a),typeof l=="number"&&(n.multipleOf=l)},Fp=(e,t,r,o)=>{r.type="boolean"},Gp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Bp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Wp=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Kp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Hp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Zp=(e,t,r,o)=>{r.not={}},Vp=(e,t,r,o)=>{},Yp=(e,t,r,o)=>{},qp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Jp=(e,t,r,o)=>{let n=e._zod.def,i=Ao(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Xp=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Qp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},eh=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},th=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(d=>({contentMediaType:d}))):Object.assign(n,i)},nh=(e,t,r,o)=>{r.type="boolean"},rh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},oh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ih=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ah=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},sh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},ch=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=ye(i.element,t,{...o,path:[...o.path,"items"]})},lh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let d in a)n.properties[d]=ye(a[d],t,{...o,path:[...o.path,"properties",d]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(d=>{let p=i.shape[d]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ye(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ls=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,l)=>ye(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},dh=(e,t,r,o)=>{let n=e._zod.def,i=ye(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=ye(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},uh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((f,y)=>ye(f,t,{...o,path:[...o.path,a,y]})),d=i.rest?ye(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,d&&(n.items=d)):t.target==="openapi-3.0"?(n.items={anyOf:l},d&&n.items.anyOf.push(d),n.minItems=l.length,d||(n.maxItems=l.length)):(n.items=l,d&&(n.additionalItems=d));let{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)},ph=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let p=ye(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let h of l)n.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=ye(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=ye(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let d=a._zod.values;if(d){let p=[...d].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(n.required=p)}},hh=(e,t,r,o)=>{let n=e._zod.def,i=ye(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},mh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},fh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},gh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},yh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},vh=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;ye(a,t,o);let s=t.seen.get(e);s.ref=a},bh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},wh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},ds=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},_h=(e,t,r,o)=>{let n=e._zod.innerType;ye(n,t,o);let i=t.seen.get(e);i.ref=n},cs={string:Up,number:zp,boolean:Fp,bigint:Gp,symbol:Bp,null:Wp,undefined:Kp,void:Hp,never:Zp,any:Vp,unknown:Yp,date:qp,enum:Jp,literal:Xp,nan:Qp,template_literal:eh,file:th,success:nh,custom:rh,function:oh,transform:ih,map:ah,set:sh,array:ch,object:lh,union:ls,intersection:dh,tuple:uh,record:ph,nullable:hh,nonoptional:mh,default:fh,prefault:gh,catch:yh,pipe:vh,readonly:bh,promise:wh,optional:ds,lazy:_h}});var ps,pw=v(()=>{Vo();Zo();ps=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=wn({processors:cs,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return ye(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),_n(this.ctx,t);let o=kn(this.ctx,t),{"~standard":n,...i}=o;return i}}});var hw={};var mw=v(()=>{});var Xt={};Ot(Xt,{$ZodAny:()=>mu,$ZodArray:()=>bu,$ZodAsyncError:()=>Et,$ZodBase64:()=>ou,$ZodBase64URL:()=>iu,$ZodBigInt:()=>Aa,$ZodBigIntFormat:()=>du,$ZodBoolean:()=>Uo,$ZodCIDRv4:()=>tu,$ZodCIDRv6:()=>nu,$ZodCUID:()=>Bd,$ZodCUID2:()=>Wd,$ZodCatch:()=>ju,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>yd,$ZodCheckEndsWith:()=>Id,$ZodCheckGreaterThan:()=>_a,$ZodCheckIncludes:()=>Td,$ZodCheckLengthEquals:()=>xd,$ZodCheckLessThan:()=>wa,$ZodCheckLowerCase:()=>Ed,$ZodCheckMaxLength:()=>_d,$ZodCheckMaxSize:()=>vd,$ZodCheckMimeType:()=>Pd,$ZodCheckMinLength:()=>kd,$ZodCheckMinSize:()=>bd,$ZodCheckMultipleOf:()=>fd,$ZodCheckNumberFormat:()=>gd,$ZodCheckOverwrite:()=>Od,$ZodCheckProperty:()=>Cd,$ZodCheckRegex:()=>Sd,$ZodCheckSizeEquals:()=>wd,$ZodCheckStartsWith:()=>Ad,$ZodCheckStringFormat:()=>br,$ZodCheckUpperCase:()=>$d,$ZodCodec:()=>Fo,$ZodCustom:()=>Ku,$ZodCustomStringFormat:()=>cu,$ZodDate:()=>vu,$ZodDefault:()=>Nu,$ZodDiscriminatedUnion:()=>ku,$ZodE164:()=>au,$ZodEmail:()=>Ud,$ZodEmoji:()=>Fd,$ZodEncodeError:()=>hn,$ZodEnum:()=>Tu,$ZodError:()=>No,$ZodExactOptional:()=>Pu,$ZodFile:()=>Iu,$ZodFunction:()=>Gu,$ZodGUID:()=>jd,$ZodIPv4:()=>Xd,$ZodIPv6:()=>Qd,$ZodISODate:()=>Yd,$ZodISODateTime:()=>Vd,$ZodISODuration:()=>Jd,$ZodISOTime:()=>qd,$ZodIntersection:()=>xu,$ZodJWT:()=>su,$ZodKSUID:()=>Zd,$ZodLazy:()=>Wu,$ZodLiteral:()=>Au,$ZodMAC:()=>eu,$ZodMap:()=>Eu,$ZodNaN:()=>Mu,$ZodNanoID:()=>Gd,$ZodNever:()=>gu,$ZodNonOptional:()=>Lu,$ZodNull:()=>hu,$ZodNullable:()=>Ou,$ZodNumber:()=>Ta,$ZodNumberFormat:()=>lu,$ZodObject:()=>mv,$ZodObjectJIT:()=>wu,$ZodOptional:()=>Ca,$ZodPipe:()=>Pa,$ZodPrefault:()=>Ru,$ZodPreprocess:()=>Uu,$ZodPromise:()=>Bu,$ZodReadonly:()=>zu,$ZodRealError:()=>at,$ZodRecord:()=>Su,$ZodRegistry:()=>La,$ZodSet:()=>$u,$ZodString:()=>Kn,$ZodStringFormat:()=>ve,$ZodSuccess:()=>Du,$ZodSymbol:()=>uu,$ZodTemplateLiteral:()=>Fu,$ZodTransform:()=>Cu,$ZodTuple:()=>Ia,$ZodType:()=>ae,$ZodULID:()=>Kd,$ZodURL:()=>zd,$ZodUUID:()=>Md,$ZodUndefined:()=>pu,$ZodUnion:()=>zo,$ZodUnknown:()=>fu,$ZodVoid:()=>yu,$ZodXID:()=>Hd,$ZodXor:()=>_u,$brand:()=>kl,$constructor:()=>_,$input:()=>Xu,$output:()=>Ju,Doc:()=>Mo,JSONSchema:()=>hw,JSONSchemaGenerator:()=>ps,NEVER:()=>_l,TimePrecision:()=>np,_any:()=>xp,_array:()=>Cp,_base64:()=>Qa,_base64url:()=>es,_bigint:()=>gp,_boolean:()=>mp,_catch:()=>KI,_check:()=>dw,_cidrv4:()=>Ja,_cidrv6:()=>Xa,_coercedBigint:()=>yp,_coercedBoolean:()=>fp,_coercedDate:()=>Ap,_coercedNumber:()=>cp,_coercedString:()=>ep,_cuid:()=>Wa,_cuid2:()=>Ka,_custom:()=>Op,_date:()=>Tp,_decode:()=>da,_decodeAsync:()=>pa,_default:()=>GI,_discriminatedUnion:()=>CI,_e164:()=>ts,_email:()=>ja,_emoji:()=>Ga,_encode:()=>la,_encodeAsync:()=>ua,_endsWith:()=>$r,_enum:()=>DI,_file:()=>Pp,_float32:()=>dp,_float64:()=>up,_gt:()=>Lt,_gte:()=>et,_guid:()=>Ko,_includes:()=>Sr,_int:()=>lp,_int32:()=>pp,_int64:()=>vp,_intersection:()=>PI,_ipv4:()=>Ya,_ipv6:()=>qa,_isoDate:()=>op,_isoDateTime:()=>rp,_isoDuration:()=>ap,_isoTime:()=>ip,_jwt:()=>ns,_ksuid:()=>Va,_lazy:()=>YI,_length:()=>Vn,_literal:()=>MI,_lowercase:()=>kr,_lt:()=>Rt,_lte:()=>ht,_mac:()=>tp,_map:()=>RI,_max:()=>ht,_maxLength:()=>Zn,_maxSize:()=>bn,_mime:()=>Tr,_min:()=>et,_minLength:()=>Jt,_minSize:()=>Dt,_multipleOf:()=>vn,_nan:()=>Ip,_nanoid:()=>Ba,_nativeEnum:()=>jI,_negative:()=>os,_never:()=>Ep,_nonnegative:()=>as,_nonoptional:()=>BI,_nonpositive:()=>is,_normalize:()=>Ar,_null:()=>kp,_nullable:()=>FI,_number:()=>sp,_optional:()=>zI,_overwrite:()=>$t,_parse:()=>fr,_parseAsync:()=>gr,_pipe:()=>HI,_positive:()=>rs,_promise:()=>qI,_property:()=>ss,_readonly:()=>ZI,_record:()=>NI,_refine:()=>Np,_regex:()=>_r,_safeDecode:()=>ma,_safeDecodeAsync:()=>ga,_safeEncode:()=>ha,_safeEncodeAsync:()=>fa,_safeParse:()=>yr,_safeParseAsync:()=>vr,_set:()=>LI,_size:()=>Hn,_slugify:()=>Or,_startsWith:()=>Er,_string:()=>Qu,_stringFormat:()=>Nr,_stringbool:()=>jp,_success:()=>WI,_superRefine:()=>Rp,_symbol:()=>wp,_templateLiteral:()=>VI,_toLowerCase:()=>Cr,_toUpperCase:()=>Pr,_transform:()=>UI,_trim:()=>Ir,_tuple:()=>OI,_uint32:()=>hp,_uint64:()=>bp,_ulid:()=>Ha,_undefined:()=>_p,_union:()=>AI,_unknown:()=>Sp,_uppercase:()=>xr,_url:()=>Ho,_uuid:()=>Ma,_uuidv4:()=>Ua,_uuidv6:()=>za,_uuidv7:()=>Fa,_void:()=>$p,_xid:()=>Za,_xor:()=>II,clone:()=>Xe,config:()=>Ae,createStandardJSONSchemaMethod:()=>Rr,createToJSONSchemaMethod:()=>Mp,decode:()=>qA,decodeAsync:()=>XA,describe:()=>Lp,encode:()=>YA,encodeAsync:()=>JA,extractDefs:()=>_n,finalize:()=>kn,flattenError:()=>Ro,formatError:()=>Lo,globalConfig:()=>Fn,globalRegistry:()=>Ue,initializeContext:()=>wn,isValidBase64:()=>ru,isValidBase64URL:()=>dv,isValidJWT:()=>uv,locales:()=>Bo,meta:()=>Dp,parse:()=>sa,parseAsync:()=>ca,prettifyError:()=>Ll,process:()=>ye,regexes:()=>pt,registry:()=>Da,safeDecode:()=>e0,safeDecodeAsync:()=>n0,safeEncode:()=>QA,safeEncodeAsync:()=>t0,safeParse:()=>jl,safeParseAsync:()=>Ml,toDotPath:()=>By,toJSONSchema:()=>us,treeifyError:()=>Rl,util:()=>B,version:()=>Rd});var mt=v(()=>{Gn();Ul();Dl();Hu();ka();Ld();ne();ba();qu();Wo();Nd();uw();Zo();Vo();pw();mw()});var hs={};Ot(hs,{endsWith:()=>$r,gt:()=>Lt,gte:()=>et,includes:()=>Sr,length:()=>Vn,lowercase:()=>kr,lt:()=>Rt,lte:()=>ht,maxLength:()=>Zn,maxSize:()=>bn,mime:()=>Tr,minLength:()=>Jt,minSize:()=>Dt,multipleOf:()=>vn,negative:()=>os,nonnegative:()=>as,nonpositive:()=>is,normalize:()=>Ar,overwrite:()=>$t,positive:()=>rs,property:()=>ss,regex:()=>_r,size:()=>Hn,slugify:()=>Or,startsWith:()=>Er,toLowerCase:()=>Cr,toUpperCase:()=>Pr,trim:()=>Ir,uppercase:()=>xr});var ms=v(()=>{mt()});var Lr={};Ot(Lr,{ZodISODate:()=>gs,ZodISODateTime:()=>fs,ZodISODuration:()=>vs,ZodISOTime:()=>ys,date:()=>xh,datetime:()=>kh,duration:()=>Eh,time:()=>Sh});function kh(e){return rp(fs,e)}function xh(e){return op(gs,e)}function Sh(e){return ip(ys,e)}function Eh(e){return ap(vs,e)}var fs,gs,ys,vs,Yo=v(()=>{mt();Jo();fs=_("ZodISODateTime",(e,t)=>{Vd.init(e,t),be.init(e,t)});gs=_("ZodISODate",(e,t)=>{Yd.init(e,t),be.init(e,t)});ys=_("ZodISOTime",(e,t)=>{qd.init(e,t),be.init(e,t)});vs=_("ZodISODuration",(e,t)=>{Jd.init(e,t),be.init(e,t)})});var fw,QI,st,$h=v(()=>{mt();mt();ne();fw=(e,t)=>{No.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Lo(e,r)},flatten:{value:r=>Ro(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,pr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,pr,2)}},isEmpty:{get(){return e.issues.length===0}}})},QI=_("ZodError",fw),st=_("ZodError",fw,{Parent:Error})});var Th,Ah,Ih,Ch,Ph,Oh,Nh,Rh,Lh,Dh,jh,Mh,Uh=v(()=>{mt();$h();Th=fr(st),Ah=gr(st),Ih=yr(st),Ch=vr(st),Ph=la(st),Oh=da(st),Nh=ua(st),Rh=pa(st),Lh=ha(st),Dh=ma(st),jh=fa(st),Mh=ga(st)});var qo={};Ot(qo,{ZodAny:()=>Zh,ZodArray:()=>Jh,ZodBase64:()=>Rs,ZodBase64URL:()=>Ls,ZodBigInt:()=>Gr,ZodBigIntFormat:()=>Ms,ZodBoolean:()=>Fr,ZodCIDRv4:()=>Os,ZodCIDRv6:()=>Ns,ZodCUID:()=>Es,ZodCUID2:()=>$s,ZodCatch:()=>bm,ZodCodec:()=>li,ZodCustom:()=>di,ZodCustomStringFormat:()=>Ur,ZodDate:()=>oi,ZodDefault:()=>hm,ZodDiscriminatedUnion:()=>Qh,ZodE164:()=>Ds,ZodEmail:()=>ks,ZodEmoji:()=>xs,ZodEnum:()=>jr,ZodExactOptional:()=>dm,ZodFile:()=>cm,ZodFunction:()=>Im,ZodGUID:()=>Qo,ZodIPv4:()=>Cs,ZodIPv6:()=>Ps,ZodIntersection:()=>em,ZodJWT:()=>js,ZodKSUID:()=>Is,ZodLazy:()=>$m,ZodLiteral:()=>sm,ZodMAC:()=>zh,ZodMap:()=>im,ZodNaN:()=>_m,ZodNanoID:()=>Ss,ZodNever:()=>Yh,ZodNonOptional:()=>Ws,ZodNull:()=>Kh,ZodNullable:()=>pm,ZodNumber:()=>zr,ZodNumberFormat:()=>qn,ZodObject:()=>ai,ZodOptional:()=>Bs,ZodPipe:()=>ci,ZodPrefault:()=>fm,ZodPreprocess:()=>km,ZodPromise:()=>Am,ZodReadonly:()=>xm,ZodRecord:()=>Dr,ZodSet:()=>am,ZodString:()=>Mr,ZodStringFormat:()=>be,ZodSuccess:()=>vm,ZodSymbol:()=>Bh,ZodTemplateLiteral:()=>Em,ZodTransform:()=>lm,ZodTuple:()=>nm,ZodType:()=>le,ZodULID:()=>Ts,ZodURL:()=>ri,ZodUUID:()=>jt,ZodUndefined:()=>Wh,ZodUnion:()=>si,ZodUnknown:()=>Vh,ZodVoid:()=>qh,ZodXID:()=>As,ZodXor:()=>Xh,_ZodString:()=>_s,_default:()=>mm,_function:()=>x_,any:()=>e_,array:()=>ii,base64:()=>jw,base64url:()=>Mw,bigint:()=>Yw,boolean:()=>Gh,catch:()=>wm,check:()=>S_,cidrv4:()=>Lw,cidrv6:()=>Dw,codec:()=>b_,cuid:()=>Tw,cuid2:()=>Aw,custom:()=>E_,date:()=>n_,describe:()=>$_,discriminatedUnion:()=>c_,e164:()=>Uw,email:()=>yw,emoji:()=>Ew,enum:()=>Fs,exactOptional:()=>um,file:()=>f_,float32:()=>Kw,float64:()=>Hw,function:()=>x_,guid:()=>vw,hash:()=>Ww,hex:()=>Bw,hostname:()=>Gw,httpUrl:()=>Sw,instanceof:()=>A_,int:()=>bs,int32:()=>Zw,int64:()=>qw,intersection:()=>tm,invertCodec:()=>w_,ipv4:()=>Ow,ipv6:()=>Rw,json:()=>C_,jwt:()=>zw,keyof:()=>r_,ksuid:()=>Pw,lazy:()=>Tm,literal:()=>m_,looseObject:()=>a_,looseRecord:()=>d_,mac:()=>Nw,map:()=>u_,meta:()=>T_,nan:()=>v_,nanoid:()=>$w,nativeEnum:()=>h_,never:()=>Us,nonoptional:()=>ym,null:()=>Hh,nullable:()=>ti,nullish:()=>g_,number:()=>Fh,object:()=>o_,optional:()=>ei,partialRecord:()=>l_,pipe:()=>ws,prefault:()=>gm,preprocess:()=>P_,promise:()=>k_,readonly:()=>Sm,record:()=>om,refine:()=>Cm,set:()=>p_,strictObject:()=>i_,string:()=>Xo,stringFormat:()=>Fw,stringbool:()=>I_,success:()=>y_,superRefine:()=>Pm,symbol:()=>Xw,templateLiteral:()=>__,transform:()=>Gs,tuple:()=>rm,uint32:()=>Vw,uint64:()=>Jw,ulid:()=>Iw,undefined:()=>Qw,union:()=>zs,unknown:()=>Yn,url:()=>xw,uuid:()=>bw,uuidv4:()=>ww,uuidv6:()=>_w,uuidv7:()=>kw,void:()=>t_,xid:()=>Cw,xor:()=>s_});function ni(e,t,r){let o=Object.getPrototypeOf(e),n=gw.get(o);if(n||(n=new Set,gw.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}function Xo(e){return Qu(Mr,e)}function yw(e){return ja(ks,e)}function vw(e){return Ko(Qo,e)}function bw(e){return Ma(jt,e)}function ww(e){return Ua(jt,e)}function _w(e){return za(jt,e)}function kw(e){return Fa(jt,e)}function xw(e){return Ho(ri,e)}function Sw(e){return Ho(ri,{protocol:pt.httpProtocol,hostname:pt.domain,...B.normalizeParams(e)})}function Ew(e){return Ga(xs,e)}function $w(e){return Ba(Ss,e)}function Tw(e){return Wa(Es,e)}function Aw(e){return Ka($s,e)}function Iw(e){return Ha(Ts,e)}function Cw(e){return Za(As,e)}function Pw(e){return Va(Is,e)}function Ow(e){return Ya(Cs,e)}function Nw(e){return tp(zh,e)}function Rw(e){return qa(Ps,e)}function Lw(e){return Ja(Os,e)}function Dw(e){return Xa(Ns,e)}function jw(e){return Qa(Rs,e)}function Mw(e){return es(Ls,e)}function Uw(e){return ts(Ds,e)}function zw(e){return ns(js,e)}function Fw(e,t,r={}){return Nr(Ur,e,t,r)}function Gw(e){return Nr(Ur,"hostname",pt.hostname,e)}function Bw(e){return Nr(Ur,"hex",pt.hex,e)}function Ww(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=pt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Nr(Ur,o,n,t)}function Fh(e){return sp(zr,e)}function bs(e){return lp(qn,e)}function Kw(e){return dp(qn,e)}function Hw(e){return up(qn,e)}function Zw(e){return pp(qn,e)}function Vw(e){return hp(qn,e)}function Gh(e){return mp(Fr,e)}function Yw(e){return gp(Gr,e)}function qw(e){return vp(Ms,e)}function Jw(e){return bp(Ms,e)}function Xw(e){return wp(Bh,e)}function Qw(e){return _p(Wh,e)}function Hh(e){return kp(Kh,e)}function e_(){return xp(Zh)}function Yn(){return Sp(Vh)}function Us(e){return Ep(Yh,e)}function t_(e){return $p(qh,e)}function n_(e){return Tp(oi,e)}function ii(e,t){return Cp(Jh,e,t)}function r_(e){let t=e._zod.def.shape;return Fs(Object.keys(t))}function o_(e,t){let r={type:"object",shape:e??{},...B.normalizeParams(t)};return new ai(r)}function i_(e,t){return new ai({type:"object",shape:e,catchall:Us(),...B.normalizeParams(t)})}function a_(e,t){return new ai({type:"object",shape:e,catchall:Yn(),...B.normalizeParams(t)})}function zs(e,t){return new si({type:"union",options:e,...B.normalizeParams(t)})}function s_(e,t){return new Xh({type:"union",options:e,inclusive:!1,...B.normalizeParams(t)})}function c_(e,t,r){return new Qh({type:"union",options:t,discriminator:e,...B.normalizeParams(r)})}function tm(e,t){return new em({type:"intersection",left:e,right:t})}function rm(e,t,r){let o=t instanceof ae,n=o?r:t,i=o?t:null;return new nm({type:"tuple",items:e,rest:i,...B.normalizeParams(n)})}function om(e,t,r){return!t||!t._zod?new Dr({type:"record",keyType:Xo(),valueType:e,...B.normalizeParams(t)}):new Dr({type:"record",keyType:e,valueType:t,...B.normalizeParams(r)})}function l_(e,t,r){let o=Xe(e);return o._zod.values=void 0,new Dr({type:"record",keyType:o,valueType:t,...B.normalizeParams(r)})}function d_(e,t,r){return new Dr({type:"record",keyType:e,valueType:t,mode:"loose",...B.normalizeParams(r)})}function u_(e,t,r){return new im({type:"map",keyType:e,valueType:t,...B.normalizeParams(r)})}function p_(e,t){return new am({type:"set",valueType:e,...B.normalizeParams(t)})}function Fs(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new jr({type:"enum",entries:r,...B.normalizeParams(t)})}function h_(e,t){return new jr({type:"enum",entries:e,...B.normalizeParams(t)})}function m_(e,t){return new sm({type:"literal",values:Array.isArray(e)?e:[e],...B.normalizeParams(t)})}function f_(e){return Pp(cm,e)}function Gs(e){return new lm({type:"transform",transform:e})}function ei(e){return new Bs({type:"optional",innerType:e})}function um(e){return new dm({type:"optional",innerType:e})}function ti(e){return new pm({type:"nullable",innerType:e})}function g_(e){return ei(ti(e))}function mm(e,t){return new hm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():B.shallowClone(t)}})}function gm(e,t){return new fm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():B.shallowClone(t)}})}function ym(e,t){return new Ws({type:"nonoptional",innerType:e,...B.normalizeParams(t)})}function y_(e){return new vm({type:"success",innerType:e})}function wm(e,t){return new bm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function v_(e){return Ip(_m,e)}function ws(e,t){return new ci({type:"pipe",in:e,out:t})}function b_(e,t,r){return new li({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function w_(e){let t=e._zod.def;return new li({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Sm(e){return new xm({type:"readonly",innerType:e})}function __(e,t){return new Em({type:"template_literal",parts:e,...B.normalizeParams(t)})}function Tm(e){return new $m({type:"lazy",getter:e})}function k_(e){return new Am({type:"promise",innerType:e})}function x_(e){return new Im({type:"function",input:Array.isArray(e?.input)?rm(e?.input):e?.input??ii(Yn()),output:e?.output??Yn()})}function S_(e){let t=new we({check:"custom"});return t._zod.check=e,t}function E_(e,t){return Op(di,e??(()=>!0),t)}function Cm(e,t={}){return Np(di,e,t)}function Pm(e,t){return Rp(e,t)}function A_(e,t={}){let r=new di({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...B.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function C_(e){let t=Tm(()=>zs([Xo(e),Fh(),Gh(),Hh(),ii(t),om(Xo(),t)]));return t}function P_(e,t){return new km({type:"pipe",in:Gs(e),out:t})}var gw,le,_s,Mr,be,ks,Qo,jt,ri,xs,Ss,Es,$s,Ts,As,Is,Cs,zh,Ps,Os,Ns,Rs,Ls,Ds,js,Ur,zr,qn,Fr,Gr,Ms,Bh,Wh,Kh,Zh,Vh,Yh,qh,oi,Jh,ai,si,Xh,Qh,em,nm,Dr,im,am,jr,sm,cm,lm,Bs,dm,pm,hm,fm,Ws,vm,bm,_m,ci,li,km,xm,Em,$m,Am,Im,di,$_,T_,I_,Jo=v(()=>{mt();mt();Vo();Zo();ms();Yo();Uh();gw=new WeakMap;le=_("ZodType",(e,t)=>(ae.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rr(e,"input"),output:Rr(e,"output")}}),e.toJSONSchema=Mp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Th(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Ih(e,r,o),e.parseAsync=async(r,o)=>Ah(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Ch(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Ph(e,r,o),e.decode=(r,o)=>Oh(e,r,o),e.encodeAsync=async(r,o)=>Nh(e,r,o),e.decodeAsync=async(r,o)=>Rh(e,r,o),e.safeEncode=(r,o)=>Lh(e,r,o),e.safeDecode=(r,o)=>Dh(e,r,o),e.safeEncodeAsync=async(r,o)=>jh(e,r,o),e.safeDecodeAsync=async(r,o)=>Mh(e,r,o),ni(e,"ZodType",{check(...r){let o=this.def;return this.clone(B.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Xe(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Cm(r,o))},superRefine(r,o){return this.check(Pm(r,o))},overwrite(r){return this.check($t(r))},optional(){return ei(this)},exactOptional(){return um(this)},nullable(){return ti(this)},nullish(){return ei(ti(this))},nonoptional(r){return ym(this,r)},array(){return ii(this)},or(r){return zs([this,r])},and(r){return tm(this,r)},transform(r){return ws(this,Gs(r))},default(r){return mm(this,r)},prefault(r){return gm(this,r)},catch(r){return wm(this,r)},pipe(r){return ws(this,r)},readonly(){return Sm(this)},describe(r){let o=this.clone();return Ue.add(o,{description:r}),o},meta(...r){if(r.length===0)return Ue.get(this);let o=this.clone();return Ue.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ue.get(e)?.description},configurable:!0}),e)),_s=_("_ZodString",(e,t)=>{Kn.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Up(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,ni(e,"_ZodString",{regex(...o){return this.check(_r(...o))},includes(...o){return this.check(Sr(...o))},startsWith(...o){return this.check(Er(...o))},endsWith(...o){return this.check($r(...o))},min(...o){return this.check(Jt(...o))},max(...o){return this.check(Zn(...o))},length(...o){return this.check(Vn(...o))},nonempty(...o){return this.check(Jt(1,...o))},lowercase(o){return this.check(kr(o))},uppercase(o){return this.check(xr(o))},trim(){return this.check(Ir())},normalize(...o){return this.check(Ar(...o))},toLowerCase(){return this.check(Cr())},toUpperCase(){return this.check(Pr())},slugify(){return this.check(Or())}})}),Mr=_("ZodString",(e,t)=>{Kn.init(e,t),_s.init(e,t),e.email=r=>e.check(ja(ks,r)),e.url=r=>e.check(Ho(ri,r)),e.jwt=r=>e.check(ns(js,r)),e.emoji=r=>e.check(Ga(xs,r)),e.guid=r=>e.check(Ko(Qo,r)),e.uuid=r=>e.check(Ma(jt,r)),e.uuidv4=r=>e.check(Ua(jt,r)),e.uuidv6=r=>e.check(za(jt,r)),e.uuidv7=r=>e.check(Fa(jt,r)),e.nanoid=r=>e.check(Ba(Ss,r)),e.guid=r=>e.check(Ko(Qo,r)),e.cuid=r=>e.check(Wa(Es,r)),e.cuid2=r=>e.check(Ka($s,r)),e.ulid=r=>e.check(Ha(Ts,r)),e.base64=r=>e.check(Qa(Rs,r)),e.base64url=r=>e.check(es(Ls,r)),e.xid=r=>e.check(Za(As,r)),e.ksuid=r=>e.check(Va(Is,r)),e.ipv4=r=>e.check(Ya(Cs,r)),e.ipv6=r=>e.check(qa(Ps,r)),e.cidrv4=r=>e.check(Ja(Os,r)),e.cidrv6=r=>e.check(Xa(Ns,r)),e.e164=r=>e.check(ts(Ds,r)),e.datetime=r=>e.check(kh(r)),e.date=r=>e.check(xh(r)),e.time=r=>e.check(Sh(r)),e.duration=r=>e.check(Eh(r))});be=_("ZodStringFormat",(e,t)=>{ve.init(e,t),_s.init(e,t)}),ks=_("ZodEmail",(e,t)=>{Ud.init(e,t),be.init(e,t)});Qo=_("ZodGUID",(e,t)=>{jd.init(e,t),be.init(e,t)});jt=_("ZodUUID",(e,t)=>{Md.init(e,t),be.init(e,t)});ri=_("ZodURL",(e,t)=>{zd.init(e,t),be.init(e,t)});xs=_("ZodEmoji",(e,t)=>{Fd.init(e,t),be.init(e,t)});Ss=_("ZodNanoID",(e,t)=>{Gd.init(e,t),be.init(e,t)});Es=_("ZodCUID",(e,t)=>{Bd.init(e,t),be.init(e,t)});$s=_("ZodCUID2",(e,t)=>{Wd.init(e,t),be.init(e,t)});Ts=_("ZodULID",(e,t)=>{Kd.init(e,t),be.init(e,t)});As=_("ZodXID",(e,t)=>{Hd.init(e,t),be.init(e,t)});Is=_("ZodKSUID",(e,t)=>{Zd.init(e,t),be.init(e,t)});Cs=_("ZodIPv4",(e,t)=>{Xd.init(e,t),be.init(e,t)});zh=_("ZodMAC",(e,t)=>{eu.init(e,t),be.init(e,t)});Ps=_("ZodIPv6",(e,t)=>{Qd.init(e,t),be.init(e,t)});Os=_("ZodCIDRv4",(e,t)=>{tu.init(e,t),be.init(e,t)});Ns=_("ZodCIDRv6",(e,t)=>{nu.init(e,t),be.init(e,t)});Rs=_("ZodBase64",(e,t)=>{ou.init(e,t),be.init(e,t)});Ls=_("ZodBase64URL",(e,t)=>{iu.init(e,t),be.init(e,t)});Ds=_("ZodE164",(e,t)=>{au.init(e,t),be.init(e,t)});js=_("ZodJWT",(e,t)=>{su.init(e,t),be.init(e,t)});Ur=_("ZodCustomStringFormat",(e,t)=>{cu.init(e,t),be.init(e,t)});zr=_("ZodNumber",(e,t)=>{Ta.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>zp(e,o,n,i),ni(e,"ZodNumber",{gt(o,n){return this.check(Lt(o,n))},gte(o,n){return this.check(et(o,n))},min(o,n){return this.check(et(o,n))},lt(o,n){return this.check(Rt(o,n))},lte(o,n){return this.check(ht(o,n))},max(o,n){return this.check(ht(o,n))},int(o){return this.check(bs(o))},safe(o){return this.check(bs(o))},positive(o){return this.check(Lt(0,o))},nonnegative(o){return this.check(et(0,o))},negative(o){return this.check(Rt(0,o))},nonpositive(o){return this.check(ht(0,o))},multipleOf(o,n){return this.check(vn(o,n))},step(o,n){return this.check(vn(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});qn=_("ZodNumberFormat",(e,t)=>{lu.init(e,t),zr.init(e,t)});Fr=_("ZodBoolean",(e,t)=>{Uo.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fp(e,r,o,n)});Gr=_("ZodBigInt",(e,t)=>{Aa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Gp(e,o,n,i),e.gte=(o,n)=>e.check(et(o,n)),e.min=(o,n)=>e.check(et(o,n)),e.gt=(o,n)=>e.check(Lt(o,n)),e.gte=(o,n)=>e.check(et(o,n)),e.min=(o,n)=>e.check(et(o,n)),e.lt=(o,n)=>e.check(Rt(o,n)),e.lte=(o,n)=>e.check(ht(o,n)),e.max=(o,n)=>e.check(ht(o,n)),e.positive=o=>e.check(Lt(BigInt(0),o)),e.negative=o=>e.check(Rt(BigInt(0),o)),e.nonpositive=o=>e.check(ht(BigInt(0),o)),e.nonnegative=o=>e.check(et(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(vn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Ms=_("ZodBigIntFormat",(e,t)=>{du.init(e,t),Gr.init(e,t)});Bh=_("ZodSymbol",(e,t)=>{uu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bp(e,r,o,n)});Wh=_("ZodUndefined",(e,t)=>{pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kp(e,r,o,n)});Kh=_("ZodNull",(e,t)=>{hu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wp(e,r,o,n)});Zh=_("ZodAny",(e,t)=>{mu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vp(e,r,o,n)});Vh=_("ZodUnknown",(e,t)=>{fu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yp(e,r,o,n)});Yh=_("ZodNever",(e,t)=>{gu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zp(e,r,o,n)});qh=_("ZodVoid",(e,t)=>{yu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hp(e,r,o,n)});oi=_("ZodDate",(e,t)=>{vu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>qp(e,o,n,i),e.min=(o,n)=>e.check(et(o,n)),e.max=(o,n)=>e.check(ht(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});Jh=_("ZodArray",(e,t)=>{bu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ch(e,r,o,n),e.element=t.element,ni(e,"ZodArray",{min(r,o){return this.check(Jt(r,o))},nonempty(r){return this.check(Jt(1,r))},max(r,o){return this.check(Zn(r,o))},length(r,o){return this.check(Vn(r,o))},unwrap(){return this.element}})});ai=_("ZodObject",(e,t)=>{wu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lh(e,r,o,n),B.defineLazy(e,"shape",()=>t.shape),ni(e,"ZodObject",{keyof(){return Fs(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Yn()})},loose(){return this.clone({...this._zod.def,catchall:Yn()})},strict(){return this.clone({...this._zod.def,catchall:Us()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return B.extend(this,r)},safeExtend(r){return B.safeExtend(this,r)},merge(r){return B.merge(this,r)},pick(r){return B.pick(this,r)},omit(r){return B.omit(this,r)},partial(...r){return B.partial(Bs,this,r[0])},required(...r){return B.required(Ws,this,r[0])}})});si=_("ZodUnion",(e,t)=>{zo.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ls(e,r,o,n),e.options=t.options});Xh=_("ZodXor",(e,t)=>{si.init(e,t),_u.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ls(e,r,o,n),e.options=t.options});Qh=_("ZodDiscriminatedUnion",(e,t)=>{si.init(e,t),ku.init(e,t)});em=_("ZodIntersection",(e,t)=>{xu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dh(e,r,o,n)});nm=_("ZodTuple",(e,t)=>{Ia.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uh(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});Dr=_("ZodRecord",(e,t)=>{Su.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ph(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});im=_("ZodMap",(e,t)=>{Eu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ah(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Dt(...r)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(...r)=>e.check(bn(...r)),e.size=(...r)=>e.check(Hn(...r))});am=_("ZodSet",(e,t)=>{$u.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sh(e,r,o,n),e.min=(...r)=>e.check(Dt(...r)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(...r)=>e.check(bn(...r)),e.size=(...r)=>e.check(Hn(...r))});jr=_("ZodEnum",(e,t)=>{Tu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Jp(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new jr({...t,checks:[],...B.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new jr({...t,checks:[],...B.normalizeParams(n),entries:i})}});sm=_("ZodLiteral",(e,t)=>{Au.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xp(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});cm=_("ZodFile",(e,t)=>{Iu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>th(e,r,o,n),e.min=(r,o)=>e.check(Dt(r,o)),e.max=(r,o)=>e.check(bn(r,o)),e.mime=(r,o)=>e.check(Tr(Array.isArray(r)?r:[r],o))});lm=_("ZodTransform",(e,t)=>{Cu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ih(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new hn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(B.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(B.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});Bs=_("ZodOptional",(e,t)=>{Ca.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ds(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});dm=_("ZodExactOptional",(e,t)=>{Pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ds(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});pm=_("ZodNullable",(e,t)=>{Ou.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});hm=_("ZodDefault",(e,t)=>{Nu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});fm=_("ZodPrefault",(e,t)=>{Ru.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Ws=_("ZodNonOptional",(e,t)=>{Lu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});vm=_("ZodSuccess",(e,t)=>{Du.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});bm=_("ZodCatch",(e,t)=>{ju.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});_m=_("ZodNaN",(e,t)=>{Mu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qp(e,r,o,n)});ci=_("ZodPipe",(e,t)=>{Pa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vh(e,r,o,n),e.in=t.in,e.out=t.out});li=_("ZodCodec",(e,t)=>{ci.init(e,t),Fo.init(e,t)});km=_("ZodPreprocess",(e,t)=>{ci.init(e,t),Uu.init(e,t)}),xm=_("ZodReadonly",(e,t)=>{zu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Em=_("ZodTemplateLiteral",(e,t)=>{Fu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eh(e,r,o,n)});$m=_("ZodLazy",(e,t)=>{Wu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_h(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});Am=_("ZodPromise",(e,t)=>{Bu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Im=_("ZodFunction",(e,t)=>{Gu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oh(e,r,o,n)});di=_("ZodCustom",(e,t)=>{Ku.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rh(e,r,o,n)});$_=Lp,T_=Dp;I_=(...e)=>jp({Codec:li,Boolean:Fr,String:Mr},...e)});function nC(e){Ae({customError:e})}function rC(){return Ae().customError}var tC,Om,O_=v(()=>{mt();tC={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Om||(Om={})});function iC(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function aC(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function N_(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Y.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Y.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=aC(n,t),a=Ke(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return Y.null();if(n.length===0)return Y.never();if(n.length===1)return Y.literal(n[0]);if(n.every(a=>typeof a=="string"))return Y.enum(n);let i=n.map(a=>Y.literal(a));return i.length<2?i[0]:Y.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return Y.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return N_(a,t)});return n.length===0?Y.never():n.length===1?n[0]:Y.union(n)}if(!r)return Y.any();let o;switch(r){case"string":{let n=Y.string();if(e.format){let i=e.format;i==="email"?n=n.check(Y.email()):i==="uri"||i==="uri-reference"?n=n.check(Y.url()):i==="uuid"||i==="guid"?n=n.check(Y.uuid()):i==="date-time"?n=n.check(Y.iso.datetime()):i==="date"?n=n.check(Y.iso.date()):i==="time"?n=n.check(Y.iso.time()):i==="duration"?n=n.check(Y.iso.duration()):i==="ipv4"?n=n.check(Y.ipv4()):i==="ipv6"?n=n.check(Y.ipv6()):i==="mac"?n=n.check(Y.mac()):i==="cidr"?n=n.check(Y.cidrv4()):i==="cidr-v6"?n=n.check(Y.cidrv6()):i==="base64"?n=n.check(Y.base64()):i==="base64url"?n=n.check(Y.base64url()):i==="e164"?n=n.check(Y.e164()):i==="jwt"?n=n.check(Y.jwt()):i==="emoji"?n=n.check(Y.emoji()):i==="nanoid"?n=n.check(Y.nanoid()):i==="cuid"?n=n.check(Y.cuid()):i==="cuid2"?n=n.check(Y.cuid2()):i==="ulid"?n=n.check(Y.ulid()):i==="xid"?n=n.check(Y.xid()):i==="ksuid"&&(n=n.check(Y.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?Y.number().int():Y.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=Y.boolean();break}case"null":{o=Y.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[l,d]of Object.entries(i)){let p=Ke(d,t);n[l]=a.has(l)?p:p.optional()}if(e.propertyNames){let l=Ke(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?Ke(e.additionalProperties,t):Y.any();if(Object.keys(n).length===0){o=Y.record(l,d);break}let p=Y.object(n).passthrough(),h=Y.looseRecord(l,d);o=Y.intersection(p,h);break}if(e.patternProperties){let l=e.patternProperties,d=Object.keys(l),p=[];for(let f of d){let y=Ke(l[f],t),k=Y.string().regex(new RegExp(f));p.push(Y.looseRecord(k,y))}let h=[];if(Object.keys(n).length>0&&h.push(Y.object(n).passthrough()),h.push(...p),h.length===0)o=Y.object({}).passthrough();else if(h.length===1)o=h[0];else{let f=Y.intersection(h[0],h[1]);for(let y=2;y<h.length;y++)f=Y.intersection(f,h[y]);o=f}break}let s=Y.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Ke(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(l=>Ke(l,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Ke(i,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(l=>Ke(l,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Ke(e.additionalItems,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(i!==void 0){let a=Ke(i,t),s=Y.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=Y.array(Y.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Ke(e,t){if(typeof e=="boolean")return e?Y.any():Y.never();let r=N_(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(d=>Ke(d,t)),l=Y.union(s);r=o?Y.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(d=>Ke(d,t)),l=Y.xor(s);r=o?Y.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:Y.any();else{let s=o?r:Ke(e.allOf[0],t),l=o?0:1;for(let d=l;d<e.allOf.length;d++)s=Y.intersection(s,Ke(e.allOf[d],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=Y.nullable(r)),e.readOnly===!0&&(r=Y.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))oC.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function R_(e,t){if(typeof e=="boolean")return e?Y.any():Y.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=iC(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ue};return Ke(r,i)}var Y,oC,L_=v(()=>{Wo();ms();Yo();Jo();Y={...qo,...hs,iso:Lr},oC=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Nm={};Ot(Nm,{bigint:()=>dC,boolean:()=>lC,date:()=>uC,number:()=>cC,string:()=>sC});function sC(e){return ep(Mr,e)}function cC(e){return cp(zr,e)}function lC(e){return fp(Fr,e)}function dC(e){return yp(Gr,e)}function uC(e){return Ap(oi,e)}var D_=v(()=>{mt();Jo()});var c={};Ot(c,{$brand:()=>kl,$input:()=>Xu,$output:()=>Ju,NEVER:()=>_l,TimePrecision:()=>np,ZodAny:()=>Zh,ZodArray:()=>Jh,ZodBase64:()=>Rs,ZodBase64URL:()=>Ls,ZodBigInt:()=>Gr,ZodBigIntFormat:()=>Ms,ZodBoolean:()=>Fr,ZodCIDRv4:()=>Os,ZodCIDRv6:()=>Ns,ZodCUID:()=>Es,ZodCUID2:()=>$s,ZodCatch:()=>bm,ZodCodec:()=>li,ZodCustom:()=>di,ZodCustomStringFormat:()=>Ur,ZodDate:()=>oi,ZodDefault:()=>hm,ZodDiscriminatedUnion:()=>Qh,ZodE164:()=>Ds,ZodEmail:()=>ks,ZodEmoji:()=>xs,ZodEnum:()=>jr,ZodError:()=>QI,ZodExactOptional:()=>dm,ZodFile:()=>cm,ZodFirstPartyTypeKind:()=>Om,ZodFunction:()=>Im,ZodGUID:()=>Qo,ZodIPv4:()=>Cs,ZodIPv6:()=>Ps,ZodISODate:()=>gs,ZodISODateTime:()=>fs,ZodISODuration:()=>vs,ZodISOTime:()=>ys,ZodIntersection:()=>em,ZodIssueCode:()=>tC,ZodJWT:()=>js,ZodKSUID:()=>Is,ZodLazy:()=>$m,ZodLiteral:()=>sm,ZodMAC:()=>zh,ZodMap:()=>im,ZodNaN:()=>_m,ZodNanoID:()=>Ss,ZodNever:()=>Yh,ZodNonOptional:()=>Ws,ZodNull:()=>Kh,ZodNullable:()=>pm,ZodNumber:()=>zr,ZodNumberFormat:()=>qn,ZodObject:()=>ai,ZodOptional:()=>Bs,ZodPipe:()=>ci,ZodPrefault:()=>fm,ZodPreprocess:()=>km,ZodPromise:()=>Am,ZodReadonly:()=>xm,ZodRealError:()=>st,ZodRecord:()=>Dr,ZodSet:()=>am,ZodString:()=>Mr,ZodStringFormat:()=>be,ZodSuccess:()=>vm,ZodSymbol:()=>Bh,ZodTemplateLiteral:()=>Em,ZodTransform:()=>lm,ZodTuple:()=>nm,ZodType:()=>le,ZodULID:()=>Ts,ZodURL:()=>ri,ZodUUID:()=>jt,ZodUndefined:()=>Wh,ZodUnion:()=>si,ZodUnknown:()=>Vh,ZodVoid:()=>qh,ZodXID:()=>As,ZodXor:()=>Xh,_ZodString:()=>_s,_default:()=>mm,_function:()=>x_,any:()=>e_,array:()=>ii,base64:()=>jw,base64url:()=>Mw,bigint:()=>Yw,boolean:()=>Gh,catch:()=>wm,check:()=>S_,cidrv4:()=>Lw,cidrv6:()=>Dw,clone:()=>Xe,codec:()=>b_,coerce:()=>Nm,config:()=>Ae,core:()=>Xt,cuid:()=>Tw,cuid2:()=>Aw,custom:()=>E_,date:()=>n_,decode:()=>Oh,decodeAsync:()=>Rh,describe:()=>$_,discriminatedUnion:()=>c_,e164:()=>Uw,email:()=>yw,emoji:()=>Ew,encode:()=>Ph,encodeAsync:()=>Nh,endsWith:()=>$r,enum:()=>Fs,exactOptional:()=>um,file:()=>f_,flattenError:()=>Ro,float32:()=>Kw,float64:()=>Hw,formatError:()=>Lo,fromJSONSchema:()=>R_,function:()=>x_,getErrorMap:()=>rC,globalRegistry:()=>Ue,gt:()=>Lt,gte:()=>et,guid:()=>vw,hash:()=>Ww,hex:()=>Bw,hostname:()=>Gw,httpUrl:()=>Sw,includes:()=>Sr,instanceof:()=>A_,int:()=>bs,int32:()=>Zw,int64:()=>qw,intersection:()=>tm,invertCodec:()=>w_,ipv4:()=>Ow,ipv6:()=>Rw,iso:()=>Lr,json:()=>C_,jwt:()=>zw,keyof:()=>r_,ksuid:()=>Pw,lazy:()=>Tm,length:()=>Vn,literal:()=>m_,locales:()=>Bo,looseObject:()=>a_,looseRecord:()=>d_,lowercase:()=>kr,lt:()=>Rt,lte:()=>ht,mac:()=>Nw,map:()=>u_,maxLength:()=>Zn,maxSize:()=>bn,meta:()=>T_,mime:()=>Tr,minLength:()=>Jt,minSize:()=>Dt,multipleOf:()=>vn,nan:()=>v_,nanoid:()=>$w,nativeEnum:()=>h_,negative:()=>os,never:()=>Us,nonnegative:()=>as,nonoptional:()=>ym,nonpositive:()=>is,normalize:()=>Ar,null:()=>Hh,nullable:()=>ti,nullish:()=>g_,number:()=>Fh,object:()=>o_,optional:()=>ei,overwrite:()=>$t,parse:()=>Th,parseAsync:()=>Ah,partialRecord:()=>l_,pipe:()=>ws,positive:()=>rs,prefault:()=>gm,preprocess:()=>P_,prettifyError:()=>Ll,promise:()=>k_,property:()=>ss,readonly:()=>Sm,record:()=>om,refine:()=>Cm,regex:()=>_r,regexes:()=>pt,registry:()=>Da,safeDecode:()=>Dh,safeDecodeAsync:()=>Mh,safeEncode:()=>Lh,safeEncodeAsync:()=>jh,safeParse:()=>Ih,safeParseAsync:()=>Ch,set:()=>p_,setErrorMap:()=>nC,size:()=>Hn,slugify:()=>Or,startsWith:()=>Er,strictObject:()=>i_,string:()=>Xo,stringFormat:()=>Fw,stringbool:()=>I_,success:()=>y_,superRefine:()=>Pm,symbol:()=>Xw,templateLiteral:()=>__,toJSONSchema:()=>us,toLowerCase:()=>Cr,toUpperCase:()=>Pr,transform:()=>Gs,treeifyError:()=>Rl,trim:()=>Ir,tuple:()=>rm,uint32:()=>Vw,uint64:()=>Jw,ulid:()=>Iw,undefined:()=>Qw,union:()=>zs,unknown:()=>Yn,uppercase:()=>xr,url:()=>xw,util:()=>B,uuid:()=>bw,uuidv4:()=>ww,uuidv6:()=>_w,uuidv7:()=>kw,void:()=>t_,xid:()=>Cw,xor:()=>s_});var Rm=v(()=>{mt();Jo();ms();$h();Uh();O_();mt();Zu();mt();Vo();L_();qu();Yo();Yo();D_();Ae(Oa())});var He=v(()=>{Rm();Rm()});function j_(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(hC.has(t)||pC.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return j_(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function M_(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(j_(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var pC,hC,Lm=v(()=>{"use strict";pC=[".localhost",".local",".internal",".test",".localdomain"],hC=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var ui,pi=v(()=>{"use strict";He();ui=c.object({date:c.string(),plays:c.number(),players:c.number().nullable()})});var hi,Ks=v(()=>{"use strict";He();hi=c.discriminatedUnion("source",[c.object({source:c.literal("manifest")}),c.object({source:c.literal("studio"),element_id:c.string().min(1),edition_id:c.string().min(1)})])});var xn,Dm,mi,nt,Mt,Br,Wr=v(()=>{"use strict";xn="penalty_v1",Dm=["easy_v1","balanced_v1","hard_v1"],mi="balanced_v1",nt={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},Mt={postX:1e3,barY:1e3,postWidth:60,barHeight:60,ballRadius:40,keeperStart:{x:0,y:420}},Br="shoot"});function G_(e){return e.questions?e.questions:[{id:"1",kind:"choice",prompt:e.prompt,options:e.options??[],result:e.result,points:void 0,min:void 0,max:void 0,step:void 0,tolerance:void 0}]}function Hs(e,t,r){if(e.result===void 0)return 0;let n=(e.kind==="choice"?(e.options??[]).find(i=>i.key===e.result):void 0)?.points??e.points??r;if(e.kind==="number"){if(typeof t!="number"||typeof e.result!="number")return 0;let i=Math.abs(t-e.result);return i===0?n:e.tolerance===void 0||i>=e.tolerance?0:Math.round(n*(1-i/e.tolerance))}return t===e.result?n:0}function Qt(e){return`round-${e.number}`}var Jn,jm,mC,fC,gC,yC,U_,vC,Mm,z_,bC,F_,wC,Zs,_C,kC,xC,SC,EC,Ze,LU,DU,jU,Ut=v(()=>{"use strict";He();Yt();pi();Ks();Wr();Jn={scoreOrder:c.enum(["high_first","low_first"]).optional().describe("Which score wins: high_first for most points, low_first for a fastest time, fewest attempts or closest to a target. Absent means high_first.")},jm=c.object({archetype:c.literal("hunt"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(2),targets:c.array(c.string().min(1)).min(1),required:c.number().int().positive().optional(),pointsPerTarget:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),mC=c.object({key:c.string().min(1),label:c.string().min(1),value:c.number().int().nonnegative()}),fC=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(mC).min(1)}),gC=c.object({within:c.number().min(0).max(1),label:c.string().min(1)}),yC=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],U_=c.object({archetype:c.literal("push"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),target:c.number().int().positive(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),theme:c.string().default(""),slates:c.array(fC).min(1),line:c.array(c.object({slate:c.string(),key:c.string()})).optional(),tiers:c.array(gC).default(yC),floorLabel:c.string().default("Rookie"),bustLabel:c.string().default("Busted"),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{if(e.line)if(e.line.length!==e.slates.length)t.addIssue({code:"custom",path:["line"],message:`The line has ${e.line.length} pick(s) for ${e.slates.length} slate(s). A perfect line is one pick per slate.`});else{let s=0,l=!1;for(let d of e.line){let h=e.slates.find(f=>f.id===d.slate)?.entries.find(f=>f.key===d.key);if(!h){l=!0,t.addIssue({code:"custom",path:["line"],message:`The line names "${d.key}" on slate "${d.slate}", which the round does not hold.`});break}s+=h.value}!l&&s!==e.target&&t.addIssue({code:"custom",path:["line"],message:`The line sums to ${s}, not the target ${e.target}. A perfect line lands exactly.`})}let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(l=>l.key)),n=[...new Set(o.filter((s,l)=>o.indexOf(s)!==l))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,l)=>s+Math.min(...l.entries.map(d=>d.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,l)=>l===0||s.within>e.tiers[l-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),vC=c.object({key:c.string().min(1),label:c.string().min(1),members:c.array(c.string().min(1)).min(2)}),Mm=c.object({archetype:c.literal("group"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(4),groups:c.array(vC).min(2),pointsPerGroup:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let l=r.get(s);l&&l!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${l} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),z_=c.object({key:c.string().min(1),label:c.string().min(1),points:c.number().int().nonnegative().optional()}),bC=c.object({id:c.string().min(1),kind:c.enum(["choice","number"]).default("choice"),prompt:c.string().default(""),options:c.array(z_).optional(),min:c.number().optional(),max:c.number().optional(),step:c.number().positive().optional(),result:c.union([c.string().min(1),c.number()]).optional(),points:c.number().int().nonnegative().optional(),tolerance:c.number().positive().optional()}).superRefine((e,t)=>{if(e.kind==="choice"){if(!e.options||e.options.length<2){t.addIssue({code:"custom",path:["options"],message:"A choice needs at least two options, or there is nothing to predict."});return}new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),typeof e.result=="string"&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),typeof e.result=="number"&&t.addIssue({code:"custom",path:["result"],message:"A choice settles to one of its option keys, not to a number."});return}e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A number question has no options: a fan gives a value."}),e.min===void 0||e.max===void 0?t.addIssue({code:"custom",path:["min"],message:"A number needs a min and a max, or a fan is given a control with no ends."}):e.max<=e.min&&t.addIssue({code:"custom",path:["max"],message:"The maximum has to be above the minimum."}),typeof e.result=="string"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),F_=c.object({archetype:c.literal("predict"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),options:c.array(z_).min(2).optional(),questions:c.array(bC).min(1).optional(),result:c.string().min(1).optional(),pointsForCorrect:c.number().int().nonnegative().default(10),attemptsAllowed:c.number().int().positive().default(1),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.options!==void 0,o=e.questions!==void 0;if(r&&o&&t.addIssue({code:"custom",path:["questions"],message:"A round declares options or questions, not both. Two homes for one question is how they drift apart."}),!r&&!o&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),o&&e.questions){let n=e.questions.map(i=>i.id);new Set(n).size!==n.length&&t.addIssue({code:"custom",path:["questions"],message:"Two questions share an id. A play names the question it answered."})}e.options&&new Set(e.options.map(n=>n.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&e.options!==void 0&&!e.options.some(n=>n.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})});wC=c.object({archetype:c.literal("bingo"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),rows:c.number().int().min(2),columns:c.number().int().min(2),centreMode:c.enum(["none","free","choice"]).default("none"),centreOptions:c.array(c.string().min(1)).optional(),allowCentreDuplicate:c.boolean().default(!1),lineTypes:c.array(c.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:c.array(c.object({key:c.string().min(1),label:c.string().min(1),note:c.string().optional(),result:c.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:c.number().int().nonnegative().default(10),pointsForFullBoard:c.number().int().nonnegative().default(0),shuffleAllowance:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),locksAt:c.string().optional()}).superRefine((e,t)=>{let r=e.cardPool.map(n=>n.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let o=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<o&&t.addIssue({code:"custom",path:["cardPool"],message:`The pool has ${e.cardPool.length} card${e.cardPool.length===1?"":"s"}, and a ${e.rows}x${e.columns} board needs ${o}. Add more cards or shrink the board.`}),e.centreMode==="choice")if(!e.centreOptions||e.centreOptions.length===0)t.addIssue({code:"custom",path:["centreOptions"],message:"The centre is a player's choice, so at least one option is required."});else{let n=e.centreOptions.filter(i=>!r.includes(i));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),Zs=c.object({archetype:c.literal("shoot"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),model:c.literal(xn).default(xn),difficulty:c.enum(Dm).default(mi),shotsAllowed:c.number().int().min(1).max(20).default(5),goalsToWin:c.number().int().min(1).default(3),pointsPerGoal:c.number().int().nonnegative().default(100),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{e.goalsToWin>e.shotsAllowed&&t.addIssue({code:"custom",path:["goalsToWin"],message:`Asks for ${e.goalsToWin} goals from ${e.shotsAllowed} shots, which cannot be reached.`})}),_C=c.object({key:c.string().min(1),label:c.string().min(1),art:c.string().optional()}),kC=c.object({key:c.string().min(1),name:c.string().min(1),image:c.string().optional()}),xC=c.object({item:c.string().min(1),cells:c.array(c.string().min(1))}),SC=c.object({archetype:c.literal("place"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(_C).min(1),deck:c.array(kC).min(1),qualifies:c.array(xC).default([]),pointsPerPlacement:c.number().int().nonnegative().default(1),fullHouseBonus:c.number().int().nonnegative().default(0),mistakesAllowed:c.number().int().positive().default(4),skipsAllowed:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Set;for(let s of e.board)r.has(s.key)&&t.addIssue({code:"custom",path:["board"],message:`Two cells share the key ${s.key}. Each one needs its own.`}),r.add(s.key);let o=new Set;for(let s of e.deck)o.has(s.key)&&t.addIssue({code:"custom",path:["deck"],message:`Two cards share the key ${s.key}. Each one needs its own.`}),o.add(s.key);let n=new Set,i=new Set;for(let s of e.qualifies){o.has(s.item)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is not a card in the deck.`}),n.has(s.item)&&t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is listed twice. Give each card one row.`}),n.add(s.item);for(let l of s.cells)r.has(l)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} qualifies for ${l}, which is not on the board.`}),i.add(l)}let a=e.board.filter(s=>!i.has(s.key)).map(s=>s.key);a.length&&t.addIssue({code:"custom",path:["board"],message:`No card can fill: ${a.join(", ")}. Every cell needs at least one qualifying card.`}),e.deck.length<e.board.length&&t.addIssue({code:"custom",path:["deck"],message:`${e.deck.length} cards cannot fill ${e.board.length} cells.`})}),EC=c.discriminatedUnion("archetype",[jm,U_,Mm,F_,wC,Zs,SC]),Ze=c.preprocess(Dy,EC);LU=c.object({action:c.literal("settle"),game:c.string().min(1),roundId:c.string().min(1),result:c.string().min(1)}),DU=c.object({game:c.string().min(1),round:Ze,origin:hi.optional(),snapshot:c.string().default(""),source:c.string().optional(),roundId:c.string().min(1).optional(),selection:c.object({mode:c.literal("rotation"),windowSeconds:c.number().int().positive(),rounds:c.array(c.object({id:c.string().min(1),round:Ze,origin:hi.optional()})).min(1)}).optional()}),jU=c.object({roundId:c.string(),version:c.number().int().nonnegative(),changed:c.boolean(),current:c.boolean(),activity:c.array(ui).optional(),monthlyPlayers:c.number().int().nonnegative().optional()})});function CC(e){return H_.includes(e)}function PC(e){return V_.includes(We(e))}function Y_(e){let t=[],r=e.backend.archetype;r&&PC(r)&&t.push({path:"backend.archetype",message:`\`${r}\` is a classification, not a format the Engine marks. The formats it marks are ${Nt.join(", ")}. Name one of those, or say what your game does and ask us: a mechanic no format fits is a format we have not built, not a setting you are missing.`});let o=e.backend.route;o&&CC(o)&&t.push({path:"backend.route",message:`\`${o}\` is a classification, not a route Gamestage implements. Set \`${Fm}\`: every game runs on our Engine, and there is no route that runs a game on an engine of your own.`}),e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let n=e.operations.promotion;if(n.offers_prize&&(n.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),n.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!n.skill_based&&!n.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let i of["issuer","jwks_uri"]){let a=e.identity.jwt[i],s=M_(a);s&&t.push({path:`identity.jwt.${i}`,message:s==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":s==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var fi,Um,zm,Kr,B_,gi,Sn,En,W_,$C,zt,TC,AC,IC,K_,Fm,H_,Z_,$n,V_,OC,NC,RC,LC,DC,jC,MC,UC,Gm,zC,FC,GC,BC,Tn,Hr,en=v(()=>{"use strict";He();Lm();$o();Yt();Ut();fi="1.0",Um=c.enum(["missing","proposed","confirmed","verified","approved"]),zm={missing:0,proposed:1,confirmed:2,verified:3,approved:4},Kr=c.enum(["runtime","live","enterprise"]),B_="Accounts must be approved before the first deploy.",gi={runtime:"Starter",live:"Publisher",enterprise:"Enterprise"},Sn=c.enum(["L0","L1","L2","L3","L4","L5"]),En={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},W_={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},$C=c.discriminatedUnion("kind",[c.object({kind:c.literal("human_decision"),owner:c.string(),date:c.string(),note:c.string().optional()}),c.object({kind:c.literal("generated_proposal"),tool:c.string(),model:c.string().optional(),source_context:c.string().optional()}),c.object({kind:c.literal("repository_evidence"),file:c.string(),commit:c.string().optional(),package:c.string().optional()}),c.object({kind:c.literal("platform_evidence"),system:c.string(),id:c.string()}),c.object({kind:c.literal("external_evidence"),supplier:c.string(),licence:c.string().optional(),dataset_version:c.string().optional()})]),zt={status:Um.default("missing"),provenance:c.array($C).default([])},TC=c.object({schema_version:c.string(),revision:c.number().int().nonnegative().default(0),conformance:Sn.default("L0")}),AC=c.object({repository:c.string().url(),branch:c.string().default("main")}),IC=c.object({id:c.string().min(1),title:c.string().min(1),summary:c.string().optional(),source:AC.optional(),owners:c.object({ip:c.string().optional(),delivery:c.string().optional(),platform:c.string().optional()}).prefault({}),...zt}),K_=c.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Fm="managed_runtime",H_=K_.options.filter(e=>e!==Fm);Z_=c.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot","place"]),$n=c.preprocess(e=>typeof e=="string"?We(e):e,Z_),V_=Z_.options.filter(e=>!Nt.includes(e));OC=c.object({route:K_.optional().describe(`Only ${Fm} is a route Gamestage implements: every game runs on our Engine. ${H_.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:$n.optional().describe(`The formats the Engine marks are ${Nt.join(", ")}. ${V_.join(", ")} are classifications that inspect uses to describe a game it found; nothing marks them, and a manifest naming one is refused.`),component:c.string().optional(),version:c.string().optional(),variant:c.string().optional(),configuration:c.record(c.string(),c.unknown()).default({}),round:Ze.optional(),...zt}),NC=c.object({surfaces:c.array(c.string()).default([]),container_label:c.string().min(1).default(ur),screen_graph:c.string().optional(),design:c.object({figma_file:c.string().optional(),figma_version:c.string().optional(),tokens:c.string().optional(),fidelity:Sn.optional()}).optional(),...zt}),RC=c.object({spec_url:c.string().optional(),version:c.string().optional(),...zt}),LC=c.object({family:c.string().optional(),version:c.string().optional(),configuration_schema:c.string().optional(),...zt}),DC=c.object({project_template:c.string().optional(),project_id:c.string().optional(),events:c.array(c.string()).default([]),elements:c.array(c.string()).default([]),...zt}),jC=c.object({required:c.boolean().default(!1),minimum_age:c.number().int().positive().max(120).optional(),method:c.enum(["self_declared","verified"]).default("self_declared"),verifier:c.string().optional()}),MC=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),UC=c.object({provider:c.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:MC.optional(),require_authenticated_writes:c.boolean().default(!0),age_gate:jC.prefault({}),consent:c.object({analytics_requires_consent:c.boolean().default(!0),provider:c.string().optional()}).prefault({}),...zt}),Gm=c.object({type:c.enum(["monterosa","posthog","ga4","webhook"]),enabled:c.boolean().default(!0),config:c.record(c.string(),c.string()).default({})}),zC=c.object({destinations:c.array(Gm).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:c.array(c.string()).default([]),signal:c.object({enabled:c.boolean().default(!1),application_id:c.string().optional(),write_key:c.string().optional(),monterosa:c.object({enabled:c.boolean().default(!1),organisation_id:c.string().optional(),project_id:c.string().optional()}).prefault({})}).prefault({}),...zt}),FC=c.object({hosting:c.string().optional(),space_spec:c.string().optional(),environments:c.array(c.enum(["local","playground","staging","production"])).default(["local"]),...zt}),GC=c.object({offers_prize:c.boolean().default(!1),free_entry_route:c.string().optional(),skill_based:c.boolean().default(!1),terms_url:c.string().optional(),jurisdictions:c.array(c.string()).default([])}),BC=c.object({support_tier:Kr.optional(),runbook:c.string().optional(),promotion:GC.prefault({}),...zt}),Tn=c.object({manifest:TC,app:IC,experience:NC.prefault({}),studio_app:RC.prefault({}),studio_surface:LC.prefault({}),backend:OC.prefault({}),interaction_cloud:DC.prefault({}),identity:UC.prefault({}),measurement:zC.prefault({}),deployment:FC.prefault({}),operations:BC.prefault({})});Hr=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function ct(e,t={}){let r=f=>({id:f.id,level:f.level,requirement:f.requirement,advice:f.advice,owner:f.owner,passed:f.check(e,t)}),o=Bm.filter(f=>f.checkable).map(r),n=Bm.filter(f=>!f.checkable).map(r),i="L0",a=!0;for(let f of Wm){let y=o.filter(D=>D.level===f);y.length>0&&y.every(D=>D.passed)&&a?i=f:a=!1}let s=o.filter(f=>f.level==="L0").every(f=>f.passed),l=En[i]+1,d=Wm[l],p=d?o.filter(f=>f.level===d&&!f.passed):[],h=e.manifest.conformance;return{computed:i,computedName:W_[i],claimed:h,overclaimed:!s||Math.min(En[h],En[q_])>En[i],results:o,blockers:s?p:o.filter(f=>f.level==="L0"&&!f.passed),ceiling:q_,advice:n}}function J_(e,t){let o=ct(e).results.filter(n=>!n.passed&&En[n.level]<=En[t]);return{ok:o.length===0,missing:o}}var Xn,ze,Bm,Wm,WC,HU,q_,Vs=v(()=>{"use strict";en();Xn=(e,t,r)=>{let o=e[t];return zm[o?.status??"missing"]>=zm[r]},ze=e=>typeof e=="string"?e.trim().length>0:e!=null,Bm=[{level:"L0",id:"L0.app.identity",checkable:!0,advice:"Give the game a name, and a short id we can use in web addresses.",owner:"creator",requirement:"app.id and app.title are set",check:e=>ze(e.app.id)&&ze(e.app.title)},{level:"L0",id:"L0.app.status",checkable:!0,advice:"Mark the game as started.",owner:"creator",requirement:"app section is at least proposed",check:e=>Xn(e,"app","proposed")},{level:"L0",id:"L0.schema.version",checkable:!0,advice:"The version of the format this game is described in. Set when the game was created.",owner:"creator",requirement:"manifest.schema_version is set",check:e=>ze(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",checkable:!0,advice:"Describe the screens in the game.",owner:"creator",requirement:"experience declares a screen graph or at least one player surface",check:e=>ze(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",checkable:!0,advice:"Mark the design as started.",owner:"creator",requirement:"experience section is at least proposed",check:e=>Xn(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",checkable:!0,advice:"Choose which engine runs the game: one we manage, or one you bring.",owner:"creator",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>ze(e.backend.route)},{level:"L2",id:"L2.backend.pinned",checkable:!0,advice:"Deploy the game. We record which engine answered.",owner:"creator",requirement:"a component is serving this game's rounds",check:(e,t)=>ze(t.backendComponent)||ze(e.backend.component)&&ze(e.backend.version)},{level:"L2",id:"L2.identity.policy",checkable:!0,advice:"Say how a fan signs in. If they don't sign in, say that. Gamestage does not provide sign-in, so this names the one a fan meets.",owner:"creator",requirement:"an identity provider is named",check:e=>ze(e.identity.provider)},{level:"L2",id:"L2.measurement.destination",checkable:!0,advice:"Switch on somewhere to send the data, on this game's Integrations tab. This checks the switch is on. Whether events are arriving is a separate question.",owner:"creator",requirement:"an analytics destination is switched on",check:(e,t)=>t.destinationsEnabled===!0||e.measurement.destinations.some(r=>r.enabled)},{level:"L2",id:"L2.platform.identifiers",checkable:!0,advice:"Deploy the game. That puts it on Monterosa's platform and gives you a place to manage content.",owner:"creator",requirement:"the game exists on Interaction Cloud",check:(e,t)=>ze(t.platformProject)||ze(e.studio_app.spec_url)||ze(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",checkable:!0,advice:"Deploy the game with a URL.",owner:"creator",requirement:"the game is deployed somewhere a fan can reach",check:(e,t)=>ze(t.playgroundUrl)||ze(e.deployment.space_spec)&&e.deployment.environments.some(r=>r!=="local")},{level:"L3",id:"L3.surface.declared",checkable:!1,advice:"Say what the person running your game can change: rounds, wording, or both.",owner:"creator",requirement:"a Studio Surface family is declared for operator control",check:e=>ze(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",checkable:!1,advice:"Mark which parts you have finished: the play, the scoring, and the hosting.",owner:"creator",requirement:"experience, backend and deployment are all confirmed or better",check:e=>Xn(e,"experience","confirmed")&&Xn(e,"backend","confirmed")&&Xn(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",checkable:!1,advice:"Link proof it works: a play-through recording, or a test result.",owner:"creator",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>Xn(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",checkable:!1,advice:"Name who to call when it breaks, and link the instructions they follow.",owner:"creator",requirement:"operations declares a support tier and a runbook",check:e=>ze(e.operations.support_tier)&&ze(e.operations.runbook)},{level:"L5",id:"L5.production.approved",checkable:!1,advice:"Approve the game for prod, and move your workspace onto a paid plan. Monterosa does the second part.",owner:"monterosa",requirement:"the manifest is approved and deployed to a production environment",check:e=>Xn(e,"operations","approved")&&e.deployment.environments.includes("production")}],Wm=["L0","L1","L2","L3","L4","L5"],WC=[{level:"L0",name:"Concept",means:"the game has a name and a description we hold for it"},{level:"L1",name:"Experience built",means:"there is something to play, and scoring runs on our server rather than in the browser"},{level:"L2",name:"Wired to the platform",means:"it is set up on the Monterosa platform, knows who each player is, and sends its numbers to your analytics"},{level:"L3",name:"Fans can reach it",means:"it is deployed at an address a fan can open"},{level:"L4",name:"Production ready",means:"checked with evidence, with someone to call and a page saying what to do if it breaks"},{level:"L5",name:"Operating live",means:"reviewed with you, and running in production"}],HU=new Map(WC.map(e=>[e.level,e])),q_=[...Wm].reverse().find(e=>Bm.some(t=>t.level===e&&t.checkable))??"L0"});function KC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yi(){if(X_)return An;X_=1;function e(a){return typeof a>"u"||a===null}function t(a){return typeof a=="object"&&a!==null}function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}function o(a,s){if(s){let l=Object.keys(s);for(let d=0,p=l.length;d<p;d+=1){let h=l[d];a[h]=s[h]}}return a}function n(a,s){let l="";for(let d=0;d<s;d+=1)l+=a;return l}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return An.isNothing=e,An.isObject=t,An.toArray=r,An.repeat=n,An.isNegativeZero=i,An.extend=o,An}function vi(){if(Q_)return Km;Q_=1;function e(r,o){let n="",i=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(n+='in "'+r.mark.name+'" '),n+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!o&&r.mark.snippet&&(n+=`
77
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function kn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let l=e.seen.get(s);if(l.ref===null)return;let d=l.def??l.schema,p={...d},h=l.ref;if(l.ref=null,h){o(h);let y=e.seen.get(h),k=y.schema;if(k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(k)):Object.assign(d,k),Object.assign(d,p),s._zod.parent===h)for(let b in d)b==="$ref"||b==="allOf"||b in p||delete d[b];if(k.$ref&&y.def)for(let b in d)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(d[b])===JSON.stringify(y.def[b])&&delete d[b]}let f=s._zod.parent;if(f&&f!==h){o(f);let y=e.seen.get(f);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(let k in d)k==="$ref"||k==="allOf"||k in y.def&&JSON.stringify(d[k])===JSON.stringify(y.def[k])&&delete d[k]}e.override({zodSchema:s,jsonSchema:d,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Lr(t,"input",e.processors),output:Lr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function tt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return tt(o.element,r);if(o.type==="set")return tt(o.valueType,r);if(o.type==="lazy")return tt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return tt(o.innerType,r);if(o.type==="intersection")return tt(o.left,r)||tt(o.right,r);if(o.type==="record"||o.type==="map")return tt(o.keyType,r)||tt(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:tt(o.in,r)||tt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(tt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(tt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(tt(n,r))return!0;return!!(o.rest&&tt(o.rest,r))}return!1}var Mp,Lr,Zo=v(()=>{Wo();Mp=(e,t={})=>r=>{let o=wn({...r,processors:t});return ye(e,o),_n(o,e),kn(o,e)},Lr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=wn({...n??{},target:i,io:t,processors:r});return ye(e,a),_n(a,e),kn(a,e)}});function us(e,t){if("_idmap"in e){let o=e,n=wn({...t,processors:cs}),i={};for(let l of o._idmap.entries()){let[d,p]=l;ye(p,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let l of o._idmap.entries()){let[d,p]=l;_n(n,p),a[d]=kn(n,p)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:i}}return{schemas:a}}let r=wn({...t,processors:cs});return ye(e,r),_n(r,e),kn(r,e)}var nC,Up,zp,Fp,Gp,Bp,Wp,Kp,Hp,Zp,Vp,Yp,qp,Jp,Xp,Qp,eh,th,nh,rh,oh,ih,ah,sh,ch,lh,ls,dh,uh,ph,hh,mh,fh,gh,yh,vh,bh,wh,ds,_h,cs,Vo=v(()=>{Zo();ne();nC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Up=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:d}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=nC[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),d&&(n.contentEncoding=d),l&&l.size>0){let p=[...l];p.length===1?n.pattern=p[0].source:p.length>1&&(n.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},zp=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:d,exclusiveMinimum:p}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let h=typeof p=="number"&&p>=(i??Number.NEGATIVE_INFINITY),f=typeof d=="number"&&d<=(a??Number.POSITIVE_INFINITY),y=t.target==="draft-04"||t.target==="openapi-3.0";h?y?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),f?y?(n.maximum=d,n.exclusiveMaximum=!0):n.exclusiveMaximum=d:typeof a=="number"&&(n.maximum=a),typeof l=="number"&&(n.multipleOf=l)},Fp=(e,t,r,o)=>{r.type="boolean"},Gp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Bp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Wp=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Kp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Hp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Zp=(e,t,r,o)=>{r.not={}},Vp=(e,t,r,o)=>{},Yp=(e,t,r,o)=>{},qp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Jp=(e,t,r,o)=>{let n=e._zod.def,i=Ao(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Xp=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Qp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},eh=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},th=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(d=>({contentMediaType:d}))):Object.assign(n,i)},nh=(e,t,r,o)=>{r.type="boolean"},rh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},oh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ih=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ah=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},sh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},ch=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=ye(i.element,t,{...o,path:[...o.path,"items"]})},lh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let d in a)n.properties[d]=ye(a[d],t,{...o,path:[...o.path,"properties",d]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(d=>{let p=i.shape[d]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ye(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ls=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,l)=>ye(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},dh=(e,t,r,o)=>{let n=e._zod.def,i=ye(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=ye(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},uh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((f,y)=>ye(f,t,{...o,path:[...o.path,a,y]})),d=i.rest?ye(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,d&&(n.items=d)):t.target==="openapi-3.0"?(n.items={anyOf:l},d&&n.items.anyOf.push(d),n.minItems=l.length,d||(n.maxItems=l.length)):(n.items=l,d&&(n.additionalItems=d));let{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)},ph=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let p=ye(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let h of l)n.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=ye(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=ye(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let d=a._zod.values;if(d){let p=[...d].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(n.required=p)}},hh=(e,t,r,o)=>{let n=e._zod.def,i=ye(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},mh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},fh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},gh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},yh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},vh=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;ye(a,t,o);let s=t.seen.get(e);s.ref=a},bh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},wh=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},ds=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},_h=(e,t,r,o)=>{let n=e._zod.innerType;ye(n,t,o);let i=t.seen.get(e);i.ref=n},cs={string:Up,number:zp,boolean:Fp,bigint:Gp,symbol:Bp,null:Wp,undefined:Kp,void:Hp,never:Zp,any:Vp,unknown:Yp,date:qp,enum:Jp,literal:Xp,nan:Qp,template_literal:eh,file:th,success:nh,custom:rh,function:oh,transform:ih,map:ah,set:sh,array:ch,object:lh,union:ls,intersection:dh,tuple:uh,record:ph,nullable:hh,nonoptional:mh,default:fh,prefault:gh,catch:yh,pipe:vh,readonly:bh,promise:wh,optional:ds,lazy:_h}});var ps,pw=v(()=>{Vo();Zo();ps=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=wn({processors:cs,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return ye(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),_n(this.ctx,t);let o=kn(this.ctx,t),{"~standard":n,...i}=o;return i}}});var hw={};var mw=v(()=>{});var Xt={};Ot(Xt,{$ZodAny:()=>mu,$ZodArray:()=>bu,$ZodAsyncError:()=>Et,$ZodBase64:()=>ou,$ZodBase64URL:()=>iu,$ZodBigInt:()=>Aa,$ZodBigIntFormat:()=>du,$ZodBoolean:()=>Uo,$ZodCIDRv4:()=>tu,$ZodCIDRv6:()=>nu,$ZodCUID:()=>Bd,$ZodCUID2:()=>Wd,$ZodCatch:()=>ju,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>yd,$ZodCheckEndsWith:()=>Id,$ZodCheckGreaterThan:()=>_a,$ZodCheckIncludes:()=>Td,$ZodCheckLengthEquals:()=>xd,$ZodCheckLessThan:()=>wa,$ZodCheckLowerCase:()=>Ed,$ZodCheckMaxLength:()=>_d,$ZodCheckMaxSize:()=>vd,$ZodCheckMimeType:()=>Pd,$ZodCheckMinLength:()=>kd,$ZodCheckMinSize:()=>bd,$ZodCheckMultipleOf:()=>fd,$ZodCheckNumberFormat:()=>gd,$ZodCheckOverwrite:()=>Od,$ZodCheckProperty:()=>Cd,$ZodCheckRegex:()=>Sd,$ZodCheckSizeEquals:()=>wd,$ZodCheckStartsWith:()=>Ad,$ZodCheckStringFormat:()=>wr,$ZodCheckUpperCase:()=>$d,$ZodCodec:()=>Fo,$ZodCustom:()=>Ku,$ZodCustomStringFormat:()=>cu,$ZodDate:()=>vu,$ZodDefault:()=>Nu,$ZodDiscriminatedUnion:()=>ku,$ZodE164:()=>au,$ZodEmail:()=>Ud,$ZodEmoji:()=>Fd,$ZodEncodeError:()=>hn,$ZodEnum:()=>Tu,$ZodError:()=>No,$ZodExactOptional:()=>Pu,$ZodFile:()=>Iu,$ZodFunction:()=>Gu,$ZodGUID:()=>jd,$ZodIPv4:()=>Xd,$ZodIPv6:()=>Qd,$ZodISODate:()=>Yd,$ZodISODateTime:()=>Vd,$ZodISODuration:()=>Jd,$ZodISOTime:()=>qd,$ZodIntersection:()=>xu,$ZodJWT:()=>su,$ZodKSUID:()=>Zd,$ZodLazy:()=>Wu,$ZodLiteral:()=>Au,$ZodMAC:()=>eu,$ZodMap:()=>Eu,$ZodNaN:()=>Mu,$ZodNanoID:()=>Gd,$ZodNever:()=>gu,$ZodNonOptional:()=>Lu,$ZodNull:()=>hu,$ZodNullable:()=>Ou,$ZodNumber:()=>Ta,$ZodNumberFormat:()=>lu,$ZodObject:()=>mv,$ZodObjectJIT:()=>wu,$ZodOptional:()=>Ca,$ZodPipe:()=>Pa,$ZodPrefault:()=>Ru,$ZodPreprocess:()=>Uu,$ZodPromise:()=>Bu,$ZodReadonly:()=>zu,$ZodRealError:()=>at,$ZodRecord:()=>Su,$ZodRegistry:()=>La,$ZodSet:()=>$u,$ZodString:()=>Kn,$ZodStringFormat:()=>ve,$ZodSuccess:()=>Du,$ZodSymbol:()=>uu,$ZodTemplateLiteral:()=>Fu,$ZodTransform:()=>Cu,$ZodTuple:()=>Ia,$ZodType:()=>ae,$ZodULID:()=>Kd,$ZodURL:()=>zd,$ZodUUID:()=>Md,$ZodUndefined:()=>pu,$ZodUnion:()=>zo,$ZodUnknown:()=>fu,$ZodVoid:()=>yu,$ZodXID:()=>Hd,$ZodXor:()=>_u,$brand:()=>kl,$constructor:()=>_,$input:()=>Xu,$output:()=>Ju,Doc:()=>Mo,JSONSchema:()=>hw,JSONSchemaGenerator:()=>ps,NEVER:()=>_l,TimePrecision:()=>np,_any:()=>xp,_array:()=>Cp,_base64:()=>Qa,_base64url:()=>es,_bigint:()=>gp,_boolean:()=>mp,_catch:()=>qI,_check:()=>dw,_cidrv4:()=>Ja,_cidrv6:()=>Xa,_coercedBigint:()=>yp,_coercedBoolean:()=>fp,_coercedDate:()=>Ap,_coercedNumber:()=>cp,_coercedString:()=>ep,_cuid:()=>Wa,_cuid2:()=>Ka,_custom:()=>Op,_date:()=>Tp,_decode:()=>da,_decodeAsync:()=>pa,_default:()=>ZI,_discriminatedUnion:()=>LI,_e164:()=>ts,_email:()=>ja,_emoji:()=>Ga,_encode:()=>la,_encodeAsync:()=>ua,_endsWith:()=>Tr,_enum:()=>FI,_file:()=>Pp,_float32:()=>dp,_float64:()=>up,_gt:()=>Lt,_gte:()=>et,_guid:()=>Ko,_includes:()=>Er,_int:()=>lp,_int32:()=>pp,_int64:()=>vp,_intersection:()=>DI,_ipv4:()=>Ya,_ipv6:()=>qa,_isoDate:()=>op,_isoDateTime:()=>rp,_isoDuration:()=>ap,_isoTime:()=>ip,_jwt:()=>ns,_ksuid:()=>Va,_lazy:()=>eC,_length:()=>Vn,_literal:()=>BI,_lowercase:()=>xr,_lt:()=>Rt,_lte:()=>ht,_mac:()=>tp,_map:()=>UI,_max:()=>ht,_maxLength:()=>Zn,_maxSize:()=>bn,_mime:()=>Ar,_min:()=>et,_minLength:()=>Jt,_minSize:()=>Dt,_multipleOf:()=>vn,_nan:()=>Ip,_nanoid:()=>Ba,_nativeEnum:()=>GI,_negative:()=>os,_never:()=>Ep,_nonnegative:()=>as,_nonoptional:()=>VI,_nonpositive:()=>is,_normalize:()=>Ir,_null:()=>kp,_nullable:()=>HI,_number:()=>sp,_optional:()=>KI,_overwrite:()=>$t,_parse:()=>gr,_parseAsync:()=>yr,_pipe:()=>JI,_positive:()=>rs,_promise:()=>tC,_property:()=>ss,_readonly:()=>XI,_record:()=>MI,_refine:()=>Np,_regex:()=>kr,_safeDecode:()=>ma,_safeDecodeAsync:()=>ga,_safeEncode:()=>ha,_safeEncodeAsync:()=>fa,_safeParse:()=>vr,_safeParseAsync:()=>br,_set:()=>zI,_size:()=>Hn,_slugify:()=>Nr,_startsWith:()=>$r,_string:()=>Qu,_stringFormat:()=>Rr,_stringbool:()=>jp,_success:()=>YI,_superRefine:()=>Rp,_symbol:()=>wp,_templateLiteral:()=>QI,_toLowerCase:()=>Pr,_toUpperCase:()=>Or,_transform:()=>WI,_trim:()=>Cr,_tuple:()=>jI,_uint32:()=>hp,_uint64:()=>bp,_ulid:()=>Ha,_undefined:()=>_p,_union:()=>NI,_unknown:()=>Sp,_uppercase:()=>Sr,_url:()=>Ho,_uuid:()=>Ma,_uuidv4:()=>Ua,_uuidv6:()=>za,_uuidv7:()=>Fa,_void:()=>$p,_xid:()=>Za,_xor:()=>RI,clone:()=>Xe,config:()=>Ae,createStandardJSONSchemaMethod:()=>Lr,createToJSONSchemaMethod:()=>Mp,decode:()=>t0,decodeAsync:()=>r0,describe:()=>Lp,encode:()=>e0,encodeAsync:()=>n0,extractDefs:()=>_n,finalize:()=>kn,flattenError:()=>Ro,formatError:()=>Lo,globalConfig:()=>Fn,globalRegistry:()=>Ue,initializeContext:()=>wn,isValidBase64:()=>ru,isValidBase64URL:()=>dv,isValidJWT:()=>uv,locales:()=>Bo,meta:()=>Dp,parse:()=>sa,parseAsync:()=>ca,prettifyError:()=>Ll,process:()=>ye,regexes:()=>pt,registry:()=>Da,safeDecode:()=>i0,safeDecodeAsync:()=>s0,safeEncode:()=>o0,safeEncodeAsync:()=>a0,safeParse:()=>jl,safeParseAsync:()=>Ml,toDotPath:()=>By,toJSONSchema:()=>us,treeifyError:()=>Rl,util:()=>B,version:()=>Rd});var mt=v(()=>{Gn();Ul();Dl();Hu();ka();Ld();ne();ba();qu();Wo();Nd();uw();Zo();Vo();pw();mw()});var hs={};Ot(hs,{endsWith:()=>Tr,gt:()=>Lt,gte:()=>et,includes:()=>Er,length:()=>Vn,lowercase:()=>xr,lt:()=>Rt,lte:()=>ht,maxLength:()=>Zn,maxSize:()=>bn,mime:()=>Ar,minLength:()=>Jt,minSize:()=>Dt,multipleOf:()=>vn,negative:()=>os,nonnegative:()=>as,nonpositive:()=>is,normalize:()=>Ir,overwrite:()=>$t,positive:()=>rs,property:()=>ss,regex:()=>kr,size:()=>Hn,slugify:()=>Nr,startsWith:()=>$r,toLowerCase:()=>Pr,toUpperCase:()=>Or,trim:()=>Cr,uppercase:()=>Sr});var ms=v(()=>{mt()});var Dr={};Ot(Dr,{ZodISODate:()=>gs,ZodISODateTime:()=>fs,ZodISODuration:()=>vs,ZodISOTime:()=>ys,date:()=>xh,datetime:()=>kh,duration:()=>Eh,time:()=>Sh});function kh(e){return rp(fs,e)}function xh(e){return op(gs,e)}function Sh(e){return ip(ys,e)}function Eh(e){return ap(vs,e)}var fs,gs,ys,vs,Yo=v(()=>{mt();Jo();fs=_("ZodISODateTime",(e,t)=>{Vd.init(e,t),be.init(e,t)});gs=_("ZodISODate",(e,t)=>{Yd.init(e,t),be.init(e,t)});ys=_("ZodISOTime",(e,t)=>{qd.init(e,t),be.init(e,t)});vs=_("ZodISODuration",(e,t)=>{Jd.init(e,t),be.init(e,t)})});var fw,oC,st,$h=v(()=>{mt();mt();ne();fw=(e,t)=>{No.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Lo(e,r)},flatten:{value:r=>Ro(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,hr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,hr,2)}},isEmpty:{get(){return e.issues.length===0}}})},oC=_("ZodError",fw),st=_("ZodError",fw,{Parent:Error})});var Th,Ah,Ih,Ch,Ph,Oh,Nh,Rh,Lh,Dh,jh,Mh,Uh=v(()=>{mt();$h();Th=gr(st),Ah=yr(st),Ih=vr(st),Ch=br(st),Ph=la(st),Oh=da(st),Nh=ua(st),Rh=pa(st),Lh=ha(st),Dh=ma(st),jh=fa(st),Mh=ga(st)});var qo={};Ot(qo,{ZodAny:()=>Zh,ZodArray:()=>Jh,ZodBase64:()=>Rs,ZodBase64URL:()=>Ls,ZodBigInt:()=>Br,ZodBigIntFormat:()=>Ms,ZodBoolean:()=>Gr,ZodCIDRv4:()=>Os,ZodCIDRv6:()=>Ns,ZodCUID:()=>Es,ZodCUID2:()=>$s,ZodCatch:()=>bm,ZodCodec:()=>li,ZodCustom:()=>di,ZodCustomStringFormat:()=>zr,ZodDate:()=>oi,ZodDefault:()=>hm,ZodDiscriminatedUnion:()=>Qh,ZodE164:()=>Ds,ZodEmail:()=>ks,ZodEmoji:()=>xs,ZodEnum:()=>Mr,ZodExactOptional:()=>dm,ZodFile:()=>cm,ZodFunction:()=>Im,ZodGUID:()=>Qo,ZodIPv4:()=>Cs,ZodIPv6:()=>Ps,ZodIntersection:()=>em,ZodJWT:()=>js,ZodKSUID:()=>Is,ZodLazy:()=>$m,ZodLiteral:()=>sm,ZodMAC:()=>zh,ZodMap:()=>im,ZodNaN:()=>_m,ZodNanoID:()=>Ss,ZodNever:()=>Yh,ZodNonOptional:()=>Ws,ZodNull:()=>Kh,ZodNullable:()=>pm,ZodNumber:()=>Fr,ZodNumberFormat:()=>qn,ZodObject:()=>ai,ZodOptional:()=>Bs,ZodPipe:()=>ci,ZodPrefault:()=>fm,ZodPreprocess:()=>km,ZodPromise:()=>Am,ZodReadonly:()=>xm,ZodRecord:()=>jr,ZodSet:()=>am,ZodString:()=>Ur,ZodStringFormat:()=>be,ZodSuccess:()=>vm,ZodSymbol:()=>Bh,ZodTemplateLiteral:()=>Em,ZodTransform:()=>lm,ZodTuple:()=>nm,ZodType:()=>le,ZodULID:()=>Ts,ZodURL:()=>ri,ZodUUID:()=>jt,ZodUndefined:()=>Wh,ZodUnion:()=>si,ZodUnknown:()=>Vh,ZodVoid:()=>qh,ZodXID:()=>As,ZodXor:()=>Xh,_ZodString:()=>_s,_default:()=>mm,_function:()=>x_,any:()=>e_,array:()=>ii,base64:()=>jw,base64url:()=>Mw,bigint:()=>Yw,boolean:()=>Gh,catch:()=>wm,check:()=>S_,cidrv4:()=>Lw,cidrv6:()=>Dw,codec:()=>b_,cuid:()=>Tw,cuid2:()=>Aw,custom:()=>E_,date:()=>n_,describe:()=>$_,discriminatedUnion:()=>c_,e164:()=>Uw,email:()=>yw,emoji:()=>Ew,enum:()=>Fs,exactOptional:()=>um,file:()=>f_,float32:()=>Kw,float64:()=>Hw,function:()=>x_,guid:()=>vw,hash:()=>Ww,hex:()=>Bw,hostname:()=>Gw,httpUrl:()=>Sw,instanceof:()=>A_,int:()=>bs,int32:()=>Zw,int64:()=>qw,intersection:()=>tm,invertCodec:()=>w_,ipv4:()=>Ow,ipv6:()=>Rw,json:()=>C_,jwt:()=>zw,keyof:()=>r_,ksuid:()=>Pw,lazy:()=>Tm,literal:()=>m_,looseObject:()=>a_,looseRecord:()=>d_,mac:()=>Nw,map:()=>u_,meta:()=>T_,nan:()=>v_,nanoid:()=>$w,nativeEnum:()=>h_,never:()=>Us,nonoptional:()=>ym,null:()=>Hh,nullable:()=>ti,nullish:()=>g_,number:()=>Fh,object:()=>o_,optional:()=>ei,partialRecord:()=>l_,pipe:()=>ws,prefault:()=>gm,preprocess:()=>P_,promise:()=>k_,readonly:()=>Sm,record:()=>om,refine:()=>Cm,set:()=>p_,strictObject:()=>i_,string:()=>Xo,stringFormat:()=>Fw,stringbool:()=>I_,success:()=>y_,superRefine:()=>Pm,symbol:()=>Xw,templateLiteral:()=>__,transform:()=>Gs,tuple:()=>rm,uint32:()=>Vw,uint64:()=>Jw,ulid:()=>Iw,undefined:()=>Qw,union:()=>zs,unknown:()=>Yn,url:()=>xw,uuid:()=>bw,uuidv4:()=>ww,uuidv6:()=>_w,uuidv7:()=>kw,void:()=>t_,xid:()=>Cw,xor:()=>s_});function ni(e,t,r){let o=Object.getPrototypeOf(e),n=gw.get(o);if(n||(n=new Set,gw.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}function Xo(e){return Qu(Ur,e)}function yw(e){return ja(ks,e)}function vw(e){return Ko(Qo,e)}function bw(e){return Ma(jt,e)}function ww(e){return Ua(jt,e)}function _w(e){return za(jt,e)}function kw(e){return Fa(jt,e)}function xw(e){return Ho(ri,e)}function Sw(e){return Ho(ri,{protocol:pt.httpProtocol,hostname:pt.domain,...B.normalizeParams(e)})}function Ew(e){return Ga(xs,e)}function $w(e){return Ba(Ss,e)}function Tw(e){return Wa(Es,e)}function Aw(e){return Ka($s,e)}function Iw(e){return Ha(Ts,e)}function Cw(e){return Za(As,e)}function Pw(e){return Va(Is,e)}function Ow(e){return Ya(Cs,e)}function Nw(e){return tp(zh,e)}function Rw(e){return qa(Ps,e)}function Lw(e){return Ja(Os,e)}function Dw(e){return Xa(Ns,e)}function jw(e){return Qa(Rs,e)}function Mw(e){return es(Ls,e)}function Uw(e){return ts(Ds,e)}function zw(e){return ns(js,e)}function Fw(e,t,r={}){return Rr(zr,e,t,r)}function Gw(e){return Rr(zr,"hostname",pt.hostname,e)}function Bw(e){return Rr(zr,"hex",pt.hex,e)}function Ww(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=pt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Rr(zr,o,n,t)}function Fh(e){return sp(Fr,e)}function bs(e){return lp(qn,e)}function Kw(e){return dp(qn,e)}function Hw(e){return up(qn,e)}function Zw(e){return pp(qn,e)}function Vw(e){return hp(qn,e)}function Gh(e){return mp(Gr,e)}function Yw(e){return gp(Br,e)}function qw(e){return vp(Ms,e)}function Jw(e){return bp(Ms,e)}function Xw(e){return wp(Bh,e)}function Qw(e){return _p(Wh,e)}function Hh(e){return kp(Kh,e)}function e_(){return xp(Zh)}function Yn(){return Sp(Vh)}function Us(e){return Ep(Yh,e)}function t_(e){return $p(qh,e)}function n_(e){return Tp(oi,e)}function ii(e,t){return Cp(Jh,e,t)}function r_(e){let t=e._zod.def.shape;return Fs(Object.keys(t))}function o_(e,t){let r={type:"object",shape:e??{},...B.normalizeParams(t)};return new ai(r)}function i_(e,t){return new ai({type:"object",shape:e,catchall:Us(),...B.normalizeParams(t)})}function a_(e,t){return new ai({type:"object",shape:e,catchall:Yn(),...B.normalizeParams(t)})}function zs(e,t){return new si({type:"union",options:e,...B.normalizeParams(t)})}function s_(e,t){return new Xh({type:"union",options:e,inclusive:!1,...B.normalizeParams(t)})}function c_(e,t,r){return new Qh({type:"union",options:t,discriminator:e,...B.normalizeParams(r)})}function tm(e,t){return new em({type:"intersection",left:e,right:t})}function rm(e,t,r){let o=t instanceof ae,n=o?r:t,i=o?t:null;return new nm({type:"tuple",items:e,rest:i,...B.normalizeParams(n)})}function om(e,t,r){return!t||!t._zod?new jr({type:"record",keyType:Xo(),valueType:e,...B.normalizeParams(t)}):new jr({type:"record",keyType:e,valueType:t,...B.normalizeParams(r)})}function l_(e,t,r){let o=Xe(e);return o._zod.values=void 0,new jr({type:"record",keyType:o,valueType:t,...B.normalizeParams(r)})}function d_(e,t,r){return new jr({type:"record",keyType:e,valueType:t,mode:"loose",...B.normalizeParams(r)})}function u_(e,t,r){return new im({type:"map",keyType:e,valueType:t,...B.normalizeParams(r)})}function p_(e,t){return new am({type:"set",valueType:e,...B.normalizeParams(t)})}function Fs(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Mr({type:"enum",entries:r,...B.normalizeParams(t)})}function h_(e,t){return new Mr({type:"enum",entries:e,...B.normalizeParams(t)})}function m_(e,t){return new sm({type:"literal",values:Array.isArray(e)?e:[e],...B.normalizeParams(t)})}function f_(e){return Pp(cm,e)}function Gs(e){return new lm({type:"transform",transform:e})}function ei(e){return new Bs({type:"optional",innerType:e})}function um(e){return new dm({type:"optional",innerType:e})}function ti(e){return new pm({type:"nullable",innerType:e})}function g_(e){return ei(ti(e))}function mm(e,t){return new hm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():B.shallowClone(t)}})}function gm(e,t){return new fm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():B.shallowClone(t)}})}function ym(e,t){return new Ws({type:"nonoptional",innerType:e,...B.normalizeParams(t)})}function y_(e){return new vm({type:"success",innerType:e})}function wm(e,t){return new bm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function v_(e){return Ip(_m,e)}function ws(e,t){return new ci({type:"pipe",in:e,out:t})}function b_(e,t,r){return new li({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function w_(e){let t=e._zod.def;return new li({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Sm(e){return new xm({type:"readonly",innerType:e})}function __(e,t){return new Em({type:"template_literal",parts:e,...B.normalizeParams(t)})}function Tm(e){return new $m({type:"lazy",getter:e})}function k_(e){return new Am({type:"promise",innerType:e})}function x_(e){return new Im({type:"function",input:Array.isArray(e?.input)?rm(e?.input):e?.input??ii(Yn()),output:e?.output??Yn()})}function S_(e){let t=new we({check:"custom"});return t._zod.check=e,t}function E_(e,t){return Op(di,e??(()=>!0),t)}function Cm(e,t={}){return Np(di,e,t)}function Pm(e,t){return Rp(e,t)}function A_(e,t={}){let r=new di({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...B.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function C_(e){let t=Tm(()=>zs([Xo(e),Fh(),Gh(),Hh(),ii(t),om(Xo(),t)]));return t}function P_(e,t){return new km({type:"pipe",in:Gs(e),out:t})}var gw,le,_s,Ur,be,ks,Qo,jt,ri,xs,Ss,Es,$s,Ts,As,Is,Cs,zh,Ps,Os,Ns,Rs,Ls,Ds,js,zr,Fr,qn,Gr,Br,Ms,Bh,Wh,Kh,Zh,Vh,Yh,qh,oi,Jh,ai,si,Xh,Qh,em,nm,jr,im,am,Mr,sm,cm,lm,Bs,dm,pm,hm,fm,Ws,vm,bm,_m,ci,li,km,xm,Em,$m,Am,Im,di,$_,T_,I_,Jo=v(()=>{mt();mt();Vo();Zo();ms();Yo();Uh();gw=new WeakMap;le=_("ZodType",(e,t)=>(ae.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Lr(e,"input"),output:Lr(e,"output")}}),e.toJSONSchema=Mp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Th(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Ih(e,r,o),e.parseAsync=async(r,o)=>Ah(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Ch(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Ph(e,r,o),e.decode=(r,o)=>Oh(e,r,o),e.encodeAsync=async(r,o)=>Nh(e,r,o),e.decodeAsync=async(r,o)=>Rh(e,r,o),e.safeEncode=(r,o)=>Lh(e,r,o),e.safeDecode=(r,o)=>Dh(e,r,o),e.safeEncodeAsync=async(r,o)=>jh(e,r,o),e.safeDecodeAsync=async(r,o)=>Mh(e,r,o),ni(e,"ZodType",{check(...r){let o=this.def;return this.clone(B.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Xe(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Cm(r,o))},superRefine(r,o){return this.check(Pm(r,o))},overwrite(r){return this.check($t(r))},optional(){return ei(this)},exactOptional(){return um(this)},nullable(){return ti(this)},nullish(){return ei(ti(this))},nonoptional(r){return ym(this,r)},array(){return ii(this)},or(r){return zs([this,r])},and(r){return tm(this,r)},transform(r){return ws(this,Gs(r))},default(r){return mm(this,r)},prefault(r){return gm(this,r)},catch(r){return wm(this,r)},pipe(r){return ws(this,r)},readonly(){return Sm(this)},describe(r){let o=this.clone();return Ue.add(o,{description:r}),o},meta(...r){if(r.length===0)return Ue.get(this);let o=this.clone();return Ue.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ue.get(e)?.description},configurable:!0}),e)),_s=_("_ZodString",(e,t)=>{Kn.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Up(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,ni(e,"_ZodString",{regex(...o){return this.check(kr(...o))},includes(...o){return this.check(Er(...o))},startsWith(...o){return this.check($r(...o))},endsWith(...o){return this.check(Tr(...o))},min(...o){return this.check(Jt(...o))},max(...o){return this.check(Zn(...o))},length(...o){return this.check(Vn(...o))},nonempty(...o){return this.check(Jt(1,...o))},lowercase(o){return this.check(xr(o))},uppercase(o){return this.check(Sr(o))},trim(){return this.check(Cr())},normalize(...o){return this.check(Ir(...o))},toLowerCase(){return this.check(Pr())},toUpperCase(){return this.check(Or())},slugify(){return this.check(Nr())}})}),Ur=_("ZodString",(e,t)=>{Kn.init(e,t),_s.init(e,t),e.email=r=>e.check(ja(ks,r)),e.url=r=>e.check(Ho(ri,r)),e.jwt=r=>e.check(ns(js,r)),e.emoji=r=>e.check(Ga(xs,r)),e.guid=r=>e.check(Ko(Qo,r)),e.uuid=r=>e.check(Ma(jt,r)),e.uuidv4=r=>e.check(Ua(jt,r)),e.uuidv6=r=>e.check(za(jt,r)),e.uuidv7=r=>e.check(Fa(jt,r)),e.nanoid=r=>e.check(Ba(Ss,r)),e.guid=r=>e.check(Ko(Qo,r)),e.cuid=r=>e.check(Wa(Es,r)),e.cuid2=r=>e.check(Ka($s,r)),e.ulid=r=>e.check(Ha(Ts,r)),e.base64=r=>e.check(Qa(Rs,r)),e.base64url=r=>e.check(es(Ls,r)),e.xid=r=>e.check(Za(As,r)),e.ksuid=r=>e.check(Va(Is,r)),e.ipv4=r=>e.check(Ya(Cs,r)),e.ipv6=r=>e.check(qa(Ps,r)),e.cidrv4=r=>e.check(Ja(Os,r)),e.cidrv6=r=>e.check(Xa(Ns,r)),e.e164=r=>e.check(ts(Ds,r)),e.datetime=r=>e.check(kh(r)),e.date=r=>e.check(xh(r)),e.time=r=>e.check(Sh(r)),e.duration=r=>e.check(Eh(r))});be=_("ZodStringFormat",(e,t)=>{ve.init(e,t),_s.init(e,t)}),ks=_("ZodEmail",(e,t)=>{Ud.init(e,t),be.init(e,t)});Qo=_("ZodGUID",(e,t)=>{jd.init(e,t),be.init(e,t)});jt=_("ZodUUID",(e,t)=>{Md.init(e,t),be.init(e,t)});ri=_("ZodURL",(e,t)=>{zd.init(e,t),be.init(e,t)});xs=_("ZodEmoji",(e,t)=>{Fd.init(e,t),be.init(e,t)});Ss=_("ZodNanoID",(e,t)=>{Gd.init(e,t),be.init(e,t)});Es=_("ZodCUID",(e,t)=>{Bd.init(e,t),be.init(e,t)});$s=_("ZodCUID2",(e,t)=>{Wd.init(e,t),be.init(e,t)});Ts=_("ZodULID",(e,t)=>{Kd.init(e,t),be.init(e,t)});As=_("ZodXID",(e,t)=>{Hd.init(e,t),be.init(e,t)});Is=_("ZodKSUID",(e,t)=>{Zd.init(e,t),be.init(e,t)});Cs=_("ZodIPv4",(e,t)=>{Xd.init(e,t),be.init(e,t)});zh=_("ZodMAC",(e,t)=>{eu.init(e,t),be.init(e,t)});Ps=_("ZodIPv6",(e,t)=>{Qd.init(e,t),be.init(e,t)});Os=_("ZodCIDRv4",(e,t)=>{tu.init(e,t),be.init(e,t)});Ns=_("ZodCIDRv6",(e,t)=>{nu.init(e,t),be.init(e,t)});Rs=_("ZodBase64",(e,t)=>{ou.init(e,t),be.init(e,t)});Ls=_("ZodBase64URL",(e,t)=>{iu.init(e,t),be.init(e,t)});Ds=_("ZodE164",(e,t)=>{au.init(e,t),be.init(e,t)});js=_("ZodJWT",(e,t)=>{su.init(e,t),be.init(e,t)});zr=_("ZodCustomStringFormat",(e,t)=>{cu.init(e,t),be.init(e,t)});Fr=_("ZodNumber",(e,t)=>{Ta.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>zp(e,o,n,i),ni(e,"ZodNumber",{gt(o,n){return this.check(Lt(o,n))},gte(o,n){return this.check(et(o,n))},min(o,n){return this.check(et(o,n))},lt(o,n){return this.check(Rt(o,n))},lte(o,n){return this.check(ht(o,n))},max(o,n){return this.check(ht(o,n))},int(o){return this.check(bs(o))},safe(o){return this.check(bs(o))},positive(o){return this.check(Lt(0,o))},nonnegative(o){return this.check(et(0,o))},negative(o){return this.check(Rt(0,o))},nonpositive(o){return this.check(ht(0,o))},multipleOf(o,n){return this.check(vn(o,n))},step(o,n){return this.check(vn(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});qn=_("ZodNumberFormat",(e,t)=>{lu.init(e,t),Fr.init(e,t)});Gr=_("ZodBoolean",(e,t)=>{Uo.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fp(e,r,o,n)});Br=_("ZodBigInt",(e,t)=>{Aa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Gp(e,o,n,i),e.gte=(o,n)=>e.check(et(o,n)),e.min=(o,n)=>e.check(et(o,n)),e.gt=(o,n)=>e.check(Lt(o,n)),e.gte=(o,n)=>e.check(et(o,n)),e.min=(o,n)=>e.check(et(o,n)),e.lt=(o,n)=>e.check(Rt(o,n)),e.lte=(o,n)=>e.check(ht(o,n)),e.max=(o,n)=>e.check(ht(o,n)),e.positive=o=>e.check(Lt(BigInt(0),o)),e.negative=o=>e.check(Rt(BigInt(0),o)),e.nonpositive=o=>e.check(ht(BigInt(0),o)),e.nonnegative=o=>e.check(et(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(vn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Ms=_("ZodBigIntFormat",(e,t)=>{du.init(e,t),Br.init(e,t)});Bh=_("ZodSymbol",(e,t)=>{uu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bp(e,r,o,n)});Wh=_("ZodUndefined",(e,t)=>{pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kp(e,r,o,n)});Kh=_("ZodNull",(e,t)=>{hu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wp(e,r,o,n)});Zh=_("ZodAny",(e,t)=>{mu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vp(e,r,o,n)});Vh=_("ZodUnknown",(e,t)=>{fu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yp(e,r,o,n)});Yh=_("ZodNever",(e,t)=>{gu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zp(e,r,o,n)});qh=_("ZodVoid",(e,t)=>{yu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hp(e,r,o,n)});oi=_("ZodDate",(e,t)=>{vu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>qp(e,o,n,i),e.min=(o,n)=>e.check(et(o,n)),e.max=(o,n)=>e.check(ht(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});Jh=_("ZodArray",(e,t)=>{bu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ch(e,r,o,n),e.element=t.element,ni(e,"ZodArray",{min(r,o){return this.check(Jt(r,o))},nonempty(r){return this.check(Jt(1,r))},max(r,o){return this.check(Zn(r,o))},length(r,o){return this.check(Vn(r,o))},unwrap(){return this.element}})});ai=_("ZodObject",(e,t)=>{wu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lh(e,r,o,n),B.defineLazy(e,"shape",()=>t.shape),ni(e,"ZodObject",{keyof(){return Fs(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Yn()})},loose(){return this.clone({...this._zod.def,catchall:Yn()})},strict(){return this.clone({...this._zod.def,catchall:Us()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return B.extend(this,r)},safeExtend(r){return B.safeExtend(this,r)},merge(r){return B.merge(this,r)},pick(r){return B.pick(this,r)},omit(r){return B.omit(this,r)},partial(...r){return B.partial(Bs,this,r[0])},required(...r){return B.required(Ws,this,r[0])}})});si=_("ZodUnion",(e,t)=>{zo.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ls(e,r,o,n),e.options=t.options});Xh=_("ZodXor",(e,t)=>{si.init(e,t),_u.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ls(e,r,o,n),e.options=t.options});Qh=_("ZodDiscriminatedUnion",(e,t)=>{si.init(e,t),ku.init(e,t)});em=_("ZodIntersection",(e,t)=>{xu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dh(e,r,o,n)});nm=_("ZodTuple",(e,t)=>{Ia.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uh(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});jr=_("ZodRecord",(e,t)=>{Su.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ph(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});im=_("ZodMap",(e,t)=>{Eu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ah(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Dt(...r)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(...r)=>e.check(bn(...r)),e.size=(...r)=>e.check(Hn(...r))});am=_("ZodSet",(e,t)=>{$u.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sh(e,r,o,n),e.min=(...r)=>e.check(Dt(...r)),e.nonempty=r=>e.check(Dt(1,r)),e.max=(...r)=>e.check(bn(...r)),e.size=(...r)=>e.check(Hn(...r))});Mr=_("ZodEnum",(e,t)=>{Tu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Jp(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Mr({...t,checks:[],...B.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Mr({...t,checks:[],...B.normalizeParams(n),entries:i})}});sm=_("ZodLiteral",(e,t)=>{Au.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xp(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});cm=_("ZodFile",(e,t)=>{Iu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>th(e,r,o,n),e.min=(r,o)=>e.check(Dt(r,o)),e.max=(r,o)=>e.check(bn(r,o)),e.mime=(r,o)=>e.check(Ar(Array.isArray(r)?r:[r],o))});lm=_("ZodTransform",(e,t)=>{Cu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ih(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new hn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(B.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(B.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});Bs=_("ZodOptional",(e,t)=>{Ca.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ds(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});dm=_("ZodExactOptional",(e,t)=>{Pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ds(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});pm=_("ZodNullable",(e,t)=>{Ou.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});hm=_("ZodDefault",(e,t)=>{Nu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});fm=_("ZodPrefault",(e,t)=>{Ru.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Ws=_("ZodNonOptional",(e,t)=>{Lu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});vm=_("ZodSuccess",(e,t)=>{Du.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});bm=_("ZodCatch",(e,t)=>{ju.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});_m=_("ZodNaN",(e,t)=>{Mu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qp(e,r,o,n)});ci=_("ZodPipe",(e,t)=>{Pa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vh(e,r,o,n),e.in=t.in,e.out=t.out});li=_("ZodCodec",(e,t)=>{ci.init(e,t),Fo.init(e,t)});km=_("ZodPreprocess",(e,t)=>{ci.init(e,t),Uu.init(e,t)}),xm=_("ZodReadonly",(e,t)=>{zu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Em=_("ZodTemplateLiteral",(e,t)=>{Fu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eh(e,r,o,n)});$m=_("ZodLazy",(e,t)=>{Wu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_h(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});Am=_("ZodPromise",(e,t)=>{Bu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Im=_("ZodFunction",(e,t)=>{Gu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oh(e,r,o,n)});di=_("ZodCustom",(e,t)=>{Ku.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rh(e,r,o,n)});$_=Lp,T_=Dp;I_=(...e)=>jp({Codec:li,Boolean:Gr,String:Ur},...e)});function sC(e){Ae({customError:e})}function cC(){return Ae().customError}var aC,Om,O_=v(()=>{mt();aC={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Om||(Om={})});function dC(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function uC(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function N_(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Y.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Y.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=uC(n,t),a=Ke(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return Y.null();if(n.length===0)return Y.never();if(n.length===1)return Y.literal(n[0]);if(n.every(a=>typeof a=="string"))return Y.enum(n);let i=n.map(a=>Y.literal(a));return i.length<2?i[0]:Y.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return Y.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return N_(a,t)});return n.length===0?Y.never():n.length===1?n[0]:Y.union(n)}if(!r)return Y.any();let o;switch(r){case"string":{let n=Y.string();if(e.format){let i=e.format;i==="email"?n=n.check(Y.email()):i==="uri"||i==="uri-reference"?n=n.check(Y.url()):i==="uuid"||i==="guid"?n=n.check(Y.uuid()):i==="date-time"?n=n.check(Y.iso.datetime()):i==="date"?n=n.check(Y.iso.date()):i==="time"?n=n.check(Y.iso.time()):i==="duration"?n=n.check(Y.iso.duration()):i==="ipv4"?n=n.check(Y.ipv4()):i==="ipv6"?n=n.check(Y.ipv6()):i==="mac"?n=n.check(Y.mac()):i==="cidr"?n=n.check(Y.cidrv4()):i==="cidr-v6"?n=n.check(Y.cidrv6()):i==="base64"?n=n.check(Y.base64()):i==="base64url"?n=n.check(Y.base64url()):i==="e164"?n=n.check(Y.e164()):i==="jwt"?n=n.check(Y.jwt()):i==="emoji"?n=n.check(Y.emoji()):i==="nanoid"?n=n.check(Y.nanoid()):i==="cuid"?n=n.check(Y.cuid()):i==="cuid2"?n=n.check(Y.cuid2()):i==="ulid"?n=n.check(Y.ulid()):i==="xid"?n=n.check(Y.xid()):i==="ksuid"&&(n=n.check(Y.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?Y.number().int():Y.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=Y.boolean();break}case"null":{o=Y.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[l,d]of Object.entries(i)){let p=Ke(d,t);n[l]=a.has(l)?p:p.optional()}if(e.propertyNames){let l=Ke(e.propertyNames,t),d=e.additionalProperties&&typeof e.additionalProperties=="object"?Ke(e.additionalProperties,t):Y.any();if(Object.keys(n).length===0){o=Y.record(l,d);break}let p=Y.object(n).passthrough(),h=Y.looseRecord(l,d);o=Y.intersection(p,h);break}if(e.patternProperties){let l=e.patternProperties,d=Object.keys(l),p=[];for(let f of d){let y=Ke(l[f],t),k=Y.string().regex(new RegExp(f));p.push(Y.looseRecord(k,y))}let h=[];if(Object.keys(n).length>0&&h.push(Y.object(n).passthrough()),h.push(...p),h.length===0)o=Y.object({}).passthrough();else if(h.length===1)o=h[0];else{let f=Y.intersection(h[0],h[1]);for(let y=2;y<h.length;y++)f=Y.intersection(f,h[y]);o=f}break}let s=Y.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Ke(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(l=>Ke(l,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Ke(i,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(l=>Ke(l,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Ke(e.additionalItems,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(i!==void 0){let a=Ke(i,t),s=Y.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=Y.array(Y.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Ke(e,t){if(typeof e=="boolean")return e?Y.any():Y.never();let r=N_(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(d=>Ke(d,t)),l=Y.union(s);r=o?Y.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(d=>Ke(d,t)),l=Y.xor(s);r=o?Y.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:Y.any();else{let s=o?r:Ke(e.allOf[0],t),l=o?0:1;for(let d=l;d<e.allOf.length;d++)s=Y.intersection(s,Ke(e.allOf[d],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=Y.nullable(r)),e.readOnly===!0&&(r=Y.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))lC.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function R_(e,t){if(typeof e=="boolean")return e?Y.any():Y.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=dC(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ue};return Ke(r,i)}var Y,lC,L_=v(()=>{Wo();ms();Yo();Jo();Y={...qo,...hs,iso:Dr},lC=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Nm={};Ot(Nm,{bigint:()=>fC,boolean:()=>mC,date:()=>gC,number:()=>hC,string:()=>pC});function pC(e){return ep(Ur,e)}function hC(e){return cp(Fr,e)}function mC(e){return fp(Gr,e)}function fC(e){return yp(Br,e)}function gC(e){return Ap(oi,e)}var D_=v(()=>{mt();Jo()});var c={};Ot(c,{$brand:()=>kl,$input:()=>Xu,$output:()=>Ju,NEVER:()=>_l,TimePrecision:()=>np,ZodAny:()=>Zh,ZodArray:()=>Jh,ZodBase64:()=>Rs,ZodBase64URL:()=>Ls,ZodBigInt:()=>Br,ZodBigIntFormat:()=>Ms,ZodBoolean:()=>Gr,ZodCIDRv4:()=>Os,ZodCIDRv6:()=>Ns,ZodCUID:()=>Es,ZodCUID2:()=>$s,ZodCatch:()=>bm,ZodCodec:()=>li,ZodCustom:()=>di,ZodCustomStringFormat:()=>zr,ZodDate:()=>oi,ZodDefault:()=>hm,ZodDiscriminatedUnion:()=>Qh,ZodE164:()=>Ds,ZodEmail:()=>ks,ZodEmoji:()=>xs,ZodEnum:()=>Mr,ZodError:()=>oC,ZodExactOptional:()=>dm,ZodFile:()=>cm,ZodFirstPartyTypeKind:()=>Om,ZodFunction:()=>Im,ZodGUID:()=>Qo,ZodIPv4:()=>Cs,ZodIPv6:()=>Ps,ZodISODate:()=>gs,ZodISODateTime:()=>fs,ZodISODuration:()=>vs,ZodISOTime:()=>ys,ZodIntersection:()=>em,ZodIssueCode:()=>aC,ZodJWT:()=>js,ZodKSUID:()=>Is,ZodLazy:()=>$m,ZodLiteral:()=>sm,ZodMAC:()=>zh,ZodMap:()=>im,ZodNaN:()=>_m,ZodNanoID:()=>Ss,ZodNever:()=>Yh,ZodNonOptional:()=>Ws,ZodNull:()=>Kh,ZodNullable:()=>pm,ZodNumber:()=>Fr,ZodNumberFormat:()=>qn,ZodObject:()=>ai,ZodOptional:()=>Bs,ZodPipe:()=>ci,ZodPrefault:()=>fm,ZodPreprocess:()=>km,ZodPromise:()=>Am,ZodReadonly:()=>xm,ZodRealError:()=>st,ZodRecord:()=>jr,ZodSet:()=>am,ZodString:()=>Ur,ZodStringFormat:()=>be,ZodSuccess:()=>vm,ZodSymbol:()=>Bh,ZodTemplateLiteral:()=>Em,ZodTransform:()=>lm,ZodTuple:()=>nm,ZodType:()=>le,ZodULID:()=>Ts,ZodURL:()=>ri,ZodUUID:()=>jt,ZodUndefined:()=>Wh,ZodUnion:()=>si,ZodUnknown:()=>Vh,ZodVoid:()=>qh,ZodXID:()=>As,ZodXor:()=>Xh,_ZodString:()=>_s,_default:()=>mm,_function:()=>x_,any:()=>e_,array:()=>ii,base64:()=>jw,base64url:()=>Mw,bigint:()=>Yw,boolean:()=>Gh,catch:()=>wm,check:()=>S_,cidrv4:()=>Lw,cidrv6:()=>Dw,clone:()=>Xe,codec:()=>b_,coerce:()=>Nm,config:()=>Ae,core:()=>Xt,cuid:()=>Tw,cuid2:()=>Aw,custom:()=>E_,date:()=>n_,decode:()=>Oh,decodeAsync:()=>Rh,describe:()=>$_,discriminatedUnion:()=>c_,e164:()=>Uw,email:()=>yw,emoji:()=>Ew,encode:()=>Ph,encodeAsync:()=>Nh,endsWith:()=>Tr,enum:()=>Fs,exactOptional:()=>um,file:()=>f_,flattenError:()=>Ro,float32:()=>Kw,float64:()=>Hw,formatError:()=>Lo,fromJSONSchema:()=>R_,function:()=>x_,getErrorMap:()=>cC,globalRegistry:()=>Ue,gt:()=>Lt,gte:()=>et,guid:()=>vw,hash:()=>Ww,hex:()=>Bw,hostname:()=>Gw,httpUrl:()=>Sw,includes:()=>Er,instanceof:()=>A_,int:()=>bs,int32:()=>Zw,int64:()=>qw,intersection:()=>tm,invertCodec:()=>w_,ipv4:()=>Ow,ipv6:()=>Rw,iso:()=>Dr,json:()=>C_,jwt:()=>zw,keyof:()=>r_,ksuid:()=>Pw,lazy:()=>Tm,length:()=>Vn,literal:()=>m_,locales:()=>Bo,looseObject:()=>a_,looseRecord:()=>d_,lowercase:()=>xr,lt:()=>Rt,lte:()=>ht,mac:()=>Nw,map:()=>u_,maxLength:()=>Zn,maxSize:()=>bn,meta:()=>T_,mime:()=>Ar,minLength:()=>Jt,minSize:()=>Dt,multipleOf:()=>vn,nan:()=>v_,nanoid:()=>$w,nativeEnum:()=>h_,negative:()=>os,never:()=>Us,nonnegative:()=>as,nonoptional:()=>ym,nonpositive:()=>is,normalize:()=>Ir,null:()=>Hh,nullable:()=>ti,nullish:()=>g_,number:()=>Fh,object:()=>o_,optional:()=>ei,overwrite:()=>$t,parse:()=>Th,parseAsync:()=>Ah,partialRecord:()=>l_,pipe:()=>ws,positive:()=>rs,prefault:()=>gm,preprocess:()=>P_,prettifyError:()=>Ll,promise:()=>k_,property:()=>ss,readonly:()=>Sm,record:()=>om,refine:()=>Cm,regex:()=>kr,regexes:()=>pt,registry:()=>Da,safeDecode:()=>Dh,safeDecodeAsync:()=>Mh,safeEncode:()=>Lh,safeEncodeAsync:()=>jh,safeParse:()=>Ih,safeParseAsync:()=>Ch,set:()=>p_,setErrorMap:()=>sC,size:()=>Hn,slugify:()=>Nr,startsWith:()=>$r,strictObject:()=>i_,string:()=>Xo,stringFormat:()=>Fw,stringbool:()=>I_,success:()=>y_,superRefine:()=>Pm,symbol:()=>Xw,templateLiteral:()=>__,toJSONSchema:()=>us,toLowerCase:()=>Pr,toUpperCase:()=>Or,transform:()=>Gs,treeifyError:()=>Rl,trim:()=>Cr,tuple:()=>rm,uint32:()=>Vw,uint64:()=>Jw,ulid:()=>Iw,undefined:()=>Qw,union:()=>zs,unknown:()=>Yn,uppercase:()=>Sr,url:()=>xw,util:()=>B,uuid:()=>bw,uuidv4:()=>ww,uuidv6:()=>_w,uuidv7:()=>kw,void:()=>t_,xid:()=>Cw,xor:()=>s_});var Rm=v(()=>{mt();Jo();ms();$h();Uh();O_();mt();Zu();mt();Vo();L_();qu();Yo();Yo();D_();Ae(Oa())});var He=v(()=>{Rm();Rm()});function j_(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(vC.has(t)||yC.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return j_(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function M_(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(j_(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var yC,vC,Lm=v(()=>{"use strict";yC=[".localhost",".local",".internal",".test",".localdomain"],vC=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var ui,pi=v(()=>{"use strict";He();ui=c.object({date:c.string(),plays:c.number(),players:c.number().nullable()})});var hi,Ks=v(()=>{"use strict";He();hi=c.discriminatedUnion("source",[c.object({source:c.literal("manifest")}),c.object({source:c.literal("studio"),element_id:c.string().min(1),edition_id:c.string().min(1)})])});var xn,Dm,mi,nt,Mt,Wr,Kr=v(()=>{"use strict";xn="penalty_v1",Dm=["easy_v1","balanced_v1","hard_v1"],mi="balanced_v1",nt={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},Mt={postX:1e3,barY:1e3,postWidth:60,barHeight:60,ballRadius:40,keeperStart:{x:0,y:420}},Wr="shoot"});function G_(e){return e.questions?e.questions:[{id:"1",kind:"choice",prompt:e.prompt,options:e.options??[],result:e.result,points:void 0,min:void 0,max:void 0,step:void 0,tolerance:void 0}]}function Hs(e,t,r){if(e.result===void 0)return 0;let n=(e.kind==="choice"?(e.options??[]).find(i=>i.key===e.result):void 0)?.points??e.points??r;if(e.kind==="number"){if(typeof t!="number"||typeof e.result!="number")return 0;let i=Math.abs(t-e.result);return i===0?n:e.tolerance===void 0||i>=e.tolerance?0:Math.round(n*(1-i/e.tolerance))}return t===e.result?n:0}function Qt(e){return`round-${e.number}`}var Jn,jm,bC,wC,_C,kC,U_,xC,Mm,z_,SC,F_,EC,Zs,$C,TC,AC,IC,CC,Ze,jU,MU,UU,Ut=v(()=>{"use strict";He();Yt();pi();Ks();Kr();Jn={scoreOrder:c.enum(["high_first","low_first"]).optional().describe("Which score wins: high_first for most points, low_first for a fastest time, fewest attempts or closest to a target. Absent means high_first.")},jm=c.object({archetype:c.literal("hunt"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(2),targets:c.array(c.string().min(1)).min(1),required:c.number().int().positive().optional(),pointsPerTarget:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),bC=c.object({key:c.string().min(1),label:c.string().min(1),value:c.number().int().nonnegative()}),wC=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(bC).min(1)}),_C=c.object({within:c.number().min(0).max(1),label:c.string().min(1)}),kC=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],U_=c.object({archetype:c.literal("push"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),target:c.number().int().positive(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),theme:c.string().default(""),slates:c.array(wC).min(1),line:c.array(c.object({slate:c.string(),key:c.string()})).optional(),tiers:c.array(_C).default(kC),floorLabel:c.string().default("Rookie"),bustLabel:c.string().default("Busted"),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{if(e.line)if(e.line.length!==e.slates.length)t.addIssue({code:"custom",path:["line"],message:`The line has ${e.line.length} pick(s) for ${e.slates.length} slate(s). A perfect line is one pick per slate.`});else{let s=0,l=!1;for(let d of e.line){let h=e.slates.find(f=>f.id===d.slate)?.entries.find(f=>f.key===d.key);if(!h){l=!0,t.addIssue({code:"custom",path:["line"],message:`The line names "${d.key}" on slate "${d.slate}", which the round does not hold.`});break}s+=h.value}!l&&s!==e.target&&t.addIssue({code:"custom",path:["line"],message:`The line sums to ${s}, not the target ${e.target}. A perfect line lands exactly.`})}let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(l=>l.key)),n=[...new Set(o.filter((s,l)=>o.indexOf(s)!==l))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,l)=>s+Math.min(...l.entries.map(d=>d.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,l)=>l===0||s.within>e.tiers[l-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),xC=c.object({key:c.string().min(1),label:c.string().min(1),members:c.array(c.string().min(1)).min(2)}),Mm=c.object({archetype:c.literal("group"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(4),groups:c.array(xC).min(2),pointsPerGroup:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let l=r.get(s);l&&l!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${l} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),z_=c.object({key:c.string().min(1),label:c.string().min(1),points:c.number().int().nonnegative().optional()}),SC=c.object({id:c.string().min(1),kind:c.enum(["choice","number"]).default("choice"),prompt:c.string().default(""),options:c.array(z_).optional(),min:c.number().optional(),max:c.number().optional(),step:c.number().positive().optional(),result:c.union([c.string().min(1),c.number()]).optional(),points:c.number().int().nonnegative().optional(),tolerance:c.number().positive().optional()}).superRefine((e,t)=>{if(e.kind==="choice"){if(!e.options||e.options.length<2){t.addIssue({code:"custom",path:["options"],message:"A choice needs at least two options, or there is nothing to predict."});return}new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),typeof e.result=="string"&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),typeof e.result=="number"&&t.addIssue({code:"custom",path:["result"],message:"A choice settles to one of its option keys, not to a number."});return}e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A number question has no options: a fan gives a value."}),e.min===void 0||e.max===void 0?t.addIssue({code:"custom",path:["min"],message:"A number needs a min and a max, or a fan is given a control with no ends."}):e.max<=e.min&&t.addIssue({code:"custom",path:["max"],message:"The maximum has to be above the minimum."}),typeof e.result=="string"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),F_=c.object({archetype:c.literal("predict"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),options:c.array(z_).min(2).optional(),questions:c.array(SC).min(1).optional(),result:c.string().min(1).optional(),pointsForCorrect:c.number().int().nonnegative().default(10),attemptsAllowed:c.number().int().positive().default(1),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.options!==void 0,o=e.questions!==void 0;if(r&&o&&t.addIssue({code:"custom",path:["questions"],message:"A round declares options or questions, not both. Two homes for one question is how they drift apart."}),!r&&!o&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),o&&e.questions){let n=e.questions.map(i=>i.id);new Set(n).size!==n.length&&t.addIssue({code:"custom",path:["questions"],message:"Two questions share an id. A play names the question it answered."})}e.options&&new Set(e.options.map(n=>n.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&e.options!==void 0&&!e.options.some(n=>n.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})});EC=c.object({archetype:c.literal("bingo"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),rows:c.number().int().min(2),columns:c.number().int().min(2),centreMode:c.enum(["none","free","choice"]).default("none"),centreOptions:c.array(c.string().min(1)).optional(),allowCentreDuplicate:c.boolean().default(!1),lineTypes:c.array(c.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:c.array(c.object({key:c.string().min(1),label:c.string().min(1),note:c.string().optional(),result:c.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:c.number().int().nonnegative().default(10),pointsForFullBoard:c.number().int().nonnegative().default(0),shuffleAllowance:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),locksAt:c.string().optional()}).superRefine((e,t)=>{let r=e.cardPool.map(n=>n.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let o=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<o&&t.addIssue({code:"custom",path:["cardPool"],message:`The pool has ${e.cardPool.length} card${e.cardPool.length===1?"":"s"}, and a ${e.rows}x${e.columns} board needs ${o}. Add more cards or shrink the board.`}),e.centreMode==="choice")if(!e.centreOptions||e.centreOptions.length===0)t.addIssue({code:"custom",path:["centreOptions"],message:"The centre is a player's choice, so at least one option is required."});else{let n=e.centreOptions.filter(i=>!r.includes(i));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),Zs=c.object({archetype:c.literal("shoot"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),model:c.literal(xn).default(xn),difficulty:c.enum(Dm).default(mi),shotsAllowed:c.number().int().min(1).max(20).default(5),goalsToWin:c.number().int().min(1).default(3),pointsPerGoal:c.number().int().nonnegative().default(100),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{e.goalsToWin>e.shotsAllowed&&t.addIssue({code:"custom",path:["goalsToWin"],message:`Asks for ${e.goalsToWin} goals from ${e.shotsAllowed} shots, which cannot be reached.`})}),$C=c.object({key:c.string().min(1),label:c.string().min(1),art:c.string().optional()}),TC=c.object({key:c.string().min(1),name:c.string().min(1),image:c.string().optional()}),AC=c.object({item:c.string().min(1),cells:c.array(c.string().min(1))}),IC=c.object({archetype:c.literal("place"),...Jn,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array($C).min(1),deck:c.array(TC).min(1),qualifies:c.array(AC).default([]),pointsPerPlacement:c.number().int().nonnegative().default(1),fullHouseBonus:c.number().int().nonnegative().default(0),mistakesAllowed:c.number().int().positive().default(4),skipsAllowed:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Set;for(let s of e.board)r.has(s.key)&&t.addIssue({code:"custom",path:["board"],message:`Two cells share the key ${s.key}. Each one needs its own.`}),r.add(s.key);let o=new Set;for(let s of e.deck)o.has(s.key)&&t.addIssue({code:"custom",path:["deck"],message:`Two cards share the key ${s.key}. Each one needs its own.`}),o.add(s.key);let n=new Set,i=new Set;for(let s of e.qualifies){o.has(s.item)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is not a card in the deck.`}),n.has(s.item)&&t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is listed twice. Give each card one row.`}),n.add(s.item);for(let l of s.cells)r.has(l)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} qualifies for ${l}, which is not on the board.`}),i.add(l)}let a=e.board.filter(s=>!i.has(s.key)).map(s=>s.key);a.length&&t.addIssue({code:"custom",path:["board"],message:`No card can fill: ${a.join(", ")}. Every cell needs at least one qualifying card.`}),e.deck.length<e.board.length&&t.addIssue({code:"custom",path:["deck"],message:`${e.deck.length} cards cannot fill ${e.board.length} cells.`})}),CC=c.discriminatedUnion("archetype",[jm,U_,Mm,F_,EC,Zs,IC]),Ze=c.preprocess(Dy,CC);jU=c.object({action:c.literal("settle"),game:c.string().min(1),roundId:c.string().min(1),result:c.string().min(1)}),MU=c.object({game:c.string().min(1),round:Ze,origin:hi.optional(),snapshot:c.string().default(""),source:c.string().optional(),roundId:c.string().min(1).optional(),selection:c.object({mode:c.literal("rotation"),windowSeconds:c.number().int().positive(),rounds:c.array(c.object({id:c.string().min(1),round:Ze,origin:hi.optional()})).min(1)}).optional()}),UU=c.object({roundId:c.string(),version:c.number().int().nonnegative(),changed:c.boolean(),current:c.boolean(),activity:c.array(ui).optional(),monthlyPlayers:c.number().int().nonnegative().optional()})});function LC(e){return H_.includes(e)}function DC(e){return V_.includes(We(e))}function Y_(e){let t=[],r=e.backend.archetype;r&&DC(r)&&t.push({path:"backend.archetype",message:`\`${r}\` is a classification, not a format the Engine marks. The formats it marks are ${Nt.join(", ")}. Name one of those, or say what your game does and ask us: a mechanic no format fits is a format we have not built, not a setting you are missing.`});let o=e.backend.route;o&&LC(o)&&t.push({path:"backend.route",message:`\`${o}\` is a classification, not a route Gamestage implements. Set \`${Fm}\`: every game runs on our Engine, and there is no route that runs a game on an engine of your own.`}),e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let n=e.operations.promotion;if(n.offers_prize&&(n.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),n.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!n.skill_based&&!n.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let i of["issuer","jwks_uri"]){let a=e.identity.jwt[i],s=M_(a);s&&t.push({path:`identity.jwt.${i}`,message:s==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":s==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var fi,Um,zm,Hr,B_,gi,Sn,En,W_,PC,zt,OC,NC,RC,K_,Fm,H_,Z_,$n,V_,jC,MC,UC,zC,FC,GC,BC,WC,Gm,KC,HC,ZC,VC,Tn,Zr,en=v(()=>{"use strict";He();Lm();$o();Yt();Ut();fi="1.0",Um=c.enum(["missing","proposed","confirmed","verified","approved"]),zm={missing:0,proposed:1,confirmed:2,verified:3,approved:4},Hr=c.enum(["runtime","live","enterprise"]),B_="Accounts must be approved before the first deploy.",gi={runtime:"Starter",live:"Publisher",enterprise:"Enterprise"},Sn=c.enum(["L0","L1","L2","L3","L4","L5"]),En={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},W_={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},PC=c.discriminatedUnion("kind",[c.object({kind:c.literal("human_decision"),owner:c.string(),date:c.string(),note:c.string().optional()}),c.object({kind:c.literal("generated_proposal"),tool:c.string(),model:c.string().optional(),source_context:c.string().optional()}),c.object({kind:c.literal("repository_evidence"),file:c.string(),commit:c.string().optional(),package:c.string().optional()}),c.object({kind:c.literal("platform_evidence"),system:c.string(),id:c.string()}),c.object({kind:c.literal("external_evidence"),supplier:c.string(),licence:c.string().optional(),dataset_version:c.string().optional()})]),zt={status:Um.default("missing"),provenance:c.array(PC).default([])},OC=c.object({schema_version:c.string(),revision:c.number().int().nonnegative().default(0),conformance:Sn.default("L0")}),NC=c.object({repository:c.string().url(),branch:c.string().default("main")}),RC=c.object({id:c.string().min(1),title:c.string().min(1),summary:c.string().optional(),source:NC.optional(),owners:c.object({ip:c.string().optional(),delivery:c.string().optional(),platform:c.string().optional()}).prefault({}),...zt}),K_=c.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Fm="managed_runtime",H_=K_.options.filter(e=>e!==Fm);Z_=c.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot","place"]),$n=c.preprocess(e=>typeof e=="string"?We(e):e,Z_),V_=Z_.options.filter(e=>!Nt.includes(e));jC=c.object({route:K_.optional().describe(`Only ${Fm} is a route Gamestage implements: every game runs on our Engine. ${H_.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:$n.optional().describe(`The formats the Engine marks are ${Nt.join(", ")}. ${V_.join(", ")} are classifications that inspect uses to describe a game it found; nothing marks them, and a manifest naming one is refused.`),component:c.string().optional(),version:c.string().optional(),variant:c.string().optional(),configuration:c.record(c.string(),c.unknown()).default({}),round:Ze.optional(),...zt}),MC=c.object({surfaces:c.array(c.string()).default([]),container_label:c.string().min(1).default(pr),screen_graph:c.string().optional(),design:c.object({figma_file:c.string().optional(),figma_version:c.string().optional(),tokens:c.string().optional(),fidelity:Sn.optional()}).optional(),...zt}),UC=c.object({spec_url:c.string().optional(),version:c.string().optional(),...zt}),zC=c.object({family:c.string().optional(),version:c.string().optional(),configuration_schema:c.string().optional(),...zt}),FC=c.object({project_template:c.string().optional(),project_id:c.string().optional(),events:c.array(c.string()).default([]),elements:c.array(c.string()).default([]),...zt}),GC=c.object({required:c.boolean().default(!1),minimum_age:c.number().int().positive().max(120).optional(),method:c.enum(["self_declared","verified"]).default("self_declared"),verifier:c.string().optional()}),BC=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),WC=c.object({provider:c.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:BC.optional(),require_authenticated_writes:c.boolean().default(!0),age_gate:GC.prefault({}),consent:c.object({analytics_requires_consent:c.boolean().default(!0),provider:c.string().optional()}).prefault({}),...zt}),Gm=c.object({type:c.enum(["monterosa","posthog","ga4","webhook"]),enabled:c.boolean().default(!0),config:c.record(c.string(),c.string()).default({})}),KC=c.object({destinations:c.array(Gm).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:c.array(c.string()).default([]),signal:c.object({enabled:c.boolean().default(!1),application_id:c.string().optional(),write_key:c.string().optional(),monterosa:c.object({enabled:c.boolean().default(!1),organisation_id:c.string().optional(),project_id:c.string().optional()}).prefault({})}).prefault({}),...zt}),HC=c.object({hosting:c.string().optional(),space_spec:c.string().optional(),environments:c.array(c.enum(["local","playground","staging","production"])).default(["local"]),...zt}),ZC=c.object({offers_prize:c.boolean().default(!1),free_entry_route:c.string().optional(),skill_based:c.boolean().default(!1),terms_url:c.string().optional(),jurisdictions:c.array(c.string()).default([])}),VC=c.object({support_tier:Hr.optional(),runbook:c.string().optional(),promotion:ZC.prefault({}),...zt}),Tn=c.object({manifest:OC,app:RC,experience:MC.prefault({}),studio_app:UC.prefault({}),studio_surface:zC.prefault({}),backend:jC.prefault({}),interaction_cloud:FC.prefault({}),identity:WC.prefault({}),measurement:KC.prefault({}),deployment:HC.prefault({}),operations:VC.prefault({})});Zr=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function ct(e,t={}){let r=f=>({id:f.id,level:f.level,requirement:f.requirement,advice:f.advice,owner:f.owner,passed:f.check(e,t)}),o=Bm.filter(f=>f.checkable).map(r),n=Bm.filter(f=>!f.checkable).map(r),i="L0",a=!0;for(let f of Wm){let y=o.filter(D=>D.level===f);y.length>0&&y.every(D=>D.passed)&&a?i=f:a=!1}let s=o.filter(f=>f.level==="L0").every(f=>f.passed),l=En[i]+1,d=Wm[l],p=d?o.filter(f=>f.level===d&&!f.passed):[],h=e.manifest.conformance;return{computed:i,computedName:W_[i],claimed:h,overclaimed:!s||Math.min(En[h],En[q_])>En[i],results:o,blockers:s?p:o.filter(f=>f.level==="L0"&&!f.passed),ceiling:q_,advice:n}}function J_(e,t){let o=ct(e).results.filter(n=>!n.passed&&En[n.level]<=En[t]);return{ok:o.length===0,missing:o}}var Xn,ze,Bm,Wm,YC,VU,q_,Vs=v(()=>{"use strict";en();Xn=(e,t,r)=>{let o=e[t];return zm[o?.status??"missing"]>=zm[r]},ze=e=>typeof e=="string"?e.trim().length>0:e!=null,Bm=[{level:"L0",id:"L0.app.identity",checkable:!0,advice:"Give the game a name, and a short id we can use in web addresses.",owner:"creator",requirement:"app.id and app.title are set",check:e=>ze(e.app.id)&&ze(e.app.title)},{level:"L0",id:"L0.app.status",checkable:!0,advice:"Mark the game as started.",owner:"creator",requirement:"app section is at least proposed",check:e=>Xn(e,"app","proposed")},{level:"L0",id:"L0.schema.version",checkable:!0,advice:"The version of the format this game is described in. Set when the game was created.",owner:"creator",requirement:"manifest.schema_version is set",check:e=>ze(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",checkable:!0,advice:"Describe the screens in the game.",owner:"creator",requirement:"experience declares a screen graph or at least one player surface",check:e=>ze(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",checkable:!0,advice:"Mark the design as started.",owner:"creator",requirement:"experience section is at least proposed",check:e=>Xn(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",checkable:!0,advice:"Choose which engine runs the game: one we manage, or one you bring.",owner:"creator",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>ze(e.backend.route)},{level:"L2",id:"L2.backend.pinned",checkable:!0,advice:"Deploy the game. We record which engine answered.",owner:"creator",requirement:"a component is serving this game's rounds",check:(e,t)=>ze(t.backendComponent)||ze(e.backend.component)&&ze(e.backend.version)},{level:"L2",id:"L2.identity.policy",checkable:!0,advice:"Say how a fan signs in. If they don't sign in, say that. Gamestage does not provide sign-in, so this names the one a fan meets.",owner:"creator",requirement:"an identity provider is named",check:e=>ze(e.identity.provider)},{level:"L2",id:"L2.measurement.destination",checkable:!0,advice:"Switch on somewhere to send the data, on this game's Integrations tab. This checks the switch is on. Whether events are arriving is a separate question.",owner:"creator",requirement:"an analytics destination is switched on",check:(e,t)=>t.destinationsEnabled===!0||e.measurement.destinations.some(r=>r.enabled)},{level:"L2",id:"L2.platform.identifiers",checkable:!0,advice:"Deploy the game. That puts it on Monterosa's platform and gives you a place to manage content.",owner:"creator",requirement:"the game exists on Interaction Cloud",check:(e,t)=>ze(t.platformProject)||ze(e.studio_app.spec_url)||ze(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",checkable:!0,advice:"Deploy the game with a URL.",owner:"creator",requirement:"the game is deployed somewhere a fan can reach",check:(e,t)=>ze(t.playgroundUrl)||ze(e.deployment.space_spec)&&e.deployment.environments.some(r=>r!=="local")},{level:"L3",id:"L3.surface.declared",checkable:!1,advice:"Say what the person running your game can change: rounds, wording, or both.",owner:"creator",requirement:"a Studio Surface family is declared for operator control",check:e=>ze(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",checkable:!1,advice:"Mark which parts you have finished: the play, the scoring, and the hosting.",owner:"creator",requirement:"experience, backend and deployment are all confirmed or better",check:e=>Xn(e,"experience","confirmed")&&Xn(e,"backend","confirmed")&&Xn(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",checkable:!1,advice:"Link proof it works: a play-through recording, or a test result.",owner:"creator",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>Xn(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",checkable:!1,advice:"Name who to call when it breaks, and link the instructions they follow.",owner:"creator",requirement:"operations declares a support tier and a runbook",check:e=>ze(e.operations.support_tier)&&ze(e.operations.runbook)},{level:"L5",id:"L5.production.approved",checkable:!1,advice:"Approve the game for prod, and move your workspace onto a paid plan. Monterosa does the second part.",owner:"monterosa",requirement:"the manifest is approved and deployed to a production environment",check:e=>Xn(e,"operations","approved")&&e.deployment.environments.includes("production")}],Wm=["L0","L1","L2","L3","L4","L5"],YC=[{level:"L0",name:"Concept",means:"the game has a name and a description we hold for it"},{level:"L1",name:"Experience built",means:"there is something to play, and scoring runs on our server rather than in the browser"},{level:"L2",name:"Wired to the platform",means:"it is set up on the Monterosa platform, knows who each player is, and sends its numbers to your analytics"},{level:"L3",name:"Fans can reach it",means:"it is deployed at an address a fan can open"},{level:"L4",name:"Production ready",means:"checked with evidence, with someone to call and a page saying what to do if it breaks"},{level:"L5",name:"Operating live",means:"reviewed with you, and running in production"}],VU=new Map(YC.map(e=>[e.level,e])),q_=[...Wm].reverse().find(e=>Bm.some(t=>t.level===e&&t.checkable))??"L0"});function qC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yi(){if(X_)return An;X_=1;function e(a){return typeof a>"u"||a===null}function t(a){return typeof a=="object"&&a!==null}function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}function o(a,s){if(s){let l=Object.keys(s);for(let d=0,p=l.length;d<p;d+=1){let h=l[d];a[h]=s[h]}}return a}function n(a,s){let l="";for(let d=0;d<s;d+=1)l+=a;return l}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return An.isNothing=e,An.isObject=t,An.toArray=r,An.repeat=n,An.isNegativeZero=i,An.extend=o,An}function vi(){if(Q_)return Km;Q_=1;function e(r,o){let n="",i=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(n+='in "'+r.mark.name+'" '),n+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!o&&r.mark.snippet&&(n+=`
78
78
 
79
- `+r.mark.snippet),i+" "+n):i}function t(r,o){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=o,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(o){return this.name+": "+e(this,o)},Km=t,Km}function HC(){if(ek)return Hm;ek=1;let e=yi();function t(n,i,a,s,l){let d="",p="",h=Math.floor(l/2)-1;return s-i>h&&(d=" ... ",i=s-h+d.length),a-s>h&&(p=" ...",a=s+h-p.length),{str:d+n.slice(i,a).replace(/\t/g,"\u2192")+p,pos:s-i+d.length}}function r(n,i){return e.repeat(" ",i-n.length)+n}function o(n,i){if(i=Object.create(i||null),!n.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!="number"&&(i.indent=1),typeof i.linesBefore!="number"&&(i.linesBefore=3),typeof i.linesAfter!="number"&&(i.linesAfter=2);let a=/\r?\n|\r|\0/g,s=[0],l=[],d,p=-1;for(;d=a.exec(n.buffer);)l.push(d.index),s.push(d.index+d[0].length),n.position<=d.index&&p<0&&(p=s.length-2);p<0&&(p=s.length-1);let h="",f=Math.min(n.line+i.linesAfter,l.length).toString().length,y=i.maxLength-(i.indent+f+3);for(let D=1;D<=i.linesBefore&&!(p-D<0);D++){let b=t(n.buffer,s[p-D],l[p-D],n.position-(s[p]-s[p-D]),y);h=e.repeat(" ",i.indent)+r((n.line-D+1).toString(),f)+" | "+b.str+`
79
+ `+r.mark.snippet),i+" "+n):i}function t(r,o){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=o,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(o){return this.name+": "+e(this,o)},Km=t,Km}function JC(){if(ek)return Hm;ek=1;let e=yi();function t(n,i,a,s,l){let d="",p="",h=Math.floor(l/2)-1;return s-i>h&&(d=" ... ",i=s-h+d.length),a-s>h&&(p=" ...",a=s+h-p.length),{str:d+n.slice(i,a).replace(/\t/g,"\u2192")+p,pos:s-i+d.length}}function r(n,i){return e.repeat(" ",i-n.length)+n}function o(n,i){if(i=Object.create(i||null),!n.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!="number"&&(i.indent=1),typeof i.linesBefore!="number"&&(i.linesBefore=3),typeof i.linesAfter!="number"&&(i.linesAfter=2);let a=/\r?\n|\r|\0/g,s=[0],l=[],d,p=-1;for(;d=a.exec(n.buffer);)l.push(d.index),s.push(d.index+d[0].length),n.position<=d.index&&p<0&&(p=s.length-2);p<0&&(p=s.length-1);let h="",f=Math.min(n.line+i.linesAfter,l.length).toString().length,y=i.maxLength-(i.indent+f+3);for(let D=1;D<=i.linesBefore&&!(p-D<0);D++){let b=t(n.buffer,s[p-D],l[p-D],n.position-(s[p]-s[p-D]),y);h=e.repeat(" ",i.indent)+r((n.line-D+1).toString(),f)+" | "+b.str+`
80
80
  `+h}let k=t(n.buffer,s[p],l[p],n.position,y);h+=e.repeat(" ",i.indent)+r((n.line+1).toString(),f)+" | "+k.str+`
81
81
  `,h+=e.repeat("-",i.indent+f+3+k.pos)+`^
82
82
  `;for(let D=1;D<=i.linesAfter&&!(p+D>=l.length);D++){let b=t(n.buffer,s[p+D],l[p+D],n.position-(s[p]-s[p+D]),y);h+=e.repeat(" ",i.indent)+r((n.line+D+1).toString(),f)+" | "+b.str+`
83
83
  `}return h.replace(/\n$/,"")}return Hm=o,Hm}function rt(){if(tk)return Zm;tk=1;let e=vi(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function o(i){let a={};return i!==null&&Object.keys(i).forEach(function(s){i[s].forEach(function(l){a[String(l)]=s})}),a}function n(i,a){if(a=a||{},Object.keys(a).forEach(function(s){if(t.indexOf(s)===-1)throw new e('Unknown option "'+s+'" is met in definition of "'+i+'" YAML type.')}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(s){return s},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=o(a.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}return Zm=n,Zm}function xk(){if(nk)return Vm;nk=1;let e=vi(),t=rt();function r(i,a){let s=[];return i[a].forEach(function(l){let d=s.length;s.forEach(function(p,h){p.tag===l.tag&&p.kind===l.kind&&p.multi===l.multi&&(d=h)}),s[d]=l}),s}function o(){let i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(s){s.multi?(i.multi[s.kind].push(s),i.multi.fallback.push(s)):i[s.kind][s.tag]=i.fallback[s.tag]=s}for(let s=0,l=arguments.length;s<l;s+=1)arguments[s].forEach(a);return i}function n(i){return this.extend(i)}return n.prototype.extend=function(a){let s=[],l=[];if(a instanceof t)l.push(a);else if(Array.isArray(a))l=l.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(s=s.concat(a.implicit)),a.explicit&&(l=l.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");s.forEach(function(p){if(!(p instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(p.loadKind&&p.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(p.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(p){if(!(p instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let d=Object.create(n.prototype);return d.implicit=(this.implicit||[]).concat(s),d.explicit=(this.explicit||[]).concat(l),d.compiledImplicit=r(d,"implicit"),d.compiledExplicit=r(d,"explicit"),d.compiledTypeMap=o(d.compiledImplicit,d.compiledExplicit),d},Vm=n,Vm}function Sk(){if(rk)return Ym;rk=1;let e=rt();return Ym=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),Ym}function Ek(){if(ok)return qm;ok=1;let e=rt();return qm=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),qm}function $k(){if(ik)return Jm;ik=1;let e=rt();return Jm=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Jm}function Tk(){if(ak)return Xm;ak=1;let e=xk();return Xm=new e({explicit:[Sk(),Ek(),$k()]}),Xm}function Ak(){if(sk)return Qm;sk=1;let e=rt();function t(n){if(n===null)return!0;let i=n.length;return i===1&&n==="~"||i===4&&(n==="null"||n==="Null"||n==="NULL")}function r(){return null}function o(n){return n===null}return Qm=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Qm}function Ik(){if(ck)return ef;ck=1;let e=rt();function t(n){if(n===null)return!1;let i=n.length;return i===4&&(n==="true"||n==="True"||n==="TRUE")||i===5&&(n==="false"||n==="False"||n==="FALSE")}function r(n){return n==="true"||n==="True"||n==="TRUE"}function o(n){return Object.prototype.toString.call(n)==="[object Boolean]"}return ef=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:o,represent:{lowercase:function(n){return n?"true":"false"},uppercase:function(n){return n?"TRUE":"FALSE"},camelcase:function(n){return n?"True":"False"}},defaultStyle:"lowercase"}),ef}function Ck(){if(lk)return tf;lk=1;let e=yi(),t=rt();function r(d){return d>=48&&d<=57||d>=65&&d<=70||d>=97&&d<=102}function o(d){return d>=48&&d<=55}function n(d){return d>=48&&d<=57}function i(d){if(d===null)return!1;let p=d.length,h=0,f=!1;if(!p)return!1;let y=d[h];if((y==="-"||y==="+")&&(y=d[++h]),y==="0"){if(h+1===p)return!0;if(y=d[++h],y==="b"){for(h++;h<p;h++){if(y=d[h],y!=="0"&&y!=="1")return!1;f=!0}return f&&isFinite(a(d))}if(y==="x"){for(h++;h<p;h++){if(!r(d.charCodeAt(h)))return!1;f=!0}return f&&isFinite(a(d))}if(y==="o"){for(h++;h<p;h++){if(!o(d.charCodeAt(h)))return!1;f=!0}return f&&isFinite(a(d))}}for(;h<p;h++){if(!n(d.charCodeAt(h)))return!1;f=!0}return f?isFinite(a(d)):!1}function a(d){let p=d,h=1,f=p[0];if((f==="-"||f==="+")&&(f==="-"&&(h=-1),p=p.slice(1),f=p[0]),p==="0")return 0;if(f==="0"){if(p[1]==="b")return h*parseInt(p.slice(2),2);if(p[1]==="x")return h*parseInt(p.slice(2),16);if(p[1]==="o")return h*parseInt(p.slice(2),8)}return h*parseInt(p,10)}function s(d){return a(d)}function l(d){return Object.prototype.toString.call(d)==="[object Number]"&&d%1===0&&!e.isNegativeZero(d)}return tf=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:i,construct:s,predicate:l,represent:{binary:function(d){return d>=0?"0b"+d.toString(2):"-0b"+d.toString(2).slice(1)},octal:function(d){return d>=0?"0o"+d.toString(8):"-0o"+d.toString(8).slice(1)},decimal:function(d){return d.toString(10)},hexadecimal:function(d){return d>=0?"0x"+d.toString(16).toUpperCase():"-0x"+d.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),tf}function Pk(){if(dk)return nf;dk=1;let e=yi(),t=rt(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function n(d){return d===null||!r.test(d)?!1:isFinite(parseFloat(d,10))?!0:o.test(d)}function i(d){let p=d.toLowerCase(),h=p[0]==="-"?-1:1;return"+-".indexOf(p[0])>=0&&(p=p.slice(1)),p===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:p===".nan"?NaN:h*parseFloat(p,10)}let a=/^[-+]?[0-9]+e/;function s(d,p){if(isNaN(d))switch(p){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===d)switch(p){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===d)switch(p){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(d))return"-0.0";let h=d.toString(10);return a.test(h)?h.replace("e",".e"):h}function l(d){return Object.prototype.toString.call(d)==="[object Number]"&&(d%1!==0||e.isNegativeZero(d))}return nf=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:l,represent:s,defaultStyle:"lowercase"}),nf}function Ok(){return uk||(uk=1,rf=Tk().extend({implicit:[Ak(),Ik(),Ck(),Pk()]})),rf}function Nk(){return pk||(pk=1,of=Ok()),of}function Rk(){if(hk)return af;hk=1;let e=rt(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function o(a){return a===null?!1:t.exec(a)!==null||r.exec(a)!==null}function n(a){let s=0,l=null,d=t.exec(a);if(d===null&&(d=r.exec(a)),d===null)throw new Error("Date resolve error");let p=+d[1],h=+d[2]-1,f=+d[3];if(!d[4])return new Date(Date.UTC(p,h,f));let y=+d[4],k=+d[5],D=+d[6];if(d[7]){for(s=d[7].slice(0,3);s.length<3;)s+="0";s=+s}if(d[9]){let $=+d[10],S=+(d[11]||0);l=($*60+S)*6e4,d[9]==="-"&&(l=-l)}let b=new Date(Date.UTC(p,h,f,y,k,D,s));return l&&b.setTime(b.getTime()-l),b}function i(a){return a.toISOString()}return af=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:o,construct:n,instanceOf:Date,represent:i}),af}function Lk(){if(mk)return sf;mk=1;let e=rt();function t(r){return r==="<<"||r===null}return sf=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),sf}function Dk(){if(fk)return cf;fk=1;let e=rt(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
84
- \r`;function r(a){if(a===null)return!1;let s=0,l=a.length,d=t;for(let p=0;p<l;p++){let h=d.indexOf(a.charAt(p));if(!(h>64)){if(h<0)return!1;s+=6}}return s%8===0}function o(a){let s=a.replace(/[\r\n=]/g,""),l=s.length,d=t,p=0,h=[];for(let y=0;y<l;y++)y%4===0&&y&&(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)),p=p<<6|d.indexOf(s.charAt(y));let f=l%4*6;return f===0?(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)):f===18?(h.push(p>>10&255),h.push(p>>2&255)):f===12&&h.push(p>>4&255),new Uint8Array(h)}function n(a){let s="",l=0,d=a.length,p=t;for(let f=0;f<d;f++)f%3===0&&f&&(s+=p[l>>18&63],s+=p[l>>12&63],s+=p[l>>6&63],s+=p[l&63]),l=(l<<8)+a[f];let h=d%3;return h===0?(s+=p[l>>18&63],s+=p[l>>12&63],s+=p[l>>6&63],s+=p[l&63]):h===2?(s+=p[l>>10&63],s+=p[l>>4&63],s+=p[l<<2&63],s+=p[64]):h===1&&(s+=p[l>>2&63],s+=p[l<<4&63],s+=p[64],s+=p[64]),s}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return cf=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:o,predicate:i,represent:n}),cf}function jk(){if(gk)return lf;gk=1;let e=rt(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function o(i){if(i===null)return!0;let a={},s=i;for(let l=0,d=s.length;l<d;l+=1){let p=s[l],h=!1;if(r.call(p)!=="[object Object]")return!1;let f;for(f in p)if(t.call(p,f))if(!h)h=!0;else return!1;if(!h||t.call(a,f))return!1;Object.defineProperty(a,f,{value:!0})}return!0}function n(i){return i!==null?i:[]}return lf=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:n}),lf}function Mk(){if(yk)return df;yk=1;let e=rt(),t=Object.prototype.toString;function r(n){if(n===null)return!0;let i=n,a=new Array(i.length);for(let s=0,l=i.length;s<l;s+=1){let d=i[s];if(t.call(d)!=="[object Object]")return!1;let p=Object.keys(d);if(p.length!==1)return!1;a[s]=[p[0],d[p[0]]]}return!0}function o(n){if(n===null)return[];let i=n,a=new Array(i.length);for(let s=0,l=i.length;s<l;s+=1){let d=i[s],p=Object.keys(d);a[s]=[p[0],d[p[0]]]}return a}return df=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:o}),df}function Uk(){if(vk)return uf;vk=1;let e=rt(),t=Object.prototype.hasOwnProperty;function r(n){if(n===null)return!0;let i=n;for(let a in i)if(t.call(i,a)&&i[a]!==null)return!1;return!0}function o(n){return n!==null?n:{}}return uf=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:o}),uf}function mf(){return bk||(bk=1,pf=Nk().extend({implicit:[Rk(),Lk()],explicit:[Dk(),jk(),Mk(),Uk()]})),pf}function ZC(){if(wk)return Ys;wk=1;let e=yi(),t=vi(),r=HC(),o=mf(),n=Object.prototype.hasOwnProperty,i=1,a=2,s=3,l=4,d=1,p=2,h=3,f=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,k=/[,\[\]{}]/,D=/^(?:!|!!|![0-9A-Za-z-]+!)$/,b=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function $(u){return Object.prototype.toString.call(u)}function S(u){return u===10||u===13}function w(u){return u===9||u===32}function C(u){return u===9||u===32||u===10||u===13}function N(u){return u===44||u===91||u===93||u===123||u===125}function ee(u){if(u>=48&&u<=57)return u-48;let x=u|32;return x>=97&&x<=102?x-97+10:-1}function de(u){return u===120?2:u===117?4:u===85?8:0}function me(u){return u>=48&&u<=57?u-48:-1}function Ce(u){switch(u){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
85
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function Ct(u){return u<=65535?String.fromCharCode(u):String.fromCharCode((u-65536>>10)+55296,(u-65536&1023)+56320)}function he(u,x,L){x==="__proto__"?Object.defineProperty(u,x,{configurable:!0,enumerable:!0,writable:!0,value:L}):u[x]=L}let Ne=new Array(256),yt=new Array(256);for(let u=0;u<256;u++)Ne[u]=Ce(u)?1:0,yt[u]=Ce(u);function se(u,x){this.input=u,this.filename=x.filename||null,this.schema=x.schema||o,this.onWarning=x.onWarning||null,this.legacy=x.legacy||!1,this.json=x.json||!1,this.listener=x.listener||null,this.maxDepth=typeof x.maxDepth=="number"?x.maxDepth:100,this.maxTotalMergeKeys=typeof x.maxTotalMergeKeys=="number"?x.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=u.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function $e(u,x){let L={name:u.filename,buffer:u.input.slice(0,-1),position:u.position,line:u.line,column:u.position-u.lineStart};return L.snippet=r(L),new t(x,L)}function X(u,x){throw $e(u,x)}function dt(u,x){u.onWarning&&u.onWarning.call(null,$e(u,x))}function Ge(u,x,L){let j=u.anchorMapTransactions;if(j.length!==0){let O=j[j.length-1];n.call(O,x)||(O[x]={existed:n.call(u.anchorMap,x),value:u.anchorMap[x]})}u.anchorMap[x]=L}function jn(u){u.anchorMapTransactions.push(Object.create(null))}function _e(u){let x=u.anchorMapTransactions.pop(),L=u.anchorMapTransactions;if(L.length===0)return;let j=L[L.length-1],O=Object.keys(x);for(let m=0,E=O.length;m<E;m+=1){let I=O[m];n.call(j,I)||(j[I]=x[I])}}function Je(u){let x=u.anchorMapTransactions.pop(),L=Object.keys(x);for(let j=L.length-1;j>=0;j-=1){let O=x[L[j]];O.existed?u.anchorMap[L[j]]=O.value:delete u.anchorMap[L[j]]}}function q(u){return{position:u.position,line:u.line,lineStart:u.lineStart,lineIndent:u.lineIndent,firstTabInLine:u.firstTabInLine,tag:u.tag,anchor:u.anchor,kind:u.kind,result:u.result}}function Se(u,x){u.position=x.position,u.line=x.line,u.lineStart=x.lineStart,u.lineIndent=x.lineIndent,u.firstTabInLine=x.firstTabInLine,u.tag=x.tag,u.anchor=x.anchor,u.kind=x.kind,u.result=x.result}let ut={YAML:function(x,L,j){x.version!==null&&X(x,"duplication of %YAML directive"),j.length!==1&&X(x,"YAML directive accepts exactly one argument");let O=/^([0-9]+)\.([0-9]+)$/.exec(j[0]);O===null&&X(x,"ill-formed argument of the YAML directive");let m=parseInt(O[1],10),E=parseInt(O[2],10);m!==1&&X(x,"unacceptable YAML version of the document"),x.version=j[0],x.checkLineBreaks=E<2,E!==1&&E!==2&&dt(x,"unsupported YAML version of the document")},TAG:function(x,L,j){let O;j.length!==2&&X(x,"TAG directive accepts exactly two arguments");let m=j[0];O=j[1],D.test(m)||X(x,"ill-formed tag handle (first argument) of the TAG directive"),n.call(x.tagMap,m)&&X(x,'there is a previously declared suffix for "'+m+'" tag handle'),b.test(O)||X(x,"ill-formed tag prefix (second argument) of the TAG directive");try{O=decodeURIComponent(O)}catch{X(x,"tag prefix is malformed: "+O)}x.tagMap[m]=O}};function Be(u,x,L,j){if(x<L){let O=u.input.slice(x,L);if(j)for(let m=0,E=O.length;m<E;m+=1){let I=O.charCodeAt(m);I===9||I>=32&&I<=1114111||X(u,"expected valid JSON character")}else f.test(O)&&X(u,"the stream contains non-printable characters");u.result+=O}}function St(u){u.totalMergeKeys++,u.maxTotalMergeKeys!==-1&&u.totalMergeKeys>u.maxTotalMergeKeys&&X(u,"merge keys exceeded maxTotalMergeKeys ("+u.maxTotalMergeKeys+")")}function Mn(u,x,L,j){e.isObject(L)||X(u,"cannot merge mappings; the provided source object is unacceptable"),St(u);let O=Object.keys(L);for(let m=0,E=O.length;m<E;m+=1){let I=O[m];St(u),n.call(x,I)||(he(x,I,L[I]),j[I]=!0)}}function Zt(u,x,L,j,O,m,E,I,U){if(Array.isArray(O)){O=Array.prototype.slice.call(O);for(let G=0,W=O.length;G<W;G+=1)Array.isArray(O[G])&&X(u,"nested arrays are not supported inside keys"),typeof O=="object"&&$(O[G])==="[object Object]"&&(O[G]="[object Object]")}if(typeof O=="object"&&$(O)==="[object Object]"&&(O="[object Object]"),O=String(O),x===null&&(x={}),j==="tag:yaml.org,2002:merge")if(Array.isArray(m)){m.length>100&&X(u,"abnormal merge sequence size");for(let G=0,W=m.length;G<W;G+=1)Mn(u,x,m[G],L)}else Mn(u,x,m,L);else!u.json&&!n.call(L,O)&&n.call(x,O)&&(u.line=E||u.line,u.lineStart=I||u.lineStart,u.position=U||u.position,X(u,"duplicated mapping key")),he(x,O,m),delete L[O];return x}function bo(u){let x=u.input.charCodeAt(u.position);x===10?u.position++:x===13?(u.position++,u.input.charCodeAt(u.position)===10&&u.position++):X(u,"a line break is expected"),u.line+=1,u.lineStart=u.position,u.firstTabInLine=-1}function Te(u,x,L){let j=0,O=u.input.charCodeAt(u.position);for(;O!==0;){for(;w(O);)O===9&&u.firstTabInLine===-1&&(u.firstTabInLine=u.position),O=u.input.charCodeAt(++u.position);if(x&&O===35)do O=u.input.charCodeAt(++u.position);while(O!==10&&O!==13&&O!==0);if(S(O))for(bo(u),O=u.input.charCodeAt(u.position),j++,u.lineIndent=0;O===32;)u.lineIndent++,O=u.input.charCodeAt(++u.position);else break}return L!==-1&&j!==0&&u.lineIndent<L&&dt(u,"deficient indentation"),j}function Pt(u){let x=u.position,L=u.input.charCodeAt(x);return!!((L===45||L===46)&&L===u.input.charCodeAt(x+1)&&L===u.input.charCodeAt(x+2)&&(x+=3,L=u.input.charCodeAt(x),L===0||C(L)))}function lr(u,x){x===1?u.result+=" ":x>1&&(u.result+=e.repeat(`
86
- `,x-1))}function Vi(u,x,L){let j,O,m,E,I,U,G=u.kind,W=u.result,R=u.input.charCodeAt(u.position);if(C(R)||N(R)||R===35||R===38||R===42||R===33||R===124||R===62||R===39||R===34||R===37||R===64||R===96)return!1;if(R===63||R===45){let Z=u.input.charCodeAt(u.position+1);if(C(Z)||L&&N(Z))return!1}for(u.kind="scalar",u.result="",j=O=u.position,m=!1;R!==0;){if(R===58){let Z=u.input.charCodeAt(u.position+1);if(C(Z)||L&&N(Z))break}else if(R===35){let Z=u.input.charCodeAt(u.position-1);if(C(Z))break}else{if(u.position===u.lineStart&&Pt(u)||L&&N(R))break;if(S(R))if(E=u.line,I=u.lineStart,U=u.lineIndent,Te(u,!1,-1),u.lineIndent>=x){m=!0,R=u.input.charCodeAt(u.position);continue}else{u.position=O,u.line=E,u.lineStart=I,u.lineIndent=U;break}}m&&(Be(u,j,O,!1),lr(u,u.line-E),j=O=u.position,m=!1),w(R)||(O=u.position+1),R=u.input.charCodeAt(++u.position)}return Be(u,j,O,!1),u.result?!0:(u.kind=G,u.result=W,!1)}function wo(u,x){let L,j,O=u.input.charCodeAt(u.position);if(O!==39)return!1;for(u.kind="scalar",u.result="",u.position++,L=j=u.position;(O=u.input.charCodeAt(u.position))!==0;)if(O===39)if(Be(u,L,u.position,!0),O=u.input.charCodeAt(++u.position),O===39)L=u.position,u.position++,j=u.position;else return!0;else S(O)?(Be(u,L,j,!0),lr(u,Te(u,!1,x)),L=j=u.position):u.position===u.lineStart&&Pt(u)?X(u,"unexpected end of the document within a single quoted scalar"):(u.position++,w(O)||(j=u.position));X(u,"unexpected end of the stream within a single quoted scalar")}function Yi(u,x){let L,j,O,m=u.input.charCodeAt(u.position);if(m!==34)return!1;for(u.kind="scalar",u.result="",u.position++,L=j=u.position;(m=u.input.charCodeAt(u.position))!==0;){if(m===34)return Be(u,L,u.position,!0),u.position++,!0;if(m===92){if(Be(u,L,u.position,!0),m=u.input.charCodeAt(++u.position),S(m))Te(u,!1,x);else if(m<256&&Ne[m])u.result+=yt[m],u.position++;else if((O=de(m))>0){let E=O,I=0;for(;E>0;E--)m=u.input.charCodeAt(++u.position),(O=ee(m))>=0?I=(I<<4)+O:X(u,"expected hexadecimal character");u.result+=Ct(I),u.position++}else X(u,"unknown escape sequence");L=j=u.position}else S(m)?(Be(u,L,j,!0),lr(u,Te(u,!1,x)),L=j=u.position):u.position===u.lineStart&&Pt(u)?X(u,"unexpected end of the document within a double quoted scalar"):(u.position++,w(m)||(j=u.position))}X(u,"unexpected end of the stream within a double quoted scalar")}function qi(u,x){let L=!0,j,O,m,E=u.tag,I,U=u.anchor,G,W,R,Z,te=Object.create(null),oe,ie,ce,ue=u.input.charCodeAt(u.position);if(ue===91)G=93,Z=!1,I=[];else if(ue===123)G=125,Z=!0,I={};else return!1;for(u.anchor!==null&&Ge(u,u.anchor,I),ue=u.input.charCodeAt(++u.position);ue!==0;){if(Te(u,!0,x),ue=u.input.charCodeAt(u.position),ue===G)return u.position++,u.tag=E,u.anchor=U,u.kind=Z?"mapping":"sequence",u.result=I,!0;if(L?ue===44&&X(u,"expected the node content, but found ','"):X(u,"missed comma between flow collection entries"),ie=oe=ce=null,W=R=!1,ue===63){let dn=u.input.charCodeAt(u.position+1);C(dn)&&(W=R=!0,u.position++,Te(u,!0,x))}j=u.line,O=u.lineStart,m=u.position,ln(u,x,i,!1,!0),ie=u.tag,oe=u.result,Te(u,!0,x),ue=u.input.charCodeAt(u.position),(R||u.line===j)&&ue===58&&(W=!0,ue=u.input.charCodeAt(++u.position),Te(u,!0,x),ln(u,x,i,!1,!0),ce=u.result),Z?Zt(u,I,te,ie,oe,ce,j,O,m):W?I.push(Zt(u,null,te,ie,oe,ce,j,O,m)):I.push(oe),Te(u,!0,x),ue=u.input.charCodeAt(u.position),ue===44?(L=!0,ue=u.input.charCodeAt(++u.position)):L=!1}X(u,"unexpected end of the stream within a flow collection")}function cn(u,x){let L,j=d,O=!1,m=!1,E=x,I=0,U=!1,G,W=u.input.charCodeAt(u.position);if(W===124)L=!1;else if(W===62)L=!0;else return!1;for(u.kind="scalar",u.result="";W!==0;)if(W=u.input.charCodeAt(++u.position),W===43||W===45)d===j?j=W===43?h:p:X(u,"repeat of a chomping mode identifier");else if((G=me(W))>=0)G===0?X(u,"bad explicit indentation width of a block scalar; it cannot be less than one"):m?X(u,"repeat of an indentation width identifier"):(E=x+G-1,m=!0);else break;if(w(W)){do W=u.input.charCodeAt(++u.position);while(w(W));if(W===35)do W=u.input.charCodeAt(++u.position);while(!S(W)&&W!==0)}for(;W!==0;){for(bo(u),u.lineIndent=0,W=u.input.charCodeAt(u.position);(!m||u.lineIndent<E)&&W===32;)u.lineIndent++,W=u.input.charCodeAt(++u.position);if(!m&&u.lineIndent>E&&(E=u.lineIndent),S(W)){I++;continue}if(!m&&E===0&&X(u,"missing indentation for block scalar"),u.lineIndent<E){j===h?u.result+=e.repeat(`
84
+ \r`;function r(a){if(a===null)return!1;let s=0,l=a.length,d=t;for(let p=0;p<l;p++){let h=d.indexOf(a.charAt(p));if(!(h>64)){if(h<0)return!1;s+=6}}return s%8===0}function o(a){let s=a.replace(/[\r\n=]/g,""),l=s.length,d=t,p=0,h=[];for(let y=0;y<l;y++)y%4===0&&y&&(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)),p=p<<6|d.indexOf(s.charAt(y));let f=l%4*6;return f===0?(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)):f===18?(h.push(p>>10&255),h.push(p>>2&255)):f===12&&h.push(p>>4&255),new Uint8Array(h)}function n(a){let s="",l=0,d=a.length,p=t;for(let f=0;f<d;f++)f%3===0&&f&&(s+=p[l>>18&63],s+=p[l>>12&63],s+=p[l>>6&63],s+=p[l&63]),l=(l<<8)+a[f];let h=d%3;return h===0?(s+=p[l>>18&63],s+=p[l>>12&63],s+=p[l>>6&63],s+=p[l&63]):h===2?(s+=p[l>>10&63],s+=p[l>>4&63],s+=p[l<<2&63],s+=p[64]):h===1&&(s+=p[l>>2&63],s+=p[l<<4&63],s+=p[64],s+=p[64]),s}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return cf=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:o,predicate:i,represent:n}),cf}function jk(){if(gk)return lf;gk=1;let e=rt(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function o(i){if(i===null)return!0;let a={},s=i;for(let l=0,d=s.length;l<d;l+=1){let p=s[l],h=!1;if(r.call(p)!=="[object Object]")return!1;let f;for(f in p)if(t.call(p,f))if(!h)h=!0;else return!1;if(!h||t.call(a,f))return!1;Object.defineProperty(a,f,{value:!0})}return!0}function n(i){return i!==null?i:[]}return lf=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:n}),lf}function Mk(){if(yk)return df;yk=1;let e=rt(),t=Object.prototype.toString;function r(n){if(n===null)return!0;let i=n,a=new Array(i.length);for(let s=0,l=i.length;s<l;s+=1){let d=i[s];if(t.call(d)!=="[object Object]")return!1;let p=Object.keys(d);if(p.length!==1)return!1;a[s]=[p[0],d[p[0]]]}return!0}function o(n){if(n===null)return[];let i=n,a=new Array(i.length);for(let s=0,l=i.length;s<l;s+=1){let d=i[s],p=Object.keys(d);a[s]=[p[0],d[p[0]]]}return a}return df=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:o}),df}function Uk(){if(vk)return uf;vk=1;let e=rt(),t=Object.prototype.hasOwnProperty;function r(n){if(n===null)return!0;let i=n;for(let a in i)if(t.call(i,a)&&i[a]!==null)return!1;return!0}function o(n){return n!==null?n:{}}return uf=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:o}),uf}function mf(){return bk||(bk=1,pf=Nk().extend({implicit:[Rk(),Lk()],explicit:[Dk(),jk(),Mk(),Uk()]})),pf}function XC(){if(wk)return Ys;wk=1;let e=yi(),t=vi(),r=JC(),o=mf(),n=Object.prototype.hasOwnProperty,i=1,a=2,s=3,l=4,d=1,p=2,h=3,f=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,k=/[,\[\]{}]/,D=/^(?:!|!!|![0-9A-Za-z-]+!)$/,b=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function $(u){return Object.prototype.toString.call(u)}function S(u){return u===10||u===13}function w(u){return u===9||u===32}function C(u){return u===9||u===32||u===10||u===13}function N(u){return u===44||u===91||u===93||u===123||u===125}function ee(u){if(u>=48&&u<=57)return u-48;let x=u|32;return x>=97&&x<=102?x-97+10:-1}function de(u){return u===120?2:u===117?4:u===85?8:0}function me(u){return u>=48&&u<=57?u-48:-1}function Ce(u){switch(u){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
85
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function Ct(u){return u<=65535?String.fromCharCode(u):String.fromCharCode((u-65536>>10)+55296,(u-65536&1023)+56320)}function he(u,x,L){x==="__proto__"?Object.defineProperty(u,x,{configurable:!0,enumerable:!0,writable:!0,value:L}):u[x]=L}let Ne=new Array(256),yt=new Array(256);for(let u=0;u<256;u++)Ne[u]=Ce(u)?1:0,yt[u]=Ce(u);function se(u,x){this.input=u,this.filename=x.filename||null,this.schema=x.schema||o,this.onWarning=x.onWarning||null,this.legacy=x.legacy||!1,this.json=x.json||!1,this.listener=x.listener||null,this.maxDepth=typeof x.maxDepth=="number"?x.maxDepth:100,this.maxTotalMergeKeys=typeof x.maxTotalMergeKeys=="number"?x.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=u.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function $e(u,x){let L={name:u.filename,buffer:u.input.slice(0,-1),position:u.position,line:u.line,column:u.position-u.lineStart};return L.snippet=r(L),new t(x,L)}function X(u,x){throw $e(u,x)}function dt(u,x){u.onWarning&&u.onWarning.call(null,$e(u,x))}function Ge(u,x,L){let j=u.anchorMapTransactions;if(j.length!==0){let O=j[j.length-1];n.call(O,x)||(O[x]={existed:n.call(u.anchorMap,x),value:u.anchorMap[x]})}u.anchorMap[x]=L}function jn(u){u.anchorMapTransactions.push(Object.create(null))}function _e(u){let x=u.anchorMapTransactions.pop(),L=u.anchorMapTransactions;if(L.length===0)return;let j=L[L.length-1],O=Object.keys(x);for(let m=0,E=O.length;m<E;m+=1){let I=O[m];n.call(j,I)||(j[I]=x[I])}}function Je(u){let x=u.anchorMapTransactions.pop(),L=Object.keys(x);for(let j=L.length-1;j>=0;j-=1){let O=x[L[j]];O.existed?u.anchorMap[L[j]]=O.value:delete u.anchorMap[L[j]]}}function q(u){return{position:u.position,line:u.line,lineStart:u.lineStart,lineIndent:u.lineIndent,firstTabInLine:u.firstTabInLine,tag:u.tag,anchor:u.anchor,kind:u.kind,result:u.result}}function Se(u,x){u.position=x.position,u.line=x.line,u.lineStart=x.lineStart,u.lineIndent=x.lineIndent,u.firstTabInLine=x.firstTabInLine,u.tag=x.tag,u.anchor=x.anchor,u.kind=x.kind,u.result=x.result}let ut={YAML:function(x,L,j){x.version!==null&&X(x,"duplication of %YAML directive"),j.length!==1&&X(x,"YAML directive accepts exactly one argument");let O=/^([0-9]+)\.([0-9]+)$/.exec(j[0]);O===null&&X(x,"ill-formed argument of the YAML directive");let m=parseInt(O[1],10),E=parseInt(O[2],10);m!==1&&X(x,"unacceptable YAML version of the document"),x.version=j[0],x.checkLineBreaks=E<2,E!==1&&E!==2&&dt(x,"unsupported YAML version of the document")},TAG:function(x,L,j){let O;j.length!==2&&X(x,"TAG directive accepts exactly two arguments");let m=j[0];O=j[1],D.test(m)||X(x,"ill-formed tag handle (first argument) of the TAG directive"),n.call(x.tagMap,m)&&X(x,'there is a previously declared suffix for "'+m+'" tag handle'),b.test(O)||X(x,"ill-formed tag prefix (second argument) of the TAG directive");try{O=decodeURIComponent(O)}catch{X(x,"tag prefix is malformed: "+O)}x.tagMap[m]=O}};function Be(u,x,L,j){if(x<L){let O=u.input.slice(x,L);if(j)for(let m=0,E=O.length;m<E;m+=1){let I=O.charCodeAt(m);I===9||I>=32&&I<=1114111||X(u,"expected valid JSON character")}else f.test(O)&&X(u,"the stream contains non-printable characters");u.result+=O}}function St(u){u.totalMergeKeys++,u.maxTotalMergeKeys!==-1&&u.totalMergeKeys>u.maxTotalMergeKeys&&X(u,"merge keys exceeded maxTotalMergeKeys ("+u.maxTotalMergeKeys+")")}function Mn(u,x,L,j){e.isObject(L)||X(u,"cannot merge mappings; the provided source object is unacceptable"),St(u);let O=Object.keys(L);for(let m=0,E=O.length;m<E;m+=1){let I=O[m];St(u),n.call(x,I)||(he(x,I,L[I]),j[I]=!0)}}function Zt(u,x,L,j,O,m,E,I,U){if(Array.isArray(O)){O=Array.prototype.slice.call(O);for(let G=0,W=O.length;G<W;G+=1)Array.isArray(O[G])&&X(u,"nested arrays are not supported inside keys"),typeof O=="object"&&$(O[G])==="[object Object]"&&(O[G]="[object Object]")}if(typeof O=="object"&&$(O)==="[object Object]"&&(O="[object Object]"),O=String(O),x===null&&(x={}),j==="tag:yaml.org,2002:merge")if(Array.isArray(m)){m.length>100&&X(u,"abnormal merge sequence size");for(let G=0,W=m.length;G<W;G+=1)Mn(u,x,m[G],L)}else Mn(u,x,m,L);else!u.json&&!n.call(L,O)&&n.call(x,O)&&(u.line=E||u.line,u.lineStart=I||u.lineStart,u.position=U||u.position,X(u,"duplicated mapping key")),he(x,O,m),delete L[O];return x}function bo(u){let x=u.input.charCodeAt(u.position);x===10?u.position++:x===13?(u.position++,u.input.charCodeAt(u.position)===10&&u.position++):X(u,"a line break is expected"),u.line+=1,u.lineStart=u.position,u.firstTabInLine=-1}function Te(u,x,L){let j=0,O=u.input.charCodeAt(u.position);for(;O!==0;){for(;w(O);)O===9&&u.firstTabInLine===-1&&(u.firstTabInLine=u.position),O=u.input.charCodeAt(++u.position);if(x&&O===35)do O=u.input.charCodeAt(++u.position);while(O!==10&&O!==13&&O!==0);if(S(O))for(bo(u),O=u.input.charCodeAt(u.position),j++,u.lineIndent=0;O===32;)u.lineIndent++,O=u.input.charCodeAt(++u.position);else break}return L!==-1&&j!==0&&u.lineIndent<L&&dt(u,"deficient indentation"),j}function Pt(u){let x=u.position,L=u.input.charCodeAt(x);return!!((L===45||L===46)&&L===u.input.charCodeAt(x+1)&&L===u.input.charCodeAt(x+2)&&(x+=3,L=u.input.charCodeAt(x),L===0||C(L)))}function dr(u,x){x===1?u.result+=" ":x>1&&(u.result+=e.repeat(`
86
+ `,x-1))}function Vi(u,x,L){let j,O,m,E,I,U,G=u.kind,W=u.result,R=u.input.charCodeAt(u.position);if(C(R)||N(R)||R===35||R===38||R===42||R===33||R===124||R===62||R===39||R===34||R===37||R===64||R===96)return!1;if(R===63||R===45){let Z=u.input.charCodeAt(u.position+1);if(C(Z)||L&&N(Z))return!1}for(u.kind="scalar",u.result="",j=O=u.position,m=!1;R!==0;){if(R===58){let Z=u.input.charCodeAt(u.position+1);if(C(Z)||L&&N(Z))break}else if(R===35){let Z=u.input.charCodeAt(u.position-1);if(C(Z))break}else{if(u.position===u.lineStart&&Pt(u)||L&&N(R))break;if(S(R))if(E=u.line,I=u.lineStart,U=u.lineIndent,Te(u,!1,-1),u.lineIndent>=x){m=!0,R=u.input.charCodeAt(u.position);continue}else{u.position=O,u.line=E,u.lineStart=I,u.lineIndent=U;break}}m&&(Be(u,j,O,!1),dr(u,u.line-E),j=O=u.position,m=!1),w(R)||(O=u.position+1),R=u.input.charCodeAt(++u.position)}return Be(u,j,O,!1),u.result?!0:(u.kind=G,u.result=W,!1)}function wo(u,x){let L,j,O=u.input.charCodeAt(u.position);if(O!==39)return!1;for(u.kind="scalar",u.result="",u.position++,L=j=u.position;(O=u.input.charCodeAt(u.position))!==0;)if(O===39)if(Be(u,L,u.position,!0),O=u.input.charCodeAt(++u.position),O===39)L=u.position,u.position++,j=u.position;else return!0;else S(O)?(Be(u,L,j,!0),dr(u,Te(u,!1,x)),L=j=u.position):u.position===u.lineStart&&Pt(u)?X(u,"unexpected end of the document within a single quoted scalar"):(u.position++,w(O)||(j=u.position));X(u,"unexpected end of the stream within a single quoted scalar")}function Yi(u,x){let L,j,O,m=u.input.charCodeAt(u.position);if(m!==34)return!1;for(u.kind="scalar",u.result="",u.position++,L=j=u.position;(m=u.input.charCodeAt(u.position))!==0;){if(m===34)return Be(u,L,u.position,!0),u.position++,!0;if(m===92){if(Be(u,L,u.position,!0),m=u.input.charCodeAt(++u.position),S(m))Te(u,!1,x);else if(m<256&&Ne[m])u.result+=yt[m],u.position++;else if((O=de(m))>0){let E=O,I=0;for(;E>0;E--)m=u.input.charCodeAt(++u.position),(O=ee(m))>=0?I=(I<<4)+O:X(u,"expected hexadecimal character");u.result+=Ct(I),u.position++}else X(u,"unknown escape sequence");L=j=u.position}else S(m)?(Be(u,L,j,!0),dr(u,Te(u,!1,x)),L=j=u.position):u.position===u.lineStart&&Pt(u)?X(u,"unexpected end of the document within a double quoted scalar"):(u.position++,w(m)||(j=u.position))}X(u,"unexpected end of the stream within a double quoted scalar")}function qi(u,x){let L=!0,j,O,m,E=u.tag,I,U=u.anchor,G,W,R,Z,te=Object.create(null),oe,ie,ce,ue=u.input.charCodeAt(u.position);if(ue===91)G=93,Z=!1,I=[];else if(ue===123)G=125,Z=!0,I={};else return!1;for(u.anchor!==null&&Ge(u,u.anchor,I),ue=u.input.charCodeAt(++u.position);ue!==0;){if(Te(u,!0,x),ue=u.input.charCodeAt(u.position),ue===G)return u.position++,u.tag=E,u.anchor=U,u.kind=Z?"mapping":"sequence",u.result=I,!0;if(L?ue===44&&X(u,"expected the node content, but found ','"):X(u,"missed comma between flow collection entries"),ie=oe=ce=null,W=R=!1,ue===63){let dn=u.input.charCodeAt(u.position+1);C(dn)&&(W=R=!0,u.position++,Te(u,!0,x))}j=u.line,O=u.lineStart,m=u.position,ln(u,x,i,!1,!0),ie=u.tag,oe=u.result,Te(u,!0,x),ue=u.input.charCodeAt(u.position),(R||u.line===j)&&ue===58&&(W=!0,ue=u.input.charCodeAt(++u.position),Te(u,!0,x),ln(u,x,i,!1,!0),ce=u.result),Z?Zt(u,I,te,ie,oe,ce,j,O,m):W?I.push(Zt(u,null,te,ie,oe,ce,j,O,m)):I.push(oe),Te(u,!0,x),ue=u.input.charCodeAt(u.position),ue===44?(L=!0,ue=u.input.charCodeAt(++u.position)):L=!1}X(u,"unexpected end of the stream within a flow collection")}function cn(u,x){let L,j=d,O=!1,m=!1,E=x,I=0,U=!1,G,W=u.input.charCodeAt(u.position);if(W===124)L=!1;else if(W===62)L=!0;else return!1;for(u.kind="scalar",u.result="";W!==0;)if(W=u.input.charCodeAt(++u.position),W===43||W===45)d===j?j=W===43?h:p:X(u,"repeat of a chomping mode identifier");else if((G=me(W))>=0)G===0?X(u,"bad explicit indentation width of a block scalar; it cannot be less than one"):m?X(u,"repeat of an indentation width identifier"):(E=x+G-1,m=!0);else break;if(w(W)){do W=u.input.charCodeAt(++u.position);while(w(W));if(W===35)do W=u.input.charCodeAt(++u.position);while(!S(W)&&W!==0)}for(;W!==0;){for(bo(u),u.lineIndent=0,W=u.input.charCodeAt(u.position);(!m||u.lineIndent<E)&&W===32;)u.lineIndent++,W=u.input.charCodeAt(++u.position);if(!m&&u.lineIndent>E&&(E=u.lineIndent),S(W)){I++;continue}if(!m&&E===0&&X(u,"missing indentation for block scalar"),u.lineIndent<E){j===h?u.result+=e.repeat(`
87
87
  `,O?1+I:I):j===d&&O&&(u.result+=`
88
88
  `);break}L?w(W)?(U=!0,u.result+=e.repeat(`
89
89
  `,O?1+I:I)):U?(U=!1,u.result+=e.repeat(`
90
90
  `,I+1)):I===0?O&&(u.result+=" "):u.result+=e.repeat(`
91
91
  `,I):u.result+=e.repeat(`
92
92
  `,O?1+I:I),O=!0,m=!0,I=0;let R=u.position;for(;!S(W)&&W!==0;)W=u.input.charCodeAt(++u.position);Be(u,R,u.position,!1)}return!0}function Ji(u,x){let L=u.tag,j=u.anchor,O=[],m=!1;if(u.firstTabInLine!==-1)return!1;u.anchor!==null&&Ge(u,u.anchor,O);let E=u.input.charCodeAt(u.position);for(;E!==0&&(u.firstTabInLine!==-1&&(u.position=u.firstTabInLine,X(u,"tab characters must not be used in indentation")),E===45);){let I=u.input.charCodeAt(u.position+1);if(!C(I))break;if(m=!0,u.position++,Te(u,!0,-1)&&u.lineIndent<=x){O.push(null),E=u.input.charCodeAt(u.position);continue}let U=u.line;if(ln(u,x,s,!1,!0),O.push(u.result),Te(u,!0,-1),E=u.input.charCodeAt(u.position),(u.line===U||u.lineIndent>x)&&E!==0)X(u,"bad indentation of a sequence entry");else if(u.lineIndent<x)break}return m?(u.tag=L,u.anchor=j,u.kind="sequence",u.result=O,!0):!1}function Xi(u,x,L){let j,O,m,E,I=u.tag,U=u.anchor,G={},W=Object.create(null),R=null,Z=null,te=null,oe=!1,ie=!1;if(u.firstTabInLine!==-1)return!1;u.anchor!==null&&Ge(u,u.anchor,G);let ce=u.input.charCodeAt(u.position);for(;ce!==0;){!oe&&u.firstTabInLine!==-1&&(u.position=u.firstTabInLine,X(u,"tab characters must not be used in indentation"));let ue=u.input.charCodeAt(u.position+1),dn=u.line;if((ce===63||ce===58)&&C(ue))ce===63?(oe&&(Zt(u,G,W,R,Z,null,O,m,E),R=Z=te=null),ie=!0,oe=!0,j=!0):oe?(oe=!1,j=!0):X(u,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),u.position+=1,ce=ue;else{if(O=u.line,m=u.lineStart,E=u.position,!ln(u,L,a,!1,!0))break;if(u.line===dn){for(ce=u.input.charCodeAt(u.position);w(ce);)ce=u.input.charCodeAt(++u.position);if(ce===58)ce=u.input.charCodeAt(++u.position),C(ce)||X(u,"a whitespace character is expected after the key-value separator within a block mapping"),oe&&(Zt(u,G,W,R,Z,null,O,m,E),R=Z=te=null),ie=!0,oe=!1,j=!1,R=u.tag,Z=u.result;else if(ie)X(u,"can not read an implicit mapping pair; a colon is missed");else return u.tag=I,u.anchor=U,!0}else if(ie)X(u,"can not read a block mapping entry; a multiline key may not be an implicit key");else return u.tag=I,u.anchor=U,!0}if((u.line===dn||u.lineIndent>x)&&(oe&&(O=u.line,m=u.lineStart,E=u.position),ln(u,x,l,!0,j)&&(oe?Z=u.result:te=u.result),oe||(Zt(u,G,W,R,Z,te,O,m,E),R=Z=te=null),Te(u,!0,-1),ce=u.input.charCodeAt(u.position)),(u.line===dn||u.lineIndent>x)&&ce!==0)X(u,"bad indentation of a mapping entry");else if(u.lineIndent<x)break}return oe&&Zt(u,G,W,R,Z,null,O,m,E),ie&&(u.tag=I,u.anchor=U,u.kind="mapping",u.result=G),ie}function Qi(u){let x=!1,L=!1,j,O,m=u.input.charCodeAt(u.position);if(m!==33)return!1;u.tag!==null&&X(u,"duplication of a tag property"),m=u.input.charCodeAt(++u.position),m===60?(x=!0,m=u.input.charCodeAt(++u.position)):m===33?(L=!0,j="!!",m=u.input.charCodeAt(++u.position)):j="!";let E=u.position;if(x){do m=u.input.charCodeAt(++u.position);while(m!==0&&m!==62);u.position<u.length?(O=u.input.slice(E,u.position),m=u.input.charCodeAt(++u.position)):X(u,"unexpected end of the stream within a verbatim tag")}else{for(;m!==0&&!C(m);)m===33&&(L?X(u,"tag suffix cannot contain exclamation marks"):(j=u.input.slice(E-1,u.position+1),D.test(j)||X(u,"named tag handle cannot contain such characters"),L=!0,E=u.position+1)),m=u.input.charCodeAt(++u.position);O=u.input.slice(E,u.position),k.test(O)&&X(u,"tag suffix cannot contain flow indicator characters")}O&&!b.test(O)&&X(u,"tag name cannot contain such characters: "+O);try{O=decodeURIComponent(O)}catch{X(u,"tag name is malformed: "+O)}return x?u.tag=O:n.call(u.tagMap,j)?u.tag=u.tagMap[j]+O:j==="!"?u.tag="!"+O:j==="!!"?u.tag="tag:yaml.org,2002:"+O:X(u,'undeclared tag handle "'+j+'"'),!0}function ea(u){let x=u.input.charCodeAt(u.position);if(x!==38)return!1;u.anchor!==null&&X(u,"duplication of an anchor property"),x=u.input.charCodeAt(++u.position);let L=u.position;for(;x!==0&&!C(x)&&!N(x);)x=u.input.charCodeAt(++u.position);return u.position===L&&X(u,"name of an anchor node must contain at least one character"),u.anchor=u.input.slice(L,u.position),!0}function ml(u){let x=u.input.charCodeAt(u.position);if(x!==42)return!1;x=u.input.charCodeAt(++u.position);let L=u.position;for(;x!==0&&!C(x)&&!N(x);)x=u.input.charCodeAt(++u.position);u.position===L&&X(u,"name of an alias node must contain at least one character");let j=u.input.slice(L,u.position);return n.call(u.anchorMap,j)||X(u,'unidentified alias "'+j+'"'),u.result=u.anchorMap[j],Te(u,!0,-1),!0}function ta(u,x,L,j){let O=q(u);return jn(u),Se(u,x),u.tag=null,u.anchor=null,u.kind=null,u.result=null,Xi(u,L,j)&&u.kind==="mapping"?(_e(u),!0):(Je(u),Se(u,O),!1)}function ln(u,x,L,j,O){let m,E,I=1,U=!1,G=!1,W=null,R,Z,te;u.depth>=u.maxDepth&&X(u,"nesting exceeded maxDepth ("+u.maxDepth+")"),u.depth+=1,u.listener!==null&&u.listener("open",u),u.tag=null,u.anchor=null,u.kind=null,u.result=null;let oe=m=E=l===L||s===L;if(j&&Te(u,!0,-1)&&(U=!0,u.lineIndent>x?I=1:u.lineIndent===x?I=0:u.lineIndent<x&&(I=-1)),I===1)for(;;){let ie=u.input.charCodeAt(u.position),ce=q(u);if(U&&(ie===33&&u.tag!==null||ie===38&&u.anchor!==null)||!Qi(u)&&!ea(u))break;W===null&&(W=ce),Te(u,!0,-1)?(U=!0,E=oe,u.lineIndent>x?I=1:u.lineIndent===x?I=0:u.lineIndent<x&&(I=-1)):E=!1}if(E&&(E=U||O),I===1||l===L)if(i===L||a===L?Z=x:Z=x+1,te=u.position-u.lineStart,I===1)if(E&&(Ji(u,te)||Xi(u,te,Z))||qi(u,Z))G=!0;else{let ie=u.input.charCodeAt(u.position);W!==null&&oe&&!E&&ie!==124&&ie!==62&&ta(u,W,W.position-W.lineStart,Z)||m&&cn(u,Z)||wo(u,Z)||Yi(u,Z)?G=!0:ml(u)?(G=!0,(u.tag!==null||u.anchor!==null)&&X(u,"alias node should not have any properties")):Vi(u,Z,i===L)&&(G=!0,u.tag===null&&(u.tag="?")),u.anchor!==null&&Ge(u,u.anchor,u.result)}else I===0&&(G=E&&Ji(u,te));if(u.tag===null)u.anchor!==null&&Ge(u,u.anchor,u.result);else if(u.tag==="?"){u.result!==null&&u.kind!=="scalar"&&X(u,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+u.kind+'"');for(let ie=0,ce=u.implicitTypes.length;ie<ce;ie+=1)if(R=u.implicitTypes[ie],R.resolve(u.result)){u.result=R.construct(u.result),u.tag=R.tag,u.anchor!==null&&Ge(u,u.anchor,u.result);break}}else if(u.tag!=="!"){if(n.call(u.typeMap[u.kind||"fallback"],u.tag))R=u.typeMap[u.kind||"fallback"][u.tag];else{R=null;let ie=u.typeMap.multi[u.kind||"fallback"];for(let ce=0,ue=ie.length;ce<ue;ce+=1)if(u.tag.slice(0,ie[ce].tag.length)===ie[ce].tag){R=ie[ce];break}}R||X(u,"unknown tag !<"+u.tag+">"),u.result!==null&&R.kind!==u.kind&&X(u,"unacceptable node kind for !<"+u.tag+'> tag; it should be "'+R.kind+'", not "'+u.kind+'"'),R.resolve(u.result,u.tag)?(u.result=R.construct(u.result,u.tag),u.anchor!==null&&Ge(u,u.anchor,u.result)):X(u,"cannot resolve a node with !<"+u.tag+"> explicit tag")}return u.listener!==null&&u.listener("close",u),u.depth-=1,u.tag!==null||u.anchor!==null||G}function fl(u){let x=u.position,L=!1,j;for(u.version=null,u.checkLineBreaks=u.legacy,u.tagMap=Object.create(null),u.anchorMap=Object.create(null);(j=u.input.charCodeAt(u.position))!==0&&(Te(u,!0,-1),j=u.input.charCodeAt(u.position),!(u.lineIndent>0||j!==37));){L=!0,j=u.input.charCodeAt(++u.position);let O=u.position;for(;j!==0&&!C(j);)j=u.input.charCodeAt(++u.position);let m=u.input.slice(O,u.position),E=[];for(m.length<1&&X(u,"directive name must not be less than one character in length");j!==0;){for(;w(j);)j=u.input.charCodeAt(++u.position);if(j===35){do j=u.input.charCodeAt(++u.position);while(j!==0&&!S(j));break}if(S(j))break;for(O=u.position;j!==0&&!C(j);)j=u.input.charCodeAt(++u.position);E.push(u.input.slice(O,u.position))}j!==0&&bo(u),n.call(ut,m)?ut[m](u,m,E):dt(u,'unknown document directive "'+m+'"')}if(Te(u,!0,-1),u.lineIndent===0&&u.input.charCodeAt(u.position)===45&&u.input.charCodeAt(u.position+1)===45&&u.input.charCodeAt(u.position+2)===45?(u.position+=3,Te(u,!0,-1)):L&&X(u,"directives end mark is expected"),ln(u,u.lineIndent-1,l,!1,!0),Te(u,!0,-1),u.checkLineBreaks&&y.test(u.input.slice(x,u.position))&&dt(u,"non-ASCII line breaks are interpreted as content"),u.documents.push(u.result),u.position===u.lineStart&&Pt(u)){u.input.charCodeAt(u.position)===46&&(u.position+=3,Te(u,!0,-1));return}u.position<u.length-1&&X(u,"end of the stream or a document separator is expected")}function _o(u,x){u=String(u),x=x||{},u.length!==0&&(u.charCodeAt(u.length-1)!==10&&u.charCodeAt(u.length-1)!==13&&(u+=`
93
- `),u.charCodeAt(0)===65279&&(u=u.slice(1)));let L=new se(u,x),j=u.indexOf("\0");for(j!==-1&&(L.position=j,X(L,"null byte is not allowed in input")),L.input+="\0";L.input.charCodeAt(L.position)===32;)L.lineIndent+=1,L.position+=1;for(;L.position<L.length-1;)fl(L);return L.documents}function gl(u,x,L){x!==null&&typeof x=="object"&&typeof L>"u"&&(L=x,x=null);let j=_o(u,L);if(typeof x!="function")return j;for(let O=0,m=j.length;O<m;O+=1)x(j[O])}function yl(u,x){let L=_o(u,x);if(L.length!==0){if(L.length===1)return L[0];throw new t("expected a single document in the stream, but found more")}}return Ys.loadAll=gl,Ys.load=yl,Ys}function VC(){if(_k)return hf;_k=1;let e=yi(),t=vi(),r=mf(),o=Object.prototype.toString,n=Object.prototype.hasOwnProperty,i=65279,a=9,s=10,l=13,d=32,p=33,h=34,f=35,y=37,k=38,D=39,b=42,$=44,S=45,w=58,C=61,N=62,ee=63,de=64,me=91,Ce=93,Ct=96,he=123,Ne=124,yt=125,se={};se[0]="\\0",se[7]="\\a",se[8]="\\b",se[9]="\\t",se[10]="\\n",se[11]="\\v",se[12]="\\f",se[13]="\\r",se[27]="\\e",se[34]='\\"',se[92]="\\\\",se[133]="\\N",se[160]="\\_",se[8232]="\\L",se[8233]="\\P";let $e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],X=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function dt(m,E){if(E===null)return{};let I={},U=Object.keys(E);for(let G=0,W=U.length;G<W;G+=1){let R=U[G],Z=String(E[R]);R.slice(0,2)==="!!"&&(R="tag:yaml.org,2002:"+R.slice(2));let te=m.compiledTypeMap.fallback[R];te&&n.call(te.styleAliases,Z)&&(Z=te.styleAliases[Z]),I[R]=Z}return I}function Ge(m){let E,I,U=m.toString(16).toUpperCase();if(m<=255)E="x",I=2;else if(m<=65535)E="u",I=4;else if(m<=4294967295)E="U",I=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+E+e.repeat("0",I-U.length)+U}let jn=1,_e=2;function Je(m){this.schema=m.schema||r,this.indent=Math.max(1,m.indent||2),this.noArrayIndent=m.noArrayIndent||!1,this.skipInvalid=m.skipInvalid||!1,this.flowLevel=e.isNothing(m.flowLevel)?-1:m.flowLevel,this.styleMap=dt(this.schema,m.styles||null),this.sortKeys=m.sortKeys||!1,this.lineWidth=m.lineWidth||80,this.noRefs=m.noRefs||!1,this.noCompatMode=m.noCompatMode||!1,this.condenseFlow=m.condenseFlow||!1,this.quotingType=m.quotingType==='"'?_e:jn,this.forceQuotes=m.forceQuotes||!1,this.replacer=typeof m.replacer=="function"?m.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function q(m,E){let I=e.repeat(" ",E),U=0,G="",W=m.length;for(;U<W;){let R,Z=m.indexOf(`
93
+ `),u.charCodeAt(0)===65279&&(u=u.slice(1)));let L=new se(u,x),j=u.indexOf("\0");for(j!==-1&&(L.position=j,X(L,"null byte is not allowed in input")),L.input+="\0";L.input.charCodeAt(L.position)===32;)L.lineIndent+=1,L.position+=1;for(;L.position<L.length-1;)fl(L);return L.documents}function gl(u,x,L){x!==null&&typeof x=="object"&&typeof L>"u"&&(L=x,x=null);let j=_o(u,L);if(typeof x!="function")return j;for(let O=0,m=j.length;O<m;O+=1)x(j[O])}function yl(u,x){let L=_o(u,x);if(L.length!==0){if(L.length===1)return L[0];throw new t("expected a single document in the stream, but found more")}}return Ys.loadAll=gl,Ys.load=yl,Ys}function QC(){if(_k)return hf;_k=1;let e=yi(),t=vi(),r=mf(),o=Object.prototype.toString,n=Object.prototype.hasOwnProperty,i=65279,a=9,s=10,l=13,d=32,p=33,h=34,f=35,y=37,k=38,D=39,b=42,$=44,S=45,w=58,C=61,N=62,ee=63,de=64,me=91,Ce=93,Ct=96,he=123,Ne=124,yt=125,se={};se[0]="\\0",se[7]="\\a",se[8]="\\b",se[9]="\\t",se[10]="\\n",se[11]="\\v",se[12]="\\f",se[13]="\\r",se[27]="\\e",se[34]='\\"',se[92]="\\\\",se[133]="\\N",se[160]="\\_",se[8232]="\\L",se[8233]="\\P";let $e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],X=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function dt(m,E){if(E===null)return{};let I={},U=Object.keys(E);for(let G=0,W=U.length;G<W;G+=1){let R=U[G],Z=String(E[R]);R.slice(0,2)==="!!"&&(R="tag:yaml.org,2002:"+R.slice(2));let te=m.compiledTypeMap.fallback[R];te&&n.call(te.styleAliases,Z)&&(Z=te.styleAliases[Z]),I[R]=Z}return I}function Ge(m){let E,I,U=m.toString(16).toUpperCase();if(m<=255)E="x",I=2;else if(m<=65535)E="u",I=4;else if(m<=4294967295)E="U",I=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+E+e.repeat("0",I-U.length)+U}let jn=1,_e=2;function Je(m){this.schema=m.schema||r,this.indent=Math.max(1,m.indent||2),this.noArrayIndent=m.noArrayIndent||!1,this.skipInvalid=m.skipInvalid||!1,this.flowLevel=e.isNothing(m.flowLevel)?-1:m.flowLevel,this.styleMap=dt(this.schema,m.styles||null),this.sortKeys=m.sortKeys||!1,this.lineWidth=m.lineWidth||80,this.noRefs=m.noRefs||!1,this.noCompatMode=m.noCompatMode||!1,this.condenseFlow=m.condenseFlow||!1,this.quotingType=m.quotingType==='"'?_e:jn,this.forceQuotes=m.forceQuotes||!1,this.replacer=typeof m.replacer=="function"?m.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function q(m,E){let I=e.repeat(" ",E),U=0,G="",W=m.length;for(;U<W;){let R,Z=m.indexOf(`
94
94
  `,U);Z===-1?(R=m.slice(U),U=W):(R=m.slice(U,Z+1),U=Z+1),R.length&&R!==`
95
95
  `&&(G+=I),G+=R}return G}function Se(m,E){return`
96
- `+e.repeat(" ",m.indent*E)}function ut(m,E){for(let I=0,U=m.implicitTypes.length;I<U;I+=1)if(m.implicitTypes[I].resolve(E))return!0;return!1}function Be(m){return m===d||m===a}function St(m){return m>=32&&m<=126||m>=161&&m<=55295&&m!==8232&&m!==8233||m>=57344&&m<=65533&&m!==i||m>=65536&&m<=1114111}function Mn(m){return St(m)&&m!==i&&m!==l&&m!==s}function Zt(m,E,I){let U=Mn(m),G=U&&!Be(m);return(I?U:U&&m!==$&&m!==me&&m!==Ce&&m!==he&&m!==yt)&&m!==f&&!(E===w&&!G)||Mn(E)&&!Be(E)&&m===f||E===w&&G}function bo(m){return St(m)&&m!==i&&!Be(m)&&m!==S&&m!==ee&&m!==w&&m!==$&&m!==me&&m!==Ce&&m!==he&&m!==yt&&m!==f&&m!==k&&m!==b&&m!==p&&m!==Ne&&m!==C&&m!==N&&m!==D&&m!==h&&m!==y&&m!==de&&m!==Ct}function Te(m){return!Be(m)&&m!==w}function Pt(m,E){let I=m.charCodeAt(E),U;return I>=55296&&I<=56319&&E+1<m.length&&(U=m.charCodeAt(E+1),U>=56320&&U<=57343)?(I-55296)*1024+U-56320+65536:I}function lr(m){return/^\n* /.test(m)}let Vi=1,wo=2,Yi=3,qi=4,cn=5;function Ji(m,E,I,U,G,W,R,Z){let te,oe=0,ie=null,ce=!1,ue=!1,dn=U!==-1,ko=-1,xo=bo(Pt(m,0))&&Te(Pt(m,m.length-1));if(E||R)for(te=0;te<m.length;oe>=65536?te+=2:te++){if(oe=Pt(m,te),!St(oe))return cn;xo=xo&&Zt(oe,ie,Z),ie=oe}else{for(te=0;te<m.length;oe>=65536?te+=2:te++){if(oe=Pt(m,te),oe===s)ce=!0,dn&&(ue=ue||te-ko-1>U&&m[ko+1]!==" ",ko=te);else if(!St(oe))return cn;xo=xo&&Zt(oe,ie,Z),ie=oe}ue=ue||dn&&te-ko-1>U&&m[ko+1]!==" "}return!ce&&!ue?xo&&!R&&!G(m)?Vi:W===_e?cn:wo:I>9&&lr(m)?cn:R?W===_e?cn:wo:ue?qi:Yi}function Xi(m,E,I,U,G){m.dump=(function(){if(E.length===0)return m.quotingType===_e?'""':"''";if(!m.noCompatMode&&($e.indexOf(E)!==-1||X.test(E)))return m.quotingType===_e?'"'+E+'"':"'"+E+"'";let W=m.indent*Math.max(1,I),R=m.lineWidth===-1?-1:Math.max(Math.min(m.lineWidth,40),m.lineWidth-W),Z=U||m.flowLevel>-1&&I>=m.flowLevel;function te(oe){return ut(m,oe)}switch(Ji(E,Z,m.indent,R,te,m.quotingType,m.forceQuotes&&!U,G)){case Vi:return E;case wo:return"'"+E.replace(/'/g,"''")+"'";case Yi:return"|"+Qi(E,m.indent)+ea(q(E,W));case qi:return">"+Qi(E,m.indent)+ea(q(ml(E,R),W));case cn:return'"'+ln(E)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function Qi(m,E){let I=lr(m)?String(E):"",U=m[m.length-1]===`
96
+ `+e.repeat(" ",m.indent*E)}function ut(m,E){for(let I=0,U=m.implicitTypes.length;I<U;I+=1)if(m.implicitTypes[I].resolve(E))return!0;return!1}function Be(m){return m===d||m===a}function St(m){return m>=32&&m<=126||m>=161&&m<=55295&&m!==8232&&m!==8233||m>=57344&&m<=65533&&m!==i||m>=65536&&m<=1114111}function Mn(m){return St(m)&&m!==i&&m!==l&&m!==s}function Zt(m,E,I){let U=Mn(m),G=U&&!Be(m);return(I?U:U&&m!==$&&m!==me&&m!==Ce&&m!==he&&m!==yt)&&m!==f&&!(E===w&&!G)||Mn(E)&&!Be(E)&&m===f||E===w&&G}function bo(m){return St(m)&&m!==i&&!Be(m)&&m!==S&&m!==ee&&m!==w&&m!==$&&m!==me&&m!==Ce&&m!==he&&m!==yt&&m!==f&&m!==k&&m!==b&&m!==p&&m!==Ne&&m!==C&&m!==N&&m!==D&&m!==h&&m!==y&&m!==de&&m!==Ct}function Te(m){return!Be(m)&&m!==w}function Pt(m,E){let I=m.charCodeAt(E),U;return I>=55296&&I<=56319&&E+1<m.length&&(U=m.charCodeAt(E+1),U>=56320&&U<=57343)?(I-55296)*1024+U-56320+65536:I}function dr(m){return/^\n* /.test(m)}let Vi=1,wo=2,Yi=3,qi=4,cn=5;function Ji(m,E,I,U,G,W,R,Z){let te,oe=0,ie=null,ce=!1,ue=!1,dn=U!==-1,ko=-1,xo=bo(Pt(m,0))&&Te(Pt(m,m.length-1));if(E||R)for(te=0;te<m.length;oe>=65536?te+=2:te++){if(oe=Pt(m,te),!St(oe))return cn;xo=xo&&Zt(oe,ie,Z),ie=oe}else{for(te=0;te<m.length;oe>=65536?te+=2:te++){if(oe=Pt(m,te),oe===s)ce=!0,dn&&(ue=ue||te-ko-1>U&&m[ko+1]!==" ",ko=te);else if(!St(oe))return cn;xo=xo&&Zt(oe,ie,Z),ie=oe}ue=ue||dn&&te-ko-1>U&&m[ko+1]!==" "}return!ce&&!ue?xo&&!R&&!G(m)?Vi:W===_e?cn:wo:I>9&&dr(m)?cn:R?W===_e?cn:wo:ue?qi:Yi}function Xi(m,E,I,U,G){m.dump=(function(){if(E.length===0)return m.quotingType===_e?'""':"''";if(!m.noCompatMode&&($e.indexOf(E)!==-1||X.test(E)))return m.quotingType===_e?'"'+E+'"':"'"+E+"'";let W=m.indent*Math.max(1,I),R=m.lineWidth===-1?-1:Math.max(Math.min(m.lineWidth,40),m.lineWidth-W),Z=U||m.flowLevel>-1&&I>=m.flowLevel;function te(oe){return ut(m,oe)}switch(Ji(E,Z,m.indent,R,te,m.quotingType,m.forceQuotes&&!U,G)){case Vi:return E;case wo:return"'"+E.replace(/'/g,"''")+"'";case Yi:return"|"+Qi(E,m.indent)+ea(q(E,W));case qi:return">"+Qi(E,m.indent)+ea(q(ml(E,R),W));case cn:return'"'+ln(E)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function Qi(m,E){let I=dr(m)?String(E):"",U=m[m.length-1]===`
97
97
  `,W=U&&(m[m.length-2]===`
98
98
  `||m===`
99
99
  `)?"+":U?"":"-";return I+W+`
@@ -105,7 +105,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
105
105
  `+m.slice(G,W),G=W+1),R=Z;return te+=`
106
106
  `,m.length-G>E&&R>G?te+=m.slice(G,R)+`
107
107
  `+m.slice(R+1):te+=m.slice(G),te.slice(1)}function ln(m){let E="",I=0;for(let U=0;U<m.length;I>=65536?U+=2:U++){I=Pt(m,U);let G=se[I];!G&&St(I)?(E+=m[U],I>=65536&&(E+=m[U+1])):E+=G||Ge(I)}return E}function fl(m,E,I){let U="",G=m.tag;for(let W=0,R=I.length;W<R;W+=1){let Z=I[W];m.replacer&&(Z=m.replacer.call(I,String(W),Z)),(x(m,E,Z,!1,!1)||typeof Z>"u"&&x(m,E,null,!1,!1))&&(U!==""&&(U+=","+(m.condenseFlow?"":" ")),U+=m.dump)}m.tag=G,m.dump="["+U+"]"}function _o(m,E,I,U){let G="",W=m.tag;for(let R=0,Z=I.length;R<Z;R+=1){let te=I[R];m.replacer&&(te=m.replacer.call(I,String(R),te)),(x(m,E+1,te,!0,!0,!1,!0)||typeof te>"u"&&x(m,E+1,null,!0,!0,!1,!0))&&((!U||G!=="")&&(G+=Se(m,E)),m.dump&&s===m.dump.charCodeAt(0)?G+="-":G+="- ",G+=m.dump)}m.tag=W,m.dump=G||"[]"}function gl(m,E,I){let U="",G=m.tag,W=Object.keys(I);for(let R=0,Z=W.length;R<Z;R+=1){let te="";U!==""&&(te+=", "),m.condenseFlow&&(te+='"');let oe=W[R],ie=I[oe];m.replacer&&(ie=m.replacer.call(I,oe,ie)),x(m,E,oe,!1,!1)&&(m.dump.length>1024&&(te+="? "),te+=m.dump+(m.condenseFlow?'"':"")+":"+(m.condenseFlow?"":" "),x(m,E,ie,!1,!1)&&(te+=m.dump,U+=te))}m.tag=G,m.dump="{"+U+"}"}function yl(m,E,I,U){let G="",W=m.tag,R=Object.keys(I);if(m.sortKeys===!0)R.sort();else if(typeof m.sortKeys=="function")R.sort(m.sortKeys);else if(m.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let Z=0,te=R.length;Z<te;Z+=1){let oe="";(!U||G!=="")&&(oe+=Se(m,E));let ie=R[Z],ce=I[ie];if(m.replacer&&(ce=m.replacer.call(I,ie,ce)),!x(m,E+1,ie,!0,!0,!0))continue;let ue=m.tag!==null&&m.tag!=="?"||m.dump&&m.dump.length>1024;ue&&(m.dump&&s===m.dump.charCodeAt(0)?oe+="?":oe+="? "),oe+=m.dump,ue&&(oe+=Se(m,E)),x(m,E+1,ce,!0,ue)&&(m.dump&&s===m.dump.charCodeAt(0)?oe+=":":oe+=": ",oe+=m.dump,G+=oe)}m.tag=W,m.dump=G||"{}"}function u(m,E,I){let U=I?m.explicitTypes:m.implicitTypes;for(let G=0,W=U.length;G<W;G+=1){let R=U[G];if((R.instanceOf||R.predicate)&&(!R.instanceOf||typeof E=="object"&&E instanceof R.instanceOf)&&(!R.predicate||R.predicate(E))){if(I?R.multi&&R.representName?m.tag=R.representName(E):m.tag=R.tag:m.tag="?",R.represent){let Z=m.styleMap[R.tag]||R.defaultStyle,te;if(o.call(R.represent)==="[object Function]")te=R.represent(E,Z);else if(n.call(R.represent,Z))te=R.represent[Z](E,Z);else throw new t("!<"+R.tag+'> tag resolver accepts not "'+Z+'" style');m.dump=te}return!0}}return!1}function x(m,E,I,U,G,W,R){m.tag=null,m.dump=I,u(m,I,!1)||u(m,I,!0);let Z=o.call(m.dump),te=U;U&&(U=m.flowLevel<0||m.flowLevel>E);let oe=Z==="[object Object]"||Z==="[object Array]",ie,ce;if(oe&&(ie=m.duplicates.indexOf(I),ce=ie!==-1),(m.tag!==null&&m.tag!=="?"||ce||m.indent!==2&&E>0)&&(G=!1),ce&&m.usedDuplicates[ie])m.dump="*ref_"+ie;else{if(oe&&ce&&!m.usedDuplicates[ie]&&(m.usedDuplicates[ie]=!0),Z==="[object Object]")U&&Object.keys(m.dump).length!==0?(yl(m,E,m.dump,G),ce&&(m.dump="&ref_"+ie+m.dump)):(gl(m,E,m.dump),ce&&(m.dump="&ref_"+ie+" "+m.dump));else if(Z==="[object Array]")U&&m.dump.length!==0?(m.noArrayIndent&&!R&&E>0?_o(m,E-1,m.dump,G):_o(m,E,m.dump,G),ce&&(m.dump="&ref_"+ie+m.dump)):(fl(m,E,m.dump),ce&&(m.dump="&ref_"+ie+" "+m.dump));else if(Z==="[object String]")m.tag!=="?"&&Xi(m,m.dump,E,W,te);else{if(Z==="[object Undefined]")return!1;if(m.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+Z)}if(m.tag!==null&&m.tag!=="?"){let ue=encodeURI(m.tag[0]==="!"?m.tag.slice(1):m.tag).replace(/!/g,"%21");m.tag[0]==="!"?ue="!"+ue:ue.slice(0,18)==="tag:yaml.org,2002:"?ue="!!"+ue.slice(18):ue="!<"+ue+">",m.dump=ue+" "+m.dump}}return!0}function L(m,E){let I=[],U=[];j(m,I,U);let G=U.length;for(let W=0;W<G;W+=1)E.duplicates.push(I[U[W]]);E.usedDuplicates=new Array(G)}function j(m,E,I){if(m!==null&&typeof m=="object"){let U=E.indexOf(m);if(U!==-1)I.indexOf(U)===-1&&I.push(U);else if(E.push(m),Array.isArray(m))for(let G=0,W=m.length;G<W;G+=1)j(m[G],E,I);else{let G=Object.keys(m);for(let W=0,R=G.length;W<R;W+=1)j(m[G[W]],E,I)}}}function O(m,E){E=E||{};let I=new Je(E);I.noRefs||L(m,I);let U=m;return I.replacer&&(U=I.replacer.call({"":U},"",U)),x(I,0,U,!0,!0)?I.dump+`
108
- `:""}return hf.dump=O,hf}function YC(){if(kk)return Ve;kk=1;let e=ZC(),t=VC();function r(o,n){return function(){throw new Error("Function yaml."+o+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return Ve.Type=rt(),Ve.Schema=xk(),Ve.FAILSAFE_SCHEMA=Tk(),Ve.JSON_SCHEMA=Ok(),Ve.CORE_SCHEMA=Nk(),Ve.DEFAULT_SCHEMA=mf(),Ve.load=e.load,Ve.loadAll=e.loadAll,Ve.dump=t.dump,Ve.YAMLException=vi(),Ve.types={binary:Dk(),float:Pk(),map:$k(),null:Ak(),pairs:Mk(),set:Uk(),timestamp:Rk(),bool:Ik(),int:Ck(),merge:Lk(),omap:jk(),seq:Ek(),str:Sk()},Ve.safeLoad=r("safeLoad","load"),Ve.safeLoadAll=r("safeLoadAll","loadAll"),Ve.safeDump=r("safeDump","dump"),Ve}var Ve,Ys,An,X_,Km,Q_,Hm,ek,Zm,tk,Vm,nk,Ym,rk,qm,ok,Jm,ik,Xm,ak,Qm,sk,ef,ck,tf,lk,nf,dk,rf,uk,of,pk,af,hk,sf,mk,cf,fk,lf,gk,df,yk,uf,vk,pf,bk,wk,hf,_k,kk,qC,Zr,VU,YU,qU,JU,XU,QU,zk,ez,tz,nz,rz,oz,iz,az,qs=v(()=>{Ve={},Ys={},An={};hf={};qC=YC(),Zr=KC(qC),{Type:VU,Schema:YU,FAILSAFE_SCHEMA:qU,JSON_SCHEMA:JU,CORE_SCHEMA:XU,DEFAULT_SCHEMA:QU,load:zk,loadAll:ez,dump:tz,YAMLException:nz,types:rz,safeLoad:oz,safeLoadAll:iz,safeDump:az}=Zr});function De(e){let t;try{t=Zr.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=Tn.safeParse(t);if(!r.success)return{ok:!1,issues:JC(r.error)};let o=Y_(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function JC(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function bi(e){return Zr.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function Js(e,t){return Tn.parse({manifest:{schema_version:fi,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var Xs=v(()=>{"use strict";qs();en()});var ff=v(()=>{"use strict";Xs();en();Vs()});var Fk=v(()=>{"use strict"});function Gk(e,t){let r=e.backend.archetype;if(!r)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:ct(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Hr.map(o=>({section:o,status:e[o].status}))}}function Bk(e,t){let r=[];return t&&e.app.id!==t&&r.push(`This manifest is for the game "${e.app.id}", and you are editing "${t}". A manifest cannot change which game it belongs to: set app.id to "${t}", or register "${e.app.id}" as its own game.`),e.backend.archetype||r.push("This manifest declares no backend.archetype, so there is nothing to register. The control plane keys a game on its archetype and a game without one could never be deployed against."),r}var Wk=v(()=>{"use strict";Vs();Xs();en()});var Pe,Qs,Kk=v(()=>{"use strict";Pe={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",rounds:"/play/v1/games/{game}/rounds",roundsMine:"/play/v1/games/{game}/rounds/mine",nextRound:"/play/v1/games/{game}/rounds/next",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},Qs="/play"});function ec(e,t){let r=t==="won"?e.current_streak+1:t==="lost"||t==="partial"?0:e.current_streak;return{...e,played:e.played+1,won:e.won+(t==="won"?1:0),current_streak:r,max_streak:Math.max(e.max_streak,r)}}var Hk,Ft,XC,QC,eP,Sz,Vk,tP,nP,Ez,rP,$z,Tz,Az,Yk,oP,iP,Iz,aP,sP,Cz,Zk,Pz,Oz,gf=v(()=>{"use strict";He();en();Ks();Kk();Hk="2.0",Ft=c.object({server_time:c.string(),snapshot:c.string()}),XC=c.enum(["at_commit","at_settlement"]),QC=c.enum(["shared","per_player","feed"]),eP=c.object({kind:c.enum(["fixed","local_midnight","feed","continuous"]),timezone:c.string().optional()}),Sz=Ft.extend({game:c.string(),api_version:c.literal(Hk).default(Hk),archetype:$n,marking:XC,challenge_source:QC,schedule:eP,updates:c.object({transport:c.enum(["poll","socket"]),freshness_seconds:c.number().int().positive()}),display:c.record(c.string(),c.unknown()).default({}),identity:c.object({required:c.boolean(),provider:c.string(),anonymous_play:c.boolean().default(!1)}),archive:c.boolean().default(!1),capabilities:c.array(c.string()).default([])}),Vk=c.object({accepting_plays:c.boolean(),results_available:c.boolean(),solution_revealed:c.boolean(),closed:c.boolean(),optimistic_play:c.boolean().default(!1)}),tP=Ft.extend({id:c.string(),number:c.number().int().positive().optional(),origin:hi.optional(),version:c.number().int().nonnegative(),can:Vk,opens_at:c.string().optional(),locks_at:c.string().optional(),timer_seconds:c.number().int().positive().optional(),challenge_instance_id:c.string().nullable().default(null),challenge:c.record(c.string(),c.unknown()).default({}),solution:c.record(c.string(),c.unknown()).optional()}),nP=c.object({id:c.string(),number:c.number().int().positive().optional(),version:c.number().int().nonnegative(),can:Vk,opens_at:c.string().optional(),locks_at:c.string().optional(),current:c.boolean().default(!1),theme:c.string().default("")}),Ez=Ft.extend({rounds:c.array(nP)}),rP=c.object({round_id:c.string(),finished:c.boolean(),score:c.number(),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional()}),$z=Ft.extend({player_id:c.string(),played:c.array(rP)}),Tz=Ft.extend({status:c.enum(["ready","exhausted"]),round:tP.optional()}),Az=Ft.extend({token:c.string(),player_id:c.string(),kind:c.literal("anonymous")}),Yk=c.object({idempotency_key:c.string().min(8),round_version:c.number().int().nonnegative(),challenge_instance_id:c.string().nullable().default(null),payload:c.record(c.string(),c.unknown()).refine(e=>e.op===void 0||typeof e.op=="string"&&e.op.length>0,{message:"op must be a non-empty string when present",path:["op"]})}),oP=c.enum(["accepted","rejected","duplicate","stale","busy"]),iP=c.object({key:c.string(),verdict:c.enum(["correct","close","wrong","higher","lower","unknown"]),label:c.string().optional()}),Iz=Ft.extend({play_id:c.string(),outcome:oP,reason:c.string().optional(),round_version:c.number().int().nonnegative(),retry_after_seconds:c.number().int().positive().optional(),marked:c.boolean().default(!0),feedback:c.array(iP).default([]),round_state:c.lazy(()=>sP).optional()}),aP=c.object({title:c.string(),grid:c.array(c.string()).default([]),text:c.string().optional()}),sP=Ft.extend({player_id:c.string(),round_id:c.string(),started_at:c.string().optional(),attempts_used:c.number().int().nonnegative().default(0),attempts_allowed:c.number().int().nonnegative().optional(),mistakes_used:c.number().int().nonnegative().default(0),mistakes_allowed:c.number().int().nonnegative().optional(),progress:c.record(c.string(),c.unknown()).default({}),score:c.number().default(0),score_revision:c.number().int().nonnegative().default(0),finished:c.boolean().default(!1),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional(),share:aP.optional()}),Cz=Ft.extend({player_id:c.string(),display_name:c.string().optional(),played:c.number().int().nonnegative().default(0),won:c.number().int().nonnegative().default(0),current_streak:c.number().int().nonnegative().default(0),max_streak:c.number().int().nonnegative().default(0),distribution:c.record(c.string(),c.number()).default({}),constraints:c.record(c.string(),c.unknown()).default({})});Zk=c.object({rank:c.number().int().positive(),player_id:c.string(),display_name:c.string().optional(),score:c.number()}),Pz=Ft.extend({round_id:c.string().optional(),order:c.enum(["high_first","low_first"]).default("high_first"),tie_break:c.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:c.array(Zk).default([]),total:c.number().int().nonnegative().default(0),truncated:c.boolean().default(!1),me:Zk.optional()}),Oz=c.object({error:c.object({code:c.string(),message:c.string(),retryable:c.boolean()})})});function qk(e){return pP[We(e)]}function Jk(e,t){let r=e.op;return typeof r=="string"&&r.length>0?r:qk(t)?.[0]}function Xk(e,t){return qk(e)?.includes(t)??!1}function tc(e){return yf({round_id:e.round_id,round_version:e.round_version,challenge_instance_id:e.challenge_instance_id??null,payload:e.payload})}function yf(e){if(Array.isArray(e))return`[${e.map(yf).join(",")}]`;if(e&&typeof e=="object"){let t=e;return`{${Object.keys(t).filter(o=>t[o]!==void 0).sort().map(o=>`${JSON.stringify(o)}:${yf(t[o])}`).join(",")}}`}return JSON.stringify(e)??"null"}var cP,lP,dP,uP,vf,Mz,pP,Qk=v(()=>{"use strict";He();Yt();Wr();cP=c.object({op:c.string().min(1),model:c.string().min(1).optional()}).passthrough(),lP=c.object({op:c.literal("pick"),picks:c.array(c.string())}).passthrough(),dP=c.object({op:c.literal("answer"),answers:c.record(c.string(),c.union([c.string(),c.number()])).optional(),picks:c.array(c.string()).optional()}).passthrough(),uP=c.object({op:c.enum(["deal","reshuffle","lock"]),centre:c.unknown().optional(),board:c.number().int().nonnegative().optional()}).passthrough(),vf=c.object({op:c.literal(Br),model:c.literal(xn).optional(),shotIndex:c.number().int().nonnegative(),aimX:c.number().int().min(nt.aimX.min).max(nt.aimX.max),aimY:c.number().int().min(nt.aimY.min).max(nt.aimY.max),power:c.number().int().min(nt.power.min).max(nt.power.max)}).strict(),Mz=c.union([lP,dP,uP,vf,cP]),pP={hunt:["pick"],push:["pick"],group:["pick"],predict:["answer"],bingo:["deal","reshuffle","lock"],shoot:[Br],place:["place","skip"]}});function tx(e,t=new Date){let r=typeof t=="string"?Date.parse(t):t.getTime(),o,n=Number.NEGATIVE_INFINITY;for(let i of e.rounds){let a=Date.parse(i.locksAt);Number.isNaN(a)||a>n&&(n=a,o=i)}return o?n>r?{state:"live",round:o}:{state:"stale",round:o,lockedForMs:r-n}:{state:"none"}}function nx(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),r=t<1?`${Math.max(1,Math.floor(e.lockedForMs/6e4))} minutes`:t<48?`${t} hours`:`${Math.floor(t/24)} days`;return`The round this game is serving, ${e.round.label}, locked ${r} ago and nothing has replaced it. Fans are playing a closed round. Run gamestage deploy, or refresh the round, to move it on.`}function ax(e,t=nc){return e.terms?.version===t}function oc(e){let t=sx.safeParse(e.access);return t.success?t.data:"pending"}function cx(e){let t=n=>typeof n=="string"&&n.trim()?n:null,r=e.decision??null,o=r?t(r.state):null;return{workspaceId:t(e.workspaceId)??"unknown",name:t(e.name),ownerEmail:t(e.ownerEmail)??"",company:t(e.company),role:t(e.role),intent:t(e.intent),signals:t(e.signals),registeredAt:t(e.registeredAt)??"",termsVersion:t(e.termsVersion),decision:o==="approved"||o==="refused"?{state:o,at:t(r.at)??t(e.registeredAt)??"",by:t(r.by)??"unknown",reason:t(r.reason)}:null}}function lx(e){return{waiting:e.filter(t=>!t.decision).sort((t,r)=>t.registeredAt.localeCompare(r.registeredAt)),decided:e.filter(t=>t.decision).sort((t,r)=>r.decision.at.localeCompare(t.decision.at))}}function wf(e){return IP.includes(e)}function _f(e,t){return!e.prodApproval||wf(t.tier)?"dev":"prod"}function ux(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function px(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var hP,mP,ex,fP,gP,yP,bf,vP,bP,rx,wP,Kz,ox,_P,nc,rc,ix,kP,xP,sx,Hz,Zz,SP,EP,$P,Vz,Yz,qz,Jz,Xz,TP,Qz,dx,e4,AP,IP,ic=v(()=>{"use strict";He();en();$o();pi();pi();Ut();hP=c.enum(["draft","live","sleeping","throttled","expired","archived"]),mP=c.enum(["scheduled","open","locked","settled"]),ex=c.object({id:c.string(),label:c.string(),used:c.number(),limit:c.number(),unit:c.string()}),fP=c.object({id:c.string(),label:c.string(),state:mP,opensAt:c.string(),locksAt:c.string(),settledAt:c.string().nullable(),plays:c.number()}),gP=c.object({id:c.string(),name:c.string(),enabled:c.boolean(),consentRequired:c.boolean(),note:c.string()}),yP=c.object({number:c.number().int().positive(),title:c.string(),openedAt:c.string(),labels:c.array(c.string()).default([]),fromGame:c.boolean().default(!1)}),bf=c.object({at:c.string(),level:c.enum(["info","warn","error"]),roundId:c.string().nullable(),message:c.string(),dataset:c.string().optional()}),vP=c.enum(["absent","pending","ready","failed"]),bP=c.object({state:vP.default("absent"),url:c.string().nullable().default(null),regenerations:c.number().int().nonnegative().default(0),updatedAt:c.string().nullable().default(null),onProject:c.string().nullable().default(null)});rx=c.object({section:c.string(),status:Um}),wP=c.object({instanceId:c.string(),embedSlug:c.string(),template:c.string(),type:c.enum(["leaderboard","qr"]),createdAt:c.string(),consentBy:c.string()}),Kz=c.object({template:c.string().min(1),consent:c.literal(!0)}),ox=c.object({id:c.string(),name:c.string(),containerLabel:c.string().min(1).default(ur),repository:c.string().nullable(),openIssues:c.number().int().nonnegative(),issues:c.array(yP).default([]),archetype:$n,offersPrize:c.boolean().default(!1),state:hP,prodApproval:c.object({approvedAt:c.string(),approvedBy:c.string()}).nullable().default(null).optional(),archivePrefix:c.string().nullable().default(null),space:c.string().nullable().default(null).optional(),platformSpace:c.string().nullable().default(null).optional(),platformProject:c.string().nullable().default(null).optional(),platformEvent:c.string().nullable().default(null).optional(),platformElement:c.string().nullable().default(null).optional(),studioUrl:c.string().nullable().default(null).optional(),appSpec:c.object({version:c.string(),shape:c.string(),resource:c.string().nullable().default(null),specUrl:c.string().optional(),wording:c.array(c.string()).optional(),refusal:c.object({at:c.string(),reason:c.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:bP.prefault({}).optional(),graphics:c.array(wP).optional(),playgroundUrl:c.string().nullable(),playerEndpoint:c.string().nullable(),manifestRevision:c.string(),manifestSource:c.string().optional(),conformance:Sn,contentHash:c.string(),referenceDigest:c.string().optional(),referenceName:c.string().optional(),monthlyPlayers:c.number().int().nonnegative().optional(),sections:c.array(rx),meters:c.array(ex),history:c.array(ui),rounds:c.array(fP),destinations:c.array(gP),logs:c.array(bf),updatedAt:c.string()}),_P=c.object({login:c.string(),linkedAt:c.string()}),nc="2026-09-06",rc="https://gamestage.ai/terms",ix="https://gamestage.ai/stage",kP=c.object({version:c.string(),acceptedAt:c.string(),by:c.string()});xP=c.object({enabled:c.boolean().default(!1),applicationId:c.string().nullable().default(null),writeKey:c.string().nullable().default(null)}),sx=c.enum(["pending","approved","refused"]),Hz=c.enum(["manual","automatic"]);Zz=c.enum(["approved","refused"]),SP=c.object({company:c.string().trim().max(120).nullish(),role:c.string().trim().max(120).nullish(),intent:c.string().trim().max(500).nullish()});EP=c.object({id:c.string(),name:c.string(),tier:Kr,ownerEmail:c.string(),access:sx.default("pending"),profile:SP.optional(),platformSpace:c.string().optional(),liveGameAllowance:c.number(),supplierGrants:c.array(c.string()).default([]),github:_P.nullable().default(null),terms:kP.nullable().default(null),signal:xP.prefault({}),meters:c.array(ex),games:c.array(ox)}),$P=ox.extend({logs:c.array(bf).optional()}),Vz=EP.extend({games:c.array($P),gamesTotal:c.number().int().nonnegative(),archivedTotal:c.number().int().nonnegative().default(0)}),Yz=c.object({player:c.string().nullable(),control:c.string().nullable(),playground:c.string().nullable()}),qz=c.object({id:c.string(),name:c.string(),archetype:$n,repository:c.string().nullable().default(null),manifestRevision:c.string(),contentHash:c.string(),conformance:Sn,offersPrize:c.boolean().default(!1),sections:c.array(rx).default([]),containerLabel:c.string().min(1).optional()}),Jz=c.object({uploadUrl:c.string(),publicUrl:c.string(),key:c.string(),expiresInSeconds:c.number().int().positive(),cacheControl:c.string().optional(),playerApiOrigin:c.string()}),Xz=c.object({manifestRevision:c.string(),contentHash:c.string(),conformance:Sn,offersPrize:c.boolean().default(!1),round:Ze.optional(),wording:c.array(c.string()).optional(),manifestSource:c.string().optional(),notes:c.string().max(500).optional()}),TP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),since:c.string().nullable().default(null),level:bf.shape.level.nullable().default(null)}),Qz=c.enum(["access_pending","terms_not_accepted","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","operator_required","game_archived","dev_allowance_reached","art_limit_reached","art_unavailable","round_source_unreadable","round_not_seeded","delete_refused"]),dx=c.enum(["workspace.created","workspace.approved","workspace.refused","workspace.profile_updated","github.linked","github.unlinked","terms.accepted","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","round.unchanged","round.seeded","game.platform_provisioned","game.platform_provision_failed","game.app_spec_refused","art.requested","art.generated","art.failed","art.published","game.woken","game.suspended","game.throttled","game.approaching_fair_use","game.archived","game.graphic.added","game.graphic.removed","game.promoted","game.withdrawn","game.deleted","game.deleted","workspace.plan_changed","workspace.plan_refused","engine.integrity_violation","destination.changed","signal.enabled","signal.disabled"]),e4=c.object({id:c.string(),at:c.string(),action:dx,actor:c.object({kind:c.enum(["creator","operator","system"]),id:c.string(),email:c.string().nullable().default(null)}),gameId:c.string().nullable().default(null),correlationId:c.string(),detail:c.record(c.string(),c.unknown()).default({})}),AP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),action:dx.nullable().default(null),actorId:c.string().nullable().default(null),gameId:c.string().nullable().default(null),from:c.string().nullable().default(null),to:c.string().nullable().default(null)}),IP=["runtime"]});var Gt=v(()=>{"use strict"});function RP(e){return`slate-${e+1}`}function fx(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,r)=>({id:RP(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var OP,NP,mx,In=v(()=>{"use strict";He();Gt();OP=c.object({key:c.string().min(1),label:c.string().default(""),note:c.string().optional()}),NP=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(OP).min(1)}),mx=c.object({archetype:c.literal("push"),theme:c.string().default(""),prompt:c.string().default(""),target:c.number().int().positive().optional(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),slates:c.array(NP).min(1)})});var p4,ac=v(()=>{"use strict";He();Ut();In();Gt();p4=c.discriminatedUnion("archetype",[mx,jm,Mm,Zs])});var sc=v(()=>{"use strict";Ut();Gt();Wr()});var cc=v(()=>{"use strict"});var kf=v(()=>{"use strict";Yt();In();ac();sc();cc();Gt()});import{createHash as LP}from"node:crypto";function jP(e){return LP("sha256").update(e).digest("hex").slice(0,16)}function lc(e){return jP(e)}var DP,Cn,er=v(()=>{"use strict";He();Gt();Ut();DP=c.object({key:c.string().min(1),label:c.string().default(""),values:c.record(c.string(),c.number().int().nonnegative())}),Cn=c.object({corpus:c.literal("1"),measures:c.array(DP).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var MP,yx,UP,z4,vx,F4,G4,B4,xf=v(()=>{"use strict";He();MP=c.enum(["push","pull"]),yx=c.object({workspaceId:c.string().min(1),name:c.string().min(1),key:c.string().min(1),digest:c.string().regex(/^[0-9a-f]{16}$/),measures:c.array(c.string()).default([]),counts:c.record(c.string(),c.number().int().nonnegative()).default({}),bytes:c.number().int().nonnegative().default(0),origin:MP.default("push"),supplier:c.string().optional(),publishedAt:c.string().nullable().default(null),checkedAt:c.string().nullable().default(null),failing:c.boolean().default(!1),counted:c.boolean().default(!1)}),UP=c.object({gameId:c.string().min(1),gameName:c.string().default(""),pinnedDigest:c.string().nullable().default(null),stale:c.boolean().default(!1),roundIds:c.array(c.string()).default([])}),z4=c.object({dataset:yx,usedBy:c.array(UP).default([])}),vx=c.enum(["pushed","pulled","joined","refused","failed"]),F4=c.object({at:c.string(),event:vx,dataset:c.string().min(1),digest:c.string().nullable().default(null),gameId:c.string().nullable().default(null),gameName:c.string().nullable().default(null),roundId:c.string().nullable().default(null),message:c.string().default(""),ok:c.boolean().default(!0)}),G4=c.object({dataset:c.string().optional(),gameId:c.string().optional(),event:c.array(vx).optional(),since:c.string().optional(),search:c.string().optional(),before:c.string().optional(),limit:c.number().int().positive().max(500).default(100)}),B4=c.object({datasets:c.array(yx).default([]),unavailable:c.string().nullable().default(null)})});var Sf=v(()=>{"use strict";Gt();Ut()});var Ef=v(()=>{"use strict";In();Gt()});var $f=v(()=>{"use strict"});var Tf=v(()=>{"use strict";er();In();Ef();sc();$f();Gt();In();Ut();Yt();cc();ac()});function tr(e,t,r,o){let n=e[0].toUpperCase()+e.slice(1),i=(l,d,p)=>({key:`css_variables_${l}`,label:d,type:"colour",description:p,readBy:`The game's own CSS, as the --gs-${l} custom property.`,section:"Colour Palette",subsection:t,subsectionDescription:r}),a=t.toLowerCase(),s=[i(`${e}MainColour`,`${t} main colour`,"Main: the primary surface.")];return o.variant&&s.push(i(`${e}VariantColour`,`${t} variant colour`,"Variant: overlays, borders and subtle accents.")),s.push(i(`on${n}Colour`,`On ${a} colour`,"On: content sitting on the main and variant surfaces."),i(`${e}ContainerColour`,`${t} container colour`,"Container: the wrapper surface."),i(`on${n}ContainerColour`,`On ${a} container colour`,"On container: content sitting on the container surface.")),s}function Df(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)?!0:t==="analyticsUrl"}function dc(e){return Af.filter(t=>Df(e,Lf[t.key])).map(t=>t.key)}var Af,If,FP,bx,Cf,GP,Pf,BP,wx,_x,WP,KP,Of,HP,ZP,Nf,Rf,Lf,jf=v(()=>{"use strict";Af=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:`What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:`What the result screen says when a fan finished under, e.g. "{n} away from the target". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:`The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:`The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Leave it empty to keep the game's own words.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:`The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Leave it empty and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Leave it empty and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"},{key:"capped_today_note",label:"When today's plays are used up",type:"freetext",description:"What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Leave it empty to keep the game's own words.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"}],If=Af.map(e=>e.key);FP=[...tr("background","Background","The app and element background.",{variant:!1}),...tr("highlight","Highlight","The accent for primary buttons and selected states; a saturated, high-contrast hue.",{variant:!0}),...tr("positive","Positive","Positive states such as a correct answer or a successful submission; usually green.",{variant:!0}),...tr("negative","Negative","Negative states such as a wrong answer or an error; usually red.",{variant:!0}),...tr("primary","Primary","A high-contrast brand colour for the header, footer and some icons; less prominent than Highlight.",{variant:!0}),...tr("secondary","Secondary","A medium-contrast brand colour for secondary buttons and inactive states.",{variant:!0}),...tr("tertiary","Tertiary","A low-contrast colour for option buttons and most interactive UI.",{variant:!0})],bx=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Leave it empty and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"Your brand colour. It is the button a fan presses, and the accent on any Live Graphics graphic this game puts on a screen.",readBy:"The game's own page, as the --gamestage-primary custom property, and the graphic, as its accent.",section:"Brand"},{key:"logo_url",label:"Logo",type:"image",description:"Your mark, shown in the top corner of a graphic on a screen. Leave it empty and the graphic carries no logo. A transparent PNG or an SVG reads best on a dark board.",readBy:"Live Graphics, in the top corner of every graphic for this game.",section:"Brand"},{key:"brand_font_url",label:"Typeface stylesheet",type:"freetext",description:"A stylesheet that loads your typeface, such as a Google Fonts address. Leave it empty to keep the graphic's own face.",readBy:"Live Graphics, which loads it before drawing a graphic.",section:"Brand"},{key:"brand_font_family",label:"Typeface name",type:"freetext",description:`The font-family the stylesheet above provides, such as "Archivo". Set both or neither: a name with no stylesheet falls back to the graphic's own face, and a stylesheet with no name is never used.`,readBy:"Live Graphics, as the face every word on a graphic is set in.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...Af,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1},...FP],Cf=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"}],GP=[{key:"bingo_rows",label:"Board rows",type:"number",description:"How many rows a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_columns",label:"Board columns",type:"number",description:"How many columns a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_centre_mode",label:"Centre cell",type:"freetext",description:'One of "free" (marked for everybody, and does not use a card), "none" (an ordinary cell dealt like any other) or "choice" (the fan picks it). Leave it empty for "free".',readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_shuffle_allowance",label:"Reshuffles allowed",type:"number",description:"How many times a fan may redeal their board before locking it. Leave it empty for 3.",readBy:"The Engine, which refuses a reshuffle once this is spent.",section:"This edition"},{key:"bingo_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_points_per_line",label:"Points per line",type:"number",description:"Awarded once for each completed line. Leave it empty for 10.",readBy:"The Engine, when it scores a settled board.",section:"This edition"},{key:"bingo_points_for_full_board",label:"Points for a full board",type:"number",description:"Awarded once, on top of every line, when the whole board comes in. Leave it empty for 0.",readBy:"The Engine, when it scores a settled board.",section:"This edition"}],Pf=[{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1},{key:"round_timer_seconds",label:"Time limit",type:"number",description:"How many seconds a fan gets on this round, counted from when they open it: 180 for three minutes. The Engine refuses a play that arrives after it. Leave it empty for a round with no clock.",readBy:"The Engine, which refuses a late play, and the game's own page, which counts it down.",section:"Content"}],BP=[{key:"round_theme",label:"Theme",type:"freetext",description:`What this round is about, in a word or two, e.g. "The Eighties". Shown above the game's name. Leave it empty for a round that is not one of a themed set.`,readBy:"The game's own page, above the title.",section:"This round"},{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_unit",label:"Unit",type:"freetext",description:'Put in front of every number in this round, e.g. "\xA3". Leave it empty for a round that counts something with no unit, like points.',readBy:"The game's own page, in front of the target, each pick and the total.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"},{key:"entry_note",label:"Note",type:"freetext",description:'Something worth knowing about this choice, shown to a fan who went over because of it, e.g. "Six rings, six Finals MVPs." Leave it empty and the game works out its own line.',readBy:"The game's own page, on the result when this choice took a fan over.",section:"This round"}]}]}],wx="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",_x={key:"round_board",label:"The board",type:"collection",itemLabel:"{{board_item}}",description:"Everything a fan can pick from, in the order they should see it.",readBy:"The Engine, which marks against it, and the page, which draws it.",section:"This round",fieldset:[{key:"board_item",label:"Pick",type:"freetext",description:'One thing a fan can pick, exactly as they should read it, e.g. "Michael Jordan".',readBy:"The game's own page, and the Engine, which marks a pick by it.",section:"This round"}]},WP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},_x,{key:"round_targets",label:"The right answers",type:"freetext",description:`The picks that are right, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Larry Bird". ${wx}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],KP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},_x,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${wx}`,readBy:"The Engine, to mark a guess and to name a group once it is found.",section:"This round",public:!1,fieldset:[{key:"group_label",label:"What they have in common",type:"freetext",description:'Shown to a fan only once they have found this group, e.g. "1996-97 Bulls".',readBy:"The game's own page, after the group is solved.",section:"This round"},{key:"group_members",label:"Which ones",type:"freetext",description:'The picks in this group, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Scottie Pippen". Every one has to be on the board, and no pick may be in two groups.',readBy:"The Engine, to mark a guess.",section:"This round"}]}],Of=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],HP=[{key:"card_note",label:"What this card means",type:"freetext",description:'A sentence explaining the card, shown when a fan taps it. "Goal in the first 10" might be "A goal is scored by either team inside the first ten minutes." Leave it empty and tapping the card does nothing.',readBy:"The game's own page, on the back of the card a fan taps.",section:"This card",public:!0}],ZP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the goal, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the goal.",section:"This round"},{key:"shoot_shots_allowed",label:"Shots",type:"number",description:"How many penalties a fan takes, from 1 to 20. Leave it empty for 5.",readBy:"The Engine, which refuses a shot once they are spent.",section:"This round"},{key:"shoot_goals_to_win",label:"Goals to win",type:"number",description:"How many goals count as winning the shootout. Reaching it does not end play: every remaining shot still scores. Leave it empty for 3.",readBy:"The Engine, which decides won or lost after the last shot.",section:"This round"},{key:"shoot_points_per_goal",label:"Points per goal",type:"number",description:"What each goal is worth on the leaderboard. Leave it empty for 100.",readBy:"The Engine, which scores each goal.",section:"This round"},{key:"shoot_difficulty",label:"Keeper",type:"freetext",description:"How good the goalkeeper is: easy_v1, balanced_v1 or hard_v1. Leave it empty for balanced_v1.",readBy:"The Engine, which picks the keeper's speed, reach and reactions from it.",section:"This round"}],Nf={hunt:WP,push:BP,group:KP,predict:[],bingo:HP,shoot:ZP,place:[]},Rf={hunt:[],push:[],group:[],predict:[],bingo:GP,shoot:[],place:[]},Lf={display_name:"displayName",analytics_url:"analyticsUrl",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline",margin_over:"marginOver",margin_exact:"marginExact",margin_under:"marginUnder",result_over:"resultOver",result_exact:"resultExact",result_under:"resultUnder",share_over:"shareOver",share_exact:"shareExact",share_under:"shareUnder",result_bust_note:"resultBustNote",share_bust_note:"shareBustNote",capped_today_note:"cappedTodayNote",share_dare:"shareDare",result_dare:"resultDare"}});function JP(e){let t=new Map,r=o=>{for(let n of o)if(n.type==="collection"){let i=t.get(n.key);if(i&&(i.itemLabel!==n.itemLabel||JSON.stringify(i.fieldset??[])!==JSON.stringify(n.fieldset??[])))throw new Error(`The collection "${n.key}" is declared with two different shapes. One key is one declaration; its fieldset and item label must match wherever it appears.`);t.set(n.key,n),r(n.fieldset??[])}};return r(e),[...VP,...Of.map(qP),...[...t.values()].map(YP)]}function Mf(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,field:Sx(r),description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);if(i||(i={name:r.section},t.push(i)),r.subsection){let a=i.subsections??=[],s=a.find(l=>l.name===r.subsection);s||(s={name:r.subsection,...r.subsectionDescription?{description:r.subsectionDescription}:{},properties:[]},a.push(s)),s.properties.push(n)}else(i.properties??=[]).push(n)}return t}function XP(e){let t=e.archetypes.map(We);for(let i of t)if(!kx[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??If),n=bx.filter(i=>!If.includes(i.key)||o.has(i.key));return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:kx[i],content_type:xx(i),derived_from:uc[i]?.derivedFrom??"data",duration:uc[i]?.duration??{mode:"instant"},label:uc[i]?.derivedFrom==="prediction"?"{{question.text}}":e.name,custom_fields:Mf([...Pf,...Nf[We(i)]??[]]),...uc[i]?.derivedFrom==="prediction"?{label_question:i==="bingo"?"Card":"Question",label_option:i==="bingo"?"Outcome":"Option",reveal_results:{modes:["manual"],default:"manual"},correct_option:{live_update:!0},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":JP([...n,...Cf,...Pf,...Object.values(Nf).flat(),...Object.values(Rf).flat(),...Of]),"project_settings.json":{sections:Mf(n)},"event_settings.json":{sections:Mf([...Cf,...t.flatMap(i=>Rf[i]??[])])}}}function Ex(e){return XP({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var kx,xx,uc,Sx,VP,YP,qP,Uf=v(()=>{"use strict";jf();Yt();kx=jy,xx=e=>{let t=We(e);return wl[t]??`gamestage-${t.replaceAll("_","-")}-element`},uc={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},place:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}},shoot:{derivedFrom:"data",duration:{mode:"fixed",default:86400}}},Sx=e=>e.type==="collection"?e.key:e.type,VP=[{key:"colour",type:"colour"},{key:"freetext",type:"freetext",localisable:!1},{key:"number",type:"number"},{key:"image",type:"image",width:[1,2e3],height:[1,2e3],file_size:500,localisable:!1},{key:"boolean",type:"boolean"},{key:"wysiwyg",type:"wysiwyg",localisable:!1}],YP=e=>({key:e.key,type:"collection",...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,field:Sx(t),...t.description?{description:t.description}:{}}))}),qP=e=>({key:e.key,type:e.type,...e.type==="freetext"||e.type==="wysiwyg"||e.type==="image"?{localisable:!1}:{}})});var zf=v(()=>{"use strict";Yt()});var $x=v(()=>{"use strict";$o();ic();kf();er();xf();Sf();Tf();Uf();zf();ff();gf();Ut()});function Ix(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function Px(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let l=globalThis.location?.origin,d=new URL(`${o}${a}`,o.startsWith("/")?l:void 0);for(let[h,f]of Object.entries(s.query??{}))f!=null&&d.searchParams.set(h,String(f));let p;for(let h=1;h<=r;h++){let f=typeof e.token=="function"?await e.token():e.token,y;try{y=await t(d,{method:i,headers:{authorization:`Bearer ${f}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)})}catch(b){let $=b instanceof Error?b.message:String(b);if(p=new ft(0,"unreachable",`Could not reach the control plane at ${o}: ${$}. Check your connection and run the command again.`,!0),h===r)break;await Tx(Ix(h));continue}if(y.ok)return await y.json();let k=await y.json().catch(()=>({}));if(p=new ft(y.status,k.error?.code??"unknown",k.error?.message??y.statusText,k.error?.retryable??!1),!p.retryable||h===r)break;let D=Number(y.headers.get("retry-after"));await Tx(Number.isFinite(D)&&D>0?D*1e3:Ix(h))}throw p??new ft(0,"unknown","Request failed.",!1)}}function Ox(e){let t=Px(e);return{setWorkspaceAccess:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/access`,{body:{access:o,reason:n??null}}),async listAccess(){let r=await t("GET","/v1/admin/access"),o=[...r.waiting??[],...r.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(cx);return lx(o)},getWorkspace:r=>t("GET",`/v1/admin/workspaces/${encodeURIComponent(r)}`),setWorkspacePlan:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/plan`,{body:{tier:o,...n===void 0?{}:{liveGameAllowance:n}}})}}function Vr(e){let t=Px(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let l of r)Array.isArray(s[l])||(s[l]=[]);return s},n=a=>({...a,access:oc(a),terms:a.terms??null,games:(a.games??[]).map(o),gamesTotal:a.gamesTotal??(a.games??[]).length,archivedTotal:a.archivedTotal??(a.games??[]).filter(s=>s.state==="archived").length}),i=a=>({...a,workspace:{...a.workspace,access:oc(a.workspace??{}),games:(a.workspace?.games??[]).map(o)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(a){if(!(a instanceof ft)||a.status!==404)throw a;return Ax||(Ax=!0,console.warn("[control-plane] no /v1/workspace/summary, falling back to the full workspace read. If this persists the control plane is behind the site, and every Stage screen is carrying the whole workspace again.")),n(await t("GET","/v1/workspace"))}},linkGitHub:async a=>i(await t("PUT","/v1/workspace/github",{body:{login:a}})),acceptTerms:async a=>i(await t("PUT","/v1/workspace/terms",{body:{version:a}})),setPlan:async a=>i(await t("PUT","/v1/workspace/plan",{body:{tier:a}})),uploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/uploads`,{body:{filename:s}}),setPresetArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art/preset`,{body:{preset:s}}),artUploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/art/uploads`,{body:{content_type:s}}),setUploadedArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art`,{body:{url:s}}),referenceUploadTarget:(a,s)=>t("POST","/v1/reference/uploads",{body:{name:a,digest:s}}),pruneBundle:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/bundle`,{body:{filenames:s}}),async getGame(a){try{return o(await t("GET",`/v1/games/${encodeURIComponent(a)}`))}catch(s){if(s instanceof ft&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,l)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:l}}),registerGame:a=>t("POST","/v1/games",{body:a}),archiveGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/archive`),addGraphic:()=>{throw new Error("A graphic is composed by the control plane, not recorded by a client. Use composeGraphic(gameId, { template, consent: true }).")},composeGraphic:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/graphics`,{body:s}),removeGraphic:(a,s)=>t("DELETE",`/v1/games/${encodeURIComponent(a)}/graphics/${encodeURIComponent(s)}`),promoteGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/promote`),withdrawGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/withdraw`),deleteGame:a=>t("DELETE",`/v1/games/${encodeURIComponent(a)}`),deploy:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/deploy`,{body:s}),refreshRound:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/round/refresh`),async seedRound(a,s){try{return await t("PUT",`/v1/games/${encodeURIComponent(a)}/round`,{body:{round:s}})}catch(l){throw l instanceof ft&&l.status===404&&!/no such game/i.test(l.message)?new ft(404,"not_supported","This control plane cannot take a round yet. It is running a build older than this CLI, so the round has to go in through Studio until it is updated.",!1):l}},setSignal:async a=>i(await t("PUT","/v1/workspace/signal",{body:{enabled:a}})),setWorkspaceProfile:a=>t("PUT","/v1/workspace/profile",{body:a}),async getEndpoints(a){try{return await t("GET",`/v1/games/${encodeURIComponent(a)}/endpoints`)}catch(s){if(s instanceof ft&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:l}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return l},async getAuditLog(a){let{records:s}=await t("GET","/v1/audit",{query:a});return s},async listDatasets(){try{let a=await t("GET","/v1/reference/datasets");return!a||!Array.isArray(a.datasets)?{datasets:[],unavailable:Cx}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof ft&&a.status===404)return{datasets:[],unavailable:Cx};throw a}},async getDataset(a){try{let s=await t("GET",`/v1/reference/datasets/${encodeURIComponent(a)}`);return s?.dataset?s:void 0}catch(s){if(s instanceof ft&&s.status===404)return;throw s}},async getDataLog(a){try{let s=await t("GET","/v1/reference/log",{query:a});return Array.isArray(s?.lines)?s.lines:[]}catch(s){if(s instanceof ft&&s.status===404)return[];throw s}}}}var ft,Tx,Ax,Cx,Nx=v(()=>{"use strict";ic();ft=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},Tx=e=>new Promise(t=>setTimeout(t,e)),Ax=!1;Cx="This control plane is running a build older than this screen, so it cannot list datasets yet."});function QP(e){if(e.timerSeconds===void 0||!Number.isInteger(e.timerSeconds)||e.timerSeconds<=0||!e.startedAt)return;let t=Date.parse(e.startedAt);if(Number.isFinite(t))return t+e.timerSeconds*1e3}function Rx(e,t){let r=QP(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var Lx=v(()=>{"use strict"});var Dx=v(()=>{"use strict";In()});var eO,tO,nO,E6,Ff=v(()=>{"use strict";He();eO=c.discriminatedUnion("kind",[c.object({kind:c.literal("everyone")}),c.object({kind:c.literal("domains"),domains:c.array(c.string().min(1)).min(1)}),c.object({kind:c.literal("named")})]),tO=c.enum(["licensed","unofficial","creator"]),nO=c.enum(["ours","creator"]),E6=c.object({id:c.string().min(1),label:c.string().min(1),standing:tO,origin:nO,tiers:c.array(c.enum(["runtime","live","enterprise"])).min(1),produces:c.array(c.string()),note:c.string().min(1),audience:eO.optional()})});var jx=v(()=>{"use strict";Ff()});function cO(e,t){let r=e.trim().toLowerCase();return r?t.some(o=>{let n=o.trim().toLowerCase();return r===n||r.endsWith(`.${n}`)}):!1}function lO(e,t){let r=new Set((e.grants??[]).filter(o=>o.startsWith("org:")).map(o=>o.slice(4)));return t.find(o=>r.has(o.id)?!0:e.domain?cO(e.domain,o.domains):!1)}function zx(e,t){let r=e?.lastIndexOf("@")??-1,o=r>=0?e.slice(r+1).trim().toLowerCase():void 0;if(o)return lO({id:"creator",domain:o},t)}function Fx(e,t){let r={kind:"generated_proposal",tool:"org-profile",source_context:`org:${t.id} v${t.version}`};if(t.identity&&(e.identity.provider="jwt",e.identity.jwt={issuer:t.identity.issuer,jwks_uri:t.identity.jwks_uri,...t.identity.audience?{audience:t.identity.audience}:{}},e.identity.status="proposed",e.identity.provenance=[...e.identity.provenance,r]),e.identity.consent={analytics_requires_consent:t.consent.analytics_requires_consent,...t.consent.provider?{provider:t.consent.provider}:{}},t.analytics.length>0){let o=new Set(e.measurement.destinations.map(n=>n.type));for(let n of t.analytics)o.has(n.type)||(e.measurement.destinations.push({type:n.type,enabled:!0,config:n.config}),o.add(n.type));e.measurement.status="proposed",e.measurement.provenance=[...e.measurement.provenance,r]}t.brand&&(e.experience.design={...e.experience.design,...t.brand.kind==="figma"?{figma_file:t.brand.ref}:{tokens:t.brand.ref}},e.experience.status="proposed",e.experience.provenance=[...e.experience.provenance,r])}var rO,oO,iO,aO,Mx,sO,Ux,Gx,Bx=v(()=>{"use strict";He();en();rO=c.object({kind:c.enum(["figma","tokens","guidelines"]),ref:c.string().min(1)}),oO=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),iO=c.object({provider:c.string().optional(),analytics_requires_consent:c.boolean().default(!0)}),aO=c.object({type:Gm.shape.type,config:c.record(c.string(),c.string()).default({})}),Mx=c.object({kind:c.string().min(1),ref:c.string().min(1)}),sO=c.object({sink:Mx.optional(),source:Mx.optional()}),Ux=c.object({id:c.string().min(1),displayName:c.string().min(1),domains:c.array(c.string()).default([]),version:c.number().int().nonnegative().default(1),brand:rO.optional(),identity:oO.optional(),consent:iO.prefault({}),analytics:c.array(aO).default([]),data:sO.prefault({})});Gx=[Ux.parse({id:"monterosa",displayName:"Monterosa",domains:["monterosa.co.uk"],brand:{kind:"guidelines",ref:"monterosa-brand-guidelines"},identity:{issuer:"https://accounts.google.com",jwks_uri:"https://www.googleapis.com/oauth2/v3/certs"},consent:{analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{source:{kind:"slack-directory",ref:"monterosa-people"},sink:{kind:"delta-share",ref:"monterosa_gameplay"}}}),Ux.parse({id:"nba",displayName:"NBA",domains:["nba.com"],brand:{kind:"figma",ref:"nba-brand"},identity:{issuer:"https://id.nba.com",jwks_uri:"https://id.nba.com/.well-known/jwks.json"},consent:{provider:"onetrust",analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{sink:{kind:"snowflake",ref:"nba_gameplay"}}})]});var R6,Wx=v(()=>{"use strict";He();R6=c.object({org:c.string().min(1),game:c.string().min(1),player:c.string().min(1),alias:c.string().optional(),round:c.string().optional(),score:c.number(),outcome:c.string().optional(),at:c.string().min(1)})});var Kx=v(()=>{"use strict";er()});var Hx=v(()=>{"use strict";er()});function dO(e){let t;try{t=JSON.parse(e)}catch(o){return{ok:!1,reason:"That is not JSON.",detail:o instanceof Error?o.message:void 0}}let r=Cn.safeParse(t);if(!r.success){let o=r.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:o?`${o.path.join(".")||"document"}: ${o.message}`:void 0}}return{ok:!0,summary:{digest:lc(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length]))}}}async function Zx(e,t){let r=dO(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}var Vx=v(()=>{"use strict";er()});var Yx=v(()=>{"use strict"});var qx=v(()=>{"use strict"});function Gf(e){return e.sourceIp?.trim()||"unknown"}function Bf(e,t){return`${e.length}:${e}${t}`}var uO,Jx,Xx,Qx,eS,W6,K6,H6,tS=v(()=>{"use strict";uO=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},Jx=e=>typeof process>"u"?void 0:uO(process.env?.[e]),Xx=(e,t,r)=>({burst:Jx(t)??e.burst,perMinute:Jx(r)??e.perMinute}),Qx={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},eS={player:Xx(Qx.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:Xx(Qx.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},W6=eS.player,K6=eS.publicRoutes,H6=600*1e3});var nS=v(()=>{"use strict"});var ke=v(()=>{"use strict";$o();Yt();en();Lm();Vs();ff();Fk();Xs();Wk();Ks();gf();Qk();pi();Ut();ic();$x();Nx();jf();Gt();Sf();Lx();In();ac();Ef();sc();$f();Wr();Dx();er();jx();Bx();Wx();Ff();Kx();Hx();Vx();xf();cc();Tf();Yx();Uf();kf();qx();zf();tS();nS()});var Yr,nr,Fe,Tt,Bt,Oe,rS,pO,hO,mO,fO,gO,yO,wi,tn=v(()=>{"use strict";Yr=`/**
108
+ `:""}return hf.dump=O,hf}function eP(){if(kk)return Ve;kk=1;let e=XC(),t=QC();function r(o,n){return function(){throw new Error("Function yaml."+o+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return Ve.Type=rt(),Ve.Schema=xk(),Ve.FAILSAFE_SCHEMA=Tk(),Ve.JSON_SCHEMA=Ok(),Ve.CORE_SCHEMA=Nk(),Ve.DEFAULT_SCHEMA=mf(),Ve.load=e.load,Ve.loadAll=e.loadAll,Ve.dump=t.dump,Ve.YAMLException=vi(),Ve.types={binary:Dk(),float:Pk(),map:$k(),null:Ak(),pairs:Mk(),set:Uk(),timestamp:Rk(),bool:Ik(),int:Ck(),merge:Lk(),omap:jk(),seq:Ek(),str:Sk()},Ve.safeLoad=r("safeLoad","load"),Ve.safeLoadAll=r("safeLoadAll","loadAll"),Ve.safeDump=r("safeDump","dump"),Ve}var Ve,Ys,An,X_,Km,Q_,Hm,ek,Zm,tk,Vm,nk,Ym,rk,qm,ok,Jm,ik,Xm,ak,Qm,sk,ef,ck,tf,lk,nf,dk,rf,uk,of,pk,af,hk,sf,mk,cf,fk,lf,gk,df,yk,uf,vk,pf,bk,wk,hf,_k,kk,tP,Vr,qU,JU,XU,QU,ez,tz,zk,nz,rz,oz,iz,az,sz,cz,qs=v(()=>{Ve={},Ys={},An={};hf={};tP=eP(),Vr=qC(tP),{Type:qU,Schema:JU,FAILSAFE_SCHEMA:XU,JSON_SCHEMA:QU,CORE_SCHEMA:ez,DEFAULT_SCHEMA:tz,load:zk,loadAll:nz,dump:rz,YAMLException:oz,types:iz,safeLoad:az,safeLoadAll:sz,safeDump:cz}=Vr});function De(e){let t;try{t=Vr.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=Tn.safeParse(t);if(!r.success)return{ok:!1,issues:nP(r.error)};let o=Y_(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function nP(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function bi(e){return Vr.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function Js(e,t){return Tn.parse({manifest:{schema_version:fi,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var Xs=v(()=>{"use strict";qs();en()});var ff=v(()=>{"use strict";Xs();en();Vs()});var Fk=v(()=>{"use strict"});function Gk(e,t){let r=e.backend.archetype;if(!r)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:ct(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Zr.map(o=>({section:o,status:e[o].status}))}}function Bk(e,t){let r=[];return t&&e.app.id!==t&&r.push(`This manifest is for the game "${e.app.id}", and you are editing "${t}". A manifest cannot change which game it belongs to: set app.id to "${t}", or register "${e.app.id}" as its own game.`),e.backend.archetype||r.push("This manifest declares no backend.archetype, so there is nothing to register. The control plane keys a game on its archetype and a game without one could never be deployed against."),r}var Wk=v(()=>{"use strict";Vs();Xs();en()});var Pe,Qs,Kk=v(()=>{"use strict";Pe={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",rounds:"/play/v1/games/{game}/rounds",roundsMine:"/play/v1/games/{game}/rounds/mine",nextRound:"/play/v1/games/{game}/rounds/next",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},Qs="/play"});function ec(e,t){let r=t==="won"?e.current_streak+1:t==="lost"||t==="partial"?0:e.current_streak;return{...e,played:e.played+1,won:e.won+(t==="won"?1:0),current_streak:r,max_streak:Math.max(e.max_streak,r)}}var Hk,Ft,rP,oP,iP,$z,Vk,aP,sP,Tz,cP,Az,Iz,Cz,Yk,lP,dP,Pz,uP,pP,Oz,Zk,Nz,Rz,gf=v(()=>{"use strict";He();en();Ks();Kk();Hk="2.0",Ft=c.object({server_time:c.string(),snapshot:c.string()}),rP=c.enum(["at_commit","at_settlement"]),oP=c.enum(["shared","per_player","feed"]),iP=c.object({kind:c.enum(["fixed","local_midnight","feed","continuous"]),timezone:c.string().optional()}),$z=Ft.extend({game:c.string(),api_version:c.literal(Hk).default(Hk),archetype:$n,marking:rP,challenge_source:oP,schedule:iP,updates:c.object({transport:c.enum(["poll","socket"]),freshness_seconds:c.number().int().positive()}),display:c.record(c.string(),c.unknown()).default({}),identity:c.object({required:c.boolean(),provider:c.string(),anonymous_play:c.boolean().default(!1)}),archive:c.boolean().default(!1),capabilities:c.array(c.string()).default([])}),Vk=c.object({accepting_plays:c.boolean(),results_available:c.boolean(),solution_revealed:c.boolean(),closed:c.boolean(),optimistic_play:c.boolean().default(!1)}),aP=Ft.extend({id:c.string(),number:c.number().int().positive().optional(),origin:hi.optional(),version:c.number().int().nonnegative(),can:Vk,opens_at:c.string().optional(),locks_at:c.string().optional(),timer_seconds:c.number().int().positive().optional(),challenge_instance_id:c.string().nullable().default(null),challenge:c.record(c.string(),c.unknown()).default({}),solution:c.record(c.string(),c.unknown()).optional()}),sP=c.object({id:c.string(),number:c.number().int().positive().optional(),version:c.number().int().nonnegative(),can:Vk,opens_at:c.string().optional(),locks_at:c.string().optional(),current:c.boolean().default(!1),theme:c.string().default("")}),Tz=Ft.extend({rounds:c.array(sP)}),cP=c.object({round_id:c.string(),finished:c.boolean(),score:c.number(),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional()}),Az=Ft.extend({player_id:c.string(),played:c.array(cP)}),Iz=Ft.extend({status:c.enum(["ready","exhausted"]),round:aP.optional()}),Cz=Ft.extend({token:c.string(),player_id:c.string(),kind:c.literal("anonymous")}),Yk=c.object({idempotency_key:c.string().min(8),round_version:c.number().int().nonnegative(),challenge_instance_id:c.string().nullable().default(null),payload:c.record(c.string(),c.unknown()).refine(e=>e.op===void 0||typeof e.op=="string"&&e.op.length>0,{message:"op must be a non-empty string when present",path:["op"]})}),lP=c.enum(["accepted","rejected","duplicate","stale","busy"]),dP=c.object({key:c.string(),verdict:c.enum(["correct","close","wrong","higher","lower","unknown"]),label:c.string().optional()}),Pz=Ft.extend({play_id:c.string(),outcome:lP,reason:c.string().optional(),round_version:c.number().int().nonnegative(),retry_after_seconds:c.number().int().positive().optional(),marked:c.boolean().default(!0),feedback:c.array(dP).default([]),round_state:c.lazy(()=>pP).optional()}),uP=c.object({title:c.string(),grid:c.array(c.string()).default([]),text:c.string().optional()}),pP=Ft.extend({player_id:c.string(),round_id:c.string(),started_at:c.string().optional(),attempts_used:c.number().int().nonnegative().default(0),attempts_allowed:c.number().int().nonnegative().optional(),mistakes_used:c.number().int().nonnegative().default(0),mistakes_allowed:c.number().int().nonnegative().optional(),progress:c.record(c.string(),c.unknown()).default({}),score:c.number().default(0),score_revision:c.number().int().nonnegative().default(0),finished:c.boolean().default(!1),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional(),share:uP.optional()}),Oz=Ft.extend({player_id:c.string(),display_name:c.string().optional(),played:c.number().int().nonnegative().default(0),won:c.number().int().nonnegative().default(0),current_streak:c.number().int().nonnegative().default(0),max_streak:c.number().int().nonnegative().default(0),distribution:c.record(c.string(),c.number()).default({}),constraints:c.record(c.string(),c.unknown()).default({})});Zk=c.object({rank:c.number().int().positive(),player_id:c.string(),display_name:c.string().optional(),score:c.number()}),Nz=Ft.extend({round_id:c.string().optional(),order:c.enum(["high_first","low_first"]).default("high_first"),tie_break:c.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:c.array(Zk).default([]),total:c.number().int().nonnegative().default(0),truncated:c.boolean().default(!1),me:Zk.optional()}),Rz=c.object({error:c.object({code:c.string(),message:c.string(),retryable:c.boolean()})})});function qk(e){return yP[We(e)]}function Jk(e,t){let r=e.op;return typeof r=="string"&&r.length>0?r:qk(t)?.[0]}function Xk(e,t){return qk(e)?.includes(t)??!1}function tc(e){return yf({round_id:e.round_id,round_version:e.round_version,challenge_instance_id:e.challenge_instance_id??null,payload:e.payload})}function yf(e){if(Array.isArray(e))return`[${e.map(yf).join(",")}]`;if(e&&typeof e=="object"){let t=e;return`{${Object.keys(t).filter(o=>t[o]!==void 0).sort().map(o=>`${JSON.stringify(o)}:${yf(t[o])}`).join(",")}}`}return JSON.stringify(e)??"null"}var hP,mP,fP,gP,vf,zz,yP,Qk=v(()=>{"use strict";He();Yt();Kr();hP=c.object({op:c.string().min(1),model:c.string().min(1).optional()}).passthrough(),mP=c.object({op:c.literal("pick"),picks:c.array(c.string())}).passthrough(),fP=c.object({op:c.literal("answer"),answers:c.record(c.string(),c.union([c.string(),c.number()])).optional(),picks:c.array(c.string()).optional()}).passthrough(),gP=c.object({op:c.enum(["deal","reshuffle","lock"]),centre:c.unknown().optional(),board:c.number().int().nonnegative().optional()}).passthrough(),vf=c.object({op:c.literal(Wr),model:c.literal(xn).optional(),shotIndex:c.number().int().nonnegative(),aimX:c.number().int().min(nt.aimX.min).max(nt.aimX.max),aimY:c.number().int().min(nt.aimY.min).max(nt.aimY.max),power:c.number().int().min(nt.power.min).max(nt.power.max)}).strict(),zz=c.union([mP,fP,gP,vf,hP]),yP={hunt:["pick"],push:["pick"],group:["pick"],predict:["answer"],bingo:["deal","reshuffle","lock"],shoot:[Wr],place:["place","skip"]}});function tx(e,t=new Date){let r=typeof t=="string"?Date.parse(t):t.getTime(),o,n=Number.NEGATIVE_INFINITY;for(let i of e.rounds){let a=Date.parse(i.locksAt);Number.isNaN(a)||a>n&&(n=a,o=i)}return o?n>r?{state:"live",round:o}:{state:"stale",round:o,lockedForMs:r-n}:{state:"none"}}function nx(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),r=t<1?`${Math.max(1,Math.floor(e.lockedForMs/6e4))} minutes`:t<48?`${t} hours`:`${Math.floor(t/24)} days`;return`The round this game is serving, ${e.round.label}, locked ${r} ago and nothing has replaced it. Fans are playing a closed round. Run gamestage deploy, or refresh the round, to move it on.`}function ax(e,t=nc){return e.terms?.version===t}function oc(e){let t=sx.safeParse(e.access);return t.success?t.data:"pending"}function cx(e){let t=n=>typeof n=="string"&&n.trim()?n:null,r=e.decision??null,o=r?t(r.state):null;return{workspaceId:t(e.workspaceId)??"unknown",name:t(e.name),ownerEmail:t(e.ownerEmail)??"",company:t(e.company),role:t(e.role),intent:t(e.intent),signals:t(e.signals),registeredAt:t(e.registeredAt)??"",termsVersion:t(e.termsVersion),decision:o==="approved"||o==="refused"?{state:o,at:t(r.at)??t(e.registeredAt)??"",by:t(r.by)??"unknown",reason:t(r.reason)}:null}}function lx(e){return{waiting:e.filter(t=>!t.decision).sort((t,r)=>t.registeredAt.localeCompare(r.registeredAt)),decided:e.filter(t=>t.decision).sort((t,r)=>r.decision.at.localeCompare(t.decision.at))}}function wf(e){return RP.includes(e)}function _f(e,t){return!e.prodApproval||wf(t.tier)?"dev":"prod"}function ux(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function px(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var vP,bP,ex,wP,_P,kP,bf,xP,SP,rx,EP,Zz,ox,$P,nc,rc,ix,TP,AP,sx,Vz,Yz,IP,CP,PP,qz,Jz,Xz,Qz,e4,OP,t4,dx,n4,NP,RP,ic=v(()=>{"use strict";He();en();$o();pi();pi();Ut();vP=c.enum(["draft","live","sleeping","throttled","expired","archived"]),bP=c.enum(["scheduled","open","locked","settled"]),ex=c.object({id:c.string(),label:c.string(),used:c.number(),limit:c.number(),unit:c.string()}),wP=c.object({id:c.string(),label:c.string(),state:bP,opensAt:c.string(),locksAt:c.string(),settledAt:c.string().nullable(),plays:c.number()}),_P=c.object({id:c.string(),name:c.string(),enabled:c.boolean(),consentRequired:c.boolean(),note:c.string()}),kP=c.object({number:c.number().int().positive(),title:c.string(),openedAt:c.string(),labels:c.array(c.string()).default([]),fromGame:c.boolean().default(!1)}),bf=c.object({at:c.string(),level:c.enum(["info","warn","error"]),roundId:c.string().nullable(),message:c.string(),dataset:c.string().optional()}),xP=c.enum(["absent","pending","ready","failed"]),SP=c.object({state:xP.default("absent"),url:c.string().nullable().default(null),regenerations:c.number().int().nonnegative().default(0),updatedAt:c.string().nullable().default(null),onProject:c.string().nullable().default(null)});rx=c.object({section:c.string(),status:Um}),EP=c.object({instanceId:c.string(),embedSlug:c.string(),template:c.string(),type:c.enum(["leaderboard","qr"]),createdAt:c.string(),consentBy:c.string()}),Zz=c.object({template:c.string().min(1),consent:c.literal(!0)}),ox=c.object({id:c.string(),name:c.string(),containerLabel:c.string().min(1).default(pr),repository:c.string().nullable(),openIssues:c.number().int().nonnegative(),issues:c.array(kP).default([]),archetype:$n,offersPrize:c.boolean().default(!1),state:vP,prodApproval:c.object({approvedAt:c.string(),approvedBy:c.string()}).nullable().default(null).optional(),archivePrefix:c.string().nullable().default(null),space:c.string().nullable().default(null).optional(),platformSpace:c.string().nullable().default(null).optional(),platformProject:c.string().nullable().default(null).optional(),platformEvent:c.string().nullable().default(null).optional(),platformElement:c.string().nullable().default(null).optional(),studioUrl:c.string().nullable().default(null).optional(),appSpec:c.object({version:c.string(),shape:c.string(),resource:c.string().nullable().default(null),specUrl:c.string().optional(),wording:c.array(c.string()).optional(),refusal:c.object({at:c.string(),reason:c.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:SP.prefault({}).optional(),graphics:c.array(EP).optional(),playgroundUrl:c.string().nullable(),playerEndpoint:c.string().nullable(),manifestRevision:c.string(),manifestSource:c.string().optional(),conformance:Sn,contentHash:c.string(),referenceDigest:c.string().optional(),referenceName:c.string().optional(),monthlyPlayers:c.number().int().nonnegative().optional(),sections:c.array(rx),meters:c.array(ex),history:c.array(ui),rounds:c.array(wP),destinations:c.array(_P),logs:c.array(bf),updatedAt:c.string()}),$P=c.object({login:c.string(),linkedAt:c.string()}),nc="2026-09-06",rc="https://gamestage.ai/terms",ix="https://gamestage.ai/stage",TP=c.object({version:c.string(),acceptedAt:c.string(),by:c.string()});AP=c.object({enabled:c.boolean().default(!1),applicationId:c.string().nullable().default(null),writeKey:c.string().nullable().default(null)}),sx=c.enum(["pending","approved","refused"]),Vz=c.enum(["manual","automatic"]);Yz=c.enum(["approved","refused"]),IP=c.object({company:c.string().trim().max(120).nullish(),role:c.string().trim().max(120).nullish(),intent:c.string().trim().max(500).nullish()});CP=c.object({id:c.string(),name:c.string(),tier:Hr,ownerEmail:c.string(),access:sx.default("pending"),profile:IP.optional(),platformSpace:c.string().optional(),liveGameAllowance:c.number(),supplierGrants:c.array(c.string()).default([]),github:$P.nullable().default(null),terms:TP.nullable().default(null),signal:AP.prefault({}),meters:c.array(ex),games:c.array(ox)}),PP=ox.extend({logs:c.array(bf).optional()}),qz=CP.extend({games:c.array(PP),gamesTotal:c.number().int().nonnegative(),archivedTotal:c.number().int().nonnegative().default(0)}),Jz=c.object({player:c.string().nullable(),control:c.string().nullable(),playground:c.string().nullable()}),Xz=c.object({id:c.string(),name:c.string(),archetype:$n,repository:c.string().nullable().default(null),manifestRevision:c.string(),contentHash:c.string(),conformance:Sn,offersPrize:c.boolean().default(!1),sections:c.array(rx).default([]),containerLabel:c.string().min(1).optional()}),Qz=c.object({uploadUrl:c.string(),publicUrl:c.string(),key:c.string(),expiresInSeconds:c.number().int().positive(),cacheControl:c.string().optional(),playerApiOrigin:c.string()}),e4=c.object({manifestRevision:c.string(),contentHash:c.string(),conformance:Sn,offersPrize:c.boolean().default(!1),round:Ze.optional(),wording:c.array(c.string()).optional(),manifestSource:c.string().optional(),notes:c.string().max(500).optional()}),OP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),since:c.string().nullable().default(null),level:bf.shape.level.nullable().default(null)}),t4=c.enum(["access_pending","terms_not_accepted","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","operator_required","game_archived","dev_allowance_reached","art_limit_reached","art_unavailable","round_source_unreadable","round_not_seeded","delete_refused"]),dx=c.enum(["workspace.created","workspace.approved","workspace.refused","workspace.profile_updated","github.linked","github.unlinked","terms.accepted","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","round.unchanged","round.seeded","game.platform_provisioned","game.platform_provision_failed","game.app_spec_refused","art.requested","art.generated","art.failed","art.published","game.woken","game.suspended","game.throttled","game.approaching_fair_use","game.archived","game.graphic.added","game.graphic.removed","game.promoted","game.withdrawn","game.deleted","game.deleted","workspace.plan_changed","workspace.plan_refused","engine.integrity_violation","destination.changed","signal.enabled","signal.disabled"]),n4=c.object({id:c.string(),at:c.string(),action:dx,actor:c.object({kind:c.enum(["creator","operator","system"]),id:c.string(),email:c.string().nullable().default(null)}),gameId:c.string().nullable().default(null),correlationId:c.string(),detail:c.record(c.string(),c.unknown()).default({})}),NP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),action:dx.nullable().default(null),actorId:c.string().nullable().default(null),gameId:c.string().nullable().default(null),from:c.string().nullable().default(null),to:c.string().nullable().default(null)}),RP=["runtime"]});var Gt=v(()=>{"use strict"});function UP(e){return`slate-${e+1}`}function fx(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,r)=>({id:UP(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var jP,MP,mx,In=v(()=>{"use strict";He();Gt();jP=c.object({key:c.string().min(1),label:c.string().default(""),note:c.string().optional()}),MP=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(jP).min(1)}),mx=c.object({archetype:c.literal("push"),theme:c.string().default(""),prompt:c.string().default(""),target:c.number().int().positive().optional(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),slates:c.array(MP).min(1)})});var m4,ac=v(()=>{"use strict";He();Ut();In();Gt();m4=c.discriminatedUnion("archetype",[mx,jm,Mm,Zs])});var sc=v(()=>{"use strict";Ut();Gt();Kr()});var cc=v(()=>{"use strict"});var kf=v(()=>{"use strict";Yt();In();ac();sc();cc();Gt()});import{createHash as zP}from"node:crypto";function GP(e){return zP("sha256").update(e).digest("hex").slice(0,16)}function lc(e){return GP(e)}var FP,Cn,er=v(()=>{"use strict";He();Gt();Ut();FP=c.object({key:c.string().min(1),label:c.string().default(""),values:c.record(c.string(),c.number().int().nonnegative())}),Cn=c.object({corpus:c.literal("1"),measures:c.array(FP).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var BP,yx,WP,G4,vx,B4,W4,K4,xf=v(()=>{"use strict";He();BP=c.enum(["push","pull"]),yx=c.object({workspaceId:c.string().min(1),name:c.string().min(1),key:c.string().min(1),digest:c.string().regex(/^[0-9a-f]{16}$/),measures:c.array(c.string()).default([]),counts:c.record(c.string(),c.number().int().nonnegative()).default({}),bytes:c.number().int().nonnegative().default(0),origin:BP.default("push"),supplier:c.string().optional(),publishedAt:c.string().nullable().default(null),checkedAt:c.string().nullable().default(null),failing:c.boolean().default(!1),counted:c.boolean().default(!1)}),WP=c.object({gameId:c.string().min(1),gameName:c.string().default(""),pinnedDigest:c.string().nullable().default(null),stale:c.boolean().default(!1),roundIds:c.array(c.string()).default([])}),G4=c.object({dataset:yx,usedBy:c.array(WP).default([])}),vx=c.enum(["pushed","pulled","joined","refused","failed"]),B4=c.object({at:c.string(),event:vx,dataset:c.string().min(1),digest:c.string().nullable().default(null),gameId:c.string().nullable().default(null),gameName:c.string().nullable().default(null),roundId:c.string().nullable().default(null),message:c.string().default(""),ok:c.boolean().default(!0)}),W4=c.object({dataset:c.string().optional(),gameId:c.string().optional(),event:c.array(vx).optional(),since:c.string().optional(),search:c.string().optional(),before:c.string().optional(),limit:c.number().int().positive().max(500).default(100)}),K4=c.object({datasets:c.array(yx).default([]),unavailable:c.string().nullable().default(null)})});var Sf=v(()=>{"use strict";Gt();Ut()});var Ef=v(()=>{"use strict";In();Gt()});var $f=v(()=>{"use strict"});var Tf=v(()=>{"use strict";er();In();Ef();sc();$f();Gt();In();Ut();Yt();cc();ac()});function tr(e,t,r,o){let n=e[0].toUpperCase()+e.slice(1),i=(l,d,p)=>({key:`css_variables_${l}`,label:d,type:"colour",description:p,readBy:`The game's own CSS, as the --gs-${l} custom property.`,section:"Colour Palette",subsection:t,subsectionDescription:r}),a=t.toLowerCase(),s=[i(`${e}MainColour`,`${t} main colour`,"Main: the primary surface.")];return o.variant&&s.push(i(`${e}VariantColour`,`${t} variant colour`,"Variant: overlays, borders and subtle accents.")),s.push(i(`on${n}Colour`,`On ${a} colour`,"On: content sitting on the main and variant surfaces."),i(`${e}ContainerColour`,`${t} container colour`,"Container: the wrapper surface."),i(`on${n}ContainerColour`,`On ${a} container colour`,"On container: content sitting on the container surface.")),s}function Df(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)?!0:t==="analyticsUrl"}function dc(e){return Af.filter(t=>Df(e,Lf[t.key])).map(t=>t.key)}var Af,If,HP,bx,Cf,ZP,Pf,VP,wx,_x,YP,qP,Of,JP,XP,Nf,Rf,Lf,jf=v(()=>{"use strict";Af=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:`What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:`What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:`What the result screen says when a fan finished under, e.g. "{n} away from the target". Leave it empty to keep the game's own words.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:`The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:`The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Leave it empty to keep the game's own words.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:`The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Leave it empty to keep the game's own words.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Leave it empty and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Leave it empty and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"},{key:"capped_today_note",label:"When today's plays are used up",type:"freetext",description:"What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Leave it empty to keep the game's own words.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"}],If=Af.map(e=>e.key);HP=[...tr("background","Background","The app and element background.",{variant:!1}),...tr("highlight","Highlight","The accent for primary buttons and selected states; a saturated, high-contrast hue.",{variant:!0}),...tr("positive","Positive","Positive states such as a correct answer or a successful submission; usually green.",{variant:!0}),...tr("negative","Negative","Negative states such as a wrong answer or an error; usually red.",{variant:!0}),...tr("primary","Primary","A high-contrast brand colour for the header, footer and some icons; less prominent than Highlight.",{variant:!0}),...tr("secondary","Secondary","A medium-contrast brand colour for secondary buttons and inactive states.",{variant:!0}),...tr("tertiary","Tertiary","A low-contrast colour for option buttons and most interactive UI.",{variant:!0})],bx=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Leave it empty and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"Your brand colour. It is the button a fan presses, and the accent on any Live Graphics graphic this game puts on a screen.",readBy:"The game's own page, as the --gamestage-primary custom property, and the graphic, as its accent.",section:"Brand"},{key:"logo_url",label:"Logo",type:"image",description:"Your mark, shown in the top corner of a graphic on a screen. Leave it empty and the graphic carries no logo. A transparent PNG or an SVG reads best on a dark board.",readBy:"Live Graphics, in the top corner of every graphic for this game.",section:"Brand"},{key:"brand_font_url",label:"Typeface stylesheet",type:"freetext",description:"A stylesheet that loads your typeface, such as a Google Fonts address. Leave it empty to keep the graphic's own face.",readBy:"Live Graphics, which loads it before drawing a graphic.",section:"Brand"},{key:"brand_font_family",label:"Typeface name",type:"freetext",description:`The font-family the stylesheet above provides, such as "Archivo". Set both or neither: a name with no stylesheet falls back to the graphic's own face, and a stylesheet with no name is never used.`,readBy:"Live Graphics, as the face every word on a graphic is set in.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...Af,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1},...HP],Cf=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"}],ZP=[{key:"bingo_rows",label:"Board rows",type:"number",description:"How many rows a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_columns",label:"Board columns",type:"number",description:"How many columns a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_centre_mode",label:"Centre cell",type:"freetext",description:'One of "free" (marked for everybody, and does not use a card), "none" (an ordinary cell dealt like any other) or "choice" (the fan picks it). Leave it empty for "free".',readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_shuffle_allowance",label:"Reshuffles allowed",type:"number",description:"How many times a fan may redeal their board before locking it. Leave it empty for 3.",readBy:"The Engine, which refuses a reshuffle once this is spent.",section:"This edition"},{key:"bingo_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_points_per_line",label:"Points per line",type:"number",description:"Awarded once for each completed line. Leave it empty for 10.",readBy:"The Engine, when it scores a settled board.",section:"This edition"},{key:"bingo_points_for_full_board",label:"Points for a full board",type:"number",description:"Awarded once, on top of every line, when the whole board comes in. Leave it empty for 0.",readBy:"The Engine, when it scores a settled board.",section:"This edition"}],Pf=[{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1},{key:"round_timer_seconds",label:"Time limit",type:"number",description:"How many seconds a fan gets on this round, counted from when they open it: 180 for three minutes. The Engine refuses a play that arrives after it. Leave it empty for a round with no clock.",readBy:"The Engine, which refuses a late play, and the game's own page, which counts it down.",section:"Content"}],VP=[{key:"round_theme",label:"Theme",type:"freetext",description:`What this round is about, in a word or two, e.g. "The Eighties". Shown above the game's name. Leave it empty for a round that is not one of a themed set.`,readBy:"The game's own page, above the title.",section:"This round"},{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_unit",label:"Unit",type:"freetext",description:'Put in front of every number in this round, e.g. "\xA3". Leave it empty for a round that counts something with no unit, like points.',readBy:"The game's own page, in front of the target, each pick and the total.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"},{key:"entry_note",label:"Note",type:"freetext",description:'Something worth knowing about this choice, shown to a fan who went over because of it, e.g. "Six rings, six Finals MVPs." Leave it empty and the game works out its own line.',readBy:"The game's own page, on the result when this choice took a fan over.",section:"This round"}]}]}],wx="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",_x={key:"round_board",label:"The board",type:"collection",itemLabel:"{{board_item}}",description:"Everything a fan can pick from, in the order they should see it.",readBy:"The Engine, which marks against it, and the page, which draws it.",section:"This round",fieldset:[{key:"board_item",label:"Pick",type:"freetext",description:'One thing a fan can pick, exactly as they should read it, e.g. "Michael Jordan".',readBy:"The game's own page, and the Engine, which marks a pick by it.",section:"This round"}]},YP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},_x,{key:"round_targets",label:"The right answers",type:"freetext",description:`The picks that are right, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Larry Bird". ${wx}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],qP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},_x,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${wx}`,readBy:"The Engine, to mark a guess and to name a group once it is found.",section:"This round",public:!1,fieldset:[{key:"group_label",label:"What they have in common",type:"freetext",description:'Shown to a fan only once they have found this group, e.g. "1996-97 Bulls".',readBy:"The game's own page, after the group is solved.",section:"This round"},{key:"group_members",label:"Which ones",type:"freetext",description:'The picks in this group, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Scottie Pippen". Every one has to be on the board, and no pick may be in two groups.',readBy:"The Engine, to mark a guess.",section:"This round"}]}],Of=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],JP=[{key:"card_note",label:"What this card means",type:"freetext",description:'A sentence explaining the card, shown when a fan taps it. "Goal in the first 10" might be "A goal is scored by either team inside the first ten minutes." Leave it empty and tapping the card does nothing.',readBy:"The game's own page, on the back of the card a fan taps.",section:"This card",public:!0}],XP=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the goal, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the goal.",section:"This round"},{key:"shoot_shots_allowed",label:"Shots",type:"number",description:"How many penalties a fan takes, from 1 to 20. Leave it empty for 5.",readBy:"The Engine, which refuses a shot once they are spent.",section:"This round"},{key:"shoot_goals_to_win",label:"Goals to win",type:"number",description:"How many goals count as winning the shootout. Reaching it does not end play: every remaining shot still scores. Leave it empty for 3.",readBy:"The Engine, which decides won or lost after the last shot.",section:"This round"},{key:"shoot_points_per_goal",label:"Points per goal",type:"number",description:"What each goal is worth on the leaderboard. Leave it empty for 100.",readBy:"The Engine, which scores each goal.",section:"This round"},{key:"shoot_difficulty",label:"Keeper",type:"freetext",description:"How good the goalkeeper is: easy_v1, balanced_v1 or hard_v1. Leave it empty for balanced_v1.",readBy:"The Engine, which picks the keeper's speed, reach and reactions from it.",section:"This round"}],Nf={hunt:YP,push:VP,group:qP,predict:[],bingo:JP,shoot:XP,place:[]},Rf={hunt:[],push:[],group:[],predict:[],bingo:ZP,shoot:[],place:[]},Lf={display_name:"displayName",analytics_url:"analyticsUrl",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline",margin_over:"marginOver",margin_exact:"marginExact",margin_under:"marginUnder",result_over:"resultOver",result_exact:"resultExact",result_under:"resultUnder",share_over:"shareOver",share_exact:"shareExact",share_under:"shareUnder",result_bust_note:"resultBustNote",share_bust_note:"shareBustNote",capped_today_note:"cappedTodayNote",share_dare:"shareDare",result_dare:"resultDare"}});function nO(e){let t=new Map,r=o=>{for(let n of o)if(n.type==="collection"){let i=t.get(n.key);if(i&&(i.itemLabel!==n.itemLabel||JSON.stringify(i.fieldset??[])!==JSON.stringify(n.fieldset??[])))throw new Error(`The collection "${n.key}" is declared with two different shapes. One key is one declaration; its fieldset and item label must match wherever it appears.`);t.set(n.key,n),r(n.fieldset??[])}};return r(e),[...QP,...Of.map(tO),...[...t.values()].map(eO)]}function Mf(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,field:Sx(r),description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);if(i||(i={name:r.section},t.push(i)),r.subsection){let a=i.subsections??=[],s=a.find(l=>l.name===r.subsection);s||(s={name:r.subsection,...r.subsectionDescription?{description:r.subsectionDescription}:{},properties:[]},a.push(s)),s.properties.push(n)}else(i.properties??=[]).push(n)}return t}function rO(e){let t=e.archetypes.map(We);for(let i of t)if(!kx[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??If),n=bx.filter(i=>!If.includes(i.key)||o.has(i.key));return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:kx[i],content_type:xx(i),derived_from:uc[i]?.derivedFrom??"data",duration:uc[i]?.duration??{mode:"instant"},label:uc[i]?.derivedFrom==="prediction"?"{{question.text}}":e.name,custom_fields:Mf([...Pf,...Nf[We(i)]??[]]),...uc[i]?.derivedFrom==="prediction"?{label_question:i==="bingo"?"Card":"Question",label_option:i==="bingo"?"Outcome":"Option",reveal_results:{modes:["manual"],default:"manual"},correct_option:{live_update:!0},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":nO([...n,...Cf,...Pf,...Object.values(Nf).flat(),...Object.values(Rf).flat(),...Of]),"project_settings.json":{sections:Mf(n)},"event_settings.json":{sections:Mf([...Cf,...t.flatMap(i=>Rf[i]??[])])}}}function Ex(e){return rO({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var kx,xx,uc,Sx,QP,eO,tO,Uf=v(()=>{"use strict";jf();Yt();kx=jy,xx=e=>{let t=We(e);return wl[t]??`gamestage-${t.replaceAll("_","-")}-element`},uc={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},place:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}},shoot:{derivedFrom:"data",duration:{mode:"fixed",default:86400}}},Sx=e=>e.type==="collection"?e.key:e.type,QP=[{key:"colour",type:"colour"},{key:"freetext",type:"freetext",localisable:!1},{key:"number",type:"number"},{key:"image",type:"image",width:[1,2e3],height:[1,2e3],file_size:500,localisable:!1},{key:"boolean",type:"boolean"},{key:"wysiwyg",type:"wysiwyg",localisable:!1}],eO=e=>({key:e.key,type:"collection",...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,field:Sx(t),...t.description?{description:t.description}:{}}))}),tO=e=>({key:e.key,type:e.type,...e.type==="freetext"||e.type==="wysiwyg"||e.type==="image"?{localisable:!1}:{}})});var zf=v(()=>{"use strict";Yt()});var $x=v(()=>{"use strict";$o();ic();kf();er();xf();Sf();Tf();Uf();zf();ff();gf();Ut()});function Ix(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function Px(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let l=globalThis.location?.origin,d=new URL(`${o}${a}`,o.startsWith("/")?l:void 0);for(let[h,f]of Object.entries(s.query??{}))f!=null&&d.searchParams.set(h,String(f));let p;for(let h=1;h<=r;h++){let f=typeof e.token=="function"?await e.token():e.token,y;try{y=await t(d,{method:i,headers:{authorization:`Bearer ${f}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)})}catch(b){let $=b instanceof Error?b.message:String(b);if(p=new ft(0,"unreachable",`Could not reach the control plane at ${o}: ${$}. Check your connection and run the command again.`,!0),h===r)break;await Tx(Ix(h));continue}if(y.ok)return await y.json();let k=await y.json().catch(()=>({}));if(p=new ft(y.status,k.error?.code??"unknown",k.error?.message??y.statusText,k.error?.retryable??!1),!p.retryable||h===r)break;let D=Number(y.headers.get("retry-after"));await Tx(Number.isFinite(D)&&D>0?D*1e3:Ix(h))}throw p??new ft(0,"unknown","Request failed.",!1)}}function Ox(e){let t=Px(e);return{setWorkspaceAccess:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/access`,{body:{access:o,reason:n??null}}),async listAccess(){let r=await t("GET","/v1/admin/access"),o=[...r.waiting??[],...r.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(cx);return lx(o)},getWorkspace:r=>t("GET",`/v1/admin/workspaces/${encodeURIComponent(r)}`),setWorkspacePlan:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/plan`,{body:{tier:o,...n===void 0?{}:{liveGameAllowance:n}}})}}function Yr(e){let t=Px(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let l of r)Array.isArray(s[l])||(s[l]=[]);return s},n=a=>({...a,access:oc(a),terms:a.terms??null,games:(a.games??[]).map(o),gamesTotal:a.gamesTotal??(a.games??[]).length,archivedTotal:a.archivedTotal??(a.games??[]).filter(s=>s.state==="archived").length}),i=a=>({...a,workspace:{...a.workspace,access:oc(a.workspace??{}),games:(a.workspace?.games??[]).map(o)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(a){if(!(a instanceof ft)||a.status!==404)throw a;return Ax||(Ax=!0,console.warn("[control-plane] no /v1/workspace/summary, falling back to the full workspace read. If this persists the control plane is behind the site, and every Stage screen is carrying the whole workspace again.")),n(await t("GET","/v1/workspace"))}},linkGitHub:async a=>i(await t("PUT","/v1/workspace/github",{body:{login:a}})),acceptTerms:async a=>i(await t("PUT","/v1/workspace/terms",{body:{version:a}})),setPlan:async a=>i(await t("PUT","/v1/workspace/plan",{body:{tier:a}})),uploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/uploads`,{body:{filename:s}}),setPresetArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art/preset`,{body:{preset:s}}),artUploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/art/uploads`,{body:{content_type:s}}),setUploadedArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art`,{body:{url:s}}),referenceUploadTarget:(a,s)=>t("POST","/v1/reference/uploads",{body:{name:a,digest:s}}),pruneBundle:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/bundle`,{body:{filenames:s}}),async getGame(a){try{return o(await t("GET",`/v1/games/${encodeURIComponent(a)}`))}catch(s){if(s instanceof ft&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,l)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:l}}),registerGame:a=>t("POST","/v1/games",{body:a}),archiveGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/archive`),addGraphic:()=>{throw new Error("A graphic is composed by the control plane, not recorded by a client. Use composeGraphic(gameId, { template, consent: true }).")},composeGraphic:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/graphics`,{body:s}),removeGraphic:(a,s)=>t("DELETE",`/v1/games/${encodeURIComponent(a)}/graphics/${encodeURIComponent(s)}`),promoteGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/promote`),withdrawGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/withdraw`),deleteGame:a=>t("DELETE",`/v1/games/${encodeURIComponent(a)}`),deploy:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/deploy`,{body:s}),refreshRound:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/round/refresh`),async seedRound(a,s){try{return await t("PUT",`/v1/games/${encodeURIComponent(a)}/round`,{body:{round:s}})}catch(l){throw l instanceof ft&&l.status===404&&!/no such game/i.test(l.message)?new ft(404,"not_supported","This control plane cannot take a round yet. It is running a build older than this CLI, so the round has to go in through Studio until it is updated.",!1):l}},setSignal:async a=>i(await t("PUT","/v1/workspace/signal",{body:{enabled:a}})),setWorkspaceProfile:a=>t("PUT","/v1/workspace/profile",{body:a}),async getEndpoints(a){try{return await t("GET",`/v1/games/${encodeURIComponent(a)}/endpoints`)}catch(s){if(s instanceof ft&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:l}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return l},async getAuditLog(a){let{records:s}=await t("GET","/v1/audit",{query:a});return s},async listDatasets(){try{let a=await t("GET","/v1/reference/datasets");return!a||!Array.isArray(a.datasets)?{datasets:[],unavailable:Cx}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof ft&&a.status===404)return{datasets:[],unavailable:Cx};throw a}},async getDataset(a){try{let s=await t("GET",`/v1/reference/datasets/${encodeURIComponent(a)}`);return s?.dataset?s:void 0}catch(s){if(s instanceof ft&&s.status===404)return;throw s}},async getDataLog(a){try{let s=await t("GET","/v1/reference/log",{query:a});return Array.isArray(s?.lines)?s.lines:[]}catch(s){if(s instanceof ft&&s.status===404)return[];throw s}}}}var ft,Tx,Ax,Cx,Nx=v(()=>{"use strict";ic();ft=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},Tx=e=>new Promise(t=>setTimeout(t,e)),Ax=!1;Cx="This control plane is running a build older than this screen, so it cannot list datasets yet."});function oO(e){if(e.timerSeconds===void 0||!Number.isInteger(e.timerSeconds)||e.timerSeconds<=0||!e.startedAt)return;let t=Date.parse(e.startedAt);if(Number.isFinite(t))return t+e.timerSeconds*1e3}function Rx(e,t){let r=oO(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var Lx=v(()=>{"use strict"});var Dx=v(()=>{"use strict";In()});var iO,aO,sO,T6,Ff=v(()=>{"use strict";He();iO=c.discriminatedUnion("kind",[c.object({kind:c.literal("everyone")}),c.object({kind:c.literal("domains"),domains:c.array(c.string().min(1)).min(1)}),c.object({kind:c.literal("named")})]),aO=c.enum(["licensed","unofficial","creator"]),sO=c.enum(["ours","creator"]),T6=c.object({id:c.string().min(1),label:c.string().min(1),standing:aO,origin:sO,tiers:c.array(c.enum(["runtime","live","enterprise"])).min(1),produces:c.array(c.string()),note:c.string().min(1),audience:iO.optional()})});var jx=v(()=>{"use strict";Ff()});function hO(e,t){let r=e.trim().toLowerCase();return r?t.some(o=>{let n=o.trim().toLowerCase();return r===n||r.endsWith(`.${n}`)}):!1}function mO(e,t){let r=new Set((e.grants??[]).filter(o=>o.startsWith("org:")).map(o=>o.slice(4)));return t.find(o=>r.has(o.id)?!0:e.domain?hO(e.domain,o.domains):!1)}function zx(e,t){let r=e?.lastIndexOf("@")??-1,o=r>=0?e.slice(r+1).trim().toLowerCase():void 0;if(o)return mO({id:"creator",domain:o},t)}function Fx(e,t){let r={kind:"generated_proposal",tool:"org-profile",source_context:`org:${t.id} v${t.version}`};if(t.identity&&(e.identity.provider="jwt",e.identity.jwt={issuer:t.identity.issuer,jwks_uri:t.identity.jwks_uri,...t.identity.audience?{audience:t.identity.audience}:{}},e.identity.status="proposed",e.identity.provenance=[...e.identity.provenance,r]),e.identity.consent={analytics_requires_consent:t.consent.analytics_requires_consent,...t.consent.provider?{provider:t.consent.provider}:{}},t.analytics.length>0){let o=new Set(e.measurement.destinations.map(n=>n.type));for(let n of t.analytics)o.has(n.type)||(e.measurement.destinations.push({type:n.type,enabled:!0,config:n.config}),o.add(n.type));e.measurement.status="proposed",e.measurement.provenance=[...e.measurement.provenance,r]}t.brand&&(e.experience.design={...e.experience.design,...t.brand.kind==="figma"?{figma_file:t.brand.ref}:{tokens:t.brand.ref}},e.experience.status="proposed",e.experience.provenance=[...e.experience.provenance,r])}var cO,lO,dO,uO,Mx,pO,Ux,Gx,Bx=v(()=>{"use strict";He();en();cO=c.object({kind:c.enum(["figma","tokens","guidelines"]),ref:c.string().min(1)}),lO=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),dO=c.object({provider:c.string().optional(),analytics_requires_consent:c.boolean().default(!0)}),uO=c.object({type:Gm.shape.type,config:c.record(c.string(),c.string()).default({})}),Mx=c.object({kind:c.string().min(1),ref:c.string().min(1)}),pO=c.object({sink:Mx.optional(),source:Mx.optional()}),Ux=c.object({id:c.string().min(1),displayName:c.string().min(1),domains:c.array(c.string()).default([]),version:c.number().int().nonnegative().default(1),brand:cO.optional(),identity:lO.optional(),consent:dO.prefault({}),analytics:c.array(uO).default([]),data:pO.prefault({})});Gx=[Ux.parse({id:"monterosa",displayName:"Monterosa",domains:["monterosa.co.uk"],brand:{kind:"guidelines",ref:"monterosa-brand-guidelines"},identity:{issuer:"https://accounts.google.com",jwks_uri:"https://www.googleapis.com/oauth2/v3/certs"},consent:{analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{source:{kind:"slack-directory",ref:"monterosa-people"},sink:{kind:"delta-share",ref:"monterosa_gameplay"}}}),Ux.parse({id:"nba",displayName:"NBA",domains:["nba.com"],brand:{kind:"figma",ref:"nba-brand"},identity:{issuer:"https://id.nba.com",jwks_uri:"https://id.nba.com/.well-known/jwks.json"},consent:{provider:"onetrust",analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{sink:{kind:"snowflake",ref:"nba_gameplay"}}})]});var D6,Wx=v(()=>{"use strict";He();D6=c.object({org:c.string().min(1),game:c.string().min(1),player:c.string().min(1),alias:c.string().optional(),round:c.string().optional(),score:c.number(),outcome:c.string().optional(),at:c.string().min(1)})});var Kx=v(()=>{"use strict";er()});var Hx=v(()=>{"use strict";er()});function fO(e){let t;try{t=JSON.parse(e)}catch(o){return{ok:!1,reason:"That is not JSON.",detail:o instanceof Error?o.message:void 0}}let r=Cn.safeParse(t);if(!r.success){let o=r.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:o?`${o.path.join(".")||"document"}: ${o.message}`:void 0}}return{ok:!0,summary:{digest:lc(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length]))}}}async function Zx(e,t){let r=fO(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}var Vx=v(()=>{"use strict";er()});var Yx=v(()=>{"use strict"});var qx=v(()=>{"use strict"});function Gf(e){return e.sourceIp?.trim()||"unknown"}function Bf(e,t){return`${e.length}:${e}${t}`}var gO,Jx,Xx,Qx,eS,H6,Z6,V6,tS=v(()=>{"use strict";gO=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},Jx=e=>typeof process>"u"?void 0:gO(process.env?.[e]),Xx=(e,t,r)=>({burst:Jx(t)??e.burst,perMinute:Jx(r)??e.perMinute}),Qx={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},eS={player:Xx(Qx.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:Xx(Qx.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},H6=eS.player,Z6=eS.publicRoutes,V6=600*1e3});var nS=v(()=>{"use strict"});var ke=v(()=>{"use strict";$o();Yt();en();Lm();Vs();ff();Fk();Xs();Wk();Ks();gf();Qk();pi();Ut();ic();$x();Nx();jf();Gt();Sf();Lx();In();ac();Ef();sc();$f();Kr();Dx();er();jx();Bx();Wx();Ff();Kx();Hx();Vx();xf();cc();Tf();Yx();Uf();kf();qx();zf();tS();nS()});var qr,nr,Fe,Tt,Bt,Oe,rS,yO,vO,bO,wO,_O,kO,wi,tn=v(()=>{"use strict";qr=`/**
109
109
  * @monterosa/gamestage-player, bundled for a browser.
110
110
  *
111
111
  * Generated by the Gamestage CLI. Do not edit: it is replaced whenever the CLI
@@ -7208,7 +7208,7 @@ export {
7208
7208
  streakFrom,
7209
7209
  tokenOf
7210
7210
  };
7211
- `,Bt="4795f5e585d3db9d",Oe="gamestage.js",rS="0.52.0",pO=`<!doctype html>
7211
+ `,Bt="4795f5e585d3db9d",Oe="gamestage.js",rS="0.52.0",yO=`<!doctype html>
7212
7212
  <html lang="en">
7213
7213
  <head>
7214
7214
  <meta charset="utf-8" />
@@ -7581,7 +7581,7 @@ main().catch((error) => {
7581
7581
  </script>
7582
7582
  </body>
7583
7583
  </html>
7584
- `,hO=`<!doctype html>
7584
+ `,vO=`<!doctype html>
7585
7585
  <html lang="en">
7586
7586
  <head>
7587
7587
  <meta charset="utf-8" />
@@ -8003,7 +8003,7 @@ main().catch((error) => {
8003
8003
  </script>
8004
8004
  </body>
8005
8005
  </html>
8006
- `,mO=`<!doctype html>
8006
+ `,bO=`<!doctype html>
8007
8007
  <html lang="en">
8008
8008
  <head>
8009
8009
  <meta charset="utf-8" />
@@ -8481,7 +8481,7 @@ main().catch((error) => {
8481
8481
  </script>
8482
8482
  </body>
8483
8483
  </html>
8484
- `,fO=`<!doctype html>
8484
+ `,wO=`<!doctype html>
8485
8485
  <html lang="en">
8486
8486
  <head>
8487
8487
  <meta charset="utf-8" />
@@ -8935,7 +8935,7 @@ main().catch((error) => {
8935
8935
  </script>
8936
8936
  </body>
8937
8937
  </html>
8938
- `,gO=`<!doctype html>
8938
+ `,_O=`<!doctype html>
8939
8939
  <html lang="en">
8940
8940
  <head>
8941
8941
  <meta charset="utf-8" />
@@ -9759,7 +9759,7 @@ main().catch((error) => {
9759
9759
  </script>
9760
9760
  </body>
9761
9761
  </html>
9762
- `,yO=`<!doctype html>
9762
+ `,kO=`<!doctype html>
9763
9763
  <html lang="en">
9764
9764
  <head>
9765
9765
  <meta charset="utf-8" />
@@ -10406,16 +10406,16 @@ main().catch((error) => {
10406
10406
  </script>
10407
10407
  </body>
10408
10408
  </html>
10409
- `,wi={hunt:pO,push:hO,group:mO,predict:fO,bingo:gO,shoot:yO}});function oS(e){Jr=e}function J(){return Jr}function pc(e=process.argv,t=process.env){if(t.GAMESTAGE_INVOCATION)return t.GAMESTAGE_INVOCATION;let r=e[1]??"";if(/[\\/]_npx[\\/]/.test(r))return"npx gamestage";let o=r.split(/[\\/]/).pop()??"";return o==="gamestage.mjs"||o==="cli.mjs"?`node ${o}`:"gamestage"}function re(e){return`${pc()} ${e}`}function Wf(e){let t=pc();return t==="gamestage"?e:e.replace(wO,(r,o,n)=>bO.includes(o)?`\`${t} ${o}${n}\``:r)}function g(e=""){Jr||process.stdout.write(Wf(e)+`
10410
- `)}function K(e){g(),g(P.bold(e))}function A(e,t="-"){g(` ${P.dim(t)} ${e}`)}function M(e,t){g(` ${P.dim(e.padEnd(18))} ${t}`)}function Q(e){Jr&&process.stdout.write(JSON.stringify(e,null,2)+`
10411
- `)}async function Kf(e){let t=process.stdout;typeof t.writableLength=="number"&&t.writableLength>0&&await new Promise(r=>{let o=()=>r();t.once("drain",o),t.once("error",o),t.once("close",o)}),process.exit(e)}function V(e,t){if(Jr)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
10409
+ `,wi={hunt:yO,push:vO,group:bO,predict:wO,bingo:_O,shoot:kO}});function oS(e){Xr=e}function J(){return Xr}function pc(e=process.argv,t=process.env){if(t.GAMESTAGE_INVOCATION)return t.GAMESTAGE_INVOCATION;let r=e[1]??"";if(/[\\/]_npx[\\/]/.test(r))return"npx gamestage";let o=r.split(/[\\/]/).pop()??"";return o==="gamestage.mjs"||o==="cli.mjs"?`node ${o}`:"gamestage"}function re(e){return`${pc()} ${e}`}function Wf(e){let t=pc();return t==="gamestage"?e:e.replace(EO,(r,o,n)=>SO.includes(o)?`\`${t} ${o}${n}\``:r)}function g(e=""){Xr||process.stdout.write(Wf(e)+`
10410
+ `)}function K(e){g(),g(P.bold(e))}function A(e,t="-"){g(` ${P.dim(t)} ${e}`)}function M(e,t){g(` ${P.dim(e.padEnd(18))} ${t}`)}function Q(e){Xr&&process.stdout.write(JSON.stringify(e,null,2)+`
10411
+ `)}async function Kf(e){let t=process.stdout;typeof t.writableLength=="number"&&t.writableLength>0&&await new Promise(r=>{let o=()=>r();t.once("drain",o),t.once("error",o),t.once("close",o)}),process.exit(e)}function V(e,t){if(Xr)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
10412
10412
  `);else{process.stderr.write(`${P.red("Error")} ${Wf(e)}
10413
10413
  `);for(let r of t??[])process.stderr.write(` ${Wf(r)}
10414
- `)}process.exit(1)}var Jr,vO,qr,P,bO,wO,Re=v(()=>{"use strict";Jr=!1;vO=()=>!Jr&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,qr=(e,t)=>vO()?`\x1B[${e}m${t}\x1B[0m`:t,P={bold:e=>qr("1",e),dim:e=>qr("2",e),red:e=>qr("31",e),green:e=>qr("32",e),yellow:e=>qr("33",e),cyan:e=>qr("36",e)};bO=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","graphic","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","start","status","suggest","suspend","verify","wake","whoami"],wO=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});import{spawn as pS}from"node:child_process";import{chmod as sS,mkdir as cS,readFile as lS,rm as dS,writeFile as uS}from"node:fs/promises";import{homedir as IO,platform as Xr}from"node:os";import{dirname as CO,join as hS}from"node:path";async function mS(){let e=await fetch(`${Hf}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:Zf})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function fS(e){let t=await fetch(`${Hf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Zf,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function gS(e){let t=Xr()==="darwin"?"open":Xr()==="win32"?"cmd":"xdg-open",r=Xr()==="win32"?["/c","start","",e]:[e];try{pS(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function Vf(){let e=process.env.GAMESTAGE_CREDENTIALS?.trim();return e||void 0}function Yf(e,t){return new Promise(r=>{let o=pS("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function qf(e){let t=JSON.stringify(e),r=Vf();return r?(await cS(CO(r),{recursive:!0,mode:448}),await uS(r,t,{mode:384}),await sS(r,384),"file"):Xr()==="darwin"&&await Yf(["add-generic-password","-a",Qr,"-s",Qr,"-U","-w",t])!==null?"keychain":(await cS(yS,{recursive:!0,mode:448}),await uS(hc,t,{mode:384}),await sS(hc,384),"file")}function PO(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function OO(e){if(!e.refreshToken)return null;let t=await fetch(`${Hf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Zf,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function NO(){let e=Vf();if(e)try{return JSON.parse(await lS(e,"utf8"))}catch{return null}if(Xr()==="darwin"){let t=await Yf(["find-generic-password","-a",Qr,"-s",Qr,"-w"]);if(t)try{return JSON.parse(t)}catch{}}try{return JSON.parse(await lS(hc,"utf8"))}catch{return null}}async function vS(){let e=Vf();if(e){await dS(e,{force:!0});return}Xr()==="darwin"&&await Yf(["delete-generic-password","-a",Qr,"-s",Qr]),await dS(hc,{force:!0})}async function je(){let e=await NO();if(!e)return null;if(!PO(e.accessToken)||!e.refreshToken)return e;let t=await OO(e);return t?(await qf(t),t):null}var Hf,Zf,Qr,yS,hc,rr=v(()=>{"use strict";Hf="https://api.workos.com",Zf=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";Qr="gamestage-cli",yS=hS(IO(),".gamestage"),hc=hS(yS,"credentials.json")});function _S(e){return`${nn}/stage/games/${encodeURIComponent(e)}?tab=overview`}function kS(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${nn}/docs/game-formats#${e}`:`${nn}/docs`}var nn,Jf=v(()=>{"use strict";nn=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function jO(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function MO(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function UO(e=Ye,t=process.env){if(MO(t)&&!jO(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function to(e=Ye){let t=UO(e);t&&V(t)}async function ki(){let e=await je();return e||V("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and validating a manifest still need no account."]),e}async function xe(){let e=await ki();return{client:Vr({baseUrl:Ye,token:async()=>(await je())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function Qf(){let e=await je();return e||V("You are not signed in.",["Run `gamestage login`. An operator's command needs an operator's own session."]),{admin:Ox({baseUrl:Ye,token:async()=>(await je())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function gc(e){try{let t=await e.getWorkspace(),r=t?.access;return r==="approved"||r==="pending"||r==="refused"?{access:r,workspace:t}:{access:"unreported",workspace:t}}catch(t){let r=t.status,o=t.code;return o===eg?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${Ye}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${Ye}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{access:"unknown",problem:"unreachable",reason:`Could not reach the control plane at ${Ye}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function xi(e){switch(e.access){case"approved":return{ok:!0,status:"approved",access:"approved",heading:"Approved",message:"Your account is approved, so every command works, including deploy.",next:["`gamestage status` shows the workspace, its games and what they are using."]};case"pending":return{ok:!0,status:"pending_approval",access:"pending",code:eg,heading:"Registered, waiting for approval",message:"You are registered and your account is waiting for approval. That is the normal path for a new account, and approval is a person's decision today.",next:["Nothing is wrong and nothing is lost. There is no second form to fill in.","Inspecting a prototype, scaffolding a game and writing a round all work now and need no approval.","`gamestage status` re-checks approval. It never opens the browser again."]};case"refused":return{ok:!0,status:"access_refused",access:"refused",heading:"Access refused",message:"This account has been refused access. Signing in worked, so this is a decision about the account rather than a broken token.",next:["Nothing in the CLI changes this, and running `gamestage login` again will not.","Inspecting, scaffolding and writing a round still work and need no account.",`If you think this is wrong, say so where you registered: ${nn}.`]};case"unreported":return{ok:!0,status:"access_not_reported",access:null,heading:"Signed in",message:"This control plane answered and does not report an access state, so whether this account is approved is not known here.",next:["It predates the access state rather than being broken, so carry on.","A deploy that is refused for approval will say so in its own words."]};default:return{ok:!1,status:e.problem==="no_control_plane"?"no_control_plane":e.problem==="token_refused"?"token_refused":"control_plane_unreachable",access:null,heading:"Signed in, and the control plane is not usable",message:e.reason,next:e.detail}}}function xS(e){return!e.changed&&e.refused?{ok:!0,status:"refused_by_store",access:e.access,code:e.code,heading:"Not approved",message:e.refused,next:["Nothing was written. When they have accepted the terms, run this again."]}:e.changed?e.access==="approved"?{ok:!0,status:"approved",access:"approved",heading:"Approved",message:`${e.workspaceId} was ${e.previous} and is now approved.`,next:["Their next `gamestage status` says approved, and deploy works from then on."]}:{ok:!0,status:"refused",access:"refused",heading:"Refused",message:`${e.workspaceId} was ${e.previous} and is now refused.`,next:["Their next `gamestage status` says refused, and says how to argue with it."]}:{ok:!0,status:"unchanged",access:e.access,heading:"No change",message:`${e.workspaceId} was already ${e.previous}. Nothing was written.`,next:["No audit record either: the trail records transitions, and this was not one."]}}function no(e){if(K(e.heading),g(` ${e.message}`),e.next.length){g();for(let t of e.next)A(t)}g()}function SS(e,t,r){let o=a=>{let s=a.trim().toLowerCase();return Kr.options.find(l=>l===s||gi[l].toLowerCase()===s)},n=Kr.options.map(a=>`${a} (${gi[a]})`).join(", "),i=o(t);return i?r===void 0?{request:{workspaceId:e,tier:i}}:!/^\d+$/.test(r)||Number(r)>1e4?{problem:`"${r}" is not a live-game allowance.`,detail:["Give a whole number from 0 to 10000, where 0 means no ceiling.","Nothing has been changed."]}:{request:{workspaceId:e,tier:i,allowance:Number(r)}}:o(e)?{problem:"The workspace comes first and the plan second.",detail:[`Try: ${re(`admin plan ${t} ${e}`)}`,"Nothing has been changed."]}:{problem:`"${t}" is not a plan.`,detail:[`Use one of: ${n}.`,"Nothing has been changed."]}}function eo(e){let t=gi[e.tier];if(e.liveGameAllowance===void 0)return t;let r=e.liveGameAllowance===0?"no live-game ceiling":`${e.liveGameAllowance} live game${e.liveGameAllowance===1?"":"s"}`;return`${t}, ${r}`}function ES(e){let{request:t,previous:r,result:o,stored:n}=e,i=eo({tier:t.tier,liveGameAllowance:t.allowance}),a={previous:r,stored:n};return o.refused?{...a,status:"refused_by_store",exitCode:0,heading:"Not changed",message:o.refused,next:["Nothing was written."]}:n?n.tier===t.tier&&(t.allowance===void 0||n.liveGameAllowance===t.allowance)?r!==null&&r.tier===n.tier&&r.liveGameAllowance===n.liveGameAllowance?{...a,status:"unchanged",exitCode:0,heading:"No change",message:`${t.workspaceId} was already on ${eo(n)}, and still is.`,next:[Xf]}:{...a,status:"set",exitCode:0,heading:"Plan set",message:`${t.workspaceId} is on ${eo(n)}, read back from the control plane after the write.`,next:[Xf]}:{...a,status:"not_what_was_asked",exitCode:1,heading:"Not what was asked",message:`${t.workspaceId} was sent ${i} and holds ${eo(n)}. The write reported success, and the stored workspace disagrees with it.`,next:["Run it again to see whether the second read agrees. If it still disagrees, that is a control-plane defect to raise, not an operator mistake."]}:{...a,status:"unconfirmed",exitCode:2,heading:"Sent, and not confirmed",message:`The control plane accepted ${t.workspaceId} moving to ${i}, and could not then be asked what it kept: ${e.unreadable??"no reason given"}.`,next:["Treat the plan as unknown rather than set. Run this again once the control plane answers reads; repeating the same plan is safe.",Xf]}}function $S(e){if(K(e.heading),g(` ${e.message}`),g(),M("Before",e.previous?eo(e.previous):"could not be read"),M("Stored now",e.stored?eo(e.stored):"could not be read"),e.next.length){g();for(let t of e.next)A(t)}g()}function Ie(e){let t=[],r=e.status,o=e.code;if(o===eg){let n=xi({access:"pending"});J()?Q({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):no(n),process.exit(0)}r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${Ye}`),V(e instanceof Error?e.message:"The control plane call failed.",t)}var Ye,eg,Xf,At=v(()=>{"use strict";ke();rr();Re();Jf();Ye=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";eg="access_pending";Xf="This does not re-provision. A live round keeps the caps it was provisioned with, including its day cap, until the game is deployed again, so a creator refused before this is refused the same way until they redeploy with `gamestage deploy`. That is not this change failing."});import{open as HO,readFile as NS}from"node:fs/promises";import{createHash as ZO}from"node:crypto";import{gunzipSync as VO}from"node:zlib";function JO(e){for(let{pattern:t,what:r}of qO)if(t.test(e))return r}function rg(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||YO.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function LS(e,t){let r;try{r=await HO(e,"r")}catch{return}try{let{size:o}=await r.stat();if(o<=t){let s=Buffer.alloc(o);return o>0&&await r.read(s,0,o,0),s}let n=Math.floor(t/2),i=Buffer.alloc(n),a=Buffer.alloc(n);return await r.read(i,0,n,0),await r.read(a,0,n,o-n),Buffer.concat([i,Buffer.from(`
10415
- `),a])}catch{return}finally{await r.close()}}async function QO(e){return(await LS(e,RS))?.toString("latin1")}async function $i(e){let t=await LS(e,RS);if(!t)return;if(t.byteLength>=2&&t[0]===31&&t[1]===139)try{let s=await NS(e);t=VO(s,{maxOutputLength:XO})}catch{}if(t.byteLength>=2){if(t[0]===255&&t[1]===254)return t.toString("utf16le");if(t[0]===254&&t[1]===255)return t.swap16().toString("utf16le")}let r=t.subarray(0,8192);if(!r.includes(0))return t.toString("utf8");let o=0,n=0,i=0;for(let s=0;s<r.length;s+=1)r[s]===0&&(i+=1,s%2===0?o+=1:n+=1);let a=Math.floor(r.length/2);if(a>8){if(n>a*.7&&o<a*.1)return t.toString("utf16le");if(o>a*.7&&n<a*.1)return t.swap16().toString("utf16le")}if(i<=8&&i*20<r.length)return t.toString("utf8").split("\0").join("")}function eN(e){let t=De(e);if(t.ok)return{manifest:!0,round:!!t.manifest.backend.round}}function ro(e,t){if(t.archetype==="hunt"){let n=t.targets;if(n.length===0)return[];let i=n.filter(a=>new RegExp(`["'\`]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`,"i").test(e));return i.length===n.length?i:[]}if(t.archetype==="predict")return[];if(t.archetype==="bingo")return t.cardPool.length<2?[]:e.split(`
10414
+ `)}process.exit(1)}var Xr,xO,Jr,P,SO,EO,Re=v(()=>{"use strict";Xr=!1;xO=()=>!Xr&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,Jr=(e,t)=>xO()?`\x1B[${e}m${t}\x1B[0m`:t,P={bold:e=>Jr("1",e),dim:e=>Jr("2",e),red:e=>Jr("31",e),green:e=>Jr("32",e),yellow:e=>Jr("33",e),cyan:e=>Jr("36",e)};SO=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","graphic","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","start","status","suggest","suspend","verify","wake","whoami"],EO=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});import{spawn as pS}from"node:child_process";import{chmod as sS,mkdir as cS,readFile as lS,rm as dS,writeFile as uS}from"node:fs/promises";import{homedir as RO,platform as Qr}from"node:os";import{dirname as LO,join as hS}from"node:path";async function mS(){let e=await fetch(`${Hf}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:Zf})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function fS(e){let t=await fetch(`${Hf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Zf,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function gS(e){let t=Qr()==="darwin"?"open":Qr()==="win32"?"cmd":"xdg-open",r=Qr()==="win32"?["/c","start","",e]:[e];try{pS(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function Vf(){let e=process.env.GAMESTAGE_CREDENTIALS?.trim();return e||void 0}function Yf(e,t){return new Promise(r=>{let o=pS("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function qf(e){let t=JSON.stringify(e),r=Vf();return r?(await cS(LO(r),{recursive:!0,mode:448}),await uS(r,t,{mode:384}),await sS(r,384),"file"):Qr()==="darwin"&&await Yf(["add-generic-password","-a",eo,"-s",eo,"-U","-w",t])!==null?"keychain":(await cS(yS,{recursive:!0,mode:448}),await uS(hc,t,{mode:384}),await sS(hc,384),"file")}function DO(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function jO(e){if(!e.refreshToken)return null;let t=await fetch(`${Hf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Zf,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function MO(){let e=Vf();if(e)try{return JSON.parse(await lS(e,"utf8"))}catch{return null}if(Qr()==="darwin"){let t=await Yf(["find-generic-password","-a",eo,"-s",eo,"-w"]);if(t)try{return JSON.parse(t)}catch{}}try{return JSON.parse(await lS(hc,"utf8"))}catch{return null}}async function vS(){let e=Vf();if(e){await dS(e,{force:!0});return}Qr()==="darwin"&&await Yf(["delete-generic-password","-a",eo,"-s",eo]),await dS(hc,{force:!0})}async function je(){let e=await MO();if(!e)return null;if(!DO(e.accessToken)||!e.refreshToken)return e;let t=await jO(e);return t?(await qf(t),t):null}var Hf,Zf,eo,yS,hc,rr=v(()=>{"use strict";Hf="https://api.workos.com",Zf=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";eo="gamestage-cli",yS=hS(RO(),".gamestage"),hc=hS(yS,"credentials.json")});function _S(e){return`${nn}/stage/games/${encodeURIComponent(e)}?tab=overview`}function kS(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${nn}/docs/game-formats#${e}`:`${nn}/docs`}var nn,Jf=v(()=>{"use strict";nn=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function GO(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function BO(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function WO(e=Ye,t=process.env){if(BO(t)&&!GO(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function no(e=Ye){let t=WO(e);t&&V(t)}async function ki(){let e=await je();return e||V("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and validating a manifest still need no account."]),e}async function xe(){let e=await ki();return{client:Yr({baseUrl:Ye,token:async()=>(await je())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function Qf(){let e=await je();return e||V("You are not signed in.",["Run `gamestage login`. An operator's command needs an operator's own session."]),{admin:Ox({baseUrl:Ye,token:async()=>(await je())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function gc(e){try{let t=await e.getWorkspace(),r=t?.access;return r==="approved"||r==="pending"||r==="refused"?{access:r,workspace:t}:{access:"unreported",workspace:t}}catch(t){let r=t.status,o=t.code;return o===eg?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${Ye}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${Ye}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{access:"unknown",problem:"unreachable",reason:`Could not reach the control plane at ${Ye}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function xi(e){switch(e.access){case"approved":return{ok:!0,status:"approved",access:"approved",heading:"Approved",message:"Your account is approved, so every command works, including deploy.",next:["`gamestage status` shows the workspace, its games and what they are using."]};case"pending":return{ok:!0,status:"pending_approval",access:"pending",code:eg,heading:"Registered, waiting for approval",message:"You are registered and your account is waiting for approval. That is the normal path for a new account, and approval is a person's decision today.",next:["Nothing is wrong and nothing is lost. There is no second form to fill in.","Inspecting a prototype, scaffolding a game and writing a round all work now and need no approval.","`gamestage status` re-checks approval. It never opens the browser again."]};case"refused":return{ok:!0,status:"access_refused",access:"refused",heading:"Access refused",message:"This account has been refused access. Signing in worked, so this is a decision about the account rather than a broken token.",next:["Nothing in the CLI changes this, and running `gamestage login` again will not.","Inspecting, scaffolding and writing a round still work and need no account.",`If you think this is wrong, say so where you registered: ${nn}.`]};case"unreported":return{ok:!0,status:"access_not_reported",access:null,heading:"Signed in",message:"This control plane answered and does not report an access state, so whether this account is approved is not known here.",next:["It predates the access state rather than being broken, so carry on.","A deploy that is refused for approval will say so in its own words."]};default:return{ok:!1,status:e.problem==="no_control_plane"?"no_control_plane":e.problem==="token_refused"?"token_refused":"control_plane_unreachable",access:null,heading:"Signed in, and the control plane is not usable",message:e.reason,next:e.detail}}}function xS(e){return!e.changed&&e.refused?{ok:!0,status:"refused_by_store",access:e.access,code:e.code,heading:"Not approved",message:e.refused,next:["Nothing was written. When they have accepted the terms, run this again."]}:e.changed?e.access==="approved"?{ok:!0,status:"approved",access:"approved",heading:"Approved",message:`${e.workspaceId} was ${e.previous} and is now approved.`,next:["Their next `gamestage status` says approved, and deploy works from then on."]}:{ok:!0,status:"refused",access:"refused",heading:"Refused",message:`${e.workspaceId} was ${e.previous} and is now refused.`,next:["Their next `gamestage status` says refused, and says how to argue with it."]}:{ok:!0,status:"unchanged",access:e.access,heading:"No change",message:`${e.workspaceId} was already ${e.previous}. Nothing was written.`,next:["No audit record either: the trail records transitions, and this was not one."]}}function ro(e){if(K(e.heading),g(` ${e.message}`),e.next.length){g();for(let t of e.next)A(t)}g()}function SS(e,t,r){let o=a=>{let s=a.trim().toLowerCase();return Hr.options.find(l=>l===s||gi[l].toLowerCase()===s)},n=Hr.options.map(a=>`${a} (${gi[a]})`).join(", "),i=o(t);return i?r===void 0?{request:{workspaceId:e,tier:i}}:!/^\d+$/.test(r)||Number(r)>1e4?{problem:`"${r}" is not a live-game allowance.`,detail:["Give a whole number from 0 to 10000, where 0 means no ceiling.","Nothing has been changed."]}:{request:{workspaceId:e,tier:i,allowance:Number(r)}}:o(e)?{problem:"The workspace comes first and the plan second.",detail:[`Try: ${re(`admin plan ${t} ${e}`)}`,"Nothing has been changed."]}:{problem:`"${t}" is not a plan.`,detail:[`Use one of: ${n}.`,"Nothing has been changed."]}}function to(e){let t=gi[e.tier];if(e.liveGameAllowance===void 0)return t;let r=e.liveGameAllowance===0?"no live-game ceiling":`${e.liveGameAllowance} live game${e.liveGameAllowance===1?"":"s"}`;return`${t}, ${r}`}function ES(e){let{request:t,previous:r,result:o,stored:n}=e,i=to({tier:t.tier,liveGameAllowance:t.allowance}),a={previous:r,stored:n};return o.refused?{...a,status:"refused_by_store",exitCode:0,heading:"Not changed",message:o.refused,next:["Nothing was written."]}:n?n.tier===t.tier&&(t.allowance===void 0||n.liveGameAllowance===t.allowance)?r!==null&&r.tier===n.tier&&r.liveGameAllowance===n.liveGameAllowance?{...a,status:"unchanged",exitCode:0,heading:"No change",message:`${t.workspaceId} was already on ${to(n)}, and still is.`,next:[Xf]}:{...a,status:"set",exitCode:0,heading:"Plan set",message:`${t.workspaceId} is on ${to(n)}, read back from the control plane after the write.`,next:[Xf]}:{...a,status:"not_what_was_asked",exitCode:1,heading:"Not what was asked",message:`${t.workspaceId} was sent ${i} and holds ${to(n)}. The write reported success, and the stored workspace disagrees with it.`,next:["Run it again to see whether the second read agrees. If it still disagrees, that is a control-plane defect to raise, not an operator mistake."]}:{...a,status:"unconfirmed",exitCode:2,heading:"Sent, and not confirmed",message:`The control plane accepted ${t.workspaceId} moving to ${i}, and could not then be asked what it kept: ${e.unreadable??"no reason given"}.`,next:["Treat the plan as unknown rather than set. Run this again once the control plane answers reads; repeating the same plan is safe.",Xf]}}function $S(e){if(K(e.heading),g(` ${e.message}`),g(),M("Before",e.previous?to(e.previous):"could not be read"),M("Stored now",e.stored?to(e.stored):"could not be read"),e.next.length){g();for(let t of e.next)A(t)}g()}function Ie(e){let t=[],r=e.status,o=e.code;if(o===eg){let n=xi({access:"pending"});J()?Q({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):ro(n),process.exit(0)}r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${Ye}`),V(e instanceof Error?e.message:"The control plane call failed.",t)}var Ye,eg,Xf,At=v(()=>{"use strict";ke();rr();Re();Jf();Ye=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";eg="access_pending";Xf="This does not re-provision. A live round keeps the caps it was provisioned with, including its day cap, until the game is deployed again, so a creator refused before this is refused the same way until they redeploy with `gamestage deploy`. That is not this change failing."});import{open as JO,readFile as NS}from"node:fs/promises";import{createHash as XO}from"node:crypto";import{gunzipSync as QO}from"node:zlib";function nN(e){for(let{pattern:t,what:r}of tN)if(t.test(e))return r}function rg(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||eN.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function LS(e,t){let r;try{r=await JO(e,"r")}catch{return}try{let{size:o}=await r.stat();if(o<=t){let s=Buffer.alloc(o);return o>0&&await r.read(s,0,o,0),s}let n=Math.floor(t/2),i=Buffer.alloc(n),a=Buffer.alloc(n);return await r.read(i,0,n,0),await r.read(a,0,n,o-n),Buffer.concat([i,Buffer.from(`
10415
+ `),a])}catch{return}finally{await r.close()}}async function oN(e){return(await LS(e,RS))?.toString("latin1")}async function $i(e){let t=await LS(e,RS);if(!t)return;if(t.byteLength>=2&&t[0]===31&&t[1]===139)try{let s=await NS(e);t=QO(s,{maxOutputLength:rN})}catch{}if(t.byteLength>=2){if(t[0]===255&&t[1]===254)return t.toString("utf16le");if(t[0]===254&&t[1]===255)return t.swap16().toString("utf16le")}let r=t.subarray(0,8192);if(!r.includes(0))return t.toString("utf8");let o=0,n=0,i=0;for(let s=0;s<r.length;s+=1)r[s]===0&&(i+=1,s%2===0?o+=1:n+=1);let a=Math.floor(r.length/2);if(a>8){if(n>a*.7&&o<a*.1)return t.toString("utf16le");if(o>a*.7&&n<a*.1)return t.swap16().toString("utf16le")}if(i<=8&&i*20<r.length)return t.toString("utf8").split("\0").join("")}function iN(e){let t=De(e);if(t.ok)return{manifest:!0,round:!!t.manifest.backend.round}}function oo(e,t){if(t.archetype==="hunt"){let n=t.targets;if(n.length===0)return[];let i=n.filter(a=>new RegExp(`["'\`]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`,"i").test(e));return i.length===n.length?i:[]}if(t.archetype==="predict")return[];if(t.archetype==="bingo")return t.cardPool.length<2?[]:e.split(`
10416
10416
  `).some(i=>t.cardPool.every(a=>new RegExp(`["\`']${a.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(i)))?t.cardPool.map(i=>i.label):[];if(t.archetype==="group"){let n=[];for(let i of t.groups){if(new RegExp(`["\`']${i.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(e)){n.push(i.label);continue}e.split(`
10417
10417
  `).some(l=>i.members.every(d=>new RegExp(`["\`']${d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(l)))&&n.push(i.label)}return n}if(t.archetype==="shoot")return[];if(t.archetype==="place"){let n=a=>new RegExp(`["\`']${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i"),i=[];for(let a of t.qualifies){if(a.cells.length===0)continue;e.split(`
10418
- `).some(l=>n(a.item).test(l)&&a.cells.every(d=>n(d).test(l)))&&i.push(a.item)}return i}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`\\b(?:${a})\\b[^\\n]{0,120}?\\b${i.value}\\b`,"i"),l=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?\\b(?:${a})\\b`,"i");(s.test(e)||l.test(e))&&o.push(i.label)}return o}function oo(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;if(e.archetype==="place")return`The page holds which cells a card fits: ${t.join(", ")}. A player who reads it can fill the board without knowing a face, which is the game.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}function nN(e){try{return JSON.parse(e)}catch{}try{let t=zk(e);return typeof t=="object"?t:void 0}catch{return}}function rN(e){let t=nN(e);if(!t||typeof t!="object")return;let r,o=new Set,n=(i,a)=>{if(!(r||a>6||!i||typeof i!="object")&&!o.has(i)){if(o.add(i),Array.isArray(i)){for(let s of i)n(s,a+1);return}for(let[s,l]of Object.entries(i)){if(tN.has(s.toLowerCase())){r=s;return}n(l,a+1)}}};return n(t,0),r}function oN(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<ng+1)return!1;for(let r of[","," ",";"]){let o=t.slice(0,500).map(p=>p.split(r)),n=o[0].length,i=o.filter(p=>p.length===n);if(n<2||i.length<o.length*.95||i.length<ng+1)continue;let a=i.slice(1),s=Math.min(...a.map(p=>p.length)),l=!1,d=!1;for(let p=0;p<s;p+=1){let h=a.map(f=>f[p].trim());h.every(f=>f.length>0&&/^-?\d+(\.\d+)?$/.test(f))?l=!0:h.every(f=>f.length>0&&!/^-?\d+(\.\d+)?$/.test(f))&&(d=!0)}if(l&&d)return!0}try{let r=JSON.parse(e);if(r&&typeof r=="object"&&!Array.isArray(r)){let o=Object.values(r);if(o.length>=ng&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function sN(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&aN.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:iN.has(t.slice(r+1))}function lN(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>cN.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function dN(e){if(e.relativePath!==Oe)return;let t;try{t=await NS(e.path)}catch{return}if(ZO("sha256").update(t).digest("hex").slice(0,16)!==Bt)return{path:e.relativePath,why:"needs regenerating. Run `gamestage client`, then deploy again. If it is refused again with the same digest, the tool that wrote the file is older than the one checking it, so update Gamestage and rerun.",confidence:"certain"}}async function DS(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),l;for(let d of e){let p=lN(d.relativePath);if(p){i.includes(p)||i.push(p);continue}let h=await dN(d);if(h){l??=h;continue}if(s.has(d.relativePath)){r.push(d);continue}let f=await og(d,t.round);if(!f){r.push(d);continue}if(f.confidence==="suspected"&&a.has(d.relativePath)){n.push(f),r.push(d);continue}if(f.alwaysWithheld||sN(d.relativePath)){o.push(f);continue}l??=f}return{publish:r,withheld:o,allowed:n,walkedPast:i,...l?{refuse:l}:{}}}async function og(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if(rg(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await $i(e.path);if(o!==void 0){let i=JO(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=eN(o);if(a)return r(a.round?"is an App Manifest, which carries the round's private half":"is an App Manifest, which is ours rather than the game's","certain",!0);if(t){let s=ro(o,t);if(s.length)return r(oo(t,s),"certain")}}if(t&&o===void 0){let i=await QO(e.path);if(i!==void 0){let a=ro(i,t);if(a.length)return r(oo(t,a),"certain")}}if(o===void 0)return;let n=rN(o);if(n){let i=/^[aeiou]/i.test(n)?"an":"a";return r(`looks like it holds a round's answers: it has ${i} "${n}" key. If that is the game's own data rather than its answers, publish it with --allow ${e.relativePath}`,"suspected")}if(oN(o))return r(`looks like reference data: a long table of labels against numbers, which is what a round is scored against. If it is the game's own data, publish it with --allow ${e.relativePath}`,"suspected")}var YO,qO,RS,XO,tN,ng,iN,aN,cN,yc=v(()=>{"use strict";qs();ke();tn();YO=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),qO=[{pattern:/-----BEGIN [A-Z ]*PRIVATE KEY-----/,what:"a private key block"},{pattern:/-----BEGIN OPENSSH PRIVATE KEY-----/,what:"an OpenSSH private key"},{pattern:/\bAKIA[0-9A-Z]{16}\b/,what:"an AWS access key id"},{pattern:/\baws_secret_access_key\s*[=:]/i,what:"an AWS secret access key"},{pattern:/\bsk-(live|proj|ant)-[A-Za-z0-9_-]{16,}/,what:"a live API key"},{pattern:/\bsk_live_[A-Za-z0-9]{16,}/,what:"a live Stripe key"},{pattern:/\bgh[pousr]_[A-Za-z0-9]{30,}/,what:"a GitHub token"},{pattern:/\bxox[baprs]-[A-Za-z0-9-]{10,}/,what:"a Slack token"},{pattern:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,what:"a signed token"},{pattern:/\bauthorization\s*:\s*["']?\s*(bearer|basic)\s+\S{12,}/i,what:"an Authorization header with a token in it"}];RS=8e6,XO=32e6;tN=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);ng=20;iN=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),aN=new Set(["gz","br","zst","zz"]);cN=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function vc(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===Oe||o===Fe)continue;let n=await $i(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var ig=v(()=>{"use strict";tn();yc()});import{lstatSync as uN,readdirSync as pN}from"node:fs";import{relative as hN,resolve as jS,sep as mN}from"node:path";function bc(e){let t=e.split("/").pop()??e;return fN.has(t)||t.startsWith(".env.")}function Ti(e,t={}){let r=t.symlinks??"throw",o=jS(e),n=[],i=[],a=[];function s(l){for(let d of pN(l,{withFileTypes:!0}).sort((p,h)=>p.name.localeCompare(h.name))){let p=jS(l,d.name),h=hN(o,p).split(mN).join("/");if(d.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${h}`);i.push(h);continue}if(d.isDirectory())s(p);else if(d.isFile()){if(bc(h)){a.push(h);continue}n.push({path:p,relativePath:h})}}}if(!uN(o).isDirectory())throw new Error(`${e} is not a directory.`);return s(o),{files:n,skippedLinks:i,withheld:a}}function MS(e){return Ti(e,{symlinks:"throw"}).files}function US(e,t=[]){let r=[],o=new Map;for(let i of e){let a=i.relativePath;if(!gN.test(a)||yN.test(a)){r.push(a);continue}let l=a.lastIndexOf("/"),d=l===-1?".":a.slice(0,l);o.set(d,(o.get(d)??0)+1)}let n=[];for(let i of r.sort())n.push(i);for(let[i,a]of[...o].sort(([s],[l])=>s.localeCompare(l))){let s=i==="."?"the directory root":`${i}/`;n.push(`${a} ${a===1?"file":"files"} in ${s}`)}for(let i of[...t].sort())n.push(`withheld: ${i}`);return{lines:n,named:r}}var fN,gN,yN,wc=v(()=>{"use strict";fN=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs"]);gN=/\.(html?|css|js|mjs|cjs|map|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|otf|mp3|mp4|webm|txt|md)$/i,yN=/(^|\/)(\.|_)|(^|\/)[^/]*(secret|credential|password|token|key|\.pem|\.p12|\.pfx|backup|\.bak|answers?|solution)[^/]*$/i});import{createHash as vN}from"node:crypto";function Ai(e){return vN("sha256").update(e,"utf8").digest()[0]&127}var _c,ag=v(()=>{"use strict";_c=128});import{createHmac as bN,randomBytes as wN,timingSafeEqual as _N}from"node:crypto";function cg(e){return e.startsWith(sg)}function Ii(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${sg}${t||"unknown"}`}async function FS(e){if(!e.token)return e.sessionSecret?{playerId:xN(e.anonymousId,e.sessionSecret)??Ii(void 0)}:{playerId:Ii(e.anonymousId)};let t=e.resolver??zS,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:Ii(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function BS(e){let t=`${sg}${wN(16).toString("base64url")}`;return{playerId:t,token:kN(t,e)}}function WS(e,t){return bN("sha256",t).update(e).digest("base64url")}function kN(e,t){return`${e}${GS}${WS(e,t)}`}function xN(e,t){if(!e)return;let r=e.lastIndexOf(GS);if(r<=0)return;let o=e.slice(0,r);if(!cg(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(WS(o,t));if(n.length===i.length)return _N(n,i)?o:void 0}var sg,zS,GS,kc=v(()=>{"use strict";sg="anon:";zS={async resolve(){}};GS="."});function ir(e){return e instanceof Error?e.name:"unknown"}function Pn(e){console.error(SN,e)}function KS(e,t){console.error(EN,{violation:e,...t})}var SN,EN,xc=v(()=>{"use strict";SN="engine_error",EN="engine_integrity_violation"});function VS(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t^=t>>>16,t=Math.imul(t,2246822507)>>>0,t^=t>>>13,t=Math.imul(t,3266489909)>>>0,t^=t>>>16,t>>>0}function $N(e){let t=HS[VS(`a:${e}`)%HS.length],r=ZS[VS(`n:${e}`)%ZS.length];return`${t} ${r}`}function Sc(e,t){return t?.trim()||$N(e)}var HS,ZS,lg=v(()=>{"use strict";HS=["Amber","Brave","Bright","Calm","Clever","Copper","Eager","Early","Fleet","Gentle","Golden","Happy","Keen","Kind","Lucky","Merry","Nimble","Noble","Quick","Quiet","Rapid","Ready","Royal","Silver","Steady","Sunny","Swift","Tidy","True","Warm","Wise","Zesty"],ZS=["Badger","Beaver","Bison","Falcon","Ferret","Finch","Gibbon","Heron","Ibex","Jaguar","Kestrel","Lemur","Lynx","Marten","Meerkat","Osprey","Otter","Panda","Puffin","Quokka","Rabbit","Raven","Robin","Salmon","Sparrow","Stoat","Tapir","Teal","Vole","Walrus","Weasel","Wombat"]});import{createHash as TN}from"node:crypto";function wt(e){return Rx({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function YS(e){let t=Date.parse(e);if(Number.isNaN(t))return 1;let r=Date.parse(`${e.slice(0,10)}T00:00:00.000Z`)+864e5;return Math.max(1,Math.ceil((r-t)/1e3))}function Ec(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function AN(e){return TN("sha256").update(tc(e)).digest("hex")}function JS(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),l=()=>({server_time:i(),snapshot:e.runtime.snapshot}),d=S=>S;function p(S,w){return!n.settle||!S.round.can.results_available||w.outcome!=="pending"?w:n.settle({secret:S.secret,state:w,limits:S.limits,now:i()})}function h(S){if(!S.fusedUntil)return 0;let w=Math.ceil((Date.parse(S.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite(w)&&w>0?w:0}async function f(S,w){let C=e.fuse?.note(t,Ai(r),w);if(!C)return;let N=new Date(Date.parse(i())+C.holdSeconds*1e3).toISOString();if(C.kind==="stop")try{await o.setFuse(t,S,N)}catch(ee){Pn({event:"fuse_write_failed",tenant:t,round_id:S,name:ir(ee)})}try{await e.onFuse?.({...C,until:N})}catch(ee){Pn({event:"fuse_notify_failed",tenant:t,round_id:S,name:ir(ee)})}}function y(S){let w=h(S)>0,C=Ec({limits:S.limits,now:i()});return!w&&!C?S.round:{...S.round,can:{...S.round.can,accepting_plays:!1}}}function k(S,w){let C=S.round.number??Number.POSITIVE_INFINITY,N=w.round.number??Number.POSITIVE_INFINITY;return C!==N?C-N:S.round.id.localeCompare(w.round.id)}async function D(S){let w=S.round.id,C=await o.getState(t,w,r);return C?{state:C.state,version:C.version}:{state:{...n.initialState({playerId:r,roundId:w,limits:S.limits,now:i(),round:S.round,secret:S.secret}),started_at:i()},version:void 0}}async function b(S,w,C,N){if(w.timerSeconds===void 0||N!==void 0)return C;try{if(await o.putStateIfVersion(t,C,void 0))return C}catch(de){return Pn({event:"round_open_write_failed",tenant:t,round_id:S,name:ir(de)}),C}return(await o.getState(t,S,r))?.state??C}let $=(S,w,C)=>({...l(),play_id:s(),outcome:S,reason:w,round_version:C,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...l()}},async getCurrentRound(){let S=await o.getCurrentRound(t);if(!S)throw new Error(dg);return{...y(S),...l()}},async getRound(S){let w=await o.getRound(t,S);return w?{...y(w),...l()}:void 0},async getRoundPool(){let[S,w]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),C=w?.round.id,N=[...S].sort(k).map(ee=>{let de=y(ee);return{id:de.id,number:de.number,version:de.version,can:de.can,opens_at:de.opens_at,locks_at:de.locks_at,current:de.id===C,theme:typeof de.challenge?.theme=="string"?de.challenge.theme:""}});return{...l(),rounds:N}},async getPlayedRounds(){let S=await o.listStatesForPlayer(t,r);return{...l(),player_id:r,played:S.map(w=>({round_id:w.round_id,finished:w.finished,score:w.score,outcome:w.outcome})).sort((w,C)=>w.round_id.localeCompare(C.round_id))}},async getNextRound(){let[S,w]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),C=new Set(w.filter(me=>me.finished).map(me=>me.round_id)),N=new Set(w.map(me=>me.round_id)),ee=[...S].filter(me=>y(me).can.accepting_plays&&!C.has(me.round.id)).sort(k),de=ee.find(me=>!N.has(me.round.id))??ee[0];return de?{...l(),status:"ready",round:{...y(de),...l()}}:{...l(),status:"exhausted"}},async getRoundState(S){let w=await o.getRound(t,S);if(!w)throw new Error(dg);let C=d(w),{state:N,version:ee}=await D(C),de=await b(S,C.limits,N,ee),me=p(C,de);return me!==de&&me.finished&&await o.recordScore(t,S,r,me.score),{...me,...l()}},async getProfile(){let S=await o.getProfile(t,r);return{...S,display_name:Sc(r,S.display_name),...l()}},async getLeaderboard(S){let w=await o.getCurrentRound(t),C=w?.round.id??"",N=w?.limits;return{...await o.getLeaderboard(t,C,{limit:S,viewerId:r,order:N?.scoreOrder??"high_first"}),...l()}},async play(S,w){let C=await o.getRound(t,S);if(!C)return $("rejected",dg,0);let N=d(C);if(e.runtime.identity?.required&&cg(r))return $("rejected",e.identityRefusal??"identity_required",N.round.version);if(h(N)>0)return{...$("busy","fair_use",N.round.version),retry_after_seconds:h(N)};if(N.limits.playsPerSecond!==void 0){let q=i().slice(0,19),Se=await o.countPlay(t,S,q,r,3600),ut=Math.max(1,Math.ceil(N.limits.playsPerSecond/Se.buckets));if(Se.inBucket>ut)return await f(S,q),{...$("busy","capped",N.round.version),retry_after_seconds:1}}if(N.limits.playsPerDay!==void 0){let q=i().slice(0,10);if(await o.countGameDay(t,S,q,YS(i())+3600)>N.limits.playsPerDay)return await f(S,q),{...$("busy","capped_today",N.round.version),retry_after_seconds:YS(i())}}let ee=AN({round_id:S,round_version:w.round_version,challenge_instance_id:w.challenge_instance_id,payload:w.payload}),de=q=>q.intent!==void 0&&q.intent.fingerprint!==ee,me=await o.getPlay(t,r,w.idempotency_key);if(me)return de(me)?$("rejected",qS,N.round.version):{...me.result,...l(),outcome:"duplicate"};let Ce=Jk(w.payload,n.archetype),Ct=Ce!==void 0&&(n.operations?n.operations.includes(Ce):Xk(n.archetype,Ce));if(w.payload.op!==void 0&&!Ct)return $("rejected","unknown_operation",N.round.version);let{state:he,version:Ne}=await D(N),yt=n.admissible({accepting:N.round.can.accepting_plays,roundVersion:N.round.version,playedVersion:w.round_version,challengeInstanceId:N.round.challenge_instance_id??null,playedChallengeInstanceId:w.challenge_instance_id??null,state:he,secret:N.secret,limits:N.limits,now:i()});if(!yt.ok){let q=yt.reason==="round_version"?"stale":"rejected";return $(q,yt.reason,N.round.version)}if(Ec({limits:N.limits,now:i()}))return $("rejected","lock_deadline_passed",N.round.version);let se=n.mark({payload:w.payload,secret:N.secret,state:he,limits:N.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(se.outcome!=="accepted")return $("rejected",se.reason??"rejected",N.round.version);let $e={...l(),play_id:s(),outcome:se.outcome,round_version:N.round.version,marked:se.marked,feedback:se.feedback,round_state:{...se.next,...l()}},X=`play:${JSON.stringify([t,r,w.idempotency_key])}`,dt=[{id:X,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"play.committed",detail:{play_id:$e.play_id,idempotency_key:w.idempotency_key,outcome:$e.outcome,marked:$e.marked,round_version:$e.round_version,score_before:he.score,score_after:se.next.score,attempts_used:se.next.attempts_used,attempts_allowed:se.next.attempts_allowed,mistakes_used:se.next.mistakes_used,mistakes_allowed:se.next.mistakes_allowed,...n.auditDetail({secret:N.secret,before:he,decision:se,payload:w.payload})}}],Ge=se.marked&&(se.participation?.score??!0),jn=se.participation?.profile??!0;Ge&&dt.push({id:`score:${JSON.stringify([t,r,w.idempotency_key])}`,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"score.recorded",detail:{play_id:$e.play_id,score_before:he.score,score_after:se.next.score,marked:!0,outcome:se.next.outcome}});let _e=jn&&se.next.finished&&!he.finished?ec(await o.getProfile(t,r),se.next.outcome):void 0,Je=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:w.idempotency_key,date:i().slice(0,10),play:{result:$e,intent:{fingerprint:ee,round_id:S,round_version:w.round_version}},state:se.next,expectedVersion:Ne,audit:dt,...Ge?{score:{roundId:S,score:se.next.score}}:{},..._e?{profile:_e}:{},round:{roundId:S,version:N.round.version,sharded:N.sharded===!0}});if(!Je.ok&&Je.reason==="contended")return $("busy","contended",N.round.version);if(!Je.ok&&Je.reason==="play_exists"){let q=await o.getPlay(t,r,w.idempotency_key);return q&&de(q)?$("rejected",qS,N.round.version):q?{...q.result,...l(),outcome:"duplicate"}:(Pn({stage:"play_receipt_missing",tenant:t,round_id:S,player_id:r}),$("rejected","play_conflict",N.round.version))}if(!Je.ok&&Je.reason==="round_changed"){let q=await o.getRound(t,S),Se=q===void 0||q.round.version!==N.round.version,ut=Se?"round_changed":"round_closed";return await o.appendAudit({id:X,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:$e.play_id,idempotency_key:w.idempotency_key,reason:ut,decided_against_version:N.round.version,attempt_spent:!1}}),$(Se?"stale":"rejected",ut,q?.round.version??N.round.version)}return Je.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),$e):(await o.appendAudit({id:X,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:$e.play_id,idempotency_key:w.idempotency_key,reason:"round_version",attempt_spent:!1}}),$("stale","round_version",N.round.version))}}}var _t,qS,dg,Wt=v(()=>{"use strict";ag();kc();xc();lg();ke();_t="time_expired";qS="idempotency_conflict",dg="round_not_found"});function IN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function CN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter($=>r.targets.includes($)&&!i.has($)),s=t.picks.filter($=>!r.targets.includes($)),l=o.attempts_used+1,d=o.mistakes_used+(s.length>0?1:0);for(let $ of a)i.add($);let p=i.size>=r.required,h=d>=n.mistakesAllowed,f=l>=n.attemptsAllowed,y=p||h||f,k=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(p?r.completionBonus:0),D={...o,server_time:e.now,attempts_used:l,attempts_allowed:n.attemptsAllowed,mistakes_used:d,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:k,finished:y,outcome:e.markAtSettlement?"pending":p?"won":y?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:D}:{outcome:"accepted",marked:!0,feedback:t.picks.map($=>({key:$,verdict:r.targets.includes($)?"correct":"wrong"})),next:D}}function PN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var ug,pg=v(()=>{"use strict";Wt();ug={archetype:"hunt",admissible:IN,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return CN({...e,attempt:{picks:t}})},initialState:PN,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}}});function hg(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function ON(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function NN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function RN(e){let{secret:t,state:r,limits:o}=e,n=hg(r),i=$=>({outcome:"rejected",reason:$,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,l=a.entries.find($=>$.key===s);if(!l)return i("not_on_slate");let d=n.total+l.value,p=d>t.target,h=[...n.picks,{slate:a.id,key:l.key,label:l.label,value:l.value}],f=r.attempts_used+1,y=f>=o.picksAllowed,k=p||y,D={...r,server_time:e.now,attempts_used:f,attempts_allowed:o.picksAllowed,progress:{total:d,picks:h,bust:p,...k?{tier:ON(t,d)}:{}},score:e.markAtSettlement?r.score:p?t.target-d:d,finished:k,outcome:e.markAtSettlement?"pending":p?"lost":k?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:D}:{outcome:"accepted",marked:!0,feedback:[{key:l.key,verdict:p?"wrong":"correct",label:String(l.value)}],next:D}}function LN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var mg,fg=v(()=>{"use strict";Wt();mg={archetype:"push",admissible:NN,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return RN({...e,attempt:{picks:t}})},initialState:LN,auditDetail({secret:e,before:t,decision:r}){let o=hg(t),n=hg(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}}});function MN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function UN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(N=>!i.has(N.key)),l=s.find(N=>DN(N.members,t.picks)),d=o.attempts_used+1,p=o.mistakes_used+(l?0:1);l&&(i.add(l.key),a.push({key:l.key,label:l.label,members:[...l.members]}));let h=i.size>=r.groups.length,f=p>=n.mistakesAllowed,y=d>=n.attemptsAllowed,k=h||f||y,D=e.markAtSettlement?o.score:o.score+(l?r.pointsPerGroup:0)+(h?r.completionBonus:0),b={...o,server_time:e.now,attempts_used:d,attempts_allowed:n.attemptsAllowed,mistakes_used:p,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:D,finished:k,outcome:e.markAtSettlement?"pending":h?"won":k?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:b};let $=s.reduce((N,ee)=>Math.max(N,jN(t.picks,ee)),0),S=!l&&t.picks.length>1&&$===t.picks.length-1,w=l?"correct":S?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map((N,ee)=>({key:N,verdict:w,...l&&ee===0?{label:l.label}:{}})),next:b}}function zN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var DN,jN,XS,QS=v(()=>{"use strict";Wt();DN=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,jN=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;XS={archetype:"group",admissible:MN,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return UN({...e,attempt:{picks:t}})},initialState:zN,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}}});function FN(e,t){if(t.answers)return t.answers;if(t.pick===void 0)return{};let r=e.questions[0];return r?{[r.id]:t.pick}:{}}function GN(e,t){return e.kind==="number"?!(typeof t!="number"||!Number.isFinite(t)||e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max):typeof t=="string"&&(e.options??[]).some(r=>r.key===t)}function BN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function WN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=FN(r,t),a=o.attempts_used+1;if(r.questions.filter(p=>i[p.id]===void 0).length>0)return{outcome:"rejected",reason:"incomplete_prediction",marked:!1,feedback:[],next:o};let l=r.questions.find(p=>!GN(p,i[p.id]));if(l)return{outcome:"rejected",reason:l.kind==="number"?"out_of_range":"unknown_option",marked:!1,feedback:[],next:o};let d={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,answers:i},finished:a>=n.attemptsAllowed};return r.questions.some(p=>p.result===void 0)?{outcome:"accepted",marked:!1,feedback:[],next:{...d,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:KN(r,i),next:eE(r,d,i)}}function KN(e,t){return e.questions.map(r=>{let o=t[r.id],n=Hs(r,o,e.pointsForCorrect),i=r.kind==="number"?String(r.result):(r.options??[]).find(a=>a.key===r.result)?.label;return{key:r.id,verdict:n===e.pointsForCorrect||n>0&&r.kind!=="number"?"correct":n>0?"partial":"wrong",...i?{label:i}:{}}})}function eE(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=Hs(i,r[i.id],e.pointsForCorrect);o+=a,a!==Hs(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function HN(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=ZN(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...eE(t,r,o),server_time:e.now}}function ZN(e){let t=e.progress.answers;if(t&&typeof t=="object"&&!Array.isArray(t))return t;let r=Array.isArray(e.progress.picks)?e.progress.picks:[];return r.length>0?{1:r[0]}:{}}function VN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{answers:{}},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var tE,nE=v(()=>{"use strict";ke();Wt();tE={archetype:"predict",admissible:BN,mark(e){let t=e.payload.answers,r=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,o=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:void 0;return WN({...e,attempt:r?{answers:r}:{pick:o}})},initialState:VN,settle:HN,auditDetail({secret:e,decision:t,payload:r}){let o=r.answers;return{predicted:o&&typeof o=="object"&&!Array.isArray(o)?o:typeof r.pick=="string"&&e.questions[0]?{[e.questions[0].id]:r.pick}:null,settled_at_commit:e.questions.every(i=>i.result!==void 0),marked:t.marked,questions_asked:e.questions.length}}}});function YN(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function gg(e){let r=e.progress?.boards;if(!(!Array.isArray(r)||r.length===0)&&r.every(o=>Array.isArray(o)&&o.every(n=>typeof n=="string")))return r}function qN(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function JN(e){let t=gg(e),r=qN(e);if(!t||r===void 0)return;let o=t[r];if(!o)return;let n=e.progress,i=typeof n?.centre=="string"?n.centre:void 0;return{cells:o,centre:i}}function XN(e){let t=YN(e),r=[...e.cardPool],o=[],n={},i={};for(let a=0;a<t&&r.length>0;a++){let s=Math.floor(Math.random()*r.length),l=r.splice(s,1)[0];o.push(l.key),n[l.key]=l.label,l.note&&(i[l.key]=l.note)}return{board:o,cards:n,notes:i}}function rE(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function QN(e,t){let{rows:r,columns:o,centreMode:n}=e,i=n!=="none",a=i?Math.floor(r/2):-1,s=i?Math.floor(o/2):-1,l=(p,h)=>{if(i&&p===a&&h===s)return t.centre;let f=p*o+h,y=i&&f>a*o+s?1:0;return t.cells[f-y]},d=[];for(let p of e.lineTypes)if(p==="row")for(let h=0;h<r;h++)d.push(Array.from({length:o},(f,y)=>l(h,y)).filter(f=>!!f));else if(p==="column")for(let h=0;h<o;h++)d.push(Array.from({length:r},(f,y)=>l(y,h)).filter(f=>!!f));else if(p==="diagonal"&&r===o)d.push(Array.from({length:r},(h,f)=>l(f,f)).filter(h=>!!h)),d.push(Array.from({length:r},(h,f)=>l(f,r-1-f)).filter(h=>!!h));else if(p==="full_board"){let h=[...t.cells,...t.centre?[t.centre]:[]];d.push(h)}return d.filter(p=>p.length>0)}function eR(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:Ec({limits:e.limits,now:e.now})?{ok:!1,reason:"lock_deadline_passed"}:e.state.finished?{ok:!1,reason:"already_locked"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function tR(e){let{secret:t,state:r,limits:o}=e;if(gg(r)!==void 0)return{outcome:"rejected",reason:"already_dealt",marked:!1,feedback:[],next:r};let n=Math.max(1,o.shuffleAllowance+1),i=[],a={},s={};for(let l=0;l<n;l++){let d=XN(t);i.push(d.board),Object.assign(a,d.cards),Object.assign(s,d.notes)}return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,attempts_used:o.shuffleAllowance,attempts_allowed:o.shuffleAllowance,progress:{...r.progress,boards:i,cards:a,...Object.keys(s).length>0?{notes:s}:{}}}}}function nR(e){let{secret:t,state:r}=e,o=gg(r);if(o===void 0)return{outcome:"rejected",reason:"no_board_dealt",marked:!1,feedback:[],next:r};let n=typeof e.board=="number"?e.board:void 0;if(n===void 0||!Number.isInteger(n)||n<0||n>=o.length)return{outcome:"rejected",reason:"unknown_board",marked:!1,feedback:[],next:r};let i={cells:o[n]},a=typeof e.centre=="string"?e.centre:void 0;if(t.centreMode==="none"){if(a!==void 0)return{outcome:"rejected",reason:"centre_not_offered",marked:!1,feedback:[],next:r}}else if(t.centreMode==="choice"){if(a===void 0||!(t.centreOptions??[]).includes(a))return{outcome:"rejected",reason:"invalid_centre",marked:!1,feedback:[],next:r};if(!t.allowCentreDuplicate&&i.cells.includes(a))return{outcome:"rejected",reason:"centre_duplicates_board",marked:!1,feedback:[],next:r}}let s=t.centreMode==="choice"?a:void 0;return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,finished:!0,outcome:"pending",progress:{...r.progress,chosen:n,...s?{centre:s}:{}}}}}function rR(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=JN(r);if(o===void 0)return r;let n=QN(t,o),i=n.filter(f=>rE(f,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(f=>t.cardStatus?.[f]==="correct"),l=a.some(f=>t.cardStatus?.[f]===void 0),d=i*t.pointsPerLine+(s?t.pointsForFullBoard:0),p={};for(let f of a){let y=t.cardStatus?.[f];y&&(p[f]=y)}let h=n.map(f=>{let y=rE(f,t.cardStatus),k=f.filter(b=>t.cardStatus?.[b]==="correct").length,D=f.some(b=>t.cardStatus?.[b]==="incorrect");return{cards:f,complete:y,oneAway:!y&&!D&&k===f.length-1}});return{...r,server_time:e.now,score:d,progress:{...r.progress,marks:p,lines:h},outcome:l?"pending":i>0||s?"won":"lost"}}function oR(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.shuffleAllowance,mistakes_used:0,mistakes_allowed:0,progress:{},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}function iR(e){return e.op==="deal"||e.op==="reshuffle"?tR({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?nR({secret:e.secret,state:e.state,centre:e.centre,board:e.board,now:e.now}):{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}}var oE,iE=v(()=>{"use strict";Wt();oE={archetype:"bingo",admissible:eR,mark(e){let t=e.payload.op;return t!=="deal"&&t!=="reshuffle"&&t!=="lock"?{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}:iR({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:oR,settle:rR,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});import{createHmac as aR}from"node:crypto";function Ci(e,t,r){return aR("sha256",Buffer.from(e.entropy,"hex")).update(["gamestage-shoot",t,e.roundId,e.playerId,e.model,e.profile,String(e.shotIndex)].join("|")).digest().readUInt32BE(0)%r}function sE(e){let t=aE[e.profile];return{targetX:Ci(e,"keeper_x",2*t.diveMaxX+1)-t.diveMaxX,targetY:Ci(e,"keeper_y",t.diveMaxY-t.diveMinY+1)+t.diveMinY,reactionMs:Ci(e,"keeper_reaction",t.reactionMaxMs-t.reactionMinMs+1)+t.reactionMinMs,dispersionX:Ci(e,"dispersion_x",2001)-1e3,dispersionY:Ci(e,"dispersion_y",2001)-1e3}}function cE(e,t,r){let o=aE[r],n=Mt,i=n.ballRadius,a=o.maxFlightMs-Math.floor((o.maxFlightMs-o.minFlightMs)*e.power/1e3),s=o.baseSpread+Math.floor(o.spreadPerPower*e.power/1e3),l=e.aimX+Math.trunc(t.dispersionX*s/1e3),d=Math.max(i,e.aimY+Math.trunc(t.dispersionY*s/1e3)),p=100+Math.floor((1e3-e.power)/5),h=Math.max(0,a-t.reactionMs),f=Math.floor(h*o.speedPerSecond/1e3),y=t.targetX-n.keeperStart.x,k=t.targetY-n.keeperStart.y,D=Math.round(Math.hypot(y,k)),b=D===0?0:Math.min(1,f/D),$=n.keeperStart.x+Math.trunc(y*b),S=n.keeperStart.y+Math.trunc(k*b),w={startX:n.keeperStart.x,startY:n.keeperStart.y,endX:$,endY:S,diveStartMs:t.reactionMs},C={endX:l,endY:d,arcHeight:p},N=(he,Ne)=>({result:he,replay:{flightMs:a,ball:C,keeper:w,contact:Ne}}),ee=Math.abs(l),de=ee+i>=n.postX&&ee-i<=n.postX+n.postWidth&&d-i<=n.barY+n.barHeight,me=d+i>=n.barY&&d-i<=n.barY+n.barHeight&&ee-i<=n.postX+n.postWidth;return de?N("frame",{with:"post",x:Math.sign(l||1)*n.postX,y:d,atMs:a}):me?N("frame",{with:"bar",x:l,y:n.barY,atMs:a}):ee+i<n.postX&&d+i<n.barY?Math.abs(l-$)<=o.reachX+i&&Math.abs(d-S)<=o.reachY+i?N("saved",{with:"keeper",x:l,y:d,atMs:a}):N("goal",null):N("wide",null)}var aE,lE=v(()=>{"use strict";Wr();aE={easy_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:180,reactionMaxMs:340,speedPerSecond:1600,reachX:220,reachY:260},balanced_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:120,reactionMaxMs:280,speedPerSecond:2200,reachX:280,reachY:320},hard_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:80,reactionMaxMs:200,speedPerSecond:2800,reachX:320,reachY:360}}});function sR(e,t){let r=e.progress;return{kind:"shoot",model:r.model??t.model,profile:r.profile??t.profile,goals:typeof r.goals=="number"?r.goals:0,shots:Array.isArray(r.shots)?r.shots:[]}}function cR(e){return typeof e=="string"&&/^[0-9a-f]{64}$/.test(e)}function lR(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"shootout_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function dR(e){if(e.code==="unrecognized_keys")return"unexpected_field";let t=String(e.path[0]??"");return t==="op"?"unknown_operation":t==="model"?"unknown_model":t==="aimX"||t==="aimY"?"aim_out_of_range":t==="power"?"power_out_of_range":"invalid_shot"}function uR(e){let{secret:t,state:r,limits:o}=e,n=S=>({outcome:"rejected",reason:S,marked:!1,feedback:[],next:r});if(!cR(t.entropy))return n("entropy_missing");if(t.model!==xn)return n("unknown_model");let i=vf.safeParse(e.payload.op===void 0?{...e.payload,op:Br}:e.payload);if(!i.success)return n(dR(i.error.issues[0]));let a=i.data;if(r.attempts_used>=o.attemptsAllowed)return n("shootout_spent");if(a.shotIndex!==r.attempts_used)return n("shot_index_mismatch");let s=sE({entropy:t.entropy,roundId:r.round_id,playerId:r.player_id,model:t.model,profile:t.profile,shotIndex:a.shotIndex}),l=cE({aimX:a.aimX,aimY:a.aimY,power:a.power},s,t.profile),d=sR(r,t),p=l.result==="goal",h=p?t.pointsPerGoal:0,f=d.goals+(p?1:0),y={shotIndex:a.shotIndex,aimX:a.aimX,aimY:a.aimY,power:a.power,result:l.result,points:h,replay:l.replay},k=r.attempts_used+1,D=k>=o.attemptsAllowed,b={...r,server_time:e.now,attempts_used:k,attempts_allowed:o.attemptsAllowed,progress:{...d,goals:f,shots:[...d.shots,y]},score:f*t.pointsPerGoal,finished:D,outcome:D?f>=t.goalsToWin?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:[{key:`shot-${a.shotIndex}`,verdict:p?"correct":"wrong",label:l.result}],next:b}}function pR(e){let t=e.secret??{};return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{kind:"shoot",model:t.model??xn,profile:t.profile??mi,goals:0,shots:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var dE,uE=v(()=>{"use strict";ke();Wt();lE();dE={archetype:"shoot",admissible:lR,mark:uR,initialState:pR,auditDetail({before:e,decision:t,payload:r}){let o=t.next.progress.shots?.at(-1),n=t.outcome==="accepted"&&o!==void 0;return{op:r.op??Br,accepted:n,...t.outcome==="rejected"?{refused:t.reason}:{},...n?{shot_index:o.shotIndex,aim_x:o.aimX,aim_y:o.aimY,power:o.power,result:o.result,points:o.points,goals_before:e.progress.goals??0,goals_after:t.next.progress.goals??0}:{}}}}});function hR(e){let t=e.progress;return{kind:"place",filled:typeof t.filled=="number"?t.filled:0,placements:Array.isArray(t.placements)?t.placements:[],skipsUsed:typeof t.skipsUsed=="number"?t.skipsUsed:0}}function mR(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"deck_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function gR(e){let{secret:t,state:r,limits:o}=e,n=hR(r),i=f=>({outcome:"rejected",reason:f,marked:!1,feedback:[],next:r}),a=e.payload.op===void 0?"place":e.payload.op;if(a!=="place"&&a!=="skip")return i("unknown_operation");for(let f of Object.keys(e.payload))if(!fR[a].includes(f))return i("unexpected_field");let s=e.payload.itemIndex;if(typeof s!="number"||!Number.isInteger(s)||s<0)return i("invalid_item");if(s!==r.attempts_used)return i("item_index_mismatch");if(r.attempts_used>=o.attemptsAllowed)return i("deck_spent");let l=(f,y)=>{let k=r.attempts_used+1,D=r.mistakes_used+(y.mistake?1:0),b={...n,...f},$=b.filled>=t.cells.length,S=D>=o.mistakesAllowed,w=k>=o.attemptsAllowed,C=$||S||w,N={...r,server_time:e.now,attempts_used:k,attempts_allowed:o.attemptsAllowed,mistakes_used:D,mistakes_allowed:o.mistakesAllowed,progress:b,score:b.filled*t.pointsPerPlacement+($?t.fullHouseBonus:0),finished:C,outcome:C?$?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:y.feedback,next:N}};if(a==="skip")return n.skipsUsed>=o.skipsAllowed?i("skips_exhausted"):l({skipsUsed:n.skipsUsed+1},{mistake:!1,feedback:[]});let d=e.payload.cell;if(typeof d!="string"||!t.cells.includes(d))return i("unknown_cell");if(n.placements.some(f=>f.cell===d))return i("cell_filled");let p=t.deck[s];return(p!==void 0&&t.qualifies[p]?.includes(d))??!1?l({filled:n.filled+1,placements:[...n.placements,{itemIndex:s,cell:d}]},{mistake:!1,feedback:[{key:d,verdict:"correct"}]}):l({},{mistake:!0,feedback:[{key:d,verdict:"wrong"}]})}function yR(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{kind:"place",filled:0,placements:[],skipsUsed:0},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var fR,pE,hE=v(()=>{"use strict";Wt();fR={place:["op","itemIndex","cell"],skip:["op","itemIndex"]};pE={archetype:"place",operations:["place","skip"],admissible:mR,mark:gR,initialState:yR,auditDetail({before:e,decision:t,payload:r}){let o=t.outcome==="accepted",n=o&&t.feedback[0]?.verdict==="correct";return{op:r.op??"place",accepted:o,...t.outcome==="rejected"?{refused:t.reason}:{},...o?{item_index:typeof r.itemIndex=="number"?r.itemIndex:null,cell:typeof r.cell=="string"?r.cell:null,placed:n,filled_before:e.progress.filled??0,filled_after:t.next.progress.filled??0}:{}}}}});function vR(e){return mE[We(e)]}function fE(e){return vR(e.archetype??"hunt")}function gE(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard","rounds"]}}var mE,ar,$c=v(()=>{"use strict";ke();pg();fg();QS();nE();iE();uE();hE();mE={hunt:ug,push:mg,group:XS,predict:tE,bingo:oE,shoot:dE,place:pE},ar=Object.keys(mE)});function yE(e){let t=fE(e.round);if(t)return JS({...e,rules:t})}var vE=v(()=>{"use strict";Wt();$c();pg();fg();Wt()});function bE(e){let t=new Map,r=new Map,o=(b,$)=>`${$}#${b}`,n=new Map,i=new Map,a=new Map,s=new Map,l=new Map,d=new Set,p=new Map,h=new Map,f=new Map,y=e.currentRoundId,k,D=e.now??Date.now;for(let b of e.rounds)t.set(b.round.id,b);for(let b of e.states??[])n.set(Le(e.tenant,b.round_id,b.player_id),{state:b,version:0});return{async getRound(b,$){let S=t.get($);return S?structuredClone(S):void 0},async putRound(b,$,S,w){if(w&&h.has(w.id))throw new Error("audit_record_exists");for(let C=0;C<_c;C+=1)r.set(o($.round.id,C),{version:$.round.version,accepting:$.round.can.accepting_plays});t.set($.round.id,{...structuredClone($),sharded:!0}),w&&h.set(w.id,structuredClone(w)),S&&(y=$.round.id,k=void 0)},async setRotation(b,$,S){k={roundIds:[...$],windowSeconds:S}},async getCurrentRound(){let b=k?k.roundIds[Math.floor(D()/1e3/k.windowSeconds)%k.roundIds.length]:y,$=t.get(b);return $?structuredClone($):void 0},async listRounds(){return[...t.values()].map(b=>structuredClone(b))},async listStatesForPlayer(b,$){return[...n.entries()].filter(([S,w])=>S.startsWith(`${b}#`)&&w.state.player_id===$).map(([,S])=>structuredClone(S.state))},async getState(b,$,S){let w=n.get(Le(b,$,S));return w?structuredClone(w):void 0},async putStateIfVersion(b,$,S){let w=Le(b,$.round_id,$.player_id),C=n.get(w);return S===void 0?C?!1:(n.set(w,{state:structuredClone($),version:0}),!0):!C||C.version!==S?!1:(n.set(w,{state:structuredClone($),version:C.version+1}),!0)},async getPlay(b,$,S){let w=i.get(Le(b,$,S));return w?structuredClone(w):void 0},async putPlayIfAbsent(b,$,S,w){let C=Le(b,$,S);return i.has(C)?!1:(i.set(C,structuredClone(w)),!0)},async getLeaderboard(b,$,S){let w=S?.order??"high_first";if(e.leaderboard)return structuredClone(e.leaderboard);let C=[...a.entries()].filter(([ee])=>ee.startsWith(Le(b,$)+"#")).map(([ee,de])=>({rank:0,player_id:ee.slice(ee.lastIndexOf("#")+1),display_name:Sc(ee.slice(ee.lastIndexOf("#")+1)),score:de})).sort((ee,de)=>w==="low_first"?ee.score-de.score:de.score-ee.score).map((ee,de)=>({...ee,rank:de+1})),N=S?.limit??C.length;return{server_time:"",snapshot:"",round_id:$,order:w,tie_break:"earliest_play",entries:C.slice(0,N),total:C.length,truncated:!1,me:S?.viewerId?C.find(ee=>ee.player_id===S.viewerId):void 0}},async getProfile(b,$){let S=f.get(Le(b,$));return S?structuredClone(S):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:$,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(b,$,S,w,C){let N=Le(b,$,S,String(Ai(w))),ee=(s.get(N)??0)+1;return s.set(N,ee),{inBucket:ee,buckets:_c}},async countGameDay(b,$,S,w){let C=Le(b,$,S,"game"),N=(s.get(C)??0)+1;return s.set(C,N),N},async getDailyActivity(b,$){return $.map(S=>({date:S,plays:l.get(Le(b,S))??0,players:null}))},async markMonthlyPlayer(b,$,S){let w=`${Le(b,$)}#${S}`;if(d.has(w))return;d.add(w);let C=Le(b,$);p.set(C,(p.get(C)??0)+1)},async getMonthlyPlayers(b,$){return p.get(Le(b,$))??0},async setFuse(b,$,S){let w=t.get($);w&&(w.fusedUntil=S)},async setResult(b,$,S,w){let C=t.get($);if(!C)return;let ee=C.secret.questions??[],de=Object.fromEntries(ee.map(he=>[he.id,he.result??null]));if(typeof S=="string")ee[0]&&(ee[0].result=S);else for(let he of ee){let Ne=S[he.id];Ne!==void 0&&(he.result=Ne)}let me=ee.every(he=>he.result!==void 0);C.round.challenge={...C.round.challenge,...me?{questions:ee.map(he=>({...C.round.challenge.questions?.find(Ne=>Ne.id===he.id),id:he.id,result:he.result})),...typeof S=="string"?{result:S}:{}}:{}},C.round.can={...C.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0};for(let he=0;he<_c;he+=1){let Ne=r.get(o($,he));Ne&&(Ne.accepting=!1)}let Ce=new Date().toISOString(),Ct={id:`settle_${$}_${Ce}_${h.size}`,at:Ce,tenant:b,round_id:$,player_id:null,action:"round.settled",detail:{version:C.round.version,result:S,before:de,after:Object.fromEntries(ee.map(he=>[he.id,he.result??null])),closed:!0},...w?{actor:w.actor}:{},...w?.correlation_id?{correlation_id:w.correlation_id}:{}};h.set(Ct.id,structuredClone(Ct))},async recordScore(b,$,S,w){a.set(Le(b,$,S),w)},async appendAudit(b){if(h.has(b.id))throw KS("audit_record_overwrite",{tenant:b.tenant,round_id:b.round_id,action:b.action,record_id:b.id}),new Error("audit_record_exists");h.set(b.id,structuredClone(b))},async commitPlay(b){let $=Le(b.tenant,b.playerId,b.idempotencyKey);if(i.has($))return{ok:!1,reason:"play_exists"};let S=Le(b.tenant,b.state.round_id,b.state.player_id),w=n.get(S);if(b.expectedVersion===void 0){if(w)return{ok:!1,reason:"state_version"}}else if(!w||w.version!==b.expectedVersion)return{ok:!1,reason:"state_version"};for(let N of b.audit)if(h.has(N.id))throw new Error("audit_record_exists");if(b.round?.sharded){let N=r.get(o(b.round.roundId,Ai(b.playerId)));if(!N||N.version!==b.round.version||!N.accepting)return{ok:!1,reason:"round_changed"}}else if(b.round){let N=t.get(b.round.roundId);if(!N||N.round.version!==b.round.version||!N.round.can.accepting_plays)return{ok:!1,reason:"round_changed"}}i.set($,structuredClone(b.play)),n.set(S,{state:structuredClone(b.state),version:b.expectedVersion===void 0?0:b.expectedVersion+1});for(let N of b.audit)h.set(N.id,structuredClone(N));b.score&&a.set(Le(b.tenant,b.score.roundId,b.playerId),b.score.score),b.profile&&f.set(Le(b.tenant,b.playerId),structuredClone(b.profile));let C=Le(b.tenant,b.date);return l.set(C,(l.get(C)??0)+1),{ok:!0}}}}var Le,wE=v(()=>{"use strict";lg();ag();xc();Le=(...e)=>e.join("#")});import{randomBytes as bR}from"node:crypto";function wR(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function _R(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{theme:e.theme,prompt:e.prompt,target:e.target,target_label:e.targetLabel,unit:e.unit,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel,...e.line?{line:e.line}:{}},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function kR(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function xR(e,t){let r=G_(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open&&!o,results_available:o,solution_revealed:o,closed:!e.open||o,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,questions:r.map(i=>({id:i.id,kind:i.kind,prompt:i.prompt,...i.options?{options:i.options.map(a=>({key:a.key,label:a.label}))}:{},...i.min!==void 0?{min:i.min}:{},...i.max!==void 0?{max:i.max}:{},...i.step!==void 0?{step:i.step}:{},...o&&i.result!==void 0?{result:i.result}:{}})),...e.options?{options:e.options.map(i=>({key:i.key,label:i.label}))}:{},...o&&e.result!==void 0?{result:e.result}:{}}},secret:{questions:r,pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function SR(e,t){let r=AR(e,t);return e.archetype==="bingo"?e.locksAt===void 0?r:{...r,round:{...r.round,locks_at:e.locksAt},limits:{...r.limits,locksAt:e.locksAt}}:e.timerSeconds===void 0?r:{...r,round:{...r.round,timer_seconds:e.timerSeconds},limits:{...r.limits,timerSeconds:e.timerSeconds}}}function ER(e,t){let r=e.cardPool.some(i=>i.result!==void 0),o=e.cardPool.length>0&&e.cardPool.every(i=>i.result!==void 0);return{archetype:"bingo",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:r,solution_revealed:o,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,rows:e.rows,columns:e.columns,centre_mode:e.centreMode,...e.centreMode==="choice"?{centre_options:e.centreOptions??[]}:{},line_types:e.lineTypes,points_per_line:e.pointsPerLine,points_for_full_board:e.pointsForFullBoard}},secret:{rows:e.rows,columns:e.columns,centreMode:e.centreMode,...e.centreOptions?{centreOptions:e.centreOptions}:{},allowCentreDuplicate:e.allowCentreDuplicate,lineTypes:e.lineTypes,cardPool:e.cardPool.map(i=>({key:i.key,label:i.label,...i.note?{note:i.note}:{}})),cardStatus:Object.fromEntries(e.cardPool.filter(i=>i.result!==void 0).map(i=>[i.key,i.result])),pointsPerLine:e.pointsPerLine,pointsForFullBoard:e.pointsForFullBoard},limits:{shuffleAllowance:e.shuffleAllowance,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function $R(e,t){return{archetype:"shoot",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,model:e.model,profile:e.difficulty,shots_allowed:e.shotsAllowed,goals_to_win:e.goalsToWin,points_per_goal:e.pointsPerGoal,input:{aim_x:[nt.aimX.min,nt.aimX.max],aim_y:[nt.aimY.min,nt.aimY.max],power:[nt.power.min,nt.power.max]},geometry:{post_x:Mt.postX,bar_y:Mt.barY,post_width:Mt.postWidth,bar_height:Mt.barHeight,ball_radius:Mt.ballRadius,keeper_start:{x:Mt.keeperStart.x,y:Mt.keeperStart.y}}}},secret:{model:e.model,profile:e.difficulty,shotsAllowed:e.shotsAllowed,goalsToWin:e.goalsToWin,pointsPerGoal:e.pointsPerGoal},limits:{attemptsAllowed:e.shotsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function TR(e,t){let r={server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,board:e.board.map(n=>({key:n.key,label:n.label,...n.art!==void 0?{art:n.art}:{}})),deck:e.deck.map(n=>({key:n.key,name:n.name,...n.image!==void 0?{image:n.image}:{}})),points_per_placement:e.pointsPerPlacement,full_house_bonus:e.fullHouseBonus}},o={};for(let n of e.deck)o[n.key]=[];for(let n of e.qualifies)o[n.item]=n.cells;return{archetype:"place",round:r,secret:{cells:e.board.map(n=>n.key),deck:e.deck.map(n=>n.key),qualifies:o,pointsPerPlacement:e.pointsPerPlacement,fullHouseBonus:e.fullHouseBonus},limits:{attemptsAllowed:e.deck.length,mistakesAllowed:e.mistakesAllowed,skipsAllowed:e.skipsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function AR(e,t){switch(e.archetype){case"hunt":return wR(e,t);case"push":return _R(e,t);case"group":return kR(e,t);case"predict":return xR(e,t);case"bingo":return ER(e,t);case"shoot":return $R(e,t);case"place":return TR(e,t)}}function IR(){return bR(32).toString("hex")}function CR(e,t,r){if(e.archetype!=="shoot")return e;let o=t?.secret?.entropy,n=(t?.archetype??"hunt")==="shoot"&&typeof o=="string"&&o.length>0?o:r();return{...e,secret:{...e.secret,entropy:n}}}function io(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(io).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${io(o)}`).join(",")}}`}function _E(e,t,r={}){let o=i=>{let{server_time:a,snapshot:s,...l}=i,{version:d,...p}=l;if(!r.ignoringSettlement)return p;let{results_available:h,solution_revealed:f,...y}=p.can;return{...p,can:y}},n=i=>{if(!r.ignoringSettlement)return i;let{cardStatus:a,...s}=i??{};return s};return io({round:o(e.round),secret:n(e.secret),limits:e.limits,archetype:e.archetype})===io({round:o(t.round),secret:n(t.secret),limits:t.limits,archetype:t.archetype??"hunt"})}function PR(e,t){if(e.archetype!=="bingo"||!_E(e,t,{ignoringSettlement:!0}))return!1;let r=i=>(i??{}).cardStatus??{},o=r(t.secret),n=r(e.secret);for(let[i,a]of Object.entries(o))if(!(i in n)||io(n[i])!==io(a))return!1;return Object.keys(n).length>Object.keys(o).length}async function yg(e,t,r,o,n=!0,i,a,s){let l=i??Qt(r),d=await e.getRound(t,l),p=CR(SR(r,o),d,s?.newEntropy??IR);if(p.round.id=l,a&&(p.round.origin=a),d&&_E(p,d)){let{fusedUntil:y,...k}=d;return await e.putRound(t,{...k,archetype:p.archetype},n),{roundId:l,version:d.round.version,changed:!1,current:n}}if(d&&PR(p,d)){let y=Object.keys((p.secret??{}).cardStatus??{}).length;return await e.putRound(t,{...d,round:{...p.round,version:d.round.version},secret:p.secret,limits:p.limits,archetype:p.archetype},n,{id:`round_${l}_settle_v${d.round.version}_${y}`,at:new Date().toISOString(),tenant:t,round_id:l,player_id:null,action:"round.settled",detail:{version:d.round.version,resolved:y,snapshot:o}}),{roundId:l,version:d.round.version,changed:!1,current:n}}let h=d?d.round.version+1:1,f={round:{...p.round,version:h},secret:p.secret,limits:p.limits,archetype:p.archetype};return await e.putRound(t,f,n,{id:`round_${l}_v${h}`,at:new Date().toISOString(),tenant:t,round_id:l,player_id:null,action:d?"round.replaced":"round.provisioned",detail:{version:h,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:l,version:h,changed:!0,current:n}}var kE=v(()=>{"use strict";ke()});function SE(e,t){let r=e.entries??[],o=r.filter(n=>typeof n.display_name=="string"&&n.display_name.trim().length>0);return{generated_at:t,last_updated:e.server_time??t,...e.round_id!==void 0&&{round_id:e.round_id},order:e.order??"high_first",entries:o.map(n=>({external_id:n.player_id,name:n.display_name.trim(),primary_score:n.score})),withheld:r.length-o.length}}var xE,OR,FW,EE=v(()=>{"use strict";He();xE="/play/v1/games/{game}/gfx/leaderboard",OR=c.object({external_id:c.string(),name:c.string().min(1),primary_score:c.number()}),FW=c.object({generated_at:c.string(),last_updated:c.string(),round_id:c.string().optional(),order:c.string(),entries:c.array(OR),withheld:c.number().int().nonnegative()})});function kt(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function TE(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:vg,body:void 0};if(e.method==="GET"&&n===`${Qs}/health`)return lt(200,{status:"ok"});let i=xt.session.exec(n);if(i){if(e.method!=="POST")return Kt(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),l=o?.check(Bf(s,Gf(e)));if(l&&!l.allowed)return $E(l.retryAfterSeconds);let d=r?.issue(s);return d?lt(200,{server_time:"",snapshot:"",token:d.token,player_id:d.playerId,kind:"anonymous"}):Kt(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",xt.runtime],["currentRound",xt.currentRound],["rounds",xt.rounds],["roundsMine",xt.roundsMine],["nextRound",xt.nextRound],["plays",xt.plays],["roundState",xt.roundState],["profile",xt.profile],["graphicsFeed",xt.graphicsFeed],["leaderboard",xt.leaderboard],["round",xt.round]];for(let[s,l]of a){let d=l.exec(n);if(!d)continue;let p=decodeURIComponent(d[1]),h=d[2]?decodeURIComponent(d[2]):void 0,f=o?.check(Bf(p,Gf(e)));if(f&&!f.allowed)return $E(f.retryAfterSeconds);let y=s==="plays";if(y?e.method!=="POST":e.method!=="GET")return Kt(405,"method_not_allowed",`This route accepts ${y?"POST":"GET"}.`);let k;try{k=await t.forPlayer(p,e)}catch(D){return Pn({path:e.path,method:e.method,game:p,stage:"resolve",name:ir(D)}),Kt(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!k)return Kt(404,"not_found",`No game with id "${p}".`);try{switch(s){case"runtime":return lt(200,await k.getRuntime());case"currentRound":return lt(200,await k.getCurrentRound());case"rounds":return lt(200,await k.getRoundPool());case"roundsMine":return lt(200,await k.getPlayedRounds());case"nextRound":return lt(200,await k.getNextRound());case"round":{let D=await k.getRound(h);return D?lt(200,D):Kt(404,"not_found","No such round.")}case"roundState":return lt(200,await k.getRoundState(h));case"profile":return lt(200,await k.getProfile());case"leaderboard":return lt(200,await k.getLeaderboard());case"graphicsFeed":{let D=await k.getLeaderboard(),b=SE(D,new Date().toISOString()),$=lt(200,b);return $.headers["cache-control"]="public, max-age=5",$}case"plays":{let D=Yk.safeParse(e.body);if(!D.success)return Kt(422,"invalid_request",D.error.issues.map(S=>`${S.path.join(".")||"body"}: ${S.message}`).join("; "));let b=await k.play(h,D.data),$=lt(200,b);return b.outcome==="busy"&&b.retry_after_seconds&&($.headers["retry-after"]=String(b.retry_after_seconds)),$}}}catch(D){return D instanceof Error&&D.message==="round_not_found"?Kt(404,"not_found","No such round."):(Pn({path:e.path,method:e.method,game:p,name:ir(D)}),Kt(500,"internal","Something went wrong at our end.",!0))}}return NR}var vg,lt,Kt,xt,NR,$E,AE=v(()=>{"use strict";ke();EE();xc();vg={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},lt=(e,t)=>({status:e,headers:{"content-type":"application/json",...vg},body:t}),Kt=(e,t,r,o=!1)=>lt(e,{error:{code:t,message:r,retryable:o}});xt={runtime:kt(Pe.runtime),currentRound:kt(Pe.currentRound),rounds:kt(Pe.rounds),roundsMine:kt(Pe.roundsMine),nextRound:kt(Pe.nextRound),round:kt(Pe.round),plays:kt(Pe.plays),roundState:kt(Pe.roundState),profile:kt(Pe.profile),leaderboard:kt(Pe.leaderboard),graphicsFeed:kt(xE),session:kt(Pe.session)},NR=Kt(404,"not_found","No such route on the player API."),$E=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...vg},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function Ac(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function on(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var sr,Pi,Tc,ZW,ao=v(()=>{sr=new TextEncoder,Pi=new TextDecoder,Tc=new TextDecoder("utf-8",{fatal:!0}),ZW=2**32});function RR(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function IE(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw Ic(t.name);if(t.hash&&o.hash?.name!==t.hash)throw Ic(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw Ic(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw Ic(t.length,"algorithm.length");RR(e,r)}var Ic,CE=v(()=>{Ic=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function PE(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var OE,bg,wg=v(()=>{OE=(e,...t)=>PE("Key must be ",e,...t),bg=(e,t,...r)=>PE(`Key for the ${e} algorithm must be `,t,...r)});var qe,gt,Oi,Cc,Me,Ee,On,Ni,so,Pc,Oc,Nc,ot=v(()=>{qe=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},gt=class extends qe{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Oi=class extends qe{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Cc=class extends qe{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Me=class extends qe{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},Ee=class extends qe{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},On=class extends qe{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},Ni=class extends qe{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},so=class extends qe{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},Pc=class extends qe{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},Oc=class extends qe{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},Nc=class extends qe{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var co,_g,kg,xg=v(()=>{co=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},_g=e=>e?.[Symbol.toStringTag]==="KeyObject",kg=e=>co(e)||_g(e)});function Sg(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function Rc(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}var Eg=v(()=>{});function Ri(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:Pi.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=Pi.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Rc(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function lo(e){let t=e;return typeof t=="string"&&(t=sr.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):Sg(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var Li=v(()=>{ao();Eg()});function It(e){if(!LR(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Lc(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var LR,$g,NE,RE,LE,Nn=v(()=>{LR=e=>typeof e=="object"&&e!==null;$g=e=>It(e)&&typeof e.kty=="string",NE=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),RE=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,LE=e=>e.kty==="oct"&&typeof e.k=="string"});function Tg(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function Ag(e,t,r){try{return Ri(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function DE(e,t,r){try{return on(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function jE(e,t,r){let o;try{o=JSON.parse(Tc.decode(Ri(e)))}catch{throw new t(r)}if(!It(o))throw new t(r);return o}var Ig=v(()=>{Li();ao();Nn()});function MR(e,t){if(!e.kty.includes(t.kty))throw new Me(jR);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function Dc(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new Me('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=MR(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var jR,Cg=v(()=>{ot();jR='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function FR(e,t,r){return e.symmetric?UR(e,t,r):zR(e,t,r)}function zE(e,t){return Mc||=new WeakMap,Mc.get(e)?.[t]}function FE(e,t,r){let o=Mc.get(e);return o?o[t]=r:Mc.set(e,{[t]:r}),r}async function Uc(e,t,r){let o=FR(e,t,r);switch(o.kind){case UE:case Og:return o.key;case jc:{if(o.key.k)return Ri(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return ME(o.key,o.key,e)}case Ng:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?BR(n,e):ME(n,n.export({format:"jwk"}),e)}}}var uo,Pg,UR,zR,UE,Og,Ng,jc,Mc,GR,ME,BR,Rg=v(()=>{wg();xg();Nn();Li();Cg();uo=e=>e[Symbol.toStringTag],Pg=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},UR=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:UE,key:t};if($g(t)){if(LE(t)&&Pg(e,t,r))return{kind:jc,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!kg(t))throw new TypeError(bg(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${uo(t)} instances for symmetric algorithms must be of type "secret"`);return co(t)?{kind:Og,key:t}:{kind:Ng,key:t}},zR=(e,t,r)=>{let{alg:o}=e;if($g(t))switch(r){case"decrypt":case"sign":if(NE(t)&&Pg(e,t,r))return{kind:jc,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(RE(t)&&Pg(e,t,r))return{kind:jc,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!kg(t))throw new TypeError(bg(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${uo(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${uo(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${uo(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${uo(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${uo(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return co(t)?{kind:Og,key:t}:{kind:Ng,key:t}},UE=Symbol(),Og=Symbol(),Ng=Symbol(),jc=Symbol();GR={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};ME=async(e,t,r)=>{let o=zE(e,r.alg);if(o)return o;let n=await Dc(r,{...t,alg:r.alg});return FE(e,r.alg,n)},BR=(e,t)=>{let r=zE(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=GR[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return FE(e,t.alg,e.toCryptoKey(s,o,n))}});function Di(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var Lg=v(()=>{});function zc(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:WR,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Fc(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new Me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:KR,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function Dg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:Gc,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function jg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:Gc,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function Mg(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:Gc,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function Ug(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:GE,keyOps:BE,cekBits:e,ivBits:96,cbc:!1}}function zg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:GE,keyOps:BE,cekBits:e,ivBits:128,cbc:!0}}function WE(e){return HR[e]}var WR,KR,Gc,HR,GE,BE,yK,KE=v(()=>{ot();Lg();WR={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},KR={public:[],private:["deriveBits"]},Gc={public:[],private:[]};HR=Di({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:Gc,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":zc(1),"RSA-OAEP-256":zc(256),"RSA-OAEP-384":zc(384),"RSA-OAEP-512":zc(512),"ECDH-ES":Fc(),"ECDH-ES+A128KW":Fc(128),"ECDH-ES+A192KW":Fc(192),"ECDH-ES+A256KW":Fc(256),A128KW:Dg(128),A192KW:Dg(192),A256KW:Dg(256),A128GCMKW:jg(128),A192GCMKW:jg(192),A256GCMKW:jg(256),"PBES2-HS256+A128KW":Mg(256,128),"PBES2-HS384+A192KW":Mg(384,192),"PBES2-HS512+A256KW":Mg(512,256)}),GE={public:[],private:[]},BE={encrypt:"encrypt",decrypt:"decrypt"};yK=Di({A128GCM:Ug(128),A192GCM:Ug(192),A256GCM:Ug(256),"A128CBC-HS256":zg(256),"A192CBC-HS384":zg(384),"A256CBC-HS512":zg(512)})});function ZR(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function VR(e,t,r){IE(t,e.subtle,r),e.minModulusLength&&ZR(e.alg,t)}async function HE(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(VR(e,t,r),t)}async function ZE(e,t,r){let o=await HE(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function VE(e,t,r,o){let n=await HE(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var Fg=v(()=>{CE()});function YE(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function qE(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function Wc(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new Me(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var Bc,Gg=v(()=>{ot();Bc=new Map([["b64",!0]])});function Bg(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:ji}}function po(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:ji,minModulusLength:2048}}function Wg(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:ji}}function JE(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:ji}}function Kg(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:ji}}function Kc(e){let t=XE[e];if(!t)throw new Me(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Hc(e){return XE[e]}var ji,XE,Mi=v(()=>{ot();Lg();ji={public:["verify"],private:["sign"]};XE=Di({HS256:Bg(256),HS384:Bg(384),HS512:Bg(512),RS256:po("RSASSA-PKCS1-v1_5",256),RS384:po("RSASSA-PKCS1-v1_5",384),RS512:po("RSASSA-PKCS1-v1_5",512),PS256:po("RSA-PSS",256,32),PS384:po("RSA-PSS",384,48),PS512:po("RSA-PSS",512,64),ES256:Wg("P-256",256),ES384:Wg("P-384",384),ES512:Wg("P-521",512),EdDSA:JE(),Ed25519:JE(),"ML-DSA-44":Kg("ML-DSA-44"),"ML-DSA-65":Kg("ML-DSA-65"),"ML-DSA-87":Kg("ML-DSA-87")})});function QE(e){return{algorithms:e&&YE("algorithms",e.algorithms),crit:e?.crit}}async function YR(e,t,r){let o={};e.protected&&(o=jE(e.protected,Ee,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!Lc(o,e.header))throw new Ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=Wc(Ee,Bc,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new Cc('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new Ee("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new Ee("JWS Payload must be a string or an Uint8Array instance");let l=!1;typeof r=="function"&&(r=await r(o,e),l=!0);let d=Kc(s),p=Ac(e.protected!==void 0?on(e.protected):new Uint8Array,on("."),typeof e.payload=="string"?a?t.b64p??=DE(e.payload,"payload",Ee):sr.encode(e.payload):e.payload),h=Ag(e.signature,"signature",Ee),f=await Uc(d,r,"verify");if(!await VE(d,f,h,p))throw new Nc;let k;return a?k=Ag(e.payload,"payload",Ee):typeof e.payload=="string"?k=sr.encode(e.payload):k=e.payload,{payload:k,parsedProt:o,b64:a,key:f,resolvedKey:l}}async function e$(e,t,r){if(e instanceof Uint8Array&&(e=Pi.decode(e)),typeof e!="string")throw new Ee("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new Ee("Invalid Compact JWS");return YR({payload:n,protected:o,signature:i},t,r)}var t$=v(()=>{Fg();Mi();ot();ao();Ig();Nn();Gg();Rg()});function Ui(e){let t=XR.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*r$);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*o$);break;case"day":case"days":case"d":n=Math.round(r*Hg);break;case"week":case"weeks":case"w":n=Math.round(r*qR);break;default:n=Math.round(r*JR);break}return t[1]==="-"||t[4]==="ago"?-n:n}function an(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}function i$(e,t,r={}){let o;try{o=JSON.parse(Tc.decode(t))}catch{}if(!It(o))throw new On("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||n$(e.typ)!==n$(n)))throw new gt('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:l,maxTokenAge:d}=r,p=[...i];d!==void 0&&p.push("iat"),l!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),a!==void 0&&p.push("iss");for(let k of new Set(p.reverse()))if(!(k in o))throw new gt(`missing required "${k}" claim`,o,k,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new gt('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new gt('unexpected "sub" claim value',o,"sub","check_failed");if(l!==void 0&&!QR(o.aud,typeof l=="string"?[l]:l))throw new gt('unexpected "aud" claim value',o,"aud","check_failed");let h;switch(typeof r.clockTolerance){case"string":h=Ui(r.clockTolerance);break;case"number":h=r.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}an("clockTolerance option",h);let{currentDate:f}=r,y=an("currentDate option",Rn(f||new Date));if((o.iat!==void 0||d!==void 0)&&typeof o.iat!="number")throw new gt('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new gt('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>y+h)throw new gt('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new gt('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=y-h)throw new Oi('"exp" claim timestamp check failed',o,"exp","check_failed")}if(d!==void 0){let k=y-o.iat,D=typeof d=="number"?d:Ui(d);if(k-h>D)throw new Oi('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(k<0-h)throw new gt('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var Rn,r$,o$,Hg,qR,JR,XR,n$,QR,Zc,Zg=v(()=>{ot();ao();Nn();Rn=e=>Math.floor(e.getTime()/1e3),r$=60,o$=r$*60,Hg=o$*24,qR=Hg*7,JR=Hg*365.25,XR=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;n$=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,QR=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Zc=class{#e;constructor(t){if(!It(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return sr.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=an("setNotBefore",t):t instanceof Date?this.#e.nbf=an("setNotBefore",Rn(t)):this.#e.nbf=Rn(new Date)+Ui(t)}set exp(t){typeof t=="number"?this.#e.exp=an("setExpirationTime",t):t instanceof Date?this.#e.exp=an("setExpirationTime",Rn(t)):this.#e.exp=Rn(new Date)+Ui(t)}set iat(t){t===void 0?this.#e.iat=Rn(new Date):t instanceof Date?this.#e.iat=an("setIssuedAt",Rn(t)):typeof t=="string"?this.#e.iat=an("setIssuedAt",Rn(new Date)+Ui(t)):this.#e.iat=an("setIssuedAt",t)}}});async function Vg(e,t,r){let o=await e$(e,QE(r),t);if(!o.b64)throw new On("JWTs MUST NOT use unencoded payload");let i={payload:i$(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}var a$=v(()=>{t$();Zg();ot()});function Vc(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function s$(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!Lc(r,o))throw new Ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};qE(Ee,r);let i=Wc(Ee,Bc,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new Ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=Kc(s),d,p;if(a){let $=e.encoded??={};$.b64??=lo(e.payload),$.raw??=on($.b64),d=$.b64,p=$.raw}else p=e.payload,d="";let h,f;r?(h=lo(JSON.stringify(r)),f=on(h)):(h="",f=new Uint8Array);let y=Ac(f,on("."),p),k=await Uc(l,t,"sign"),D=await ZE(l,k,y),b={signature:lo(D),payload:d};return r&&(b.protected=h),b}var Yc=v(()=>{Li();Fg();Mi();Nn();ot();ao();Gg();Rg()});var qc,c$=v(()=>{ot();Yc();Ig();qc=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return Tg(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return Tg(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new Ee("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await s$({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var Jc,l$=v(()=>{c$();Yc();Jc=class{#e;#t;constructor(t){this.#e=new qc(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(Vc(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}}});var zi,d$=v(()=>{l$();Yc();ot();Zg();zi=class{#e;#t;constructor(t={}){this.#t=new Zc(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Jc(this.#t.data());if(o.setProtectedHeader(this.#e),Vc(this.#e))throw new On("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function u$(){return new Me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function p$(e){if(typeof e!="string")throw u$();let t=Hc(e)??WE(e);if(!t)throw u$();return t}var h$=v(()=>{ot();Mi();KE()});function n1(e){Gi(e,48,"Invalid PKCS#8 structure"),Fi(e),Gi(e,2,"Expected version field");let t=Fi(e);e.pos+=t,Gi(e,48,"Expected algorithm identifier");let r=Fi(e);return{algIdStart:e.pos,algIdLength:r}}var Yg,e1,qg,Fi,Gi,m$,t1,r1,o1,i1,f$,g$=v(()=>{Eg();ot();h$();Yg=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},e1=e=>({data:e,pos:0}),qg=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},Fi=e=>{let t=qg(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|qg(e);return o}return t},Gi=(e,t,r)=>{if(qg(e)!==t)throw new Error(r)},m$=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},t1=e=>{Gi(e,6,"Expected algorithm OID");let t=Fi(e);return m$(e,t)};r1=e=>{let t=t1(e);if(Yg(t,[43,101,110]))return"X25519";if(!Yg(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Gi(e,6,"Expected curve OID");let r=Fi(e),o=m$(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Yg(o,i))return n;throw new Error("Unsupported named curve")},o1=async(e,t,r,o)=>{let n=p$(r);if(n.symmetric)throw new Me('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new Me("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},i1=(e,t)=>Rc(e.replace(t,"")),f$=(e,t,r)=>{let o=i1(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=e1(i);return n1(a),r1(a)}),o1("pkcs8",o,t,n)}});function a1(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function s1(e){if(_g(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:lo(e)};if(!co(e))throw new TypeError(OE(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=a1(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function Jg(e){return s1(e)}var y$=v(()=>{wg();Li();xg()});function c1(e){let t=typeof e=="string"?Hc(e):void 0;if(!t||t.symmetric)throw new Me('Unsupported "alg" value for a JSON Web Key Set');return t}function l1(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(d1)}function d1(e){return It(e)}async function v$(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await Dc(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Ni("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function Qg(e){let t=new Xg(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}var Xg,b$=v(()=>{Cg();Mi();ot();Nn();Xg=class{#e;#t=new WeakMap;constructor(t){if(!l1(t))throw new Ni("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=c1(o),a=this.#e.keys.filter(d=>{let p=i.kty.includes(d.kty);return p&&typeof n=="string"&&(p=n===d.kid),p&&(typeof d.alg=="string"||d.kty==="AKP")&&(p=o===d.alg),p&&typeof d.use=="string"&&(p=d.use==="sig"),p&&Array.isArray(d.key_ops)&&(p=d.key_ops.includes("verify")),p&&i.crv&&(p=d.crv===i.crv),p}),{0:s,length:l}=a;if(l===0)throw new so;if(l!==1){let d=new Pc,p=this.#t;throw d[Symbol.asyncIterator]=async function*(){for(let h of a)try{yield await v$(p,h,i)}catch{}},d}return v$(this.#t,s,i)}}});function u1(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function p1(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new Oc:i});if(n.status!==200)throw new qe("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new qe("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function h1(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!It(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,It))}function ny(e,t){let r=new ty(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}var ey,w$,Xc,ty,_$=v(()=>{ot();b$();Nn();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(ey="jose/v6.2.5");w$=Symbol();Xc=Symbol();ty=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),ey&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",ey),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[w$],r?.[Xc]!==void 0&&(this.#s=r?.[Xc],h1(r?.[Xc],this.#c)&&(this.#i=this.#s.uat,this.#a=Qg(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof so&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&u1()&&(this.#r=void 0),this.#r||=p1(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=Qg(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}}});async function ry(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return f$(e,t,r)}var k$=v(()=>{g$()});var oy=v(()=>{a$();d$();_$();y$();k$()});function m1(e){let t=x$.get(e);return t||(t=ny(new URL(e)),x$.set(e,t)),t}function S$(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await Vg(r,m1(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${f1}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var x$,f1,E$=v(()=>{"use strict";oy();kc();x$=new Map;f1="id:"});import{createPublicKey as g1,generateKeyPairSync as y1}from"node:crypto";async function iy(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Qc}`,{privateKey:n,publicKey:i}=y1("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await ry(n,"RS256"),s=await Jg(g1(i)),l="gamestage-dev",d={keys:[{...s,kid:l,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:d,resolver:S$({issuer:r,jwksUri:o}),async mint(p,h={}){let f=Math.floor(Date.now()/1e3);return new zi({name:p}).setProtectedHeader({alg:"RS256",kid:l}).setIssuer(r).setSubject(p).setIssuedAt(f).setExpirationTime(f+(h.expiresInSeconds??3600)).sign(a)}}}var Qc,ay=v(()=>{"use strict";oy();E$();Qc="/.well-known/jwks.json"});import{createServer as v1}from"node:http";import{randomBytes as b1}from"node:crypto";async function _1(e){let t=bE({tenant:e.game,rounds:[],currentRoundId:""});await yg(t,e.game,Ze.parse(e.round),"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await yg(t,e.game,Ze.parse(n),`local-${o+2}`,!1,void 0,{source:"manifest"});let r=gE({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return yE({tenant:e.game,playerId:n.playerId??Ii(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function k1(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function el(e){let t=await _1(e),r=b1(32).toString("base64"),o={issue:()=>BS(r)},n=e.devIdentity,i=v1((a,s)=>{(async()=>{let l=new URL(a.url??"/","http://localhost");if(n&&l.pathname===Qc){let f=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(l.pathname)){let f=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}let d=a.headers[w1],p=a.headers.authorization,h=await TE({method:a.method??"GET",path:l.pathname,body:await k1(a),...(({playerId:f,refused:y})=>({playerId:f,identityRefusal:y}))(await FS({token:p?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(d)?d[0]:d,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(h.status,h.headers),s.end(h.body===void 0?void 0:JSON.stringify(h.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}var w1,sy=v(()=>{"use strict";ke();vE();$c();wE();kE();AE();kc();ay();ay();$c();w1="x-gamestage-player"});import{spawn as x1}from"node:child_process";import{createHash as S1,randomBytes as T$}from"node:crypto";import{constants as E1}from"node:fs";import{access as $1,mkdtemp as T1,rm as A$}from"node:fs/promises";import{request as A1}from"node:http";import{homedir as tl,tmpdir as I1}from"node:os";import{join as Bi}from"node:path";function cy(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??T$(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}async function hy(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??P1].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await $1(s,E1.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await T1(Bi(I1(),"gamestage-chrome-")),i=x1(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await N1(await O1(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:l}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await py.create(a,l,i,n)}}catch(s){throw a?.close(),await I$(i),await A$(n,{recursive:!0,force:!0}),s}}function O1(e,t){return new Promise((r,o)=>{let n="",i=p=>{clearTimeout(d),e.stderr?.off("data",a),e.off("error",s),e.off("close",l),p()},a=p=>{n=(n+p.toString("utf8")).slice(-4e3);let h=n.match(/DevTools listening on (ws:\/\/\S+)/);h&&i(()=>r(h[1]))},s=p=>i(()=>o(p)),l=p=>i(()=>o(new Error(`Chrome exited before DevTools was ready${p===null?"":` (code ${p})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",l);let d=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function N1(e){return new Promise((t,r)=>{let o=new URL(e),n=T$(16).toString("base64"),i=S1("sha1").update(n+C1).digest("base64"),a=A1({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,l,d)=>{s.headers["sec-websocket-accept"]!==i?(l.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new uy(l,d))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function I$(e){e.exitCode===null&&(e.kill("SIGTERM"),!await $$(e,1e3)&&(e.kill("SIGKILL"),await $$(e,1e3)))}function $$(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function ly(e){return new Promise(t=>setTimeout(t,e))}var C1,dy,uy,py,P1,C$=v(()=>{"use strict";C1="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";dy=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,l=n&127,d=2;if(l===126){if(this.buffered.length<d+2)break;l=this.buffered.readUInt16BE(d),d+=2}else if(l===127){if(this.buffered.length<d+8)break;let f=this.buffered.readBigUInt64BE(d);if(f>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");l=Number(f),d+=8}let p=d;if(s&&(d+=4),this.buffered.length<d+l)break;let h=Buffer.from(this.buffered.subarray(d,d+l));if(s)for(let f=0;f<h.length;f++)h[f]^=this.buffered[p+f%4];if(this.buffered=this.buffered.subarray(d+l),a===8||a===9||a===10)r.push({opcode:a,payload:h});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:h}):(this.fragmentedOpcode=a,this.fragments=[h])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(h),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},uy=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new dy;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(cy(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(cy(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(cy(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},py=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,l=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(l.split(`
10418
+ `).some(l=>n(a.item).test(l)&&a.cells.every(d=>n(d).test(l)))&&i.push(a.item)}return i}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`\\b(?:${a})\\b[^\\n]{0,120}?\\b${i.value}\\b`,"i"),l=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?\\b(?:${a})\\b`,"i");(s.test(e)||l.test(e))&&o.push(i.label)}return o}function io(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;if(e.archetype==="place")return`The page holds which cells a card fits: ${t.join(", ")}. A player who reads it can fill the board without knowing a face, which is the game.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}function sN(e){try{return JSON.parse(e)}catch{}try{let t=zk(e);return typeof t=="object"?t:void 0}catch{return}}function cN(e){let t=sN(e);if(!t||typeof t!="object")return;let r,o=new Set,n=(i,a)=>{if(!(r||a>6||!i||typeof i!="object")&&!o.has(i)){if(o.add(i),Array.isArray(i)){for(let s of i)n(s,a+1);return}for(let[s,l]of Object.entries(i)){if(aN.has(s.toLowerCase())){r=s;return}n(l,a+1)}}};return n(t,0),r}function lN(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<ng+1)return!1;for(let r of[","," ",";"]){let o=t.slice(0,500).map(p=>p.split(r)),n=o[0].length,i=o.filter(p=>p.length===n);if(n<2||i.length<o.length*.95||i.length<ng+1)continue;let a=i.slice(1),s=Math.min(...a.map(p=>p.length)),l=!1,d=!1;for(let p=0;p<s;p+=1){let h=a.map(f=>f[p].trim());h.every(f=>f.length>0&&/^-?\d+(\.\d+)?$/.test(f))?l=!0:h.every(f=>f.length>0&&!/^-?\d+(\.\d+)?$/.test(f))&&(d=!0)}if(l&&d)return!0}try{let r=JSON.parse(e);if(r&&typeof r=="object"&&!Array.isArray(r)){let o=Object.values(r);if(o.length>=ng&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function pN(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&uN.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:dN.has(t.slice(r+1))}function mN(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>hN.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function fN(e){if(e.relativePath!==Oe)return;let t;try{t=await NS(e.path)}catch{return}if(XO("sha256").update(t).digest("hex").slice(0,16)!==Bt)return{path:e.relativePath,why:"needs regenerating. Run `gamestage client`, then deploy again. If it is refused again with the same digest, the tool that wrote the file is older than the one checking it, so update Gamestage and rerun.",confidence:"certain"}}async function DS(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),l;for(let d of e){let p=mN(d.relativePath);if(p){i.includes(p)||i.push(p);continue}let h=await fN(d);if(h){l??=h;continue}if(s.has(d.relativePath)){r.push(d);continue}let f=await og(d,t.round);if(!f){r.push(d);continue}if(f.confidence==="suspected"&&a.has(d.relativePath)){n.push(f),r.push(d);continue}if(f.alwaysWithheld||pN(d.relativePath)){o.push(f);continue}l??=f}return{publish:r,withheld:o,allowed:n,walkedPast:i,...l?{refuse:l}:{}}}async function og(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if(rg(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await $i(e.path);if(o!==void 0){let i=nN(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=iN(o);if(a)return r(a.round?"is an App Manifest, which carries the round's private half":"is an App Manifest, which is ours rather than the game's","certain",!0);if(t){let s=oo(o,t);if(s.length)return r(io(t,s),"certain")}}if(t&&o===void 0){let i=await oN(e.path);if(i!==void 0){let a=oo(i,t);if(a.length)return r(io(t,a),"certain")}}if(o===void 0)return;let n=cN(o);if(n){let i=/^[aeiou]/i.test(n)?"an":"a";return r(`looks like it holds a round's answers: it has ${i} "${n}" key. If that is the game's own data rather than its answers, publish it with --allow ${e.relativePath}`,"suspected")}if(lN(o))return r(`looks like reference data: a long table of labels against numbers, which is what a round is scored against. If it is the game's own data, publish it with --allow ${e.relativePath}`,"suspected")}var eN,tN,RS,rN,aN,ng,dN,uN,hN,yc=v(()=>{"use strict";qs();ke();tn();eN=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),tN=[{pattern:/-----BEGIN [A-Z ]*PRIVATE KEY-----/,what:"a private key block"},{pattern:/-----BEGIN OPENSSH PRIVATE KEY-----/,what:"an OpenSSH private key"},{pattern:/\bAKIA[0-9A-Z]{16}\b/,what:"an AWS access key id"},{pattern:/\baws_secret_access_key\s*[=:]/i,what:"an AWS secret access key"},{pattern:/\bsk-(live|proj|ant)-[A-Za-z0-9_-]{16,}/,what:"a live API key"},{pattern:/\bsk_live_[A-Za-z0-9]{16,}/,what:"a live Stripe key"},{pattern:/\bgh[pousr]_[A-Za-z0-9]{30,}/,what:"a GitHub token"},{pattern:/\bxox[baprs]-[A-Za-z0-9-]{10,}/,what:"a Slack token"},{pattern:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,what:"a signed token"},{pattern:/\bauthorization\s*:\s*["']?\s*(bearer|basic)\s+\S{12,}/i,what:"an Authorization header with a token in it"}];RS=8e6,rN=32e6;aN=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);ng=20;dN=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),uN=new Set(["gz","br","zst","zz"]);hN=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function vc(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===Oe||o===Fe)continue;let n=await $i(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var ig=v(()=>{"use strict";tn();yc()});import{lstatSync as gN,readdirSync as yN}from"node:fs";import{relative as vN,resolve as jS,sep as bN}from"node:path";function bc(e){let t=e.split("/").pop()??e;return wN.has(t)||t.startsWith(".env.")}function Ti(e,t={}){let r=t.symlinks??"throw",o=jS(e),n=[],i=[],a=[];function s(l){for(let d of yN(l,{withFileTypes:!0}).sort((p,h)=>p.name.localeCompare(h.name))){let p=jS(l,d.name),h=vN(o,p).split(bN).join("/");if(d.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${h}`);i.push(h);continue}if(d.isDirectory())s(p);else if(d.isFile()){if(bc(h)){a.push(h);continue}n.push({path:p,relativePath:h})}}}if(!gN(o).isDirectory())throw new Error(`${e} is not a directory.`);return s(o),{files:n,skippedLinks:i,withheld:a}}function MS(e){return Ti(e,{symlinks:"throw"}).files}function US(e,t=[]){let r=[],o=new Map;for(let i of e){let a=i.relativePath;if(!_N.test(a)||kN.test(a)){r.push(a);continue}let l=a.lastIndexOf("/"),d=l===-1?".":a.slice(0,l);o.set(d,(o.get(d)??0)+1)}let n=[];for(let i of r.sort())n.push(i);for(let[i,a]of[...o].sort(([s],[l])=>s.localeCompare(l))){let s=i==="."?"the directory root":`${i}/`;n.push(`${a} ${a===1?"file":"files"} in ${s}`)}for(let i of[...t].sort())n.push(`withheld: ${i}`);return{lines:n,named:r}}var wN,_N,kN,wc=v(()=>{"use strict";wN=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs"]);_N=/\.(html?|css|js|mjs|cjs|map|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|otf|mp3|mp4|webm|txt|md)$/i,kN=/(^|\/)(\.|_)|(^|\/)[^/]*(secret|credential|password|token|key|\.pem|\.p12|\.pfx|backup|\.bak|answers?|solution)[^/]*$/i});import{createHash as xN}from"node:crypto";function Ai(e){return xN("sha256").update(e,"utf8").digest()[0]&127}var _c,ag=v(()=>{"use strict";_c=128});import{createHmac as SN,randomBytes as EN,timingSafeEqual as $N}from"node:crypto";function cg(e){return e.startsWith(sg)}function Ii(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${sg}${t||"unknown"}`}async function FS(e){if(!e.token)return e.sessionSecret?{playerId:AN(e.anonymousId,e.sessionSecret)??Ii(void 0)}:{playerId:Ii(e.anonymousId)};let t=e.resolver??zS,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:Ii(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function BS(e){let t=`${sg}${EN(16).toString("base64url")}`;return{playerId:t,token:TN(t,e)}}function WS(e,t){return SN("sha256",t).update(e).digest("base64url")}function TN(e,t){return`${e}${GS}${WS(e,t)}`}function AN(e,t){if(!e)return;let r=e.lastIndexOf(GS);if(r<=0)return;let o=e.slice(0,r);if(!cg(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(WS(o,t));if(n.length===i.length)return $N(n,i)?o:void 0}var sg,zS,GS,kc=v(()=>{"use strict";sg="anon:";zS={async resolve(){}};GS="."});function ir(e){return e instanceof Error?e.name:"unknown"}function Pn(e){console.error(IN,e)}function KS(e,t){console.error(CN,{violation:e,...t})}var IN,CN,xc=v(()=>{"use strict";IN="engine_error",CN="engine_integrity_violation"});function VS(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t^=t>>>16,t=Math.imul(t,2246822507)>>>0,t^=t>>>13,t=Math.imul(t,3266489909)>>>0,t^=t>>>16,t>>>0}function PN(e){let t=HS[VS(`a:${e}`)%HS.length],r=ZS[VS(`n:${e}`)%ZS.length];return`${t} ${r}`}function Sc(e,t){return t?.trim()||PN(e)}var HS,ZS,lg=v(()=>{"use strict";HS=["Amber","Brave","Bright","Calm","Clever","Copper","Eager","Early","Fleet","Gentle","Golden","Happy","Keen","Kind","Lucky","Merry","Nimble","Noble","Quick","Quiet","Rapid","Ready","Royal","Silver","Steady","Sunny","Swift","Tidy","True","Warm","Wise","Zesty"],ZS=["Badger","Beaver","Bison","Falcon","Ferret","Finch","Gibbon","Heron","Ibex","Jaguar","Kestrel","Lemur","Lynx","Marten","Meerkat","Osprey","Otter","Panda","Puffin","Quokka","Rabbit","Raven","Robin","Salmon","Sparrow","Stoat","Tapir","Teal","Vole","Walrus","Weasel","Wombat"]});import{createHash as ON}from"node:crypto";function wt(e){return Rx({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function YS(e){let t=Date.parse(e);if(Number.isNaN(t))return 1;let r=Date.parse(`${e.slice(0,10)}T00:00:00.000Z`)+864e5;return Math.max(1,Math.ceil((r-t)/1e3))}function Ec(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function NN(e){return ON("sha256").update(tc(e)).digest("hex")}function JS(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),l=()=>({server_time:i(),snapshot:e.runtime.snapshot}),d=S=>S;function p(S,w){return!n.settle||!S.round.can.results_available||w.outcome!=="pending"?w:n.settle({secret:S.secret,state:w,limits:S.limits,now:i()})}function h(S){if(!S.fusedUntil)return 0;let w=Math.ceil((Date.parse(S.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite(w)&&w>0?w:0}async function f(S,w){let C=e.fuse?.note(t,Ai(r),w);if(!C)return;let N=new Date(Date.parse(i())+C.holdSeconds*1e3).toISOString();if(C.kind==="stop")try{await o.setFuse(t,S,N)}catch(ee){Pn({event:"fuse_write_failed",tenant:t,round_id:S,name:ir(ee)})}try{await e.onFuse?.({...C,until:N})}catch(ee){Pn({event:"fuse_notify_failed",tenant:t,round_id:S,name:ir(ee)})}}function y(S){let w=h(S)>0,C=Ec({limits:S.limits,now:i()});return!w&&!C?S.round:{...S.round,can:{...S.round.can,accepting_plays:!1}}}function k(S,w){let C=S.round.number??Number.POSITIVE_INFINITY,N=w.round.number??Number.POSITIVE_INFINITY;return C!==N?C-N:S.round.id.localeCompare(w.round.id)}async function D(S){let w=S.round.id,C=await o.getState(t,w,r);return C?{state:C.state,version:C.version}:{state:{...n.initialState({playerId:r,roundId:w,limits:S.limits,now:i(),round:S.round,secret:S.secret}),started_at:i()},version:void 0}}async function b(S,w,C,N){if(w.timerSeconds===void 0||N!==void 0)return C;try{if(await o.putStateIfVersion(t,C,void 0))return C}catch(de){return Pn({event:"round_open_write_failed",tenant:t,round_id:S,name:ir(de)}),C}return(await o.getState(t,S,r))?.state??C}let $=(S,w,C)=>({...l(),play_id:s(),outcome:S,reason:w,round_version:C,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...l()}},async getCurrentRound(){let S=await o.getCurrentRound(t);if(!S)throw new Error(dg);return{...y(S),...l()}},async getRound(S){let w=await o.getRound(t,S);return w?{...y(w),...l()}:void 0},async getRoundPool(){let[S,w]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),C=w?.round.id,N=[...S].sort(k).map(ee=>{let de=y(ee);return{id:de.id,number:de.number,version:de.version,can:de.can,opens_at:de.opens_at,locks_at:de.locks_at,current:de.id===C,theme:typeof de.challenge?.theme=="string"?de.challenge.theme:""}});return{...l(),rounds:N}},async getPlayedRounds(){let S=await o.listStatesForPlayer(t,r);return{...l(),player_id:r,played:S.map(w=>({round_id:w.round_id,finished:w.finished,score:w.score,outcome:w.outcome})).sort((w,C)=>w.round_id.localeCompare(C.round_id))}},async getNextRound(){let[S,w]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),C=new Set(w.filter(me=>me.finished).map(me=>me.round_id)),N=new Set(w.map(me=>me.round_id)),ee=[...S].filter(me=>y(me).can.accepting_plays&&!C.has(me.round.id)).sort(k),de=ee.find(me=>!N.has(me.round.id))??ee[0];return de?{...l(),status:"ready",round:{...y(de),...l()}}:{...l(),status:"exhausted"}},async getRoundState(S){let w=await o.getRound(t,S);if(!w)throw new Error(dg);let C=d(w),{state:N,version:ee}=await D(C),de=await b(S,C.limits,N,ee),me=p(C,de);return me!==de&&me.finished&&await o.recordScore(t,S,r,me.score),{...me,...l()}},async getProfile(){let S=await o.getProfile(t,r);return{...S,display_name:Sc(r,S.display_name),...l()}},async getLeaderboard(S){let w=await o.getCurrentRound(t),C=w?.round.id??"",N=w?.limits;return{...await o.getLeaderboard(t,C,{limit:S,viewerId:r,order:N?.scoreOrder??"high_first"}),...l()}},async play(S,w){let C=await o.getRound(t,S);if(!C)return $("rejected",dg,0);let N=d(C);if(e.runtime.identity?.required&&cg(r))return $("rejected",e.identityRefusal??"identity_required",N.round.version);if(h(N)>0)return{...$("busy","fair_use",N.round.version),retry_after_seconds:h(N)};if(N.limits.playsPerSecond!==void 0){let q=i().slice(0,19),Se=await o.countPlay(t,S,q,r,3600),ut=Math.max(1,Math.ceil(N.limits.playsPerSecond/Se.buckets));if(Se.inBucket>ut)return await f(S,q),{...$("busy","capped",N.round.version),retry_after_seconds:1}}if(N.limits.playsPerDay!==void 0){let q=i().slice(0,10);if(await o.countGameDay(t,S,q,YS(i())+3600)>N.limits.playsPerDay)return await f(S,q),{...$("busy","capped_today",N.round.version),retry_after_seconds:YS(i())}}let ee=NN({round_id:S,round_version:w.round_version,challenge_instance_id:w.challenge_instance_id,payload:w.payload}),de=q=>q.intent!==void 0&&q.intent.fingerprint!==ee,me=await o.getPlay(t,r,w.idempotency_key);if(me)return de(me)?$("rejected",qS,N.round.version):{...me.result,...l(),outcome:"duplicate"};let Ce=Jk(w.payload,n.archetype),Ct=Ce!==void 0&&(n.operations?n.operations.includes(Ce):Xk(n.archetype,Ce));if(w.payload.op!==void 0&&!Ct)return $("rejected","unknown_operation",N.round.version);let{state:he,version:Ne}=await D(N),yt=n.admissible({accepting:N.round.can.accepting_plays,roundVersion:N.round.version,playedVersion:w.round_version,challengeInstanceId:N.round.challenge_instance_id??null,playedChallengeInstanceId:w.challenge_instance_id??null,state:he,secret:N.secret,limits:N.limits,now:i()});if(!yt.ok){let q=yt.reason==="round_version"?"stale":"rejected";return $(q,yt.reason,N.round.version)}if(Ec({limits:N.limits,now:i()}))return $("rejected","lock_deadline_passed",N.round.version);let se=n.mark({payload:w.payload,secret:N.secret,state:he,limits:N.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(se.outcome!=="accepted")return $("rejected",se.reason??"rejected",N.round.version);let $e={...l(),play_id:s(),outcome:se.outcome,round_version:N.round.version,marked:se.marked,feedback:se.feedback,round_state:{...se.next,...l()}},X=`play:${JSON.stringify([t,r,w.idempotency_key])}`,dt=[{id:X,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"play.committed",detail:{play_id:$e.play_id,idempotency_key:w.idempotency_key,outcome:$e.outcome,marked:$e.marked,round_version:$e.round_version,score_before:he.score,score_after:se.next.score,attempts_used:se.next.attempts_used,attempts_allowed:se.next.attempts_allowed,mistakes_used:se.next.mistakes_used,mistakes_allowed:se.next.mistakes_allowed,...n.auditDetail({secret:N.secret,before:he,decision:se,payload:w.payload})}}],Ge=se.marked&&(se.participation?.score??!0),jn=se.participation?.profile??!0;Ge&&dt.push({id:`score:${JSON.stringify([t,r,w.idempotency_key])}`,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"score.recorded",detail:{play_id:$e.play_id,score_before:he.score,score_after:se.next.score,marked:!0,outcome:se.next.outcome}});let _e=jn&&se.next.finished&&!he.finished?ec(await o.getProfile(t,r),se.next.outcome):void 0,Je=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:w.idempotency_key,date:i().slice(0,10),play:{result:$e,intent:{fingerprint:ee,round_id:S,round_version:w.round_version}},state:se.next,expectedVersion:Ne,audit:dt,...Ge?{score:{roundId:S,score:se.next.score}}:{},..._e?{profile:_e}:{},round:{roundId:S,version:N.round.version,sharded:N.sharded===!0}});if(!Je.ok&&Je.reason==="contended")return $("busy","contended",N.round.version);if(!Je.ok&&Je.reason==="play_exists"){let q=await o.getPlay(t,r,w.idempotency_key);return q&&de(q)?$("rejected",qS,N.round.version):q?{...q.result,...l(),outcome:"duplicate"}:(Pn({stage:"play_receipt_missing",tenant:t,round_id:S,player_id:r}),$("rejected","play_conflict",N.round.version))}if(!Je.ok&&Je.reason==="round_changed"){let q=await o.getRound(t,S),Se=q===void 0||q.round.version!==N.round.version,ut=Se?"round_changed":"round_closed";return await o.appendAudit({id:X,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:$e.play_id,idempotency_key:w.idempotency_key,reason:ut,decided_against_version:N.round.version,attempt_spent:!1}}),$(Se?"stale":"rejected",ut,q?.round.version??N.round.version)}return Je.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),$e):(await o.appendAudit({id:X,at:$e.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:$e.play_id,idempotency_key:w.idempotency_key,reason:"round_version",attempt_spent:!1}}),$("stale","round_version",N.round.version))}}}var _t,qS,dg,Wt=v(()=>{"use strict";ag();kc();xc();lg();ke();_t="time_expired";qS="idempotency_conflict",dg="round_not_found"});function RN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function LN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter($=>r.targets.includes($)&&!i.has($)),s=t.picks.filter($=>!r.targets.includes($)),l=o.attempts_used+1,d=o.mistakes_used+(s.length>0?1:0);for(let $ of a)i.add($);let p=i.size>=r.required,h=d>=n.mistakesAllowed,f=l>=n.attemptsAllowed,y=p||h||f,k=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(p?r.completionBonus:0),D={...o,server_time:e.now,attempts_used:l,attempts_allowed:n.attemptsAllowed,mistakes_used:d,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:k,finished:y,outcome:e.markAtSettlement?"pending":p?"won":y?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:D}:{outcome:"accepted",marked:!0,feedback:t.picks.map($=>({key:$,verdict:r.targets.includes($)?"correct":"wrong"})),next:D}}function DN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var ug,pg=v(()=>{"use strict";Wt();ug={archetype:"hunt",admissible:RN,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return LN({...e,attempt:{picks:t}})},initialState:DN,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}}});function hg(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function jN(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function MN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function UN(e){let{secret:t,state:r,limits:o}=e,n=hg(r),i=$=>({outcome:"rejected",reason:$,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,l=a.entries.find($=>$.key===s);if(!l)return i("not_on_slate");let d=n.total+l.value,p=d>t.target,h=[...n.picks,{slate:a.id,key:l.key,label:l.label,value:l.value}],f=r.attempts_used+1,y=f>=o.picksAllowed,k=p||y,D={...r,server_time:e.now,attempts_used:f,attempts_allowed:o.picksAllowed,progress:{total:d,picks:h,bust:p,...k?{tier:jN(t,d)}:{}},score:e.markAtSettlement?r.score:p?t.target-d:d,finished:k,outcome:e.markAtSettlement?"pending":p?"lost":k?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:D}:{outcome:"accepted",marked:!0,feedback:[{key:l.key,verdict:p?"wrong":"correct",label:String(l.value)}],next:D}}function zN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var mg,fg=v(()=>{"use strict";Wt();mg={archetype:"push",admissible:MN,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return UN({...e,attempt:{picks:t}})},initialState:zN,auditDetail({secret:e,before:t,decision:r}){let o=hg(t),n=hg(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}}});function BN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function WN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(N=>!i.has(N.key)),l=s.find(N=>FN(N.members,t.picks)),d=o.attempts_used+1,p=o.mistakes_used+(l?0:1);l&&(i.add(l.key),a.push({key:l.key,label:l.label,members:[...l.members]}));let h=i.size>=r.groups.length,f=p>=n.mistakesAllowed,y=d>=n.attemptsAllowed,k=h||f||y,D=e.markAtSettlement?o.score:o.score+(l?r.pointsPerGroup:0)+(h?r.completionBonus:0),b={...o,server_time:e.now,attempts_used:d,attempts_allowed:n.attemptsAllowed,mistakes_used:p,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:D,finished:k,outcome:e.markAtSettlement?"pending":h?"won":k?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:b};let $=s.reduce((N,ee)=>Math.max(N,GN(t.picks,ee)),0),S=!l&&t.picks.length>1&&$===t.picks.length-1,w=l?"correct":S?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map((N,ee)=>({key:N,verdict:w,...l&&ee===0?{label:l.label}:{}})),next:b}}function KN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var FN,GN,XS,QS=v(()=>{"use strict";Wt();FN=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,GN=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;XS={archetype:"group",admissible:BN,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return WN({...e,attempt:{picks:t}})},initialState:KN,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}}});function HN(e,t){if(t.answers)return t.answers;if(t.pick===void 0)return{};let r=e.questions[0];return r?{[r.id]:t.pick}:{}}function ZN(e,t){return e.kind==="number"?!(typeof t!="number"||!Number.isFinite(t)||e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max):typeof t=="string"&&(e.options??[]).some(r=>r.key===t)}function VN(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function YN(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=HN(r,t),a=o.attempts_used+1;if(r.questions.filter(p=>i[p.id]===void 0).length>0)return{outcome:"rejected",reason:"incomplete_prediction",marked:!1,feedback:[],next:o};let l=r.questions.find(p=>!ZN(p,i[p.id]));if(l)return{outcome:"rejected",reason:l.kind==="number"?"out_of_range":"unknown_option",marked:!1,feedback:[],next:o};let d={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,answers:i},finished:a>=n.attemptsAllowed};return r.questions.some(p=>p.result===void 0)?{outcome:"accepted",marked:!1,feedback:[],next:{...d,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:qN(r,i),next:eE(r,d,i)}}function qN(e,t){return e.questions.map(r=>{let o=t[r.id],n=Hs(r,o,e.pointsForCorrect),i=r.kind==="number"?String(r.result):(r.options??[]).find(a=>a.key===r.result)?.label;return{key:r.id,verdict:n===e.pointsForCorrect||n>0&&r.kind!=="number"?"correct":n>0?"partial":"wrong",...i?{label:i}:{}}})}function eE(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=Hs(i,r[i.id],e.pointsForCorrect);o+=a,a!==Hs(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function JN(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=XN(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...eE(t,r,o),server_time:e.now}}function XN(e){let t=e.progress.answers;if(t&&typeof t=="object"&&!Array.isArray(t))return t;let r=Array.isArray(e.progress.picks)?e.progress.picks:[];return r.length>0?{1:r[0]}:{}}function QN(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{answers:{}},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var tE,nE=v(()=>{"use strict";ke();Wt();tE={archetype:"predict",admissible:VN,mark(e){let t=e.payload.answers,r=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,o=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:void 0;return YN({...e,attempt:r?{answers:r}:{pick:o}})},initialState:QN,settle:JN,auditDetail({secret:e,decision:t,payload:r}){let o=r.answers;return{predicted:o&&typeof o=="object"&&!Array.isArray(o)?o:typeof r.pick=="string"&&e.questions[0]?{[e.questions[0].id]:r.pick}:null,settled_at_commit:e.questions.every(i=>i.result!==void 0),marked:t.marked,questions_asked:e.questions.length}}}});function eR(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function gg(e){let r=e.progress?.boards;if(!(!Array.isArray(r)||r.length===0)&&r.every(o=>Array.isArray(o)&&o.every(n=>typeof n=="string")))return r}function tR(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function nR(e){let t=gg(e),r=tR(e);if(!t||r===void 0)return;let o=t[r];if(!o)return;let n=e.progress,i=typeof n?.centre=="string"?n.centre:void 0;return{cells:o,centre:i}}function rR(e){let t=eR(e),r=[...e.cardPool],o=[],n={},i={};for(let a=0;a<t&&r.length>0;a++){let s=Math.floor(Math.random()*r.length),l=r.splice(s,1)[0];o.push(l.key),n[l.key]=l.label,l.note&&(i[l.key]=l.note)}return{board:o,cards:n,notes:i}}function rE(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function oR(e,t){let{rows:r,columns:o,centreMode:n}=e,i=n!=="none",a=i?Math.floor(r/2):-1,s=i?Math.floor(o/2):-1,l=(p,h)=>{if(i&&p===a&&h===s)return t.centre;let f=p*o+h,y=i&&f>a*o+s?1:0;return t.cells[f-y]},d=[];for(let p of e.lineTypes)if(p==="row")for(let h=0;h<r;h++)d.push(Array.from({length:o},(f,y)=>l(h,y)).filter(f=>!!f));else if(p==="column")for(let h=0;h<o;h++)d.push(Array.from({length:r},(f,y)=>l(y,h)).filter(f=>!!f));else if(p==="diagonal"&&r===o)d.push(Array.from({length:r},(h,f)=>l(f,f)).filter(h=>!!h)),d.push(Array.from({length:r},(h,f)=>l(f,r-1-f)).filter(h=>!!h));else if(p==="full_board"){let h=[...t.cells,...t.centre?[t.centre]:[]];d.push(h)}return d.filter(p=>p.length>0)}function iR(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:Ec({limits:e.limits,now:e.now})?{ok:!1,reason:"lock_deadline_passed"}:e.state.finished?{ok:!1,reason:"already_locked"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function aR(e){let{secret:t,state:r,limits:o}=e;if(gg(r)!==void 0)return{outcome:"rejected",reason:"already_dealt",marked:!1,feedback:[],next:r};let n=Math.max(1,o.shuffleAllowance+1),i=[],a={},s={};for(let l=0;l<n;l++){let d=rR(t);i.push(d.board),Object.assign(a,d.cards),Object.assign(s,d.notes)}return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,attempts_used:o.shuffleAllowance,attempts_allowed:o.shuffleAllowance,progress:{...r.progress,boards:i,cards:a,...Object.keys(s).length>0?{notes:s}:{}}}}}function sR(e){let{secret:t,state:r}=e,o=gg(r);if(o===void 0)return{outcome:"rejected",reason:"no_board_dealt",marked:!1,feedback:[],next:r};let n=typeof e.board=="number"?e.board:void 0;if(n===void 0||!Number.isInteger(n)||n<0||n>=o.length)return{outcome:"rejected",reason:"unknown_board",marked:!1,feedback:[],next:r};let i={cells:o[n]},a=typeof e.centre=="string"?e.centre:void 0;if(t.centreMode==="none"){if(a!==void 0)return{outcome:"rejected",reason:"centre_not_offered",marked:!1,feedback:[],next:r}}else if(t.centreMode==="choice"){if(a===void 0||!(t.centreOptions??[]).includes(a))return{outcome:"rejected",reason:"invalid_centre",marked:!1,feedback:[],next:r};if(!t.allowCentreDuplicate&&i.cells.includes(a))return{outcome:"rejected",reason:"centre_duplicates_board",marked:!1,feedback:[],next:r}}let s=t.centreMode==="choice"?a:void 0;return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,finished:!0,outcome:"pending",progress:{...r.progress,chosen:n,...s?{centre:s}:{}}}}}function cR(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=nR(r);if(o===void 0)return r;let n=oR(t,o),i=n.filter(f=>rE(f,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(f=>t.cardStatus?.[f]==="correct"),l=a.some(f=>t.cardStatus?.[f]===void 0),d=i*t.pointsPerLine+(s?t.pointsForFullBoard:0),p={};for(let f of a){let y=t.cardStatus?.[f];y&&(p[f]=y)}let h=n.map(f=>{let y=rE(f,t.cardStatus),k=f.filter(b=>t.cardStatus?.[b]==="correct").length,D=f.some(b=>t.cardStatus?.[b]==="incorrect");return{cards:f,complete:y,oneAway:!y&&!D&&k===f.length-1}});return{...r,server_time:e.now,score:d,progress:{...r.progress,marks:p,lines:h},outcome:l?"pending":i>0||s?"won":"lost"}}function lR(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.shuffleAllowance,mistakes_used:0,mistakes_allowed:0,progress:{},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}function dR(e){return e.op==="deal"||e.op==="reshuffle"?aR({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?sR({secret:e.secret,state:e.state,centre:e.centre,board:e.board,now:e.now}):{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}}var oE,iE=v(()=>{"use strict";Wt();oE={archetype:"bingo",admissible:iR,mark(e){let t=e.payload.op;return t!=="deal"&&t!=="reshuffle"&&t!=="lock"?{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}:dR({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:lR,settle:cR,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});import{createHmac as uR}from"node:crypto";function Ci(e,t,r){return uR("sha256",Buffer.from(e.entropy,"hex")).update(["gamestage-shoot",t,e.roundId,e.playerId,e.model,e.profile,String(e.shotIndex)].join("|")).digest().readUInt32BE(0)%r}function sE(e){let t=aE[e.profile];return{targetX:Ci(e,"keeper_x",2*t.diveMaxX+1)-t.diveMaxX,targetY:Ci(e,"keeper_y",t.diveMaxY-t.diveMinY+1)+t.diveMinY,reactionMs:Ci(e,"keeper_reaction",t.reactionMaxMs-t.reactionMinMs+1)+t.reactionMinMs,dispersionX:Ci(e,"dispersion_x",2001)-1e3,dispersionY:Ci(e,"dispersion_y",2001)-1e3}}function cE(e,t,r){let o=aE[r],n=Mt,i=n.ballRadius,a=o.maxFlightMs-Math.floor((o.maxFlightMs-o.minFlightMs)*e.power/1e3),s=o.baseSpread+Math.floor(o.spreadPerPower*e.power/1e3),l=e.aimX+Math.trunc(t.dispersionX*s/1e3),d=Math.max(i,e.aimY+Math.trunc(t.dispersionY*s/1e3)),p=100+Math.floor((1e3-e.power)/5),h=Math.max(0,a-t.reactionMs),f=Math.floor(h*o.speedPerSecond/1e3),y=t.targetX-n.keeperStart.x,k=t.targetY-n.keeperStart.y,D=Math.round(Math.hypot(y,k)),b=D===0?0:Math.min(1,f/D),$=n.keeperStart.x+Math.trunc(y*b),S=n.keeperStart.y+Math.trunc(k*b),w={startX:n.keeperStart.x,startY:n.keeperStart.y,endX:$,endY:S,diveStartMs:t.reactionMs},C={endX:l,endY:d,arcHeight:p},N=(he,Ne)=>({result:he,replay:{flightMs:a,ball:C,keeper:w,contact:Ne}}),ee=Math.abs(l),de=ee+i>=n.postX&&ee-i<=n.postX+n.postWidth&&d-i<=n.barY+n.barHeight,me=d+i>=n.barY&&d-i<=n.barY+n.barHeight&&ee-i<=n.postX+n.postWidth;return de?N("frame",{with:"post",x:Math.sign(l||1)*n.postX,y:d,atMs:a}):me?N("frame",{with:"bar",x:l,y:n.barY,atMs:a}):ee+i<n.postX&&d+i<n.barY?Math.abs(l-$)<=o.reachX+i&&Math.abs(d-S)<=o.reachY+i?N("saved",{with:"keeper",x:l,y:d,atMs:a}):N("goal",null):N("wide",null)}var aE,lE=v(()=>{"use strict";Kr();aE={easy_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:180,reactionMaxMs:340,speedPerSecond:1600,reachX:220,reachY:260},balanced_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:120,reactionMaxMs:280,speedPerSecond:2200,reachX:280,reachY:320},hard_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:80,reactionMaxMs:200,speedPerSecond:2800,reachX:320,reachY:360}}});function pR(e,t){let r=e.progress;return{kind:"shoot",model:r.model??t.model,profile:r.profile??t.profile,goals:typeof r.goals=="number"?r.goals:0,shots:Array.isArray(r.shots)?r.shots:[]}}function hR(e){return typeof e=="string"&&/^[0-9a-f]{64}$/.test(e)}function mR(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"shootout_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function fR(e){if(e.code==="unrecognized_keys")return"unexpected_field";let t=String(e.path[0]??"");return t==="op"?"unknown_operation":t==="model"?"unknown_model":t==="aimX"||t==="aimY"?"aim_out_of_range":t==="power"?"power_out_of_range":"invalid_shot"}function gR(e){let{secret:t,state:r,limits:o}=e,n=S=>({outcome:"rejected",reason:S,marked:!1,feedback:[],next:r});if(!hR(t.entropy))return n("entropy_missing");if(t.model!==xn)return n("unknown_model");let i=vf.safeParse(e.payload.op===void 0?{...e.payload,op:Wr}:e.payload);if(!i.success)return n(fR(i.error.issues[0]));let a=i.data;if(r.attempts_used>=o.attemptsAllowed)return n("shootout_spent");if(a.shotIndex!==r.attempts_used)return n("shot_index_mismatch");let s=sE({entropy:t.entropy,roundId:r.round_id,playerId:r.player_id,model:t.model,profile:t.profile,shotIndex:a.shotIndex}),l=cE({aimX:a.aimX,aimY:a.aimY,power:a.power},s,t.profile),d=pR(r,t),p=l.result==="goal",h=p?t.pointsPerGoal:0,f=d.goals+(p?1:0),y={shotIndex:a.shotIndex,aimX:a.aimX,aimY:a.aimY,power:a.power,result:l.result,points:h,replay:l.replay},k=r.attempts_used+1,D=k>=o.attemptsAllowed,b={...r,server_time:e.now,attempts_used:k,attempts_allowed:o.attemptsAllowed,progress:{...d,goals:f,shots:[...d.shots,y]},score:f*t.pointsPerGoal,finished:D,outcome:D?f>=t.goalsToWin?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:[{key:`shot-${a.shotIndex}`,verdict:p?"correct":"wrong",label:l.result}],next:b}}function yR(e){let t=e.secret??{};return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{kind:"shoot",model:t.model??xn,profile:t.profile??mi,goals:0,shots:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var dE,uE=v(()=>{"use strict";ke();Wt();lE();dE={archetype:"shoot",admissible:mR,mark:gR,initialState:yR,auditDetail({before:e,decision:t,payload:r}){let o=t.next.progress.shots?.at(-1),n=t.outcome==="accepted"&&o!==void 0;return{op:r.op??Wr,accepted:n,...t.outcome==="rejected"?{refused:t.reason}:{},...n?{shot_index:o.shotIndex,aim_x:o.aimX,aim_y:o.aimY,power:o.power,result:o.result,points:o.points,goals_before:e.progress.goals??0,goals_after:t.next.progress.goals??0}:{}}}}});function vR(e){let t=e.progress;return{kind:"place",filled:typeof t.filled=="number"?t.filled:0,placements:Array.isArray(t.placements)?t.placements:[],skipsUsed:typeof t.skipsUsed=="number"?t.skipsUsed:0}}function bR(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:wt(e)?{ok:!1,reason:_t}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"deck_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function _R(e){let{secret:t,state:r,limits:o}=e,n=vR(r),i=f=>({outcome:"rejected",reason:f,marked:!1,feedback:[],next:r}),a=e.payload.op===void 0?"place":e.payload.op;if(a!=="place"&&a!=="skip")return i("unknown_operation");for(let f of Object.keys(e.payload))if(!wR[a].includes(f))return i("unexpected_field");let s=e.payload.itemIndex;if(typeof s!="number"||!Number.isInteger(s)||s<0)return i("invalid_item");if(s!==r.attempts_used)return i("item_index_mismatch");if(r.attempts_used>=o.attemptsAllowed)return i("deck_spent");let l=(f,y)=>{let k=r.attempts_used+1,D=r.mistakes_used+(y.mistake?1:0),b={...n,...f},$=b.filled>=t.cells.length,S=D>=o.mistakesAllowed,w=k>=o.attemptsAllowed,C=$||S||w,N={...r,server_time:e.now,attempts_used:k,attempts_allowed:o.attemptsAllowed,mistakes_used:D,mistakes_allowed:o.mistakesAllowed,progress:b,score:b.filled*t.pointsPerPlacement+($?t.fullHouseBonus:0),finished:C,outcome:C?$?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:y.feedback,next:N}};if(a==="skip")return n.skipsUsed>=o.skipsAllowed?i("skips_exhausted"):l({skipsUsed:n.skipsUsed+1},{mistake:!1,feedback:[]});let d=e.payload.cell;if(typeof d!="string"||!t.cells.includes(d))return i("unknown_cell");if(n.placements.some(f=>f.cell===d))return i("cell_filled");let p=t.deck[s];return(p!==void 0&&t.qualifies[p]?.includes(d))??!1?l({filled:n.filled+1,placements:[...n.placements,{itemIndex:s,cell:d}]},{mistake:!1,feedback:[{key:d,verdict:"correct"}]}):l({},{mistake:!0,feedback:[{key:d,verdict:"wrong"}]})}function kR(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{kind:"place",filled:0,placements:[],skipsUsed:0},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var wR,pE,hE=v(()=>{"use strict";Wt();wR={place:["op","itemIndex","cell"],skip:["op","itemIndex"]};pE={archetype:"place",operations:["place","skip"],admissible:bR,mark:_R,initialState:kR,auditDetail({before:e,decision:t,payload:r}){let o=t.outcome==="accepted",n=o&&t.feedback[0]?.verdict==="correct";return{op:r.op??"place",accepted:o,...t.outcome==="rejected"?{refused:t.reason}:{},...o?{item_index:typeof r.itemIndex=="number"?r.itemIndex:null,cell:typeof r.cell=="string"?r.cell:null,placed:n,filled_before:e.progress.filled??0,filled_after:t.next.progress.filled??0}:{}}}}});function xR(e){return mE[We(e)]}function fE(e){return xR(e.archetype??"hunt")}function gE(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard","rounds"]}}var mE,ar,$c=v(()=>{"use strict";ke();pg();fg();QS();nE();iE();uE();hE();mE={hunt:ug,push:mg,group:XS,predict:tE,bingo:oE,shoot:dE,place:pE},ar=Object.keys(mE)});function yE(e){let t=fE(e.round);if(t)return JS({...e,rules:t})}var vE=v(()=>{"use strict";Wt();$c();pg();fg();Wt()});function bE(e){let t=new Map,r=new Map,o=(b,$)=>`${$}#${b}`,n=new Map,i=new Map,a=new Map,s=new Map,l=new Map,d=new Set,p=new Map,h=new Map,f=new Map,y=e.currentRoundId,k,D=e.now??Date.now;for(let b of e.rounds)t.set(b.round.id,b);for(let b of e.states??[])n.set(Le(e.tenant,b.round_id,b.player_id),{state:b,version:0});return{async getRound(b,$){let S=t.get($);return S?structuredClone(S):void 0},async putRound(b,$,S,w){if(w&&h.has(w.id))throw new Error("audit_record_exists");for(let C=0;C<_c;C+=1)r.set(o($.round.id,C),{version:$.round.version,accepting:$.round.can.accepting_plays});t.set($.round.id,{...structuredClone($),sharded:!0}),w&&h.set(w.id,structuredClone(w)),S&&(y=$.round.id,k=void 0)},async setRotation(b,$,S){k={roundIds:[...$],windowSeconds:S}},async getCurrentRound(){let b=k?k.roundIds[Math.floor(D()/1e3/k.windowSeconds)%k.roundIds.length]:y,$=t.get(b);return $?structuredClone($):void 0},async listRounds(){return[...t.values()].map(b=>structuredClone(b))},async listStatesForPlayer(b,$){return[...n.entries()].filter(([S,w])=>S.startsWith(`${b}#`)&&w.state.player_id===$).map(([,S])=>structuredClone(S.state))},async getState(b,$,S){let w=n.get(Le(b,$,S));return w?structuredClone(w):void 0},async putStateIfVersion(b,$,S){let w=Le(b,$.round_id,$.player_id),C=n.get(w);return S===void 0?C?!1:(n.set(w,{state:structuredClone($),version:0}),!0):!C||C.version!==S?!1:(n.set(w,{state:structuredClone($),version:C.version+1}),!0)},async getPlay(b,$,S){let w=i.get(Le(b,$,S));return w?structuredClone(w):void 0},async putPlayIfAbsent(b,$,S,w){let C=Le(b,$,S);return i.has(C)?!1:(i.set(C,structuredClone(w)),!0)},async getLeaderboard(b,$,S){let w=S?.order??"high_first";if(e.leaderboard)return structuredClone(e.leaderboard);let C=[...a.entries()].filter(([ee])=>ee.startsWith(Le(b,$)+"#")).map(([ee,de])=>({rank:0,player_id:ee.slice(ee.lastIndexOf("#")+1),display_name:Sc(ee.slice(ee.lastIndexOf("#")+1)),score:de})).sort((ee,de)=>w==="low_first"?ee.score-de.score:de.score-ee.score).map((ee,de)=>({...ee,rank:de+1})),N=S?.limit??C.length;return{server_time:"",snapshot:"",round_id:$,order:w,tie_break:"earliest_play",entries:C.slice(0,N),total:C.length,truncated:!1,me:S?.viewerId?C.find(ee=>ee.player_id===S.viewerId):void 0}},async getProfile(b,$){let S=f.get(Le(b,$));return S?structuredClone(S):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:$,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(b,$,S,w,C){let N=Le(b,$,S,String(Ai(w))),ee=(s.get(N)??0)+1;return s.set(N,ee),{inBucket:ee,buckets:_c}},async countGameDay(b,$,S,w){let C=Le(b,$,S,"game"),N=(s.get(C)??0)+1;return s.set(C,N),N},async getDailyActivity(b,$){return $.map(S=>({date:S,plays:l.get(Le(b,S))??0,players:null}))},async markMonthlyPlayer(b,$,S){let w=`${Le(b,$)}#${S}`;if(d.has(w))return;d.add(w);let C=Le(b,$);p.set(C,(p.get(C)??0)+1)},async getMonthlyPlayers(b,$){return p.get(Le(b,$))??0},async setFuse(b,$,S){let w=t.get($);w&&(w.fusedUntil=S)},async setResult(b,$,S,w){let C=t.get($);if(!C)return;let ee=C.secret.questions??[],de=Object.fromEntries(ee.map(he=>[he.id,he.result??null]));if(typeof S=="string")ee[0]&&(ee[0].result=S);else for(let he of ee){let Ne=S[he.id];Ne!==void 0&&(he.result=Ne)}let me=ee.every(he=>he.result!==void 0);C.round.challenge={...C.round.challenge,...me?{questions:ee.map(he=>({...C.round.challenge.questions?.find(Ne=>Ne.id===he.id),id:he.id,result:he.result})),...typeof S=="string"?{result:S}:{}}:{}},C.round.can={...C.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0};for(let he=0;he<_c;he+=1){let Ne=r.get(o($,he));Ne&&(Ne.accepting=!1)}let Ce=new Date().toISOString(),Ct={id:`settle_${$}_${Ce}_${h.size}`,at:Ce,tenant:b,round_id:$,player_id:null,action:"round.settled",detail:{version:C.round.version,result:S,before:de,after:Object.fromEntries(ee.map(he=>[he.id,he.result??null])),closed:!0},...w?{actor:w.actor}:{},...w?.correlation_id?{correlation_id:w.correlation_id}:{}};h.set(Ct.id,structuredClone(Ct))},async recordScore(b,$,S,w){a.set(Le(b,$,S),w)},async appendAudit(b){if(h.has(b.id))throw KS("audit_record_overwrite",{tenant:b.tenant,round_id:b.round_id,action:b.action,record_id:b.id}),new Error("audit_record_exists");h.set(b.id,structuredClone(b))},async commitPlay(b){let $=Le(b.tenant,b.playerId,b.idempotencyKey);if(i.has($))return{ok:!1,reason:"play_exists"};let S=Le(b.tenant,b.state.round_id,b.state.player_id),w=n.get(S);if(b.expectedVersion===void 0){if(w)return{ok:!1,reason:"state_version"}}else if(!w||w.version!==b.expectedVersion)return{ok:!1,reason:"state_version"};for(let N of b.audit)if(h.has(N.id))throw new Error("audit_record_exists");if(b.round?.sharded){let N=r.get(o(b.round.roundId,Ai(b.playerId)));if(!N||N.version!==b.round.version||!N.accepting)return{ok:!1,reason:"round_changed"}}else if(b.round){let N=t.get(b.round.roundId);if(!N||N.round.version!==b.round.version||!N.round.can.accepting_plays)return{ok:!1,reason:"round_changed"}}i.set($,structuredClone(b.play)),n.set(S,{state:structuredClone(b.state),version:b.expectedVersion===void 0?0:b.expectedVersion+1});for(let N of b.audit)h.set(N.id,structuredClone(N));b.score&&a.set(Le(b.tenant,b.score.roundId,b.playerId),b.score.score),b.profile&&f.set(Le(b.tenant,b.playerId),structuredClone(b.profile));let C=Le(b.tenant,b.date);return l.set(C,(l.get(C)??0)+1),{ok:!0}}}}var Le,wE=v(()=>{"use strict";lg();ag();xc();Le=(...e)=>e.join("#")});import{randomBytes as SR}from"node:crypto";function ER(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function $R(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{theme:e.theme,prompt:e.prompt,target:e.target,target_label:e.targetLabel,unit:e.unit,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel,...e.line?{line:e.line}:{}},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function TR(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function AR(e,t){let r=G_(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open&&!o,results_available:o,solution_revealed:o,closed:!e.open||o,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,questions:r.map(i=>({id:i.id,kind:i.kind,prompt:i.prompt,...i.options?{options:i.options.map(a=>({key:a.key,label:a.label}))}:{},...i.min!==void 0?{min:i.min}:{},...i.max!==void 0?{max:i.max}:{},...i.step!==void 0?{step:i.step}:{},...o&&i.result!==void 0?{result:i.result}:{}})),...e.options?{options:e.options.map(i=>({key:i.key,label:i.label}))}:{},...o&&e.result!==void 0?{result:e.result}:{}}},secret:{questions:r,pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function IR(e,t){let r=NR(e,t);return e.archetype==="bingo"?e.locksAt===void 0?r:{...r,round:{...r.round,locks_at:e.locksAt},limits:{...r.limits,locksAt:e.locksAt}}:e.timerSeconds===void 0?r:{...r,round:{...r.round,timer_seconds:e.timerSeconds},limits:{...r.limits,timerSeconds:e.timerSeconds}}}function CR(e,t){let r=e.cardPool.some(i=>i.result!==void 0),o=e.cardPool.length>0&&e.cardPool.every(i=>i.result!==void 0);return{archetype:"bingo",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:r,solution_revealed:o,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,rows:e.rows,columns:e.columns,centre_mode:e.centreMode,...e.centreMode==="choice"?{centre_options:e.centreOptions??[]}:{},line_types:e.lineTypes,points_per_line:e.pointsPerLine,points_for_full_board:e.pointsForFullBoard}},secret:{rows:e.rows,columns:e.columns,centreMode:e.centreMode,...e.centreOptions?{centreOptions:e.centreOptions}:{},allowCentreDuplicate:e.allowCentreDuplicate,lineTypes:e.lineTypes,cardPool:e.cardPool.map(i=>({key:i.key,label:i.label,...i.note?{note:i.note}:{}})),cardStatus:Object.fromEntries(e.cardPool.filter(i=>i.result!==void 0).map(i=>[i.key,i.result])),pointsPerLine:e.pointsPerLine,pointsForFullBoard:e.pointsForFullBoard},limits:{shuffleAllowance:e.shuffleAllowance,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function PR(e,t){return{archetype:"shoot",round:{server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,model:e.model,profile:e.difficulty,shots_allowed:e.shotsAllowed,goals_to_win:e.goalsToWin,points_per_goal:e.pointsPerGoal,input:{aim_x:[nt.aimX.min,nt.aimX.max],aim_y:[nt.aimY.min,nt.aimY.max],power:[nt.power.min,nt.power.max]},geometry:{post_x:Mt.postX,bar_y:Mt.barY,post_width:Mt.postWidth,bar_height:Mt.barHeight,ball_radius:Mt.ballRadius,keeper_start:{x:Mt.keeperStart.x,y:Mt.keeperStart.y}}}},secret:{model:e.model,profile:e.difficulty,shotsAllowed:e.shotsAllowed,goalsToWin:e.goalsToWin,pointsPerGoal:e.pointsPerGoal},limits:{attemptsAllowed:e.shotsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function OR(e,t){let r={server_time:"",snapshot:t,id:Qt(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,board:e.board.map(n=>({key:n.key,label:n.label,...n.art!==void 0?{art:n.art}:{}})),deck:e.deck.map(n=>({key:n.key,name:n.name,...n.image!==void 0?{image:n.image}:{}})),points_per_placement:e.pointsPerPlacement,full_house_bonus:e.fullHouseBonus}},o={};for(let n of e.deck)o[n.key]=[];for(let n of e.qualifies)o[n.item]=n.cells;return{archetype:"place",round:r,secret:{cells:e.board.map(n=>n.key),deck:e.deck.map(n=>n.key),qualifies:o,pointsPerPlacement:e.pointsPerPlacement,fullHouseBonus:e.fullHouseBonus},limits:{attemptsAllowed:e.deck.length,mistakesAllowed:e.mistakesAllowed,skipsAllowed:e.skipsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function NR(e,t){switch(e.archetype){case"hunt":return ER(e,t);case"push":return $R(e,t);case"group":return TR(e,t);case"predict":return AR(e,t);case"bingo":return CR(e,t);case"shoot":return PR(e,t);case"place":return OR(e,t)}}function RR(){return SR(32).toString("hex")}function LR(e,t,r){if(e.archetype!=="shoot")return e;let o=t?.secret?.entropy,n=(t?.archetype??"hunt")==="shoot"&&typeof o=="string"&&o.length>0?o:r();return{...e,secret:{...e.secret,entropy:n}}}function ao(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(ao).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${ao(o)}`).join(",")}}`}function _E(e,t,r={}){let o=i=>{let{server_time:a,snapshot:s,...l}=i,{version:d,...p}=l;if(!r.ignoringSettlement)return p;let{results_available:h,solution_revealed:f,...y}=p.can;return{...p,can:y}},n=i=>{if(!r.ignoringSettlement)return i;let{cardStatus:a,...s}=i??{};return s};return ao({round:o(e.round),secret:n(e.secret),limits:e.limits,archetype:e.archetype})===ao({round:o(t.round),secret:n(t.secret),limits:t.limits,archetype:t.archetype??"hunt"})}function DR(e,t){if(e.archetype!=="bingo"||!_E(e,t,{ignoringSettlement:!0}))return!1;let r=i=>(i??{}).cardStatus??{},o=r(t.secret),n=r(e.secret);for(let[i,a]of Object.entries(o))if(!(i in n)||ao(n[i])!==ao(a))return!1;return Object.keys(n).length>Object.keys(o).length}async function yg(e,t,r,o,n=!0,i,a,s){let l=i??Qt(r),d=await e.getRound(t,l),p=LR(IR(r,o),d,s?.newEntropy??RR);if(p.round.id=l,a&&(p.round.origin=a),d&&_E(p,d)){let{fusedUntil:y,...k}=d;return await e.putRound(t,{...k,archetype:p.archetype},n),{roundId:l,version:d.round.version,changed:!1,current:n}}if(d&&DR(p,d)){let y=Object.keys((p.secret??{}).cardStatus??{}).length;return await e.putRound(t,{...d,round:{...p.round,version:d.round.version},secret:p.secret,limits:p.limits,archetype:p.archetype},n,{id:`round_${l}_settle_v${d.round.version}_${y}`,at:new Date().toISOString(),tenant:t,round_id:l,player_id:null,action:"round.settled",detail:{version:d.round.version,resolved:y,snapshot:o}}),{roundId:l,version:d.round.version,changed:!1,current:n}}let h=d?d.round.version+1:1,f={round:{...p.round,version:h},secret:p.secret,limits:p.limits,archetype:p.archetype};return await e.putRound(t,f,n,{id:`round_${l}_v${h}`,at:new Date().toISOString(),tenant:t,round_id:l,player_id:null,action:d?"round.replaced":"round.provisioned",detail:{version:h,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:l,version:h,changed:!0,current:n}}var kE=v(()=>{"use strict";ke()});function SE(e,t){let r=e.entries??[],o=r.filter(n=>typeof n.display_name=="string"&&n.display_name.trim().length>0);return{generated_at:t,last_updated:e.server_time??t,...e.round_id!==void 0&&{round_id:e.round_id},order:e.order??"high_first",entries:o.map(n=>({external_id:n.player_id,name:n.display_name.trim(),primary_score:n.score})),withheld:r.length-o.length}}var xE,jR,BW,EE=v(()=>{"use strict";He();xE="/play/v1/games/{game}/gfx/leaderboard",jR=c.object({external_id:c.string(),name:c.string().min(1),primary_score:c.number()}),BW=c.object({generated_at:c.string(),last_updated:c.string(),round_id:c.string().optional(),order:c.string(),entries:c.array(jR),withheld:c.number().int().nonnegative()})});function kt(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function TE(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:vg,body:void 0};if(e.method==="GET"&&n===`${Qs}/health`)return lt(200,{status:"ok"});let i=xt.session.exec(n);if(i){if(e.method!=="POST")return Kt(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),l=o?.check(Bf(s,Gf(e)));if(l&&!l.allowed)return $E(l.retryAfterSeconds);let d=r?.issue(s);return d?lt(200,{server_time:"",snapshot:"",token:d.token,player_id:d.playerId,kind:"anonymous"}):Kt(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",xt.runtime],["currentRound",xt.currentRound],["rounds",xt.rounds],["roundsMine",xt.roundsMine],["nextRound",xt.nextRound],["plays",xt.plays],["roundState",xt.roundState],["profile",xt.profile],["graphicsFeed",xt.graphicsFeed],["leaderboard",xt.leaderboard],["round",xt.round]];for(let[s,l]of a){let d=l.exec(n);if(!d)continue;let p=decodeURIComponent(d[1]),h=d[2]?decodeURIComponent(d[2]):void 0,f=o?.check(Bf(p,Gf(e)));if(f&&!f.allowed)return $E(f.retryAfterSeconds);let y=s==="plays";if(y?e.method!=="POST":e.method!=="GET")return Kt(405,"method_not_allowed",`This route accepts ${y?"POST":"GET"}.`);let k;try{k=await t.forPlayer(p,e)}catch(D){return Pn({path:e.path,method:e.method,game:p,stage:"resolve",name:ir(D)}),Kt(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!k)return Kt(404,"not_found",`No game with id "${p}".`);try{switch(s){case"runtime":return lt(200,await k.getRuntime());case"currentRound":return lt(200,await k.getCurrentRound());case"rounds":return lt(200,await k.getRoundPool());case"roundsMine":return lt(200,await k.getPlayedRounds());case"nextRound":return lt(200,await k.getNextRound());case"round":{let D=await k.getRound(h);return D?lt(200,D):Kt(404,"not_found","No such round.")}case"roundState":return lt(200,await k.getRoundState(h));case"profile":return lt(200,await k.getProfile());case"leaderboard":return lt(200,await k.getLeaderboard());case"graphicsFeed":{let D=await k.getLeaderboard(),b=SE(D,new Date().toISOString()),$=lt(200,b);return $.headers["cache-control"]="public, max-age=5",$}case"plays":{let D=Yk.safeParse(e.body);if(!D.success)return Kt(422,"invalid_request",D.error.issues.map(S=>`${S.path.join(".")||"body"}: ${S.message}`).join("; "));let b=await k.play(h,D.data),$=lt(200,b);return b.outcome==="busy"&&b.retry_after_seconds&&($.headers["retry-after"]=String(b.retry_after_seconds)),$}}}catch(D){return D instanceof Error&&D.message==="round_not_found"?Kt(404,"not_found","No such round."):(Pn({path:e.path,method:e.method,game:p,name:ir(D)}),Kt(500,"internal","Something went wrong at our end.",!0))}}return MR}var vg,lt,Kt,xt,MR,$E,AE=v(()=>{"use strict";ke();EE();xc();vg={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},lt=(e,t)=>({status:e,headers:{"content-type":"application/json",...vg},body:t}),Kt=(e,t,r,o=!1)=>lt(e,{error:{code:t,message:r,retryable:o}});xt={runtime:kt(Pe.runtime),currentRound:kt(Pe.currentRound),rounds:kt(Pe.rounds),roundsMine:kt(Pe.roundsMine),nextRound:kt(Pe.nextRound),round:kt(Pe.round),plays:kt(Pe.plays),roundState:kt(Pe.roundState),profile:kt(Pe.profile),leaderboard:kt(Pe.leaderboard),graphicsFeed:kt(xE),session:kt(Pe.session)},MR=Kt(404,"not_found","No such route on the player API."),$E=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...vg},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function Ac(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function on(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var sr,Pi,Tc,YW,so=v(()=>{sr=new TextEncoder,Pi=new TextDecoder,Tc=new TextDecoder("utf-8",{fatal:!0}),YW=2**32});function UR(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function IE(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw Ic(t.name);if(t.hash&&o.hash?.name!==t.hash)throw Ic(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw Ic(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw Ic(t.length,"algorithm.length");UR(e,r)}var Ic,CE=v(()=>{Ic=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function PE(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var OE,bg,wg=v(()=>{OE=(e,...t)=>PE("Key must be ",e,...t),bg=(e,t,...r)=>PE(`Key for the ${e} algorithm must be `,t,...r)});var qe,gt,Oi,Cc,Me,Ee,On,Ni,co,Pc,Oc,Nc,ot=v(()=>{qe=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},gt=class extends qe{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Oi=class extends qe{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},Cc=class extends qe{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Me=class extends qe{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},Ee=class extends qe{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},On=class extends qe{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},Ni=class extends qe{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},co=class extends qe{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},Pc=class extends qe{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},Oc=class extends qe{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},Nc=class extends qe{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var lo,_g,kg,xg=v(()=>{lo=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},_g=e=>e?.[Symbol.toStringTag]==="KeyObject",kg=e=>lo(e)||_g(e)});function Sg(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function Rc(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}var Eg=v(()=>{});function Ri(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:Pi.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=Pi.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Rc(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function uo(e){let t=e;return typeof t=="string"&&(t=sr.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):Sg(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var Li=v(()=>{so();Eg()});function It(e){if(!zR(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Lc(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var zR,$g,NE,RE,LE,Nn=v(()=>{zR=e=>typeof e=="object"&&e!==null;$g=e=>It(e)&&typeof e.kty=="string",NE=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),RE=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,LE=e=>e.kty==="oct"&&typeof e.k=="string"});function Tg(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function Ag(e,t,r){try{return Ri(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function DE(e,t,r){try{return on(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function jE(e,t,r){let o;try{o=JSON.parse(Tc.decode(Ri(e)))}catch{throw new t(r)}if(!It(o))throw new t(r);return o}var Ig=v(()=>{Li();so();Nn()});function BR(e,t){if(!e.kty.includes(t.kty))throw new Me(GR);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function Dc(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new Me('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=BR(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var GR,Cg=v(()=>{ot();GR='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function HR(e,t,r){return e.symmetric?WR(e,t,r):KR(e,t,r)}function zE(e,t){return Mc||=new WeakMap,Mc.get(e)?.[t]}function FE(e,t,r){let o=Mc.get(e);return o?o[t]=r:Mc.set(e,{[t]:r}),r}async function Uc(e,t,r){let o=HR(e,t,r);switch(o.kind){case UE:case Og:return o.key;case jc:{if(o.key.k)return Ri(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return ME(o.key,o.key,e)}case Ng:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?VR(n,e):ME(n,n.export({format:"jwk"}),e)}}}var po,Pg,WR,KR,UE,Og,Ng,jc,Mc,ZR,ME,VR,Rg=v(()=>{wg();xg();Nn();Li();Cg();po=e=>e[Symbol.toStringTag],Pg=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},WR=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:UE,key:t};if($g(t)){if(LE(t)&&Pg(e,t,r))return{kind:jc,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!kg(t))throw new TypeError(bg(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${po(t)} instances for symmetric algorithms must be of type "secret"`);return lo(t)?{kind:Og,key:t}:{kind:Ng,key:t}},KR=(e,t,r)=>{let{alg:o}=e;if($g(t))switch(r){case"decrypt":case"sign":if(NE(t)&&Pg(e,t,r))return{kind:jc,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(RE(t)&&Pg(e,t,r))return{kind:jc,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!kg(t))throw new TypeError(bg(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${po(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${po(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${po(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${po(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${po(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return lo(t)?{kind:Og,key:t}:{kind:Ng,key:t}},UE=Symbol(),Og=Symbol(),Ng=Symbol(),jc=Symbol();ZR={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};ME=async(e,t,r)=>{let o=zE(e,r.alg);if(o)return o;let n=await Dc(r,{...t,alg:r.alg});return FE(e,r.alg,n)},VR=(e,t)=>{let r=zE(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=ZR[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return FE(e,t.alg,e.toCryptoKey(s,o,n))}});function Di(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var Lg=v(()=>{});function zc(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:YR,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Fc(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new Me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:qR,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function Dg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:Gc,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function jg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:Gc,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function Mg(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:Gc,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function Ug(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:GE,keyOps:BE,cekBits:e,ivBits:96,cbc:!1}}function zg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:GE,keyOps:BE,cekBits:e,ivBits:128,cbc:!0}}function WE(e){return JR[e]}var YR,qR,Gc,JR,GE,BE,bK,KE=v(()=>{ot();Lg();YR={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},qR={public:[],private:["deriveBits"]},Gc={public:[],private:[]};JR=Di({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:Gc,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":zc(1),"RSA-OAEP-256":zc(256),"RSA-OAEP-384":zc(384),"RSA-OAEP-512":zc(512),"ECDH-ES":Fc(),"ECDH-ES+A128KW":Fc(128),"ECDH-ES+A192KW":Fc(192),"ECDH-ES+A256KW":Fc(256),A128KW:Dg(128),A192KW:Dg(192),A256KW:Dg(256),A128GCMKW:jg(128),A192GCMKW:jg(192),A256GCMKW:jg(256),"PBES2-HS256+A128KW":Mg(256,128),"PBES2-HS384+A192KW":Mg(384,192),"PBES2-HS512+A256KW":Mg(512,256)}),GE={public:[],private:[]},BE={encrypt:"encrypt",decrypt:"decrypt"};bK=Di({A128GCM:Ug(128),A192GCM:Ug(192),A256GCM:Ug(256),"A128CBC-HS256":zg(256),"A192CBC-HS384":zg(384),"A256CBC-HS512":zg(512)})});function XR(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function QR(e,t,r){IE(t,e.subtle,r),e.minModulusLength&&XR(e.alg,t)}async function HE(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(QR(e,t,r),t)}async function ZE(e,t,r){let o=await HE(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function VE(e,t,r,o){let n=await HE(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var Fg=v(()=>{CE()});function YE(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function qE(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function Wc(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new Me(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var Bc,Gg=v(()=>{ot();Bc=new Map([["b64",!0]])});function Bg(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:ji}}function ho(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:ji,minModulusLength:2048}}function Wg(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:ji}}function JE(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:ji}}function Kg(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:ji}}function Kc(e){let t=XE[e];if(!t)throw new Me(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Hc(e){return XE[e]}var ji,XE,Mi=v(()=>{ot();Lg();ji={public:["verify"],private:["sign"]};XE=Di({HS256:Bg(256),HS384:Bg(384),HS512:Bg(512),RS256:ho("RSASSA-PKCS1-v1_5",256),RS384:ho("RSASSA-PKCS1-v1_5",384),RS512:ho("RSASSA-PKCS1-v1_5",512),PS256:ho("RSA-PSS",256,32),PS384:ho("RSA-PSS",384,48),PS512:ho("RSA-PSS",512,64),ES256:Wg("P-256",256),ES384:Wg("P-384",384),ES512:Wg("P-521",512),EdDSA:JE(),Ed25519:JE(),"ML-DSA-44":Kg("ML-DSA-44"),"ML-DSA-65":Kg("ML-DSA-65"),"ML-DSA-87":Kg("ML-DSA-87")})});function QE(e){return{algorithms:e&&YE("algorithms",e.algorithms),crit:e?.crit}}async function e1(e,t,r){let o={};e.protected&&(o=jE(e.protected,Ee,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!Lc(o,e.header))throw new Ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=Wc(Ee,Bc,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new Cc('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new Ee("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new Ee("JWS Payload must be a string or an Uint8Array instance");let l=!1;typeof r=="function"&&(r=await r(o,e),l=!0);let d=Kc(s),p=Ac(e.protected!==void 0?on(e.protected):new Uint8Array,on("."),typeof e.payload=="string"?a?t.b64p??=DE(e.payload,"payload",Ee):sr.encode(e.payload):e.payload),h=Ag(e.signature,"signature",Ee),f=await Uc(d,r,"verify");if(!await VE(d,f,h,p))throw new Nc;let k;return a?k=Ag(e.payload,"payload",Ee):typeof e.payload=="string"?k=sr.encode(e.payload):k=e.payload,{payload:k,parsedProt:o,b64:a,key:f,resolvedKey:l}}async function e$(e,t,r){if(e instanceof Uint8Array&&(e=Pi.decode(e)),typeof e!="string")throw new Ee("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new Ee("Invalid Compact JWS");return e1({payload:n,protected:o,signature:i},t,r)}var t$=v(()=>{Fg();Mi();ot();so();Ig();Nn();Gg();Rg()});function Ui(e){let t=r1.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*r$);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*o$);break;case"day":case"days":case"d":n=Math.round(r*Hg);break;case"week":case"weeks":case"w":n=Math.round(r*t1);break;default:n=Math.round(r*n1);break}return t[1]==="-"||t[4]==="ago"?-n:n}function an(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}function i$(e,t,r={}){let o;try{o=JSON.parse(Tc.decode(t))}catch{}if(!It(o))throw new On("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||n$(e.typ)!==n$(n)))throw new gt('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:l,maxTokenAge:d}=r,p=[...i];d!==void 0&&p.push("iat"),l!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),a!==void 0&&p.push("iss");for(let k of new Set(p.reverse()))if(!(k in o))throw new gt(`missing required "${k}" claim`,o,k,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new gt('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new gt('unexpected "sub" claim value',o,"sub","check_failed");if(l!==void 0&&!o1(o.aud,typeof l=="string"?[l]:l))throw new gt('unexpected "aud" claim value',o,"aud","check_failed");let h;switch(typeof r.clockTolerance){case"string":h=Ui(r.clockTolerance);break;case"number":h=r.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}an("clockTolerance option",h);let{currentDate:f}=r,y=an("currentDate option",Rn(f||new Date));if((o.iat!==void 0||d!==void 0)&&typeof o.iat!="number")throw new gt('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new gt('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>y+h)throw new gt('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new gt('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=y-h)throw new Oi('"exp" claim timestamp check failed',o,"exp","check_failed")}if(d!==void 0){let k=y-o.iat,D=typeof d=="number"?d:Ui(d);if(k-h>D)throw new Oi('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(k<0-h)throw new gt('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var Rn,r$,o$,Hg,t1,n1,r1,n$,o1,Zc,Zg=v(()=>{ot();so();Nn();Rn=e=>Math.floor(e.getTime()/1e3),r$=60,o$=r$*60,Hg=o$*24,t1=Hg*7,n1=Hg*365.25,r1=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;n$=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,o1=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Zc=class{#e;constructor(t){if(!It(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return sr.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=an("setNotBefore",t):t instanceof Date?this.#e.nbf=an("setNotBefore",Rn(t)):this.#e.nbf=Rn(new Date)+Ui(t)}set exp(t){typeof t=="number"?this.#e.exp=an("setExpirationTime",t):t instanceof Date?this.#e.exp=an("setExpirationTime",Rn(t)):this.#e.exp=Rn(new Date)+Ui(t)}set iat(t){t===void 0?this.#e.iat=Rn(new Date):t instanceof Date?this.#e.iat=an("setIssuedAt",Rn(t)):typeof t=="string"?this.#e.iat=an("setIssuedAt",Rn(new Date)+Ui(t)):this.#e.iat=an("setIssuedAt",t)}}});async function Vg(e,t,r){let o=await e$(e,QE(r),t);if(!o.b64)throw new On("JWTs MUST NOT use unencoded payload");let i={payload:i$(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}var a$=v(()=>{t$();Zg();ot()});function Vc(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function s$(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!Lc(r,o))throw new Ee("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};qE(Ee,r);let i=Wc(Ee,Bc,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new Ee('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Ee('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=Kc(s),d,p;if(a){let $=e.encoded??={};$.b64??=uo(e.payload),$.raw??=on($.b64),d=$.b64,p=$.raw}else p=e.payload,d="";let h,f;r?(h=uo(JSON.stringify(r)),f=on(h)):(h="",f=new Uint8Array);let y=Ac(f,on("."),p),k=await Uc(l,t,"sign"),D=await ZE(l,k,y),b={signature:uo(D),payload:d};return r&&(b.protected=h),b}var Yc=v(()=>{Li();Fg();Mi();Nn();ot();so();Gg();Rg()});var qc,c$=v(()=>{ot();Yc();Ig();qc=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return Tg(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return Tg(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new Ee("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await s$({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var Jc,l$=v(()=>{c$();Yc();Jc=class{#e;#t;constructor(t){this.#e=new qc(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(Vc(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}}});var zi,d$=v(()=>{l$();Yc();ot();Zg();zi=class{#e;#t;constructor(t={}){this.#t=new Zc(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Jc(this.#t.data());if(o.setProtectedHeader(this.#e),Vc(this.#e))throw new On("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function u$(){return new Me('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function p$(e){if(typeof e!="string")throw u$();let t=Hc(e)??WE(e);if(!t)throw u$();return t}var h$=v(()=>{ot();Mi();KE()});function s1(e){Gi(e,48,"Invalid PKCS#8 structure"),Fi(e),Gi(e,2,"Expected version field");let t=Fi(e);e.pos+=t,Gi(e,48,"Expected algorithm identifier");let r=Fi(e);return{algIdStart:e.pos,algIdLength:r}}var Yg,i1,qg,Fi,Gi,m$,a1,c1,l1,d1,f$,g$=v(()=>{Eg();ot();h$();Yg=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},i1=e=>({data:e,pos:0}),qg=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},Fi=e=>{let t=qg(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|qg(e);return o}return t},Gi=(e,t,r)=>{if(qg(e)!==t)throw new Error(r)},m$=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},a1=e=>{Gi(e,6,"Expected algorithm OID");let t=Fi(e);return m$(e,t)};c1=e=>{let t=a1(e);if(Yg(t,[43,101,110]))return"X25519";if(!Yg(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Gi(e,6,"Expected curve OID");let r=Fi(e),o=m$(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Yg(o,i))return n;throw new Error("Unsupported named curve")},l1=async(e,t,r,o)=>{let n=p$(r);if(n.symmetric)throw new Me('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new Me("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},d1=(e,t)=>Rc(e.replace(t,"")),f$=(e,t,r)=>{let o=d1(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=i1(i);return s1(a),c1(a)}),l1("pkcs8",o,t,n)}});function u1(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function p1(e){if(_g(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:uo(e)};if(!lo(e))throw new TypeError(OE(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=u1(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function Jg(e){return p1(e)}var y$=v(()=>{wg();Li();xg()});function h1(e){let t=typeof e=="string"?Hc(e):void 0;if(!t||t.symmetric)throw new Me('Unsupported "alg" value for a JSON Web Key Set');return t}function m1(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(f1)}function f1(e){return It(e)}async function v$(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await Dc(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Ni("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function Qg(e){let t=new Xg(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}var Xg,b$=v(()=>{Cg();Mi();ot();Nn();Xg=class{#e;#t=new WeakMap;constructor(t){if(!m1(t))throw new Ni("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=h1(o),a=this.#e.keys.filter(d=>{let p=i.kty.includes(d.kty);return p&&typeof n=="string"&&(p=n===d.kid),p&&(typeof d.alg=="string"||d.kty==="AKP")&&(p=o===d.alg),p&&typeof d.use=="string"&&(p=d.use==="sig"),p&&Array.isArray(d.key_ops)&&(p=d.key_ops.includes("verify")),p&&i.crv&&(p=d.crv===i.crv),p}),{0:s,length:l}=a;if(l===0)throw new co;if(l!==1){let d=new Pc,p=this.#t;throw d[Symbol.asyncIterator]=async function*(){for(let h of a)try{yield await v$(p,h,i)}catch{}},d}return v$(this.#t,s,i)}}});function g1(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function y1(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new Oc:i});if(n.status!==200)throw new qe("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new qe("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function v1(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!It(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,It))}function ny(e,t){let r=new ty(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}var ey,w$,Xc,ty,_$=v(()=>{ot();b$();Nn();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(ey="jose/v6.2.5");w$=Symbol();Xc=Symbol();ty=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),ey&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",ey),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[w$],r?.[Xc]!==void 0&&(this.#s=r?.[Xc],v1(r?.[Xc],this.#c)&&(this.#i=this.#s.uat,this.#a=Qg(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof co&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&g1()&&(this.#r=void 0),this.#r||=y1(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=Qg(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}}});async function ry(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return f$(e,t,r)}var k$=v(()=>{g$()});var oy=v(()=>{a$();d$();_$();y$();k$()});function b1(e){let t=x$.get(e);return t||(t=ny(new URL(e)),x$.set(e,t)),t}function S$(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await Vg(r,b1(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${w1}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var x$,w1,E$=v(()=>{"use strict";oy();kc();x$=new Map;w1="id:"});import{createPublicKey as _1,generateKeyPairSync as k1}from"node:crypto";async function iy(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Qc}`,{privateKey:n,publicKey:i}=k1("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await ry(n,"RS256"),s=await Jg(_1(i)),l="gamestage-dev",d={keys:[{...s,kid:l,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:d,resolver:S$({issuer:r,jwksUri:o}),async mint(p,h={}){let f=Math.floor(Date.now()/1e3);return new zi({name:p}).setProtectedHeader({alg:"RS256",kid:l}).setIssuer(r).setSubject(p).setIssuedAt(f).setExpirationTime(f+(h.expiresInSeconds??3600)).sign(a)}}}var Qc,ay=v(()=>{"use strict";oy();E$();Qc="/.well-known/jwks.json"});import{createServer as x1}from"node:http";import{randomBytes as S1}from"node:crypto";async function $1(e){let t=bE({tenant:e.game,rounds:[],currentRoundId:""});await yg(t,e.game,Ze.parse(e.round),"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await yg(t,e.game,Ze.parse(n),`local-${o+2}`,!1,void 0,{source:"manifest"});let r=gE({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return yE({tenant:e.game,playerId:n.playerId??Ii(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function T1(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function el(e){let t=await $1(e),r=S1(32).toString("base64"),o={issue:()=>BS(r)},n=e.devIdentity,i=x1((a,s)=>{(async()=>{let l=new URL(a.url??"/","http://localhost");if(n&&l.pathname===Qc){let f=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(l.pathname)){let f=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}let d=a.headers[E1],p=a.headers.authorization,h=await TE({method:a.method??"GET",path:l.pathname,body:await T1(a),...(({playerId:f,refused:y})=>({playerId:f,identityRefusal:y}))(await FS({token:p?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(d)?d[0]:d,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(h.status,h.headers),s.end(h.body===void 0?void 0:JSON.stringify(h.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}var E1,sy=v(()=>{"use strict";ke();vE();$c();wE();kE();AE();kc();ay();ay();$c();E1="x-gamestage-player"});import{spawn as A1}from"node:child_process";import{createHash as I1,randomBytes as T$}from"node:crypto";import{constants as C1}from"node:fs";import{access as P1,mkdtemp as O1,rm as A$}from"node:fs/promises";import{request as N1}from"node:http";import{homedir as tl,tmpdir as R1}from"node:os";import{join as Bi}from"node:path";function cy(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??T$(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}async function hy(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??D1].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await P1(s,C1.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await O1(Bi(R1(),"gamestage-chrome-")),i=A1(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await M1(await j1(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:l}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await py.create(a,l,i,n)}}catch(s){throw a?.close(),await I$(i),await A$(n,{recursive:!0,force:!0}),s}}function j1(e,t){return new Promise((r,o)=>{let n="",i=p=>{clearTimeout(d),e.stderr?.off("data",a),e.off("error",s),e.off("close",l),p()},a=p=>{n=(n+p.toString("utf8")).slice(-4e3);let h=n.match(/DevTools listening on (ws:\/\/\S+)/);h&&i(()=>r(h[1]))},s=p=>i(()=>o(p)),l=p=>i(()=>o(new Error(`Chrome exited before DevTools was ready${p===null?"":` (code ${p})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",l);let d=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function M1(e){return new Promise((t,r)=>{let o=new URL(e),n=T$(16).toString("base64"),i=I1("sha1").update(n+L1).digest("base64"),a=N1({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,l,d)=>{s.headers["sec-websocket-accept"]!==i?(l.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new uy(l,d))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function I$(e){e.exitCode===null&&(e.kill("SIGTERM"),!await $$(e,1e3)&&(e.kill("SIGKILL"),await $$(e,1e3)))}function $$(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function ly(e){return new Promise(t=>setTimeout(t,e))}var L1,dy,uy,py,D1,C$=v(()=>{"use strict";L1="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";dy=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,l=n&127,d=2;if(l===126){if(this.buffered.length<d+2)break;l=this.buffered.readUInt16BE(d),d+=2}else if(l===127){if(this.buffered.length<d+8)break;let f=this.buffered.readBigUInt64BE(d);if(f>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");l=Number(f),d+=8}let p=d;if(s&&(d+=4),this.buffered.length<d+l)break;let h=Buffer.from(this.buffered.subarray(d,d+l));if(s)for(let f=0;f<h.length;f++)h[f]^=this.buffered[p+f%4];if(this.buffered=this.buffered.subarray(d+l),a===8||a===9||a===10)r.push({opcode:a,payload:h});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:h}):(this.fragmentedOpcode=a,this.fragments=[h])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(h),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},uy=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new dy;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(cy(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(cy(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(cy(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},py=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,l=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(l.split(`
10419
10419
  `)[0].replace(/^[A-Za-z]*Error:\s*/,""))}),this.on("Network.requestWillBeSent",a=>{let s=String(a.requestId);this.requests.set(s,a.request??{}),this.inflight.add(s),this.lastNetworkActivity=Date.now()});let i=a=>{this.inflight.delete(String(a.requestId)),this.lastNetworkActivity=Date.now()};this.on("Network.loadingFinished",i),this.on("Network.loadingFailed",i)}cdp;sessionId;child;profile;pageErrors=[];requests=new Map;inflight=new Set;lastNetworkActivity=Date.now();closed=!1;static async create(t,r,o,n){let i=new e(t,r,o,n);return await Promise.all([i.send("Page.enable"),i.send("Runtime.enable"),i.send("Network.enable")]),i}async addScriptToEvaluateOnNewDocument(t){await this.send("Page.addScriptToEvaluateOnNewDocument",{source:t})}async navigate(t,r=2e4){let o=Date.now()+r,n=this.waitForEvent("Page.loadEventFired",r,"page load"),i=await this.send("Page.navigate",{url:t});if(i.errorText)throw new Error(i.errorText);await n,await this.waitForNetworkIdle(Math.max(1,o-Date.now()))}query(t){return this.evaluate(`Array.from(document.querySelectorAll(${JSON.stringify(t)}), (_, index) => index)`)}isVisible(t,r){return this.evaluate(`(() => {
10420
10420
  const element = document.querySelectorAll(${JSON.stringify(t)})[${r}];
10421
10421
  if (!element) return false;
@@ -10433,27 +10433,27 @@ main().catch((error) => {
10433
10433
  if ("disabled" in element && element.disabled) return { ok: false, error: "Element is disabled." };
10434
10434
  element.click();
10435
10435
  return { ok: true };
10436
- })()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await ly(50)}throw new Error(`Timed out after ${r}ms waiting for ${t}.`)}async setOffline(t){await this.send("Network.emulateNetworkConditions",{offline:t,latency:0,downloadThroughput:-1,uploadThroughput:-1})}waitForResponse(t){let r=t.timeout??15e3;return new Promise((o,n)=>{let i=!1,a=d=>{i||(i=!0,clearTimeout(l),s(),d())},s=this.on("Network.responseReceived",d=>{let p=String(d.requestId),h=this.requests.get(p);h?.url?.includes(t.urlIncludes)&&h.method?.toUpperCase()===t.method.toUpperCase()&&a(()=>o({json:async()=>JSON.parse(await this.responseBody(p,r))}))}),l=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await I$(this.child),await A$(this.profile,{recursive:!0,force:!0}))}send(t,r={}){return this.cdp.send(t,r,this.sessionId)}on(t,r){return this.cdp.on(t,r,this.sessionId)}async evaluate(t){let r=await this.send("Runtime.evaluate",{expression:t,awaitPromise:!0,returnByValue:!0});if(r.exceptionDetails)throw new Error(r.exceptionDetails.exception?.description??r.exceptionDetails.text??"The page could not evaluate browser code.");return r.result.value}waitForEvent(t,r,o){return new Promise((n,i)=>{let a=d=>{clearTimeout(l),s(),d()},s=this.on(t,()=>a(n)),l=setTimeout(()=>a(()=>i(new Error(`Timed out after ${r}ms waiting for ${o}.`))),r)})}async waitForNetworkIdle(t){let r=Date.now()+t;for(;Date.now()<r;){if(this.inflight.size===0&&Date.now()-this.lastNetworkActivity>=500)return;await ly(50)}throw new Error("Timed out after 20000ms waiting for the network to settle.")}async responseBody(t,r){let o=Date.now()+r,n=new Error("The response body was not available.");for(;Date.now()<o;)try{let i=await this.send("Network.getResponseBody",{requestId:t});return i.base64Encoded?Buffer.from(i.body,"base64").toString("utf8"):i.body}catch(i){n=i instanceof Error?i:n,await ly(25)}throw n}},P1=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",Bi(tl(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),Bi(tl(),"Applications/Chromium.app/Contents/MacOS/Chromium"),Bi(tl(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),Bi(tl(),"Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),"/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/opt/google/chrome/chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/lib/chromium/chromium","/snap/bin/chromium","/usr/bin/brave-browser","/usr/bin/brave-browser-stable","/opt/brave.com/brave/brave-browser","/usr/bin/microsoft-edge","/usr/bin/microsoft-edge-stable","/opt/microsoft/msedge/msedge"]});function my(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function P$(e){let t=my(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||L1.test(t)||R1.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}function O$(e){for(let t of D1)if(t.test.test(e))return{confidence:"likely",level:t.level,...t.setting?{setting:t.setting}:{},because:t.because};return{confidence:"possible",level:"project",because:"a fan reads it and nothing in the code says it changes per round or per edition"}}function j1(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
10436
+ })()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await ly(50)}throw new Error(`Timed out after ${r}ms waiting for ${t}.`)}async setOffline(t){await this.send("Network.emulateNetworkConditions",{offline:t,latency:0,downloadThroughput:-1,uploadThroughput:-1})}waitForResponse(t){let r=t.timeout??15e3;return new Promise((o,n)=>{let i=!1,a=d=>{i||(i=!0,clearTimeout(l),s(),d())},s=this.on("Network.responseReceived",d=>{let p=String(d.requestId),h=this.requests.get(p);h?.url?.includes(t.urlIncludes)&&h.method?.toUpperCase()===t.method.toUpperCase()&&a(()=>o({json:async()=>JSON.parse(await this.responseBody(p,r))}))}),l=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await I$(this.child),await A$(this.profile,{recursive:!0,force:!0}))}send(t,r={}){return this.cdp.send(t,r,this.sessionId)}on(t,r){return this.cdp.on(t,r,this.sessionId)}async evaluate(t){let r=await this.send("Runtime.evaluate",{expression:t,awaitPromise:!0,returnByValue:!0});if(r.exceptionDetails)throw new Error(r.exceptionDetails.exception?.description??r.exceptionDetails.text??"The page could not evaluate browser code.");return r.result.value}waitForEvent(t,r,o){return new Promise((n,i)=>{let a=d=>{clearTimeout(l),s(),d()},s=this.on(t,()=>a(n)),l=setTimeout(()=>a(()=>i(new Error(`Timed out after ${r}ms waiting for ${o}.`))),r)})}async waitForNetworkIdle(t){let r=Date.now()+t;for(;Date.now()<r;){if(this.inflight.size===0&&Date.now()-this.lastNetworkActivity>=500)return;await ly(50)}throw new Error("Timed out after 20000ms waiting for the network to settle.")}async responseBody(t,r){let o=Date.now()+r,n=new Error("The response body was not available.");for(;Date.now()<o;)try{let i=await this.send("Network.getResponseBody",{requestId:t});return i.base64Encoded?Buffer.from(i.body,"base64").toString("utf8"):i.body}catch(i){n=i instanceof Error?i:n,await ly(25)}throw n}},D1=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",Bi(tl(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),Bi(tl(),"Applications/Chromium.app/Contents/MacOS/Chromium"),Bi(tl(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),Bi(tl(),"Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),"/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/opt/google/chrome/chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/lib/chromium/chromium","/snap/bin/chromium","/usr/bin/brave-browser","/usr/bin/brave-browser-stable","/opt/brave.com/brave/brave-browser","/usr/bin/microsoft-edge","/usr/bin/microsoft-edge-stable","/opt/microsoft/msedge/msedge"]});function my(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function P$(e){let t=my(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||z1.test(t)||U1.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}function O$(e){for(let t of F1)if(t.test.test(e))return{confidence:"likely",level:t.level,...t.setting?{setting:t.setting}:{},because:t.because};return{confidence:"possible",level:"project",because:"a fan reads it and nothing in the code says it changes per round or per edition"}}function G1(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
10437
10437
  `.repeat(n.split(`
10438
10438
  `).length-1)).replace(/<style[\s\S]*?<\/style>/gi,n=>`
10439
10439
  `.repeat(n.split(`
10440
10440
  `).length-1)).split(`
10441
- `).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let l=s.replace(/\s+/g," ");if(!P$(l))continue;let d=my(l);t.push({text:d,...O$(d),file:e.relative,line:i+1})}}),t}function M1(e){let t=[];return e.text.split(`
10442
- `).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!P$(i))continue;let a=my(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...O$(a),file:e.relative,line:o+1})}}),t}function nl(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...j1(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...M1(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}var R1,L1,D1,fy=v(()=>{"use strict";R1=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],L1=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;D1=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}]});var q$={};Ot(q$,{browserCheck:()=>G1,browserChecks:()=>B$,connectionCheck:()=>V$,runVerify:()=>wy,scanPublishSet:()=>Y$,shootPlayCheck:()=>Z$,verificationResult:()=>G$});import{readFile as gy}from"node:fs/promises";import{dirname as N$,resolve as yy}from"node:path";function U1(e){switch(e){case"hunt":return Ze.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Ze.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Ze.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"predict":return Ze.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});case"shoot":return Ze.parse({archetype:e,number:1,prompt:"Five penalties. Three to win.",shotsAllowed:5,goalsToWin:3,pointsPerGoal:100,open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function z1(e,t,r){return(Ex({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=Lf[i.key];return a?[[i.key,a]]:[]})}function G$(e){let t=e.filter(n=>n.status==="open").length,r=e.filter(n=>n.status==="skipped").length,o=e.filter(n=>n.status==="n/a").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r,notApplicable:o}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r,notApplicable:o}:{outcome:"verified",exitCode:0,open:t,skipped:r,notApplicable:o}}function vy(e){return F1.map(t=>({...t,status:"skipped",detail:e}))}async function B$(e,t,r,o){let n;try{n=await hy()}catch(a){return vy("Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim())}if(n.status==="skipped")return vy(n.detail);let i=n.browser;try{return[await H$(i,e,t,r,o),await V$(i,e)]}finally{await i.close().catch(()=>{})}}async function G1(e,t,r,o){let n;try{n=await hy()}catch(a){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim()}}if(n.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:n.detail};let i=n.browser;try{return await H$(i,e,t,r,o)}finally{await i.close().catch(()=>{})}}async function B1(e){let t=Date.now()+by;do{if((await e.query(Wi)).length>0)return;let r=await e.query("[data-gamestage-start]:not([disabled])");for(let o of r)if(await e.isVisible("[data-gamestage-start]:not([disabled])",o))return o;await new Promise(o=>setTimeout(o,W$))}while(Date.now()<t)}async function K$(e){for(let t=0;t<3&&!((await e.query(Wi)).length>0);t++){let r=await B1(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(Wi,5e3).catch(()=>{})}}async function H$(e,t,r,o,n){try{if(await e.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(r)};window.GAMESTAGE_GAME = ${JSON.stringify(o)};`),await e.navigate(t,2e4),We(n??"")==="shoot")return await Z$(e);await K$(e);let i=await e.query(Wi);if(i.length===0){let k=e.pageErrors[0],D=await e.query("#prompt").then(()=>e.html()).then($=>/id="prompt"[^>]*>([^<]{0,160})/.exec($)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${k?` The page threw: ${k}`:D?` The page says: ${D}`:""}`}}let a=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),s=0;for(let k of i)if(await e.click(Wi,k).catch(()=>{}),s+=1,(await e.query(L$)).length>0)break;let l=await e.query(R$);if(l.length===0){let k=Symbol("pending"),D=await Promise.race([a,new Promise(b=>setTimeout(()=>b(k),5e3))]);if(D===k||D===void 0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board. The page has no Submit, which is allowed because a tap can be the play, but nothing reached the Engine either, so no play was made by any route.`}}else{if((await e.query(L$)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await e.click(R$,l[0])}let d=await a;if(!d)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let p=await d.json();if(e.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${e.pageErrors[0]}`};let h=await e.html(),f=p.round_state?.score,y=f===void 0||h.includes(String(f))||h.includes(f.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:y?"verified":"open",detail:y?`The play went to the Engine and came back ${p.outcome}.`:`The Engine committed a score of ${f} and the page does not show it.`}}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:i instanceof Error?i.message:"The page could not be played."}}}async function U$(e,t,r){let o=Date.now()+r;do{if((await e.query(t)).length>0)return!0;await new Promise(n=>setTimeout(n,W$))}while(Date.now()<o);return!1}async function Z$(e){let t="rendered-outcome",r="the screen shows what the server decided",o=b=>({id:t,what:r,status:"open",detail:b});if(!await U$(e,D$,by)){let b=e.pageErrors[0];return o("Found no aim control. A penalties page offers its aim as buttons carrying `data-aim`, so a fan and this check can set up the same shot."+(b?` The page threw: ${b}`:""))}if(await e.click(D$,0).catch(()=>{}),(await e.query(j$)).length>0&&await e.click(j$,0).catch(()=>{}),!await U$(e,M$,by))return o("An aim and a power were chosen and the page never allowed a shot: the shoot control stayed disabled or was not there. It is `#shoot` or `[data-gamestage-shoot]`.");let n=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{});await e.click(M$,0);let i=await n;if(!i)return o("Shoot was pressed and the page never asked the Engine. Whatever it showed, it decided for itself.");let a=await i.json();if(e.pageErrors.length)return o(`The page threw: ${e.pageErrors[0]}`);if(a.outcome!=="accepted"&&a.outcome!=="duplicate"){let b=a.reason==="unexpected_field"?"The page put something on the wire the Engine does not take from a page, a result or a score of its own, and the Engine refused the whole shot rather than read round it. Send the aim, the power and the shot index and nothing else.":`The Engine refused the shot: ${a.reason??a.outcome}.`;return o(b)}let s=a.round_state?.progress?.shots?.at(-1);if(!s?.result)return o("The Engine accepted the shot and its state carries no committed shot to compare against.");let l=/<[a-z][^>]*\sdata-shot-result="([a-z]+)"/g,d=new RegExp(`<[a-z][^>]*\\sdata-shot-result="${s.result}"`),p=Date.now()+W1,h=await e.html();for(;!d.test(h)&&Date.now()<p;)await new Promise(b=>setTimeout(b,100)),h=await e.html();let f=[...h.matchAll(l)].map(b=>b[1]);if(!d.test(h))return o(`The Engine committed ${s.result} and the page shows ${f.length?f.map(b=>`"${b}"`).join(", "):"no shot result at all"}. The result a fan reads has to be the one the Engine returned, drawn from \`round_state.progress.shots\`, never worked out on the page.`);let y=a.round_state?.attempts_used;if(typeof y=="number"&&f.length!==y)return o(`The Engine has taken ${y} shot${y===1?"":"s"} and the page draws ${f.length}. A shot on the screen that the Engine never committed is a shot the page invented.`);let k=a.round_state?.score;return k===void 0||h.includes(String(k))||h.includes(k.toLocaleString("en-US"))?{id:t,what:r,status:"verified",detail:`The shot went to the Engine and came back ${s.result}; the page drew that and the score ${k}.`}:o(`The Engine committed a score of ${k} and the page does not show it.`)}async function V$(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await K$(e);let n=await e.html();await e.setOffline(!0);let i=await z$(e,n,3e3);return i?(await e.setOffline(!1),await z$(e,i,3e3)?{id:r,what:o,status:"verified",detail:"Taken offline the page said so, and it recovered when the network returned."}:{id:r,what:o,status:"open",detail:"The page noticed the connection going and not it coming back: it was still in its offline state three seconds after the network returned. Listen for `online` as well, take the message down, and re-read the round rather than trusting what is on the screen."}):{id:r,what:o,status:"open",detail:"The connection was taken away and the page did not change. A fan who loses their signal is shown a game that still looks playable, and every tap on it is a tap the Engine never sees. Listen for the window's `offline` event and say so on the screen."}}catch(n){return{id:r,what:o,status:"open",detail:n instanceof Error?n.message:"The page could not be taken offline and back."}}finally{await e.setOffline(!1).catch(()=>{})}}async function z$(e,t,r){let o=Date.now()+r;for(;Date.now()<o;){let n=await e.html().catch(()=>t);if(n!==t)return n;await new Promise(i=>setTimeout(i,100))}}function H1(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>K1.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function F$(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function Y$(e,t){let{files:r,skippedLinks:o}=Ti(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let l=H1(s.relativePath);if(l){i.has(l)||(i.add(l),n.push({path:`${l}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(rg(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let d=await $i(s.path);if(d===void 0)continue;a+=1;let p=De(d);if(p.ok&&p.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let h=ro(d,t);if(h.length){n.push({path:s.relativePath,why:oo(t,h),fatal:!0});continue}let f;try{let y=JSON.parse(d);y&&Array.isArray(y.sourcesContent)&&(f=y)}catch{}if(f){let y=f.sourcesContent.filter(D=>typeof D=="string").join(`
10443
- `),k=y?ro(y,t):[];if(k.length){n.push({path:s.relativePath,why:`${oo(t,k)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}F$(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)F$(s.relativePath)&&!n.some(l=>l.path===s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1});return{files:r,read:a,findings:n}}async function wy(e){await ki();let t=e.manifest??"gamestage.yaml",r,o="";try{o=await gy(t,"utf8");let q=De(o);if(!q.ok)return V(`${t} is not a valid App Manifest.`,q.issues.map(Se=>`${P.cyan(Se.path)} ${Se.message}`));r=q.manifest}catch{return V(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let n=r.backend.round??U1(r.backend.archetype),i=r.backend.round?{source:"manifest",archetype:n.archetype,detail:"The Engine used this game's own backend.round from the manifest."}:{source:"stand-in",archetype:n.archetype,detail:`The manifest carries no round, so the Engine used a representative ${n.archetype} stand-in supplied by Gamestage. It did not test the game's production content from Studio.`};if(!ar.includes(n.archetype))return V(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${ar.join(", ")}.`]);let a=yy(e.file??"index.html"),s;try{s=await gy(a,"utf8")}catch{return V(`Cannot read ${e.file??"index.html"}.`)}let l=[];l.push({id:"round-is-the-games-own",what:"the round played here was this game's own",status:i.source==="manifest"?"verified":"skipped",detail:i.source==="manifest"?void 0:"This game keeps its content in Studio, which is where it belongs, so there is no round here to play and this check cannot run. That is a limit of checking locally rather than anything wrong with the game. Play the deployed game to prove its round."});let d=n.archetype==="shoot"?"shotsAllowed":"attemptsAllowed",p=n.archetype==="shoot"?5:10,h=n.archetype==="hunt"||n.archetype==="group"||n.archetype==="shoot",f=new RegExp(`^\\s*${d}\\s*:`,"m").test(o);l.push({id:"attempts-cap-chosen",what:"the attempt cap was chosen rather than defaulted",status:r.backend.round?h?f?"verified":"open":"n/a":"skipped",detail:r.backend.round?h?f?void 0:`backend.round.${d} is not set, so the Engine applied its default of ${p}. Nobody chose that number, and it is the game a fan plays. Set it, even to ${p}, so it is a decision rather than an accident.`:`A ${n.archetype} round is not capped by ${d}.`:"No round in the manifest; the content is in Studio, where the cap is a producer's field."});let y=yy(e.dir??N$(a)),k;try{k=await Y$(y,n)}catch(q){return V(`Cannot read the publish set at ${e.dir??N$(a)}.`,[q instanceof Error?q.message:"The directory could not be walked."])}let D=k.findings.filter(q=>q.fatal),b=ro(s,n),$=b.length>0||D.length>0;l.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${k.files.length} file${k.files.length===1?"":"s"}, ${k.read} read)`,status:$?"open":"verified",detail:$?[b.length?oo(n,b):void 0,...D.map(q=>`${q.path}: ${q.why}`)].filter(Boolean).join(" "):void 0});let S=await vc(k.files),w=S.map(q=>q.text).join(`
10444
- `),C=dc(w),N=z1(r,n.archetype,C).filter(([,q])=>!Df(w,q)).map(([q])=>q);l.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(C.length?`, and it offers ${C.length} more for controls it has (${C.join(", ")})`:""),status:N.length?"open":"verified",detail:N.length?`The page does not read: ${N.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let ee=nl(S),me=k.files.some(q=>{let Se=q.relativePath.split("/").pop();return Se===Oe||Se===Fe})||s.includes(Oe)||s.includes(Fe),Ce=s.includes("createPlayerClient")||/\bstart\s*\(/.test(s);l.push({id:"client-present",what:"the client the page imports is there",status:me||!Ce?"verified":"open",detail:Ce&&!me?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let he=["@monterosa/sdk-core","@monterosa/sdk-connect-kit","@monterosa/sdk-consent-kit","@monterosa/sdk-storage-kit","@monterosa/sdk-analytics-kit","@monterosa/sdk-interact-kit","@monterosa/sdk-identify-kit","@monterosa/sdk-util"].filter(q=>w.includes(q));l.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:he.length===0?"verified":"open",detail:he.length===0?void 0:`This game imports ${he.join(", ")} directly. The Gamestage client is the only supported way to reach Interaction Cloud: it holds the connection, the consent gate and the server clock, and a second one beside it has none of them. Use what \`start()\` returns instead, and say what is missing from it if something is.`});let Ne=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test(w),yt=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test(w);l.push({id:"server-time",what:"a deadline comes from the server's clock",status:Ne&&yt?"skipped":"verified",detail:Ne&&yt?"This game reads the device clock somewhere and handles a round's timing somewhere, and this check reads the bundle as one string, so it cannot tell whether those are the same code. Worth your eyes: a lock or a countdown decided by the device clock is a deadline a fan can move by changing their clock. Use `game.now()`, which is the server's time through the client. `Date.now()` is fine for anything that decides nothing, like an animation or an analytics timestamp.":void 0});let se=await el({game:r.app.id,round:n,title:r.app.title});await new Promise(q=>se.listen(0,"127.0.0.1",()=>q()));let $e=se.address(),X=$e&&typeof $e!="string"?`http://127.0.0.1:${$e.port}`:"",dt=await import("node:http").then(({createServer:q})=>q(async(Se,ut)=>{let Be=(Se.url??"/").split("?")[0],St=Be==="/"?a:yy(a,"..",Be.slice(1));try{let Mn=await gy(St);ut.writeHead(200,{"content-type":St.endsWith(".js")?"text/javascript":"text/html"}),ut.end(Mn)}catch{ut.writeHead(404).end()}}));await new Promise(q=>dt.listen(0,"127.0.0.1",()=>q()));let Ge=dt.address(),jn=Ge&&typeof Ge!="string"?`http://127.0.0.1:${Ge.port}/`:"";try{l.push(...e.noBrowser?vy("Asked not to open a browser."):await B$(jn,X,r.app.id,n.archetype))}finally{se.close(),dt.close()}let _e=G$(l),Je=k.findings.filter(q=>!q.fatal);if(J()){Q({ok:_e.outcome==="verified",outcome:_e.outcome,exitCode:_e.exitCode,checks:l,open:_e.open,skipped:_e.skipped,round:i,copy_candidates:ee,publish_set:{directory:y,files:k.files.map(q=>q.relativePath),read:k.read,warnings:Je}}),_e.exitCode!==0&&await Kf(_e.exitCode);return}K(_e.outcome==="verified"?"Verified":_e.outcome==="failed"?"Verification failed":"Verification incomplete"),M("round used for verification",i.source),g(` ${P.dim(i.detail)}`);for(let q of l){let Se=q.status==="verified"?P.green("ok"):q.status==="open"?P.yellow("open"):q.status==="n/a"?P.dim("n/a"):P.dim("skipped");M(q.what,Se),q.detail&&g(` ${P.dim(q.detail)}`)}if(Je.length){g(),g(P.dim(" Also in the publish set, and a deploy would upload it:"));for(let q of Je)g(` ${P.dim("\xB7")} ${P.cyan(q.path)} ${P.dim(q.why)}`)}if(ee.length){g(),g(P.dim(" Copy a producer may need to own:"));for(let q of ee)g(` ${P.dim("\xB7")} ${P.cyan(`${q.file}:${q.line}`)} ${q.text} ${P.dim(`(${q.confidence}, ${q.level})`)}`)}g(),_e.outcome==="verified"?A("The Engine decided the outcome and the page showed it. That is the migration done."):_e.outcome==="failed"?A("A check remains open, so the game failed verification. Read the open check and fix its cause."):A("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),g(),_e.exitCode!==0&&await Kf(_e.exitCode)}var Wi,R$,L$,F1,by,W$,D$,j$,M$,W1,K1,_y=v(()=>{"use strict";ke();sy();At();tn();C$();ig();fy();wc();yc();Re();Wi="button.pick, [data-pick]",R$="#submit, button[type=submit], .submit",L$="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",F1=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];by=15e3,W$=250;D$="[data-aim]",j$="[data-power]",M$="#shoot:not([disabled]), [data-gamestage-shoot]:not([disabled])",W1=4e3;K1=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var un=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Un=class extends un{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var So=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Un(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function na(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as wA}from"node:events";import bl from"node:child_process";import Vt from"node:path";import oa from"node:fs";import fe from"node:process";import{stripVTControlCharacters as _A}from"node:util";import{stripVTControlCharacters as yA}from"node:util";var Eo=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>na(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(h,f){return r.formatItem(h,o,f,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let l=r.visibleArguments(t).map(h=>i(r.styleArgumentTerm(r.argumentTerm(h)),r.styleArgumentDescription(r.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",l,r)),this.groupItems(t.options,r.visibleOptions(t),h=>h.helpGroupHeading??"Options:").forEach((h,f)=>{let y=h.map(k=>i(r.styleOptionTerm(r.optionTerm(k)),r.styleOptionDescription(r.optionDescription(k))));a=a.concat(this.formatItemList(f,y,r))}),r.showGlobalOptions){let h=r.visibleGlobalOptions(t).map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));a=a.concat(this.formatItemList("Global Options:",h,r))}return this.groupItems(t.commands,r.visibleCommands(t),h=>h.helpGroup()||"Commands:").forEach((h,f)=>{let y=h.map(k=>i(r.styleSubcommandTerm(r.subcommandTerm(k)),r.styleSubcommandDescription(r.subcommandDescription(k))));a=a.concat(this.formatItemList(f,y,r))}),a.join(`
10445
- `)}displayWidth(t){return yA(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,n){let a=" ".repeat(2);if(!o)return a+t;let s=t.padEnd(r+t.length-n.displayWidth(t)),l=2,p=(this.helpWidth??80)-r-l-2,h;return p<this.minWidthToWrap||n.preformatted(o)?h=o:h=n.boxWrap(o,p).replace(/\n/g,`
10441
+ `).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let l=s.replace(/\s+/g," ");if(!P$(l))continue;let d=my(l);t.push({text:d,...O$(d),file:e.relative,line:i+1})}}),t}function B1(e){let t=[];return e.text.split(`
10442
+ `).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!P$(i))continue;let a=my(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...O$(a),file:e.relative,line:o+1})}}),t}function nl(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...G1(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...B1(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}var U1,z1,F1,fy=v(()=>{"use strict";U1=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],z1=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;F1=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}]});var q$={};Ot(q$,{browserCheck:()=>Z1,browserChecks:()=>B$,connectionCheck:()=>V$,runVerify:()=>wy,scanPublishSet:()=>Y$,shootPlayCheck:()=>Z$,verificationResult:()=>G$});import{readFile as gy}from"node:fs/promises";import{dirname as N$,resolve as yy}from"node:path";function W1(e){switch(e){case"hunt":return Ze.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Ze.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Ze.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"predict":return Ze.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});case"shoot":return Ze.parse({archetype:e,number:1,prompt:"Five penalties. Three to win.",shotsAllowed:5,goalsToWin:3,pointsPerGoal:100,open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function K1(e,t,r){return(Ex({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=Lf[i.key];return a?[[i.key,a]]:[]})}function G$(e){let t=e.filter(n=>n.status==="open").length,r=e.filter(n=>n.status==="skipped").length,o=e.filter(n=>n.status==="n/a").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r,notApplicable:o}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r,notApplicable:o}:{outcome:"verified",exitCode:0,open:t,skipped:r,notApplicable:o}}function vy(e){return H1.map(t=>({...t,status:"skipped",detail:e}))}async function B$(e,t,r,o){let n;try{n=await hy()}catch(a){return vy("Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim())}if(n.status==="skipped")return vy(n.detail);let i=n.browser;try{return[await H$(i,e,t,r,o),await V$(i,e)]}finally{await i.close().catch(()=>{})}}async function Z1(e,t,r,o){let n;try{n=await hy()}catch(a){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim()}}if(n.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:n.detail};let i=n.browser;try{return await H$(i,e,t,r,o)}finally{await i.close().catch(()=>{})}}async function V1(e){let t=Date.now()+by;do{if((await e.query(Wi)).length>0)return;let r=await e.query("[data-gamestage-start]:not([disabled])");for(let o of r)if(await e.isVisible("[data-gamestage-start]:not([disabled])",o))return o;await new Promise(o=>setTimeout(o,W$))}while(Date.now()<t)}async function K$(e){for(let t=0;t<3&&!((await e.query(Wi)).length>0);t++){let r=await V1(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(Wi,5e3).catch(()=>{})}}async function H$(e,t,r,o,n){try{if(await e.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(r)};window.GAMESTAGE_GAME = ${JSON.stringify(o)};`),await e.navigate(t,2e4),We(n??"")==="shoot")return await Z$(e);await K$(e);let i=await e.query(Wi);if(i.length===0){let k=e.pageErrors[0],D=await e.query("#prompt").then(()=>e.html()).then($=>/id="prompt"[^>]*>([^<]{0,160})/.exec($)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${k?` The page threw: ${k}`:D?` The page says: ${D}`:""}`}}let a=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),s=0;for(let k of i)if(await e.click(Wi,k).catch(()=>{}),s+=1,(await e.query(L$)).length>0)break;let l=await e.query(R$);if(l.length===0){let k=Symbol("pending"),D=await Promise.race([a,new Promise(b=>setTimeout(()=>b(k),5e3))]);if(D===k||D===void 0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board. The page has no Submit, which is allowed because a tap can be the play, but nothing reached the Engine either, so no play was made by any route.`}}else{if((await e.query(L$)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await e.click(R$,l[0])}let d=await a;if(!d)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let p=await d.json();if(e.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${e.pageErrors[0]}`};let h=await e.html(),f=p.round_state?.score,y=f===void 0||h.includes(String(f))||h.includes(f.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:y?"verified":"open",detail:y?`The play went to the Engine and came back ${p.outcome}.`:`The Engine committed a score of ${f} and the page does not show it.`}}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:i instanceof Error?i.message:"The page could not be played."}}}async function U$(e,t,r){let o=Date.now()+r;do{if((await e.query(t)).length>0)return!0;await new Promise(n=>setTimeout(n,W$))}while(Date.now()<o);return!1}async function Z$(e){let t="rendered-outcome",r="the screen shows what the server decided",o=b=>({id:t,what:r,status:"open",detail:b});if(!await U$(e,D$,by)){let b=e.pageErrors[0];return o("Found no aim control. A penalties page offers its aim as buttons carrying `data-aim`, so a fan and this check can set up the same shot."+(b?` The page threw: ${b}`:""))}if(await e.click(D$,0).catch(()=>{}),(await e.query(j$)).length>0&&await e.click(j$,0).catch(()=>{}),!await U$(e,M$,by))return o("An aim and a power were chosen and the page never allowed a shot: the shoot control stayed disabled or was not there. It is `#shoot` or `[data-gamestage-shoot]`.");let n=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{});await e.click(M$,0);let i=await n;if(!i)return o("Shoot was pressed and the page never asked the Engine. Whatever it showed, it decided for itself.");let a=await i.json();if(e.pageErrors.length)return o(`The page threw: ${e.pageErrors[0]}`);if(a.outcome!=="accepted"&&a.outcome!=="duplicate"){let b=a.reason==="unexpected_field"?"The page put something on the wire the Engine does not take from a page, a result or a score of its own, and the Engine refused the whole shot rather than read round it. Send the aim, the power and the shot index and nothing else.":`The Engine refused the shot: ${a.reason??a.outcome}.`;return o(b)}let s=a.round_state?.progress?.shots?.at(-1);if(!s?.result)return o("The Engine accepted the shot and its state carries no committed shot to compare against.");let l=/<[a-z][^>]*\sdata-shot-result="([a-z]+)"/g,d=new RegExp(`<[a-z][^>]*\\sdata-shot-result="${s.result}"`),p=Date.now()+Y1,h=await e.html();for(;!d.test(h)&&Date.now()<p;)await new Promise(b=>setTimeout(b,100)),h=await e.html();let f=[...h.matchAll(l)].map(b=>b[1]);if(!d.test(h))return o(`The Engine committed ${s.result} and the page shows ${f.length?f.map(b=>`"${b}"`).join(", "):"no shot result at all"}. The result a fan reads has to be the one the Engine returned, drawn from \`round_state.progress.shots\`, never worked out on the page.`);let y=a.round_state?.attempts_used;if(typeof y=="number"&&f.length!==y)return o(`The Engine has taken ${y} shot${y===1?"":"s"} and the page draws ${f.length}. A shot on the screen that the Engine never committed is a shot the page invented.`);let k=a.round_state?.score;return k===void 0||h.includes(String(k))||h.includes(k.toLocaleString("en-US"))?{id:t,what:r,status:"verified",detail:`The shot went to the Engine and came back ${s.result}; the page drew that and the score ${k}.`}:o(`The Engine committed a score of ${k} and the page does not show it.`)}async function V$(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await K$(e);let n=await e.html();await e.setOffline(!0);let i=await z$(e,n,3e3);return i?(await e.setOffline(!1),await z$(e,i,3e3)?{id:r,what:o,status:"verified",detail:"Taken offline the page said so, and it recovered when the network returned."}:{id:r,what:o,status:"open",detail:"The page noticed the connection going and not it coming back: it was still in its offline state three seconds after the network returned. Listen for `online` as well, take the message down, and re-read the round rather than trusting what is on the screen."}):{id:r,what:o,status:"open",detail:"The connection was taken away and the page did not change. A fan who loses their signal is shown a game that still looks playable, and every tap on it is a tap the Engine never sees. Listen for the window's `offline` event and say so on the screen."}}catch(n){return{id:r,what:o,status:"open",detail:n instanceof Error?n.message:"The page could not be taken offline and back."}}finally{await e.setOffline(!1).catch(()=>{})}}async function z$(e,t,r){let o=Date.now()+r;for(;Date.now()<o;){let n=await e.html().catch(()=>t);if(n!==t)return n;await new Promise(i=>setTimeout(i,100))}}function J1(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>q1.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function F$(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function Y$(e,t){let{files:r,skippedLinks:o}=Ti(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let l=J1(s.relativePath);if(l){i.has(l)||(i.add(l),n.push({path:`${l}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(rg(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let d=await $i(s.path);if(d===void 0)continue;a+=1;let p=De(d);if(p.ok&&p.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let h=oo(d,t);if(h.length){n.push({path:s.relativePath,why:io(t,h),fatal:!0});continue}let f;try{let y=JSON.parse(d);y&&Array.isArray(y.sourcesContent)&&(f=y)}catch{}if(f){let y=f.sourcesContent.filter(D=>typeof D=="string").join(`
10443
+ `),k=y?oo(y,t):[];if(k.length){n.push({path:s.relativePath,why:`${io(t,k)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}F$(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)F$(s.relativePath)&&!n.some(l=>l.path===s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1});return{files:r,read:a,findings:n}}async function wy(e){await ki();let t=e.manifest??"gamestage.yaml",r,o="";try{o=await gy(t,"utf8");let q=De(o);if(!q.ok)return V(`${t} is not a valid App Manifest.`,q.issues.map(Se=>`${P.cyan(Se.path)} ${Se.message}`));r=q.manifest}catch{return V(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let n=r.backend.round??W1(r.backend.archetype),i=r.backend.round?{source:"manifest",archetype:n.archetype,detail:"The Engine used this game's own backend.round from the manifest."}:{source:"stand-in",archetype:n.archetype,detail:`The manifest carries no round, so the Engine used a representative ${n.archetype} stand-in supplied by Gamestage. It did not test the game's production content from Studio.`};if(!ar.includes(n.archetype))return V(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${ar.join(", ")}.`]);let a=yy(e.file??"index.html"),s;try{s=await gy(a,"utf8")}catch{return V(`Cannot read ${e.file??"index.html"}.`)}let l=[];l.push({id:"round-is-the-games-own",what:"the round played here was this game's own",status:i.source==="manifest"?"verified":"skipped",detail:i.source==="manifest"?void 0:"This game keeps its content in Studio, which is where it belongs, so there is no round here to play and this check cannot run. That is a limit of checking locally rather than anything wrong with the game. Play the deployed game to prove its round."});let d=n.archetype==="shoot"?"shotsAllowed":"attemptsAllowed",p=n.archetype==="shoot"?5:10,h=n.archetype==="hunt"||n.archetype==="group"||n.archetype==="shoot",f=new RegExp(`^\\s*${d}\\s*:`,"m").test(o);l.push({id:"attempts-cap-chosen",what:"the attempt cap was chosen rather than defaulted",status:r.backend.round?h?f?"verified":"open":"n/a":"skipped",detail:r.backend.round?h?f?void 0:`backend.round.${d} is not set, so the Engine applied its default of ${p}. Nobody chose that number, and it is the game a fan plays. Set it, even to ${p}, so it is a decision rather than an accident.`:`A ${n.archetype} round is not capped by ${d}.`:"No round in the manifest; the content is in Studio, where the cap is a producer's field."});let y=yy(e.dir??N$(a)),k;try{k=await Y$(y,n)}catch(q){return V(`Cannot read the publish set at ${e.dir??N$(a)}.`,[q instanceof Error?q.message:"The directory could not be walked."])}let D=k.findings.filter(q=>q.fatal),b=oo(s,n),$=b.length>0||D.length>0;l.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${k.files.length} file${k.files.length===1?"":"s"}, ${k.read} read)`,status:$?"open":"verified",detail:$?[b.length?io(n,b):void 0,...D.map(q=>`${q.path}: ${q.why}`)].filter(Boolean).join(" "):void 0});let S=await vc(k.files),w=S.map(q=>q.text).join(`
10444
+ `),C=dc(w),N=K1(r,n.archetype,C).filter(([,q])=>!Df(w,q)).map(([q])=>q);l.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(C.length?`, and it offers ${C.length} more for controls it has (${C.join(", ")})`:""),status:N.length?"open":"verified",detail:N.length?`The page does not read: ${N.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let ee=nl(S),me=k.files.some(q=>{let Se=q.relativePath.split("/").pop();return Se===Oe||Se===Fe})||s.includes(Oe)||s.includes(Fe),Ce=s.includes("createPlayerClient")||/\bstart\s*\(/.test(s);l.push({id:"client-present",what:"the client the page imports is there",status:me||!Ce?"verified":"open",detail:Ce&&!me?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let he=["@monterosa/sdk-core","@monterosa/sdk-connect-kit","@monterosa/sdk-consent-kit","@monterosa/sdk-storage-kit","@monterosa/sdk-analytics-kit","@monterosa/sdk-interact-kit","@monterosa/sdk-identify-kit","@monterosa/sdk-util"].filter(q=>w.includes(q));l.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:he.length===0?"verified":"open",detail:he.length===0?void 0:`This game imports ${he.join(", ")} directly. The Gamestage client is the only supported way to reach Interaction Cloud: it holds the connection, the consent gate and the server clock, and a second one beside it has none of them. Use what \`start()\` returns instead, and say what is missing from it if something is.`});let Ne=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test(w),yt=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test(w);l.push({id:"server-time",what:"a deadline comes from the server's clock",status:Ne&&yt?"skipped":"verified",detail:Ne&&yt?"This game reads the device clock somewhere and handles a round's timing somewhere, and this check reads the bundle as one string, so it cannot tell whether those are the same code. Worth your eyes: a lock or a countdown decided by the device clock is a deadline a fan can move by changing their clock. Use `game.now()`, which is the server's time through the client. `Date.now()` is fine for anything that decides nothing, like an animation or an analytics timestamp.":void 0});let se=await el({game:r.app.id,round:n,title:r.app.title});await new Promise(q=>se.listen(0,"127.0.0.1",()=>q()));let $e=se.address(),X=$e&&typeof $e!="string"?`http://127.0.0.1:${$e.port}`:"",dt=await import("node:http").then(({createServer:q})=>q(async(Se,ut)=>{let Be=(Se.url??"/").split("?")[0],St=Be==="/"?a:yy(a,"..",Be.slice(1));try{let Mn=await gy(St);ut.writeHead(200,{"content-type":St.endsWith(".js")?"text/javascript":"text/html"}),ut.end(Mn)}catch{ut.writeHead(404).end()}}));await new Promise(q=>dt.listen(0,"127.0.0.1",()=>q()));let Ge=dt.address(),jn=Ge&&typeof Ge!="string"?`http://127.0.0.1:${Ge.port}/`:"";try{l.push(...e.noBrowser?vy("Asked not to open a browser."):await B$(jn,X,r.app.id,n.archetype))}finally{se.close(),dt.close()}let _e=G$(l),Je=k.findings.filter(q=>!q.fatal);if(J()){Q({ok:_e.outcome==="verified",outcome:_e.outcome,exitCode:_e.exitCode,checks:l,open:_e.open,skipped:_e.skipped,round:i,copy_candidates:ee,publish_set:{directory:y,files:k.files.map(q=>q.relativePath),read:k.read,warnings:Je}}),_e.exitCode!==0&&await Kf(_e.exitCode);return}K(_e.outcome==="verified"?"Verified":_e.outcome==="failed"?"Verification failed":"Verification incomplete"),M("round used for verification",i.source),g(` ${P.dim(i.detail)}`);for(let q of l){let Se=q.status==="verified"?P.green("ok"):q.status==="open"?P.yellow("open"):q.status==="n/a"?P.dim("n/a"):P.dim("skipped");M(q.what,Se),q.detail&&g(` ${P.dim(q.detail)}`)}if(Je.length){g(),g(P.dim(" Also in the publish set, and a deploy would upload it:"));for(let q of Je)g(` ${P.dim("\xB7")} ${P.cyan(q.path)} ${P.dim(q.why)}`)}if(ee.length){g(),g(P.dim(" Copy a producer may need to own:"));for(let q of ee)g(` ${P.dim("\xB7")} ${P.cyan(`${q.file}:${q.line}`)} ${q.text} ${P.dim(`(${q.confidence}, ${q.level})`)}`)}g(),_e.outcome==="verified"?A("The Engine decided the outcome and the page showed it. That is the migration done."):_e.outcome==="failed"?A("A check remains open, so the game failed verification. Read the open check and fix its cause."):A("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),g(),_e.exitCode!==0&&await Kf(_e.exitCode)}var Wi,R$,L$,H1,by,W$,D$,j$,M$,Y1,q1,_y=v(()=>{"use strict";ke();sy();At();tn();C$();ig();fy();wc();yc();Re();Wi="button.pick, [data-pick]",R$="#submit, button[type=submit], .submit",L$="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",H1=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];by=15e3,W$=250;D$="[data-aim]",j$="[data-power]",M$="#shoot:not([disabled]), [data-gamestage-shoot]:not([disabled])",Y1=4e3;q1=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var un=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Un=class extends un{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var So=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Un(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function na(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as EA}from"node:events";import bl from"node:child_process";import Vt from"node:path";import oa from"node:fs";import fe from"node:process";import{stripVTControlCharacters as $A}from"node:util";import{stripVTControlCharacters as kA}from"node:util";var Eo=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>na(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(h,f){return r.formatItem(h,o,f,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let l=r.visibleArguments(t).map(h=>i(r.styleArgumentTerm(r.argumentTerm(h)),r.styleArgumentDescription(r.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",l,r)),this.groupItems(t.options,r.visibleOptions(t),h=>h.helpGroupHeading??"Options:").forEach((h,f)=>{let y=h.map(k=>i(r.styleOptionTerm(r.optionTerm(k)),r.styleOptionDescription(r.optionDescription(k))));a=a.concat(this.formatItemList(f,y,r))}),r.showGlobalOptions){let h=r.visibleGlobalOptions(t).map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));a=a.concat(this.formatItemList("Global Options:",h,r))}return this.groupItems(t.commands,r.visibleCommands(t),h=>h.helpGroup()||"Commands:").forEach((h,f)=>{let y=h.map(k=>i(r.styleSubcommandTerm(r.subcommandTerm(k)),r.styleSubcommandDescription(r.subcommandDescription(k))));a=a.concat(this.formatItemList(f,y,r))}),a.join(`
10445
+ `)}displayWidth(t){return kA(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,n){let a=" ".repeat(2);if(!o)return a+t;let s=t.padEnd(r+t.length-n.displayWidth(t)),l=2,p=(this.helpWidth??80)-r-l-2,h;return p<this.minWidthToWrap||n.preformatted(o)?h=o:h=n.boxWrap(o,p).replace(/\n/g,`
10446
10446
  `+" ".repeat(r+l)),a+s+" ".repeat(l)+h.replace(/\n/g,`
10447
10447
  ${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,i=[];return o.forEach(a=>{let s=a.match(n);if(s===null){i.push("");return}let l=[s.shift()],d=this.displayWidth(l[0]);s.forEach(p=>{let h=this.displayWidth(p);if(d+h<=r){l.push(p),d+=h;return}i.push(l.join(""));let f=p.trimStart();l=[f],d=this.displayWidth(f)}),i.push(l.join(""))}),i.join(`
10448
- `)}};var pn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=vA(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Un(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ny(this.name().replace(/^no-/,"")):Ny(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ra=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===t)}};function Ny(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function vA(e){let t,r,o=/^-[^-]$/,n=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(o.test(i[0])&&(t=i.shift()),n.test(i[0])&&(r=i.shift()),!t&&o.test(i[0])&&(t=i.shift()),!t&&n.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let a=i[0],s=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
10448
+ `)}};var pn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=xA(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Un(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ny(this.name().replace(/^no-/,"")):Ny(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ra=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===t)}};function Ny(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function xA(e){let t,r,o=/^-[^-]$/,n=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(o.test(i[0])&&(t=i.shift()),n.test(i[0])&&(r=i.shift()),!t&&o.test(i[0])&&(t=i.shift()),!t&&n.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let a=i[0],s=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
10449
10449
  - a short flag is a single dash and a single character
10450
10450
  - either use a single dash and a single character (for a short flag)
10451
10451
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(a)?new Error(`${s}
10452
10452
  - too many short flags`):n.test(a)?new Error(`${s}
10453
10453
  - too many long flags`):new Error(`${s}
10454
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function bA(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let n=1;n<=e.length;n++){let i;e[n-1]===t[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}function vl(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let o=[],n=3,i=.4;return t.forEach(a=>{if(a.length<=1)return;let s=bA(e,a),l=Math.max(e.length,a.length);(l-s)/l>i&&(s<n?(n=s,o=[a]):s===n&&o.push(a))}),o.sort((a,s)=>a.localeCompare(s)),r&&(o=o.map(a=>`--${a}`)),o.length>1?`
10454
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function SA(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let n=1;n<=e.length;n++){let i;e[n-1]===t[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}function vl(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let o=[],n=3,i=.4;return t.forEach(a=>{if(a.length<=1)return;let s=SA(e,a),l=Math.max(e.length,a.length);(l-s)/l>i&&(s<n?(n=s,o=[a]):s===n&&o.push(a))}),o.sort((a,s)=>a.localeCompare(s)),r&&(o=o.map(a=>`--${a}`)),o.length>1?`
10455
10455
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
10456
- (Did you mean ${o[0]}?)`:""}var dr=class e extends wA{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>fe.stdout.write(r),writeErr:r=>fe.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>fe.stdout.isTTY?fe.stdout.columns:void 0,getErrHelpWidth:()=>fe.stderr.isTTY?fe.stderr.columns:void 0,getOutHasColors:()=>Ly()??(fe.stdout.isTTY&&fe.stdout.hasColors?.()),getErrHasColors:()=>Ly()??(fe.stderr.isTTY&&fe.stderr.hasColors?.()),stripColor:r=>_A(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,a,s]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(a);return n&&(l.description(n),l._executableHandler=!0),i.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(i.noHelp||i.hidden),l._executableFile=i.executableFile||null,s&&l.arguments(s),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),n?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Eo,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
10456
+ (Did you mean ${o[0]}?)`:""}var ur=class e extends EA{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>fe.stdout.write(r),writeErr:r=>fe.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>fe.stdout.isTTY?fe.stdout.columns:void 0,getErrHelpWidth:()=>fe.stderr.isTTY?fe.stderr.columns:void 0,getOutHasColors:()=>Ly()??(fe.stdout.isTTY&&fe.stdout.hasColors?.()),getErrHasColors:()=>Ly()??(fe.stderr.isTTY&&fe.stderr.hasColors?.()),stripColor:r=>$A(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,a,s]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(a);return n&&(l.description(n),l._executableHandler=!0),i.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(i.noHelp||i.hidden),l._executableFile=i.executableFile||null,s&&l.arguments(s),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),n?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Eo,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
10457
10457
  - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new So(t,r)}argument(t,r,o,n){let i=this.createArgument(t,r);return typeof o=="function"?i.default(n).argParser(o):i.default(o),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let o=t??"help [command]",[,n,i]=o.match(/([^ ]+) *(.*)/),a=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),a&&s.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=s,(t||r)&&this._initCommandGroup(s),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
10458
10458
  Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new un(t,r,o)),fe.exit(t)}action(t){let r=o=>{let n=this.registeredArguments.length,i=o.slice(0,n);return this._storeOptionsAsProperties?i[n]=this:i[n]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new pn(t,r)}_callParseArg(t,r,o,n){try{return t.parseArg(r,o)}catch(i){if(i.code==="commander.invalidArgument"){let a=`${n} ${i.message}`;this.error(a,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
10459
10459
  - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),o=r(t).find(n=>this._findCommand(n));if(o){let n=r(this._findCommand(o)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let n=(i,a,s)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let l=this.getOptionValue(o);i!==null&&t.parseArg?i=this._callParseArg(t,i,l,a):i!==null&&t.variadic&&(i=t._collectValue(i,l)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(o,i,s)};return this.on("option:"+r,i=>{let a=`error: option '${t.flags}' argument '${i}' is invalid.`;n(i,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let a=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;n(i,a,"env")}),this}_optionEx(t,r,o,n,i){if(typeof r=="object"&&r instanceof pn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,o);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(i).argParser(n);else if(n instanceof RegExp){let s=n;n=(l,d)=>{let p=s.exec(l);return p?p[0]:d},a.default(i).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,o,n){return this._optionEx({},t,r,o,n)}requiredOption(t,r,o,n){return this._optionEx({mandatory:!0},t,r,o,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){fe.versions?.electron&&(r.from="electron");let n=fe.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=fe.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":fe.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let r=t.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
@@ -10466,12 +10466,12 @@ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._life
10466
10466
  `),this.outputHelp({error:!0}));let o=r||{},n=o.exitCode||1,i=o.code||"commander.error";this._exit(n,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in fe.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,fe.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new ra(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,o.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=a=>{let s=a.attributeName(),l=this.getOptionValue(s),d=this.options.find(h=>h.negate&&s===h.attributeName()),p=this.options.find(h=>!h.negate&&s===h.attributeName());return d&&(d.presetArg===void 0&&l===!1||d.presetArg!==void 0&&l===d.presetArg)?d:p||a},n=a=>{let s=o(a),l=s.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},i=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],i=this;do{let a=i.createHelp().visibleOptions(i).filter(s=>s.long).map(s=>s.long);n=n.concat(a),i=i.parent}while(i&&!i._enablePositionalOptions);r=vl(t,n)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",n=t.length,i=this.parent?` for '${this.name()}'`:"",a=t.join(", "),s=`error: too many arguments${i}. Expected ${r} argument${o} but got ${n}: ${a}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(i=>{n.push(i.name()),i.alias()&&n.push(i.alias())}),r=vl(t,n)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let n=this.createOption(r,o);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
10467
10467
  `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let n=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>na(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=Vt.basename(t,Vt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let n=r.formatHelp(this,r);return o.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,o,n,i;return r?(o=s=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(o=s=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(n||(s=this._outputConfiguration.stripColor(s)),o(s)),hasColors:n,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),n={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation({error:o.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(fe.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
10468
10468
  Expecting one of '${o.join("', '")}'`);let n=`${t}Help`;return this.on(n,i=>{let a;typeof r=="function"?a=r({error:i.error,command:i.command}):a=r,a&&i.write(`${a}
10469
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ry(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",n="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:t})}function Ly(){if(fe.env.NO_COLOR||fe.env.FORCE_COLOR==="0"||fe.env.FORCE_COLOR==="false")return!1;if(fe.env.FORCE_COLOR||fe.env.CLICOLOR_FORCE!==void 0)return!0}var Ej=new dr;ke();tn();Re();import{mkdir as _O,readFile as kO,writeFile as xO}from"node:fs/promises";import{dirname as SO,join as EO,relative as $O,resolve as TO}from"node:path";async function AO(e,t){let r;try{r=await kO(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function iS(e,t,r){let o=EO(e,t),n=await AO(o,r);try{await _O(SO(o),{recursive:!0}),await xO(o,r,"utf8")}catch{throw V(`Cannot write ${o}.`),new Error("unreachable")}return{where:$O(process.cwd(),o)||t,state:n}}async function aS(e){let t=TO(e.out??"."),r=await iS(t,Oe,Tt),o=await iS(t,Fe,Yr),n=`import { start } from "./${Oe}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${Fe}";`,a=r.state==="same"&&o.state==="same";if(J())return Q({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:Bt,import:n},{path:o.where,digest:nr,import:i}],path:r.where,digest:Bt,import:n});K(a?"Already current":"Wrote the Gamestage client"),M("Library",`${r.where} (${Bt})`),M("Player client",`${o.where} (${nr})`),g(),A(`Import it: ${P.cyan(n)}`),A(`The player API on its own: ${P.cyan(i)}`),(r.state==="different"||o.state==="different")&&A("An earlier copy was replaced. It is generated, so nothing of yours was in it."),g()}ke();tn();rr();import{stat as BO,writeFile as IS}from"node:fs/promises";import{createHash as WO}from"node:crypto";var bt="0.35.5",_i="2026-09-15",mc=">=22.13.0";function RO(e=mc){let[t,r]=e.replace(/^[^\d]*/,"").split(".").map(Number);return[t,r||0]}function bS(e,t=mc){let[r,o]=RO(t),[n,i]=e.split(".").map(Number);return n>r||n===r&&i>=o}import{randomUUID as LO}from"node:crypto";var DO=/-[0-9a-f]{4}$/;function fc(e){return`${e}-${LO().replace(/-/g,"").slice(0,4)}`}function wS(e){return DO.test(e)}At();var rn="favicon.svg",Si=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
10469
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ry(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",n="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:t})}function Ly(){if(fe.env.NO_COLOR||fe.env.FORCE_COLOR==="0"||fe.env.FORCE_COLOR==="false")return!1;if(fe.env.FORCE_COLOR||fe.env.CLICOLOR_FORCE!==void 0)return!0}var Tj=new ur;ke();tn();Re();import{mkdir as $O,readFile as TO,writeFile as AO}from"node:fs/promises";import{dirname as IO,join as CO,relative as PO,resolve as OO}from"node:path";async function NO(e,t){let r;try{r=await TO(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function iS(e,t,r){let o=CO(e,t),n=await NO(o,r);try{await $O(IO(o),{recursive:!0}),await AO(o,r,"utf8")}catch{throw V(`Cannot write ${o}.`),new Error("unreachable")}return{where:PO(process.cwd(),o)||t,state:n}}async function aS(e){let t=OO(e.out??"."),r=await iS(t,Oe,Tt),o=await iS(t,Fe,qr),n=`import { start } from "./${Oe}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${Fe}";`,a=r.state==="same"&&o.state==="same";if(J())return Q({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:Bt,import:n},{path:o.where,digest:nr,import:i}],path:r.where,digest:Bt,import:n});K(a?"Already current":"Wrote the Gamestage client"),M("Library",`${r.where} (${Bt})`),M("Player client",`${o.where} (${nr})`),g(),A(`Import it: ${P.cyan(n)}`),A(`The player API on its own: ${P.cyan(i)}`),(r.state==="different"||o.state==="different")&&A("An earlier copy was replaced. It is generated, so nothing of yours was in it."),g()}ke();tn();rr();import{stat as VO,writeFile as IS}from"node:fs/promises";import{createHash as YO}from"node:crypto";var bt="0.35.6",_i="2026-09-15",mc=">=22.13.0";function UO(e=mc){let[t,r]=e.replace(/^[^\d]*/,"").split(".").map(Number);return[t,r||0]}function bS(e,t=mc){let[r,o]=UO(t),[n,i]=e.split(".").map(Number);return n>r||n===r&&i>=o}import{randomUUID as zO}from"node:crypto";var FO=/-[0-9a-f]{4}$/;function fc(e){return`${e}-${zO().replace(/-/g,"").slice(0,4)}`}function wS(e){return FO.test(e)}At();var rn="favicon.svg",Si=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
10470
10470
  <rect width="32" height="32" rx="7" fill="#1b1c1f"/>
10471
10471
  <path d="m12 8 12 8-12 8Z" fill="#fff"/>
10472
10472
  </svg>
10473
10473
  `;function tg(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function Ei(e){if(tg(e))return e;let t=`<link rel="icon" href="./${rn}" type="image/svg+xml">
10474
- `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function zO(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function TS(e,t){let r=t.trim();if(!r)return e;let o=zO(r);return e.replace(/(<title[^>]*>)[\s\S]*?(<\/title>)/i,`$1${o}$2`).replace(/(<h1\b[^>]*\bid=["']game-name["'][^>]*>)[\s\S]*?(<\/h1>)/i,`$1${o}$2`)}var FO="http://127.0.0.1:4000";function GO(e){return`<script>
10474
+ `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function KO(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function TS(e,t){let r=t.trim();if(!r)return e;let o=KO(r);return e.replace(/(<title[^>]*>)[\s\S]*?(<\/title>)/i,`$1${o}$2`).replace(/(<h1\b[^>]*\bid=["']game-name["'][^>]*>)[\s\S]*?(<\/h1>)/i,`$1${o}$2`)}var HO="http://127.0.0.1:4000";function ZO(e){return`<script>
10475
10475
  // Local development only. \`gamestage deploy\` writes the real values into
10476
10476
  // this page when you deploy, and this block then does nothing: it assigns
10477
10477
  // only where nothing has assigned already, and only on a local address.
@@ -10484,35 +10484,35 @@ Expecting one of '${o.join("', '")}'`);let n=`${t}Help`;return this.on(n,i=>{let
10484
10484
  location.hostname === "127.0.0.1" ||
10485
10485
  location.hostname === "[::1]";
10486
10486
  if (!local) return;
10487
- if (!window.GAMESTAGE_API) window.GAMESTAGE_API = ${JSON.stringify(FO)};
10487
+ if (!window.GAMESTAGE_API) window.GAMESTAGE_API = ${JSON.stringify(HO)};
10488
10488
  if (!window.GAMESTAGE_GAME) window.GAMESTAGE_GAME = ${JSON.stringify(e)};
10489
10489
  })();
10490
10490
  </script>
10491
- `}function AS(e,t){let r=t.trim();return!r||!/<\/head>/i.test(e)||/window\.GAMESTAGE_API\s*=/.test(e)?e:e.replace(/<\/head>/i,`${GO(r)}</head>`)}Re();async function CS(e){try{return await BO(e),!0}catch{return!1}}var or={hunt:"Find the marked few among many. A wrong pick costs an attempt.",push:"Picks add hidden value towards a limit. Going over is a bust.",group:"Form the hidden sets in a board. The whole guess is judged at once.",predict:"Call it before it happens. It settles when the result arrives.",bingo:"Each fan gets their own board from a shared pool. Fill a line before it locks.",shoot:"Aim, pick a power, shoot. The Engine plays the keeper and decides each penalty.",place:"A card is dealt; drop it on a category it fits. The Engine holds who qualifies.",trivia:"Question, answer, mark against a server answer set, score, close.",timed_round:"Open and close rounds on a schedule, using server time.",synchronous_event:"React to a real-world trigger: kick-off, goal, period change.",collection_ranking:"Accumulate verified actions and expose rank, progress and eligibility."},PS=Object.keys(wi).map(e=>({format:e,summary:or[e]}));async function KO(e,t,r){let o=await je();if(!o)return!1;to();let i=await Vr({baseUrl:Ye,token:o.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${WO("sha256").update(t).digest("hex")}`,conformance:ct(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Hr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function OS(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return V("Give the game a name with --name.");let r=e.format??e.archetype;if(!r){J()&&(Q({ok:!1,status:"archetype_required",message:"Choose a format before scaffolding. How the game is played is decided first, on purpose.",archetypes:Object.entries(or).map(([$,S])=>({archetype:$,summary:S})),formats:Object.entries(or).map(([$,S])=>({format:$,summary:S})),example:`gamestage create --name "${e.name??t}" --format hunt`}),process.exit(1)),K("Choose how the game is played first"),g(P.dim(` The format decides what the server owns: answers, locks, scoring
10491
+ `}function AS(e,t){let r=t.trim();return!r||!/<\/head>/i.test(e)||/window\.GAMESTAGE_API\s*=/.test(e)?e:e.replace(/<\/head>/i,`${ZO(r)}</head>`)}Re();async function CS(e){try{return await VO(e),!0}catch{return!1}}var or={hunt:"Find the marked few among many. A wrong pick costs an attempt.",push:"Picks add hidden value towards a limit. Going over is a bust.",group:"Form the hidden sets in a board. The whole guess is judged at once.",predict:"Call it before it happens. It settles when the result arrives.",bingo:"Each fan gets their own board from a shared pool. Fill a line before it locks.",shoot:"Aim, pick a power, shoot. The Engine plays the keeper and decides each penalty.",place:"A card is dealt; drop it on a category it fits. The Engine holds who qualifies.",trivia:"Question, answer, mark against a server answer set, score, close.",timed_round:"Open and close rounds on a schedule, using server time.",synchronous_event:"React to a real-world trigger: kick-off, goal, period change.",collection_ranking:"Accumulate verified actions and expose rank, progress and eligibility."},PS=Object.keys(wi).map(e=>({format:e,summary:or[e]}));async function qO(e,t,r){let o=await je();if(!o)return!1;no();let i=await Yr({baseUrl:Ye,token:o.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${YO("sha256").update(t).digest("hex")}`,conformance:ct(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Zr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function OS(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return V("Give the game a name with --name.");let r=e.format??e.archetype;if(!r){J()&&(Q({ok:!1,status:"archetype_required",message:"Choose a format before scaffolding. How the game is played is decided first, on purpose.",archetypes:Object.entries(or).map(([$,S])=>({archetype:$,summary:S})),formats:Object.entries(or).map(([$,S])=>({format:$,summary:S})),example:`gamestage create --name "${e.name??t}" --format hunt`}),process.exit(1)),K("Choose how the game is played first"),g(P.dim(` The format decides what the server owns: answers, locks, scoring
10492
10492
  and settlement. Picking it before any client code is what keeps the
10493
- game trustworthy later.`)),g();for(let[$,S]of Object.entries(or))g(` ${P.cyan($.padEnd(20))} ${P.dim(S)}`);g(),g(` ${P.dim("Then run:")} ${P.cyan(re(`create --name "${e.name??t}" --format <format>`))}`),g(),process.exit(1)}let o=$n.safeParse(r);if(!o.success)return V(`Unknown format "${r}".`,[...Object.keys(or).map($=>P.cyan($)),"",`You are running gamestage ${bt}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${P.cyan("npx gamestage@latest create ...")} run the current one`]);let n=wi[o.data];if(!n&&!J())return V(`"${o.data}" is coming soon. Nothing was registered or written.`,["There is no Engine behind it yet, so create would give you a manifest and no","game a fan could play.","","Build with one of these today:",...Object.keys(wi).map($=>` ${P.cyan($.padEnd(10))} ${P.dim(or[$])}`),"",`${P.dim("Then run:")} ${P.cyan(re(`create --name "${e.name??t}" --format hunt`))}`]);let i=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(i&&!e.force&&await CS(i))return V(`${i} already exists, and create would replace it.`,["That file holds a game: its id, its format and whatever has been done to it.","A new one minted here would be a second game in the same directory.","",`${P.cyan(re(`manifest validate ${i}`))} check what you have`,`${P.cyan(re("start"))} find the next step for this directory`,"",P.dim("There is a --force, and it replaces your page and clients as well as the"),P.dim("manifest. Move the directory aside instead if you want a fresh start.")]);let a=fc(t),s=Js(a,e.name??a);s.app.status="confirmed",s.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],s.experience.status="proposed",s.experience.surfaces=["web-embed"],s.backend.status="confirmed",s.backend.route="managed_runtime",s.backend.archetype=o.data,s.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${o.data}`}],s.identity.status="proposed",s.identity.provider="identify";let l=zx((await je().catch(()=>null))?.email,Gx);l&&Fx(s,l);let d=Tn.parse(s),p=ct(d);d.manifest.conformance=p.computed;let h=bi(d),f=!1,y;try{f=await KO(d,h,o.data)}catch($){y=$ instanceof Error?$.message:"The control plane did not answer."}let k=null;i&&(k=i,await IS(k,h,"utf8"));let D=!!n&&e.write!==!1,b=[];if(D){let $=[["index.html",AS(TS(Ei(n),d.app.title),d.app.id)],[rn,Si],[Oe,Tt],[Fe,Yr]];for(let[S,w]of $){if(!e.force&&await CS(S)){b.push(S);continue}await IS(S,w,"utf8")}}if(J()){Q({ok:!0,manifest:d,manifest_yaml:h,written_to:k,conformance:{computed:p.computed,blockers:p.blockers},registered:f,...y?{registration_failed:y}:{},scaffolded:D,files:D?["index.html",rn,Oe,Fe].filter($=>!b.includes($)):[],kept:b,...n?{}:{scaffold_skipped:"no_engine",engines:Object.keys(wi)},next:"gamestage dev"});return}K(`Created ${d.app.title}`),M("Game id",d.app.id),M("Game format",o.data),D&&b.length===0?M("Files","index.html, with the Gamestage client beside it"):D&&M("Kept",`${b.join(", ")} (already here, left as they were)`),M("Authority","managed runtime (server-owned)"),M("Build stage",`${p.computed} ${p.computedName}`),k&&M("Manifest",k),g(f?" Registered in Studio as a draft.":y?` Not registered in Studio: ${y} (${Ye})`:" No account found, so registration was skipped."),K("What the server will own"),g(` ${P.dim(or[o.data])}`),K("Next"),b.includes("index.html")&&A(`${P.cyan(re("inspect ."))} find what in your page has to move to the Engine`),A(`${P.cyan(re("dev --serve"))} start the Engine and serve this page, so there is something to open`),A(`${P.cyan(re("dev"))} the Engine alone, where you serve the page yourself`),A(`${P.cyan(re("manifest validate "+(k??"gamestage.yaml")))} check where it stands`),g()}ke();tn();At();ig();wc();yc();import{readFileSync as xy}from"node:fs";import{readFile as Ki}from"node:fs/promises";import{createInterface as Z1}from"node:readline/promises";import{extname as V1,resolve as Y1}from"node:path";import{createHash as X$}from"node:crypto";Re();Jf();function Hi(e,t){return e.refused?J()?(Q({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(K("Not done"),g(` ${e.refused}`),g(),!0):!1}function Sy(e,t){if(e.state==="archived")return{stage:"dev",reason:"archived, so it serves nobody"};if(!t)return{stage:null,reason:"this control plane did not report your workspace's plan"};let r=_f(e,{tier:t});if(r==="prod")return{stage:r};let o=!!e.prodApproval,n=!wf(t);return!o&&!n?{stage:r,reason:"waiting on your approval, run `gamestage promote`, and on your workspace's plan, which only Monterosa can move"}:o?{stage:r,reason:"approved, but your workspace's plan does not carry prod yet, which only Monterosa can move"}:{stage:r,reason:"waiting on your approval, run `gamestage promote`"}}function Q$(e,t=e.playgroundUrl,r){if(M("Game",`${e.name} (${e.id})`),M("State",e.state),r!==void 0){let{stage:o,reason:n}=Sy(e,r);M("Serving",o==="prod"?"prod":`dev: ${n}`)}M("Build stage",e.conformance),M("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&M("Playground",t),e.playerEndpoint&&M("Player API",e.playerEndpoint),M("Manage",_S(e.id)),e.studioUrl&&M("Studio",e.studioUrl),M("Docs",kS(e.archetype))}async function eT(e){let{client:t,email:r}=await xe(),o=await gc(t),n=xi(o);if(n.ok||V(n.message,n.next),n.access==="pending"||n.access==="refused"){if(J())return Q({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});K("Your account"),M("Signed in as",r),M("Access",n.access),no(n);return}try{if(e){let d=await t.getGame(e);d||V(...lT(e));let p=await t.getWorkspaceSummary().then(y=>y.tier).catch(()=>{}),{stage:h,reason:f}=Sy(d,p);if(J())return Q({ok:!0,stage:h,...f?{stageReason:f}:{},game:d});if(K(d.name),Q$(d,void 0,p),p===void 0&&M("Serving",`unchecked: ${f}`),d.meters.length){g();for(let y of d.meters){let k=Math.round(px(y)*100);M(y.label,`${y.used} of ${y.limit}${y.unit} (${k}%)`)}}g();return}let i="workspace"in o&&o.workspace?o.workspace:await t.getWorkspace(),a=i.games.length,s=typeof i.gamesTotal=="number"?i.gamesTotal:void 0;if(J())return Q({ok:!0,status:n.status,access:n.access,games_total:s??null,games_shown:a,workspace:{...i,games:i.games.map(d=>{let{stage:p,reason:h}=Sy(d,i.tier);return{...d,stage:p,...h?{stageReason:h}:{}}})}});if(K(i.name),M("Signed in as",r),M("Access",n.access??"not reported by this control plane"),M("Tier",i.tier),M("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),g(),s===0){A("No games yet. `gamestage create` or `gamestage inspect .` starts one."),g();return}for(let d of i.games)M(d.name,`${d.state}${d.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(g(),A(`Showing ${a} of ${s} games.`));let l=ux(i.meters);if(l.length){g(),K("At a cap");for(let d of l)A(`${d.label}: ${d.used} of ${d.limit}${d.unit}`)}g()}catch(i){Ie(i)}}async function q1(e,t){let r;try{r=await Ki(e,"utf8")}catch{t&&V(`Cannot read ${e}.`);return}let o=De(r);if(!o.ok){V(`${e} is not a valid App Manifest, so its round cannot be provisioned.`,o.issues.map(n=>`${n.path} ${n.message}`));return}return o.manifest.backend.round}async function J1(e){try{let t=await vc(MS(e));return dc(t.map(r=>r.text).join(`
10494
- `))}catch{return}}async function X1(e){try{let t=await Ki(e,"utf8");return`c${X$("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function Q1(e){try{return await Ki(e,"utf8")}catch{return}}async function eL(e){try{let t=De(await Ki(e,"utf8"));return t.ok?ct(t.manifest).computed:"L0"}catch{return"L0"}}async function tT(e,t){t.file&&t.dir&&V("Choose either --file or --dir for a deploy, not both.");let{client:r}=await xe(),o=await q1(t.manifest??"gamestage.yaml",!!t.manifest);try{let n,i={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?n=await nL(r,e,t.file,i):t.dir&&(n=await aL(r,e,t.dir,i));let a=t.manifest??"gamestage.yaml",s=t.revision??await X1(a),l=await r.deploy(e,{manifestRevision:s,contentHash:t.hash??`sha256:${s}`,conformance:t.level??await eL(a),...await Q1(a).then(y=>y===void 0?{}:{manifestSource:y}),offersPrize:!!t.prize,round:o,...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.dir?{wording:await J1(t.dir)}:{}});if(Hi(l,"deploy"))return;let d=o?l.game.rounds.some(y=>y.id===`round-${o.number}`):null,p=d===!1?[...l.game.logs].reverse().find(y=>y.level==="error"):void 0;if(J())return Q({ok:!0,status:"deployed",roundProvisioned:d,...p?{roundError:p.message}:{},game:n?{...l.game,playgroundUrl:n}:l.game});let h=zn(l.game.containerLabel),f=zn(l.game.containerLabel,{lower:!0});if(K("Deployed"),Q$(l.game,n),d&&M(h,`${o.number} is live`),g(),l.game.appSpec?.refusal&&(K("But Studio would not take the game's settings"),g(` ${l.game.appSpec.refusal.reason}`),g(),A("The game is live and playing. What is stale is what a producer sees in Studio, so they may be editing boxes that no longer match the game."),A("Deploy again once it is fixed; nothing else needs doing."),g()),await rL(n??l.game.playgroundUrl,l.game.playerEndpoint,e,t.check===!1,l.game.archetype),d===!1){K(`But there is no ${f}`),g(` ${p?.message??`The Engine did not accept the ${f}.`}`),g(),A("Anyone opening the game will find nothing on. Deploy again once it is fixed."),g();return}if(d===null){let y=l.game.rounds?.length??0;A(y?`No ${f} in the manifest, which is right: the game is playing ${y} from Studio.`:`No ${f} in the manifest and none in Studio, so the game has nothing on yet.`)}A("Share the playground URL. It sleeps when idle and wakes on a request."),g()}catch(n){Ie(n)}}async function nT(e){let{client:t}=await xe();try{let r=await t.archiveGame(e);if(Hi(r,"archive"))return;if(J()){Q({ok:!0,status:"archived",game:r.game});return}K("Archived"),M("Game",`${r.game.name} (${r.game.id})`),g(),A("Taken off the air. Its record and files are retained outside the served bundle."),g()}catch(r){Ie(r)}}async function rT(e){let{client:t}=await xe();try{let r=await t.promoteGame(e);if(Hi(r,"promote"))return;let o=await t.getWorkspace(),n=_f(r.game,o);if(J()){Q({ok:!0,status:"promoted",stage:n,game:r.game});return}K("Approved"),M("Game",`${r.game.name} (${r.game.id})`),g(),n==="prod"?A("Live. Your workspace's plan already carries prod."):A("Approved, but still serving dev: reaching fans on prod also needs your workspace on a paid plan, which only Monterosa can do. Talk to us and this takes effect with no further action from you."),g()}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(J()){Q({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}K("Not yet"),g(" This control plane does not have promotion yet."),g(),A("Your game is untouched and still serving dev."),A("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),g();return}Ie(r)}}async function oT(e){let{client:t}=await xe();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){g("Nothing to remove. Every archived game here was deployed at some point.");return}if(!J()){K(`${o.length} archived games that never deployed`);let a=new Map;for(let s of o)a.set(s.name,(a.get(s.name)??0)+1);for(let[s,l]of[...a].sort((d,p)=>p[1]-d[1]))A(l>1?`${s} x${l}`:s);g(),A("A live game, or one that ever deployed, is refused by the server."),g()}if(!e.yes){process.stdin.isTTY||V("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=Z1({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){g("Nothing was deleted.");return}}finally{a.close()}}let n=0,i=[];for(let a of o){let s=await t.deleteGame(a.id);s.refused?i.push(`${a.name}: ${s.refused}`):n+=1}if(Q({removed:n,refused:i.length}),!J()){K("Removed"),A(`${n} records gone.`);for(let a of i)A(a);g()}}catch(r){Ie(r)}}async function iT(e){let{client:t}=await xe();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(J()){Q({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}K("Not done"),g(` ${o}`),g();return}if(J())return Q({ok:!0,workspace:r});K("Plan changed"),M("Plan",r.tier),M("Live games",String(r.liveGameAllowance||"Contracted")),g()}catch(r){Ie(r)}}async function Ey(e,t){let{admin:r,email:o}=await Qf();try{let n=await r.setWorkspaceAccess(e,t),i=xS(n);if(J())return Q({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});no(i),n.changed&&(M("Decided by",o),g())}catch(n){Ie(n)}}async function aT(e,t,r){let o=SS(e,t,r.liveGames);"problem"in o&&V(o.problem,o.detail);let{request:n}=o,{admin:i,email:a}=await Qf(),s=async()=>{try{let l=await i.getWorkspace(n.workspaceId);return{reading:{tier:l.tier,liveGameAllowance:l.liveGameAllowance}}}catch(l){let d=l.status,p=l instanceof Error?l.message:String(l);return d===404&&/unknown resource/i.test(p)?{reading:null,why:"this control plane has no operator read route, so it was deployed before GS-509 and needs a Space deploy"}:{reading:null,why:d?`${d}, ${p}`:p}}};try{let l=await s(),d=await i.setWorkspacePlan(n.workspaceId,n.tier,n.allowance),p=await s(),h=ES({request:n,previous:l.reading,result:{refused:d?.refused,code:d?.code},stored:p.reading,unreadable:p.why});if(h.exitCode!==0&&(process.exitCode=h.exitCode),J())return Q({ok:h.exitCode!==1,status:h.status,workspace_id:n.workspaceId,asked:{tier:n.tier,live_game_allowance:n.allowance??null},previous:h.previous,stored:h.stored,reprovisioned:!1,code:d?.code??null,message:h.message,next:h.next});$S(h),h.status==="set"&&(M("Decided by",a),g())}catch(l){Ie(l)}}async function sT(e){let t;try{t=await Ki(e,"utf8")}catch{return V(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=De(t);if(!r.ok)return V(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${P.cyan(a.path)} ${a.message}`),"",`${P.cyan(re(`manifest validate ${e}`))} the full report`]);let o=r.manifest,n=Bk(o);if(n.length)return V(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await xe();to();try{let a=await i.registerGame(Gk(o,`sha256:${X$("sha256").update(t).digest("hex")}`));if(Hi(a,"register"))return;if(J()){Q({ok:!0,status:"registered",game:a.game});return}K("Registered"),M("Game",`${a.game.name} (${a.game.id})`),M("State",a.game.state),M("Conformance",a.game.conformance),g(),A(`${P.cyan(re(`deploy ${a.game.id} --dir .`))} publish it`),g()}catch(a){Ie(a)}}async function $y(e,t){let{client:r}=await xe();try{let o=await r.setAwake(e,t);if(Hi(o,t?"wake":"suspend"))return;if(J()){Q({ok:!0,status:o.game.state,game:o.game});return}K(t?"Awake":"Suspended"),M("Game",`${o.game.name} (${o.game.id})`),M("State",o.game.state),g(),A(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),g()}catch(o){Ie(o)}}async function cT(e,t){let{client:r}=await xe();try{let o=await r.getEndpoints(e);if(o||V(...lT(e)),J())return Q({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||V(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),g(n);return}K("Endpoints"),M("Player",o.player??"not deployed"),M("Control",o.control??"not deployed"),M("Playground",o.playground??"not deployed"),g()}catch(o){Ie(o)}}function lT(e){let t=/[A-Z\s]/.test(e);return[`No game with the id "${e}" in this workspace.`,t?["That looks like a game's name. Every command takes the id, which is","the name in lower case plus four characters, e.g. my-game-a3c9.","`gamestage status` lists them, and `create` prints one when it makes it."]:["`gamestage status` lists the games in this workspace and their ids."]]}async function dT(e,t){let{client:r}=await xe();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await r.getGame(e).catch(()=>{}),i=n?tx(n):{state:"none"},a=nx(i);if(J())return Q({ok:!0,lines:o,freshness:i});if(a&&(K("This game is serving a closed round"),g(),A(a),g()),o.length===0){K("No log lines"),g(),A("Nothing yet, or everything is older than the tier's retention."),g();return}for(let s of o){let l=s.roundId?` [${s.roundId}]`:"";g(`${s.at} ${s.level.padEnd(5)}${l} ${s.message}`)}}catch(o){Ie(o)}}function ky(e=rS,t=bt){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&V("This is a development build of the CLI, so it cannot pin a client version.",["A deployed page imports the Gamestage client from a published version, and","this build is not one. Deploying anyway would point the game at",`${nn}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${P.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${P.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function J$(e,t,r=nn){let o=`${r}/client/${t}/${Oe}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function uT(e,t,r){let o=`<script>
10493
+ game trustworthy later.`)),g();for(let[$,S]of Object.entries(or))g(` ${P.cyan($.padEnd(20))} ${P.dim(S)}`);g(),g(` ${P.dim("Then run:")} ${P.cyan(re(`create --name "${e.name??t}" --format <format>`))}`),g(),process.exit(1)}let o=$n.safeParse(r);if(!o.success)return V(`Unknown format "${r}".`,[...Object.keys(or).map($=>P.cyan($)),"",`You are running gamestage ${bt}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${P.cyan("npx gamestage@latest create ...")} run the current one`]);let n=wi[o.data];if(!n&&!J())return V(`"${o.data}" is coming soon. Nothing was registered or written.`,["There is no Engine behind it yet, so create would give you a manifest and no","game a fan could play.","","Build with one of these today:",...Object.keys(wi).map($=>` ${P.cyan($.padEnd(10))} ${P.dim(or[$])}`),"",`${P.dim("Then run:")} ${P.cyan(re(`create --name "${e.name??t}" --format hunt`))}`]);let i=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(i&&!e.force&&await CS(i))return V(`${i} already exists, and create would replace it.`,["That file holds a game: its id, its format and whatever has been done to it.","A new one minted here would be a second game in the same directory.","",`${P.cyan(re(`manifest validate ${i}`))} check what you have`,`${P.cyan(re("start"))} find the next step for this directory`,"",P.dim("There is a --force, and it replaces your page and clients as well as the"),P.dim("manifest. Move the directory aside instead if you want a fresh start.")]);let a=fc(t),s=Js(a,e.name??a);s.app.status="confirmed",s.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],s.experience.status="proposed",s.experience.surfaces=["web-embed"],s.backend.status="confirmed",s.backend.route="managed_runtime",s.backend.archetype=o.data,s.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${o.data}`}],s.identity.status="proposed",s.identity.provider="identify";let l=zx((await je().catch(()=>null))?.email,Gx);l&&Fx(s,l);let d=Tn.parse(s),p=ct(d);d.manifest.conformance=p.computed;let h=bi(d),f=!1,y;try{f=await qO(d,h,o.data)}catch($){y=$ instanceof Error?$.message:"The control plane did not answer."}let k=null;i&&(k=i,await IS(k,h,"utf8"));let D=!!n&&e.write!==!1,b=[];if(D){let $=[["index.html",AS(TS(Ei(n),d.app.title),d.app.id)],[rn,Si],[Oe,Tt],[Fe,qr]];for(let[S,w]of $){if(!e.force&&await CS(S)){b.push(S);continue}await IS(S,w,"utf8")}}if(J()){Q({ok:!0,manifest:d,manifest_yaml:h,written_to:k,conformance:{computed:p.computed,blockers:p.blockers},registered:f,...y?{registration_failed:y}:{},scaffolded:D,files:D?["index.html",rn,Oe,Fe].filter($=>!b.includes($)):[],kept:b,...n?{}:{scaffold_skipped:"no_engine",engines:Object.keys(wi)},next:"gamestage dev"});return}K(`Created ${d.app.title}`),M("Game id",d.app.id),M("Game format",o.data),D&&b.length===0?M("Files","index.html, with the Gamestage client beside it"):D&&M("Kept",`${b.join(", ")} (already here, left as they were)`),M("Authority","managed runtime (server-owned)"),M("Build stage",`${p.computed} ${p.computedName}`),k&&M("Manifest",k),g(f?" Registered in Studio as a draft.":y?` Not registered in Studio: ${y} (${Ye})`:" No account found, so registration was skipped."),K("What the server will own"),g(` ${P.dim(or[o.data])}`),K("Next"),b.includes("index.html")&&A(`${P.cyan(re("inspect ."))} find what in your page has to move to the Engine`),A(`${P.cyan(re("dev --serve"))} start the Engine and serve this page, so there is something to open`),A(`${P.cyan(re("dev"))} the Engine alone, where you serve the page yourself`),A(`${P.cyan(re("manifest validate "+(k??"gamestage.yaml")))} check where it stands`),g()}ke();tn();At();ig();wc();yc();import{readFileSync as xy}from"node:fs";import{readFile as Ki}from"node:fs/promises";import{createInterface as X1}from"node:readline/promises";import{extname as Q1,resolve as eL}from"node:path";import{createHash as X$}from"node:crypto";Re();Jf();function Hi(e,t){return e.refused?J()?(Q({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(K("Not done"),g(` ${e.refused}`),g(),!0):!1}function Sy(e,t){if(e.state==="archived")return{stage:"dev",reason:"archived, so it serves nobody"};if(!t)return{stage:null,reason:"this control plane did not report your workspace's plan"};let r=_f(e,{tier:t});if(r==="prod")return{stage:r};let o=!!e.prodApproval,n=!wf(t);return!o&&!n?{stage:r,reason:"waiting on your approval, run `gamestage promote`, and on your workspace's plan, which only Monterosa can move"}:o?{stage:r,reason:"approved, but your workspace's plan does not carry prod yet, which only Monterosa can move"}:{stage:r,reason:"waiting on your approval, run `gamestage promote`"}}function Q$(e,t=e.playgroundUrl,r){if(M("Game",`${e.name} (${e.id})`),M("State",e.state),r!==void 0){let{stage:o,reason:n}=Sy(e,r);M("Serving",o==="prod"?"prod":`dev: ${n}`)}M("Build stage",e.conformance),M("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&M("Playground",t),e.playerEndpoint&&M("Player API",e.playerEndpoint),M("Manage",_S(e.id)),e.studioUrl&&M("Studio",e.studioUrl),M("Docs",kS(e.archetype))}async function eT(e){let{client:t,email:r}=await xe(),o=await gc(t),n=xi(o);if(n.ok||V(n.message,n.next),n.access==="pending"||n.access==="refused"){if(J())return Q({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});K("Your account"),M("Signed in as",r),M("Access",n.access),ro(n);return}try{if(e){let d=await t.getGame(e);d||V(...lT(e));let p=await t.getWorkspaceSummary().then(y=>y.tier).catch(()=>{}),{stage:h,reason:f}=Sy(d,p);if(J())return Q({ok:!0,stage:h,...f?{stageReason:f}:{},game:d});if(K(d.name),Q$(d,void 0,p),p===void 0&&M("Serving",`unchecked: ${f}`),d.meters.length){g();for(let y of d.meters){let k=Math.round(px(y)*100);M(y.label,`${y.used} of ${y.limit}${y.unit} (${k}%)`)}}g();return}let i="workspace"in o&&o.workspace?o.workspace:await t.getWorkspace(),a=i.games.length,s=typeof i.gamesTotal=="number"?i.gamesTotal:void 0;if(J())return Q({ok:!0,status:n.status,access:n.access,games_total:s??null,games_shown:a,workspace:{...i,games:i.games.map(d=>{let{stage:p,reason:h}=Sy(d,i.tier);return{...d,stage:p,...h?{stageReason:h}:{}}})}});if(K(i.name),M("Signed in as",r),M("Access",n.access??"not reported by this control plane"),M("Tier",i.tier),M("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),g(),s===0){A("No games yet. `gamestage create` or `gamestage inspect .` starts one."),g();return}for(let d of i.games)M(d.name,`${d.state}${d.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(g(),A(`Showing ${a} of ${s} games.`));let l=ux(i.meters);if(l.length){g(),K("At a cap");for(let d of l)A(`${d.label}: ${d.used} of ${d.limit}${d.unit}`)}g()}catch(i){Ie(i)}}async function tL(e,t){let r;try{r=await Ki(e,"utf8")}catch{t&&V(`Cannot read ${e}.`);return}let o=De(r);if(!o.ok){V(`${e} is not a valid App Manifest, so its round cannot be provisioned.`,o.issues.map(n=>`${n.path} ${n.message}`));return}return o.manifest.backend.round}async function nL(e){try{let t=await vc(MS(e));return dc(t.map(r=>r.text).join(`
10494
+ `))}catch{return}}async function rL(e){try{let t=await Ki(e,"utf8");return`c${X$("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function oL(e){try{return await Ki(e,"utf8")}catch{return}}async function iL(e){try{let t=De(await Ki(e,"utf8"));return t.ok?ct(t.manifest).computed:"L0"}catch{return"L0"}}async function tT(e,t){t.file&&t.dir&&V("Choose either --file or --dir for a deploy, not both.");let{client:r}=await xe(),o=await tL(t.manifest??"gamestage.yaml",!!t.manifest);try{let n,i={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?n=await sL(r,e,t.file,i):t.dir&&(n=await uL(r,e,t.dir,i));let a=t.manifest??"gamestage.yaml",s=t.revision??await rL(a),l=await r.deploy(e,{manifestRevision:s,contentHash:t.hash??`sha256:${s}`,conformance:t.level??await iL(a),...await oL(a).then(y=>y===void 0?{}:{manifestSource:y}),offersPrize:!!t.prize,round:o,...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.dir?{wording:await nL(t.dir)}:{}});if(Hi(l,"deploy"))return;let d=o?l.game.rounds.some(y=>y.id===`round-${o.number}`):null,p=d===!1?[...l.game.logs].reverse().find(y=>y.level==="error"):void 0;if(J())return Q({ok:!0,status:"deployed",roundProvisioned:d,...p?{roundError:p.message}:{},game:n?{...l.game,playgroundUrl:n}:l.game});let h=zn(l.game.containerLabel),f=zn(l.game.containerLabel,{lower:!0});if(K("Deployed"),Q$(l.game,n),d&&M(h,`${o.number} is live`),g(),l.game.appSpec?.refusal&&(K("But Studio would not take the game's settings"),g(` ${l.game.appSpec.refusal.reason}`),g(),A("The game is live and playing. What is stale is what a producer sees in Studio, so they may be editing boxes that no longer match the game."),A("Deploy again once it is fixed; nothing else needs doing."),g()),await cL(n??l.game.playgroundUrl,l.game.playerEndpoint,e,t.check===!1,l.game.archetype),d===!1){K(`But there is no ${f}`),g(` ${p?.message??`The Engine did not accept the ${f}.`}`),g(),A("Anyone opening the game will find nothing on. Deploy again once it is fixed."),g();return}if(d===null){let y=l.game.rounds?.length??0;A(y?`No ${f} in the manifest, which is right: the game is playing ${y} from Studio.`:`No ${f} in the manifest and none in Studio, so the game has nothing on yet.`)}A("Share the playground URL. It sleeps when idle and wakes on a request."),g()}catch(n){Ie(n)}}async function nT(e){let{client:t}=await xe();try{let r=await t.archiveGame(e);if(Hi(r,"archive"))return;if(J()){Q({ok:!0,status:"archived",game:r.game});return}K("Archived"),M("Game",`${r.game.name} (${r.game.id})`),g(),A("Taken off the air. Its record and files are retained outside the served bundle."),g()}catch(r){Ie(r)}}async function rT(e){let{client:t}=await xe();try{let r=await t.promoteGame(e);if(Hi(r,"promote"))return;let o=await t.getWorkspace(),n=_f(r.game,o);if(J()){Q({ok:!0,status:"promoted",stage:n,game:r.game});return}K("Approved"),M("Game",`${r.game.name} (${r.game.id})`),g(),n==="prod"?A("Live. Your workspace's plan already carries prod."):A("Approved, but still serving dev: reaching fans on prod also needs your workspace on a paid plan, which only Monterosa can do. Talk to us and this takes effect with no further action from you."),g()}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(J()){Q({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}K("Not yet"),g(" This control plane does not have promotion yet."),g(),A("Your game is untouched and still serving dev."),A("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),g();return}Ie(r)}}async function oT(e){let{client:t}=await xe();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){g("Nothing to remove. Every archived game here was deployed at some point.");return}if(!J()){K(`${o.length} archived games that never deployed`);let a=new Map;for(let s of o)a.set(s.name,(a.get(s.name)??0)+1);for(let[s,l]of[...a].sort((d,p)=>p[1]-d[1]))A(l>1?`${s} x${l}`:s);g(),A("A live game, or one that ever deployed, is refused by the server."),g()}if(!e.yes){process.stdin.isTTY||V("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=X1({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){g("Nothing was deleted.");return}}finally{a.close()}}let n=0,i=[];for(let a of o){let s=await t.deleteGame(a.id);s.refused?i.push(`${a.name}: ${s.refused}`):n+=1}if(Q({removed:n,refused:i.length}),!J()){K("Removed"),A(`${n} records gone.`);for(let a of i)A(a);g()}}catch(r){Ie(r)}}async function iT(e){let{client:t}=await xe();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(J()){Q({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}K("Not done"),g(` ${o}`),g();return}if(J())return Q({ok:!0,workspace:r});K("Plan changed"),M("Plan",r.tier),M("Live games",String(r.liveGameAllowance||"Contracted")),g()}catch(r){Ie(r)}}async function Ey(e,t){let{admin:r,email:o}=await Qf();try{let n=await r.setWorkspaceAccess(e,t),i=xS(n);if(J())return Q({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});ro(i),n.changed&&(M("Decided by",o),g())}catch(n){Ie(n)}}async function aT(e,t,r){let o=SS(e,t,r.liveGames);"problem"in o&&V(o.problem,o.detail);let{request:n}=o,{admin:i,email:a}=await Qf(),s=async()=>{try{let l=await i.getWorkspace(n.workspaceId);return{reading:{tier:l.tier,liveGameAllowance:l.liveGameAllowance}}}catch(l){let d=l.status,p=l instanceof Error?l.message:String(l);return d===404&&/unknown resource/i.test(p)?{reading:null,why:"this control plane has no operator read route, so it was deployed before GS-509 and needs a Space deploy"}:{reading:null,why:d?`${d}, ${p}`:p}}};try{let l=await s(),d=await i.setWorkspacePlan(n.workspaceId,n.tier,n.allowance),p=await s(),h=ES({request:n,previous:l.reading,result:{refused:d?.refused,code:d?.code},stored:p.reading,unreadable:p.why});if(h.exitCode!==0&&(process.exitCode=h.exitCode),J())return Q({ok:h.exitCode!==1,status:h.status,workspace_id:n.workspaceId,asked:{tier:n.tier,live_game_allowance:n.allowance??null},previous:h.previous,stored:h.stored,reprovisioned:!1,code:d?.code??null,message:h.message,next:h.next});$S(h),h.status==="set"&&(M("Decided by",a),g())}catch(l){Ie(l)}}async function sT(e){let t;try{t=await Ki(e,"utf8")}catch{return V(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=De(t);if(!r.ok)return V(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${P.cyan(a.path)} ${a.message}`),"",`${P.cyan(re(`manifest validate ${e}`))} the full report`]);let o=r.manifest,n=Bk(o);if(n.length)return V(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await xe();no();try{let a=await i.registerGame(Gk(o,`sha256:${X$("sha256").update(t).digest("hex")}`));if(Hi(a,"register"))return;if(J()){Q({ok:!0,status:"registered",game:a.game});return}K("Registered"),M("Game",`${a.game.name} (${a.game.id})`),M("State",a.game.state),M("Conformance",a.game.conformance),g(),A(`${P.cyan(re(`deploy ${a.game.id} --dir .`))} publish it`),g()}catch(a){Ie(a)}}async function $y(e,t){let{client:r}=await xe();try{let o=await r.setAwake(e,t);if(Hi(o,t?"wake":"suspend"))return;if(J()){Q({ok:!0,status:o.game.state,game:o.game});return}K(t?"Awake":"Suspended"),M("Game",`${o.game.name} (${o.game.id})`),M("State",o.game.state),g(),A(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),g()}catch(o){Ie(o)}}async function cT(e,t){let{client:r}=await xe();try{let o=await r.getEndpoints(e);if(o||V(...lT(e)),J())return Q({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||V(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),g(n);return}K("Endpoints"),M("Player",o.player??"not deployed"),M("Control",o.control??"not deployed"),M("Playground",o.playground??"not deployed"),g()}catch(o){Ie(o)}}function lT(e){let t=/[A-Z\s]/.test(e);return[`No game with the id "${e}" in this workspace.`,t?["That looks like a game's name. Every command takes the id, which is","the name in lower case plus four characters, e.g. my-game-a3c9.","`gamestage status` lists them, and `create` prints one when it makes it."]:["`gamestage status` lists the games in this workspace and their ids."]]}async function dT(e,t){let{client:r}=await xe();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await r.getGame(e).catch(()=>{}),i=n?tx(n):{state:"none"},a=nx(i);if(J())return Q({ok:!0,lines:o,freshness:i});if(a&&(K("This game is serving a closed round"),g(),A(a),g()),o.length===0){K("No log lines"),g(),A("Nothing yet, or everything is older than the tier's retention."),g();return}for(let s of o){let l=s.roundId?` [${s.roundId}]`:"";g(`${s.at} ${s.level.padEnd(5)}${l} ${s.message}`)}}catch(o){Ie(o)}}function ky(e=rS,t=bt){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&V("This is a development build of the CLI, so it cannot pin a client version.",["A deployed page imports the Gamestage client from a published version, and","this build is not one. Deploying anyway would point the game at",`${nn}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${P.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${P.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function J$(e,t,r=nn){let o=`${r}/client/${t}/${Oe}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function uT(e,t,r){let o=`<script>
10495
10495
  // Written by \`gamestage deploy\`. Where this game's Engine answers.
10496
10496
  window.GAMESTAGE_API = ${JSON.stringify(t)};
10497
10497
  window.GAMESTAGE_GAME = ${JSON.stringify(r)};
10498
10498
  // This page was deployed, so it may ask which Interaction Cloud project it is.
10499
10499
  window.GAMESTAGE_IC_LOOKUP = true;
10500
10500
  </script>
10501
- `,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function ho(e,t,r,o){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r,...o?{"cache-control":o}:{}}});n.ok||V(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function rl(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function tL(e){switch(V1(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function nL(e,t,r,o={}){let n=Y1(r),i;try{i=xy(n)}catch{throw V(`Cannot read ${r}.`),new Error("unreachable")}let a=await og({path:n,relativePath:r},o.round);a&&V(`${r} ${a.why}`,["A deploy is a publishing act, and --file publishes this file as the game's","own page. Point --file at the game's HTML, or use --dir and let the gate","withhold what the page does not need."]);let s=await e.uploadTarget(t,"index.html"),l=uT(Ei(i.toString("utf8")),`${s.playerApiOrigin}`,t);await ho(s.uploadUrl,l,"text/html; charset=utf-8",s.cacheControl);let d=await e.uploadTarget(t,Fe);await ho(d.uploadUrl,Yr,"text/javascript; charset=utf-8",d.cacheControl);let p=await e.uploadTarget(t,Oe);await ho(p.uploadUrl,Tt,"text/javascript; charset=utf-8",p.cacheControl);let h=await e.uploadTarget(t,rn);return await ho(h.uploadUrl,Si,"image/svg+xml",h.cacheControl),J()||(g(),A(`Uploaded ${r} to ${rl(s)}`),A(`Wired it to ${s.playerApiOrigin} as "${t}"`),A(`Shipped @monterosa/gamestage beside it (${Bt})`),A(`Shipped the player client beside it (${nr})`)),rl(s)}async function rL(e,t,r,o,n){if(o||!e||!t)return;let{browserCheck:i}=await Promise.resolve().then(()=>(_y(),q$));oL(await i(e,t,r,n))}function oL(e){if(e.status==="verified"){M("Checked","the page loads and plays in a browser"),g();return}if(e.status==="skipped"||e.status==="n/a"){A(P.dim(`Not checked in a browser: ${e.detail??""}`.trim())),g();return}K("The published page did not start"),g(` ${e.detail??""}`),g(),A("The files are published, so the game is live and broken rather than unpublished."),A(`${P.cyan(re("verify"))} the same check, with the rest of them`),g(),process.exitCode=1}function iL(e){for(let t of e.walkedPast)A(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)A(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)A(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&V(`${e.refuse.path} ${e.refuse.why}`,["A deploy is a publishing act, so this file would sit at a public URL beside","your game. Remove it from the directory, or point --dir at a directory that","does not contain it, and deploy again."])}async function aL(e,t,r,o={}){let n,i=[];try{let w=Ti(r,{symlinks:"throw"});n=w.files,i=w.withheld}catch(w){throw V(w instanceof Error?w.message:`Cannot read ${r}.`),new Error("unreachable")}let a=await DS(n,{...o,exempt:[Oe,Fe]});iL(a);let s=a.publish,l=s.find(w=>w.relativePath==="index.html");l||V(`Directory ${r} must contain an index.html file.`);let d=US(s,i);K(`Publishing ${s.length} ${s.length===1?"file":"files"} to the playground`);for(let w of d.lines)A(w);d.named.length&&(g(),A("The lines above are named because they are not ordinary web assets. Anything there you did not mean to publish, stop and remove it: a deploy puts every one of these at a public URL beside your game.")),g();let p=xy(l.path,"utf8"),h=tg(p),f=s.some(w=>w.relativePath==="favicon.ico"),y=s.some(w=>w.relativePath===rn),k=!h&&!f,D=k&&!y,b=ky();if(b!=="0.0.0-test"){let w=`${nn}/client/${b}/${Oe}`,C=!1;try{C=(await fetch(w,{method:"HEAD"})).ok}catch{C=!0}C||V(`The client this deploy would pin, ${b}, is not published yet.`,[`Every page uploaded here will import ${w},`,"which answers 404 today. The game would load, fetch nothing, and show a","blank screen with no error anywhere.","","Deploy the site first: it is what serves /client/<version>/.","",`${P.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let $;for(let w of s){if(w.relativePath===Oe||w.relativePath===Fe)continue;let C;try{C=await e.uploadTarget(t,w.relativePath)}catch(Ce){throw new Error(`${w.relativePath} cannot be published: ${Ce instanceof Error?Ce.message:String(Ce)}`,{cause:Ce})}w.relativePath==="index.html"&&($=C);let N=xy(w.path),ee=/\.(m?js)$/i.test(w.relativePath),me=/\.html$/i.test(w.relativePath)?uT(J$(k&&w.relativePath==="index.html"?Ei(N.toString("utf8")):N.toString("utf8"),ky()),C.playerApiOrigin,t):ee?J$(N.toString("utf8"),ky()):N;await ho(C.uploadUrl,me,tL(w.relativePath),C.cacheControl)}if(D){let w=await e.uploadTarget(t,rn);await ho(w.uploadUrl,Si,"image/svg+xml",w.cacheControl)}let S=[...s.map(w=>w.relativePath),...D?[rn]:[]];try{await e.pruneBundle(t,S);for(let w of a.withheld)A(`Removed ${w.path} from the playground.`)}catch(w){let C=w instanceof Error?w.message:String(w),N=a.withheld.map(ee=>ee.path);K("The playground still holds files this deploy did not publish"),g(` ${C}`),g(),N.length?(A(`Could not remove ${N.join(", ")} from the playground: ${C}`),A("Anything an earlier deploy put there is still being served.")):A("Anything an earlier deploy put there is still being served."),g(),process.exitCode=1}if(!J()&&$&&(g(),A(`Uploaded ${s.length} files from ${r}`),A(`Playground: ${rl($)}`),A(`Wired it to ${$.playerApiOrigin} as "${t}"`),D&&A("Added a replaceable starter favicon")),!$)throw new Error("The directory index was not uploaded.");return rl($)}rr();ke();import{readFile as fT,stat as kL}from"node:fs/promises";import{createServer as xL}from"node:http";import{extname as SL,join as EL,normalize as $L,resolve as gT,sep as TL}from"node:path";ke();var hT="player-conformance",Ty="round-current",sL="sha256:emulator-conformance";function sn(e){return structuredClone(e)}function Ht(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:sL}}var cL="2026-08-01T08:00:00.000Z";function lL(e){let t=e==="per-player-challenge",r=e==="locked";return{...Ht(),id:Ty,number:412,version:2,...r?{locks_at:cL}:{},can:{accepting_plays:!r,results_available:!1,solution_revealed:!1,closed:!1,optimistic_play:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function pT(e,t){let r=t==="mistakes";return{...Ht(),player_id:hT,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function dL(e){let t=lL(e),r=new Map([[t.id,t]]),o=new Map([[t.id,pT(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0,optimistic_play:!1},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",pT("round-revealed",e))),{runtime:{...Ht(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"predict":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...Ht(),round_id:Ty,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...Ht(),player_id:hT,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,intents:new Map,nextPlay:1}}function ol(e,t){return{...Ht(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function Ay(e){let t=dL(e);return{async getRuntime(){return sn(t.runtime)},async getCurrentRound(){return sn(t.rounds.get(Ty))},async getRound(r){let o=t.rounds.get(r);return o?sn(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return ol(t,"round_not_found");let i=tc({round_id:r,round_version:o.round_version,challenge_instance_id:o.challenge_instance_id,payload:o.payload}),a=t.plays.get(o.idempotency_key);if(a)return t.intents.get(o.idempotency_key)!==i?ol(t,"idempotency_conflict"):{...sn(a),outcome:"duplicate"};if(o.round_version!==n.version)return{...Ht(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return ol(t,"challenge_instance_id");if(n.locks_at!==void 0&&n.locks_at<=Ht().server_time)return ol(t,"lock_deadline_passed");let s=t.roundStates.get(r),l=t.runtime.marking==="at_settlement",d={...s,...Ht(),attempts_used:s.attempts_used+1,score:s.score+(l?0:10),finished:!l,outcome:l?"pending":"won"},p={...Ht(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!l,feedback:l?[]:[{key:"answer",verdict:"correct"}],round_state:sn(d)};return t.roundStates.set(r,d),t.plays.set(o.idempotency_key,p),t.intents.set(o.idempotency_key,i),d.finished&&!s.finished&&(t.profile=ec(t.profile,d.outcome)),sn(p)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return sn(o)},async getProfile(){return sn(t.profile)},async getLeaderboard(){return sn(t.leaderboard)}}}function uL(){return e=>Ay(e)}var XZ=uL();ke();import{createServer as pL}from"node:http";function cr(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var hL=cr(Pe.runtime),mL=cr(Pe.currentRound),fL=cr(Pe.round),gL=cr(Pe.plays),yL=cr(Pe.roundState),vL=cr(Pe.profile),bL=cr(Pe.leaderboard);function Ln(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function mo(e,t,r,o){Ln(e,t,{error:{code:r,message:o,retryable:!1}})}async function wL(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function _L(e,t,r,o){if(!e.url){mo(t,400,"invalid_request","The request URL is missing.");return}let i=new URL(e.url,"http://localhost").pathname;if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(i)){t.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(o)}),t.end(o);return}if(hL.test(i)){Ln(t,200,await r.getRuntime());return}if(mL.test(i)){Ln(t,200,await r.getCurrentRound());return}let a=fL.exec(i);if(a){let l=await r.getRound(decodeURIComponent(a[2]));if(!l){mo(t,404,"round_not_found","The requested round was not found.");return}Ln(t,200,l);return}let s=yL.exec(i);if(s){let l=decodeURIComponent(s[2]);try{Ln(t,200,await r.getRoundState(l))}catch{mo(t,404,"round_not_found","The requested round was not found.")}return}if(vL.test(i)){Ln(t,200,await r.getProfile());return}if(bL.test(i)){Ln(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let a=gL.exec(i);if(a){try{let s=await wL(e);Ln(t,200,await r.play(decodeURIComponent(a[2]),s))}catch(s){mo(t,400,"invalid_request",s instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}mo(t,404,"not_found","The requested player API route was not found.")}function il(e="default",t){let r=Ay(e);return pL((o,n)=>{_L(o,n,r,t).catch(()=>{n.headersSent?n.destroy():mo(n,500,"internal_error","The emulator could not answer the request.")})})}tn();sy();At();Re();async function AL(e){let t;try{t=await fT(e,"utf8")}catch{return}let r=De(t);if(!r.ok){V(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${P.cyan(o.path)} ${o.message}`));return}return r.manifest}async function IL(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:il(r,Tt),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await AL(e.manifest??"gamestage.yaml");if(!o)return{server:il(r,Tt),what:"fixture",fixtureReason:"no-manifest",game:"conformance-game"};let n=o.backend.round;if(!n){let a=o.interaction_cloud.elements.length?"studio-round":"unconfigured";return{server:il(r,Tt),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&V(`The manifest declares the ${i} format and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),ar.includes(n.archetype)||V(`No Engine here serves the ${n.archetype} format yet.`,[`Built so far: ${ar.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await el({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:Tt}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}var CL={".html":"text/html; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".ico":"image/x-icon",".woff2":"font/woff2"};function PL(e,t){let r=(n,i)=>`if (!window.${n}) window.${n} = ${JSON.stringify(i)};
10501
+ `,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function mo(e,t,r,o){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r,...o?{"cache-control":o}:{}}});n.ok||V(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function rl(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function aL(e){switch(Q1(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function sL(e,t,r,o={}){let n=eL(r),i;try{i=xy(n)}catch{throw V(`Cannot read ${r}.`),new Error("unreachable")}let a=await og({path:n,relativePath:r},o.round);a&&V(`${r} ${a.why}`,["A deploy is a publishing act, and --file publishes this file as the game's","own page. Point --file at the game's HTML, or use --dir and let the gate","withhold what the page does not need."]);let s=await e.uploadTarget(t,"index.html"),l=uT(Ei(i.toString("utf8")),`${s.playerApiOrigin}`,t);await mo(s.uploadUrl,l,"text/html; charset=utf-8",s.cacheControl);let d=await e.uploadTarget(t,Fe);await mo(d.uploadUrl,qr,"text/javascript; charset=utf-8",d.cacheControl);let p=await e.uploadTarget(t,Oe);await mo(p.uploadUrl,Tt,"text/javascript; charset=utf-8",p.cacheControl);let h=await e.uploadTarget(t,rn);return await mo(h.uploadUrl,Si,"image/svg+xml",h.cacheControl),J()||(g(),A(`Uploaded ${r} to ${rl(s)}`),A(`Wired it to ${s.playerApiOrigin} as "${t}"`),A(`Shipped @monterosa/gamestage beside it (${Bt})`),A(`Shipped the player client beside it (${nr})`)),rl(s)}async function cL(e,t,r,o,n){if(o||!e||!t)return;let{browserCheck:i}=await Promise.resolve().then(()=>(_y(),q$));lL(await i(e,t,r,n))}function lL(e){if(e.status==="verified"){M("Checked","the page loads and plays in a browser"),g();return}if(e.status==="skipped"||e.status==="n/a"){A(P.dim(`Not checked in a browser: ${e.detail??""}`.trim())),g();return}K("The published page did not start"),g(` ${e.detail??""}`),g(),A("The files are published, so the game is live and broken rather than unpublished."),A(`${P.cyan(re("verify"))} the same check, with the rest of them`),g(),process.exitCode=1}function dL(e){for(let t of e.walkedPast)A(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)A(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)A(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&V(`${e.refuse.path} ${e.refuse.why}`,["A deploy is a publishing act, so this file would sit at a public URL beside","your game. Remove it from the directory, or point --dir at a directory that","does not contain it, and deploy again."])}async function uL(e,t,r,o={}){let n,i=[];try{let w=Ti(r,{symlinks:"throw"});n=w.files,i=w.withheld}catch(w){throw V(w instanceof Error?w.message:`Cannot read ${r}.`),new Error("unreachable")}let a=await DS(n,{...o,exempt:[Oe,Fe]});dL(a);let s=a.publish,l=s.find(w=>w.relativePath==="index.html");l||V(`Directory ${r} must contain an index.html file.`);let d=US(s,i);K(`Publishing ${s.length} ${s.length===1?"file":"files"} to the playground`);for(let w of d.lines)A(w);d.named.length&&(g(),A("The lines above are named because they are not ordinary web assets. Anything there you did not mean to publish, stop and remove it: a deploy puts every one of these at a public URL beside your game.")),g();let p=xy(l.path,"utf8"),h=tg(p),f=s.some(w=>w.relativePath==="favicon.ico"),y=s.some(w=>w.relativePath===rn),k=!h&&!f,D=k&&!y,b=ky();if(b!=="0.0.0-test"){let w=`${nn}/client/${b}/${Oe}`,C=!1;try{C=(await fetch(w,{method:"HEAD"})).ok}catch{C=!0}C||V(`The client this deploy would pin, ${b}, is not published yet.`,[`Every page uploaded here will import ${w},`,"which answers 404 today. The game would load, fetch nothing, and show a","blank screen with no error anywhere.","","Deploy the site first: it is what serves /client/<version>/.","",`${P.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let $;for(let w of s){if(w.relativePath===Oe||w.relativePath===Fe)continue;let C;try{C=await e.uploadTarget(t,w.relativePath)}catch(Ce){throw new Error(`${w.relativePath} cannot be published: ${Ce instanceof Error?Ce.message:String(Ce)}`,{cause:Ce})}w.relativePath==="index.html"&&($=C);let N=xy(w.path),ee=/\.(m?js)$/i.test(w.relativePath),me=/\.html$/i.test(w.relativePath)?uT(J$(k&&w.relativePath==="index.html"?Ei(N.toString("utf8")):N.toString("utf8"),ky()),C.playerApiOrigin,t):ee?J$(N.toString("utf8"),ky()):N;await mo(C.uploadUrl,me,aL(w.relativePath),C.cacheControl)}if(D){let w=await e.uploadTarget(t,rn);await mo(w.uploadUrl,Si,"image/svg+xml",w.cacheControl)}let S=[...s.map(w=>w.relativePath),...D?[rn]:[]];try{await e.pruneBundle(t,S);for(let w of a.withheld)A(`Removed ${w.path} from the playground.`)}catch(w){let C=w instanceof Error?w.message:String(w),N=a.withheld.map(ee=>ee.path);K("The playground still holds files this deploy did not publish"),g(` ${C}`),g(),N.length?(A(`Could not remove ${N.join(", ")} from the playground: ${C}`),A("Anything an earlier deploy put there is still being served.")):A("Anything an earlier deploy put there is still being served."),g(),process.exitCode=1}if(!J()&&$&&(g(),A(`Uploaded ${s.length} files from ${r}`),A(`Playground: ${rl($)}`),A(`Wired it to ${$.playerApiOrigin} as "${t}"`),D&&A("Added a replaceable starter favicon")),!$)throw new Error("The directory index was not uploaded.");return rl($)}rr();ke();import{readFile as wT,stat as xL}from"node:fs/promises";import{createServer as SL}from"node:http";import{extname as EL,join as $L,normalize as TL,resolve as _T,sep as AL}from"node:path";ke();var hT="player-conformance",Ty="round-current",pL="sha256:emulator-conformance";function sn(e){return structuredClone(e)}function Ht(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:pL}}var hL="2026-08-01T08:00:00.000Z";function mL(e){let t=e==="per-player-challenge",r=e==="locked";return{...Ht(),id:Ty,number:412,version:2,...r?{locks_at:hL}:{},can:{accepting_plays:!r,results_available:!1,solution_revealed:!1,closed:!1,optimistic_play:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function pT(e,t){let r=t==="mistakes";return{...Ht(),player_id:hT,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function fL(e){let t=mL(e),r=new Map([[t.id,t]]),o=new Map([[t.id,pT(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0,optimistic_play:!1},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",pT("round-revealed",e))),{runtime:{...Ht(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"predict":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...Ht(),round_id:Ty,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...Ht(),player_id:hT,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,intents:new Map,nextPlay:1}}function ol(e,t){return{...Ht(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function Ay(e){let t=fL(e);return{async getRuntime(){return sn(t.runtime)},async getCurrentRound(){return sn(t.rounds.get(Ty))},async getRound(r){let o=t.rounds.get(r);return o?sn(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return ol(t,"round_not_found");let i=tc({round_id:r,round_version:o.round_version,challenge_instance_id:o.challenge_instance_id,payload:o.payload}),a=t.plays.get(o.idempotency_key);if(a)return t.intents.get(o.idempotency_key)!==i?ol(t,"idempotency_conflict"):{...sn(a),outcome:"duplicate"};if(o.round_version!==n.version)return{...Ht(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return ol(t,"challenge_instance_id");if(n.locks_at!==void 0&&n.locks_at<=Ht().server_time)return ol(t,"lock_deadline_passed");let s=t.roundStates.get(r),l=t.runtime.marking==="at_settlement",d={...s,...Ht(),attempts_used:s.attempts_used+1,score:s.score+(l?0:10),finished:!l,outcome:l?"pending":"won"},p={...Ht(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!l,feedback:l?[]:[{key:"answer",verdict:"correct"}],round_state:sn(d)};return t.roundStates.set(r,d),t.plays.set(o.idempotency_key,p),t.intents.set(o.idempotency_key,i),d.finished&&!s.finished&&(t.profile=ec(t.profile,d.outcome)),sn(p)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return sn(o)},async getProfile(){return sn(t.profile)},async getLeaderboard(){return sn(t.leaderboard)}}}function gL(){return e=>Ay(e)}var eV=gL();ke();import{createServer as yL}from"node:http";function lr(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var vL=lr(Pe.runtime),mT=lr(Pe.currentRound),fT=lr(Pe.round),gT=lr(Pe.plays),yT=lr(Pe.roundState),bL=lr(Pe.profile),wL=lr(Pe.leaderboard),vT={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"};function Ln(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{...vT,"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function cr(e,t,r,o){Ln(e,t,{error:{code:r,message:o,retryable:!1}})}async function _L(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function kL(e,t,r,o,n){if(!e.url){cr(t,400,"invalid_request","The request URL is missing.");return}let a=new URL(e.url,"http://localhost").pathname;if(e.method==="OPTIONS"){t.writeHead(204,vT),t.end();return}if(n&&(mT.test(a)||fT.test(a)||gT.test(a)||yT.test(a))){cr(t,404,"no_round",n);return}if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(a)){t.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(o)}),t.end(o);return}if(vL.test(a)){Ln(t,200,await r.getRuntime());return}if(mT.test(a)){Ln(t,200,await r.getCurrentRound());return}let s=fT.exec(a);if(s){let d=await r.getRound(decodeURIComponent(s[2]));if(!d){cr(t,404,"round_not_found","The requested round was not found.");return}Ln(t,200,d);return}let l=yT.exec(a);if(l){let d=decodeURIComponent(l[2]);try{Ln(t,200,await r.getRoundState(d))}catch{cr(t,404,"round_not_found","The requested round was not found.")}return}if(bL.test(a)){Ln(t,200,await r.getProfile());return}if(wL.test(a)){Ln(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let s=gT.exec(a);if(s){try{let l=await _L(e);Ln(t,200,await r.play(decodeURIComponent(s[2]),l))}catch(l){cr(t,400,"invalid_request",l instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}cr(t,404,"not_found","The requested player API route was not found.")}function il(e="default",t,r){let o=Ay(e);return yL((n,i)=>{kL(n,i,o,t,r).catch(()=>{i.headersSent?i.destroy():cr(i,500,"internal_error","The emulator could not answer the request.")})})}tn();sy();At();Re();async function IL(e){let t;try{t=await wT(e,"utf8")}catch{return}let r=De(t);if(!r.ok){V(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${P.cyan(o.path)} ${o.message}`));return}return r.manifest}var CL={unconfigured:"No round yet. Set one up in Studio, or add one to gamestage.yaml to play it locally.","studio-round":"This game's round is in Studio, which gamestage dev cannot reach. Play the deployed game, or add a round to gamestage.yaml to play it locally."};async function PL(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:il(r,Tt),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await IL(e.manifest??"gamestage.yaml");if(!o)return{server:il(r,Tt),what:"fixture",fixtureReason:"no-manifest",game:"conformance-game"};let n=o.backend.round;if(!n){let a=o.interaction_cloud.elements.length?"studio-round":"unconfigured";return{server:il(r,Tt,CL[a]),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&V(`The manifest declares the ${i} format and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),ar.includes(n.archetype)||V(`No Engine here serves the ${n.archetype} format yet.`,[`Built so far: ${ar.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await el({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:Tt}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}var OL={".html":"text/html; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".ico":"image/x-icon",".woff2":"font/woff2"};function NL(e,t){let r=(n,i)=>`if (!window.${n}) window.${n} = ${JSON.stringify(i)};
10502
10502
  `,o="<script>\n// Added by `gamestage dev --serve` as it served this page. Not in your file.\n"+r("GAMESTAGE_API",t.api)+r("GAMESTAGE_GAME",t.game)+(t.token?r("GAMESTAGE_TOKEN",t.token):"")+`</script>
10503
10503
  `;return/<head[^>]*>/i.test(e)?e.replace(/<head[^>]*>/i,n=>`${n}
10504
- ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","http://localhost"),i=decodeURIComponent(n.pathname),a=gT(e,`.${$L(i)}`);if(!(a===e||a.startsWith(e+TL))){o.writeHead(403).end("Outside the served directory");return}let l=a;try{(await kL(l)).isDirectory()&&(l=EL(l,"index.html"))}catch{o.writeHead(404).end("Not found");return}try{let d=await fT(l),p=/\.html?$/i.test(l),h=t&&p?PL(d.toString("utf8"),t):d;o.writeHead(200,{"content-type":CL[SL(l).toLowerCase()]??"application/octet-stream","cache-control":"no-store, must-revalidate"}),o.end(h)}catch{o.writeHead(404).end("Not found")}})}function mT(e,t){K("Your game runs in two places"),A("This process is the Engine. It holds the answers and marks every play."),t&&e?(M("Open",e),A("Your page is served from this directory, with caching off so an edit shows.")):A("Your page is yours to serve: this command does not, and the API URL above is not a page. `gamestage dev --serve` serves this directory if you want one."),A("The round a fan plays comes from Studio, not from here. A producer changes it without a deploy and without you."),g(),A("A manifest change needs a restart: this reads it once, at startup."),g()}async function yT(e){await ki();let t=await IL(e),{server:r}=t,o=()=>new Promise((f,y)=>{p?.close(),r.close(k=>k?y(k):f())}),n=new Promise(f=>{let y=async()=>{process.off("SIGINT",y),process.off("SIGTERM",y),await o(),f()};process.once("SIGINT",y),process.once("SIGTERM",y)});await new Promise((f,y)=>{r.once("error",y),r.listen(Number(e.port),"127.0.0.1",()=>f())});let i=r.address();if(!i||typeof i=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${i.port}`,s,l;t.as&&(s=await iy(a),r.attachDevIdentity?.(s),l=await s.mint(t.as));let d=(await je().catch(()=>null))?.email,p,h;if(e.serve){let f=gT(process.cwd());p=OL(f,t.game?{api:a,game:t.game,token:l}:void 0),await new Promise((k,D)=>{p.once("error",D),p.listen(Number(e.servePort??4001),"127.0.0.1",()=>k())});let y=p.address();y&&typeof y!="string"&&(h=`http://127.0.0.1:${y.port}`)}if(J())Q({ok:!0,status:"listening",serving:t.what,baseUrl:a,game:t.game,round:t.round?{number:t.round.number,id:`round-${t.round.number}`}:null,round_source:t.round?"manifest":"stand-in",...t.fixtureReason?{fixture_reason:t.fixtureReason}:{},...s&&l?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:l,required:!0}}:{}});else if(t.what==="engine"){K(t.title??t.game);let f=zn(t.containerLabel);M("Serving",`your ${zn(t.containerLabel,{lower:!0})}, through the real Engine`),M(f,`${t.round.number} (round-${t.round.number})`),M("API",a),M("Game id",t.game),d&&M("Signed in",d),g(),A(`<script src="${a}/gamestage.js"></script>`),A(`window.GAMESTAGE_API = "${a}"`),A(`window.GAMESTAGE_GAME = "${t.game}"`),l&&A(`window.GAMESTAGE_TOKEN = "${l}"`),g(),s&&l&&(M("Playing as",`${t.as} (${P.cyan(`id:${t.as}`)})`),M("Identity","required, so an anonymous play is refused here too"),M("Keys",s.jwksUri),g(),A("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),A(`This harness cannot be deployed: its issuer is a loopback URL, and ${P.cyan(re("manifest validate"))} refuses a manifest that names one.`),g()),A(`Edit the ${zn(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),g(),mT(h,!!e.serve)}else K(t.fixtureReason==="studio-round"?"Studio round, unavailable locally":t.fixtureReason==="unconfigured"?"No round configured yet":"Serving the contract fixture"),M("API",a),M("Game id",t.game),g(),A(`<script src="${a}/gamestage.js"></script>`),g(),t.fixtureReason==="studio-round"?(A("A round is configured in Studio, but `gamestage dev` cannot reach it."),A("Play the deployed game to use the Studio round. This fixture is only local wiring.")):t.fixtureReason==="unconfigured"?(A("No round is configured in Studio yet. This local run is a Gamestage stand-in, not your game."),A("Set up the first round in Studio, then play the deployed game.")):(A("There is no round here to serve, so this is the shell rather than your game."),A("`dev` reads a round from the manifest and is the one place that may: it is a local harness and deploys nothing. A game's real content lives in Studio, where a producer can change it without you.")),g(),mT(h,!!e.serve);await n}_y();ke();Re();import{stat as NL}from"node:fs/promises";function RL(e){let t=bS(e);return{id:"node",label:"Node.js",ok:t,detail:t?`v${e}`:`v${e} - Gamestage needs Node ${mc} or newer`,blocking:!0}}async function vT(){let e=[];e.push(RL(process.versions.node)),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${fi} bundled`,blocking:!1});let t=!1;try{await NL("gamestage.yaml"),t=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:t,detail:t?"gamestage.yaml found":"none here yet \u2014 `gamestage inspect .` or `gamestage create` makes one",blocking:!1}),e.push({id:"auth",label:"Signed in",ok:!1,detail:"not signed in \u2014 only needed to deploy",blocking:!1});let r=e.filter(o=>!o.ok&&o.blocking);J()&&(Q({ok:r.length===0,checks:e}),process.exit(r.length===0?0:1)),K("Environment");for(let o of e){let n=o.ok?P.green("ok"):o.blocking?P.red("blocked"):P.dim("--");g(` ${n.padEnd(18)} ${o.label.padEnd(16)} ${P.dim(o.detail)}`)}g(),r.length&&(g(` ${P.red("Fix the blocked items above before continuing.")}`),g(),process.exit(1)),g(` ${P.green("Ready.")}`),g()}qs();ke();rr();import{readFile as XL,stat as QL,writeFile as eD}from"node:fs/promises";import{createHash as tD}from"node:crypto";import{basename as nD}from"node:path";At();fy();wc();tn();import{readdir as LL,readFile as al,stat as Iy}from"node:fs/promises";import{createHash as DL}from"node:crypto";import{basename as wT,extname as jL,join as Cy,relative as ML}from"node:path";var UL=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),zL=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);function FL(e){return DL("sha256").update(e).digest("hex").slice(0,16)}var GL={[Fe]:nr,[Oe]:Bt};function BL(e){let t=wT(e.relative);if(bc(e.relative))return`${t} is never published by \`gamestage deploy\`, so nothing in it reaches a browser.`;let r=GL[t];return!r||FL(e.text)!==r?null:`${t} is the Gamestage client \`gamestage client\` generated. It reads an Engine verdict; it does not decide one, and the words that make it look like a leak (answer, correct, target) are how it talks to the Engine.`}async function WL(e,t=200){let r=await Iy(e),o=[],n=[],i=s=>{let l=BL(s);l?n.push({file:s.relative,reason:l}):o.push(s)};if(r.isFile())return i({path:e,relative:wT(e),text:await al(e,"utf8")}),{files:o,skipped:n};let a=async s=>{if(o.length>=t)return;let l=await LL(s,{withFileTypes:!0});for(let d of l){if(o.length>=t)return;if(d.name.startsWith(".")&&d.name!==".openai")continue;let p=Cy(s,d.name);if(d.isDirectory()){if(UL.has(d.name))continue;await a(p)}else if(zL.has(jL(d.name)))try{i({path:p,relative:ML(e,p),text:await al(p,"utf8")})}catch{}}};return await a(e),{files:o,skipped:n}}function KL(e,t){let r=e.text.split(`
10505
- `);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function HL(e,t){if(!(await Iy(e)).isFile())try{let o=JSON.parse(await al(Cy(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=bT(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=bT(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function bT(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var ZL=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],VL=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],YL=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"predict",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function qL(e){let t=e.map(s=>s.text).join(`
10506
- `),r=YL.map(s=>{let l=s.signals.filter(d=>d.pattern.test(t)).map(d=>d.because);return{archetype:s.archetype,hits:l.length,because:l}}).filter(s=>s.hits>0).sort((s,l)=>l.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function JL(e,t){let o=(await Iy(e)).isFile()?null:e;if(o)try{let i=await al(Cy(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},l=s.next?"Next.js":s.react?"React":s.vue?"Vue":s.svelte?"Svelte":void 0,d=s.vite?"Vite":s.webpack?"webpack":void 0;return{kind:"node_project",framework:l,build:d}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(i=>/\.html?$/.test(i.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function _T(e){let{files:t,skipped:r}=await WL(e);if(t.length===0)throw new Error(r.length>0?`No inspectable source found at ${e}. Everything found there is a generated Gamestage client bundle (${r.map(f=>f.file).join(", ")}), not a game. Point inspect at the game itself.`:`No inspectable source found at ${e}. Point inspect at a game file or a project directory.`);let o=await JL(e,t),n=qL(t),i=[];for(let f of ZL){let y=[];for(let k of t){for(let D of f.patterns){let b=KL(k,D);if(b){y.push(b);break}}if(y.length>=3)break}if(y.length>0){let k=n?f.remedies?.[n.archetype]??f.remedy:f.remedy;i.push({...k?{remedy:k}:{},id:f.id,title:f.title,detail:f.detail,evidence:y})}}let a=t.map(f=>f.text).join(`
10507
- `),s=VL.filter(f=>!f.present.test(a)).map(f=>({id:f.id,title:f.title,detail:f.detail,evidence:[]})),l=[];t.some(f=>/<(div|section|main|canvas)/i.test(f.text))&&l.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(f=>({file:f.relative}))});let p=nl(t),h=[];return o.kind==="standalone_html"&&h.push("Where is this deployed today, and who owns that hosting?"),h.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),i.some(f=>f.id==="client-play-limit")?h.push("Is the play limit per device or per person? That decides whether identity is required at launch."):(n?.archetype==="hunt"||n?.archetype==="group")&&h.push("No attempt limit inspect recognises. The Engine will not serve a hunt or group round without one: `backend.round.attemptsAllowed` defaults to 10 when left out, and that number is then the game a fan plays. Choose it deliberately, and if the prototype allowed unlimited tries, tell the developer the game has changed."),{target:e,scanned_files:t.length,stack:o,keep:l,move_behind_authority:i,missing_integrations:s,copy_to_studio:p,unknowns:h,archetype:n,name:await HL(e,t),skipped:r}}Re();var rD={hunt:"marks each pick against an answer set the producer holds, with no total and no order",push:"adds each pick to a running total, and busts the play when the total passes a ceiling",group:"judges a whole board at once, on whether the hidden sets were formed",predict:"settles a call once the world decides it, against an answer set after the fact",bingo:"deals a grid from a producer's pool and settles its cards as outcomes land",shoot:"resolves one shot, aim and power, against a keeper the Engine controls"},oD=new Set(["players make picks","selects from a roster","players guess"]);function iD(e){if(!e)return{matched:!1,nearest:null,differs:null};let t=e.archetype,r=Nt.includes(t),o=e.because.filter(n=>!oD.has(n));return r&&o.length>0?{matched:!0,nearest:t,differs:null}:{matched:!1,nearest:t,differs:r?rD[t]:"is a classification this report can reach, not a format any Engine of ours serves"}}var aD=e=>nD(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",sD=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function cD(e,t){let r=aD(e.name??e.target),o=t&&wS(t)?t:fc(r),n=e.name??sD(r),i=Js(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),Tn.parse(i)}async function lD(e,t){let r=await je();if(!r)return!1;to();let o=e.backend.archetype;if(!o)return!1;let i=await Vr({baseUrl:Ye,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${tD("sha256").update(t).digest("hex")}`,conformance:ct(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Hr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function dD(e){try{let t=Zr.load(await XL(e,"utf8"));if(!t||typeof t!="object")return;let r=t.app;return typeof r?.id=="string"&&r.id.trim()?r.id:void 0}catch{return}}async function uD(e){try{return await QL(e),!0}catch{return!1}}async function kT(e,t){let r;try{r=await _T(e)}catch(p){return V(p instanceof Error?p.message:"Inspection failed")}let o=cD(r,await dD(typeof t.write=="string"?t.write:"gamestage.yaml")),n=iD(r.archetype),i=ct(o);o.manifest.conformance=i.computed;let a=bi(o),s=!1,l,d=null;if(t.write){if(d=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await uD(d))return V(`${d} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${P.cyan(re(`manifest validate ${d}`))} check what you have`,`${P.cyan(re("inspect . --force"))} replace it anyway`]);await eD(d,a,"utf8");try{s=await lD(o,a)}catch(p){l=p instanceof Error?p.message:"The control plane did not answer."}}if(J()){Q({ok:!0,report:r,format_match:n,manifest:o,conformance:{computed:i.computed,blockers:i.blockers},manifest_yaml:a,written_to:d,registered:s,...l?{registration_failed:l}:{}});return}if(K(`Inspection report ${P.dim(r.target)}`),M("Files inspected",String(r.scanned_files)),M("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),n.matched&&r.archetype?(M("Format",r.archetype.archetype),g(` ${" ".repeat(18)} ${P.dim(r.archetype.because.join("; "))}`)):n.nearest?(M("Format",P.yellow("none of the served formats marks this game")),g(),g(` The formats are ${Nt.join(", ")}. Each is one rule an`),g(" Engine marks plays against, and this game's rule is not among them."),g(),g(` Nearest: ${P.cyan(n.nearest)}, which ${n.differs}.`),g(" Building on it would judge fans by a rule their game never had."),g()):(M("Format",P.yellow("not recognised from this code")),g(),g(" Nothing in what was read says which of the served formats this is, and"),g(" that is a reading of the code rather than a verdict on the game."),g(` They are ${Nt.join(", ")}.`),g()),n.matched||(g(" Tell us the rule we do not have. It needs no account and sends"),g(" nothing until you add --send:"),g(` ${P.cyan(re(`suggest "<your rule in one sentence>"${n.nearest?` --closest ${n.nearest}`:""}`))}`)),r.skipped.length){K("Skipped");for(let p of r.skipped)A(`${P.dim(p.file)} \u2014 not scanned`),g(` ${P.dim(p.reason)}`)}if(r.keep.length){K("Keep as yours");for(let p of r.keep)A(P.green(p.title)),g(` ${P.dim(p.detail)}`)}if(r.move_behind_authority.length){K("Must move behind an authoritative boundary");for(let p of r.move_behind_authority){A(P.yellow(p.title)),g(` ${P.dim(p.detail)}`);for(let h of p.evidence.slice(0,2)){let f=h.line?`${h.file}:${h.line}`:h.file;g(` ${P.dim("\u2192")} ${P.cyan(f)}${h.excerpt?P.dim(" "+h.excerpt):""}`)}p.remedy&&(g(` ${P.dim("delete")} ${p.remedy.delete}`),g(` ${P.dim("call")} ${P.cyan(p.remedy.call)}`),p.remedy.render&&g(` ${P.dim("render")} ${p.remedy.render}`),p.remedy.move&&g(` ${P.dim("move")} ${p.remedy.move}`),g(` ${P.dim("keep")} ${p.remedy.keep}`))}}if(r.missing_integrations.length){K("Platform integrations not present yet");for(let p of r.missing_integrations)A(p.title),g(` ${P.dim(p.detail)}`)}if(r.unknowns.length){K("Needs a human answer");for(let p of r.unknowns)A(p,"?")}if(K("App Manifest"),M("Conformance",`${i.computed} ${i.computedName}`),i.blockers.length){g(),g(P.dim(" To reach the next level:"));for(let p of i.blockers)g(` ${P.dim("\xB7")} ${p.requirement}`)}g(),d?(g(` Written to ${P.cyan(d)}`),!n.matched&&n.nearest&&g(P.dim(` It proposes ${n.nearest} as a starting point. That rule will not mark this game.`)),g(s?" Registered in Studio as a draft.":l?` Not registered in Studio: ${l} (${Ye})`:" No account found, so registration was skipped.")):(g(P.dim(" Nothing written and nothing registered. Re-run with --write to save")),g(P.dim(" this manifest and register the game."))),g()}var xT="https://github.com",pD="https://api.github.com",sl=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function ST(){let e=await fetch(`${xT}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:sl,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function ET(e){let r=await(await fetch(`${xT}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:sl,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await hD(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function hD(e){let t=await fetch(`${pD}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}At();Re();var mD=e=>new Promise(t=>setTimeout(t,e));async function $T(){let{client:e}=await xe();try{let t=await ST();J()?Q({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:sl}):(K("Link GitHub"),g(),A("This proves who you are. We read your GitHub login and nothing else."),A("No access to your code is requested, and none is stored."),A("It is optional: a deploy does not require it."),g(),M("Code",t.user_code),M("Open",t.verification_uri),g(),A("Enter the code on that page. This waits until you do."),g());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await mD(o*1e3);let n=await ET(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return V("You declined the request on GitHub.");if(n.status==="expired")return V("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(J())return Q({ok:!0,status:"linked",github:i.github});K("Linked"),M("Account",n.login),g(),A("Your first deploy is no longer gated. Run `gamestage deploy`."),g();return}V("The code expired before it was entered.")}catch(t){Ie(t)}}rr();At();Re();ke();var fD=e=>new Promise(t=>setTimeout(t,e));function gD(e){process.stderr.write(JSON.stringify({ok:!0,status:"awaiting_approval",user_code:e.user_code,verification_uri:e.verification_uri,verification_uri_complete:e.verification_uri_complete,expires_in:e.expires_in},null,2)+`
10508
- `)}async function TT(e,t,r){let{client:o}=await xe(),n=await gc(o),i=xi(n),a=n.access==="approved"||n.access==="pending"?n.workspace:void 0,s=a!==void 0&&!ax(a),l;if(r&&(l=await o.getWorkspace().then(d=>d.id).catch(()=>{})),J()){Q({ok:i.ok,status:i.status,access:i.access,...i.code?{code:i.code}:{},message:i.message,next:i.next,email:e.email,...t?{stored_in:t}:{},control_plane:Ye,...s?{terms:{accepted:!1,url:rc,version:nc}}:{}}),i.ok||process.exit(1);return}g(),K("Signed in"),M("Account",e.email??e.userId??"unknown"),t&&M("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),g(),A("Never written into the project, and never passed to your agent."),A("`gamestage logout` removes it."),r&&l&&l!==r?(g(),K("Not the workspace you asked for"),M("You asked for",r),M("You are in",l),g(),A("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):r&&l&&M("Workspace",l),no(i),s&&(K("Terms of Service"),g(` ${yD}`),g()),i.ok||process.exit(1)}var yD=`Read the Gamestage Terms of Service at ${rc} and accept them at ${ix} before your account can be approved or a game deployed. You must accept them yourself in a browser; an agent cannot accept them for you.`;async function AT(e){let t=await je();if(t){await TT(t,void 0,e);return}let r;try{r=await mS()}catch(s){V("Could not reach the sign-in service.",[String(s)])}if(J())gD(r);else{K("Sign in to Gamestage"),g(" This also creates your account if you do not have one. Google or email."),g(" A new account is approved by a person, so this may end in a wait."),g(" Taking a while? Email support@monterosa.co."),g(),M("Open",r.verification_uri_complete),M("Or enter",`${r.user_code} at ${r.verification_uri}`);let s=!!process.env.GAMESTAGE_CREDENTIALS;s&&(g(),g(" Signing in to a second credential file, so this does NOT open a browser."),A("Opening it here would hand the address to the browser you are already signed in to, which approves as that account instantly and with nothing to click."),A("Copy the address above into a private window and approve it there."),A("Signing out at auth.gamestage.ai first works too.")),g(),g(" Waiting for you to confirm in the browser..."),s||gS(r.verification_uri_complete)}let o=Date.now()+r.expires_in*1e3,n=r.interval*1e3,i=null;for(;Date.now()<o;){await fD(n);let s=await fS(r.device_code);if(s.status==="ok"){i=s.session;break}if(s.status==="slow_down"){n+=5e3;continue}s.status!=="pending"&&(s.status==="expired"&&V("That code expired.",["Run `gamestage login` again."]),V("Sign-in was refused.",[s.reason]))}i||V("Timed out waiting for approval.",["Run `gamestage login` again."]);let a=await qf(i);await TT(i,a,e)}async function IT(){let e=await je();if(await vS(),J()){Q({ok:!0,status:e?"signed_out":"not_signed_in"});return}K(e?"Signed out":"Not signed in"),e&&M("Removed",e.email??"session"),g()}async function CT(){let e=await je();if(J()){Q(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){K("Not signed in"),g(),A("Inspecting, scaffolding and local rounds need no account."),A("Run `gamestage login` when you want to deploy a playground."),g();return}K("Signed in"),M("Account",e.email??"unknown"),e.userId&&M("User",e.userId),g(),A("`gamestage status` says whether this account is approved."),g()}ke();rr();import{readdir as vD,readFile as PT,stat as bD}from"node:fs/promises";Re();import{homedir as wD}from"node:os";import{join as _D}from"node:path";async function kD(e){let t=[];try{t=await vD(e)}catch{}let r=t.filter(a=>!a.startsWith(".")),o=[];for(let a of r)/\.html?$/.test(a)&&o.push(a);let n=!1,i;for(let a of["gamestage.yaml","gamestage.yml"])try{await bD(`${e}/${a}`),n=!0;try{let s=De(await PT(`${e}/${a}`,"utf8"));s.ok&&(i=!!s.manifest.backend.round)}catch{}break}catch{}return{has_manifest:n,has_package_json:r.includes("package.json"),html_files:o,is_empty:r.length===0,has_round:i}}function xD(e,t){let r=[],o="";for(let n of e.split(" "))o&&o.length+1+n.length>t?(r.push(o),o=n):o=o?`${o} ${n}`:n;return o&&r.push(o),r}async function SD(){try{return(await PT(_D(wD(),".claude","skills","gamestage","SKILL.md"),"utf8")).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1]??null}catch{return null}}async function OT(){let e=process.cwd(),t=await kD(e),r=t.has_manifest?t.has_round===!1?"round":t.has_round===!0?"play":"continue":t.has_package_json||t.html_files.length>0?"inspect":"create",o={continue:{command:re("manifest validate gamestage.yaml"),why:"This project already has an App Manifest. Check where it stands.",prompt:"Tell me where this Gamestage project stands. Run `npx gamestage manifest validate gamestage.yaml` and `npx gamestage status`, then summarise what is done and what is left before it could go live."},round:{command:"edit gamestage.yaml, add backend.round",why:`The manifest names a format but no round, so there is no game for the Engine to serve yet. The round is the content the server owns: the board a player sees and the answers they never do. Until it is there, \`${re("dev")}\` serves the contract fixture rather than your game, and \`${re("verify")}\` has nothing to verify. Both need an account, so \`${re("login")}\` comes first.`,prompt:"This project has a Gamestage manifest with no round yet. Write one into gamestage.yaml from the game's own content so `gamestage dev` can serve it locally, and keep every answer out of the page and out of anything the browser downloads. A deployed game takes its round from Studio instead, where a producer changes it without a deploy: the manifest round is for developing against, not the content you ship."},play:{command:re("dev"),why:`The manifest declares a round. Serve it locally, through the real Engine. Needs an account, so \`${re("login")}\` first if you have not.`,prompt:"Serve this Gamestage game locally with `npx gamestage dev`, open it, and make a play. Then tell me whether the Engine decided the outcome or the page did."},inspect:{command:re("inspect ."),why:"There is a game here already. Read it read-only and produce an inspection report.",prompt:"Take the game in this folder to production with Gamestage. Start with `npx gamestage inspect .`, which changes nothing, and tell me what has to move out of the page before you edit anything."},create:{command:re("create"),why:"Nothing to inspect. Start a new game from a concept.",prompt:"Build me a new game with Gamestage. Ask me which format it should be and what it is about before you scaffold anything, rather than choosing for me."}},n=await je().catch(()=>null);if(J()){Q({ok:!0,cwd:e,version:bt,detected:t,route:r,next:o[r],prompt:o[r].prompt,docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:pc(),account:{signed_in:!!n?.email,email:n?.email??null,sign_in:re("login")},authentication:n?.email?`Signed in as ${n.email}. \`${re("deploy")}\` also needs the account approved; \`${re("status")}\` says whether it is.`:`Not signed in. \`${re("inspect")}\`, \`${re("create")}\` and \`${re("manifest validate")}\` work without an account, so do that work now. \`${re("dev")}\`, \`${re("verify")}\` and \`${re("deploy")}\` refuse until \`${re("login")}\`, which creates the account too. Tell the person once, when you reach the first command that needs it.`});return}K(`Gamestage ${bt}`);let i=_i?await SD():null;if(i&&_i&&i<_i&&g(P.dim(` Your installed Gamestage skill is ${i}; the current one is ${_i}.
10504
+ ${o}`):o+e}function RL(e,t){return SL(async(r,o)=>{let n=new URL(r.url??"/","http://localhost"),i=decodeURIComponent(n.pathname),a=_T(e,`.${TL(i)}`);if(!(a===e||a.startsWith(e+AL))){o.writeHead(403).end("Outside the served directory");return}let l=a;try{(await xL(l)).isDirectory()&&(l=$L(l,"index.html"))}catch{o.writeHead(404).end("Not found");return}try{let d=await wT(l),p=/\.html?$/i.test(l),h=t&&p?NL(d.toString("utf8"),t):d;o.writeHead(200,{"content-type":OL[EL(l).toLowerCase()]??"application/octet-stream","cache-control":"no-store, must-revalidate"}),o.end(h)}catch{o.writeHead(404).end("Not found")}})}function bT(e,t){K("Your game runs in two places"),A("This process is the Engine. It holds the answers and marks every play."),t&&e?(M("Open",e),A("Your page is served from this directory, with caching off so an edit shows.")):A("Your page is yours to serve: this command does not, and the API URL above is not a page. `gamestage dev --serve` serves this directory if you want one."),A("The round a fan plays comes from Studio, not from here. A producer changes it without a deploy and without you."),g(),A("A manifest change needs a restart: this reads it once, at startup."),g()}async function kT(e){await ki();let t=await PL(e),{server:r}=t,o=()=>new Promise((f,y)=>{p?.close(),r.close(k=>k?y(k):f())}),n=new Promise(f=>{let y=async()=>{process.off("SIGINT",y),process.off("SIGTERM",y),await o(),f()};process.once("SIGINT",y),process.once("SIGTERM",y)});await new Promise((f,y)=>{r.once("error",y),r.listen(Number(e.port),"127.0.0.1",()=>f())});let i=r.address();if(!i||typeof i=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${i.port}`,s,l;t.as&&(s=await iy(a),r.attachDevIdentity?.(s),l=await s.mint(t.as));let d=(await je().catch(()=>null))?.email,p,h;if(e.serve){let f=_T(process.cwd());p=RL(f,t.game?{api:a,game:t.game,token:l}:void 0),await new Promise((k,D)=>{p.once("error",D),p.listen(Number(e.servePort??4001),"127.0.0.1",()=>k())});let y=p.address();y&&typeof y!="string"&&(h=`http://127.0.0.1:${y.port}`)}if(J())Q({ok:!0,status:"listening",serving:t.what,baseUrl:a,game:t.game,round:t.round?{number:t.round.number,id:`round-${t.round.number}`}:null,round_source:t.round?"manifest":"stand-in",...t.fixtureReason?{fixture_reason:t.fixtureReason}:{},...s&&l?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:l,required:!0}}:{}});else if(t.what==="engine"){K(t.title??t.game);let f=zn(t.containerLabel);M("Serving",`your ${zn(t.containerLabel,{lower:!0})}, through the real Engine`),M(f,`${t.round.number} (round-${t.round.number})`),M("API",a),M("Game id",t.game),d&&M("Signed in",d),g(),A(`<script src="${a}/gamestage.js"></script>`),A(`window.GAMESTAGE_API = "${a}"`),A(`window.GAMESTAGE_GAME = "${t.game}"`),l&&A(`window.GAMESTAGE_TOKEN = "${l}"`),g(),s&&l&&(M("Playing as",`${t.as} (${P.cyan(`id:${t.as}`)})`),M("Identity","required, so an anonymous play is refused here too"),M("Keys",s.jwksUri),g(),A("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),A(`This harness cannot be deployed: its issuer is a loopback URL, and ${P.cyan(re("manifest validate"))} refuses a manifest that names one.`),g()),A(`Edit the ${zn(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),g(),bT(h,!!e.serve)}else K(t.fixtureReason==="studio-round"?"Studio round, unavailable locally":t.fixtureReason==="unconfigured"?"No round configured yet":"Serving the contract fixture"),M("API",a),M("Game id",t.game),g(),A(`<script src="${a}/gamestage.js"></script>`),g(),t.fixtureReason==="studio-round"?(A("A round is configured in Studio, but `gamestage dev` cannot reach it."),A("Play the deployed game to use the Studio round. Your page will say so here rather than draw a board.")):t.fixtureReason==="unconfigured"?(A("No round is configured in Studio yet, so your page will say so rather than draw a board."),A("Set up the first round in Studio, then play the deployed game.")):(A("There is no round here to serve, so this is the shell rather than your game."),A("`dev` reads a round from the manifest and is the one place that may: it is a local harness and deploys nothing. A game's real content lives in Studio, where a producer can change it without you.")),g(),bT(h,!!e.serve);await n}_y();ke();Re();import{stat as LL}from"node:fs/promises";function DL(e){let t=bS(e);return{id:"node",label:"Node.js",ok:t,detail:t?`v${e}`:`v${e} - Gamestage needs Node ${mc} or newer`,blocking:!0}}async function xT(){let e=[];e.push(DL(process.versions.node)),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${fi} bundled`,blocking:!1});let t=!1;try{await LL("gamestage.yaml"),t=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:t,detail:t?"gamestage.yaml found":"none here yet \u2014 `gamestage inspect .` or `gamestage create` makes one",blocking:!1}),e.push({id:"auth",label:"Signed in",ok:!1,detail:"not signed in \u2014 only needed to deploy",blocking:!1});let r=e.filter(o=>!o.ok&&o.blocking);J()&&(Q({ok:r.length===0,checks:e}),process.exit(r.length===0?0:1)),K("Environment");for(let o of e){let n=o.ok?P.green("ok"):o.blocking?P.red("blocked"):P.dim("--");g(` ${n.padEnd(18)} ${o.label.padEnd(16)} ${P.dim(o.detail)}`)}g(),r.length&&(g(` ${P.red("Fix the blocked items above before continuing.")}`),g(),process.exit(1)),g(` ${P.green("Ready.")}`),g()}qs();ke();rr();import{readFile as eD,stat as tD,writeFile as nD}from"node:fs/promises";import{createHash as rD}from"node:crypto";import{basename as oD}from"node:path";At();fy();wc();tn();import{readdir as jL,readFile as al,stat as Iy}from"node:fs/promises";import{createHash as ML}from"node:crypto";import{basename as ET,extname as UL,join as Cy,relative as zL}from"node:path";var FL=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),GL=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);function BL(e){return ML("sha256").update(e).digest("hex").slice(0,16)}var WL={[Fe]:nr,[Oe]:Bt};function KL(e){let t=ET(e.relative);if(bc(e.relative))return`${t} is never published by \`gamestage deploy\`, so nothing in it reaches a browser.`;let r=WL[t];return!r||BL(e.text)!==r?null:`${t} is the Gamestage client \`gamestage client\` generated. It reads an Engine verdict; it does not decide one, and the words that make it look like a leak (answer, correct, target) are how it talks to the Engine.`}async function HL(e,t=200){let r=await Iy(e),o=[],n=[],i=s=>{let l=KL(s);l?n.push({file:s.relative,reason:l}):o.push(s)};if(r.isFile())return i({path:e,relative:ET(e),text:await al(e,"utf8")}),{files:o,skipped:n};let a=async s=>{if(o.length>=t)return;let l=await jL(s,{withFileTypes:!0});for(let d of l){if(o.length>=t)return;if(d.name.startsWith(".")&&d.name!==".openai")continue;let p=Cy(s,d.name);if(d.isDirectory()){if(FL.has(d.name))continue;await a(p)}else if(GL.has(UL(d.name)))try{i({path:p,relative:zL(e,p),text:await al(p,"utf8")})}catch{}}};return await a(e),{files:o,skipped:n}}function ZL(e,t){let r=e.text.split(`
10505
+ `);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function VL(e,t){if(!(await Iy(e)).isFile())try{let o=JSON.parse(await al(Cy(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=ST(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=ST(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function ST(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var YL=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],qL=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],JL=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"predict",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function XL(e){let t=e.map(s=>s.text).join(`
10506
+ `),r=JL.map(s=>{let l=s.signals.filter(d=>d.pattern.test(t)).map(d=>d.because);return{archetype:s.archetype,hits:l.length,because:l}}).filter(s=>s.hits>0).sort((s,l)=>l.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function QL(e,t){let o=(await Iy(e)).isFile()?null:e;if(o)try{let i=await al(Cy(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},l=s.next?"Next.js":s.react?"React":s.vue?"Vue":s.svelte?"Svelte":void 0,d=s.vite?"Vite":s.webpack?"webpack":void 0;return{kind:"node_project",framework:l,build:d}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(i=>/\.html?$/.test(i.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function $T(e){let{files:t,skipped:r}=await HL(e);if(t.length===0)throw new Error(r.length>0?`No inspectable source found at ${e}. Everything found there is a generated Gamestage client bundle (${r.map(f=>f.file).join(", ")}), not a game. Point inspect at the game itself.`:`No inspectable source found at ${e}. Point inspect at a game file or a project directory.`);let o=await QL(e,t),n=XL(t),i=[];for(let f of YL){let y=[];for(let k of t){for(let D of f.patterns){let b=ZL(k,D);if(b){y.push(b);break}}if(y.length>=3)break}if(y.length>0){let k=n?f.remedies?.[n.archetype]??f.remedy:f.remedy;i.push({...k?{remedy:k}:{},id:f.id,title:f.title,detail:f.detail,evidence:y})}}let a=t.map(f=>f.text).join(`
10507
+ `),s=qL.filter(f=>!f.present.test(a)).map(f=>({id:f.id,title:f.title,detail:f.detail,evidence:[]})),l=[];t.some(f=>/<(div|section|main|canvas)/i.test(f.text))&&l.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(f=>({file:f.relative}))});let p=nl(t),h=[];return o.kind==="standalone_html"&&h.push("Where is this deployed today, and who owns that hosting?"),h.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),i.some(f=>f.id==="client-play-limit")?h.push("Is the play limit per device or per person? That decides whether identity is required at launch."):(n?.archetype==="hunt"||n?.archetype==="group")&&h.push("No attempt limit inspect recognises. The Engine will not serve a hunt or group round without one: `backend.round.attemptsAllowed` defaults to 10 when left out, and that number is then the game a fan plays. Choose it deliberately, and if the prototype allowed unlimited tries, tell the developer the game has changed."),{target:e,scanned_files:t.length,stack:o,keep:l,move_behind_authority:i,missing_integrations:s,copy_to_studio:p,unknowns:h,archetype:n,name:await VL(e,t),skipped:r}}Re();var iD={hunt:"marks each pick against an answer set the producer holds, with no total and no order",push:"adds each pick to a running total, and busts the play when the total passes a ceiling",group:"judges a whole board at once, on whether the hidden sets were formed",predict:"settles a call once the world decides it, against an answer set after the fact",bingo:"deals a grid from a producer's pool and settles its cards as outcomes land",shoot:"resolves one shot, aim and power, against a keeper the Engine controls"},aD=new Set(["players make picks","selects from a roster","players guess"]);function sD(e){if(!e)return{matched:!1,nearest:null,differs:null};let t=e.archetype,r=Nt.includes(t),o=e.because.filter(n=>!aD.has(n));return r&&o.length>0?{matched:!0,nearest:t,differs:null}:{matched:!1,nearest:t,differs:r?iD[t]:"is a classification this report can reach, not a format any Engine of ours serves"}}var cD=e=>oD(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",lD=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function dD(e,t){let r=cD(e.name??e.target),o=t&&wS(t)?t:fc(r),n=e.name??lD(r),i=Js(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),Tn.parse(i)}async function uD(e,t){let r=await je();if(!r)return!1;no();let o=e.backend.archetype;if(!o)return!1;let i=await Yr({baseUrl:Ye,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${rD("sha256").update(t).digest("hex")}`,conformance:ct(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Zr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function pD(e){try{let t=Vr.load(await eD(e,"utf8"));if(!t||typeof t!="object")return;let r=t.app;return typeof r?.id=="string"&&r.id.trim()?r.id:void 0}catch{return}}async function hD(e){try{return await tD(e),!0}catch{return!1}}async function TT(e,t){let r;try{r=await $T(e)}catch(p){return V(p instanceof Error?p.message:"Inspection failed")}let o=dD(r,await pD(typeof t.write=="string"?t.write:"gamestage.yaml")),n=sD(r.archetype),i=ct(o);o.manifest.conformance=i.computed;let a=bi(o),s=!1,l,d=null;if(t.write){if(d=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await hD(d))return V(`${d} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${P.cyan(re(`manifest validate ${d}`))} check what you have`,`${P.cyan(re("inspect . --force"))} replace it anyway`]);await nD(d,a,"utf8");try{s=await uD(o,a)}catch(p){l=p instanceof Error?p.message:"The control plane did not answer."}}if(J()){Q({ok:!0,report:r,format_match:n,manifest:o,conformance:{computed:i.computed,blockers:i.blockers},manifest_yaml:a,written_to:d,registered:s,...l?{registration_failed:l}:{}});return}if(K(`Inspection report ${P.dim(r.target)}`),M("Files inspected",String(r.scanned_files)),M("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),n.matched&&r.archetype?(M("Format",r.archetype.archetype),g(` ${" ".repeat(18)} ${P.dim(r.archetype.because.join("; "))}`)):n.nearest?(M("Format",P.yellow("none of the served formats marks this game")),g(),g(` The formats are ${Nt.join(", ")}. Each is one rule an`),g(" Engine marks plays against, and this game's rule is not among them."),g(),g(` Nearest: ${P.cyan(n.nearest)}, which ${n.differs}.`),g(" Building on it would judge fans by a rule their game never had."),g()):(M("Format",P.yellow("not recognised from this code")),g(),g(" Nothing in what was read says which of the served formats this is, and"),g(" that is a reading of the code rather than a verdict on the game."),g(` They are ${Nt.join(", ")}.`),g()),n.matched||(g(" Tell us the rule we do not have. It needs no account and sends"),g(" nothing until you add --send:"),g(` ${P.cyan(re(`suggest "<your rule in one sentence>"${n.nearest?` --closest ${n.nearest}`:""}`))}`)),r.skipped.length){K("Skipped");for(let p of r.skipped)A(`${P.dim(p.file)} \u2014 not scanned`),g(` ${P.dim(p.reason)}`)}if(r.keep.length){K("Keep as yours");for(let p of r.keep)A(P.green(p.title)),g(` ${P.dim(p.detail)}`)}if(r.move_behind_authority.length){K("Must move behind an authoritative boundary");for(let p of r.move_behind_authority){A(P.yellow(p.title)),g(` ${P.dim(p.detail)}`);for(let h of p.evidence.slice(0,2)){let f=h.line?`${h.file}:${h.line}`:h.file;g(` ${P.dim("\u2192")} ${P.cyan(f)}${h.excerpt?P.dim(" "+h.excerpt):""}`)}p.remedy&&(g(` ${P.dim("delete")} ${p.remedy.delete}`),g(` ${P.dim("call")} ${P.cyan(p.remedy.call)}`),p.remedy.render&&g(` ${P.dim("render")} ${p.remedy.render}`),p.remedy.move&&g(` ${P.dim("move")} ${p.remedy.move}`),g(` ${P.dim("keep")} ${p.remedy.keep}`))}}if(r.missing_integrations.length){K("Platform integrations not present yet");for(let p of r.missing_integrations)A(p.title),g(` ${P.dim(p.detail)}`)}if(r.unknowns.length){K("Needs a human answer");for(let p of r.unknowns)A(p,"?")}if(K("App Manifest"),M("Conformance",`${i.computed} ${i.computedName}`),i.blockers.length){g(),g(P.dim(" To reach the next level:"));for(let p of i.blockers)g(` ${P.dim("\xB7")} ${p.requirement}`)}g(),d?(g(` Written to ${P.cyan(d)}`),!n.matched&&n.nearest&&g(P.dim(` It proposes ${n.nearest} as a starting point. That rule will not mark this game.`)),g(s?" Registered in Studio as a draft.":l?` Not registered in Studio: ${l} (${Ye})`:" No account found, so registration was skipped.")):(g(P.dim(" Nothing written and nothing registered. Re-run with --write to save")),g(P.dim(" this manifest and register the game."))),g()}var AT="https://github.com",mD="https://api.github.com",sl=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function IT(){let e=await fetch(`${AT}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:sl,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function CT(e){let r=await(await fetch(`${AT}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:sl,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await fD(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function fD(e){let t=await fetch(`${mD}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}At();Re();var gD=e=>new Promise(t=>setTimeout(t,e));async function PT(){let{client:e}=await xe();try{let t=await IT();J()?Q({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:sl}):(K("Link GitHub"),g(),A("This proves who you are. We read your GitHub login and nothing else."),A("No access to your code is requested, and none is stored."),A("It is optional: a deploy does not require it."),g(),M("Code",t.user_code),M("Open",t.verification_uri),g(),A("Enter the code on that page. This waits until you do."),g());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await gD(o*1e3);let n=await CT(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return V("You declined the request on GitHub.");if(n.status==="expired")return V("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(J())return Q({ok:!0,status:"linked",github:i.github});K("Linked"),M("Account",n.login),g(),A("Your first deploy is no longer gated. Run `gamestage deploy`."),g();return}V("The code expired before it was entered.")}catch(t){Ie(t)}}rr();At();Re();ke();var yD=e=>new Promise(t=>setTimeout(t,e));function vD(e){process.stderr.write(JSON.stringify({ok:!0,status:"awaiting_approval",user_code:e.user_code,verification_uri:e.verification_uri,verification_uri_complete:e.verification_uri_complete,expires_in:e.expires_in},null,2)+`
10508
+ `)}async function OT(e,t,r){let{client:o}=await xe(),n=await gc(o),i=xi(n),a=n.access==="approved"||n.access==="pending"?n.workspace:void 0,s=a!==void 0&&!ax(a),l;if(r&&(l=await o.getWorkspace().then(d=>d.id).catch(()=>{})),J()){Q({ok:i.ok,status:i.status,access:i.access,...i.code?{code:i.code}:{},message:i.message,next:i.next,email:e.email,...t?{stored_in:t}:{},control_plane:Ye,...s?{terms:{accepted:!1,url:rc,version:nc}}:{}}),i.ok||process.exit(1);return}g(),K("Signed in"),M("Account",e.email??e.userId??"unknown"),t&&M("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),g(),A("Never written into the project, and never passed to your agent."),A("`gamestage logout` removes it."),r&&l&&l!==r?(g(),K("Not the workspace you asked for"),M("You asked for",r),M("You are in",l),g(),A("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):r&&l&&M("Workspace",l),ro(i),s&&(K("Terms of Service"),g(` ${bD}`),g()),i.ok||process.exit(1)}var bD=`Read the Gamestage Terms of Service at ${rc} and accept them at ${ix} before your account can be approved or a game deployed. You must accept them yourself in a browser; an agent cannot accept them for you.`;async function NT(e){let t=await je();if(t){await OT(t,void 0,e);return}let r;try{r=await mS()}catch(s){V("Could not reach the sign-in service.",[String(s)])}if(J())vD(r);else{K("Sign in to Gamestage"),g(" This also creates your account if you do not have one. Google or email."),g(" A new account is approved by a person, so this may end in a wait."),g(" Taking a while? Email support@monterosa.co."),g(),M("Open",r.verification_uri_complete),M("Or enter",`${r.user_code} at ${r.verification_uri}`);let s=!!process.env.GAMESTAGE_CREDENTIALS;s&&(g(),g(" Signing in to a second credential file, so this does NOT open a browser."),A("Opening it here would hand the address to the browser you are already signed in to, which approves as that account instantly and with nothing to click."),A("Copy the address above into a private window and approve it there."),A("Signing out at auth.gamestage.ai first works too.")),g(),g(" Waiting for you to confirm in the browser..."),s||gS(r.verification_uri_complete)}let o=Date.now()+r.expires_in*1e3,n=r.interval*1e3,i=null;for(;Date.now()<o;){await yD(n);let s=await fS(r.device_code);if(s.status==="ok"){i=s.session;break}if(s.status==="slow_down"){n+=5e3;continue}s.status!=="pending"&&(s.status==="expired"&&V("That code expired.",["Run `gamestage login` again."]),V("Sign-in was refused.",[s.reason]))}i||V("Timed out waiting for approval.",["Run `gamestage login` again."]);let a=await qf(i);await OT(i,a,e)}async function RT(){let e=await je();if(await vS(),J()){Q({ok:!0,status:e?"signed_out":"not_signed_in"});return}K(e?"Signed out":"Not signed in"),e&&M("Removed",e.email??"session"),g()}async function LT(){let e=await je();if(J()){Q(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){K("Not signed in"),g(),A("Inspecting, scaffolding and local rounds need no account."),A("Run `gamestage login` when you want to deploy a playground."),g();return}K("Signed in"),M("Account",e.email??"unknown"),e.userId&&M("User",e.userId),g(),A("`gamestage status` says whether this account is approved."),g()}ke();rr();import{readdir as wD,readFile as DT,stat as _D}from"node:fs/promises";Re();import{homedir as kD}from"node:os";import{join as xD}from"node:path";async function SD(e){let t=[];try{t=await wD(e)}catch{}let r=t.filter(a=>!a.startsWith(".")),o=[];for(let a of r)/\.html?$/.test(a)&&o.push(a);let n=!1,i;for(let a of["gamestage.yaml","gamestage.yml"])try{await _D(`${e}/${a}`),n=!0;try{let s=De(await DT(`${e}/${a}`,"utf8"));s.ok&&(i=!!s.manifest.backend.round)}catch{}break}catch{}return{has_manifest:n,has_package_json:r.includes("package.json"),html_files:o,is_empty:r.length===0,has_round:i}}function ED(e,t){let r=[],o="";for(let n of e.split(" "))o&&o.length+1+n.length>t?(r.push(o),o=n):o=o?`${o} ${n}`:n;return o&&r.push(o),r}async function $D(){try{return(await DT(xD(kD(),".claude","skills","gamestage","SKILL.md"),"utf8")).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1]??null}catch{return null}}async function jT(){let e=process.cwd(),t=await SD(e),r=t.has_manifest?t.has_round===!1?"round":t.has_round===!0?"play":"continue":t.has_package_json||t.html_files.length>0?"inspect":"create",o={continue:{command:re("manifest validate gamestage.yaml"),why:"This project already has an App Manifest. Check where it stands.",prompt:"Tell me where this Gamestage project stands. Run `npx gamestage manifest validate gamestage.yaml` and `npx gamestage status`, then summarise what is done and what is left before it could go live."},round:{command:"edit gamestage.yaml, add backend.round",why:`The manifest names a format but no round, so there is no game for the Engine to serve yet. The round is the content the server owns: the board a player sees and the answers they never do. Until it is there, \`${re("dev")}\` serves the contract fixture rather than your game, and \`${re("verify")}\` has nothing to verify. Both need an account, so \`${re("login")}\` comes first.`,prompt:"This project has a Gamestage manifest with no round yet. Write one into gamestage.yaml from the game's own content so `gamestage dev` can serve it locally, and keep every answer out of the page and out of anything the browser downloads. A deployed game takes its round from Studio instead, where a producer changes it without a deploy: the manifest round is for developing against, not the content you ship."},play:{command:re("dev"),why:`The manifest declares a round. Serve it locally, through the real Engine. Needs an account, so \`${re("login")}\` first if you have not.`,prompt:"Serve this Gamestage game locally with `npx gamestage dev`, open it, and make a play. Then tell me whether the Engine decided the outcome or the page did."},inspect:{command:re("inspect ."),why:"There is a game here already. Read it read-only and produce an inspection report.",prompt:"Take the game in this folder to production with Gamestage. Start with `npx gamestage inspect .`, which changes nothing, and tell me what has to move out of the page before you edit anything."},create:{command:re("create"),why:"Nothing to inspect. Start a new game from a concept.",prompt:"Build me a new game with Gamestage. Ask me which format it should be and what it is about before you scaffold anything, rather than choosing for me."}},n=await je().catch(()=>null);if(J()){Q({ok:!0,cwd:e,version:bt,detected:t,route:r,next:o[r],prompt:o[r].prompt,docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:pc(),account:{signed_in:!!n?.email,email:n?.email??null,sign_in:re("login")},authentication:n?.email?`Signed in as ${n.email}. \`${re("deploy")}\` also needs the account approved; \`${re("status")}\` says whether it is.`:`Not signed in. \`${re("inspect")}\`, \`${re("create")}\` and \`${re("manifest validate")}\` work without an account, so do that work now. \`${re("dev")}\`, \`${re("verify")}\` and \`${re("deploy")}\` refuse until \`${re("login")}\`, which creates the account too. Tell the person once, when you reach the first command that needs it.`});return}K(`Gamestage ${bt}`);let i=_i?await $D():null;if(i&&_i&&i<_i&&g(P.dim(` Your installed Gamestage skill is ${i}; the current one is ${_i}.
10509
10509
  Refresh it: `)+P.cyan("npx skills add https://gamestage.ai/skill")),g(P.dim(" Take an agent-built game to production, on the platform behind the")),g(P.dim(" world's biggest fan experiences.")),K("What this does"),g(P.dim(` Your game keeps its interface. Its answers, scoring and locks move
10510
10510
  behind an Engine the player's browser cannot reach, so nobody can read
10511
10511
  the answer out of the page or award themselves a score.`)),g(),g(` ${P.dim("A")} ${P.cyan("round")} ${P.dim("is one playable thing: a board, a question, a slate.")}`),g(` ${P.dim("Your")} ${P.cyan("manifest")} ${P.dim("is gamestage.yaml, which describes the game.")}`),g(` ${P.dim("The")} ${P.cyan("Engine")} ${P.dim("marks a play, holds the score and refuses a cheat.")}`),K("Who you are"),n?.email?(M("Signed in",n.email),g(P.dim(` ${re("status")} names your workspace and whether it is approved.`)),g(P.dim(` If that is not the account you signed up with, ${re("login")} rebinds
10512
- this machine. Stage shows the command with your workspace in it.`))):(g(` Not signed in. ${P.cyan(re("login"))} binds this machine to your account,`),g(" and creates the account if you do not have one."),g(P.dim(" Inspect, create and validate need no account, so start there.")),g(P.dim(` ${re("dev")}, ${re("verify")} and ${re("deploy")} ask you to sign in first.`))),K("Where you are"),t.has_manifest&&t.has_round===!1)g(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)g(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)g(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let a=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);g(` Found ${a.join(" and ")}. This looks like a game to inspect.`)}else g(" Nothing here yet. This looks like a fresh start.");if(K("Do this next"),g(` ${P.cyan(o[r].command)}`),g(` ${P.dim(o[r].why)}`),r==="create"||r==="inspect"){g(),g(` ${P.dim("The formats you can build today:")}`);for(let{format:a,summary:s}of PS)g(` ${P.cyan(a.padEnd(10))} ${P.dim(s)}`)}g(),g(` ${P.dim("Or paste this into Claude Code, Codex, Gemini or Cursor:")}`);for(let a of xD(o[r].prompt,74))g(` ${P.cyan(a)}`);K("Good to know"),g(P.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
10512
+ this machine. Stage shows the command with your workspace in it.`))):(g(` Not signed in. ${P.cyan(re("login"))} binds this machine to your account,`),g(" and creates the account if you do not have one."),g(P.dim(" Inspect, create and validate need no account, so start there.")),g(P.dim(` ${re("dev")}, ${re("verify")} and ${re("deploy")} ask you to sign in first.`))),K("Where you are"),t.has_manifest&&t.has_round===!1)g(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)g(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)g(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let a=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);g(` Found ${a.join(" and ")}. This looks like a game to inspect.`)}else g(" Nothing here yet. This looks like a fresh start.");if(K("Do this next"),g(` ${P.cyan(o[r].command)}`),g(` ${P.dim(o[r].why)}`),r==="create"||r==="inspect"){g(),g(` ${P.dim("The formats you can build today:")}`);for(let{format:a,summary:s}of PS)g(` ${P.cyan(a.padEnd(10))} ${P.dim(s)}`)}g(),g(` ${P.dim("Or paste this into Claude Code, Codex, Gemini or Cursor:")}`);for(let a of ED(o[r].prompt,74))g(` ${P.cyan(a)}`);K("Good to know"),g(P.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
10513
10513
  need you signed in, because they run your round through a real
10514
10514
  Engine. \`gamestage login\` creates the account if you do not have
10515
- one yet. ${B_}`)),g()}var fo=class extends Error{};function NT(e){let t=e.what.trim();if(!t)throw new fo("Say what you were trying to build.");if(t.length>2e3)throw new fo(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function RT(e){return JSON.stringify(e,null,2)}async function cl(e,t,r=2e3){if(e!==void 0&&e.trim())return e;if(t.isTTY)return e??"";let o=t[Symbol.asyncIterator](),n,i=Symbol("nothing came"),a=await Promise.race([o.next(),new Promise(d=>{n=setTimeout(()=>d(i),r)})]);if(clearTimeout(n),a===i||a.done)return o.return?.().catch(()=>{}),e??"";let s=[LT(a.value)];for(let d=await o.next();!d.done;d=await o.next())s.push(LT(d.value));let l=s.join("");return l.trim()?l:e??""}function LT(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Re();var ED=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function DT(e,t,r,o=process.stdin){let n=await cl(e,o),i;try{i=NT({what:n,closest:t.closest,cliVersion:r})}catch(l){throw l instanceof fo&&V(l.message),l}if(!t.send){if(J()){Q({sent:!1,would_send:i});return}K("This is everything that would be sent"),g(),g(RT(i)),g(),A("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),A(n===e?`Send it with ${re('suggest "..." --send')}.`:`Send it by piping the same text again, with ${re("suggest --send")}.`);return}let a;try{a=await fetch(ED,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(l){V("Could not reach Gamestage to send that.",[l instanceof Error?l.message:String(l)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that suggestion (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){Q({sent:!0,reference:s.reference??null});return}K("Sent"),s.reference&&A(`Reference ${s.reference}. Quote it if you follow up.`),A("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var go=class extends Error{};function jT(e){let t=e.what.trim();if(!t)throw new go("Say what went wrong.");if(t.length>2e3)throw new go(`That is ${t.length} characters and the limit is 2000. Send what broke and how to hit it; we will ask for the rest.`);let r=(e.game??"").trim();return{kind:"issue",what:t,game:r||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function MT(e){return JSON.stringify(e,null,2)}Re();var $D=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function UT(e,t,r,o=process.stdin){let n=await cl(e,o),i;try{i=jT({what:n,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(l){throw l instanceof go&&V(l.message),l}if(!t.send){if(J()){Q({sent:!1,would_send:i});return}K("This is everything that would be sent"),g(),g(MT(i)),g(),A("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),A(n===e?`Send it with ${re('issue "..." --send')}.`:`Send it by piping the same text again, with ${re("issue --send")}.`);return}let a;try{a=await fetch($D,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(l){V("Could not reach Gamestage to send that.",[l instanceof Error?l.message:String(l)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that report (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){Q({sent:!0,reference:s.reference??null});return}K("Reported"),s.reference&&A(`Reference ${s.reference}. Quote it if you follow up.`),A("It is in the backlog now. Somebody at Monterosa reads these.")}ke();At();Re();import{readFile as TD}from"node:fs/promises";import{resolve as AD}from"node:path";async function zT(e){let t=AD(e),r;try{r=await TD(t,"utf8")}catch{V(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){V(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=Cn.safeParse(o);if(!n.success){let i=n.error.issues[0];V(`${e} is not valid reference data.`,[i?`${i.path.join(".")||"document"}: ${i.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:r,measures:n.data.measures.map(i=>i.key)}}function ID(e){let t=Cn.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var CD={copy:"immutable copy",pointer:"reference data"};async function PD(e,t,r){let o=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});o.ok||V(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function FT(e,t){let{client:r}=await xe(),{body:o}=await zT(t),n=lc(o),i=await r.referenceUploadTarget(e,n),a=await Zx(o,async(d,p)=>{await PD(d==="copy"?i.copy:i.pointer,p,CD[d])});a.ok||V(`${t} is not valid reference data.`,[a.detail??"No detail."]);let{measures:s,counts:l}=a.summary;if(J())return Q({ok:!0,name:e,digest:n,measures:s,counts:l,key:i.pointer.key});K("Pushed"),A(`${e} is now the reference data for this workspace`);for(let d of s)A(`${d}: ${l[d].toLocaleString("en-GB")} values`);A(`Digest ${n}, kept so a round can say what it was scored on`),g(),A("A round provisioned from now on uses this. One already in play keeps"),A("the numbers it opened with, which is deliberate.")}async function GT(e,t){let{body:r,measures:o}=await zT(e),n=ID(r),i=Cn.parse(JSON.parse(r)),a={};for(let s of i.measures){let l=t.filter(d=>typeof s.values[d]!="number");l.length&&(a[s.key]=l)}if(J())return Q({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});K("Reference data");for(let s of o)A(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){g(),A("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(g(),!Object.keys(a).length){A(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,l]of Object.entries(a))A(`${s} has no value for ${l.map(d=>`"${d}"`).join(", ")}`);V("A round using those keys would be refused rather than scoring them as nothing.")}ke();At();Re();import{readFile as OD}from"node:fs/promises";import{resolve as ND}from"node:path";import{createInterface as RD}from"node:readline/promises";async function LD(e){let t;try{t=await OD(ND(e),"utf8")}catch{V(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=De(t);r.ok||V(`${e} is not a valid App Manifest.`,r.issues.map(n=>`${n.path} ${n.message}`));let o=r.ok?r.manifest.backend.round:void 0;return o||V(`${e} has no round in it.`,["There is nothing to push. A round lives under `backend.round` while a game is","still being built locally; once it is in Studio it lives there instead."]),o.archetype==="predict"&&V("A prediction's question and options are authored in Studio itself.",["They are the platform's own question and options rather than fields of ours,","which is what lets a producer reveal the answer once the world decides. There","is nothing here to write, and nothing to write it with."]),o}function DD(e){if(K("What goes into Studio"),A(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){A(e.target===void 0?"Target: left blank, so the round is built backwards from a perfect line at provisioning":`Target: ${e.target.toLocaleString()} ${e.targetLabel}`.trim());for(let t of e.slates)A(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);g(),g("No point values go with it. They stay in your reference data, where only"),g("the Engine reads them.")}else if(e.archetype==="shoot")A(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),A(`Keeper: ${e.difficulty}`),g(),g("Nothing here is an answer. The keeper is decided by the Engine at play time,"),g("from entropy it minted when the round was provisioned.");else{if(A(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")A(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)A(`${t.label}: ${t.members.join(", ")}`);g(),g("The answer goes with it, into a field Studio withholds from a fan's browser."),g("Only a producer signed into Studio can read it.")}g()}async function jD(e,t){if(t)return!0;process.stdin.isTTY||V("Refusing to overwrite Studio without being asked.",[`Nothing has changed on ${e}.`,"Re-run with `--yes` if you mean to replace whatever a producer has typed."]);let r=RD({input:process.stdin,output:process.stdout});try{return(await r.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{r.close()}}async function BT(e,t){let r=t.manifest??"gamestage.yaml",o=await LD(r),n=o.archetype==="push"?fx(o):o;if(J()||DD(n),!await jD(e,!!t.yes)){g("Nothing was written.");return}try{let{client:i}=await xe(),a=await i.seedRound(e,n);a.refused&&V("The round was not written into Studio.",[a.refused]);let s=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:{count:n.board.length,noun:"picks on the board"};Q({game:e,seeded:!0,archetype:n.archetype,parts:s.count}),J()||(K("Written"),A(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),A("A producer can change every word of it without another deploy."),A("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),g())}catch(i){Ie(i)}}var ll={orderMode:"auto",sortDirection:"desc",scoreFormat:"points",secondaryScoreEnabled:!1,showScores:!0,colourPreset:"dark",storyModeEnabled:!1,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1},dl=`
10515
+ one yet. ${B_}`)),g()}var fo=class extends Error{};function MT(e){let t=e.what.trim();if(!t)throw new fo("Say what you were trying to build.");if(t.length>2e3)throw new fo(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function UT(e){return JSON.stringify(e,null,2)}async function cl(e,t,r=2e3){if(e!==void 0&&e.trim())return e;if(t.isTTY)return e??"";let o=t[Symbol.asyncIterator](),n,i=Symbol("nothing came"),a=await Promise.race([o.next(),new Promise(d=>{n=setTimeout(()=>d(i),r)})]);if(clearTimeout(n),a===i||a.done)return o.return?.().catch(()=>{}),e??"";let s=[zT(a.value)];for(let d=await o.next();!d.done;d=await o.next())s.push(zT(d.value));let l=s.join("");return l.trim()?l:e??""}function zT(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Re();var TD=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function FT(e,t,r,o=process.stdin){let n=await cl(e,o),i;try{i=MT({what:n,closest:t.closest,cliVersion:r})}catch(l){throw l instanceof fo&&V(l.message),l}if(!t.send){if(J()){Q({sent:!1,would_send:i});return}K("This is everything that would be sent"),g(),g(UT(i)),g(),A("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),A(n===e?`Send it with ${re('suggest "..." --send')}.`:`Send it by piping the same text again, with ${re("suggest --send")}.`);return}let a;try{a=await fetch(TD,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(l){V("Could not reach Gamestage to send that.",[l instanceof Error?l.message:String(l)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that suggestion (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){Q({sent:!0,reference:s.reference??null});return}K("Sent"),s.reference&&A(`Reference ${s.reference}. Quote it if you follow up.`),A("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var go=class extends Error{};function GT(e){let t=e.what.trim();if(!t)throw new go("Say what went wrong.");if(t.length>2e3)throw new go(`That is ${t.length} characters and the limit is 2000. Send what broke and how to hit it; we will ask for the rest.`);let r=(e.game??"").trim();return{kind:"issue",what:t,game:r||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function BT(e){return JSON.stringify(e,null,2)}Re();var AD=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function WT(e,t,r,o=process.stdin){let n=await cl(e,o),i;try{i=GT({what:n,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(l){throw l instanceof go&&V(l.message),l}if(!t.send){if(J()){Q({sent:!1,would_send:i});return}K("This is everything that would be sent"),g(),g(BT(i)),g(),A("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),A(n===e?`Send it with ${re('issue "..." --send')}.`:`Send it by piping the same text again, with ${re("issue --send")}.`);return}let a;try{a=await fetch(AD,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(l){V("Could not reach Gamestage to send that.",[l instanceof Error?l.message:String(l)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that report (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){Q({sent:!0,reference:s.reference??null});return}K("Reported"),s.reference&&A(`Reference ${s.reference}. Quote it if you follow up.`),A("It is in the backlog now. Somebody at Monterosa reads these.")}ke();At();Re();import{readFile as ID}from"node:fs/promises";import{resolve as CD}from"node:path";async function KT(e){let t=CD(e),r;try{r=await ID(t,"utf8")}catch{V(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){V(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=Cn.safeParse(o);if(!n.success){let i=n.error.issues[0];V(`${e} is not valid reference data.`,[i?`${i.path.join(".")||"document"}: ${i.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:r,measures:n.data.measures.map(i=>i.key)}}function PD(e){let t=Cn.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var OD={copy:"immutable copy",pointer:"reference data"};async function ND(e,t,r){let o=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});o.ok||V(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function HT(e,t){let{client:r}=await xe(),{body:o}=await KT(t),n=lc(o),i=await r.referenceUploadTarget(e,n),a=await Zx(o,async(d,p)=>{await ND(d==="copy"?i.copy:i.pointer,p,OD[d])});a.ok||V(`${t} is not valid reference data.`,[a.detail??"No detail."]);let{measures:s,counts:l}=a.summary;if(J())return Q({ok:!0,name:e,digest:n,measures:s,counts:l,key:i.pointer.key});K("Pushed"),A(`${e} is now the reference data for this workspace`);for(let d of s)A(`${d}: ${l[d].toLocaleString("en-GB")} values`);A(`Digest ${n}, kept so a round can say what it was scored on`),g(),A("A round provisioned from now on uses this. One already in play keeps"),A("the numbers it opened with, which is deliberate.")}async function ZT(e,t){let{body:r,measures:o}=await KT(e),n=PD(r),i=Cn.parse(JSON.parse(r)),a={};for(let s of i.measures){let l=t.filter(d=>typeof s.values[d]!="number");l.length&&(a[s.key]=l)}if(J())return Q({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});K("Reference data");for(let s of o)A(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){g(),A("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(g(),!Object.keys(a).length){A(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,l]of Object.entries(a))A(`${s} has no value for ${l.map(d=>`"${d}"`).join(", ")}`);V("A round using those keys would be refused rather than scoring them as nothing.")}ke();At();Re();import{readFile as RD}from"node:fs/promises";import{resolve as LD}from"node:path";import{createInterface as DD}from"node:readline/promises";async function jD(e){let t;try{t=await RD(LD(e),"utf8")}catch{V(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=De(t);r.ok||V(`${e} is not a valid App Manifest.`,r.issues.map(n=>`${n.path} ${n.message}`));let o=r.ok?r.manifest.backend.round:void 0;return o||V(`${e} has no round in it.`,["There is nothing to push. A round lives under `backend.round` while a game is","still being built locally; once it is in Studio it lives there instead."]),o.archetype==="predict"&&V("A prediction's question and options are authored in Studio itself.",["They are the platform's own question and options rather than fields of ours,","which is what lets a producer reveal the answer once the world decides. There","is nothing here to write, and nothing to write it with."]),o}function MD(e){if(K("What goes into Studio"),A(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){A(e.target===void 0?"Target: left blank, so the round is built backwards from a perfect line at provisioning":`Target: ${e.target.toLocaleString()} ${e.targetLabel}`.trim());for(let t of e.slates)A(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);g(),g("No point values go with it. They stay in your reference data, where only"),g("the Engine reads them.")}else if(e.archetype==="shoot")A(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),A(`Keeper: ${e.difficulty}`),g(),g("Nothing here is an answer. The keeper is decided by the Engine at play time,"),g("from entropy it minted when the round was provisioned.");else{if(A(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")A(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)A(`${t.label}: ${t.members.join(", ")}`);g(),g("The answer goes with it, into a field Studio withholds from a fan's browser."),g("Only a producer signed into Studio can read it.")}g()}async function UD(e,t){if(t)return!0;process.stdin.isTTY||V("Refusing to overwrite Studio without being asked.",[`Nothing has changed on ${e}.`,"Re-run with `--yes` if you mean to replace whatever a producer has typed."]);let r=DD({input:process.stdin,output:process.stdout});try{return(await r.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{r.close()}}async function VT(e,t){let r=t.manifest??"gamestage.yaml",o=await jD(r),n=o.archetype==="push"?fx(o):o;if(J()||MD(n),!await UD(e,!!t.yes)){g("Nothing was written.");return}try{let{client:i}=await xe(),a=await i.seedRound(e,n);a.refused&&V("The round was not written into Studio.",[a.refused]);let s=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:{count:n.board.length,noun:"picks on the board"};Q({game:e,seeded:!0,archetype:n.archetype,parts:s.count}),J()||(K("Written"),A(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),A("A producer can change every word of it without another deploy."),A("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),g())}catch(i){Ie(i)}}var ll={orderMode:"auto",sortDirection:"desc",scoreFormat:"points",secondaryScoreEnabled:!1,showScores:!0,colourPreset:"dark",storyModeEnabled:!1,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1},dl=`
10516
10516
  /* Prev and Next render as bordered web buttons on a graphic nobody can
10517
10517
  click, next to "PAGE 1 OF 4". A director seeing browser chrome concludes
10518
10518
  the feed is a screen-share rather than a broadcast source. */
@@ -10544,20 +10544,20 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10544
10544
  .stat-label { font-size: calc(var(--row-h, 86px) * 0.22) !important; line-height: 1 !important; }
10545
10545
  .stat-value { font-size: calc(var(--row-h, 86px) * 0.40) !important; line-height: 1 !important; }
10546
10546
 
10547
- `,WT=`
10547
+ `,YT=`
10548
10548
  .leaderboard { border-width: 3px !important; }
10549
- `,KT=`
10549
+ `,qT=`
10550
10550
  html[data-mode="embed"], html[data-mode="embed"] body, #root {
10551
10551
  background: transparent !important;
10552
10552
  }
10553
10553
  body { padding: 0 !important; }
10554
- `,MD=213;function HT(e,t,r){return`
10554
+ `,zD=213;function JT(e,t,r){return`
10555
10555
  /* On the root rather than on .entries, so everything inherits it. The
10556
10556
  header's own numbers are sized from it too, and a custom property set on
10557
10557
  the rows cannot be read by anything above them. */
10558
10558
  #root {
10559
10559
  --rows: ${e};
10560
- --row-h: min(${t}px, calc((100vh - ${MD}px) / var(--rows)));
10560
+ --row-h: min(${t}px, calc((100vh - ${zD}px) / var(--rows)));
10561
10561
  }
10562
10562
  .entries { display: flex; flex-direction: column; min-height: 0; }
10563
10563
  .entry-row {
@@ -10576,11 +10576,11 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10576
10576
  88px score. */
10577
10577
  .entry-rank { font-size: calc(var(--row-h) * 0.44) !important; font-weight: 700 !important; }
10578
10578
  .table-header .col { font-size: ${r}px !important; }
10579
- `}var ZT=`
10579
+ `}var XT=`
10580
10580
  .leaderboard, .leaderboard *, .header-area, .header-area * {
10581
10581
  font-family: "Inter", "Helvetica Neue", Arial, "Liberation Sans", sans-serif !important;
10582
10582
  }
10583
- `,VT=`
10583
+ `,QT=`
10584
10584
  /* The face is an attribute, not a rule. \`primaryFontUrl\` and
10585
10585
  \`primaryFontFamily\` are the renderer's own mechanism and it loads the
10586
10586
  stylesheet into a real <link>, so the graphic carries a known face instead
@@ -10752,7 +10752,7 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10752
10752
  background: linear-gradient(90deg, rgba(255,107,61,0.14), rgba(255,107,61,0.05)) !important;
10753
10753
  border-color: rgba(255,107,61,0.32) !important;
10754
10754
  }
10755
- `,YT=`
10755
+ `,eA=`
10756
10756
  /* The ground goes on the element that already fills the screen.
10757
10757
  *
10758
10758
  * It was on #root, which is only as tall as its content, so a three-player
@@ -10869,7 +10869,7 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10869
10869
  font-size: 3vmin !important;
10870
10870
  line-height: 1 !important;
10871
10871
  }
10872
- `;function qT(e){return`
10872
+ `;function tA(e){return`
10873
10873
  #root {
10874
10874
  --rows: ${e.rows};
10875
10875
  --row-h: min(${e.maxRowPx}px, calc(${100-e.reserveVh}vh / var(--rows))) !important;
@@ -10880,8 +10880,8 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10880
10880
  .entry-score { font-size: calc(var(--row-cap) * ${e.score}) !important; }
10881
10881
  .entry-rank { font-size: calc(var(--row-cap) * ${e.rank}) !important; }
10882
10882
  .table-header .col { font-size: ${e.header}vmin !important; }
10883
- `}var JT={primaryFontUrl:"https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,600;0,700;1,700&display=swap",primaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif',secondaryFontUrl:"https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,600;0,700;1,700&display=swap",secondaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif'},ul="#1E4B8F";function UD(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/[ \t]+/g," ").replace(/\n\s*\n+/g,`
10884
- `).replace(/\s*([{}:;,])\s*/g,"$1").trim()}var zD=[{id:"lowerthird",summary:"A lower third over live video, for TV and streaming",madeFor:"A broadcast or stream, keyed over the picture",type:"leaderboard",attributes:{...ll,rowsPerScreen:3,embedPageSize:3,showAvatars:!1,aspectRatio:"16/9",accentColour:ul,cssOverrides:`${dl}${KT}${ZT}${HT(3,68,20)}${WT}
10883
+ `}var nA={primaryFontUrl:"https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,600;0,700;1,700&display=swap",primaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif',secondaryFontUrl:"https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,600;0,700;1,700&display=swap",secondaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif'},ul="#1E4B8F";function FD(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/[ \t]+/g," ").replace(/\n\s*\n+/g,`
10884
+ `).replace(/\s*([{}:;,])\s*/g,"$1").trim()}var GD=[{id:"lowerthird",summary:"A lower third over live video, for TV and streaming",madeFor:"A broadcast or stream, keyed over the picture",type:"leaderboard",attributes:{...ll,rowsPerScreen:3,embedPageSize:3,showAvatars:!1,aspectRatio:"16/9",accentColour:ul,cssOverrides:`${dl}${qT}${XT}${JT(3,68,20)}${YT}
10885
10885
  /* The lower third of the frame, inside the title-safe area. */
10886
10886
  #root {
10887
10887
  position: fixed;
@@ -10892,7 +10892,7 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10892
10892
  needs its own edge once this is keyed over a picture. */
10893
10893
  .leaderboard { background: rgba(0,0,0,0.78); border-radius: 6px; }
10894
10894
  .entry-name, .entry-score { text-shadow: 0 2px 6px rgba(0,0,0,0.9); }
10895
- `}},{id:"panel",summary:"A right-hand panel that pulls out over the picture, for TV and CTV",madeFor:"Connected TV and broadcast, beside the action rather than under it",type:"leaderboard",attributes:{...ll,rowsPerScreen:8,embedPageSize:8,showAvatars:!0,avatarStyle:"circle",aspectRatio:"16/9",accentColour:ul,cssOverrides:`${dl}${KT}${ZT}${HT(8,106,18)}${WT}
10895
+ `}},{id:"panel",summary:"A right-hand panel that pulls out over the picture, for TV and CTV",madeFor:"Connected TV and broadcast, beside the action rather than under it",type:"leaderboard",attributes:{...ll,rowsPerScreen:8,embedPageSize:8,showAvatars:!0,avatarStyle:"circle",aspectRatio:"16/9",accentColour:ul,cssOverrides:`${dl}${qT}${XT}${JT(8,106,18)}${YT}
10896
10896
  /* The right 30%, full height, inside the title-safe area. The picture keeps
10897
10897
  the left two thirds, which is where the action is. */
10898
10898
  #root {
@@ -10906,7 +10906,7 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10906
10906
  /* A narrow column cannot let a long name push the score off the end. */
10907
10907
  .col-name { min-width: 0; }
10908
10908
  .entry-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
10909
- `}},{id:"bigscreen",summary:"A stadium screen or a Jumbotron",madeFor:"The big screen in the ground",type:"leaderboard",attributes:{...ll,rowsPerScreen:10,embedPageSize:10,showAvatars:!1,avatarStyle:"circle",aspectRatio:"16/9",accentColour:ul,...JT,cssOverrides:`${dl}${YT}${qT({rows:10,maxRowPx:132,reserveVh:31,rankPct:9,scorePct:17,name:.4,score:.48,rank:.56,header:1.8,typeCapVmin:6.9})}${VT}
10909
+ `}},{id:"bigscreen",summary:"A stadium screen or a Jumbotron",madeFor:"The big screen in the ground",type:"leaderboard",attributes:{...ll,rowsPerScreen:10,embedPageSize:10,showAvatars:!1,avatarStyle:"circle",aspectRatio:"16/9",accentColour:ul,...nA,cssOverrides:`${dl}${eA}${tA({rows:10,maxRowPx:132,reserveVh:31,rankPct:9,scorePct:17,name:.4,score:.48,rank:.56,header:1.8,typeCapVmin:6.9})}${QT}
10910
10910
  /* Drawn for a 20m board serving a 150m bowl. The renderer's own cap is
10911
10911
  30.4px on a name, which is comfortable to about 44m and no further. That
10912
10912
  150m figure is asserted rather than measured: print a page at scale, walk
@@ -10915,7 +10915,7 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10915
10915
  No avatar: the names are Identify auto-aliases, so no photograph is ever
10916
10916
  coming, and a 56px circle carrying 12px initials sat in the strongest
10917
10917
  reading position on every row repeating the two words beside it. */
10918
- `,storyModeEnabled:!0,storySegmentSize:10,storySegmentDuration:8}},{id:"vertical",summary:"A portrait panel in a concourse",madeFor:"Digital out of home, 9:16",type:"leaderboard",attributes:{...ll,rowsPerScreen:8,embedPageSize:8,showAvatars:!1,avatarStyle:"circle",aspectRatio:"9/16",accentColour:ul,...JT,cssOverrides:`${dl}${YT}${qT({rows:8,maxRowPx:210,reserveVh:25,rankPct:11,scorePct:27,name:.25,score:.3,rank:.36,header:3.3,typeCapVmin:16.7})}${VT}
10918
+ `,storyModeEnabled:!0,storySegmentSize:10,storySegmentDuration:8}},{id:"vertical",summary:"A portrait panel in a concourse",madeFor:"Digital out of home, 9:16",type:"leaderboard",attributes:{...ll,rowsPerScreen:8,embedPageSize:8,showAvatars:!1,avatarStyle:"circle",aspectRatio:"9/16",accentColour:ul,...nA,cssOverrides:`${dl}${eA}${tA({rows:8,maxRowPx:210,reserveVh:25,rankPct:11,scorePct:27,name:.25,score:.3,rank:.36,header:3.3,typeCapVmin:16.7})}${QT}
10919
10919
  /* A concourse panel is read from a few metres rather than from a stand, and
10920
10920
  it has 1920 of height to spend on eight rows, so the row cap is taller
10921
10921
  than the big screen's while the type it carries is smaller in proportion
@@ -10932,10 +10932,10 @@ ${o}`):o+e}function OL(e,t){return xL(async(r,o)=>{let n=new URL(r.url??"/","htt
10932
10932
  eight rows and the chrome fill the panel. The min() still governs anything
10933
10933
  smaller, so a 720x1280 panel is unchanged. No backticks in here: this
10934
10934
  comment is inside a template literal and one of them ends the string. */
10935
- `}},{id:"promo",summary:"A QR code that sends a crowd to the game",madeFor:"Getting people playing, with no live data at all",type:"qr",attributes:{backgroundType:"solid",backgroundColour:"#0B0B0F",qrBackgroundColour:"#FFFFFF",qrForegroundColour:"#000000",qrUrlMode:"full",aspectRatio:"9/16"}}],Zi=zD.map(e=>{let t=e.attributes.cssOverrides;return typeof t=="string"?{...e,attributes:{...e.attributes,cssOverrides:UD(t)}}:e}),yo="bigscreen";function pl(e){return Zi.find(t=>t.id===e)}function XT(){return Zi.map(e=>e.id)}import{createServer as FD}from"node:http";import{readFile as eA}from"node:fs/promises";import{extname as GD}from"node:path";At();Re();var Dn=1e4,hl="preview",BD=[{name:"Happy Robin",primaryScore:61257},{name:"Copper Panda",primaryScore:59917},{name:"Sunny Robin",primaryScore:58582},{name:"Bo",primaryScore:58150},{name:"Wise Raven",primaryScore:56621},{name:"Marguerite Vandersteen-Whitlock",primaryScore:54903},{name:"Keen Marten",primaryScore:51044},{name:"Quiet Otter",primaryScore:49781},{name:"Quick Falcon",primaryScore:48310},{name:"Kind Puffin",primaryScore:47225},{name:"Ready Tapir",primaryScore:46980},{name:"Steady Finch",primaryScore:44117},{name:"Zesty Quokka",primaryScore:43508},{name:"Lucky Raven",primaryScore:41966},{name:"Bold Ibex",primaryScore:40402},{name:"Jo",primaryScore:39875},{name:"Silver Bison",primaryScore:38214},{name:"Calm Osprey",primaryScore:36790},{name:"Eager Lynx",primaryScore:35636},{name:"Golden Marmot",primaryScore:34401},{name:"Nimble Shrike",primaryScore:33118},{name:"Patient Heron",primaryScore:32292},{name:"Clever Stoat",primaryScore:30877},{name:"Brisk Wombat",primaryScore:29618},{name:"Gentle Kestrel",primaryScore:28044},{name:"Sharp Meerkat",primaryScore:26510},{name:"Sly Pangolin",primaryScore:24903},{name:"Warm Capybara",primaryScore:23177},{name:"Swift Ocelot",primaryScore:21440},{name:"Merry Numbat",primaryScore:19862},{name:"Proud Caracal",primaryScore:17305},{name:"Keen Wallaby",primaryScore:15288},{name:"Mild Aardvark",primaryScore:13910},{name:"Brave Echidna",primaryScore:11642},{name:"Plucky Serval",primaryScore:9033},{name:"Tidy Bandicoot",primaryScore:8766},{name:"Sunny Kinkajou",primaryScore:6120},{name:"Bright Heron",primaryScore:-3020},{name:"Rash Coati",primaryScore:-5417},{name:"Still Fox",primaryScore:-8824}];function WD(e){switch(GD(e)){case".js":return"text/javascript; charset=utf-8";case".css":return"text/css; charset=utf-8";case".html":return"text/html; charset=utf-8";case".json":return"application/json";case".woff2":return"font/woff2";case".svg":return"image/svg+xml";default:return"application/octet-stream"}}async function KD(e){let t="";try{t=await eA(e.css,"utf8")}catch{}let r=Number(e.rows)||10,o=new Date().toISOString(),n=pl(yo)?.attributes??{};return{instance:{instanceId:hl,name:"Preview",type:"leaderboard",embedSlug:hl,retracted:!1,updateInterval:5,embedUpdateInterval:5,createdAt:o,updatedAt:o,attributes:{orderMode:"auto",scoreFormat:"points",sortDirection:"desc",secondaryScoreEnabled:!1,rowsPerScreen:n.rowsPerScreen??r,storyModeEnabled:n.storyModeEnabled??!1,storySegmentSize:n.storySegmentSize??10,storySegmentDuration:n.storySegmentDuration??8,accentColour:e.accent??n.accentColour??"#FFD700",colourPreset:"dark",primaryFontUrl:n.primaryFontUrl,primaryFontFamily:n.primaryFontFamily,secondaryFontUrl:n.secondaryFontUrl,secondaryFontFamily:n.secondaryFontFamily,headerText:"Preview Game",statusText:"Live",logos:[{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><rect width="120" height="120" fill="none" stroke="#888" stroke-width="4"/><text x="60" y="66" font-family="monospace" font-size="16" fill="#888" text-anchor="middle">LOGO</text></svg>'),position:"top-right"}],embedPageSize:r,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1,templateCss:n.cssOverrides,cssOverrides:t}},entries:BD.slice(0,r).map((i,a)=>({entryId:`preview-${a}`,instanceId:hl,name:i.name,gender:"",primaryScore:i.primaryScore,rank:a+1,createdAt:o,updatedAt:o})),generatedAt:o}}async function QT(e,t){let r=new URL(t.replace(/^\/(r\/)?/,""),e.endsWith("/")?e:`${e}/`);return fetch(r,{redirect:"follow"})}async function tA(e){let t=e.renderer.replace(/\/+$/,"")+"/";if(!(await fetch(new URL("embed.html",t)).catch(()=>{}))?.ok)throw new Error(`Could not load the Live Graphics renderer from ${t}.
10936
- Pass --renderer <url> if your Space serves it somewhere else.`);let o=FD((a,s)=>{(async()=>{let l=(a.url??"/").split("?")[0]??"/";try{if(l==="/config.js"){s.writeHead(200,{"content-type":"text/javascript","cache-control":"no-store"}),s.end(`window.GFX_CONFIG = {"apiBase":""};
10937
- `);return}if(l.startsWith("/api/gfx/instances/")){let h=JSON.stringify(await KD(e));s.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),s.end(h);return}if(l==="/"||l==="/index.html"||l==="/embed.html"||l==="/bigscreen.html"){let y=await(await QT(t,"embed.html")).text();y=y.replace("<head>",'<head><script>window.GFX_CONFIG={apiBase:""}</script>'),s.writeHead(200,{"content-type":"text/html; charset=utf-8"}),s.end(y);return}let d=await QT(t,l);if(!d.ok){s.writeHead(d.status),s.end();return}let p=Buffer.from(await d.arrayBuffer());s.writeHead(200,{"content-type":WD(l)}),s.end(p)}catch(d){s.writeHead(502,{"content-type":"text/plain"}),s.end(`Could not reach the renderer: ${d instanceof Error?d.message:String(d)}
10935
+ `}},{id:"promo",summary:"A QR code that sends a crowd to the game",madeFor:"Getting people playing, with no live data at all",type:"qr",attributes:{backgroundType:"solid",backgroundColour:"#0B0B0F",qrBackgroundColour:"#FFFFFF",qrForegroundColour:"#000000",qrUrlMode:"full",aspectRatio:"9/16"}}],Zi=GD.map(e=>{let t=e.attributes.cssOverrides;return typeof t=="string"?{...e,attributes:{...e.attributes,cssOverrides:FD(t)}}:e}),yo="bigscreen";function pl(e){return Zi.find(t=>t.id===e)}function rA(){return Zi.map(e=>e.id)}import{createServer as BD}from"node:http";import{readFile as iA}from"node:fs/promises";import{extname as WD}from"node:path";At();Re();var Dn=1e4,hl="preview",KD=[{name:"Happy Robin",primaryScore:61257},{name:"Copper Panda",primaryScore:59917},{name:"Sunny Robin",primaryScore:58582},{name:"Bo",primaryScore:58150},{name:"Wise Raven",primaryScore:56621},{name:"Marguerite Vandersteen-Whitlock",primaryScore:54903},{name:"Keen Marten",primaryScore:51044},{name:"Quiet Otter",primaryScore:49781},{name:"Quick Falcon",primaryScore:48310},{name:"Kind Puffin",primaryScore:47225},{name:"Ready Tapir",primaryScore:46980},{name:"Steady Finch",primaryScore:44117},{name:"Zesty Quokka",primaryScore:43508},{name:"Lucky Raven",primaryScore:41966},{name:"Bold Ibex",primaryScore:40402},{name:"Jo",primaryScore:39875},{name:"Silver Bison",primaryScore:38214},{name:"Calm Osprey",primaryScore:36790},{name:"Eager Lynx",primaryScore:35636},{name:"Golden Marmot",primaryScore:34401},{name:"Nimble Shrike",primaryScore:33118},{name:"Patient Heron",primaryScore:32292},{name:"Clever Stoat",primaryScore:30877},{name:"Brisk Wombat",primaryScore:29618},{name:"Gentle Kestrel",primaryScore:28044},{name:"Sharp Meerkat",primaryScore:26510},{name:"Sly Pangolin",primaryScore:24903},{name:"Warm Capybara",primaryScore:23177},{name:"Swift Ocelot",primaryScore:21440},{name:"Merry Numbat",primaryScore:19862},{name:"Proud Caracal",primaryScore:17305},{name:"Keen Wallaby",primaryScore:15288},{name:"Mild Aardvark",primaryScore:13910},{name:"Brave Echidna",primaryScore:11642},{name:"Plucky Serval",primaryScore:9033},{name:"Tidy Bandicoot",primaryScore:8766},{name:"Sunny Kinkajou",primaryScore:6120},{name:"Bright Heron",primaryScore:-3020},{name:"Rash Coati",primaryScore:-5417},{name:"Still Fox",primaryScore:-8824}];function HD(e){switch(WD(e)){case".js":return"text/javascript; charset=utf-8";case".css":return"text/css; charset=utf-8";case".html":return"text/html; charset=utf-8";case".json":return"application/json";case".woff2":return"font/woff2";case".svg":return"image/svg+xml";default:return"application/octet-stream"}}async function ZD(e){let t="";try{t=await iA(e.css,"utf8")}catch{}let r=Number(e.rows)||10,o=new Date().toISOString(),n=pl(yo)?.attributes??{};return{instance:{instanceId:hl,name:"Preview",type:"leaderboard",embedSlug:hl,retracted:!1,updateInterval:5,embedUpdateInterval:5,createdAt:o,updatedAt:o,attributes:{orderMode:"auto",scoreFormat:"points",sortDirection:"desc",secondaryScoreEnabled:!1,rowsPerScreen:n.rowsPerScreen??r,storyModeEnabled:n.storyModeEnabled??!1,storySegmentSize:n.storySegmentSize??10,storySegmentDuration:n.storySegmentDuration??8,accentColour:e.accent??n.accentColour??"#FFD700",colourPreset:"dark",primaryFontUrl:n.primaryFontUrl,primaryFontFamily:n.primaryFontFamily,secondaryFontUrl:n.secondaryFontUrl,secondaryFontFamily:n.secondaryFontFamily,headerText:"Preview Game",statusText:"Live",logos:[{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><rect width="120" height="120" fill="none" stroke="#888" stroke-width="4"/><text x="60" y="66" font-family="monospace" font-size="16" fill="#888" text-anchor="middle">LOGO</text></svg>'),position:"top-right"}],embedPageSize:r,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1,templateCss:n.cssOverrides,cssOverrides:t}},entries:KD.slice(0,r).map((i,a)=>({entryId:`preview-${a}`,instanceId:hl,name:i.name,gender:"",primaryScore:i.primaryScore,rank:a+1,createdAt:o,updatedAt:o})),generatedAt:o}}async function oA(e,t){let r=new URL(t.replace(/^\/(r\/)?/,""),e.endsWith("/")?e:`${e}/`);return fetch(r,{redirect:"follow"})}async function aA(e){let t=e.renderer.replace(/\/+$/,"")+"/";if(!(await fetch(new URL("embed.html",t)).catch(()=>{}))?.ok)throw new Error(`Could not load the Live Graphics renderer from ${t}.
10936
+ Pass --renderer <url> if your Space serves it somewhere else.`);let o=BD((a,s)=>{(async()=>{let l=(a.url??"/").split("?")[0]??"/";try{if(l==="/config.js"){s.writeHead(200,{"content-type":"text/javascript","cache-control":"no-store"}),s.end(`window.GFX_CONFIG = {"apiBase":""};
10937
+ `);return}if(l.startsWith("/api/gfx/instances/")){let h=JSON.stringify(await ZD(e));s.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),s.end(h);return}if(l==="/"||l==="/index.html"||l==="/embed.html"||l==="/bigscreen.html"){let y=await(await oA(t,"embed.html")).text();y=y.replace("<head>",'<head><script>window.GFX_CONFIG={apiBase:""}</script>'),s.writeHead(200,{"content-type":"text/html; charset=utf-8"}),s.end(y);return}let d=await oA(t,l);if(!d.ok){s.writeHead(d.status),s.end();return}let p=Buffer.from(await d.arrayBuffer());s.writeHead(200,{"content-type":HD(l)}),s.end(p)}catch(d){s.writeHead(502,{"content-type":"text/plain"}),s.end(`Could not reach the renderer: ${d instanceof Error?d.message:String(d)}
10938
10938
  `)}})()});await new Promise((a,s)=>{o.once("error",s),o.listen(Number(e.port),"127.0.0.1",()=>a())});let n=o.address();if(!n||typeof n=="string")throw new Error("The local server did not report its listening address");let i=`http://127.0.0.1:${n.port}/?slug=${hl}${e.bigscreen?"&bigscreen=true":""}`;process.stdout.write(["",` Your graphic: ${i}`,` Stylesheet: ${e.css}`,` Renderer: ${t}`,""," Save the stylesheet and the page picks it up within five seconds."," This touches nothing real: no graphic is read and none is written.",""," Ctrl-C to stop.",""].join(`
10939
- `)),await new Promise(a=>{let s=()=>{process.off("SIGINT",s),process.off("SIGTERM",s),o.close(()=>a())};process.once("SIGINT",s),process.once("SIGTERM",s)})}function HD(e,t){let r=new URL(e),o=r.pathname.split("/");return o.pop(),r.pathname=[...o,t.replace(/^\.?\//,"")].join("/"),r.toString()}async function nA(e,t){let r=(o,n,i,a={},s={})=>{if(process.exitCode=1,J()){Q({ok:!1,reason:o,game:e,stylesheet:t.css,...s});return}K(n);for(let[l,d]of Object.entries(a))M(l,d);g();for(let l of i)A(l);g()};try{let o;try{o=await eA(t.css,"utf8")}catch{r("no_stylesheet","No stylesheet to publish",[`${t.css} is not there.`,"Write one, see it with `gamestage graphic dev`, then run this again."]);return}if(o.length>Dn){r("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Dn.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(o.length-Dn).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${o.length.toLocaleString()} characters`,Limit:`${Dn.toLocaleString()} characters`},{characters:o.length,limit:Dn});return}let{client:n}=await xe(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",["A producer can only point a graphic at a file that is being served.",`Run \`gamestage deploy ${i.id} --dir .\` first. It publishes ${t.css} along with everything else.`],{Game:`${i.name} (${i.id})`});return}let a=HD(i.playgroundUrl,t.css),s=!1,l=0;try{let d=await fetch(a);l=d.status,s=d.ok}catch{s=!1}if(!s){r("not_served","The stylesheet is not being served yet",[`Deploy the game and this address starts working: \`gamestage deploy ${i.id} --dir .\``,`A deploy publishes every file in the directory it is given, so ${t.css} has to be inside it.`],{"Expected at":a,Answered:l?String(l):"nothing"},{url:a,status:l,characters:o.length,limit:Dn});return}if(J()){Q({ok:!0,game:i.id,stylesheet:t.css,characters:o.length,limit:Dn,url:a});return}K("Ready for a producer"),M("Game",`${i.name} (${i.id})`),M("Stylesheet",`${t.css} (${o.length.toLocaleString()} of ${Dn.toLocaleString()} characters)`),M("Address",a),g(),A("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),A("Today they copy the stylesheet out of that address by hand. A graphic that follows the address by itself is proposed to Monterosa and not built yet, so nothing on your side changes when it lands."),g()}catch(o){Ie(o)}}function Py(e,t){let o=`${new URL(e).origin}/r/embed.html?slug=${encodeURIComponent(t.embedSlug)}`;if(t.type==="qr")return{Address:o};let n=pl(t.template)?.attributes?.rowsPerScreen,i=n?`${o}&rows=${n}`:o;return t.template==="bigscreen"?{Address:`${o}&bigscreen=true`,"Overlay form":i}:{Address:i}}function rA(e,t){return e.refused?(process.exitCode=1,J()?(Q({ok:!1,action:t,reason:e.code??"refused",message:e.refused}),!0):(K("Not done"),g(` ${e.refused}`),g(),!0)):!1}async function oA(e,t){let r=(n,i,a)=>{if(process.exitCode=1,J()){Q({ok:!1,reason:n,game:e,template:t.template});return}K(i),g();for(let s of a)A(s);g()},o=pl(t.template);if(!o){r("no_such_template",`No template called ${t.template}`,[`The templates are: ${XT().join(", ")}.`,"`gamestage graphic templates` lists what each one is cut for."]);return}if(!t.consent){r("consent_not_given","Nobody has said these names can be shown",["A leaderboard puts fans' names on a screen other people can see, and somebody has to confirm those people agreed to that.",`Run it again with --consent when that is true: \`gamestage graphic create ${e} --template ${o.id} --consent\`.`,"Your account is recorded on the graphic as the one who confirmed it."]);return}try{let{client:n}=await xe(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",[o.type==="qr"?"A QR code sends a crowd to the game, and there is nowhere to send them yet.":"A graphic follows the game's own leaderboard, and a game that has not deployed publishes none.",`Run \`gamestage deploy ${i.id} --dir .\` first.`]);return}let a=await n.composeGraphic(i.id,{template:o.id,consent:!0});if(rA(a,"graphic create"))return;let s=(a.game.graphics??[]).at(-1);if(!s){r("not_recorded","The graphic was made and not recorded",["The control plane accepted the request and the game holds no new graphic.",`Run \`gamestage graphic list ${i.id}\` before making another one.`]);return}let l=Py(i.playgroundUrl,s);if(J()){Q({ok:!0,game:i.id,graphic:s,addresses:l});return}K("On screen"),M("Game",`${i.name} (${i.id})`),M("Template",`${o.id} - ${o.summary}`),M("Made for",o.madeFor);for(let[d,p]of Object.entries(l))M(d,p);g(),A("Open that address on the screen. It is a web page and needs no sign-in."),A(o.type==="qr"?"The code points at your game's own page, so it keeps working as long as the game is deployed.":"It follows your game's leaderboard by itself and redraws as fans play. Nothing needs redeploying when a round changes."),A(`Restyle it with \`gamestage graphic dev\`, then \`gamestage graphic push ${i.id}\`.`),g()}catch(n){if(n.code==="graphics_not_configured"){r("graphics_not_configured","This deployment cannot make graphics",["The control plane has no Live Graphics key, so there is nothing to compose a graphic with.","That is a deployment setting rather than anything about your game. Tell whoever runs it."]);return}Ie(n)}}async function iA(e){try{let{client:t}=await xe(),r=await t.getGame(e);if(!r){process.exitCode=1,J()?Q({ok:!1,reason:"no_such_game",game:e}):(K("No such game"),g(),A(`Nothing in your workspace has the id ${e}.`),g());return}let o=r.graphics??[];if(J()){Q({ok:!0,game:r.id,graphics:o.map(n=>({...n,addresses:r.playgroundUrl?Py(r.playgroundUrl,n):{}}))});return}if(o.length===0){K("No graphics yet"),g(),A(`Make one with \`gamestage graphic create ${r.id} --template bigscreen --consent\`.`),g();return}K(`${o.length} graphic${o.length===1?"":"s"}`);for(let n of o){if(g(),M("Template",`${n.template} (${n.type})`),M("Id",n.instanceId),r.playgroundUrl)for(let[i,a]of Object.entries(Py(r.playgroundUrl,n)))M(i,a);M("Confirmed by",`${n.consentBy}, ${n.createdAt.slice(0,10)}`)}g(),A(`Take one down with \`gamestage graphic remove ${r.id} <id>\`.`),g()}catch(t){Ie(t)}}async function aA(e,t){try{let{client:r}=await xe(),o=await r.removeGraphic(e,t);if(rA(o,"graphic remove"))return;if(J()){Q({ok:!0,game:o.game.id,removed:t});return}K("Taken down"),M("Game",`${o.game.name} (${o.game.id})`),M("Removed",t),g(),A("The address stops answering. Anything showing it goes blank, so take the screen down first if somebody is watching."),g()}catch(r){Ie(r)}}function sA(){if(J()){Q({ok:!0,default:yo,templates:Zi.map(e=>({id:e.id,type:e.type,summary:e.summary,madeFor:e.madeFor}))});return}K("Graphic templates");for(let e of Zi)g(),M(e.id,e.id===yo?`${e.summary} (the default)`:e.summary),M("",e.madeFor);g(),A("Pick one with `gamestage graphic create <game> --template <id> --consent`."),g()}ke();Re();import{readFile as ZD}from"node:fs/promises";async function cA(e,t){let r;try{r=await ZD(e,"utf8")}catch{return V(`Cannot read ${e}`)}let o=De(r);if(!o.ok)return J()&&(Q({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),V(`${e} is not a valid App Manifest`,o.issues.map(d=>`${P.cyan(d.path)} ${d.message}`));let n=o.manifest,i=ct(n),a=null;if(t.level){let d=Sn.safeParse(t.level.toUpperCase());if(!d.success)return V(`Unknown level "${t.level}". Use L0 through L5.`);a=d.data}let s=a?J_(n,a):null,l=!i.overclaimed&&(s?.ok??!0);if(J()&&(Q({ok:l,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results}),process.exit(l?0:1)),K(`${n.app.title} ${P.dim(n.app.id)}`),M("Schema",n.manifest.schema_version),M("Revision",String(n.manifest.revision)),M("Conformance",i.overclaimed?`${P.red(i.claimed)} claimed, ${P.bold(i.computed)} evidenced`:`${P.green(i.computed)} ${i.computedName}`),i.overclaimed){K("Overclaimed"),g(P.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let d of i.blockers)A(P.red(d.requirement))}if(a&&s&&!s.ok){K(`Not yet ${a}`);for(let d of s.missing)A(`${P.yellow(d.id)} ${d.requirement}`)}if(l&&(g(),g(` ${P.green("Valid")}${a?` at ${a}`:""}.`),n.backend.round||(g(P.dim(" Structurally valid, and no round in the manifest, which is normal: a game's")),g(P.dim(" round comes from Studio. `gamestage dev` will say so too and serve a stand-in."))),i.blockers.length)){g(),g(P.dim(" Next level needs:"));for(let d of i.blockers)g(` ${P.dim("\xB7")} ${d.requirement}`)}g(),process.exit(l?0:1)}var lA={start:"none",doctor:"none",inspect:"none",create:"none","graphic dev":"none","graphic push":"approved","graphic templates":"none","graphic create":"approved","graphic list":"approved","graphic remove":"approved",client:"none",suggest:"none",issue:"none","manifest validate":"none","reference check":"none",login:"none",logout:"none",whoami:"none",verify:"session",dev:"session","admin approve":"session","admin refuse":"session","admin plan":"session",status:"approved",deploy:"approved",archive:"approved",promote:"approved",prune:"approved",plan:"approved",suspend:"approved",wake:"approved",endpoint:"approved",logs:"approved","manifest register":"approved","reference push":"approved","round push":"approved","link github":"approved"};function dA(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function uA(e,t){return e.commands.filter(r=>!r._hidden).map(r=>VD(r,t))}function VD(e,t){let r=t?`${t} ${e.name()}`:e.name(),o=!!e._actionHandler;return{name:e.name(),aliases:e.aliases(),summary:e.description(),arguments:e.registeredArguments.map(n=>({name:n.name(),required:n.required,description:n.description,...n.defaultValue===void 0?{}:{default:n.defaultValue}})),options:dA(e),...o?{account:lA[r]??"none"}:{},commands:uA(e,r)}}function pA(e,t){return{name:e.name(),version:t,summary:e.description(),options:dA(e),commands:uA(e,"")}}function hA(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Re();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var ge=new dr,YD=(()=>{let e=[...Nt];return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();ge.name("gamestage").description("Take an agent-built game prototype to a production fan game.\nInspect, create and validate need no account. `dev` and `verify` need\nyou signed in; publishing a game needs that account approved too.").version(bt).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{oS(!!e.opts().json)});ge.command("start").description("read the current directory and point at the right next step").action(OT);ge.command("doctor").description("check the local environment").action(vT);ge.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(kT);ge.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${YD}`).addOption(new pn("--archetype <format>").hideHelp()).option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).description("start a new game, choosing how it is played before scaffolding").action(OS);ge.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done (requires sign-in)").action(e=>wy({...e,noBrowser:e.browser===!1}));ge.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(aS);var mA=ge.command("manifest").description("work with the App Manifest");mA.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(sT);mA.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(cA);ge.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(eT);ge.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--notes <text>","what changed, said in the deploy announcement and the game's log").option("--no-check","skip loading the published page in a browser afterwards").option("--allow <path...>","publish a file the deploy gate suspects; it never clears a certain finding").description("publish a snapshot to a playground, and the round it puts on").action(tT);var fA=ge.command("reference").description("the private data a round is scored against");fA.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").action(FT);fA.command("check").argument("<file>","the JSON file holding it").argument("[keys...]","the keys a round uses, to check they are all present").description("what a round would fail on, before a producer finds out").action(GT);var qD=ge.command("round").description("the round a fan plays, and getting it into Studio");qD.command("push").argument("<game>","game id").option("--manifest <path>","manifest the round is read from","gamestage.yaml").option("--yes","do not ask before replacing what a producer has typed",!1).description("write your round into Studio, where a producer owns it from then on").action(BT);var vo=ge.command("graphic").description("the graphic your game puts on a screen");vo.command("dev").option("--css <path>","the stylesheet to preview","graphic.css").option("--port <port>","port to serve on","4321").option("--rows <rows>","how many rows to draw","10").option("--bigscreen","draw it as a big screen rather than an overlay",!1).option("--accent <colour>","accent colour, as #rrggbb").option("--renderer <url>","where the Live Graphics renderer is served from","https://monterosa-gamestage.spaces-dev.monterosa.cloud/r/").description("see your stylesheet on the real graphic, on your own machine").action(tA);vo.command("templates").description("the screens a graphic can be cut for").action(sA);vo.command("create").argument("<game>","game id").option("--template <id>","the screen to cut it for",yo).option("--consent","confirm the people named agreed to appear on a screen",!1).description("put this game's leaderboard on a screen").action(oA);vo.command("list").argument("<game>","game id").description("the graphics this game has, and where to watch them").action(iA);vo.command("remove").argument("<game>","game id").argument("<id>","the graphic's id, from `gamestage graphic list`").description("take a graphic off the air").action(aA);vo.command("push").argument("<game>","game id").option("--css <path>","the stylesheet to publish","graphic.css").description("hand a producer the address of your stylesheet").action(nA);ge.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(nT);ge.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(rT);ge.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(oT);ge.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(iT);ge.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>$y(e,!1));ge.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>$y(e,!0));ge.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(cT);ge.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(dT);ge.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").option("--serve","also serve this directory, so the page has somewhere to open",!1).option("--serve-port <port>","port for the page (with --serve)","4001").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(yT);ge.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("[what]","what you were trying to build, or pipe it in").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>DT(e,t,bt));ge.command("issue").description("report something that went wrong (no account needed)").argument("[what]","what went wrong, or pipe it in").option("--game <id>","the game it happened on, if it was about one").option("--send","actually send it, having seen what it says",!1).action((e,t)=>UT(e,t,bt));ge.command("login").description("sign in, or create an account (needed before dev, verify or deploy)").option("--workspace <id>","the workspace you expect to land in, from the welcome screen").action(e=>AT(e.workspace));var JD=ge.command("link").description("connect an account Gamestage needs (requires sign-in)");JD.command("github").description("link your GitHub account, which a first deploy requires").action($T);var Oy=ge.command("admin").description("approve, refuse or set the plan of a creator's account (operators only)");Oy.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>Ey(e,"approved"));Oy.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>Ey(e,"refused"));Oy.command("plan").argument("<workspace>","workspace id").argument("<plan>","runtime (Starter), live (Publisher) or enterprise").option("--live-games <count>","live-game ceiling instead of the plan's own; 0 is none").description("move this account onto a plan, including a paid one").action((e,t,r)=>aT(e,t,r));ge.command("logout").description("forget the stored session").action(IT);ge.command("whoami").description("show who the CLI is signed in as").action(CT);hA(process.argv)&&(process.stdout.write(`${JSON.stringify(pA(ge,bt),null,2)}
10939
+ `)),await new Promise(a=>{let s=()=>{process.off("SIGINT",s),process.off("SIGTERM",s),o.close(()=>a())};process.once("SIGINT",s),process.once("SIGTERM",s)})}function VD(e,t){let r=new URL(e),o=r.pathname.split("/");return o.pop(),r.pathname=[...o,t.replace(/^\.?\//,"")].join("/"),r.toString()}async function sA(e,t){let r=(o,n,i,a={},s={})=>{if(process.exitCode=1,J()){Q({ok:!1,reason:o,game:e,stylesheet:t.css,...s});return}K(n);for(let[l,d]of Object.entries(a))M(l,d);g();for(let l of i)A(l);g()};try{let o;try{o=await iA(t.css,"utf8")}catch{r("no_stylesheet","No stylesheet to publish",[`${t.css} is not there.`,"Write one, see it with `gamestage graphic dev`, then run this again."]);return}if(o.length>Dn){r("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Dn.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(o.length-Dn).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${o.length.toLocaleString()} characters`,Limit:`${Dn.toLocaleString()} characters`},{characters:o.length,limit:Dn});return}let{client:n}=await xe(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",["A producer can only point a graphic at a file that is being served.",`Run \`gamestage deploy ${i.id} --dir .\` first. It publishes ${t.css} along with everything else.`],{Game:`${i.name} (${i.id})`});return}let a=VD(i.playgroundUrl,t.css),s=!1,l=0;try{let d=await fetch(a);l=d.status,s=d.ok}catch{s=!1}if(!s){r("not_served","The stylesheet is not being served yet",[`Deploy the game and this address starts working: \`gamestage deploy ${i.id} --dir .\``,`A deploy publishes every file in the directory it is given, so ${t.css} has to be inside it.`],{"Expected at":a,Answered:l?String(l):"nothing"},{url:a,status:l,characters:o.length,limit:Dn});return}if(J()){Q({ok:!0,game:i.id,stylesheet:t.css,characters:o.length,limit:Dn,url:a});return}K("Ready for a producer"),M("Game",`${i.name} (${i.id})`),M("Stylesheet",`${t.css} (${o.length.toLocaleString()} of ${Dn.toLocaleString()} characters)`),M("Address",a),g(),A("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),A("Today they copy the stylesheet out of that address by hand. A graphic that follows the address by itself is proposed to Monterosa and not built yet, so nothing on your side changes when it lands."),g()}catch(o){Ie(o)}}function Py(e,t){let o=`${new URL(e).origin}/r/embed.html?slug=${encodeURIComponent(t.embedSlug)}`;if(t.type==="qr")return{Address:o};let n=pl(t.template)?.attributes?.rowsPerScreen,i=n?`${o}&rows=${n}`:o;return t.template==="bigscreen"?{Address:`${o}&bigscreen=true`,"Overlay form":i}:{Address:i}}function cA(e,t){return e.refused?(process.exitCode=1,J()?(Q({ok:!1,action:t,reason:e.code??"refused",message:e.refused}),!0):(K("Not done"),g(` ${e.refused}`),g(),!0)):!1}async function lA(e,t){let r=(n,i,a)=>{if(process.exitCode=1,J()){Q({ok:!1,reason:n,game:e,template:t.template});return}K(i),g();for(let s of a)A(s);g()},o=pl(t.template);if(!o){r("no_such_template",`No template called ${t.template}`,[`The templates are: ${rA().join(", ")}.`,"`gamestage graphic templates` lists what each one is cut for."]);return}if(!t.consent){r("consent_not_given","Nobody has said these names can be shown",["A leaderboard puts fans' names on a screen other people can see, and somebody has to confirm those people agreed to that.",`Run it again with --consent when that is true: \`gamestage graphic create ${e} --template ${o.id} --consent\`.`,"Your account is recorded on the graphic as the one who confirmed it."]);return}try{let{client:n}=await xe(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",[o.type==="qr"?"A QR code sends a crowd to the game, and there is nowhere to send them yet.":"A graphic follows the game's own leaderboard, and a game that has not deployed publishes none.",`Run \`gamestage deploy ${i.id} --dir .\` first.`]);return}let a=await n.composeGraphic(i.id,{template:o.id,consent:!0});if(cA(a,"graphic create"))return;let s=(a.game.graphics??[]).at(-1);if(!s){r("not_recorded","The graphic was made and not recorded",["The control plane accepted the request and the game holds no new graphic.",`Run \`gamestage graphic list ${i.id}\` before making another one.`]);return}let l=Py(i.playgroundUrl,s);if(J()){Q({ok:!0,game:i.id,graphic:s,addresses:l});return}K("On screen"),M("Game",`${i.name} (${i.id})`),M("Template",`${o.id} - ${o.summary}`),M("Made for",o.madeFor);for(let[d,p]of Object.entries(l))M(d,p);g(),A("Open that address on the screen. It is a web page and needs no sign-in."),A(o.type==="qr"?"The code points at your game's own page, so it keeps working as long as the game is deployed.":"It follows your game's leaderboard by itself and redraws as fans play. Nothing needs redeploying when a round changes."),A(`Restyle it with \`gamestage graphic dev\`, then \`gamestage graphic push ${i.id}\`.`),g()}catch(n){if(n.code==="graphics_not_configured"){r("graphics_not_configured","This deployment cannot make graphics",["The control plane has no Live Graphics key, so there is nothing to compose a graphic with.","That is a deployment setting rather than anything about your game. Tell whoever runs it."]);return}Ie(n)}}async function dA(e){try{let{client:t}=await xe(),r=await t.getGame(e);if(!r){process.exitCode=1,J()?Q({ok:!1,reason:"no_such_game",game:e}):(K("No such game"),g(),A(`Nothing in your workspace has the id ${e}.`),g());return}let o=r.graphics??[];if(J()){Q({ok:!0,game:r.id,graphics:o.map(n=>({...n,addresses:r.playgroundUrl?Py(r.playgroundUrl,n):{}}))});return}if(o.length===0){K("No graphics yet"),g(),A(`Make one with \`gamestage graphic create ${r.id} --template bigscreen --consent\`.`),g();return}K(`${o.length} graphic${o.length===1?"":"s"}`);for(let n of o){if(g(),M("Template",`${n.template} (${n.type})`),M("Id",n.instanceId),r.playgroundUrl)for(let[i,a]of Object.entries(Py(r.playgroundUrl,n)))M(i,a);M("Confirmed by",`${n.consentBy}, ${n.createdAt.slice(0,10)}`)}g(),A(`Take one down with \`gamestage graphic remove ${r.id} <id>\`.`),g()}catch(t){Ie(t)}}async function uA(e,t){try{let{client:r}=await xe(),o=await r.removeGraphic(e,t);if(cA(o,"graphic remove"))return;if(J()){Q({ok:!0,game:o.game.id,removed:t});return}K("Taken down"),M("Game",`${o.game.name} (${o.game.id})`),M("Removed",t),g(),A("The address stops answering. Anything showing it goes blank, so take the screen down first if somebody is watching."),g()}catch(r){Ie(r)}}function pA(){if(J()){Q({ok:!0,default:yo,templates:Zi.map(e=>({id:e.id,type:e.type,summary:e.summary,madeFor:e.madeFor}))});return}K("Graphic templates");for(let e of Zi)g(),M(e.id,e.id===yo?`${e.summary} (the default)`:e.summary),M("",e.madeFor);g(),A("Pick one with `gamestage graphic create <game> --template <id> --consent`."),g()}ke();Re();import{readFile as YD}from"node:fs/promises";async function hA(e,t){let r;try{r=await YD(e,"utf8")}catch{return V(`Cannot read ${e}`)}let o=De(r);if(!o.ok)return J()&&(Q({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),V(`${e} is not a valid App Manifest`,o.issues.map(d=>`${P.cyan(d.path)} ${d.message}`));let n=o.manifest,i=ct(n),a=null;if(t.level){let d=Sn.safeParse(t.level.toUpperCase());if(!d.success)return V(`Unknown level "${t.level}". Use L0 through L5.`);a=d.data}let s=a?J_(n,a):null,l=!i.overclaimed&&(s?.ok??!0);if(J()&&(Q({ok:l,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results}),process.exit(l?0:1)),K(`${n.app.title} ${P.dim(n.app.id)}`),M("Schema",n.manifest.schema_version),M("Revision",String(n.manifest.revision)),M("Conformance",i.overclaimed?`${P.red(i.claimed)} claimed, ${P.bold(i.computed)} evidenced`:`${P.green(i.computed)} ${i.computedName}`),i.overclaimed){K("Overclaimed"),g(P.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let d of i.blockers)A(P.red(d.requirement))}if(a&&s&&!s.ok){K(`Not yet ${a}`);for(let d of s.missing)A(`${P.yellow(d.id)} ${d.requirement}`)}if(l&&(g(),g(` ${P.green("Valid")}${a?` at ${a}`:""}.`),n.backend.round||(g(P.dim(" Structurally valid, and no round in the manifest, which is normal: a game's")),g(P.dim(" round comes from Studio. `gamestage dev` will say so too and serve a stand-in."))),i.blockers.length)){g(),g(P.dim(" Next level needs:"));for(let d of i.blockers)g(` ${P.dim("\xB7")} ${d.requirement}`)}g(),process.exit(l?0:1)}var mA={start:"none",doctor:"none",inspect:"none",create:"none","graphic dev":"none","graphic push":"approved","graphic templates":"none","graphic create":"approved","graphic list":"approved","graphic remove":"approved",client:"none",suggest:"none",issue:"none","manifest validate":"none","reference check":"none",login:"none",logout:"none",whoami:"none",verify:"session",dev:"session","admin approve":"session","admin refuse":"session","admin plan":"session",status:"approved",deploy:"approved",archive:"approved",promote:"approved",prune:"approved",plan:"approved",suspend:"approved",wake:"approved",endpoint:"approved",logs:"approved","manifest register":"approved","reference push":"approved","round push":"approved","link github":"approved"};function fA(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function gA(e,t){return e.commands.filter(r=>!r._hidden).map(r=>qD(r,t))}function qD(e,t){let r=t?`${t} ${e.name()}`:e.name(),o=!!e._actionHandler;return{name:e.name(),aliases:e.aliases(),summary:e.description(),arguments:e.registeredArguments.map(n=>({name:n.name(),required:n.required,description:n.description,...n.defaultValue===void 0?{}:{default:n.defaultValue}})),options:fA(e),...o?{account:mA[r]??"none"}:{},commands:gA(e,r)}}function yA(e,t){return{name:e.name(),version:t,summary:e.description(),options:fA(e),commands:gA(e,"")}}function vA(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Re();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var ge=new ur,JD=(()=>{let e=[...Nt];return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();ge.name("gamestage").description("Take an agent-built game prototype to a production fan game.\nInspect, create and validate need no account. `dev` and `verify` need\nyou signed in; publishing a game needs that account approved too.").version(bt).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{oS(!!e.opts().json)});ge.command("start").description("read the current directory and point at the right next step").action(jT);ge.command("doctor").description("check the local environment").action(xT);ge.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(TT);ge.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${JD}`).addOption(new pn("--archetype <format>").hideHelp()).option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).description("start a new game, choosing how it is played before scaffolding").action(OS);ge.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done (requires sign-in)").action(e=>wy({...e,noBrowser:e.browser===!1}));ge.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(aS);var bA=ge.command("manifest").description("work with the App Manifest");bA.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(sT);bA.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(hA);ge.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(eT);ge.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--notes <text>","what changed, said in the deploy announcement and the game's log").option("--no-check","skip loading the published page in a browser afterwards").option("--allow <path...>","publish a file the deploy gate suspects; it never clears a certain finding").description("publish a snapshot to a playground, and the round it puts on").action(tT);var wA=ge.command("reference").description("the private data a round is scored against");wA.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").action(HT);wA.command("check").argument("<file>","the JSON file holding it").argument("[keys...]","the keys a round uses, to check they are all present").description("what a round would fail on, before a producer finds out").action(ZT);var XD=ge.command("round").description("the round a fan plays, and getting it into Studio");XD.command("push").argument("<game>","game id").option("--manifest <path>","manifest the round is read from","gamestage.yaml").option("--yes","do not ask before replacing what a producer has typed",!1).description("write your round into Studio, where a producer owns it from then on").action(VT);var vo=ge.command("graphic").description("the graphic your game puts on a screen");vo.command("dev").option("--css <path>","the stylesheet to preview","graphic.css").option("--port <port>","port to serve on","4321").option("--rows <rows>","how many rows to draw","10").option("--bigscreen","draw it as a big screen rather than an overlay",!1).option("--accent <colour>","accent colour, as #rrggbb").option("--renderer <url>","where the Live Graphics renderer is served from","https://monterosa-gamestage.spaces-dev.monterosa.cloud/r/").description("see your stylesheet on the real graphic, on your own machine").action(aA);vo.command("templates").description("the screens a graphic can be cut for").action(pA);vo.command("create").argument("<game>","game id").option("--template <id>","the screen to cut it for",yo).option("--consent","confirm the people named agreed to appear on a screen",!1).description("put this game's leaderboard on a screen").action(lA);vo.command("list").argument("<game>","game id").description("the graphics this game has, and where to watch them").action(dA);vo.command("remove").argument("<game>","game id").argument("<id>","the graphic's id, from `gamestage graphic list`").description("take a graphic off the air").action(uA);vo.command("push").argument("<game>","game id").option("--css <path>","the stylesheet to publish","graphic.css").description("hand a producer the address of your stylesheet").action(sA);ge.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(nT);ge.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(rT);ge.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(oT);ge.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(iT);ge.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>$y(e,!1));ge.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>$y(e,!0));ge.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(cT);ge.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(dT);ge.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").option("--serve","also serve this directory, so the page has somewhere to open",!1).option("--serve-port <port>","port for the page (with --serve)","4001").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(kT);ge.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("[what]","what you were trying to build, or pipe it in").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>FT(e,t,bt));ge.command("issue").description("report something that went wrong (no account needed)").argument("[what]","what went wrong, or pipe it in").option("--game <id>","the game it happened on, if it was about one").option("--send","actually send it, having seen what it says",!1).action((e,t)=>WT(e,t,bt));ge.command("login").description("sign in, or create an account (needed before dev, verify or deploy)").option("--workspace <id>","the workspace you expect to land in, from the welcome screen").action(e=>NT(e.workspace));var QD=ge.command("link").description("connect an account Gamestage needs (requires sign-in)");QD.command("github").description("link your GitHub account, which a first deploy requires").action(PT);var Oy=ge.command("admin").description("approve, refuse or set the plan of a creator's account (operators only)");Oy.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>Ey(e,"approved"));Oy.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>Ey(e,"refused"));Oy.command("plan").argument("<workspace>","workspace id").argument("<plan>","runtime (Starter), live (Publisher) or enterprise").option("--live-games <count>","live-game ceiling instead of the plan's own; 0 is none").description("move this account onto a plan, including a paid one").action((e,t,r)=>aT(e,t,r));ge.command("logout").description("forget the stored session").action(RT);ge.command("whoami").description("show who the CLI is signed in as").action(LT);vA(process.argv)&&(process.stdout.write(`${JSON.stringify(yA(ge,bt),null,2)}
10940
10940
  `),process.exit(0));ge.parseAsync(process.argv).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
10941
10941
  `),process.exit(1)});