@orkestralai/codesignflo 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY.md +9 -0
- package/dist/main.js +292 -0
- package/package.json +31 -4
- package/skills/codesignflo-deliver/SKILL.md +70 -0
- package/skills/codesignflo-status/SKILL.md +23 -0
- package/skills/codesignflo-sync/SKILL.md +36 -0
- package/skills/codesignflo-verify/SKILL.md +22 -0
- package/README.md +0 -3
package/dist/main.js
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __cdlRequire } from 'node:module';
|
|
3
|
+
const require = __cdlRequire(import.meta.url);
|
|
4
|
+
var HM=Object.create;var af=Object.defineProperty;var WM=Object.getOwnPropertyDescriptor;var KM=Object.getOwnPropertyNames;var GM=Object.getPrototypeOf,JM=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(t&&(e=t(t=0)),e);var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jr=(t,e)=>{for(var r in e)af(t,r,{get:e[r],enumerable:!0})},sf=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of KM(e))!JM.call(t,n)&&n!==r&&af(t,n,{get:()=>e[n],enumerable:!(i=WM(e,n))||i.enumerable});return t},D=(t,e,r)=>(sf(t,e,"default"),r&&sf(r,e,"default")),xo=(t,e,r)=>(r=t!=null?HM(GM(t)):{},sf(e||!t||!t.__esModule?af(r,"default",{value:t,enumerable:!0}):r,t)),Xr=t=>sf(af({},"__esModule",{value:!0}),t);function eE(t,e=524288){let r=JSON.stringify(t);if(r.length<=e)return[r];let i=`c${Date.now().toString(36)}${(XM++).toString(36)}`,n=Math.ceil(r.length/e),o=[];for(let s=0;s<n;s++){let a={t:"chunk",cid:i,seq:s,total:n,data:r.slice(s*e,(s+1)*e)};o.push(JSON.stringify(a))}return o}function tE(t,e){let r=o=>o.split(".").map(s=>Number.parseInt(s,10)||0),[i,n]=[r(t),r(e)];for(let o=0;o<3;o++)if((i[o]??0)!==(n[o]??0))return(i[o]??0)>(n[o]??0);return!0}var XM,cf,Qy=w(()=>{"use strict";XM=0;cf=class{pending=new Map;push(e){let r=JSON.parse(e);if(r.t!=="chunk")return r;let i=this.pending.get(r.cid);return i||(i={parts:new Array(r.total),received:0},this.pending.set(r.cid,i)),i.parts[r.seq]===void 0&&i.received++,i.parts[r.seq]=r.data,i.received<r.total?null:(this.pending.delete(r.cid),JSON.parse(i.parts.join("")))}}});import{readFileSync as YM}from"node:fs";function QM(){try{let t=JSON.parse(YM(new URL("../package.json",import.meta.url),"utf8"));if(t.version&&t.name?.includes("codesignflo"))return t.version}catch{}return"0.0.0"}var lf,ev=w(()=>{"use strict";lf=QM()});function oE(t){if(!t||t==="none")return[];let e=[];for(let r of f4(t)){let i=/rgba?\(([^)]+)\)/.exec(r),n=r.replace(/rgba?\([^)]+\)/,"").trim(),o=/\binset\b/.test(n),s=n.replace(/\binset\b/,"").trim().split(/\s+/).filter(Boolean).map(p=>parseFloat(p));if(s.length<2||s.some(Number.isNaN))continue;let[a=0,c=0,l=0,u=0]=s,d=(i?.[1]??"0, 0, 0").split(/[\s,/]+/).filter(Boolean).map(Number);e.push({type:o?"INNER_SHADOW":"DROP_SHADOW",color:{r:(d[0]??0)/255,g:(d[1]??0)/255,b:(d[2]??0)/255,a:d[3]??1},offset:{x:a,y:c},radius:l,spread:u,visible:!0,blendMode:"NORMAL"})}return e.reverse()}var f4,sE=w(()=>{"use strict";f4=t=>t.split(/,(?![^(]*\))/).map(e=>e.trim())});function Di(t){let e=new Map,r=(i,n)=>{if("$value"in i)return void e.set(n.join("-"),n.join("/"));for(let o of Object.keys(i).filter(s=>!s.startsWith("$")))r(i[o],[...n,o])};return r(t,[]),e}function h4(t,e=[]){let r=new Map,i=o=>o.split("/").slice(2).join("/"),n=(o,s)=>{s(o);for(let a of o.children??[])n(a,s)};for(let o of[...t,...e])n(o,s=>{if(s.type!=="TEXT")return;let a=r.get(i(s.k))??new Set;a.add(String(s.props.characters)),r.set(i(s.k),a)});for(let o of t)n(o,s=>{s.type==="TEXT"&&(r.get(i(s.k))?.size??0)>1&&(s.data=!0)})}function av(t,e,r){return m4(aE(t,e,r).sets())}function m4(t){let e=new Map;for(let s of t){let a=new Set,c=l=>{l.instance&&a.add(l.instance.mainK.split("/")[0]);for(let u of l.children??[])c(u)};c(s),a.delete(s.k),e.set(s.k,a)}let r=[],i=new Set,n=new Set,o=s=>{if(!i.has(s.k)){if(n.has(s.k))throw new Error(`components use each other in a cycle: ${[...n,s.k].join(" \u2192 ")}`);n.add(s.k);for(let a of e.get(s.k)??[]){let c=t.find(l=>l.k===a);c&&o(c)}n.delete(s.k),i.add(s.k),r.push(s)}};for(let s of t)o(s);return r}function cv(t,e,r){let i=aE(t,e,r);return Object.entries(t.screens??{}).map(([n,o])=>{let s=typeof o=="string"?o:o.story,a=e.get(s);if(!a)throw new Error(`no IR for screen story ${s}`);let c=i.node(sv(a.root),`screen:${n}`,null,!0,"FRAME");c.name=n;let l=0,u=0,d={},p=[],f=m=>1+(m.children??[]).reduce((g,y)=>g+f(y),0),h=(m,g)=>{if(m.component&&i.placed(m)){let y=f(m);l+=y,u+=y,d[m.component.module]=(d[m.component.module]??0)+1;return}l++,m.type==="FRAME"&&g&&p.push(g);for(let y of m.children??[])h(y,g?`${g}/${y.name}`:y.name)};return h(a.root,""),{spec:c,coverage:{nodes:l,inInstances:u,instances:d,unmapped:p}}})}function sv(t){let e=n=>({w:n.w==="fill"?"fixed":n.w,h:n.h==="fill"?"fixed":n.h}),r=n=>n.type==="TEXT"&&!n.text?.maxLines&&n.height<(n.text?.lineHeight||n.height)*1.5,i=(n,o)=>{let s=n.layout?.direction,a=s==="HORIZONTAL"?"w":s==="VERTICAL"?"h":null,c=s==="HORIZONTAL"?"h":s==="VERTICAL"?"w":null,l=g=>r(g)&&g.sizing.w==="fill"&&(o.w==="hug"||s==="VERTICAL"&&!g.text?.align);n.children&&(n={...n,children:n.children.map(g=>l(g)?{...g,sizing:{...g.sizing,w:"hug"}}:g)}),n.layout?.wrap&&c&&n.children&&(n={...n,children:n.children.map(g=>g.sizing[c]==="fill"?{...g,sizing:{...g.sizing,[c]:"fixed"}}:g)});let u=(g,y)=>y==="w"?g.width:g.height,d=g=>{let y=n.layout?.padding,v=n.stroke?n.stroke.sides??[n.stroke.width,n.stroke.width,n.stroke.width,n.stroke.width]:[0,0,0,0],b=x=>(y?.[x]?.value??0)+(v[x]??0);return g==="w"?n.width-b(1)-b(3):n.height-b(0)-b(2)},p=(g,y)=>!g.absolute&&g.sizing[y]==="fill"&&u(g,y)>1&&u(g,y)<d(y)-1;c&&!n.layout?.wrap&&n.children&&(n={...n,children:n.children.map(g=>p(g,c)?{...g,sizing:{...g.sizing,[c]:g.type==="TEXT"&&c==="h"?"hug":"fixed"}}:g)});let f=(n.children??[]).filter(g=>(g.type!=="TEXT"||g.width>0)&&!g.absolute),h={...o};c&&h[c]==="hug"&&f.some(g=>g.sizing[c]==="fill")&&Math.max(0,...f.filter(y=>y.sizing[c]!=="fill").map(y=>u(y,c)))<d(c)-1&&(h[c]="fixed");let m=(n.children??[]).map(g=>{let y={...g.sizing};if(a&&h[a]==="hug"&&y[a]==="fill"&&(y[a]="fixed"),s==="GRID")for(let v of["w","h"])h[v]==="hug"&&y[v]==="fill"&&(y[v]=g.type==="TEXT"&&v==="h"?"hug":"fixed");return i(g,y)});return{...n,sizing:h,...n.children?{children:m}:{}}};return i(t,e(t.sizing))}function aE(t,e,r){let i=u=>u?.token?r.get(u.token):void 0,n=new Map(Object.entries(t.components).map(([u,d])=>[d.module,{key:u,...d}])),o=new Set;for(let[u,d]of Object.entries(t.components))for(let[p,f]of Object.entries(d.examples??{})){let h=d.stories[f],m=e.get(f)?.root,g=e.get(p)?.root;if(!h||!m||!g)continue;let y=(v,b,x)=>{if(!(!v||!b)){v.type==="TEXT"&&b.type==="TEXT"&&v.sizing.w==="hug"&&b.height>v.height+2&&o.add(x);for(let[k,E]of ov(v.children))y(k,iv(b,E),`${x}/${E}`)}};y(m,g,`${u}/${Io(h)}`)}let s=u=>{let d=u.component&&n.get(u.component.module);if(!d)return;let p=new Set(u.component.classes),f=new Set(Object.keys(d.stories).flatMap(q=>e.get(q)?.root.component?.classes??[]));if(f.size&&!u.component.classes.some(q=>f.has(q)))return;let h=(q,Re="")=>[`${Re}${q.name}:${q.sizing.w}`,...(q.children??[]).flatMap(de=>h(de,`${Re}${q.name}/`))],m=new Set(h(u)),g=q=>[...q.module?[q.module]:[],...(q.children??[]).flatMap(g)],y=[...new Set(g(u))].filter(q=>!n.has(q)),v=null;for(let[q,Re]of Object.entries(d.stories)){let de=new Set(g(e.get(q).root));if(y.some(De=>!de.has(De)))continue;let pt=new Set(h(e.get(q).root)),Zt=[...m].filter(De=>pt.has(De)).length/new Set([...m,...pt]).size,Y=Object.values(Re).filter(De=>p.has(De)).length+Zt;(!v||Y>v.score+1e-9)&&(v={props:Re,score:Y,story:q})}if(!v)return;let b=e.get(v.story)?.root,x=[],k=q=>q.reduce((Re,de)=>iv(Re,de),b);if(b&&u.fill?.value!==b.fill?.value&&u.fill){let q=i(u.fill);x.push({path:[],fill:u.fill.value,...q?{fillToken:q}:{}})}let E=q=>q?.layout&&q.layout.direction!=="GRID"?{paddingTop:q.layout.padding[0].value,paddingRight:q.layout.padding[1].value,paddingBottom:q.layout.padding[2].value,paddingLeft:q.layout.padding[3].value,itemSpacing:q.layout.gap.value,cornerRadius:q.radius?.value??0}:void 0,O=(q,Re)=>{let[de,pt]=[E(q),E(Re)];if(!de||!pt)return;let Zt=Object.fromEntries(Object.entries(de).filter(([Y,De])=>Math.abs(De-pt[Y])>.01));return Object.keys(Zt).length?Zt:void 0},X=O(u,b);X&&x.push({path:[],layout:X});let le=(q,Re,de,pt)=>{if(q.type==="TEXT"&&q.text){let Zt=[...Re,de],Y={path:Zt,at:pt,characters:q.text.characters},De=k(Zt);if(De?.text&&De.text.color.value!==q.text.color.value){Y.fill=q.text.color.value;let Lt=i(q.text.color);Lt&&(Y.fillToken=Lt)}x.push(Y)}else if(q!==u&&q.type==="FRAME"){let Zt=[...Re,de],Y=O(q,k(Zt));Y&&x.push({path:Zt,at:pt,layout:Y})}for(let[Zt,[Y,De]]of ov(q.children).entries())le(Y,q===u?[]:[...Re,de],De,[...pt,Zt])};le(u,[],u.name,[]);let $e=q=>q.path.reduce((Re,de,pt)=>iv(Re,de)??(q.at?.[pt]!==void 0?Re?.children?.[q.at[pt]]:void 0),b);if(!(b&&x.some(q=>q.path.length&&(!$e(q)||q.characters!==void 0&&$e(q).type!=="TEXT"))))return{mainK:`${d.key}/${Io(v.props)}`,overrides:x}},a=(u,d,p,f,h="COMPONENT")=>({...c(u,d,p,f,h),...u.width>0&&u.height>0?{measured:{w:Math.round(u.width),h:Math.round(u.height),...u.at?{x:Math.round(u.at.x),y:Math.round(u.at.y)}:{}}}:{}}),c=(u,d,p,f,h="COMPONENT")=>{let m={},g={},y={};u.rotation&&(m.rotation=-u.rotation),u.absolute&&(p&&(m.layoutPositioning="ABSOLUTE"),m.x=u.absolute.x,m.y=u.absolute.y);let v=Y=>f&&Y==="fill"?"FIXED":Y==="fill"?"FILL":Y==="hug"?"HUG":"FIXED";p&&(m.layoutSizingHorizontal=v(u.sizing.w),m.layoutSizingVertical=v(u.sizing.h));let b=u.sizing.w==="fixed"||f&&u.sizing.w==="fill",x=u.sizing.h==="fixed"||f&&u.sizing.h==="fill";if(b&&(m.width=u.width),x&&(m.height=u.height),u.spaceToken&&r.get(u.spaceToken)&&(g[x?"height":"width"]=r.get(u.spaceToken)),u.type==="TEXT"&&u.text&&o.has(d)&&(p&&(m.layoutSizingHorizontal="FILL"),delete m.width,u={...u,sizing:{...u.sizing,w:"fill"}}),u.type==="TEXT"&&u.text){let Y=u.text;m.characters=Y.characters,m.fontName={family:Y.fontFamily,style:p4[Y.fontWeight.value]??"Regular"},m.fontSize=Y.fontSize.value,m.lineHeight=Y.lineHeight>0?{unit:"PIXELS",value:Y.lineHeight}:{unit:"AUTO"},m.letterSpacing={unit:"PIXELS",value:Y.letterSpacing},m.fills=[Y.color.value],m.textAutoResize=u.sizing.w==="hug"?"WIDTH_AND_HEIGHT":"HEIGHT",Y.align&&(m.textAlignHorizontal=Y.align),Y.case&&(m.textCase=Y.case),Y.maxLines&&(m.textTruncation="ENDING",m.maxLines=Y.maxLines);let De=i(Y.color);De&&(y.fills=De);let Lt=i(Y.fontSize);return Lt&&(g.fontSize=Lt),{k:d,type:"TEXT",name:u.name,props:m,...Object.keys(g).length?{bind:g}:{},...Object.keys(y).length?{paintBind:y}:{}}}if(u.type==="IMAGE")return m.fills=[u.image?.ref?`image:${u.image.ref}`:u.fill?.value??"#e0e7ff"],(!p||u.sizing.w==="fixed")&&(m.width=u.width),(!p||u.sizing.h==="fixed")&&(m.height=u.height),{k:d,type:"RECTANGLE",name:u.name,props:m};if(u.type==="SVG")return{k:d,type:"SVG",name:u.name,props:{width:u.width,height:u.height,...p?{layoutSizingHorizontal:"FIXED",layoutSizingVertical:"FIXED"}:{},...m.rotation!==void 0?{rotation:m.rotation}:{}},svg:u.svg};let k=f?void 0:s(u);if(k){let Y=Ht=>u.sizing[Ht]==="fill"&&!!p,De={...p?{layoutSizingHorizontal:Y("w")?"FILL":"FIXED",layoutSizingVertical:Y("h")?"FILL":"FIXED"}:{},...Y("w")?{}:{width:u.width},...Y("h")?{}:{height:u.height}},Lt=Object.fromEntries(["rotation","layoutPositioning","x","y"].filter(Ht=>m[Ht]!==void 0).map(Ht=>[Ht,m[Ht]]));return{k:d,type:"INSTANCE",name:u.name,props:{...Lt,...De},instance:k}}let E=u.layout,O=!b&&u.sizing.w!=="fill";if(m.layoutMode=E.direction,[m.paddingTop,m.paddingRight,m.paddingBottom,m.paddingLeft]=E.padding.map(Y=>Y.value),E.direction==="GRID"){m.gridColumnCount=E.columns;let Y=u.width-E.padding[1].value-E.padding[3].value,De=!!E.columnSizes&&E.columnSizes.reduce((Mn,Fn)=>Mn+Fn,0)+E.gap.value*(E.columns-1)<Y-1;E.columnSizes&&E.columnSizes.length===E.columns&&(De||new Set(E.columnSizes).size>1)&&(m.gridColumnSizes=E.columnSizes.map(Mn=>O||De?{type:"FIXED",value:Mn}:{type:"FLEX",value:Math.round(Mn)})),m.gridRowCount=E.rows,m.gridColumnGap=E.gap.value,m.gridRowGap=E.rowGap?.value??E.gap.value;let Lt=i(E.gap);Lt&&(g.gridColumnGap=Lt);let Ht=i(E.rowGap);Ht&&(g.gridRowGap=Ht)}else{if(m.itemSpacing=E.gap.value,E.wrap){m.layoutWrap="WRAP",m.counterAxisSpacing=E.rowGap?.value??E.gap.value;let Y=i(E.rowGap);Y&&(g.counterAxisSpacing=Y)}m.primaryAxisAlignItems=E.justify,m.counterAxisAlignItems=E.align==="STRETCH"||E.align==="BASELINE"&&E.direction==="VERTICAL"?"MIN":E.align}let X=!b&&u.sizing.w!=="fill",le=!x;E.direction!=="GRID"&&(m.primaryAxisSizingMode=(E.direction==="HORIZONTAL"?X:le)?"AUTO":"FIXED",m.counterAxisSizingMode=(E.direction==="HORIZONTAL"?le:X)?"AUTO":"FIXED"),m.fills=[...u.fill?[u.fill.value]:[],...u.gradient?[`gradient:${JSON.stringify({angle:u.gradient.angle,stops:u.gradient.stops.map(Y=>[Y.color.value,Y.position])})}`]:[]],u.stroke?(m.strokes=[u.stroke.color.value],u.stroke.sides?[m.strokeTopWeight,m.strokeRightWeight,m.strokeBottomWeight,m.strokeLeftWeight]=u.stroke.sides:m.strokeWeight=u.stroke.width,m.strokeAlign="INSIDE",u.stroke.dash&&(m.dashPattern=u.stroke.dash)):m.strokes=[],m.strokesIncludedInLayout=!!u.stroke,m.cornerRadius=u.radius?.value??0,m.opacity=u.opacity??1,m.clipsContent=!!u.clip,m.effects=oE(u.shadow),m.effects.some(Y=>Y.spread>0)&&!(u.children??[]).some(Y=>Y.absolute)&&(m.clipsContent=!0);let $e=E.direction==="GRID"?void 0:i(E.gap);$e&&(g.itemSpacing=$e),["paddingTop","paddingRight","paddingBottom","paddingLeft"].forEach((Y,De)=>{let Lt=i(E.padding[De]);Lt&&(g[Y]=Lt)});let q=i(u.radius);if(q)for(let Y of["topLeftRadius","topRightRadius","bottomLeftRadius","bottomRightRadius"])g[Y]=q;let Re=i(u.fill);Re&&(y.fills=Re);let de=u.stroke&&i(u.stroke.color);de&&(y.strokes=de);let pt=new Map,Zt=(u.children??[]).map(Y=>{let De=pt.get(Y.name)??0;return pt.set(Y.name,De+1),a(Y,`${d}/${Y.name}${De?`#${De}`:""}`,E,!1)});return{k:d,type:f?h:"FRAME",name:u.name,props:m,...Object.keys(g).length?{bind:g}:{},...Object.keys(y).length?{paintBind:y}:{},...Zt.length?{children:Zt}:{}}};return{node:a,sets:()=>Object.entries(t.components).map(([u,d])=>{let p=Object.entries(d.stories).map(([h,m])=>{let g=e.get(h);if(!g)throw new Error(`no IR for story ${h}`);let y=Io(m);return{...a(sv(g.root),`${u}/${y}`,null,!0),name:y}}).sort((h,m)=>h.name<m.name?-1:1),f=Object.entries(d.examples??{}).flatMap(([h,m])=>{let g=e.get(h),y=d.stories[m];return g&&y?[a(sv(g.root),`${u}/${Io(y)}`,null,!0)]:[]});return h4(p,f),{k:u,type:"COMPONENT_SET",name:u,props:{layoutMode:"HORIZONTAL",layoutWrap:"WRAP",itemSpacing:24,counterAxisSpacing:24,paddingTop:24,paddingRight:24,paddingBottom:24,paddingLeft:24,primaryAxisSizingMode:"FIXED",counterAxisSizingMode:"AUTO",width:Math.max(1e3,...p.map(h=>Math.ceil(h.measured?.w??0)+48))},children:p}}),placed:u=>!!s(u)}}function Dc(t,e,r=0){let i=t.children?{children:t.children.map(d=>Dc(d,e,r))}:{};if(t.type!=="INSTANCE"||!t.instance||r>8)return{...t,...i};let n=e.get(t.instance.mainK);if(!n)return t;let o=(d,p)=>({...d,k:p,...d.children?{children:d.children.map(f=>o(f,p+f.k.slice(d.k.length)))}:{}}),s=o(JSON.parse(JSON.stringify(n)),t.k),a=(t.measured?.x??0)-(n.measured?.x??0),c=(t.measured?.y??0)-(n.measured?.y??0),l=d=>{d.measured?.x!==void 0&&d.measured.y!==void 0&&(d.measured={...d.measured,x:d.measured.x+a,y:d.measured.y+c});for(let p of d.children??[])l(p)};t.measured?.x!==void 0&&l(s),s.type="FRAME",s.name=t.name;for(let d of["layoutSizingHorizontal","layoutSizingVertical","width","height","layoutPositioning","x","y"])t.props[d]!==void 0&&(s.props[d]=t.props[d]);t.props.layoutSizingHorizontal==="FILL"&&delete s.props.width,t.props.layoutSizingVertical==="FILL"&&delete s.props.height,t.measured&&(s.measured=t.measured);let u=d=>d.path.reduce((p,f,h)=>p?.children?.find(m=>m.k===`${p.k}/${f}`)??(d.at?.[h]!==void 0?p?.children?.[d.at[h]]:void 0),s);for(let d of t.instance.overrides){let p=u(d);if(p){d.characters!==void 0&&p.type==="TEXT"&&(p.props.characters=d.characters),d.fill!==void 0&&(p.props.fills=[d.fill],p.paintBind={...p.paintBind??{}},d.fillToken?p.paintBind.fills=d.fillToken:delete p.paintBind.fills);for(let[f,h]of Object.entries(d.layout??{}))p.props[f]=h,p.bind&&delete p.bind[f]}}return{...t,inlined:Dc(s,e,r+1)}}var ov,iv,p4,Io,lv=w(()=>{"use strict";sE();ov=(t=[])=>{let e=new Map;return t.map(r=>{let i=e.get(r.name)??0;return e.set(r.name,i+1),[r,`${r.name}${i?`#${i}`:""}`]})},iv=(t,e)=>t&&ov(t.children).find(([,r])=>r===e)?.[0],p4={400:"Regular",500:"Medium",600:"Semi Bold",700:"Bold"};Io=t=>Object.keys(t).sort().map(e=>`${e}=${String(t[e]??"").replace(/[=,]/g," ").trim()||"default"}`).join(", ")});function uv(t,e){let r=t.width??0,i=t.height??0;if(r<e*.9||i<=0||i>60||(t.y??0)>1)return!1;let n=(t.children??[]).filter(o=>(o.width??99)<=20&&Math.abs((o.width??0)-(o.height??0))<1);return n.length===3&&(t.children??[]).length<=4&&new Set(n.map(o=>Math.round(o.width??0))).size===1}function cE(t){let e=[],r=t.width??0;for(let i of t.children??[])if(uv(i,r))e.push(i);else for(let n of i.children??[])uv(n,r)&&e.push(n);return e}function fv(t){let e=new Set(cE(t));if(!e.size)return t;let r=i=>({...i,...e.has(i)?{presentation:"the browser window the design is framed in: not app UI, don't build it"}:{},...i.children?{children:i.children.map(r)}:{}});return r(t)}var dv,pv=w(()=>{"use strict";dv=t=>uv({...t,y:0},t.width??0)});function pi(t,e=0){let r=3735928559^e,i=1103547991^e;for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);r=Math.imul(r^o,2654435761),i=Math.imul(i^o,1597334677)}return r=Math.imul(r^r>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),(4294967296*(2097151&i)+(r>>>0)).toString(16).padStart(14,"0")}var ff=w(()=>{"use strict"});function Yr(t,e){let r=i=>{if(Array.isArray(i))return i.map(r);if(i&&typeof i=="object"){let n={};for(let o of Object.keys(i).sort())!e?.(o)&&i[o]!==void 0&&(n[o]=r(i[o]));return n}return i};return JSON.stringify(r(t))??"undefined"}var pf,Lc=w(()=>{"use strict";pf=(t,e)=>Yr(t)===Yr(e)});function hv(t){let e=new Map,r=n=>{let o=n.id;for(let s=2;e.has(o);s++)o=`${n.id}#dup${s}`;return e.set(o,{...n,id:o}),o},i=(n,o,s,a,c,l,u=[])=>{let d;o===null?d="ROOT":l&&n.type==="COMPONENT"?d=g4(n):typeof n.k=="string"?d=`${s}|${n.k}`:d=`${s}|~${o}/${String(n.name)}`;let p=o===null?String(n.name):`${a} / ${String(n.name)}`;d=r({id:d,node:n,parent:o,path:p,index:c,at:u});let f=n.type==="INSTANCE"||l&&n.type==="COMPONENT"?d:s;for(let[h,m]of(n.children??[]).entries())i(m,d,f,p,h,o===null&&n.type==="COMPONENT_SET",[...u,h])};return i(t,null,"ROOT","",0,!1),e}function mE(t){return new Map([...hv(t)].filter(([,e])=>typeof e.node.k=="string").map(([e,r])=>[e,r.node.k]))}function _4(t){let e=/italic/i.test(t),r=t.replace(/italic/i,"").toLowerCase().replace(/[\s_-]/g,""),i=v4.find(n=>n.toLowerCase().replace(/\s/g,"")===r)??(r?t.replace(/italic/i,"").trim():"Regular");return e?`${i==="Regular"?"":`${i} `}Italic`:i}function lE(t,e){let r={...t};if(delete r.children,delete r.k,delete r.dataText,delete r.pin,r.fontName&&typeof r.fontName=="object"){let d=r.fontName;r.fontName={family:d.family,style:_4(d.style??"Regular")}}delete r.locked,delete r.layoutGrids,delete r.guides,Array.isArray(r.segments)&&r.segments.length<=1&&delete r.segments;let i=d=>d==="HUG"||d==="FILL",n=r.textAutoResize,o=r.layout?.mode,s=r.primaryAxisSizingMode==="AUTO",a=r.counterAxisSizingMode==="AUTO",c=o==="HORIZONTAL"&&s||o==="VERTICAL"&&a,l=o==="VERTICAL"&&s||o==="HORIZONTAL"&&a;if((i(r.layoutSizingHorizontal)||c||n==="WIDTH_AND_HEIGHT"||e&&r.type==="COMPONENT_SET")&&delete r.width,(i(r.layoutSizingVertical)||l||n==="WIDTH_AND_HEIGHT"||n==="HEIGHT"||e&&r.type==="COMPONENT_SET")&&delete r.height,r.componentPropertyDefinitions){let d=r.componentPropertyDefinitions;r.componentPropertyDefinitions=Object.fromEntries(Object.entries(d).filter(([,p])=>p.type!=="VARIANT"))}delete r.overriddenFields;let u=r.layout;if(u){delete r.layout;for(let[d,p]of Object.entries(u))hf.includes(d)||(r[`layout.${d}`]=p);hf.some(d=>d in u)&&(r.padding=hf.map(d=>u[d]??0))}return r.cornerRadii&&(r.cornerRadius=r.cornerRadii,delete r.cornerRadii),r}function k4(t,e,r,i={}){let n=lE(t.node,r),o=lE(e.node,r),s=new Set(["boundVariables",...i.ignore??[]]),a=new Map;for(let p of new Set([...Object.keys(n),...Object.keys(o)]))s.has(p)||uE(n[p],o[p])||a.set(p,{from:n[p],to:o[p],token:dE(n[p])||dE(o[p])});let c=n.boundVariables??{},l=o.boundVariables??{},u=new Map;for(let p of new Set([...Object.keys(c),...Object.keys(l)])){if(uE(c[p],l[p]))continue;let f=b4(p),h=u.get(f)??{from:{},to:{}};h.from[p]=c[p]??null,h.to[p]=l[p]??null,u.set(f,h)}for(let[p,f]of u){let h=a.get(p)??{from:n[p],to:o[p],token:!0};a.set(p,{...h,token:!0,fromBound:f.from,toBound:f.to})}I4(a),x4(a);let d=!!t.node.dataText||!!e.node.dataText;return[...a].map(([p,f])=>({id:Li(e.id,p),kind:f.token?"token":d&&p==="characters"?"data":$4(p),op:"change",target:e.id,path:e.path,prop:p,from:f.from,to:f.to,...f.fromBound?{fromBound:f.fromBound,toBound:f.toBound}:{},match:e.id.includes("|~")?"unkeyed":e.id.startsWith("V[")&&!e.id.includes("|")?"variant":"key"}))}function x4(t){let e=S4.filter(o=>t.has(o));if(e.length<2)return;let r={},i={},n=!1;for(let o of e){let s=t.get(o);s.from!==void 0&&(r[o]=s.from),s.to!==void 0&&(i[o]=s.to),n||=s.token,t.delete(o)}t.set("size",{from:r,to:i,token:n})}function I4(t){let e=t.get("padding");if(!e)return;let r=h=>Array.isArray(h)&&h.length===4&&h.every(m=>typeof m=="number")?h:null,i=r(e.from),n=r(e.to);if(!i||!n)return;let[o,s,a,c]=i,[l,u,d,p]=n,f=(h,m)=>{let g=t.get(h);g&&typeof g.from=="number"&&typeof g.to=="number"&&Math.abs(g.to-g.from-m)<.01&&t.delete(h)};f("height",l+d-(o+a)),f("width",p+u-(c+s))}function E4(t,e){let r=Array.from({length:t.length+1},()=>new Array(e.length+1).fill(0));for(let n=t.length-1;n>=0;n--)for(let o=e.length-1;o>=0;o--)r[n][o]=t[n]===e[o]?r[n+1][o+1]+1:Math.max(r[n+1][o],r[n][o+1]);let i=new Set;for(let n=0,o=0;n<t.length&&o<e.length;)t[n]===e[o]?(i.add(t[n]),n++,o++):r[n+1][o]>=r[n][o+1]?n++:o++;return i}function qn(t,e,r={}){let i=hv(t),n=hv(e),o=[],s=new Set,a=new Set,c=(u,d)=>[...u.values()].filter(p=>O4(u,p.id,d));for(let u of n.values()){if(!u.id.startsWith("V[")||u.id.includes("|")||i.has(u.id))continue;let d=[...i.values()].find(f=>f.id.startsWith("V[")&&!f.id.includes("|")&&f.node.k===u.node.k),p=d?qn(pE(d.node),pE(u.node),{ignoreRootName:!0}).filter(f=>f.prop!=="variantProperties"):void 0;o.push({id:Li("variant+",u.id),kind:"variant",op:"add",target:u.id,path:u.path,to:u.node.variantProperties,from:d?d.node.variantProperties:void 0,match:"variant",details:p}),s.add(u.id);for(let f of c(n,u.id))s.add(f.id)}for(let u of i.values())if(!(!u.id.startsWith("V[")||u.id.includes("|")||n.has(u.id))){o.push({id:Li("variant-",u.id),kind:"variant",op:"remove",target:u.id,path:u.path,from:u.node.variantProperties,match:"variant"}),a.add(u.id);for(let d of c(i,u.id))a.add(d.id)}let l=new Set;for(let u of n.values()){if(i.has(u.id)||s.has(u.id)||u.parent&&!i.has(u.parent))continue;let d=(u.node.children??[]).length>0&&[...n.values()].filter(p=>p.parent===u.id&&i.has(p.id));d&&d.length>0?(l.add(u.id),o.push({id:Li("wrap",u.id),kind:"structure",op:"wrap",target:u.id,path:u.path,to:d.map(p=>p.path),match:"unkeyed"})):o.push({id:Li("add",u.id),kind:"structure",op:"add",target:u.id,path:u.path,to:hE(u.node),match:"unkeyed"})}for(let u of i.values())n.has(u.id)||a.has(u.id)||u.parent&&!n.has(u.parent)||o.push({id:Li("remove",u.id),kind:"structure",op:"remove",target:u.id,path:u.path,from:hE(u.node),match:"key"});for(let u of n.values()){let d=i.get(u.id);if(!d)continue;let p=u.id==="ROOT";o.push(...k4(d,u,p,{ignore:p&&r.ignoreRootName?["name"]:[]})),!p&&d.parent!==u.parent&&!(u.parent&&l.has(u.parent))&&o.push({id:Li("move",u.id),kind:"structure",op:"move",target:u.id,path:u.path,from:i.get(d.parent)?.path,to:n.get(u.parent)?.path,match:"key"})}for(let u of new Set([...n.values()].map(d=>d.parent).filter(d=>!!d&&i.has(d)))){let d=m=>[...m.values()].filter(g=>g.parent===u).sort((g,y)=>g.index-y.index).map(g=>g.id).filter(g=>i.get(g)?.parent===u&&n.get(g)?.parent===u),p=d(i),f=d(n),h=E4(p,f);for(let m of f.filter(g=>!h.has(g)))o.push({id:Li("reorder",m),kind:"structure",op:"reorder",target:m,path:n.get(m).path,from:p.indexOf(m),to:f.indexOf(m),match:"key"})}return r.pins===!1?o:o.filter(u=>!fE(i,u)&&!fE(n,u))}function fE(t,e){for(let r=t.get(e.target);r;r=r.parent?t.get(r.parent):void 0){let i=T4(r.node);if(i.includes("*")||r.id===e.target&&e.prop&&i.includes(e.prop))return!0}return!1}function O4(t,e,r){for(let i=t.get(e)?.parent;i;i=t.get(i)?.parent)if(i===r)return!0;return!1}function pE(t){return{...t,type:"FRAME_ROOT"}}var g4,hf,y4,v4,b4,w4,$4,uE,Li,S4,dE,T4,hE,mv=w(()=>{"use strict";ff();Lc();g4=t=>{let e=t.variantProperties??{};return`V[${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join(",")}]`};hf=["paddingTop","paddingRight","paddingBottom","paddingLeft"],y4=["topLeftRadius","topRightRadius","bottomLeftRadius","bottomRightRadius"],v4=["Thin","Extra Light","Light","Regular","Medium","Semi Bold","Bold","Extra Bold","Black"];b4=t=>hf.includes(t)?"padding":y4.includes(t)?"cornerRadius":t==="itemSpacing"?"layout.itemSpacing":t,w4={size:"layout",padding:"layout",width:"layout",height:"layout",x:"layout",y:"layout",layoutSizingHorizontal:"layout",layoutSizingVertical:"layout",layoutGrow:"layout",layoutAlign:"layout",layoutPositioning:"layout",minWidth:"layout",maxWidth:"layout",minHeight:"layout",maxHeight:"layout",constraints:"layout",primaryAxisSizingMode:"layout",counterAxisSizingMode:"layout",fills:"style",strokes:"style",strokeWeight:"style",strokeAlign:"style",effects:"style",cornerRadius:"style",opacity:"style",visible:"style",blendMode:"style",clipsContent:"style",rotation:"style",fontName:"typography",fontSize:"typography",lineHeight:"typography",letterSpacing:"typography",textCase:"typography",textDecoration:"typography",textAlignHorizontal:"typography",textAlignVertical:"typography",textAutoResize:"typography",segments:"typography",characters:"content",name:"name",componentPropertyDefinitions:"prop",componentPropertyReferences:"prop",componentProperties:"instance",mainComponent:"instance",overriddenFields:"instance"},$4=t=>t.startsWith("layout.")?"layout":w4[t]??"other",uE=pf,Li=(...t)=>pi(JSON.stringify(t)).slice(0,10);S4=["width","height","layoutSizingHorizontal","layoutSizingVertical","primaryAxisSizingMode","counterAxisSizingMode","layoutAlign","layoutGrow"];dE=t=>JSON.stringify(t??null).includes('"var(');T4=t=>Array.isArray(t.pin)?t.pin:[];hE=t=>({type:t.type,name:t.name,...t.characters?{characters:t.characters}:{}})});function _v(t,e){let r=t.split("/").slice(1).map(i=>i.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()).filter(Boolean);return(e&&r[0]!=="color"?["color",...r]:r).join("/")}function Ds(t,e){return JSON.parse(JSON.stringify(t),(r,i)=>{let n=typeof i=="string"?/^var\(([^/)]+)\/(.+)\)$/.exec(i):null;if(!n||n[1]===Ns)return i;for(let o of[!0,!1]){let s=_v(`${n[1]}/${n[2]}`,o);if(e.has(s))return`var(${Ns}/${s})`}return i})}function P4(t){let e=[],r=t.toBound??{},i=Array.isArray(t.to)?t.to:[t.to];return JSON.stringify(r,(n,o)=>{let s=typeof o=="string"?/^var\(([^/)]+)\/(.+)\)$/.exec(o):null;if(s&&s[1]!==Ns){let a=i.find(l=>typeof l=="object"&&l&&"color"in l),c=a?.color?`#${gv(a.color.r)}${gv(a.color.g)}${gv(a.color.b)}`:JSON.stringify(t.to);e.push({variable:`${s[1]}/${s[2]}`,value:c,token:_v(`${s[1]}/${s[2]}`,!!a?.color)})}return o}),e}function yE(t){let[,...e]=t.split("|");return e.map(r=>r.split("/").slice(2).join("/")).filter(Boolean).join(" > ")||"(root)"}function gE(t,e,r,i){if(t==="padding"&&Array.isArray(e)&&e.length===4){let o=["paddingTop","paddingRight","paddingBottom","paddingLeft"],s=d=>{let p=i?.[o[d]],f=Array.isArray(p)?p[0]:p;return typeof f=="string"&&f.startsWith("var(")?yv(f):`${e[d]}px`},[a,c,l,u]=[0,1,2,3].map(s);return a===c&&c===l&&l===u?a:a===l&&c===u?`${a} ${c}`:c===u?`${a} ${c} ${l}`:`${a} ${c} ${l} ${u}`}let n=o=>JSON.stringify(o).match(/var\([^)]+\)/g)?.map(yv)??[];if(i){let o=[...new Set(n(i))];if(o.length)return o.join(" ")}if(e==null)return"(none)";if(t==="fills"||t==="strokes"){let o=[...new Set(n(e))];return o.length?o.join(" "):Yr(e.map(s=>s.color))}if(t==="fontName"){let o=e.style,s={Regular:400,Medium:500,"Semi Bold":600,Bold:700}[o]??400,a=r.get(s);return`font-weight ${s}${a?` (var(--${a}))`:""}`}return Yr(e)}function R4(t){if(t.kind!=="token"||!t.fromBound||t.toBound&&JSON.stringify(t.toBound).includes("var("))return!1;let r=i=>Yr(i,n=>n==="boundVariables");return r(t.from)===r(t.to)}function mf(t,e,r){let i=new Map,n=(s,a)=>{if("$value"in s){a[0]==="font"&&a[1]==="weight"&&i.set(Number(s.$value),a.join("-"));return}for(let c of Object.keys(s).filter(l=>!l.startsWith("$")))n(s[c],[...a,c])};n(e,[]);let o=new Map;for(let s of t){if(R4(s))continue;let a=yE(s.target),c=s.prop??s.op??"?",l=gE(c,s.from,i,s.fromBound),u=gE(c,s.to,i,s.toBound),d=JSON.stringify([a,c,l,u]),p=o.get(d)??{layer:a,prop:c,kind:s.kind,from:l,to:u,variants:[],items:[]};p.variants.push(A4(s.target)),p.items.push(s.id);for(let f of P4(s))p.foreign?.some(h=>h.variable===f.variable)||(p.foreign=[...p.foreign??[],f]);o.set(d,p)}return[...o.values()].sort((s,a)=>s.layer+s.prop<a.layer+a.prop?-1:1).map((s,a)=>({...s,id:`C${a+1}`,variants:s.variants.length===r.length?"all":s.variants.sort()}))}var vv,Ns,gv,A4,yv,Uc=w(()=>{"use strict";Lc();vv=t=>`${t.layer}|${t.prop}${Array.isArray(t.variants)?`|${[...t.variants].sort().join(";")}`:""}`,Ns="Tokens";gv=t=>Math.round(t*255).toString(16).padStart(2,"0");A4=t=>/^V\[([^\]]*)\]/.exec(t)?.[1]??"",yv=t=>t.replace(/var\((?:[^/)]+\/)?([^)]+)\)/g,(e,r)=>`var(--${r.replace(/\//g,"-")})`)});var A={};Jr(A,{BIGINT_FORMAT_RANGES:()=>Vc,CONSTANT_CATCH:()=>bf,Class:()=>$v,NUMBER_FORMAT_RANGES:()=>qc,aborted:()=>pr,allowsEval:()=>xv,assert:()=>D4,assertEqual:()=>j4,assertIs:()=>C4,assertNever:()=>N4,assertNotEqual:()=>z4,assignProp:()=>Gt,attachSchema:()=>_f,base64ToUint8Array:()=>OE,base64urlToUint8Array:()=>G4,cached:()=>Fs,captureStackTrace:()=>yf,cleanEnum:()=>K4,cleanRegex:()=>mi,clone:()=>Be,cloneDef:()=>M4,codePointLength:()=>Oo,constantCatch:()=>Av,createTransparentProxy:()=>H4,defineLazy:()=>kv,defineLazyInternal:()=>xe,derived:()=>Q4,esc:()=>fr,escapeRegex:()=>tn,explicitlyAborted:()=>Tv,extend:()=>kE,finalizeIssue:()=>Ir,floatSafeRemainder:()=>Fc,getElementAtPath:()=>F4,getEnumValues:()=>Us,getLengthableOrigin:()=>Hc,getParsedType:()=>B4,getSizableOrigin:()=>Bc,hexToUint8Array:()=>X4,hide:()=>Wc,installLazyProp:()=>Pv,isObject:()=>To,isPlainObject:()=>en,issue:()=>Vs,joinValues:()=>I,jsonStringifyReplacer:()=>Ms,members:()=>Ov,merge:()=>IE,mergeDefs:()=>Qr,normalizeParams:()=>M,nullish:()=>gf,numKeys:()=>V4,objectClone:()=>L4,omit:()=>$E,optionalKeys:()=>Ev,own:()=>Vn,parsedType:()=>j,partial:()=>EE,pick:()=>wE,prefixIssues:()=>xr,primitiveTypes:()=>Iv,promiseAllObject:()=>Z4,propertyKeyTypes:()=>Zc,randomString:()=>q4,rawShape:()=>Zs,required:()=>TE,safeExtend:()=>xE,shallowClone:()=>qs,slugify:()=>Sv,stringifyPrimitive:()=>R,toZod:()=>Mc,uint8ArrayToBase64:()=>PE,uint8ArrayToBase64url:()=>J4,uint8ArrayToHex:()=>Y4,unwrapMessage:()=>Ls});function j4(t){return t}function z4(t){return t}function Mc(){return t=>t}function C4(t){}function N4(t){throw new Error("Unexpected value in exhaustive check")}function D4(t){}function Us(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function I(t,e="|"){return t.map(r=>R(r)).join(e)}function Ms(t,e){return typeof e=="bigint"?e.toString():e}function Fs(t){return new wv(t)}function gf(t){return t==null}function mi(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Fc(t,e){let r=t/e,i=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}function kv(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==vE)return i===void 0&&(i=vE,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function L4(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Gt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Zs(t){let e=Object.getOwnPropertyDescriptor(t,"shape");return e?.get?e.get.raw:e?.value}function hi(t){return Zs(t._zod.def)??t._zod.def.shape}function _E(t,e,r){Object.defineProperty(t,e,{get(){let i=r();return Gt(this,e,i),i},enumerable:!0,configurable:!0})}function bE(t,e,r){e in t?Gt(t,e,r):t[e]=r}function Eo(t,e,r,i){let n=hi(e);for(let o of r){let s=Object.getOwnPropertyDescriptor(n,o);s.enumerable&&(s.get?_E(t,o,()=>{let a=e._zod.def.shape[o];return i?i(a,o):a}):bE(t,o,i?i(s.value,o):s.value))}}function U4(t,e){for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);i.enumerable&&(i.get?_E(t,r,()=>e[r]):bE(t,r,i.value))}}function Qr(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function M4(t){return Qr(t._zod.def)}function F4(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function Z4(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function q4(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function fr(t){return JSON.stringify(t)}function Sv(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function To(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function en(t){if(To(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(To(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function qs(t){return en(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function V4(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function tn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Be(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function M(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function H4(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function R(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Ev(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}function wE(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Eo(o,t,vf(t,e)),Be(t,Qr(r,{shape:o,checks:[]}))}function vf(t,e){let r=hi(t),i=[];for(let n of Reflect.ownKeys(e)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);e[n]&&i.push(n)}return i}function $E(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(vf(t,e)),s={};return Eo(s,t,Reflect.ownKeys(hi(t)).filter(a=>!o.has(a))),Be(t,Qr(r,{shape:s,checks:[]}))}function kE(t,e){if(!en(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let n=hi(t);for(let o of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Be(t,Qr(t._zod.def,{shape:SE(t,e)}))}function SE(t,e){let r={};return Eo(r,t,Reflect.ownKeys(hi(t))),U4(r,e),r}function xE(t,e){if(!en(e))throw new Error("Invalid input to safeExtend: expected a plain object");return Be(t,Qr(t._zod.def,{shape:SE(t,e)}))}function IE(t,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Eo(r,t,Reflect.ownKeys(hi(t))),Eo(r,e,Reflect.ownKeys(hi(e)));let i=Qr(t._zod.def,{shape:r,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Be(t,i)}function EE(t,e,r,i="partial"){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=r?new Set(vf(e,r)):void 0,c={};return Eo(c,e,Reflect.ownKeys(hi(e)),t&&((l,u)=>a&&!a.has(u)?l:new t({type:"optional",innerType:l}))),Be(e,Qr(e._zod.def,{shape:c,checks:[]}))}function TE(t,e,r){let i=r?new Set(vf(e,r)):void 0,n={};return Eo(n,e,Reflect.ownKeys(hi(e)),(o,s)=>i&&!i.has(s)?o:new t({type:"nonoptional",innerType:o})),Be(e,Qr(e._zod.def,{shape:n}))}function pr(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Tv(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function xr(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function Ls(t){return typeof t=="string"?t:t?.message}function _f(t,e,r){var i;for(let n=e;n<t.length;n++)(i=t[n]).schema??(i.schema=r)}function Ir(t,e,r){var i;let n=t.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(i=t).schema??(i.schema=t.inst):t.schema=t.inst);let o=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,s=t.message?t.message:Ls(t.inst?._zod.def?.error?.(t))??Ls(o?.(t))??Ls(e?.error?.(t))??Ls(r.customError?.(t))??Ls(r.localeError?.(t))??"Invalid input",a={};for(let c of Object.keys(t))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=t[c]);return a.path??(a.path=[]),a.message=s,e?.reportInput&&(a.input=t.input),a}function Bc(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Oo(t){let e=t.length;if(!W4.test(t))return e;let r=e;for(let i=0;i<e-1;i++)(t.charCodeAt(i)&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320&&(r--,i++);return r}function Hc(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function j(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Vs(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function K4(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function OE(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function PE(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function G4(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return OE(e+r)}function J4(t){return PE(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function X4(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function Y4(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Ov(t,e){for(let r in e){let i=Object.getOwnPropertyDescriptor(e,r);i.get?Object.defineProperty(t,r,{...i,enumerable:!1}):eF(t,r,i.value)}}function Vn(t,e,r,i=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:i,value:r}),r}function Wc(t,e,r){return Vn(t,e,r,!1)}function Q4(t,e){for(let r in t){let i=t[r];Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){return Vn(this,r,i(this))},set(n){Vn(this,r,n)}})}return e}function eF(t,e,r){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?r:Vn(this,e,r.bind(this))},set(i){Vn(this,e,i)}})}function tF(t,e){let r=Object.getPrototypeOf(t);return e in r?void 0:r}function xe(t,e,r){let i=Object.getPrototypeOf(t._zod);if(e in i&&bv!==t._zod){bv=void 0;return}bv=t._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,rF);let n=Ui;Ui=!1;try{let o=r(this);return Ui?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o}),Ui=Ui||n,o}catch(o){throw delete this[e],Ui=Ui||n,o}},set(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}function Pv(t,e,r,i){let n=tF(t,e);n&&Object.defineProperty(n,e,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,e,o),o.value=r(this),Object.defineProperty(this,e,o),o.value},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:i,value:o})}})}function Av(t){let e=()=>t;return e[bf]=!0,e}var wv,vE,yf,xv,B4,Zc,Iv,qc,Vc,W4,$v,bv,Ui,rF,bf,B=w(()=>{Mi();wv=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};vE=Symbol("evaluating");yf="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};xv=Fs(()=>{if(Wt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});B4=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Zc=new Set(["string","number","symbol"]),Iv=new Set(["string","number","bigint","boolean","symbol","undefined"]);qc={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]},Vc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};W4=/[\uD800-\uDBFF]/;$v=class{constructor(...e){}};Ui=!1,rF={configurable:!0,get(){Ui=!0}};bf="~constantCatch"});function nF(t){let e=RE;if(e){let r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return RE=null,new t}try{return new t}finally{e.stackTraceLimit=r}}}return new t}function $(t,e,r,i){let n={};function o(p){this.def=p,this.constr=d,this.traits=new Set}o.prototype=n;let s=r,a=s&&new WeakSet;function c(p,f){if(p._zod){if(p._zod.traits.has(t))return}else{Rv.value=new o(f);try{Object.defineProperty(p,"_zod",Rv)}finally{Rv.value=void 0}}if(p._zod.traits.add(t),e(p,f),a){let m=Object.getPrototypeOf(p),g=p._zod.constr.prototype,y=m;for(;y&&y!==g;)y=Object.getPrototypeOf(y);let v=y??m;a.has(v)||(a.add(v),Ov(v,s))}let h=d.prototype;for(let m in h)Object.prototype.hasOwnProperty.call(h,m)&&(m in p||(p[m]=h[m].bind(p)))}let l=i?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:t});function d(p){let f=i?.Parent?nF(u):this;c(f,p);let h=f._zod.deferred;if(h){for(let g of h)g();f._zod.deferred=void 0}let m=globalThis.__zod_globalConfig?.postProcessor;return m&&m(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>i?.Parent&&p instanceof i.Parent?!0:p?._zod?.traits?.has(t)}),Object.defineProperty(d,"name",{value:t}),d}function Pt(t){return t&&Object.assign(Wt,t),Wt}var AE,jv,Rv,RE,zv,Er,Fi,Wt,Mi=w(()=>{B();jv=Object.freeze({status:"aborted"}),Rv={value:void 0,enumerable:!1},RE="captureStackTrace"in Error?Error:null;zv=Symbol("zod_brand"),Er=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fi=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(AE=globalThis).__zod_globalConfig??(AE.__zod_globalConfig={});Wt=globalThis.__zod_globalConfig});function iF(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,Ms,2)),t.message}function oF(t){this._zod.message=t}function aF(t,e,r){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):t[e]=r()),t[e]}function Kc(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?aF(r,n.path[0],()=>[]).push(e(n)):i.push(e(n));return{formErrors:i,fieldErrors:r}}function Gc(t,e=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)r._errors.push(e(s));else{let c=r,l=0;for(;l<a.length;){let u=a[l],d=l===a.length-1;if(u==="_errors"){d&&c._errors.push(e(s)),l++;continue}Object.prototype.hasOwnProperty.call(c,u)||Object.defineProperty(c,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let p=c[u];d&&p._errors.push(e(s)),c=p,l++}}}};return i(t),r}function Lv(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s;for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){r.errors.push(e(a));continue}let l=r,u=0;for(;u<c.length;){let d=c[u],p=u===c.length-1;typeof d=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,d)||Object.defineProperty(l.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[d]):(l.items??(l.items=[]),(s=l.items)[d]??(s[d]={errors:[]}),l=l.items[d]),p&&l.errors.push(e(a)),u++}}};return i(t),r}function CE(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Uv(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${CE(i.path)}`);return e.join(`
|
|
5
|
+
`)}var sF,Nv,jE,zE,Dv,Tr,Mv=w(()=>{Mi();B();sF={get:iF,set:oF,enumerable:!0,configurable:!0},Nv={value:void 0,enumerable:!1},jE=new WeakSet([Object.prototype,Error.prototype]),zE=(t,e)=>{t.name="$ZodError",Nv.value=e,Object.defineProperty(t,"issues",Nv),Nv.value=void 0,Object.defineProperty(t,"message",sF);let r=Object.getPrototypeOf(t);jE.has(r)||(jE.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},Dv=$("$ZodError",zE),Tr=$("$ZodError",zE,void 0,{Parent:Error})});function wf(t,e){return{callee:e?.callee??t,Err:e?.Err}}function NE(t,e,r){let i;return{success:!1,get error(){return i||(i=new t(e.map(n=>Ir(n,r,Pt()))),e=void 0,r=void 0),i},set error(n){i=n,e=void 0,r=void 0}}}function dF(t,e,r){let i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=t._zod.bag.fallbackRun,o;if(n?(i[uF]=!0,o=n({value:e,issues:[]},i)):o=t._zod.run({value:e,issues:[]},i),o instanceof Promise)throw new Er;return o.issues.length===0}var Bs,Po,Hs,Ao,Ws,Ks,Gs,Js,lF,uF,Xs,Ys,$f,DE,kf,LE,Sf,UE,xf,ME,If,FE,Ef,ZE,Tf,qE,Of,VE,Fv=w(()=>{Mi();Mv();B();Bs=t=>{let e=(r,i,n,o)=>{let s=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new Er;if(a.issues.length){let c=new(o?.Err??t)(a.issues.map(l=>Ir(l,s,Pt())));throw yf(c,o?.callee??e),c}return a.value};return e},Po=Bs(Tr),Hs=t=>{let e=async(r,i,n,o)=>{let s=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??t)(a.issues.map(l=>Ir(l,s,Pt())));throw yf(c,o?.callee??e),c}return a.value};return e},Ao=Hs(Tr),Ws=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Er;return o.issues.length?NE(t,o.issues,n):{success:!0,data:o.value}},Ks=Ws(Tr);Gs=t=>async(e,r,i)=>{let n=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?NE(t,o.issues,n):{success:!0,data:o.value}},Js=Gs(Tr),lF=Symbol.for("zod.compile.invalid"),uF=Symbol.for("zod.compile.fallback"),Xs=((t,e,r)=>{let i=t._zod.bag.validator;if(i!==void 0){if(i(e)!==lF)return!0;if(i.definite===!0&&r===void 0)return!1}return dF(t,e,r)});Ys=async(t,e,r)=>{let i=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=t._zod.run({value:e,issues:[]},i);return n instanceof Promise&&(n=await n),n.issues.length===0},$f=t=>{let e=Bs(t),r=(i,n,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return e(i,n,a,wf(r,s))};return r},DE=$f(Tr),kf=t=>{let e=Bs(t),r=(i,n,o,s)=>e(i,n,o,wf(r,s));return r},LE=kf(Tr),Sf=t=>{let e=Hs(t),r=async(i,n,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await e(i,n,a,wf(r,s))};return r},UE=Sf(Tr),xf=t=>{let e=Hs(t),r=async(i,n,o,s)=>await e(i,n,o,wf(r,s));return r},ME=xf(Tr),If=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Ws(t)(e,r,n)},FE=If(Tr),Ef=t=>(e,r,i)=>Ws(t)(e,r,i),ZE=Ef(Tr),Tf=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Gs(t)(e,r,n)},qE=Tf(Tr),Of=t=>async(e,r,i)=>Gs(t)(e,r,i),VE=Of(Tr)});var Fr={};Jr(Fr,{anyString:()=>h_,base64:()=>o_,base64url:()=>s_,bigint:()=>g_,boolean:()=>y_,browserEmail:()=>_F,cidrv4:()=>n_,cidrv6:()=>i_,creditCard:()=>Pf,cuid:()=>qv,cuid2:()=>Vv,currencyCode:()=>u_,date:()=>d_,datetime:()=>p_,domain:()=>c_,duration:()=>Jv,e164:()=>l_,email:()=>Yv,emoji:()=>Qv,extendedDuration:()=>fF,guid:()=>Xv,hex:()=>$_,hostname:()=>a_,html5Email:()=>gF,httpProtocol:()=>Jc,iban:()=>Af,idnEmail:()=>vF,integer:()=>Xc,ipv4:()=>e_,ipv6:()=>t_,ksuid:()=>Wv,lowercase:()=>b_,mac:()=>r_,md5_base64:()=>kF,md5_base64url:()=>SF,md5_hex:()=>$F,nanoid:()=>Kv,nanoidOfLength:()=>Gv,null:()=>v_,number:()=>gi,rfc5322Email:()=>yF,sha1_base64:()=>IF,sha1_base64url:()=>EF,sha1_hex:()=>xF,sha256_base64:()=>OF,sha256_base64url:()=>PF,sha256_hex:()=>TF,sha384_base64:()=>RF,sha384_base64url:()=>jF,sha384_hex:()=>AF,sha512_base64:()=>CF,sha512_base64url:()=>NF,sha512_hex:()=>zF,string:()=>m_,time:()=>f_,ulid:()=>Bv,undefined:()=>__,unicodeEmail:()=>BE,uppercase:()=>w_,uuid:()=>Ro,uuid4:()=>pF,uuid6:()=>hF,uuid7:()=>mF,xid:()=>Hv});function Gv(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}function Qv(){return new RegExp(bF,"u")}function wF(t){return new RegExp(`^${t}$`)}function Zv(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function f_(t){return new RegExp(`^${Zv(t)}$`)}function p_(t){let e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Zv({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,i=t.local?`${r}|${Zv({precision:t.precision})}`:r;return new RegExp(`^${HE}T(?:${i})$`)}function Yc(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Qc(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var qv,Vv,Bv,Hv,Wv,Kv,Jv,fF,Xv,Ro,pF,hF,mF,Yv,gF,yF,BE,vF,_F,bF,e_,t_,r_,n_,i_,o_,s_,a_,c_,Jc,l_,Pf,u_,Af,HE,d_,h_,m_,g_,Xc,gi,y_,v_,__,b_,w_,$_,$F,kF,SF,xF,IF,EF,TF,OF,PF,AF,RF,jF,zF,CF,NF,jo=w(()=>{B();qv=/^[cC][0-9a-z]{6,}$/,Vv=/^[0-9a-z]+$/,Bv=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Hv=/^[0-9a-vA-V]{20}$/,Wv=/^[A-Za-z0-9]{27}$/,Kv=/^[a-zA-Z0-9_-]{21}$/;Jv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fF=/^[-+]?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)?)??$/,Xv=/^([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})$/,Ro=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,pF=Ro(4),hF=Ro(6),mF=Ro(7),Yv=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gF=/^[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])?)*$/,yF=/^(([^<>()\[\]\\.,;:\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,}))$/,BE=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,vF=BE,_F=/^[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])?)*$/,bF="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";e_=/^(?:(?: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])$/,t_=/^(([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}|:))$/,r_=t=>{let e=tn(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},n_=/^((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])$/,i_=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,o_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s_=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,a_=/^(?=.{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])?)*\.?$/,c_=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Jc=/^https?$/,l_=/^\+[1-9]\d{6,14}$/,Pf=/^\d(?:[ -]?\d){11,18}$/,u_=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Af=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,HE="(?:(?:\\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])))";d_=wF(HE);h_=/^[\s\S]{0,}$/,m_=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},g_=/^-?\d+n?$/,Xc=/^-?\d+$/,gi=/^-?\d+(?:\.\d+)?$/,y_=/^(?:true|false)$/i,v_=/^null$/i,__=/^undefined$/i,b_=/^[^A-Z]*$/,w_=/^[^a-z]*$/,$_=/^[0-9a-fA-F]*$/;$F=/^[0-9a-fA-F]{32}$/,kF=Yc(22,"=="),SF=Qc(22),xF=/^[0-9a-fA-F]{40}$/,IF=Yc(27,"="),EF=Qc(27),TF=/^[0-9a-fA-F]{64}$/,OF=Yc(43,"="),PF=Qc(43),AF=/^[0-9a-fA-F]{96}$/,RF=Yc(64,""),jF=Qc(64),zF=/^[0-9a-fA-F]{128}$/,CF=Yc(86,"=="),NF=Qc(86)});function jf(t,e,r){t.issues.length&&e.issues.push(...xr(r,t.issues))}var it,k_,S_,Rf,zf,Cf,x_,I_,E_,T_,O_,P_,A_,R_,j_,Qs,z_,C_,N_,D_,L_,U_,M_,F_,Z_,q_,Nf=w(()=>{Mi();jo();B();it=$("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),k_=t=>{let e=t.value;return!gf(e)&&e.size!==void 0},S_=t=>{let e=t.value;return!gf(e)&&e.length!==void 0},Rf={number:"number",bigint:"bigint",object:"date"},zf=$("$ZodCheckLessThan",(t,e)=>{it.init(t,e);let r=Rf[typeof e.value];t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:Rf[typeof i.value]??r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Cf=$("$ZodCheckGreaterThan",(t,e)=>{it.init(t,e);let r=Rf[typeof e.value];t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:Rf[typeof i.value]??r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),x_=$("$ZodCheckMultipleOf",(t,e)=>{it.init(t,e),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?e.value!==BigInt(0)&&r.value%e.value===BigInt(0):Fc(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),I_=$("$ZodCheckNumberFormat",(t,e)=>{it.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=qc[e.format];t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),E_=$("$ZodCheckBigIntFormat",(t,e)=>{it.init(t,e);let[r,i]=Vc[e.format];t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),T_=$("$ZodCheckMaxSize",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=k_),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Bc(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),O_=$("$ZodCheckMinSize",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=k_),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Bc(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),P_=$("$ZodCheckSizeEquals",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=k_),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:Bc(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),A_=$("$ZodCheckMaxLength",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=S_),t._zod.check=i=>{let n=i.value,o=n.length;if((typeof n=="string"&&o>e.maximum?Oo(n):o)<=e.maximum)return;let a=Hc(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),R_=$("$ZodCheckMinLength",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=S_),t._zod.check=i=>{let n=i.value,o=n.length;if((typeof n=="string"&&o>=e.minimum&&o<e.minimum*2?Oo(n):o)>=e.minimum)return;let a=Hc(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),j_=$("$ZodCheckLengthEquals",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=S_),t._zod.check=i=>{let n=i.value,o=n.length,s=typeof n=="string"&&o>=e.length&&o<=e.length*2?Oo(n):o;if(s===e.length)return;let a=Hc(n),c=s>e.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Qs=$("$ZodCheckStringFormat",(t,e)=>{var r,i;it.init(t,e),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),z_=$("$ZodCheckRegex",(t,e)=>{Qs.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),C_=$("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=b_),Qs.init(t,e)}),N_=$("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=w_),Qs.init(t,e)}),D_=$("$ZodCheckIncludes",(t,e)=>{it.init(t,e);let r=tn(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position},}${r}`:r);e.pattern=i,t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),L_=$("$ZodCheckStartsWith",(t,e)=>{it.init(t,e);let r=new RegExp(`^${tn(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),U_=$("$ZodCheckEndsWith",(t,e)=>{it.init(t,e);let r=new RegExp(`.*${tn(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});M_=$("$ZodCheckProperty",(t,e)=>{it.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>jf(n,r,e.property));jf(i,r,e.property)}}),F_=$("$ZodCheckProperties",(t,e)=>{it.init(t,e),Wc(t,Symbol.iterator,function*(){yield t});let r;t._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:t});return}r??(r=Reflect.ownKeys(e.shape).map(s=>[s,e.shape[s]]));let n=i.value,o;for(let[s,a]of r){let c=a._zod.run({value:n[s],issues:[]},{});c instanceof Promise?(o??(o=[]),o.push(c.then(l=>jf(l,i,s)))):jf(c,i,s)}if(o)return Promise.all(o).then(()=>{})}}),Z_=$("$ZodCheckMimeType",(t,e)=>{it.init(t,e);let r=new Set(e.mime);t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),q_=$("$ZodCheckOverwrite",(t,e)=>{it.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var zo,Df=w(()=>{zo=class{constructor(e=[],r={}){this.content=[],this.indent=0,this.args=e,this.closed=r}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
6
|
+
`).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
7
|
+
${r.join(`
|
|
8
|
+
`)}
|
|
9
|
+
};`)(...Object.values(this.closed))}}});var V_,B_=w(()=>{V_={major:4,minor:6,patch:5}});async function DF(t,e){let r={async:!0};return lT(await t._zod.run({value:e,issues:[]},r),r)}function Zf(t){return{validate:e=>{let r={async:!1};try{let i=t._zod.run({value:e,issues:[]},r);if(!(i instanceof Promise))return lT(i,r)}catch{}return DF(t,e)},vendor:"zod",version:1}}function K_(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function Hf(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?K_(t)||el:uT(t,e)}function uT(t,e){if(!e.normalize&&e.protocol?.source===Jc.source&&!/^https?:\/\//i.test(t))return W_;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(t)??el}return new URL(t)}catch{return el}}function tl(t){return t.replace(LF,"")}function Wf(t,e){return e.lastIndex=0,e.test(t.hostname)}function Kf(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}function rl(t){return UF.test(t)?K_(`http://[${t}]`):!1}function ap(t){let e=t.split("/");if(e.length!==2)return!1;let[r,i]=e;if(!i)return!1;let n=Number(i);return`${n}`!==i||n<0||n>128?!1:rl(r)}function nl(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function dp(t){if(!il.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return nl(r)}function FF(t){let e=t.length,r=1,i=0;for(;e;){let n=t.charCodeAt(--e)-48;r^=1,i+=r?[0,2,4,6,8,1,3,5,7,9][n]:n}return i%10===0}function hp(t){return Pf.test(t)?FF(t.replace(MF,"")):!1}function ZF(t){let e=0,r=t.length;for(let i=4;i<r;i++){let n=t.charCodeAt(i);e=(n>=65?e*100+(n-55):e*10+(n-48))%97}for(let i=0;i<4;i++){let n=t.charCodeAt(i);e=(n>=65?e*100+(n-55):e*10+(n-48))%97}return e===1}function gp(t){return Af.test(t)?ZF(t):!1}function vp(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}function KE(t,e,r){t.issues.length&&e.issues.push(...xr(r,t.issues)),e.value[r]=t.value}function Ff(t,e,r,i,n,o){let s=r in i,a=o==="optional";if(!(!s&&a&&n==="optional")){if(t.issues.length){if(n!==void 0&&a&&!s)return;e.issues.push(...xr(r,t.issues))}if(!s&&n===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?(s||n==="defaulted"&&!a)&&(e.value[r]=void 0):e.value[r]=t.value}}function dT(t){let e=Object.keys(t.shape),r=Object.getOwnPropertySymbols(t.shape),i=r.length?r:qF,n=i.length?[...e,...i]:e;for(let s of n)if(!t.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=Ev(t.shape);return{...t,allKeys:n,symbolKeys:i,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(o)}}function fT(t,e,r,i,n,o,s){let a=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optin,p=l.optout,f=0;for(let h in e){if(s&&r.issues.length!==f){if(pr(r,f))break;f=r.issues.length}if(c.has(h))continue;if(h==="__proto__"){u==="never"&&a.push(h);continue}if(u==="never"){a.push(h);continue}let m=l.run({value:e[h],issues:[]},i);m instanceof Promise?t.push(m.then(g=>Ff(g,r,h,e,d,p))):Ff(m,r,h,e,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o,continue:!0}),t.length?Promise.all(t).then(()=>r):r}function GE(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!pr(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Ir(s,i,Pt())))}),e)}function JE(t,e,r,i){let n=[];for(let o=0;o<t.length;o++)t[o].issues.length===0&&n.push(o);return n.length===1?(e.value=t[n[0]].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Ir(s,i,Pt())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1,matches:n}),e)}function eb(t,e){let r=t._zod,i=r.bag.optionsMap;i||(i=pT(r.def),r.bag.optionsMap=i);let n=i.get(e);if(n===null)throw new Error(`Ambiguous discriminator value "${String(e)}"`);return n}function pT(t){let e=new Map;for(let r of t.options){let i=r._zod.propValues?.[t.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let n of i)if(e.has(n)){if(n!==void 0)throw new Error(`Duplicate discriminator value "${String(n)}"`);e.set(n,null)}else e.set(n,r)}return e}function ea(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(en(t)&&en(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};Object.prototype.hasOwnProperty.call(n,"__proto__")&&delete n.__proto__;for(let o of i){if(o==="__proto__")continue;let s=ea(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],s=ea(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function XE(t,e,r){let i=new Map,n,o=new Map,s=(l,u)=>{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)n??(n=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),d=[p]}else return!1;for(let p of d)i.has(p)||i.set(p,{}),i.get(p)[u]=!0;return!0};for(let l of e.issues)s(l,"l")||t.issues.push(l);for(let l of r.issues)s(l,"r")||t.issues.push(l);let a=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=n?a.filter(u=>n.keys.includes(u)):[];l.length&&t.issues.push({...n,keys:l});for(let u of a)!l.includes(u)&&o.has(u)&&t.issues.push(o.get(u))}let c=ea(e.value,r.value);if(!c.valid){if(pr(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return t.value=c.data,t}function YE(t,e){for(let r=t.length-1;r>=0;r--)if(!(e==="optin"?t[r]._zod.optin!==void 0:t[r]._zod.optout==="optional"))return r+1;return 0}function QE(t,e,r){t.issues.length&&e.issues.push(...xr(r,t.issues)),e.value[r]=t.value}function eT(t,e,r,i,n){for(let o=0;o<r.length;o++){let s=t[o],a=o<i.length;if(!a&&o>=n&&r[o]._zod.optin==="optional"){e.value.length=o;break}if(s.issues.length){if(!a&&o>=n){e.value.length=o;break}e.issues.push(...xr(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(r[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}function tT(t,e,r,i,n,o,s){t.issues.length&&(Zc.has(typeof i)?r.issues.push(...xr(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(a=>Ir(a,s,Pt()))})),e.issues.length&&(Zc.has(typeof i)?r.issues.push(...xr(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(a=>Ir(a,s,Pt()))})),r.value.set(t.value,e.value)}function rT(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function nT(t,e){return t.value=e.issues.length?void 0:e.value,t}function iT(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function oT(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function sT(t,e,r,i){return e.issues.length?(t.value=r.catchValue({...e,value:t.value,error:{issues:e.issues.map(n=>Ir(n,i,Pt()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}function Lf(t,e,r){return t.issues.some(i=>i.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}function Uf(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>Mf(t,o,e.out,r)):Mf(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>Mf(t,o,e.in,r)):Mf(t,n,e.in,r)}}function Mf(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}function aT(t){return t.memo||(t.value=Object.freeze(t.value)),t}function VF(t){let e=t._zod.def,r=e.pattern,i=!!e.format?.includes("int"),n,o;for(let a of e.checks??[]){let c=a._zod.def;c.pattern&&(r=c.pattern),i||(i=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(n===void 0||l>n)&&(n=l),u!==void 0&&(o===void 0||u<o)&&(o=u)}if(r)return r.source;if(n!==void 0&&o!==void 0&&n>o)return"(?!)";if(n!==void 0||o!==void 0)return m_({minimum:n,maximum:o}).source;let s=t._zod.pattern;return(i&&s===gi?Xc:s)?.source}function H_(t){let e=t._zod.def,r=t._zod.pattern?.source,i=e.innerType??t._zod.innerType;if(i){let n=i._zod.pattern?.source,o=H_(i);return r&&n&&o&&o!==n?r.replace(mi(n),()=>mi(o)):r}if(e.options){let n=e.options.map(H_);if(n.every(Boolean))return`^(${n.map(o=>mi(o)).join("|")})$`}return VF(t)}function cT(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(Vs(n))}}var ve,lT,yi,Xe,qf,Vf,Bf,W_,el,LF,Gf,Jf,Xf,Yf,Qf,ep,tp,rp,G_,J_,X_,Y_,np,UF,ip,op,sp,cp,lp,up,il,fp,pp,MF,mp,yp,_p,bp,ta,wp,Co,ol,$p,kp,Sp,xp,Ip,Ep,Tp,Op,Pp,sl,qF,Ap,Q_,ra,Rp,al,jp,cl,zp,Cp,Np,ll,ul,Dp,Lp,na,Up,Mp,Fp,Zp,qp,Vp,Bp,Hp,dl,ia,tb,Wp,Kp,Gp,Jp,oa,Xp,sa=w(()=>{Nf();Mi();Df();Fv();jo();B();B_();B();ve=$("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=V_;let i=t._zod.def.checks,n=t._zod.traits.has("$ZodCheck")?[t,...i??[]]:i?.length?[...i]:[];for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(a,c,l)=>{if(a.memo)return a;let u=pr(a),d;for(let p of c){if(p._zod.def.when){if(Tv(a)||!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&l?.async===!1)throw new Er;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,a.issues.length!==f&&(_f(a.issues,f,t),u||(u=pr(a,f)))});else{if(a.issues.length===f)continue;_f(a.issues,f,t),u||(u=pr(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(pr(a))return a.aborted=!0,a;let u=o(c,n,l);if(u instanceof Promise){if(l.async===!1)throw new Er;return u.then(d=>t._zod.parse(d,l))}return t._zod.parse(u,l)};t._zod.run=(a,c)=>{if(c.skipChecks)return t._zod.parse(a,c);if(c.direction==="backward"){let u=t._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}let l=t._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Er;return l.then(u=>o(u,n,c))}return o(l,n,c)}}},{get"~standard"(){return Wc(this,"~standard",Zf(this))},set"~standard"(t){Vn(this,"~standard",t)}}),lT=(t,e)=>t.issues.length?{issues:t.issues.map(r=>Ir(r,e,Pt()))}:{value:t.value};yi=$("$ZodString",(t,e)=>{ve.init(t,e),t._zod.pattern=e.pattern??h_,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),Xe=$("$ZodStringFormat",(t,e)=>{Qs.init(t,e),yi.init(t,e)}),qf=$("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Xv),Xe.init(t,e)}),Vf=$("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Ro(i))}else e.pattern??(e.pattern=Ro());Xe.init(t,e)}),Bf=$("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Yv),Xe.init(t,e)}),W_=1,el=2;LF=/[\t\n\r]/g;Gf=$("$ZodURL",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=Hf(i,e);if(n===W_){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}if(n===el){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});return}if(n===!0){r.value=tl(i);return}e.hostname&&!Wf(n,e.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort}),e.protocol&&!Kf(n,e.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort}),r.value=e.normalize?n.href:tl(i);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Jf=$("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Qv()),Xe.init(t,e)}),Xf=$("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?Kv:Gv(e.length)),Xe.init(t,e)}),Yf=$("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=qv),Xe.init(t,e)}),Qf=$("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Vv),Xe.init(t,e)}),ep=$("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Bv),Xe.init(t,e)}),tp=$("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Hv),Xe.init(t,e)}),rp=$("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Wv),Xe.init(t,e)}),G_=$("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=p_(e)),Xe.init(t,e)}),J_=$("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=d_),Xe.init(t,e)}),X_=$("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=f_(e)),Xe.init(t,e)}),Y_=$("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Jv),Xe.init(t,e)}),np=$("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=e_),Xe.init(t,e)}),UF=/^[0-9a-fA-F:.]+$/;ip=$("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=t_),Xe.init(t,e),t._zod.check=r=>{rl(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}),op=$("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=r_(e.delimiter)),Xe.init(t,e)}),sp=$("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=n_),Xe.init(t,e)});cp=$("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=i_),Xe.init(t,e),t._zod.check=r=>{ap(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}});lp=/^[0-9a-zA-Z+/]*={0,2}$/,up=$("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=lp),Xe.init(t,e),t._zod.check=r=>{nl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}}),il=/^[A-Za-z0-9_-]*$/;fp=$("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=il),Xe.init(t,e),t._zod.check=r=>{dp(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),pp=$("$ZodE164",(t,e)=>{e.pattern??(e.pattern=l_),Xe.init(t,e)}),MF=/[- ]/g;mp=$("$ZodCreditCard",(t,e)=>{e.pattern??(e.pattern=Pf),Xe.init(t,e),t._zod.check=r=>{hp(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:t,continue:!e.abort})}});yp=$("$ZodIBAN",(t,e)=>{e.pattern??(e.pattern=Af),Xe.init(t,e),t._zod.check=r=>{gp(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:t,continue:!e.abort})}});_p=$("$ZodJWT",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{vp(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),bp=$("$ZodCustomStringFormat",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),ta=$("$ZodNumber",(t,e)=>{ve.init(t,e),t._zod.pattern=gi,t._zod.parse=(r,i)=>{if(e.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 o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...o?{received:o}:{}}),r}}),wp=$("$ZodNumberFormat",(t,e)=>{I_.init(t,e),ta.init(t,e)}),Co=$("$ZodBoolean",(t,e)=>{ve.init(t,e),t._zod.pattern=y_,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),ol=$("$ZodBigInt",(t,e)=>{ve.init(t,e),t._zod.pattern=g_,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),$p=$("$ZodBigIntFormat",(t,e)=>{E_.init(t,e),ol.init(t,e)}),kp=$("$ZodSymbol",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),Sp=$("$ZodUndefined",(t,e)=>{ve.init(t,e),t._zod.pattern=__,t._zod.values=new Set([void 0]),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),xp=$("$ZodNull",(t,e)=>{ve.init(t,e),t._zod.pattern=v_,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),Ip=$("$ZodAny",(t,e)=>{ve.init(t,e),t._zod.parse=r=>r}),Ep=$("$ZodUnknown",(t,e)=>{ve.init(t,e),t._zod.parse=r=>r}),Tp=$("$ZodNever",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Op=$("$ZodVoid",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),Pp=$("$ZodDate",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:t}),r}});sl=$("$ZodArray",(t,e)=>{ve.init(t,e);let r=Wt.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),i;i.value=r?r.alloc(t,i,Array(o.length),n):Array(o.length);let s=[],a=n?.abortEarly;for(let c=0;c<o.length;c++){let l=o[c],u=e.element._zod.run({value:l,issues:[]},n);if(u instanceof Promise)s.push(u.then(d=>KE(d,i,c)));else if(KE(u,i,c),a&&u.issues.length!==0&&pr(u))break}return s.length?Promise.all(s).then(()=>i):i}});qF=[];Ap=$("$ZodObject",(t,e)=>{ve.init(t,e);let r=Object.getOwnPropertyDescriptor(e,"shape"),i=r?.get?r.get.raw:e.shape??{};if(i){let l=()=>{let u={...i};return Object.defineProperty(e,"shape",{value:u}),l.raw=u,u};l.raw=i,Object.defineProperty(e,"shape",{get:l})}let n=Fs(()=>dT(e));xe(t,"propValues",l=>{let u=l.def.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,p)||Gt(d,p,new Set);for(let h of f.values)d[p].add(h);f.optin!==void 0&&d[p].add(void 0)}}return d});let o=To,s=e.catchall,a,c=Wt.memoizer;c?.attach(t),t._zod.parse=(l,u)=>{a??(a=n.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),l;l.value=c?c.alloc(t,l,{},u):{};let p=[],f=a.shape,h=u?.abortEarly,m=l.issues.length;for(let g of a.allKeys){if(h&&l.issues.length!==m){if(pr(l,m))break;m=l.issues.length}if(g==="__proto__")continue;let y=f[g],v=y._zod.optin,b=y._zod.optout,x=y._zod.run({value:d[g],issues:[]},u);x instanceof Promise?p.push(x.then(k=>Ff(k,l,g,d,v,b))):Ff(x,l,g,d,v,b)}return s?fT(p,d,l,u,n.value,t,h===!0):p.length?Promise.all(p).then(()=>l):l}}),Q_=$("$ZodObjectJIT",(t,e)=>{Ap.init(t,e);let r=t._zod.parse,i=Fs(()=>dT(e)),n=Wt.memoizer,o=f=>{let h=i.value,m=h.symbolKeys,g=new zo(["payload","ctx"],{shape:f,inst:t,memo:n,syms:m}),y=k=>`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`,v=(k,E)=>`
|
|
10
|
+
let ${k}_ab = false;
|
|
11
|
+
for (let i = 0; i < ${k}.issues.length; i++) {
|
|
12
|
+
const iss = ${k}.issues[i];
|
|
13
|
+
iss.path = iss.path ? [${E}, ...iss.path] : [${E}];
|
|
14
|
+
payload.issues.push(iss);
|
|
15
|
+
if (iss.continue !== true) ${k}_ab = true;
|
|
16
|
+
}
|
|
17
|
+
if (${k}_ab && ctx && ctx.abortEarly) {
|
|
18
|
+
payload.value = newResult;
|
|
19
|
+
return payload;
|
|
20
|
+
}`;g.write("const input = payload.value;");let b=Object.create(null),x=0;for(let k of h.allKeys)b[k]=`key_${x++}`;g.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let k of h.allKeys){if(k==="__proto__")continue;let E=b[k],O=typeof k=="symbol"?`syms[${m.indexOf(k)}]`:fr(k),X=`${O} in input`,le=f[k],$e=le?._zod?.optin,q=$e!==void 0,Re=le?._zod?.optout==="optional";if(g.write(`const ${E} = ${y(O)};`),q&&Re){let de=$e==="optional"?`${E}_present`:`${E}.value !== undefined || ${E}_present`;g.write(`
|
|
21
|
+
const ${E}_present = ${X};
|
|
22
|
+
if (!${E}.issues.length || ${E}_present) {
|
|
23
|
+
if (${E}.issues.length) {${v(E,O)}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (${de}) {
|
|
27
|
+
newResult[${O}] = ${E}.value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
`)}else q?(g.write(`
|
|
32
|
+
if (${E}.issues.length) {${v(E,O)}
|
|
33
|
+
}
|
|
34
|
+
`),$e==="defaulted"?g.write(`newResult[${O}] = ${E}.value;`):g.write(`
|
|
35
|
+
if (${E}.value !== undefined || ${X}) {
|
|
36
|
+
newResult[${O}] = ${E}.value;
|
|
37
|
+
}
|
|
38
|
+
`)):g.write(`
|
|
39
|
+
const ${E}_present = ${X};
|
|
40
|
+
if (${E}.issues.length) {${v(E,O)}
|
|
41
|
+
}
|
|
42
|
+
if (!${E}_present && !${E}.issues.length) {
|
|
43
|
+
payload.issues.push({
|
|
44
|
+
code: "invalid_type",
|
|
45
|
+
expected: "nonoptional",
|
|
46
|
+
input: undefined,
|
|
47
|
+
path: [${O}]
|
|
48
|
+
});
|
|
49
|
+
if (ctx && ctx.abortEarly) {
|
|
50
|
+
payload.value = newResult;
|
|
51
|
+
return payload;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${E}_present) {
|
|
56
|
+
newResult[${O}] = ${E}.value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
`)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=To,c=!Wt.jitless,u=c&&xv.value,d=e.catchall,p;t._zod.parse=(f,h)=>{p??(p=i.value);let m=f.value;return a(m)?c&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(e.shape)),f=s(f,h),d?fT([],m,f,h,p,t,h?.abortEarly===!0):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f)}});ra=$("$ZodUnion",(t,e)=>{ve.init(t,e),xe(t,"optin",i=>i.def.options.some(n=>n._zod.optin==="defaulted")?"defaulted":i.def.options.some(n=>n._zod.optin!==void 0)?"optional":void 0),xe(t,"optout",i=>i.def.options.some(n=>n._zod.optout==="optional")?"optional":void 0),xe(t,"values",i=>{if(i.def.options.every(n=>n._zod.values))return new Set(i.def.options.flatMap(n=>Array.from(n._zod.values)))}),xe(t,"pattern",i=>{if(i.def.options.every(n=>n._zod.pattern)){let n=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>mi(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>GE(a,i,t,n)):GE(s,i,t,n)}});Rp=$("$ZodXor",(t,e)=>{ra.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>JE(a,i,t,n)):JE(s,i,t,n)}});al=$("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ra.init(t,e);let r=t._zod.parse;xe(t,"propValues",n=>{let o={},s=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);c[n.def.discriminator]?.has(void 0)&&s++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||Gt(o,l,new Set);for(let d of u)o[l].add(d)}}return!n.def.unionFallback&&s>1&&o[n.def.discriminator]?.delete(void 0),o}),e.options.forEach((n,o)=>{let s=Zs(n._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,e.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=Fs(()=>pT(e));t._zod.parse=(n,o)=>{let s=n.value;if(!To(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let a=s?.[e.discriminator],c=i.value.get(a);return c&&(a!==void 0||o.direction!=="backward")?c._zod.run(n,o):e.unionFallback||o.direction==="backward"?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:s,path:[e.discriminator],inst:t}),n)}}),jp=$("$ZodIntersection",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),s=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>XE(r,c,l)):XE(r,o,s)}});cl=$("$ZodTuple",(t,e)=>{ve.init(t,e);let r=e.items,i=Wt.memoizer;i?.attach(t),t._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=i?i.alloc(t,n,[],o):[];let a=[],c=YE(r,"optin"),l=YE(r,"optout");if(!e.rest){if(s.length<c)return n.issues.push({code:"too_small",minimum:c,inclusive:!0,input:s,inst:t,origin:"array"}),n;s.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:t,origin:"array"})}let u=new Array(r.length),d=e.rest?o?.abortEarly:void 0,p=!1;for(let f=0;f<r.length;f++){let h=r[f]._zod.run({value:s[f],issues:[]},o);h instanceof Promise?a.push(h.then(m=>{u[f]=m})):(u[f]=h,d&&!p&&h.issues.length&&(p=pr(h)))}if(e.rest&&!p){let f=r.length-1,h=s.slice(r.length),m=n.issues.length;for(let g of h){if(d&&n.issues.length!==m){if(pr(n,m))break;m=n.issues.length}f++;let y=e.rest._zod.run({value:g,issues:[]},o);y instanceof Promise?a.push(y.then(v=>QE(v,n,f))):QE(y,n,f)}}return a.length?Promise.all(a).then(()=>eT(u,n,r,s,l)):eT(u,n,r,s,l)}});zp=$("$ZodRecord",(t,e)=>{ve.init(t,e);let r=Wt.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!en(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),i;let s=[],a=e.keyType._zod.values;if(a&&!e.partial){i.value=r?r.alloc(t,i,{},n):{};let c=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=e.keyType._zod.run({value:u,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>Ir(h,n,Pt())),input:u,path:[u],inst:t});continue}let p=d.value;if(p==="__proto__")continue;let f=e.valueType._zod.run({value:o[u],issues:[]},n);f instanceof Promise?s.push(f.then(h=>{h.issues.length&&i.issues.push(...xr(u,h.issues)),i.value[p]=h.value})):(f.issues.length&&i.issues.push(...xr(u,f.issues)),i.value[p]=f.value)}let l;for(let u in o)if(!c.has(u))if(e.mode==="loose"){if(u==="__proto__")continue;i.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l,continue:!0})}else{i.value=r?r.alloc(t,i,{},n):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=e.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&gi.test(l)&&u.issues.length){let h=e.keyType._zod.run({value:Number(l),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(u=h)}if(u.issues.length){e.mode==="loose"?i.value[l]=o[l]:a?(c=c??[],c.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>Ir(h,n,Pt())),input:l,path:[l],inst:t});continue}let p=u.value;if(p==="__proto__")continue;let f=e.valueType._zod.run({value:o[l],issues:[]},n);f instanceof Promise?s.push(f.then(h=>{h.issues.length&&i.issues.push(...xr(l,h.issues)),i.value[p]=h.value})):(f.issues.length&&i.issues.push(...xr(l,f.issues)),i.value[p]=f.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),Cp=$("$ZodMap",(t,e)=>{ve.init(t,e);let r=Wt.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),i;let s=[];i.value=r?r.alloc(t,i,new Map,n):new Map;let a=n?.abortEarly,c=i.issues.length;for(let[l,u]of o){if(a&&i.issues.length!==c){if(pr(i,c))break;c=i.issues.length}let d=e.keyType._zod.run({value:l,issues:[]},n),p=e.valueType._zod.run({value:u,issues:[]},n);d instanceof Promise||p instanceof Promise?s.push(Promise.all([d,p]).then(([f,h])=>{tT(f,h,i,l,o,t,n)})):tT(d,p,i,l,o,t,n)}return s.length?Promise.all(s).then(()=>i):i}});Np=$("$ZodSet",(t,e)=>{ve.init(t,e);let r=Wt.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),i;let s=[];i.value=r?r.alloc(t,i,new Set,n):new Set;let a=n?.abortEarly,c=i.issues.length;for(let l of o){if(a&&i.issues.length!==c){if(pr(i,c))break;c=i.issues.length}let u=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise?s.push(u.then(d=>rT(d,i))):rT(u,i)}return s.length?Promise.all(s).then(()=>i):i}});ll=$("$ZodEnum",(t,e)=>{ve.init(t,e);let r=Us(e.entries),i=new Set(r);t._zod.values=i,xe(t,"pattern",n=>{let o=Us(n.def.entries).filter(s=>Zc.has(typeof s));return new RegExp(o.length?`^(${o.map(s=>tn(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),ul=$("$ZodLiteral",(t,e)=>{ve.init(t,e);let r=new Set(e.values);t._zod.values=r,xe(t,"pattern",i=>{let n=i.def.values;return new RegExp(n.length?`^(${n.map(o=>typeof o=="string"?tn(o):o?tn(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),Dp=$("$ZodFile",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),Lp=$("$ZodTransform",(t,e)=>{ve.init(t,e),t._zod.optin="optional",Wt.memoizer?.guard(t),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Fi(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new Er;return r.value=n,r}});na=$("$ZodOptional",(t,e)=>{ve.init(t,e),xe(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",xe(t,"values",r=>{let i=r.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),xe(t,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${mi(i.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(r.value===void 0){if(e.innerType._zod.optin!=="defaulted")return r;let n=e.innerType._zod.run({value:r.value,issues:[]},i);return n instanceof Promise?n.then(o=>nT(r,o)):nT(r,n)}return e.innerType._zod.run(r,i)}}),Up=$("$ZodExactOptional",(t,e)=>{na.init(t,e),xe(t,"values",r=>r.def.innerType._zod.values),xe(t,"pattern",r=>r.def.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),Mp=$("$ZodNullable",(t,e)=>{ve.init(t,e),xe(t,"optin",r=>r.def.innerType._zod.optin),xe(t,"optout",r=>r.def.innerType._zod.optout),xe(t,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${mi(i.source)}|null)$`):void 0}),xe(t,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),Fp=$("$ZodDefault",(t,e)=>{ve.init(t,e),t._zod.optin="defaulted",xe(t,"values",r=>r.def.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>iT(o,e)):iT(n,e)}});Zp=$("$ZodPrefault",(t,e)=>{ve.init(t,e),t._zod.optin="defaulted",xe(t,"values",r=>r.def.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),qp=$("$ZodNonOptional",(t,e)=>{ve.init(t,e),xe(t,"values",r=>{let i=r.def.innerType._zod.values;return i?new Set([...i].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>oT(o,t)):oT(n,t)}});Vp=$("$ZodSuccess",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Fi("ZodSuccess");let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}});Bp=$("$ZodCatch",(t,e)=>{ve.init(t,e),xe(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),xe(t,"optout",r=>r.def.innerType._zod.optout),xe(t,"values",r=>r.def.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run({value:r.value,issues:[]},i);return n instanceof Promise?n.then(o=>sT(r,o,e,i)):sT(r,n,e,i)}}),Hp=$("$ZodNaN",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),dl=$("$ZodPipe",(t,e)=>{ve.init(t,e),xe(t,"values",r=>r.def.in._zod.values),xe(t,"optin",r=>r.def.in._zod.optin),xe(t,"optout",r=>r.def.out._zod.optout),xe(t,"propValues",r=>r.def.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Lf(s,e.in,i)):Lf(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>Lf(o,e.out,i)):Lf(n,e.out,i)}});ia=$("$ZodCodec",(t,e)=>{ve.init(t,e),xe(t,"values",r=>r.def.in._zod.values),xe(t,"optin",r=>r.def.in._zod.optin),xe(t,"optout",r=>r.def.out._zod.optout),xe(t,"propValues",r=>r.def.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>Uf(s,e,i)):Uf(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Uf(s,e,i)):Uf(o,e,i)}}});tb=$("$ZodPreprocess",(t,e)=>{dl.init(t,e)}),Wp=$("$ZodReadonly",(t,e)=>{ve.init(t,e),xe(t,"propValues",r=>r.def.innerType._zod.propValues),xe(t,"values",r=>r.def.innerType._zod.values),xe(t,"optin",r=>r.def.innerType?._zod?.optin),xe(t,"optout",r=>r.def.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(aT):aT(n)}});Kp=$("$ZodTemplateLiteral",(t,e)=>{ve.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){let n=H_(i);if(!n)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);r.push(mi(n))}else if(i===null||Iv.has(typeof i))r.push(tn(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),Gp=$("$ZodFunction",(t,e)=>(ve.init(t,e),Object.defineProperty(t,"_def",{value:e}),t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let n=t._def.input?Po(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?Po(t._def.output,o):o},"_zod",{value:t._zod,enumerable:!1})},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let n=t._def.input?await Ao(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await Ao(t._def.output,o):o},"_zod",{value:t._zod,enumerable:!1})},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new cl({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),Jp=$("$ZodPromise",(t,e)=>{ve.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),oa=$("$ZodLazy",(t,e)=>{ve.init(t,e),kv(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),xe(t,"pattern",r=>r.innerType?._zod?.pattern),xe(t,"propValues",r=>r.innerType?._zod?.propValues),xe(t,"optin",r=>r.innerType?._zod?.optin??void 0),xe(t,"optout",r=>r.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),Xp=$("$ZodCustom",(t,e)=>{it.init(t,e),ve.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>cT(o,r,i,t));cT(n,r,i,t)}})});function gT(t){return t!==null&&typeof t=="object"}function rb(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}function pl(t,e,r){let i=yT.get(t);if(i!==void 0)return i?fl:aa;if(e.has(t))return fl;e.add(t);let n=aa,o=u=>{if(n!==fl&&u?._zod){let d=pl(u,e,r);d>n&&(n=d)}},s=(u,d)=>{let p=aa;for(let f of Reflect.ownKeys(u)){let h=Object.getOwnPropertyDescriptor(u,f);if(d&&!h.enumerable)continue;let m=h.get?eh:h.value?._zod?pl(h.value,e,r):aa;m>p&&(p=m)}return p},a=u=>{u>n&&(n=u)},c=t._zod.def,l=c.type;switch(l){case"object":{let u=Zs(c);a(u?s(u,!0):eh),o(c.catchall);break}case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(r?t._zod.innerType:void 0);a(u?pl(u,e,!1):eh);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(let f of p)o(f)}}}return e.delete(t),BF(t,n)}function BF(t,e){return e!==eh&&yT.set(t,e===fl),e}function rh(t){return pl(t,new Set,!0)!==aa}function HF(t,e){let r=t.buckets.get(e);return r||(r=new WeakMap,t.buckets.set(e,r)),r}function hl(){return WF}function nh(t,e){let r=t[nb]?.backEdges;return r!==void 0&&gT(e)&&r.has(e)}var th,nb,mT,yT,aa,eh,fl,Yp,Qp,WF,ib=w(()=>{B();th=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},nb="~memo",mT=[];yT=new WeakMap,aa=0,eh=1,fl=2;Qp=[],WF={alloc(t,e,r){let i=Yp;if(!i)return r;Yp=void 0;let n={value:r,issues:null};return i.set(e.value,n),Qp.push(n),r},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let r=t._zod.parse,i=(n,o)=>{if(o.direction!=="backward"&&nh(o,n.value))throw new th;return r(n,o)};t._zod.parse=i,t._zod.run===r&&(t._zod.run=i)})},attach(t){var e;let r,i=!1,n,o;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let s=t._zod.parse,a=(c,l)=>{if(r===void 0){let y=pl(t,new Set,!1);if(y===aa)return t._zod.parse=s,t._zod.run===a&&(t._zod.run=s),s(c,l);y===fl||i?r=!0:i=!0}let u=c.value;if(!gT(u))return s(c,l);let d=l[nb];d||(d={buckets:new WeakMap,backEdges:void 0},l[nb]=d);let p;n===l?p=o:(p=HF(d,t),n=l,o=p);let f=p.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...rb(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;Yp=p;let h=Qp.length,m=s(c,l);Yp=void 0;let g=Qp.length>h?Qp.pop():void 0;return m instanceof Promise?m.then(y=>(g&&(g.issues=y.issues.length?rb(y.issues):mT),y)):(g&&(g.issues=m.issues.length?rb(m.issues):mT),m)};t._zod.parse=a,t._zod.run===s&&(t._zod.run=a)})}}});function vT(){return{localeError:KF()}}var KF,_T=w(()=>{B();KF=()=>{let t={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"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[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",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",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",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",currency_code:"\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}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 ${R(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: ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?` \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"} ${o} ${n.maximum.toString()} ${s.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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\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 ${o} ${n.minimum.toString()} ${s.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 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${r[o.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":""}: ${I(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 bT(){return{localeError:GF()}}var GF,wT=w(()=>{B();GF=()=>{let t={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"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[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",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",currency_code:"valyuta kodu",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${R(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.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":""}: ${I(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 $T(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}function kT(){return{localeError:JF()}}var JF,ST=w(()=>{B();JF=()=>{let t={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"},map:{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 e(n){return t[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",mac:"MAC \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",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=$T(a,s.unit.one,s.unit.few,s.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 ${s.verb} ${o}${n.maximum.toString()} ${c}`}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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=$T(a,s.unit.one,s.unit.few,s.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 ${s.verb} ${o}${n.minimum.toString()} ${c}`}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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.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"}: ${I(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 xT(){return{localeError:XF()}}var XF,IT=w(()=>{B();XF=()=>{let t={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return t[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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\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 ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\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 ${o}${n.minimum.toString()} ${s.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.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":""}: ${I(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 ET(){return{localeError:YF()}}var YF,TT=w(()=>{B();YF=()=>{let t={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function e(n){return t[n]??null}let r={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",currency_code:"\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${a}`}case"invalid_value":return n.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${R(n.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${I(n.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${n.origin??"\u09AE\u09BE\u09A8"} ${o}${n.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${n.origin??"\u09AE\u09BE\u09A8"} ${o}${n.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${n.origin} ${o}${n.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${n.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${n.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${n.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${n.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}}});function OT(){return{localeError:QF()}}var QF,PT=w(()=>{B();QF=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function e(n){return t[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",mac:"adre\xE7a MAC",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",credit_card:"n\xFAmero de targeta de cr\xE8dit",currency_code:"codi de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${R(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${I(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.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":""}: ${I(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 AT(){return{localeError:e6()}}var e6,RT=w(()=>{B();e6=()=>{let t={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function e(n){return t[n]??null}let r={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",currency_code:"\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>a.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(a);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${a}${l?"":c}`}case"invalid_value":return n.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${R(n.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${I(n.values,"|")}`;case"too_big":{let o=e(n.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${n.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${n.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=e(n.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${n.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${n.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${r[o.format]??n.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${n.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${I(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${n.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${n.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}}});function jT(){return{localeError:t6()}}var t6,zT=w(()=>{B();t6=()=>{let t={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"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[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",mac:"MAC 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",credit_card:"\u010D\xEDslo kreditn\xED karty",currency_code:"k\xF3d m\u011Bny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${R(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.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: ${I(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 CT(){return{localeError:r6()}}var r6,NT=w(()=>{B();r6=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${R(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${I(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 DT(){return{localeError:n6()}}var n6,LT=w(()=>{B();n6=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function e(n){return t[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",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",currency_code:"W\xE4hrungscode",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${R(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.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"}: ${I(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 UT(){return{localeError:i6()}}var i6,MT=w(()=>{B();i6=()=>{let t={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 e(n){return t[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",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",currency_code:"\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\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 ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\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 ${o}${n.minimum.toString()} ${s.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[o.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"}: ${I(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 ih(){return{localeError:o6()}}var o6,ob=w(()=>{B();o6=()=>{let t={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 e(o){return t[o]??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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function n(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):i[o]??o}return o=>{switch(o.code){case"invalid_type":{let s=n(o.expected),a=j(o.input),c=n(a,o.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${R(o.values[0])}`:`Invalid option: expected one of ${I(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",a=e(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",a=e(o.origin);return a?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${I(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(a=>`'${a}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}}});function FT(){return{localeError:s6()}}var s6,ZT=w(()=>{B();s6=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function e(n){return t[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",mac:"MAC-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",credit_card:"kreditkarta numero",currency_code:"valuta kodo",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${R(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.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":""}: ${I(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 qT(){return{localeError:a6()}}var a6,VT=w(()=>{B();a6=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[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",mac:"direcci\xF3n MAC",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",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",currency_code:"c\xF3digo de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${R(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.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":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function BT(){return{localeError:c6()}}var c6,HT=w(()=>{B();c6=()=>{let t={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"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return t[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",mac:"MAC \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",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",currency_code:"\u06A9\u062F \u0627\u0631\u0632",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a} \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 ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \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 ${R(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 ${I(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.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: ${I(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 WT(){return{localeError:l6()}}var l6,KT=w(()=>{B();l6=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return t[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",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",currency_code:"valuuttakoodi",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${R(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.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"}: ${I(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 GT(){return{localeError:u6()}}var u6,JT=w(()=>{B();u6=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"expression r\xE9guli\xE8re",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",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",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:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instance de ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${R(n.values[0])} attendu`:`Option invalide : une valeur parmi ${I(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${r[o.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":""} : ${I(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 XT(){return{localeError:d6()}}var d6,YT=w(()=>{B();d6=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[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",mac:"adresse MAC",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",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${R(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.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":""} : ${I(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 QT(){return{localeError:f6()}}var f6,eO=w(()=>{B();f6=()=>{let t={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function e(n){return t[n]??null}let r={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",currency_code:"\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${a}`}case"invalid_value":return n.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${R(n.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${I(n.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${n.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${n.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${n.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${n.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${n.origin} ${o}${n.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${n.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${n.keys.length>1?"\u0A93":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${n.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${n.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}}});function tO(){return{localeError:p6()}}var p6,rO=w(()=>{B();p6=()=>{let t={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"}},e={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=l=>l?t[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??t.unknown.label},n=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={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"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",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"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",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"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},currency_code:{label:"\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",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"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??i(u),p=j(l.input),f=c[p]??t[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.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 ${R(l.values[0])}`;let u=l.values.map(f=>R(f));if(l.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",m=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let g=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`}let m=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,h=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${h}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${I(l.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(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function nO(){return{localeError:h6()}}var h6,iO=w(()=>{B();h6=()=>{let t={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function e(n){return t[n]??null}let r={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return n.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${R(n.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${n.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin??"\u092E\u093E\u0928"} ${o}${n.maximum} \u0939\u094B`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin} \u092E\u0947\u0902 ${o}${n.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin} ${o}${n.minimum} \u0939\u094B`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${n.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${n.keys.length>1?"\u092F\u093E\u0901":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${n.origin} \u092E\u0947\u0902`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${n.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${n.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}}});function oO(){return{localeError:m6()}}var m6,sO=w(()=>{B();m6=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(n){return t[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",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",currency_code:"kod valute",iban:"IBAN",jwt:"JWT",template_literal:"unos"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${R(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${n.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${n.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${r[o.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"}: ${I(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function aO(){return{localeError:g6()}}var g6,cO=w(()=>{B();g6=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function e(n){return t[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",mac:"MAC 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",credit_card:"hitelk\xE1rtyasz\xE1m",currency_code:"p\xE9nznemk\xF3d",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${R(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.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":""}: ${I(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 lO(t,e,r){return Math.abs(t)===1?e:r}function ca(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}function uO(){return{localeError:y6()}}var y6,dO=w(()=>{B();y6=()=>{let t={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"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(n){return t[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",mac:"MAC \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",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",currency_code:"\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=lO(a,s.unit.one,s.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 ${ca(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${c}`}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 ${ca(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=lO(a,s.unit.one,s.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 ${ca(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${c}`}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 ${ca(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.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":""}. ${I(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ca(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 ${ca(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function fO(){return{localeError:v6()}}var v6,pO=w(()=>{B();v6=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function e(n){return t[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",mac:"alamat MAC",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",credit_card:"nomor kartu kredit",currency_code:"kode mata uang",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${R(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.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":""}: ${I(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 hO(){return{localeError:_6()}}var _6,mO=w(()=>{B();_6=()=>{let t={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"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function e(n){return t[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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",currency_code:"gjaldmi\xF0ilsk\xF3\xF0i",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${R(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.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"}: ${I(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 gO(){return{localeError:b6()}}var b6,yO=w(()=>{B();b6=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function e(n){return t[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",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",currency_code:"codice valuta",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${R(n.values[0])}`:`Opzione non valida: atteso uno tra ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${r[o.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"}: ${I(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 vO(){return{localeError:w6()}}var w6,_O=w(()=>{B();w6=()=>{let t={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"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return t[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",mac:"MAC\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",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",currency_code:"\u901A\u8CA8\u30B3\u30FC\u30C9",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${R(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${I(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.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":""}: ${I(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 bO(){return{localeError:$6()}}var $6,wO=w(()=>{B();$6=()=>{let t={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"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(n){return t[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",mac:"MAC \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",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",currency_code:"\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}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 ${R(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 ${I(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\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"} ${s.verb} ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\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} ${s.verb} ${o}${n.minimum.toString()} ${s.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"-\u10D8\u10D7`:o.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 "${o.suffix}"-\u10D8\u10D7`:o.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 "${o.includes}"-\u10E1`:o.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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.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"}: ${I(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 oh(){return{localeError:k6()}}var k6,sb=w(()=>{B();k6=()=>{let t={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"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return t[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",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",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",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",currency_code:"\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.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 ${I(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 $O(){return oh()}var kO=w(()=>{sb()});function SO(){return{localeError:S6()}}var S6,xO=w(()=>{B();S6=()=>{let t={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function e(n){return t[n]??null}let r={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",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 \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",currency_code:"\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${R(n.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${n.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${n.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${n.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${n.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}}});function IO(){return{localeError:x6()}}var x6,EO=w(()=>{B();x6=()=>{let t={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"},map:{unit:"\uAC1C",verb:"to have"}};function e(n){return t[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",mac:"MAC \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",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",currency_code:"\uD1B5\uD654 \uCF54\uB4DC",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${R(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${I(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.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: ${I(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 TO(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}function OO(){return{localeError:I6()}}var ml,I6,PO=w(()=>{B();ml=t=>t.charAt(0).toUpperCase()+t.slice(1);I6=()=>{let t={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 e(n,o,s,a){let c=t[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"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",mac:"MAC 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",credit_card:"kredito kortel\u0117s numeris",currency_code:"valiutos kodas",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${R(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${I(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=e(n.origin,TO(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${ml(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${ml(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=e(n.origin,TO(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${ml(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${ml(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.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"}: ${I(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${ml(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function AO(){return{localeError:E6()}}var E6,RO=w(()=>{B();E6=()=>{let t={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"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return t[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",mac:"MAC \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",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\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 ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\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 ${o}${n.minimum.toString()} ${s.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${r[o.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"}: ${I(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 jO(){return{localeError:T6()}}var T6,zO=w(()=>{B();T6=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[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",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",currency_code:"kod mata wang",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${R(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(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 CO(){return{localeError:O6()}}var O6,NO=w(()=>{B();O6=()=>{let t={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function e(n){return t[n]??null}let r={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return n.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${R(n.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${n.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${n.origin??"\u092E\u093E\u0928"} ${o}${n.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${n.origin} \u092E\u093E ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${n.origin} ${o}${n.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${n.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${n.keys.length>1?"\u0939\u0930\u0942":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${n.origin} \u092E\u093E`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${n.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${n.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}}});function DO(){return{localeError:P6()}}var P6,LO=w(()=>{B();P6=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function e(n){return t[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",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",currency_code:"valutacode",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${R(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.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":""}: ${I(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 UO(){return{localeError:A6()}}var A6,MO=w(()=>{B();A6=()=>{let t={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function e(n){return t[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-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventa instanceof ${n.expected}, fekk ${a}`:`Ugyldig input: forventa ${o}, fekk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventa ${R(n.values[0])}`:`Ugyldig val: forventa eitt av ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventa ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventa ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${I(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 FO(){return{localeError:R6()}}var R6,ZO=w(()=>{B();R6=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${R(n.values[0])}`:`Ugyldig valg: forventet en av ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${I(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 qO(){return{localeError:j6()}}var j6,VO=w(()=>{B();j6=()=>{let t={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"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return t[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",mac:"MAC 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",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${R(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.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":""}: ${I(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 BO(){return{localeError:z6()}}var z6,HO=w(()=>{B();z6=()=>{let t={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"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[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",mac:"\u062F MAC \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",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",currency_code:"\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \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 ${R(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${I(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.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"}: ${I(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 WO(){return{localeError:C6()}}var C6,KO=w(()=>{B();C6=()=>{let t={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"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[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",mac:"adres MAC",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",credit_card:"numer karty kredytowej",currency_code:"kod waluty",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${R(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.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":""}: ${I(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 GO(){return{localeError:N6()}}var N6,JO=w(()=>{B();N6=()=>{let t={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function e(s){return t[s]??null}let r={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},n={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=n[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=j(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${R(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${I(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=e(s.origin);return c?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=e(s.origin);return c?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${r[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${I(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}}});function XO(){return{localeError:D6()}}var D6,YO=w(()=>{B();D6=()=>{let t={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function e(s){return t[s]??null}let r={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},n={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=n[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=j(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${R(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${I(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=e(s.origin);return c?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=e(s.origin);return c?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${r[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${I(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}}});function QO(){return{localeError:L6()}}var L6,eP=w(()=>{B();L6=()=>{let t={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 e(n){return t[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",credit_card:"num\u0103r de card de credit",currency_code:"cod valutar",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${R(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${r[o.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: ${I(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 tP(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}function rP(){return{localeError:U6()}}var U6,nP=w(()=>{B();U6=()=>{let t={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"},map:{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 e(n){return t[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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=tP(a,s.unit.one,s.unit.few,s.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 ${o}${n.maximum.toString()} ${c}`}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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=tP(a,s.unit.one,s.unit.few,s.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 ${o}${n.minimum.toString()} ${c}`}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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.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":""}: ${I(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 iP(){return{localeError:M6()}}var M6,oP=w(()=>{B();M6=()=>{let t={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function e(n){return t[n]??null}let r={regex:"regul\xE1rny 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:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",currency_code:"k\xF3d meny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${n.expected}, obdr\u017Ean\xE9 ${a}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${R(n.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${n.origin??"hodnota"} mus\xED ma\u0165 ${o}${n.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${n.origin??"hodnota"} mus\xED by\u0165 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED ma\u0165 ${o}${n.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED by\u0165 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${I(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\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 sP(){return{localeError:F6()}}var F6,aP=w(()=>{B();F6=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function e(n){return t[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",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",currency_code:"koda valute",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${R(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.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"}: ${I(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 cP(){return{localeError:Z6()}}var Z6,lP=w(()=>{B();Z6=()=>{let t={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"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return t[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-adress",ipv6:"IPv6-adress",mac:"MAC-adress",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",credit_card:"kreditkortsnummer",currency_code:"valutakod",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${R(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.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"}: ${I(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 uP(){return{localeError:q6()}}var q6,dP=w(()=>{B();q6=()=>{let t={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"},map:{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 e(n){return t[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",mac:"MAC \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",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",currency_code:"\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}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 ${R(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 ${I(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\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"} ${o}${n.maximum.toString()} ${s.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"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\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} ${o}${n.minimum.toString()} ${s.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} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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[o.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":""}: ${I(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 fP(){return{localeError:V6()}}var V6,pP=w(()=>{B();V6=()=>{let t={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",currency_code:"\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},i={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${a} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return n.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${R(n.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${I(n.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${n.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${n.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${n.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${n.origin} \u0431\u043E\u044F\u0434 ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${n.origin} \u0431\u043E\u044F\u0434 ${o}${n.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${r[o.format]??n.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${n.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${n.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${I(n.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${n.options.map(s=>`'${s}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${n.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}}});function hP(){return{localeError:B6()}}var B6,mP=w(()=>{B();B6=()=>{let t={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"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return t[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",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",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)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",currency_code:"\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={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 o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.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${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.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: ${I(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 gP(){return{localeError:H6()}}var H6,yP=w(()=>{B();H6=()=>{let t={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function e(n){return t[n]??null}let r={regex:"giri\u015F",email:"e-po\xE7ta salgysy",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 sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",currency_code:"wal\xFDuta kody",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${a} alyndy`}case"invalid_value":return n.values.length===1?`N\xE4dogry baha: ${R(n.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Has uly: gara\u015Fyl\xFDan ${n.origin??"baha"} ${o} ${n.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${n.origin??"baha"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xE4dogry san: ${n.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${n.keys.length>1?"lar":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${n.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}}});function vP(){return{localeError:W6()}}var W6,_P=w(()=>{B();W6=()=>{let t={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"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[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",mac:"MAC 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",credit_card:"kredi kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${R(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.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":""}: ${I(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 sh(){return{localeError:K6()}}var K6,ab=w(()=>{B();K6=()=>{let t={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return t[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",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}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 ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\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"} ${s.verb} ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\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} ${s.verb} ${o}${n.minimum.toString()} ${s.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.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":""}: ${I(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 bP(){return sh()}var wP=w(()=>{ab()});function $P(){return{localeError:G6()}}var G6,kP=w(()=>{B();G6=()=>{let t={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"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[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",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \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",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",currency_code:"\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${R(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${I(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.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 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.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 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.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":""}: ${I(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 SP(){return{localeError:J6()}}var J6,xP=w(()=>{B();J6=()=>{let t={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 e(n){return t[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",credit_card:"kredit karta raqami",currency_code:"valyuta kodi",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${R(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.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":""}: ${I(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 IP(){return{localeError:X6()}}var X6,EP=w(()=>{B();X6=()=>{let t={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"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[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",mac:"\u0111\u1ECBa ch\u1EC9 MAC",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",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",currency_code:"m\xE3 ti\u1EC1n t\u1EC7",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${R(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 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.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: ${I(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 TP(){return{localeError:Y6()}}var Y6,OP=w(()=>{B();Y6=()=>{let t={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"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[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",mac:"MAC\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",credit_card:"\u4FE1\u7528\u5361\u53F7",currency_code:"\u8D27\u5E01\u4EE3\u7801",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${R(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.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): ${I(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 PP(){return{localeError:Q6()}}var Q6,AP=w(()=>{B();Q6=()=>{let t={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"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[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",mac:"MAC \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",credit_card:"\u4FE1\u7528\u5361\u865F",currency_code:"\u8CA8\u5E63\u4EE3\u78BC",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${R(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.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${I(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 RP(){return{localeError:eZ()}}var eZ,jP=w(()=>{B();eZ=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function e(n){return t[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",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",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",credit_card:"n\u1ECDmba kaadi gbese",currency_code:"koodu ow\xF3",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=j(n.input),a=i[s]??s;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 ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${R(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${I(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.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: ${I(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 la={};Jr(la,{ar:()=>vT,az:()=>bT,be:()=>kT,bg:()=>xT,bn:()=>ET,ca:()=>OT,ckb:()=>AT,cs:()=>jT,da:()=>CT,de:()=>DT,el:()=>UT,en:()=>ih,eo:()=>FT,es:()=>qT,fa:()=>BT,fi:()=>WT,fr:()=>GT,frCA:()=>XT,gu:()=>QT,he:()=>tO,hi:()=>nO,hr:()=>oO,hu:()=>aO,hy:()=>uO,id:()=>fO,is:()=>hO,it:()=>gO,ja:()=>vO,ka:()=>bO,kh:()=>$O,km:()=>oh,kn:()=>SO,ko:()=>IO,lt:()=>OO,mk:()=>AO,ms:()=>jO,ne:()=>CO,nl:()=>DO,nn:()=>UO,no:()=>FO,ota:()=>qO,pl:()=>WO,ps:()=>BO,pt:()=>GO,ptBR:()=>XO,ro:()=>QO,ru:()=>rP,sk:()=>iP,sl:()=>sP,sv:()=>cP,ta:()=>uP,tg:()=>fP,th:()=>hP,tk:()=>gP,tr:()=>vP,ua:()=>bP,uk:()=>sh,ur:()=>$P,uz:()=>SP,vi:()=>IP,yo:()=>RP,zhCN:()=>TP,zhTW:()=>PP});var ah=w(()=>{_T();wT();ST();IT();TT();PT();RT();zT();NT();LT();MT();ob();ZT();VT();HT();KT();JT();YT();eO();rO();iO();sO();cO();dO();pO();mO();yO();_O();wO();kO();sb();xO();EO();PO();RO();zO();NO();LO();MO();ZO();VO();HO();KO();JO();YO();eP();nP();oP();aP();lP();dP();pP();mP();yP();_P();wP();ab();kP();xP();EP();OP();AP();jP()});function lh(){return new ch}var zP,cb,lb,ch,Jt,gl=w(()=>{cb=Symbol("ZodOutput"),lb=Symbol("ZodInput"),ch=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(zP=globalThis).__zod_globalRegistry??(zP.__zod_globalRegistry=lh());Jt=globalThis.__zod_globalRegistry});function rZ(t,e){try{return dh(t,{assertOnly:!0})}catch{return e}}function pb(t,e){try{let r=dh(t),i=uh(t,r);return i._zod.bag.validator=rZ(t,r),i}catch(r){if(e?.strict)throw r;return t}}function uh(t,e){if(rh(t))throw new je("a schema whose subtree contains a reference cycle");let r=Be(t),i=t._zod.run,n=i.__originalRun??i,o=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[CP]||a&&nh(a,s.value))return n(s,a);let c=e(s.value);return c!==hr?(s.value=c,s):(a&&(a[CP]=!0),n(s,a))};return o.__originalRun=n,r._zod.bag.fallbackRun=n,r._zod.bag.validator=e,r._zod.run=o,i.__originalRun||nZ(r,t,e),r}function nZ(t,e,r){let i=t,n=e;if(typeof n.safeParse=="function"){let o=n.safeParse;i.safeParse=(s,a)=>{let c=r(s);return c!==hr?{success:!0,data:c}:o(s,a)}}if(typeof n.parse=="function"){let o=n.parse;i.parse=(s,a)=>{let c=r(s);return c!==hr?c:o(s,a)}}}function dh(t,e){let r=!0;try{r=rh(t)}catch{}if(r)throw new je("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},n=new zo(["input"]),o=bt(n,i,t,"input",!e?.assertOnly);n.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...i.constants.keys()],a=[hr,...i.constants.values()],c=n.content.join(`
|
|
60
|
+
`),l=e?.debug?s.length>0?`// Constants: ${s.join(", ")}
|
|
61
|
+
${c}`:c:"",u=Function,d=`return (input) => {
|
|
62
|
+
${c}
|
|
63
|
+
}`,p;try{p=new u(...s,d)(...a)}catch(f){throw new je(`this schema (generated code failed to evaluate: ${f.message})`)}return e?.debug&&(p.code=l),p.definite=i.definite,p}function he(t,e){for(let[i,n]of t.constants)if(n===e)return i;let r=`c${t.constantCounter++}`;return t.constants.set(r,e),r}function Lo(t,e){return t.definite=!1,he(t,e)}function fe(t){return`v${t.varCounter++}`}function iZ(t,e){let r=t._zod.run({value:e,issues:[]},{});if(r&&typeof r.then=="function")return hr;let i=r;return i.issues.length===0?i.value:hr}function or(t,e,r,i,n=!0){let o=t.content.length,s=e.constants.size,a=e.constantCounter,c=e.varCounter;try{return bt(t,e,r,i,n)}catch(l){if(!(l instanceof je)||!l.islandable)throw l;if(t.content.length=o,e.constants.size>s){let u=Array.from(e.constants.keys()).slice(s);for(let d of u)e.constants.delete(d)}return e.constantCounter=a,e.varCounter=c,oZ(t,e,r,i)}}function oZ(t,e,r,i){e.definite=!1;let n=he(e,r),o=he(e,iZ),s=fe(e);return t.write(`const ${s} = ${o}(${n}, ${i});`),t.write(`if (${s} === INVALID) return INVALID;`),s}function aZ(t,e,r,i){let n=r._zod.def.checks;if(!n||n.length===0)return i;let o=i;for(let s of n){let a=s._zod.def;if(a.when&&!sZ.has(a.check))throw new je('check with a custom "when" condition');switch(a.check){case"greater_than":cZ(t,e,a,o);break;case"less_than":lZ(t,e,a,o);break;case"multiple_of":uZ(t,e,a,o);break;case"number_format":FP(t,a,o);break;case"min_length":{let c=No(a.minimum,"min_length"),l=ub(t,e,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);t.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=No(a.maximum,"max_length"),l=ub(t,e,o,`${o}.length > ${c}`);t.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=No(a.length,"length_equals"),l=ub(t,e,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);t.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":t.write(`if (${o}.size < ${No(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":t.write(`if (${o}.size > ${No(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":t.write(`if (${o}.size !== ${No(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=ZP(t,e,a,o);break;case"custom":o=gZ(t,e,s,o);break;case"bigint_format":dZ(t,a,o);break;case"mime_type":fZ(t,e,a,o);break;case"property":hZ(t,e,a,o);break;case"properties":pZ(t,e,a,o);break;case"overwrite":{let c=fe(e);mZ(t,e,s,o,c),o=c;break}default:throw new je(`check type ${a.check}`)}}return o}function ub(t,e,r,i){let n=he(e,Oo),o=fe(e);return t.write(`const ${o} = typeof ${r} === "string" && ${i} ? ${n}(${r}) : ${r}.length;`),o}function No(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new je(`${e} bound of type ${typeof t}`);return`${t}`}function MP(t,e){if(typeof e=="bigint")return`${e}n`;if(typeof e=="number"){if(Number.isNaN(e))throw new je("comparison check with NaN bound");return`${e}`}if(e instanceof Date){if(Number.isNaN(e.getTime()))throw new je("comparison check with Invalid Date bound");return he(t,e)}throw new je(`comparison check bound of type ${typeof e}`)}function cZ(t,e,r,i){let n=r.inclusive?"<":"<=";t.write(`if (${i} ${n} ${MP(e,r.value)}) return INVALID;`)}function lZ(t,e,r,i){let n=r.inclusive?">":">=";t.write(`if (${i} ${n} ${MP(e,r.value)}) return INVALID;`)}function uZ(t,e,r,i){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new je("multiple_of check with a zero divisor");t.write(`if (${i} % ${r.value}n !== 0n) return INVALID;`)}else{let n=he(e,Fc);t.write(`if (${n}(${i}, ${No(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function FP(t,e,r){let i=e.format;switch(i){case"safeint":t.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":t.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":t.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":t.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":t.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new je(`number format ${i}`)}}function dZ(t,e,r){let i=e.format;if(i)switch(i){case"int64":t.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new je(`bigint format ${i}`)}}function fZ(t,e,r,i){let n=r.mime;if(n&&n.length>0){let o=he(e,new Set(n));t.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function pZ(t,e,r,i){if(r.when)throw new je('check with a custom "when" condition');t.write(`if (${i} == null) return INVALID;`);let n=r.shape;for(let o of Reflect.ownKeys(n)){let s=typeof o=="symbol"?he(e,o):fr(o),a=fe(e);t.write(`const ${a} = ${i}[${s}];`),or(t,e,n[o],a,!1)}}function hZ(t,e,r,i){let n=`${i}[${JSON.stringify(r.property)}]`;bt(t,e,r.schema,n)}function mZ(t,e,r,i,n){let o=r._zod.def.tx;if(!o)throw new je("overwrite check without a transform function");if(Uo(o))throw new vn("z.compile: async overwrite transforms are not supported");let s=he(e,o);t.write(`const ${n} = ${s}(${i});`)}function db(){throw new Er}function hb(t){this.issues.push(t)}function gZ(t,e,r,i){let n=r._zod.def;if(n.fn){if(Uo(n.fn))throw new vn("z.compile: async .refine() predicates are not supported");let o=Lo(e,n.fn),s=he(e,db),a=fe(e);return t.write(`const ${a} = ${o}(${i});`),t.write(`if (${a} instanceof Promise) ${s}();`),t.write(`if (!${a}) return INVALID;`),i}if(r._zod.check){if(Uo(r._zod.check))throw new vn("z.compile: async .superRefine() / check functions are not supported");let o=r._zod.check,a=Lo(e,l=>{let u={value:l,issues:[],addIssue:hb};return o(u)instanceof Promise&&db(),u.issues.length===0?u.value:hr}),c=fe(e);return t.write(`const ${c} = ${a}(${i});`),t.write(`if (${c} === INVALID) return INVALID;`),c}throw new je("custom check without a predicate or check function")}function ZP(t,e,r,i,n=!0){let o=r.format;if(o==="base64"){let l=he(e,nl);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="base64url"){let l=he(e,dp);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="jwt"){let l=he(e,vp),u=he(e,r.alg??null);return t.write(`if (!${l}(${i}, ${u})) return INVALID;`),i}if(o==="ipv6"){let l=he(e,rl);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="cidrv6"){let l=he(e,ap);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="credit_card"){let l=he(e,hp);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="iban"){let l=he(e,gp);return t.write(`if (!${l}(${i})) return INVALID;`),i}let s=r;if(o==="url"||o==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let l=he(e,Hf),u=he(e,r),d=fe(e),p=fe(e);if(t.write(`const ${d} = ${i}.trim();`),t.write(`const ${p} = ${l}(${d}, ${u});`),t.write(`if (typeof ${p} === "number") return INVALID;`),s.hostname!==void 0){let m=he(e,Wf);t.write(`if (!${m}(${p}, ${u}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let m=he(e,Kf);t.write(`if (!${m}(${p}, ${u}.protocol)) return INVALID;`)}if(!n)return null;let f=fe(e),h=s.normalize?`${p}.href`:`${he(e,tl)}(${d})`;return t.write(`const ${f} = ${h};`),f}let a=r.fn;if(a){if(Uo(a))throw new je(`async string format ${o}`);let l=he(e,a);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(yZ.has(o)&&r.pattern){let l=he(e,r.pattern);return t.write(`${l}.lastIndex = 0;`),t.write(`if (!${l}.test(${i})) return INVALID;`),i}let c=r.format;switch(c){case"regex":throw new je("regex format without a pattern");case"lowercase":t.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":t.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":t.write(`if (!${i}.includes(${fr(r.includes)})) return INVALID;`);break;case"starts_with":{let l=r.prefix;t.write(`if (${i}.slice(0, ${l.length}) !== ${fr(l)}) return INVALID;`);break}case"ends_with":{let l=r.suffix;t.write(`if (${i}.slice(-${l.length}) !== ${fr(l)}) return INVALID;`);break}default:throw new je(`string format ${c}`)}return i}function bt(t,e,r,i,n=!0){let o=r._zod.def,s=o.type;if(o.coerce)throw new je(`coercion (z.coerce.${s}())`);let a=n||!!o.checks?.length,c;switch(s){case"string":c=vZ(t,e,r,i,a);break;case"number":c=_Z(t,r,i);break;case"boolean":c=bZ(t,i);break;case"bigint":c=wZ(t,r,i);break;case"symbol":c=$Z(t,i);break;case"undefined":c=kZ(t,i);break;case"null":c=SZ(t,i);break;case"any":case"unknown":c=i;break;case"never":t.write("return INVALID;"),c=i;break;case"void":c=xZ(t,i);break;case"nan":c=IZ(t,i);break;case"date":c=EZ(t,i);break;case"object":c=TZ(t,e,r,i,a);break;case"optional":c=OZ(t,e,r,i,a);break;case"nullable":c=RZ(t,e,r,i,a);break;case"array":c=jZ(t,e,r,i,a);break;case"literal":c=zZ(t,e,r,i);break;case"enum":c=CZ(t,e,r,i);break;case"readonly":{let l=DP(t,e,r,i),u=fe(e);t.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":DP(t,e,r,i),c="true";break;case"default":case"prefault":c=NZ(t,e,r,i);break;case"nonoptional":c=DZ(t,e,r,i);break;case"tuple":c=LZ(t,e,r,i);break;case"union":c=UZ(t,e,r,i);break;case"intersection":c=ZZ(t,e,r,i);break;case"record":c=qZ(t,e,r,i);break;case"map":c=BZ(t,e,r,i);break;case"set":c=HZ(t,e,r,i);break;case"file":c=WZ(t,i);break;case"template_literal":c=KZ(t,e,r,i);break;case"lazy":c=GZ(t,e,r,i);break;case"pipe":c=JZ(t,e,r,i);break;case"custom":c=XZ(t,e,r,i);break;case"transform":c=eq(t,e,r,i);break;case"catch":c=QZ(t,e,r,i);break;default:throw new je(`schema type ${s}`)}return c===null?null:aZ(t,e,r,c)}function vZ(t,e,r,i,n=!0){t.write(`if (typeof ${i} !== "string") return INVALID;`);let o=r._zod.def;return o.format===void 0?i:ZP(t,e,o,i,n)}function _Z(t,e,r){t.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let i=e._zod.def;return i.check==="number_format"&&i.format&&FP(t,{format:i.format},r),r}function bZ(t,e){return t.write(`if (typeof ${e} !== "boolean") return INVALID;`),e}function wZ(t,e,r){t.write(`if (typeof ${r} !== "bigint") return INVALID;`);let i=e._zod.def;if(i.format)switch(i.format){case"int64":t.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function $Z(t,e){return t.write(`if (typeof ${e} !== "symbol") return INVALID;`),e}function kZ(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function SZ(t,e){return t.write(`if (${e} !== null) return INVALID;`),e}function xZ(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function IZ(t,e){return t.write(`if (typeof ${e} !== "number" || !Number.isNaN(${e})) return INVALID;`),e}function EZ(t,e){return t.write(`if (!(${e} instanceof Date) || Number.isNaN(${e}.getTime())) return INVALID;`),e}function TZ(t,e,r,i,n=!0){let o=r._zod.def;t.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let s=o.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,u=v=>typeof v=="symbol"?he(e,v):fr(v),d=v=>typeof v=="symbol"?`[${u(v)}]`:fr(v),p=s;if(a.includes("__proto__"))throw new je('object shape key "__proto__"');let f=new Map;for(let v of l){let b=p[v],x=u(v),k=fe(e);if(t.write(`const ${k} = ${i}[${x}];`),b._zod.optin!==void 0){let E=fe(e);t.write(`let ${E} = (() => {`),t.indented(O=>{let X=or(O,e,b,k);O.write(`return ${X};`)}),t.write("})();"),b._zod.optout==="optional"?(t.write(`if (${E} === INVALID) {`),t.indented(O=>{O.write(`if (${x} in ${i}) return INVALID;`),O.write(`${E} = undefined;`)}),t.write("}")):t.write(`if (${E} === INVALID) return INVALID;`),f.set(v,E)}else{AZ(b)&&t.write(`if (!(${x} in ${i})) return INVALID;`);let E=or(t,e,b,k,n);E!==null&&f.set(v,E)}}let h=o.catchall,m="none";if(h){let v=h._zod.def.type;if(v==="never"){let b=a.map(x=>`k !== ${fr(x)}`).join(" && ")||"true";t.write(`for (const k in ${i}) {`),t.indented(x=>{x.write(`if (${b}) return INVALID;`)}),t.write("}")}else(v==="unknown"||v==="any")&&!h._zod.def.checks?.length?m="passthrough":m="schema"}let g=fe(e),y=l.some(v=>NP(p[v])||fb(p[v]));if(!n){if(m==="schema"){let v=a.length>0?he(e,new Set(a)):null;t.write(`for (const k in ${i}) {`),t.indented(b=>{b.write('if (k === "__proto__") continue;'),v&&b.write(`if (${v}.has(k)) continue;`);let x=fe(e);b.write(`const ${x} = ${i}[k];`),or(b,e,h,x,!1)}),t.write("}")}return null}if(y){t.write(`const ${g} = {};`);for(let v of l){let b=u(v),x=f.get(v);fb(p[v])?t.write(`if (${b} in ${i}) ${g}[${b}] = ${x};`):NP(p[v])?t.write(`if (${x} !== undefined || ${b} in ${i}) ${g}[${b}] = ${x};`):t.write(`${g}[${b}] = ${x};`)}}else{let v=l.map(b=>`${d(b)}: ${f.get(b)}`).join(", ");t.write(`const ${g} = { ${v} };`)}if(m!=="none"){let v=a.length>0?he(e,new Set(a)):null;t.write(`for (const k in ${i}) {`),t.indented(b=>{if(b.write('if (k === "__proto__") continue;'),v&&b.write(`if (${v}.has(k)) continue;`),m==="passthrough")b.write(`${g}[k] = ${i}[k];`);else{let x=fe(e);b.write(`const ${x} = ${i}[k];`);let k=or(b,e,h,x);b.write(`${g}[k] = ${k};`)}}),t.write("}")}return g}function OZ(t,e,r,i,n=!0){let o=r._zod.def;if(PZ(r))return bt(t,e,o.innerType,i,n);if(o.innerType._zod.optin==="defaulted"){let a=fe(e),c=fe(e);return t.write(`let ${a};`),t.write(`if (${i} === undefined) {`),t.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=bt(u,e,o.innerType,i);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),t.write("} else {"),t.indented(l=>{let u=bt(l,e,o.innerType,i);l.write(`${a} = ${u};`)}),t.write("}"),a}let s=n?fe(e):null;return s&&t.write(`let ${s};`),t.write(`if (${i} !== undefined) {`),t.indented(a=>{let c=bt(a,e,o.innerType,i,n);s&&c!==null&&a.write(`${s} = ${c};`)}),t.write("}"),s}function PZ(t){return t._zod.traits?.has("$ZodExactOptional")===!0}function AZ(t){return t._zod.optin===void 0&&Do(t)}function Do(t){if(t._zod.def.coerce)return!0;let e=t._zod.def;switch(e.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return e.innerType?Do(e.innerType):!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return e.innerType?Do(e.innerType):!0;case"catch":return!0;case"union":return e.options?e.options.some(Do):!0;case"intersection":return!e.left||!e.right?!0:Do(e.left)&&Do(e.right);case"pipe":return e.in?Do(e.in):!0;default:return!0}}function fb(t){return t._zod.optin==="optional"&&t._zod.optout==="optional"}function NP(t){return(t._zod.optin!=="defaulted"||t._zod.optout==="optional")&&ua(t)}function ua(t){let e=t._zod.def;switch(e.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return e.innerType?ua(e.innerType):!0;case"union":return e.options?e.options.some(ua):!0;case"intersection":return!e.left||!e.right||ua(e.left)||ua(e.right);case"pipe":return e.out?ua(e.out):!0;default:return!0}}function RZ(t,e,r,i,n=!0){let o=r._zod.def,s=n?fe(e):null;return s&&t.write(`let ${s} = null;`),t.write(`if (${i} !== null) {`),t.indented(a=>{let c=bt(a,e,o.innerType,i,n);s&&c!==null&&a.write(`${s} = ${c};`)}),t.write("}"),s}function jZ(t,e,r,i,n=!0){let o=r._zod.def;t.write(`if (!Array.isArray(${i})) return INVALID;`);let s=n?fe(e):null,a=fe(e),c=fe(e);return s&&t.write(`const ${s} = new Array(${i}.length);`),t.write(`for (let ${a} = 0; ${a} < ${i}.length; ${a}++) {`),t.indented(l=>{l.write(`const ${c} = ${i}[${a}];`);let u=or(l,e,o.element,c,n);s&&u!==null&&l.write(`${s}[${a}] = ${u};`)}),t.write("}"),s}function zZ(t,e,r,i){let o=r._zod.def.values;if(o.length!==1){let a=he(e,new Set(o));return t.write(`if (!${a}.has(${i})) return INVALID;`),i}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let a=he(e,new Set(o));return t.write(`if (!${a}.has(${i})) return INVALID;`),i}if(typeof s=="string")t.write(`if (${i} !== ${fr(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")t.write(`if (${i} !== ${s}) return INVALID;`);else if(s===null)t.write(`if (${i} !== null) return INVALID;`);else if(s===void 0)t.write(`if (${i} !== undefined) return INVALID;`);else if(typeof s=="bigint")t.write(`if (${i} !== ${s}n) return INVALID;`);else throw new je(`literal type ${typeof s}`);return i}function CZ(t,e,r,i){let n=r._zod.values;if(!n)throw new je("enum schema without enumerated values");let o=he(e,n);return t.write(`if (!${o}.has(${i})) return INVALID;`),i}function DP(t,e,r,i){let n=r._zod.def;return bt(t,e,n.innerType,i)}function NZ(t,e,r,i){let n=r._zod.def,s=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!s)return bt(t,e,n.innerType,i);let c=he(e,s),l=fe(e);return t.write(`let ${l} = ${i};`),t.write(`if (${i} === undefined) ${l} = ${c}();`),bt(t,e,n.innerType,l)}let a=fe(e);if(s){let c=he(e,s),l=he(e,qs);t.write(`let ${a};`),t.write(`if (${i} === undefined) {`),t.indented(u=>{u.write(`${a} = ${l}(${c}());`)}),t.write("} else {"),t.indented(u=>{let d=bt(u,e,n.innerType,i);u.write(`${a} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),t.write("}")}else t.write(`let ${a};`),t.write(`if (${i} !== undefined) {`),t.indented(c=>{let l=bt(c,e,n.innerType,i);c.write(`${a} = ${l};`)}),t.write("}");return a}function DZ(t,e,r,i){let n=r._zod.def,o=bt(t,e,n.innerType,i),s=fe(e);return t.write(`const ${s} = ${o};`),t.write(`if (${s} === undefined) return INVALID;`),s}function LZ(t,e,r,i){let n=r._zod.def,o=n.items,s=n.rest;t.write(`if (!Array.isArray(${i})) return INVALID;`);let a=LP(o,"optin"),c=LP(o,"optout");s?t.write(`if (${i}.length < ${a}) return INVALID;`):t.write(`if (${i}.length < ${a} || ${i}.length > ${o.length}) return INVALID;`);let l=fe(e);t.write(`const ${l} = [];`);for(let u=0;u<o.length;u++){let d=o[u];if(u>=c)t.write(`if (${l}.length === ${u}) {`),t.indented(p=>{p.write(`if (${u} < ${i}.length) {`),p.indented(f=>{let h=fe(e);f.write(`const ${h} = ${i}[${u}];`);let m=or(f,e,d,h);f.write(`${l}[${u}] = ${m};`)}),p.write("} else {"),p.indented(f=>{if(fb(d)){f.write(`${l}.length = ${u};`);return}let h=fe(e),m=fe(e);f.write(`const ${h} = undefined;`),f.write(`const ${m} = (() => {`),f.indented(g=>{let y=or(g,e,d,h);g.write(`return ${y};`)}),f.write("})();"),f.write(`if (${m} === INVALID || ${m} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${m};`)}),p.write("}")}),t.write("}");else{let p=fe(e);t.write(`const ${p} = ${i}[${u}];`);let f=or(t,e,d,p);t.write(`${l}[${u}] = ${f};`)}}if(s){let u=fe(e),d=fe(e);t.write(`for (let ${u} = ${o.length}; ${u} < ${i}.length; ${u}++) {`),t.indented(p=>{p.write(`const ${d} = ${i}[${u}];`);let f=or(p,e,s,d);p.write(`${l}[${u}] = ${f};`)}),t.write("}")}return l}function LP(t,e){for(let r=t.length-1;r>=0;r--)if(!(e==="optin"?t[r]._zod.optin!==void 0:t[r]._zod.optout==="optional"))return r+1;return 0}function UZ(t,e,r,i){let n=r._zod.def,o=n.options;if(n.discriminator)return MZ(t,e,n,i);if(n.inclusive===!1)throw new je("exclusive unions (z.xor)");if(o.length===0)return t.write("return INVALID;"),i;if(o.length===1)return bt(t,e,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=he(e,c);return t.write(`if (!${l}.has(${i})) return INVALID;`),i}let a=fe(e);t.write(`let ${a};`);for(let c=0;c<o.length;c++){let l=o[c];c===0?t.write(`${a} = (() => {`):t.write(`if (${a} === INVALID) ${a} = (() => {`),t.indented(u=>{let d=bt(u,e,l,i);u.write(`return ${d};`)}),t.write("})();")}return t.write(`if (${a} === INVALID) return INVALID;`),a}function MZ(t,e,r,i){if(r.unionFallback)throw new je("discriminated union with unionFallback");if(r.options.length===0)return t.write("return INVALID;"),i;let n=fe(e),o=fe(e);t.write(`const ${n} = ${i}?.[${fr(r.discriminator)}];`),t.write(`let ${o};`);let s=!0,a=new Set;for(let c of r.options){let l=c._zod.propValues?.[r.discriminator];if(!l||l.size===0)throw new je("discriminated union option without static discriminator values");for(let p of l){if(a.has(p))throw new je(`duplicate discriminator value ${String(p)}`);a.add(p)}let u=Array.from(l,p=>FZ(e,n,p)),d=s?"if":"else if";t.write(`${d} (${u.join(" || ")}) {`),t.indented(p=>{let f=bt(p,e,c,i);p.write(`${o} = ${f};`)}),t.write("}"),s=!1}return t.write("else { return INVALID; }"),o}function FZ(t,e,r){if(typeof r=="string")return`${e} === ${fr(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${e})`:`${e} === ${r}`;if(typeof r=="boolean")return`${e} === ${r}`;if(r===null)return`${e} === null`;if(r===void 0)return`${e} === undefined`;if(typeof r=="bigint")return`${e} === ${r}n`;if(typeof r=="symbol"){let i=he(t,r);return`${e} === ${i}`}throw new je(`literal discriminator value ${String(r)}`)}function ZZ(t,e,r,i){let n=r._zod.def;e.definite=!1;let o=or(t,e,n.left,i),s=or(t,e,n.right,i),a=he(e,ea),c=fe(e);return t.write(`const ${c} = ${a}(${o}, ${s});`),t.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function qZ(t,e,r,i){let n=r._zod.def,o=he(e,en);t.write(`if (!${o}(${i})) return INVALID;`);let s=fe(e),a=fe(e),c=fe(e);t.write(`const ${s} = {};`);let l=n,u=l.partial?void 0:n.keyType._zod.values;if(u){let f=[];for(let m of u){if(!(typeof m=="string"||typeof m=="number"||typeof m=="symbol"))throw new je(`record key value ${String(m)}`);let g=typeof m=="number"?m.toString():m;if(g==="__proto__")throw new je('record key "__proto__"');f.push(g);let y=he(e,m),v=bt(t,e,n.keyType,y),b=fe(e);t.write(`const ${b} = ${i}[${VZ(e,g)}];`);let x=or(t,e,n.valueType,b);t.write(`${s}[${v}] = ${x};`)}let h=he(e,new Set(f));return t.write(`for (const ${a} in ${i}) {`),t.indented(m=>{m.write(`if (${h}.has(${a})) continue;`),l.mode==="loose"?m.write(`if (${a} !== "__proto__") ${s}[${a}] = ${i}[${a}];`):m.write("return INVALID;")}),t.write("}"),s}let d=n.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=n.mode==="loose",h=dh(n.keyType);h.definite===!1&&(e.definite=!1);let m=he(e,h),g=he(e,gi),y=fe(e);return UP(t,e,i,a,v=>{v.write(`let ${y} = ${m}(${a});`),v.write(`if (${y} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${y} = ${m}(Number(${a}));`),f?v.write(`if (${y} === INVALID) { ${s}[${a}] = ${i}[${a}]; continue; }`):v.write(`if (${y} === INVALID) return INVALID;`),v.write(`if (${y} === "__proto__") continue;`);let b=fe(e);v.write(`const ${b} = ${i}[${a}];`);let x=or(v,e,n.valueType,b);v.write(`${s}[${y}] = ${x};`)}),s}return UP(t,e,i,a,f=>{f.write(`const ${c} = ${i}[${a}];`);let h=or(f,e,n.valueType,c);f.write(`${s}[${a}] = ${h};`)},"return INVALID;"),s}function UP(t,e,r,i,n,o){let s=he(e,Object.prototype.propertyIsEnumerable),a=fe(e),c=fe(e),l=fe(e);t.write(`const ${a} = Object.getOwnPropertySymbols(${r});`),t.write(`const ${c} = Object.getOwnPropertyNames(${r});`),t.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),t.indented(u=>{u.write(`const ${i} = ${c}[${l}];`),u.write(`if (${i} === "__proto__" || !${s}.call(${r}, ${i})) continue;`),n(u)}),t.write("}"),t.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),t.indented(u=>{u.write(`const ${i} = ${a}[${l}];`),u.write(`if (!${s}.call(${r}, ${i})) continue;`),o?u.write(o):n(u)}),t.write("}")}function VZ(t,e){return typeof e=="string"?fr(e):he(t,e)}function BZ(t,e,r,i){let n=r._zod.def;t.write(`if (!(${i} instanceof Map)) return INVALID;`);let o=fe(e),s=fe(e),a=fe(e);return t.write(`const ${o} = new Map();`),t.write(`for (const [${s}, ${a}] of ${i}) {`),t.indented(c=>{let l=bt(c,e,n.keyType,s),u=bt(c,e,n.valueType,a);c.write(`${o}.set(${l}, ${u});`)}),t.write("}"),o}function HZ(t,e,r,i){let n=r._zod.def;t.write(`if (!(${i} instanceof Set)) return INVALID;`);let o=fe(e),s=fe(e);return t.write(`const ${o} = new Set();`),t.write(`for (const ${s} of ${i}) {`),t.indented(a=>{let c=bt(a,e,n.valueType,s);a.write(`${o}.add(${c});`)}),t.write("}"),o}function WZ(t,e){return t.write(`if (!(${e} instanceof File)) return INVALID;`),e}function KZ(t,e,r,i){t.write(`if (typeof ${i} !== "string") return INVALID;`);let n=r._zod.pattern;if(n){let o=he(e,n);t.write(`${o}.lastIndex = 0;`),t.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function GZ(t,e,r,i){let n=r._zod.def,o=Lo(e,n.getter),s=he(e,{parser:null});t.write(`if (!${s}.parser) {`),t.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),t.write("}");let a=fe(e);return t.write(`const ${a} = ${s}.parser(${i});`),t.write(`if (${a} === INVALID) return INVALID;`),a}function JZ(t,e,r,i){let n=r._zod.def,o=bt(t,e,n.in,i);if(n.transform){if(Uo(n.transform))throw new vn("z.compile: async transforms in pipes are not supported");let s=n.transform,c=Lo(e,u=>{let d={value:u,issues:[],addIssue:hb},p=s(u,d);return p instanceof Promise?hr:d.issues.length===0?p:hr}),l=fe(e);return t.write(`const ${l} = ${c}(${o});`),t.write(`if (${l} === INVALID) return INVALID;`),bt(t,e,n.out,l)}else return bt(t,e,n.out,o)}function Uo(t){return typeof t=="function"&&(t.constructor.name==="AsyncFunction"||t[Symbol.toStringTag]==="AsyncFunction")}function XZ(t,e,r,i){let n=r._zod.def;if(n.fn){if(Uo(n.fn))throw new vn("z.compile: async custom predicates are not supported");let o=Lo(e,n.fn),s=he(e,db),a=fe(e);t.write(`const ${a} = ${o}(${i});`),t.write(`if (${a} instanceof Promise) ${s}();`),t.write(`if (!${a}) return INVALID;`)}else throw new je("custom schema without a predicate function");return i}function YZ(t,e,r){let i=t._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return hr;let n=i;return n.issues.length===0?n.value:e()}function QZ(t,e,r,i){let n=r._zod.def;if(!n.catchValue[bf])throw new je("catch with a callback (only a constant catch value compiles)",!1);let o=fe(e);t.write(`let ${o} = (() => {`),t.indented(l=>{let u=or(l,e,n.innerType,i);l.write(`return ${u};`)}),t.write("})();");let s=he(e,n.innerType),a=Lo(e,n.catchValue),c=he(e,YZ);return t.write(`if (${o} === INVALID) {`),t.indented(l=>{l.write(`${o} = ${c}(${s}, ${a}, ${i});`),l.write(`if (${o} === INVALID) return INVALID;`)}),t.write("}"),o}function eq(t,e,r,i){let n=r._zod.def;if(n.transform){if(Uo(n.transform))throw new vn("z.compile: async transforms are not supported");let o=n.transform,a=Lo(e,l=>{let u={value:l,issues:[],addIssue:hb},d=o(l,u);return d instanceof Promise?hr:u.issues.length===0?d:hr}),c=fe(e);return t.write(`const ${c} = ${a}(${i});`),t.write(`if (${c} === INVALID) return INVALID;`),c}return i}var hr,CP,vn,je,sZ,yZ,qP=w(()=>{Mi();Df();ib();jo();sa();B();hr=Symbol.for("zod.compile.invalid"),CP=Symbol.for("zod.compile.fallback"),vn=class extends Error{constructor(e="z.compile does not support async refinements, transforms, or checks"){super(e),this.name="ZodCompileAsyncError"}},je=class extends Error{constructor(e,r=!0){super(`z.compile does not support ${e}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};sZ=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);yZ=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function fh(t){return t.checks&&(t.checks=[...t.checks]),t}function yl(t,e){return new t(fh({type:"string",...M(e)}))}function mb(t,e){return new t(fh({type:"string",coerce:!0,...M(e)}))}function vl(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...M(e)})}function _l(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...M(e)})}function bl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...M(e)})}function wl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M(e)})}function $l(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M(e)})}function kl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...M(e)})}function da(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...M(e)})}function Sl(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...M(e)})}function xl(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...M(e)})}function Il(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...M(e)})}function El(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...M(e)})}function Tl(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...M(e)})}function Ol(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...M(e)})}function Pl(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...M(e)})}function Al(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...M(e)})}function Rl(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...M(e)})}function ph(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...M(e)})}function jl(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M(e)})}function zl(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M(e)})}function Cl(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...M(e)})}function Nl(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...M(e)})}function Dl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...M(e)})}function hh(t,e){return new t({type:"string",format:"credit_card",check:"string_format",abort:!1,...M(e)})}function mh(t,e){return new t({type:"string",format:"iban",check:"string_format",abort:!1,...M(e)})}function Ll(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...M(e)})}function Ul(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M(e)})}function Ml(t,e){return new t({type:"string",format:"date",check:"string_format",...M(e)})}function Fl(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...M(e)})}function Zl(t,e){return new t({type:"string",format:"duration",check:"string_format",...M(e)})}function ql(t,e){return new t(fh({type:"number",checks:[],...M(e)}))}function yb(t,e){return new t(fh({type:"number",coerce:!0,checks:[],...M(e)}))}function gh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...M(e)})}function yh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...M(e)})}function vh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...M(e)})}function _h(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...M(e)})}function bh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...M(e)})}function Vl(t,e){return new t({type:"boolean",...M(e)})}function vb(t,e){return new t({type:"boolean",coerce:!0,...M(e)})}function wh(t,e){return new t({type:"bigint",...M(e)})}function _b(t,e){return new t({type:"bigint",coerce:!0,...M(e)})}function $h(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...M(e)})}function kh(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...M(e)})}function Sh(t,e){return new t({type:"symbol",...M(e)})}function xh(t,e){return new t({type:"undefined",...M(e)})}function Ih(t,e){return new t({type:"null",...M(e)})}function Eh(t){return new t({type:"any"})}function Th(t){return new t({type:"unknown"})}function Oh(t,e){return new t({type:"never",...M(e)})}function Ph(t,e){return new t({type:"void",...M(e)})}function Ah(t,e){return new t({type:"date",...M(e)})}function bb(t,e){return new t({type:"date",coerce:!0,...M(e)})}function Rh(t,e){return new t({type:"nan",...M(e)})}function _n(t,e){return new zf({check:"less_than",...M(e),value:t,inclusive:!1})}function mr(t,e){return new zf({check:"less_than",...M(e),value:t,inclusive:!0})}function bn(t,e){return new Cf({check:"greater_than",...M(e),value:t,inclusive:!1})}function gr(t,e){return new Cf({check:"greater_than",...M(e),value:t,inclusive:!0})}function Bl(t){return bn(0,t)}function Hl(t){return _n(0,t)}function Wl(t){return mr(0,t)}function Kl(t){return gr(0,t)}function vi(t,e){return new x_({check:"multiple_of",...M(e),value:t})}function _i(t,e){return new T_({check:"max_size",...M(e),maximum:t})}function wn(t,e){return new O_({check:"min_size",...M(e),minimum:t})}function Zi(t,e){return new P_({check:"size_equals",...M(e),size:t})}function qi(t,e){return new A_({check:"max_length",...M(e),maximum:t})}function Or(t,e){return new R_({check:"min_length",...M(e),minimum:t})}function Vi(t,e){return new j_({check:"length_equals",...M(e),length:t})}function Mo(t,e){return new z_({check:"string_format",format:"regex",...M(e),pattern:t})}function Fo(t){return new C_({check:"string_format",format:"lowercase",...M(t)})}function Zo(t){return new N_({check:"string_format",format:"uppercase",...M(t)})}function qo(t,e){return new D_({check:"string_format",format:"includes",...M(e),includes:t})}function Vo(t,e){return new L_({check:"string_format",format:"starts_with",...M(e),prefix:t})}function Bo(t,e){return new U_({check:"string_format",format:"ends_with",...M(e),suffix:t})}function Gl(t,e,r){return new M_({check:"property",property:t,schema:e,...M(r)})}function Ho(t,e){return new F_({check:"properties",shape:t,...M(e)})}function Wo(t,e){return new Z_({check:"mime_type",mime:t,...M(e)})}function rn(t){return new q_({check:"overwrite",tx:t})}function Ko(t){return rn(e=>e.normalize(t))}function Go(){return rn(t=>t.trim())}function Jo(){return rn(t=>t.toLowerCase())}function Xo(){return rn(t=>t.toUpperCase())}function fa(){return rn(t=>Sv(t))}function wb(t,e,r){return new t({type:"array",element:e,...M(r)})}function tq(t,e,r){return new t({type:"union",options:e,...M(r)})}function rq(t,e,r){return new t({type:"union",options:e,inclusive:!1,...M(r)})}function nq(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...M(i)})}function iq(t,e,r){return new t({type:"intersection",left:e,right:r})}function oq(t,e,r,i){let n=r instanceof ve,o=n?i:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...M(o)})}function sq(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...M(i)})}function aq(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...M(i)})}function cq(t,e,r){return new t({type:"set",valueType:e,...M(r)})}function lq(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...M(r)})}function uq(t,e,r){return new t({type:"enum",entries:e,...M(r)})}function dq(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...M(r)})}function jh(t,e){return new t({type:"file",...M(e)})}function fq(t,e){return new t({type:"transform",transform:e})}function pq(t,e){return new t({type:"optional",innerType:e})}function hq(t,e){return new t({type:"nullable",innerType:e})}function mq(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():qs(r)}})}function gq(t,e,r){return new t({type:"nonoptional",innerType:e,...M(r)})}function yq(t,e){return new t({type:"success",innerType:e})}function vq(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:Av(r)})}function _q(t,e,r){return new t({type:"pipe",in:e,out:r})}function bq(t,e){return new t({type:"readonly",innerType:e})}function wq(t,e,r){return new t({type:"template_literal",parts:e,...M(r)})}function $q(t,e){return new t({type:"lazy",getter:e})}function kq(t,e){return new t({type:"promise",innerType:e})}function zh(t,e,r){let i=M(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Ch(t,e,r){return new t({type:"custom",check:"custom",fn:e,...M(r)})}function Nh(t,e){let r=VP(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(Vs(n,i.value,r._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Vs(o))}},t(i.value,i)),e);return r}function VP(t,e){let r=new it({check:"custom",...M(e)});return r._zod.check=t,r}function Dh(t){let e=new it({check:"describe"});return e._zod.onattach=[r=>{let i=Jt.get(r)??{};Jt.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function Lh(t){let e=new it({check:"meta"});return e._zod.onattach=[r=>{let i=Jt.get(r)??{};Jt.add(r,{...i,...t})}],e._zod.check=()=>{},e}function Uh(t,e){let r=M(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(n),a=t.Codec??ia,c=t.Boolean??Co,l=t.String??yi,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,h)=>{let m=f;return r.case!=="sensitive"&&(m=m.toLowerCase()),o.has(m)?!0:s.has(m)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:h.value,inst:p,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?i[0]||"true":n[0]||"false"),error:r.error});return p._zod.bag.truthy=i,p._zod.bag.falsy=n,p._zod.bag.case=r.case??"insensitive",p}function Bi(t,e,r,i={}){let n=M(i),o={check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}var gb,BP=w(()=>{Nf();gl();sa();B();gb={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Jl(t,...e){for(let r of e)for(let i of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,i)&&Gt(t,i,r[i]);return t}function Hi(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Jt,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function qt(t,e,r,i,n){let o=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:i.path,message:n}):e.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(n);return Object.assign(r,o),!0}function et(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,u);else{let p=s.schema,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(t,e,p,u)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),et(d,e,u),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Jl(s.schema,c),e.io==="input"&&yr(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function HP(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function Wi(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let n=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,p=t.external.uri??(h=>h);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${HP(f)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===r&&!s[1].schema.id)return{ref:c};let u=s[1].schema.id??`__schema${t.counter++}`;return{defId:u,ref:l+HP(u)}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=n(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
64
|
+
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let l=t.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}a.count>1&&t.reused==="ref"&&o(s)}t.external&&(t.sharedDefsExtractedFor=t.external)}function GP(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let r=[];for(let i of e){if(!i||typeof i!="object")return;GP(i);let n=Object.keys(i);if(n.length!==1||n[0]!=="type")return;let o=i.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete t.anyOf,t.type=r.length===1?r[0]:r}function KP(t){let e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function $b(t){let e=[];for(let o of t){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!JP.has(s))return null;e.push(o)}let r={},i=new Set;for(let o of e){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let a=[];for(let l of e){let u=l.properties?.[s]??KP(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:$b(a)??{allOf:a};Gt(r,s,c)}for(let s of o.required??[])i.add(s)}let n={type:"object",properties:r};if(i.size&&(n.required=[...i]),e.every(o=>o.additionalProperties===!1))n.additionalProperties=!1;else{let o=[];for(let s of e){let a=KP(s);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?n.additionalProperties=o[0]:o.length>1&&(n.additionalProperties={allOf:o})}return n}function Sq(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let n of JP)if(n in t)return;let r=e.filter(n=>WP.some(o=>Array.isArray(n[o]))),i=null;if(!r.length)i=$b(e);else{let n=r[0],o=WP.find(c=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let s=e.filter(c=>c!==n),a=n[o].map(c=>$b([...s,c]));if(a.some(c=>!c))return;i={[o]:a}}i&&(delete t.allOf,Jl(t,i))}function Ki(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let f=t.seen.get(d),h=f.schema;if(h.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Jl(l,h),Jl(l,u),a._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(h.$ref&&f.def)for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=t.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let a of[...t.seen.entries()].reverse())i(a[0]);if(t.target!=="openapi-3.0")for(let a of t.seen.entries())GP(a[1].def??a[1].schema);for(let a of t.deferred)a();if(t.intersections.length){let a=new Map;for(let c of t.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=a.get(u);d?d.push(l):a.set(u,[l])}for(let c of t.intersections)for(let l of a.get(c)??[])Sq(l)}}let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a)}Jl(n,r.defId?r.schema:r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&n.id===o&&delete n.id;let s=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Gt(s,c.defId,c.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:pa(e,"input",t.processors),output:pa(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function yr(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return yr(i.element,r);if(i.type==="set")return yr(i.valueType,r);if(i.type==="lazy")return yr(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return yr(i.innerType,r);if(i.type==="intersection")return yr(i.left,r)||yr(i.right,r);if(i.type==="record"||i.type==="map")return yr(i.keyType,r)||yr(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:yr(i.in,r)||yr(i.out,r);if(i.type==="object"){for(let n in i.shape)if(yr(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(yr(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(yr(n,r))return!0;return!!(i.rest&&yr(i.rest,r))}return!1}var JP,WP,kb,pa,Xl=w(()=>{gl();B();JP=new Set(["type","properties","required","additionalProperties"]),WP=["oneOf","anyOf"];kb=(t,e={})=>r=>{let i=Hi({...r,processors:e});return et(t,i),Wi(i,t),Ki(i,t)},pa=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=Hi({...n??{},target:o,io:e,processors:r});return et(t,s),Wi(s,t),Ki(s,t)}});function Vt(t){let e={},r=t._zod.def,i=t._zod.traits.has("$ZodCheck")?[t,...r.checks??[]]:r.checks??[];for(let o of i)xq[o._zod.def.check]?.(e,o._zod.def);let n=t._zod.bag;n.minimum!==void 0&&ha(e,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&ha(e,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&ma(e,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&ma(e,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&tA(e,n.multipleOf),n.format!==void 0&&(e.format??(e.format=n.format),n.format.includes("int")&&(e.isInt=!0)),n.mime&&nA(e,n.mime);for(let o of n.patterns??[])rA(e,o);return e}function Yl(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?Yl(e.out):e.type==="catch"?Yl(e.innerType):t._zod.optin}function Sb(t,e,r){if(e.$ref){if(r.has(e))return e;r.add(e);let h=t.get(e)?.def;if(!h)return e;let m=Sb(t,h,r);return m===h?e:m}for(let h of["anyOf","oneOf"]){let m=e[h];if(!Array.isArray(m))continue;let g=m.map(y=>Sb(t,y,r));g.some((y,v)=>y!==m[v])&&(e={...e,[h]:g})}let i=Array.isArray(e.type)?e.type:[e.type],n=!i.includes("string")&&i.some(h=>h==="number"||h==="integer"),o=e.enum??(e.const!==void 0?[e.const]:void 0);if(!n&&!o?.some(h=>typeof h=="number"))return e;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:p,...f}=e;return f.enum?f.enum=f.enum.map(h=>typeof h=="number"?String(h):h):typeof f.const=="number"&&(f.const=String(f.const)),n&&(f.type="string",o||(f.pattern=(i.includes("number")?gi:Xc).source)),f}function Tq(t){let e=new Map;for(let i of t.seen.values())i.def&&!e.has(i.schema)&&e.set(i.schema,i);let r=new Map;for(let i of xb.get(t)??[]){let n=t.seen.get(i),o=(n?.def??n?.schema)?.propertyNames;if(!o||o===!0||r.has(o))continue;let s=Sb(e,o,new Set);s!==o&&r.set(o,s)}if(r.size)for(let i of t.seen.values())for(let n of[i.schema,i.def]){let o=n&&r.get(n.propertyNames);o&&(n.propertyNames=o)}}function sA(t,e,r,i,n){let o=!1,s=JSON.stringify(t,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(qt(e,r,i,n,"BigInt defaults cannot be represented in JSON Schema"),rw):JSON.parse(s)}function Yo(t,e){if("_idmap"in t){let i=t,n=Hi({...e,processors:Mh}),o={};for(let c of i._idmap.entries()){let[l,u]=c;et(u,n)}let s={},a={registry:i,uri:e?.uri,defs:o};n.external=a;for(let c of i._idmap.entries()){let[l,u]=c;Wi(n,u),Gt(s,l,Ki(n,u))}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Hi({...e,processors:Mh});return et(t,r),Wi(r,t),Ki(r,t)}var ha,ma,XP,tA,rA,nA,iA,YP,QP,eA,xq,Iq,Eq,oA,Ib,Eb,Tb,Ob,Pb,Ab,Rb,jb,zb,Cb,Nb,Db,Lb,Ub,Mb,Fb,Zb,qb,Vb,Bb,Hb,Wb,Kb,Gb,Jb,Fh,Xb,Yb,xb,Qb,ew,tw,rw,nw,iw,ow,sw,aw,cw,Zh,lw,Mh,ga=w(()=>{jo();sa();Xl();B();ha=(t,e,r)=>{(t[e]===void 0||r>t[e])&&(t[e]=r)},ma=(t,e,r)=>{(t[e]===void 0||r<t[e])&&(t[e]=r)},XP=(t,e)=>{ha(t,"minimum",e),ma(t,"maximum",e)},tA=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},rA=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},nA=(t,e)=>{t.mime=t.mime?t.mime.filter(r=>e.includes(r)):[...e]},iA=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},YP=(t,e)=>ha(t,"minimum",e.minimum),QP=(t,e)=>ma(t,"maximum",e.maximum),eA=t=>(e,r)=>{iA(e,r.format);let[i,n]=t[r.format];ha(e,"minimum",i),ma(e,"maximum",n)},xq={greater_than:(t,e)=>ha(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>ma(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>tA(t,e.value),number_format:eA(qc),bigint_format:eA(Vc),min_length:YP,max_length:QP,length_equals:(t,e)=>XP(t,e.length),min_size:YP,max_size:QP,size_equals:(t,e)=>XP(t,e.size),string_format:(t,e)=>{iA(t,e.format),e.pattern&&rA(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>nA(t,e.mime)};Iq={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Eq=new Map([[lp,o_],[il,s_]]),oA=t=>Eq.get(t)??t,Ib=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:u}=Vt(t);if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=Iq[a]??a,n.format===""&&delete n.format,(a==="time"||u)&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let d=[...c].map(oA);d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Eb=(t,e,r,i)=>{let n=r,{minimum:o,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Vt(t);n.type=u?"integer":"number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";if(d?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof o=="number"&&(n.minimum=o),p?f?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof s=="number"&&(n.maximum=s),a){let h=new Set;for(let y of a)Number.isFinite(y)&&y!==0?h.add(Math.abs(y)):qt(t,e,n,i,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);let[m,...g]=h;m!==void 0&&(n.multipleOf=m),g.length&&(n.allOf=[...n.allOf??[],...g.map(y=>({multipleOf:y}))])}},Tb=(t,e,r,i)=>{r.type="boolean"},Ob=(t,e,r,i)=>{qt(t,e,r,i,"BigInt cannot be represented in JSON Schema")},Pb=(t,e,r,i)=>{qt(t,e,r,i,"Symbols cannot be represented in JSON Schema")},Ab=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Rb=(t,e,r,i)=>{qt(t,e,r,i,"Undefined cannot be represented in JSON Schema")},jb=(t,e,r,i)=>{qt(t,e,r,i,"Void cannot be represented in JSON Schema")},zb=(t,e,r,i)=>{r.not={}},Cb=(t,e,r,i)=>{},Nb=(t,e,r,i)=>{},Db=(t,e,r,i)=>{qt(t,e,r,i,"Date cannot be represented in JSON Schema")},Lb=(t,e,r,i)=>{let n=t._zod.def,o=Us(n.entries);if(o.length===0){r.not={};return}o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},Ub=(t,e,r,i)=>{let n=t._zod.def;if(n.values.length===0){r.not={};return}let o=[];for(let s of n.values)if(s===void 0){if(qt(t,e,r,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(qt(t,e,r,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},Mb=(t,e,r,i)=>{qt(t,e,r,i,"NaN cannot be represented in JSON Schema")},Fb=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},Zb=(t,e,r,i)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:o,maximum:s,mime:a}=Vt(t);o!==void 0&&(n.minLength=o),s!==void 0&&(n.maxLength=s),a&&(a.length===0?n.not={}:a.length===1?n.contentMediaType=a[0]:n.anyOf=a.map(c=>({contentMediaType:c})))},qb=(t,e,r,i)=>{r.type="boolean"},Vb=(t,e,r,i)=>{qt(t,e,r,i,"Custom types cannot be represented in JSON Schema")},Bb=(t,e,r,i)=>{qt(t,e,r,i,"Function types cannot be represented in JSON Schema")},Hb=(t,e,r,i)=>{qt(t,e,r,i,"Transforms cannot be represented in JSON Schema")},Wb=(t,e,r,i)=>{qt(t,e,r,i,"Map cannot be represented in JSON Schema")},Kb=(t,e,r,i)=>{qt(t,e,r,i,"Set cannot be represented in JSON Schema")},Gb=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:s,maximum:a}=Vt(t);typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=et(o.element,e,{...i,path:[...i.path,"items"]})};Jb=(t,e,r,i)=>{let n=r,o=t._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&qt(t,e,n,i,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let l in s)Gt(n.properties,l,et(s[l],e,{...i,path:[...i.path,"properties",l]}));let c=[];for(let l of Object.keys(s)){let u=o.shape[l];(e.io==="input"?Yl(u)===void 0:u._zod.optout===void 0)&&c.push(l)}c.length>0&&(n.required=c),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=et(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},Fh=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,s=n.options.map((a,c)=>et(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},Xb=(t,e,r,i)=>{let n=t._zod.def,o=et(n.left,e,{...i,path:[...i.path,"allOf",0]}),s=et(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c,e.intersections.push(c)},Yb=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((m,g)=>et(m,e,{...i,path:[...i.path,s,g]})),l=o.rest?et(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let m=o.items[u-1];if(!(e.io==="input"?Yl(m)!==void 0:m._zod.optout==="optional"))break;u--}let d=o.items.length,p=!o.rest;e.target==="draft-2020-12"?(n.prefixItems=c,p?n.items=!1:l&&(n.items=l),u>0&&(n.minItems=u),p&&(n.maxItems=d)):e.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),u>0&&(n.minItems=u),p&&(n.maxItems=d)):(n.items=c,p?n.additionalItems=!1:l&&(n.additionalItems=l),u>0&&(n.minItems=u),p&&(n.maxItems=d));let{minimum:f,maximum:h}=Vt(t);typeof f=="number"&&(n.minItems=f),typeof h=="number"&&(n.maxItems=h)};xb=new WeakMap;Qb=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let s=o.keyType,a=Vt(s).patterns;if(o.mode==="loose"&&a&&a.size>0){let u=et(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)Gt(n.patternProperties,oA(d).source,u)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){n.propertyNames=et(o.keyType,e,{...i,path:[...i.path,"propertyNames"]});let u=xb.get(e);u||(u=[],xb.set(e,u),e.deferred.push(()=>Tq(e))),u.push(t)}n.additionalProperties=et(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]})}let c=s._zod.values,l=e.io==="input"&&Yl(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u.map(String))}},ew=(t,e,r,i)=>{let n=t._zod.def,o=et(n.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},tw=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},rw=Symbol();nw=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let s=sA(n.defaultValue,t,e,r,i);s!==rw&&(r.default=s)},iw=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);if(o.ref=n.innerType,e.io!=="input")return;let s=sA(n.defaultValue,t,e,r,i);s!==rw&&(r._prefault=s)},ow=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{qt(t,e,r,i,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},sw=(t,e,r,i)=>{let n=t._zod.def,o=n.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?n.out:n.in:n.out;et(s,e,i);let a=e.seen.get(t);a.ref=s},aw=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},cw=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Zh=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},lw=(t,e,r,i)=>{let n=t._zod.innerType;et(n,e,i);let o=e.seen.get(t);o.ref=n},Mh={string:Ib,number:Eb,boolean:Tb,bigint:Ob,symbol:Pb,null:Ab,undefined:Rb,void:jb,never:zb,any:Cb,unknown:Nb,date:Db,enum:Lb,literal:Ub,nan:Mb,template_literal:Fb,file:Zb,success:qb,custom:Vb,function:Bb,transform:Hb,map:Wb,set:Kb,array:Gb,object:Jb,union:Fh,intersection:Xb,tuple:Yb,record:Qb,nullable:ew,nonoptional:tw,default:nw,prefault:iw,catch:ow,pipe:sw,readonly:aw,promise:cw,optional:Zh,lazy:lw}});var qh,aA=w(()=>{ga();Xl();qh=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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Hi({processors:Mh,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return et(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Wi(this.ctx,e);let i=Ki(this.ctx,e),{"~standard":n,...o}=i;return o}}});var cA={};var lA=w(()=>{});var $n={};Jr($n,{$ZodAny:()=>Ip,$ZodArray:()=>sl,$ZodAsyncError:()=>Er,$ZodBase64:()=>up,$ZodBase64URL:()=>fp,$ZodBigInt:()=>ol,$ZodBigIntFormat:()=>$p,$ZodBoolean:()=>Co,$ZodCIDRv4:()=>sp,$ZodCIDRv6:()=>cp,$ZodCUID:()=>Yf,$ZodCUID2:()=>Qf,$ZodCatch:()=>Bp,$ZodCheck:()=>it,$ZodCheckBigIntFormat:()=>E_,$ZodCheckEndsWith:()=>U_,$ZodCheckGreaterThan:()=>Cf,$ZodCheckIncludes:()=>D_,$ZodCheckLengthEquals:()=>j_,$ZodCheckLessThan:()=>zf,$ZodCheckLowerCase:()=>C_,$ZodCheckMaxLength:()=>A_,$ZodCheckMaxSize:()=>T_,$ZodCheckMimeType:()=>Z_,$ZodCheckMinLength:()=>R_,$ZodCheckMinSize:()=>O_,$ZodCheckMultipleOf:()=>x_,$ZodCheckNumberFormat:()=>I_,$ZodCheckOverwrite:()=>q_,$ZodCheckProperties:()=>F_,$ZodCheckProperty:()=>M_,$ZodCheckRegex:()=>z_,$ZodCheckSizeEquals:()=>P_,$ZodCheckStartsWith:()=>L_,$ZodCheckStringFormat:()=>Qs,$ZodCheckUpperCase:()=>N_,$ZodCodec:()=>ia,$ZodCreditCard:()=>mp,$ZodCustom:()=>Xp,$ZodCustomStringFormat:()=>bp,$ZodCyclicError:()=>th,$ZodDate:()=>Pp,$ZodDefault:()=>Fp,$ZodDiscriminatedUnion:()=>al,$ZodE164:()=>pp,$ZodEmail:()=>Bf,$ZodEmoji:()=>Jf,$ZodEncodeError:()=>Fi,$ZodEnum:()=>ll,$ZodError:()=>Dv,$ZodExactOptional:()=>Up,$ZodFile:()=>Dp,$ZodFunction:()=>Gp,$ZodGUID:()=>qf,$ZodIBAN:()=>yp,$ZodIPv4:()=>np,$ZodIPv6:()=>ip,$ZodISODate:()=>J_,$ZodISODateTime:()=>G_,$ZodISODuration:()=>Y_,$ZodISOTime:()=>X_,$ZodIntersection:()=>jp,$ZodJWT:()=>_p,$ZodKSUID:()=>rp,$ZodLazy:()=>oa,$ZodLiteral:()=>ul,$ZodMAC:()=>op,$ZodMap:()=>Cp,$ZodNaN:()=>Hp,$ZodNanoID:()=>Xf,$ZodNever:()=>Tp,$ZodNonOptional:()=>qp,$ZodNull:()=>xp,$ZodNullable:()=>Mp,$ZodNumber:()=>ta,$ZodNumberFormat:()=>wp,$ZodObject:()=>Ap,$ZodObjectJIT:()=>Q_,$ZodOptional:()=>na,$ZodPipe:()=>dl,$ZodPrefault:()=>Zp,$ZodPreprocess:()=>tb,$ZodPromise:()=>Jp,$ZodReadonly:()=>Wp,$ZodRealError:()=>Tr,$ZodRecord:()=>zp,$ZodRegistry:()=>ch,$ZodSet:()=>Np,$ZodString:()=>yi,$ZodStringFormat:()=>Xe,$ZodSuccess:()=>Vp,$ZodSymbol:()=>kp,$ZodTemplateLiteral:()=>Kp,$ZodTransform:()=>Lp,$ZodTuple:()=>cl,$ZodType:()=>ve,$ZodULID:()=>ep,$ZodURL:()=>Gf,$ZodUUID:()=>Vf,$ZodUndefined:()=>Sp,$ZodUnion:()=>ra,$ZodUnknown:()=>Ep,$ZodVoid:()=>Op,$ZodXID:()=>tp,$ZodXor:()=>Rp,$brand:()=>zv,$constructor:()=>$,$input:()=>lb,$output:()=>cb,Doc:()=>zo,INVALID:()=>hr,JSONSchema:()=>cA,JSONSchemaGenerator:()=>qh,NEVER:()=>jv,TimePrecision:()=>gb,URL_BAD_FORMAT:()=>W_,URL_UNPARSEABLE:()=>el,ZodCompileAsyncError:()=>vn,ZodCompileUnsupportedError:()=>je,_any:()=>Eh,_array:()=>wb,_base64:()=>Cl,_base64url:()=>Nl,_bigint:()=>wh,_boolean:()=>Vl,_catch:()=>vq,_check:()=>VP,_cidrv4:()=>jl,_cidrv6:()=>zl,_coercedBigint:()=>_b,_coercedBoolean:()=>vb,_coercedDate:()=>bb,_coercedNumber:()=>yb,_coercedString:()=>mb,_creditCard:()=>hh,_cuid:()=>Il,_cuid2:()=>El,_custom:()=>zh,_date:()=>Ah,_decode:()=>kf,_decodeAsync:()=>xf,_default:()=>mq,_discriminatedUnion:()=>nq,_e164:()=>Dl,_email:()=>vl,_emoji:()=>Sl,_encode:()=>$f,_encodeAsync:()=>Sf,_endsWith:()=>Bo,_enum:()=>lq,_file:()=>jh,_float32:()=>yh,_float64:()=>vh,_gt:()=>bn,_gte:()=>gr,_guid:()=>_l,_iban:()=>mh,_includes:()=>qo,_int:()=>gh,_int32:()=>_h,_int64:()=>$h,_intersection:()=>iq,_ipv4:()=>Al,_ipv6:()=>Rl,_isoDate:()=>Ml,_isoDateTime:()=>Ul,_isoDuration:()=>Zl,_isoTime:()=>Fl,_jwt:()=>Ll,_ksuid:()=>Pl,_lazy:()=>$q,_length:()=>Vi,_literal:()=>dq,_lowercase:()=>Fo,_lt:()=>_n,_lte:()=>mr,_mac:()=>ph,_map:()=>aq,_max:()=>mr,_maxLength:()=>qi,_maxSize:()=>_i,_mime:()=>Wo,_min:()=>gr,_minLength:()=>Or,_minSize:()=>wn,_multipleOf:()=>vi,_nan:()=>Rh,_nanoid:()=>xl,_nativeEnum:()=>uq,_negative:()=>Hl,_never:()=>Oh,_nonnegative:()=>Kl,_nonoptional:()=>gq,_nonpositive:()=>Wl,_normalize:()=>Ko,_null:()=>Ih,_nullable:()=>hq,_number:()=>ql,_optional:()=>pq,_overwrite:()=>rn,_parse:()=>Bs,_parseAsync:()=>Hs,_pipe:()=>_q,_positive:()=>Bl,_promise:()=>kq,_properties:()=>Ho,_property:()=>Gl,_readonly:()=>bq,_record:()=>sq,_refine:()=>Ch,_regex:()=>Mo,_safeDecode:()=>Ef,_safeDecodeAsync:()=>Of,_safeEncode:()=>If,_safeEncodeAsync:()=>Tf,_safeParse:()=>Ws,_safeParseAsync:()=>Gs,_set:()=>cq,_size:()=>Zi,_slugify:()=>fa,_startsWith:()=>Vo,_string:()=>yl,_stringFormat:()=>Bi,_stringbool:()=>Uh,_success:()=>yq,_superRefine:()=>Nh,_symbol:()=>Sh,_templateLiteral:()=>wq,_toLowerCase:()=>Jo,_toUpperCase:()=>Xo,_transform:()=>fq,_trim:()=>Go,_tuple:()=>oq,_uint32:()=>bh,_uint64:()=>kh,_ulid:()=>Tl,_undefined:()=>xh,_union:()=>tq,_unknown:()=>Th,_uppercase:()=>Zo,_url:()=>da,_uuid:()=>bl,_uuidv4:()=>wl,_uuidv6:()=>$l,_uuidv7:()=>kl,_void:()=>Ph,_xid:()=>Ol,_xor:()=>rq,base64Charset:()=>lp,base64urlCharset:()=>il,canParseURL:()=>K_,clone:()=>Be,compile:()=>pb,compileFn:()=>dh,config:()=>Pt,createStandardJSONSchemaMethod:()=>pa,createToJSONSchemaMethod:()=>kb,decode:()=>LE,decodeAsync:()=>ME,describe:()=>Dh,encode:()=>DE,encodeAsync:()=>UE,extractDefs:()=>Wi,finalize:()=>Ki,flattenError:()=>Kc,formatError:()=>Gc,getDiscriminatedOption:()=>eb,globalConfig:()=>Wt,globalRegistry:()=>Jt,handleUnrepresentable:()=>qt,initializeContext:()=>Hi,isBackEdge:()=>nh,isRecursiveSchema:()=>rh,isValidBase64:()=>nl,isValidBase64URL:()=>dp,isValidCIDRv6:()=>ap,isValidCreditCard:()=>hp,isValidIBAN:()=>gp,isValidIPv6:()=>rl,isValidJWT:()=>vp,locales:()=>la,memoizer:()=>hl,mergeValues:()=>ea,meta:()=>Lh,parse:()=>Po,parseAsync:()=>Ao,parseURLObject:()=>uT,prettifyError:()=>Uv,process:()=>et,processSchema:()=>et,regexes:()=>Fr,registry:()=>lh,safeDecode:()=>ZE,safeDecodeAsync:()=>VE,safeEncode:()=>FE,safeEncodeAsync:()=>qE,safeParse:()=>Ks,safeParseAsync:()=>Js,standardProps:()=>Zf,stripTabAndNewline:()=>tl,toDotPath:()=>CE,toJSONSchema:()=>Yo,toZod:()=>Mc,treeifyError:()=>Lv,urlHostnameOk:()=>Wf,urlProtocolOk:()=>Kf,util:()=>A,validate:()=>Xs,validateAsync:()=>Ys,validateURL:()=>Hf,version:()=>V_,withParser:()=>uh});var Xt=w(()=>{Mi();Fv();Mv();sa();ib();Nf();B_();B();B();jo();ah();gl();Df();qP();BP();Xl();ga();aA();lA()});var uw=w(()=>{Xt()});function ze(t){return yl(Aq,t)}function uA(t){return ql(Rq,t)}function dA(t){return Vl(jq,t)}function Ql(t,e){return new zq({type:"array",element:t,...M(e)})}function dt(t,e){let r={type:"object",shape:t??{},...M(e)};return new Cq(r)}function fA(t,e,r){return new Nq({type:"union",options:e,discriminator:t,...M(r)})}function Qo(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Dq({type:"enum",entries:r,...M(e)})}function St(t,e){return new Lq({type:"literal",values:Array.isArray(t)?t:[t],...M(e)})}function Gi(t){return new Uq({type:"optional",innerType:t})}var bi,Aq,Rq,jq,zq,Cq,Nq,Dq,Lq,Uq,pA=w(()=>{Xt();B();uw();bi=$("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ve.init(t,e),t.def=e,t.type=e.type},{get with(){return this.check},set with(t){Vn(this,"with",t)},parse(t,e){return Po(this,t,e,{callee:this.parse})},parseAsync(t,e){return Ao(this,t,e,{callee:this.parseAsync})},safeParse(t,e){return Ks(this,t,e)},safeParseAsync(t,e){return Js(this,t,e)},check(...t){let e=this.def;return this.clone({...e,checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0})},clone(t,e){return Be(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},apply(t,...e){return e.length===0?t(this):t(this,...e)}}),Aq=$("ZodMiniString",(t,e)=>{yi.init(t,e),bi.init(t,e)});Rq=$("ZodMiniNumber",(t,e)=>{ta.init(t,e),bi.init(t,e)});jq=$("ZodMiniBoolean",(t,e)=>{Co.init(t,e),bi.init(t,e)});zq=$("ZodMiniArray",(t,e)=>{sl.init(t,e),bi.init(t,e)});Cq=$("ZodMiniObject",(t,e)=>{Ap.init(t,e),bi.init(t,e),Pv(t,"shape",r=>r._zod.def.shape,!1)});Nq=$("ZodMiniDiscriminatedUnion",(t,e)=>{al.init(t,e),bi.init(t,e)});Dq=$("ZodMiniEnum",(t,e)=>{ll.init(t,e),bi.init(t,e),t.options=[...t._zod.values]});Lq=$("ZodMiniLiteral",(t,e)=>{ul.init(t,e),bi.init(t,e)});Uq=$("ZodMiniOptional",(t,e)=>{na.init(t,e),bi.init(t,e)})});var hA=w(()=>{Xt()});function eu(t,e){let r=typeof e=="function"?e:(s,a)=>{let c=e[s._zod.def.type];return c?c(s,a):s},i=new Map;function n(s){let a=i.get(s);if(a===mA)return new oa({type:"lazy",getter:()=>i.get(s)});if(a!==void 0)return a;i.set(s,mA);let c=o(s),l=r(c,c!==s);return i.set(s,l),l}function o(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let l=a.shape,u=Object.keys(l),d=!1,p={};for(let h of u){let m=n(l[h]);m!==l[h]&&(d=!0),p[h]=m}let f=a.catchall;return a.catchall&&(f=n(a.catchall),f!==a.catchall&&(d=!0)),d?Be(s,{...a,shape:p,catchall:f}):s}case"array":{let l=n(a.element);return l===a.element?s:Be(s,{...a,element:l})}case"tuple":{let l=a.items,u=!1,d=[];for(let f of l){let h=n(f);h!==f&&(u=!0),d.push(h)}let p=a.rest;return a.rest&&(p=n(a.rest),p!==a.rest&&(u=!0)),u?Be(s,{...a,items:d,rest:p}):s}case"record":case"map":{let l=n(a.keyType),u=n(a.valueType);return l===a.keyType&&u===a.valueType?s:Be(s,{...a,keyType:l,valueType:u})}case"set":{let l=n(a.valueType);return l===a.valueType?s:Be(s,{...a,valueType:l})}case"union":{let l=a.options,u=!1,d=[];for(let p of l){let f=n(p);f!==p&&(u=!0),d.push(f)}return u?Be(s,{...a,options:d}):s}case"intersection":{let l=n(a.left),u=n(a.right);return l===a.left&&u===a.right?s:Be(s,{...a,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=n(a.innerType);return l===a.innerType?s:Be(s,{...a,innerType:l})}case"pipe":{let l=n(a.in),u=n(a.out);return l===a.in&&u===a.out?s:Be(s,{...a,in:l,out:u})}case"function":{let l=n(a.input),u=n(a.output);return l===a.input&&u===a.output?s:Be(s,{...a,input:l,output:u})}case"lazy":{let l=a.getter,{_cachedInner:u,...d}=a;return Be(s,{...d,getter:()=>n(l())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return n(t)}var mA,dw=w(()=>{sa();B();mA=Symbol("z.visit/resolving")});var gA=w(()=>{});var yA=w(()=>{});var fw=w(()=>{Xt();uw();pA();hA();ga();ah();gA();yA()});var vA=w(()=>{fw()});function Vh(t){let e=_A.safeParse(t);return e.success?e.data:null}var At,_A,tu,pw=w(()=>{"use strict";vA();At={id:ze(),at:ze(),by:ze(),component:ze()},_A=fA("kind",[dt({...At,kind:St("generated"),gen:ze(),commit:ze(),fingerprint:ze()}),dt({...At,kind:St("registered"),reviewed:dA()}),dt({...At,kind:St("delivered"),claim:ze(),mode:Qo(["track","patch","pr","ticket"]),ref:Gi(ze())}),dt({...At,kind:St("sent_back"),claim:ze(),question:ze()}),dt({...At,kind:St("dev_reviewed"),claim:ze(),decision:Qo(["approved","questions","later","skipped"]),plan:Gi(ze()),question:Gi(ze())}),dt({...At,kind:St("resolved"),claim:ze(),take:Qo(["design","code"]),reason:Gi(ze())}),dt({...At,kind:St("closed"),claim:ze(),commit:ze(),items:Ql(ze()),how:Gi(Qo(["accepted","kept"]))}),dt({...At,kind:St("proposal_changed_after_ready"),claim:ze()}),dt({...At,kind:St("removed_in_code"),commit:ze()}),dt({...At,kind:St("claimed"),claim:ze(),baselineGen:ze()}),dt({...At,kind:St("unclaimed"),claim:ze()}),dt({...At,kind:St("reopened"),claim:ze()}),dt({...At,kind:St("ready"),claim:ze(),note:ze().check(Or(1)),readyHash:ze()}),dt({...At,kind:St("seen")}),dt({...At,kind:St("accepted")}),dt({...At,kind:St("ignored")}),dt({...At,kind:St("compared"),result:Qo(["matches","differs","design_only"]),differences:Gi(uA()),decision:Gi(Qo(["design","code","later"]))}),dt({...At,kind:St("review_requested")}),dt({...At,kind:St("kept"),claim:ze(),pins:Ql(dt({key:ze(),props:Ql(ze())}))}),dt({...At,kind:St("unkept"),key:ze(),props:Ql(ze())}),dt({...At,kind:St("designed_new"),claim:ze(),note:ze().check(Or(1))}),dt({...At,kind:St("review_answered"),claim:ze(),answer:ze().check(Or(1))})]);tu=t=>[...t].sort((e,r)=>e.at===r.at?e.id<r.id?-1:e.id>r.id?1:0:e.at<r.at?-1:1)});function xt(t,e=new Map){let r=new Map([...e].map(([i,n])=>[i,JSON.parse(JSON.stringify(n))]));for(let i of tu(t)){let n=r.get(i.component)??qq(i.component);r.set(i.component,bA(n,i))}return r}function bA(t,e){{let r=t.state,i=s=>{s!==t.state&&t.history.push({at:e.at,event:e.kind,from:t.state,to:s}),t.state=s},n=s=>t.warnings.push(`${e.at} ${e.kind}: ${s} (state ${r})`),o=s=>t.claim?.id===s;switch(e.kind){case"registered":t.lastGen||i(e.reviewed?"in_sync":"code_new");break;case"removed_in_code":t.removedInCode=e.commit;break;case"generated":{delete t.removedInCode;let s=t.lastGen!==void 0&&t.lastGen!==e.gen;t.lastGen=e.gen,s&&(t.state==="in_sync"||t.state==="code_new")&&(t.unseen=!0);break}case"seen":t.unseen=!1;break;case"accepted":t.state==="code_new"?i("in_sync"):n("only a code_new component can be accepted");break;case"ignored":t.state==="code_new"?i("ignored"):n("only a code_new component can be ignored");break;case"claimed":t.state==="in_sync"||t.state==="code_new"||t.state==="ignored"?(t.claim={id:e.claim,by:e.by,baselineGen:e.baselineGen},t.unseen=!1,i("in_design")):n("already claimed");break;case"unclaimed":o(e.claim)&&(t.state==="in_design"||t.state==="ready_for_dev"||t.state==="design_new")?(t.claim=void 0,i("in_sync")):n("no matching open claim");break;case"ready":o(e.claim)&&t.state==="in_design"&&t.claim?(t.claim.note=e.note,t.claim.readyHash=e.readyHash,t.claim.question=void 0,t.claim.review=void 0,i("ready_for_dev")):n("ready needs an open claim in design");break;case"resolved":o(e.claim)||n("no matching claim");break;case"reopened":o(e.claim)&&t.state==="ready_for_dev"?i("in_design"):o(e.claim)&&t.state==="in_design"||n("can only reopen a ready proposal");break;case"proposal_changed_after_ready":o(e.claim)&&t.state==="ready_for_dev"&&i("in_design");break;case"sent_back":o(e.claim)&&t.state==="ready_for_dev"&&t.claim?(t.claim.question=e.question,t.lastGen&&(t.claim.baselineGen=t.lastGen),i("in_design")):n("can only send back a ready proposal");break;case"delivered":o(e.claim)&&(t.state==="ready_for_dev"||t.state==="design_new")&&t.claim?t.claim.delivered=e.ref??e.mode:n("can only deliver a ready proposal");break;case"closed":o(e.claim)&&(t.state==="ready_for_dev"||t.state==="design_new")?(t.claim=void 0,t.unseen=!1,i("in_sync")):n("no matching ready proposal");break;case"compared":t.compared={result:e.result,...e.differences!==void 0?{differences:e.differences}:{},...e.decision?{decision:e.decision}:{}};break;case"review_requested":t.state==="in_sync"?i("code_new"):n("only a component in sync goes back to review");break;case"kept":{let s={...t.pins??{}};for(let a of e.pins)s[a.key]=[...new Set([...s[a.key]??[],...a.props])];t.pins=s;break}case"unkept":{let s={...t.pins??{}},a=(s[e.key]??[]).filter(c=>!e.props.includes(c));a.length?s[e.key]=a:delete s[e.key],t.pins=Object.keys(s).length?s:void 0;break}case"dev_reviewed":o(e.claim)&&t.claim&&(t.state==="ready_for_dev"||t.state==="design_new")?t.claim.review={decision:e.decision,by:e.by,at:e.at,...e.plan?{plan:e.plan}:{},...e.question?{question:e.question}:{}}:n("can only review what the designer sent");break;case"review_answered":o(e.claim)&&t.claim?.review?t.claim.review.answer=e.answer:n("no review to answer");break;case"designed_new":!t.lastGen&&!t.claim?(t.claim={id:e.claim,by:e.by,baselineGen:"",note:e.note},i("design_new")):n("component already exists in code");break}t.conflict=!!t.claim&&t.claim.baselineGen!==""&&t.lastGen!==void 0&&t.lastGen!==t.claim.baselineGen}return t}var qq,hw=w(()=>{"use strict";pw();qq=t=>({component:t,state:"in_sync",unseen:!1,conflict:!1,history:[],warnings:[]})});function SA(t,e,r=!1){return typeof e=="number"?Jq(e,Xq.has(t)?Gq:Kq):typeof e=="string"?e.startsWith("VariableID:")?`var(${kA[e]??"unresolved"})`:t in Bq&&mw[e]?`style(${mw[e]})`:r?wA(e):e:Array.isArray(e)?e.map(i=>SA(t,i,r)):e&&typeof e=="object"?gw(e,new Set,r||$A.has(t)):e}function gw(t,e=new Set,r=!1){let i={},n=Object.keys(t).map(o=>[r?wA(o):o,o]);for(let[o,s]of n.sort((a,c)=>a[0]<c[0]?-1:a[0]>c[0]?1:0)){if(e.has(s))continue;let a=t[s];a!==void 0&&(i[o]=SA(s,a,r||$A.has(s)))}return i}function ru(t,e={}){kA=e.variables??{},mw=e.styles??{};let r=(i,n,o)=>{let s=new Set(Hq);(n||o&&i.layoutPositioning!=="ABSOLUTE")&&(s.add("x"),s.add("y")),n&&e.ignoreRootName&&s.add("name"),s.add("children"),s.add("ds"),s.add("mainComponent"),s.add("overrides");let a=gw(i,s),c=a.letterSpacing;c&&c.value===0&&(a.letterSpacing={unit:"PIXELS",value:0});let l=i.ds;l?.k&&(a.k=l.k),l?.pin&&(a.pin=JSON.parse(l.pin)),l?.src==="data"&&(a.dataText=!0);let u=i.mainComponent;u&&(a.mainComponent=gw(u,Wq));let d=i.overrides;d?.length&&(a.overriddenFields=[...new Set(d.flatMap(f=>f.fields))].sort());let p=typeof i.layout?.mode=="string";return i.children&&(a.children=i.children.map(f=>r(f,!1,p))),a};return r(t,!0,!1)}var Vq,wA,Bq,$A,Hq,Wq,Kq,Gq,Jq,Xq,kA,mw,Bn,yw=w(()=>{"use strict";Vq=/#\d+:\d+$/,wA=t=>t.replace(Vq,""),Bq={fill:!0,stroke:!0,effect:!0,text:!0,grid:!0},$A=new Set(["componentPropertyDefinitions","componentProperties","componentPropertyReferences"]),Hq=new Set(["id","parentId","locked"]),Wq=new Set(["id","componentSetId"]),Kq=2,Gq=4,Jq=(t,e)=>{let r=Math.round(t*10**e)/10**e;return Object.is(r,-0)?0:r},Xq=new Set(["r","g","b","a","opacity","position","innerRadius"]),kA={},mw={};Bn=t=>`${JSON.stringify(t,null,2)}
|
|
66
|
+
`});function EA(t,e,r){let i=qn(t,e),n=qn(t,r),o=i.map(s=>{let a=n.filter(u=>!!(u.op==="remove"&&IA(s.target,u.target)||s.op==="remove"&&IA(u.target,s.target)||u.target===s.target&&u.prop!==void 0&&u.prop===s.prop||u.target===s.target&&u.op&&s.op&&u.op===s.op&&u.op!=="change"));if(a.length===0)return{...s,merge:"clean"};let c=a[0],l=a.length===1&&c!==void 0&&c.prop===s.prop&&(xA(c.to,s.to)&&xA(c.toBound,s.toBound)||!Yq(s)&&Qq(c.to,s.to));return{...s,merge:l?"convergent":"conflict",against:a.map(u=>({kind:u.kind,op:u.op,prop:u.prop,path:u.path,to:u.to,toBound:u.toBound}))}});return{ours:o,theirs:n,summary:{clean:o.filter(s=>s.merge==="clean").length,conflict:o.filter(s=>s.merge==="conflict").length,convergent:o.filter(s=>s.merge==="convergent").length,codeChanges:n.length}}}var xA,Yq,Qq,IA,TA=w(()=>{"use strict";mv();Lc();xA=pf,Yq=t=>`${JSON.stringify(t.to??null)}${JSON.stringify(t.toBound??null)}`.includes("var("),Qq=(t,e)=>Yr(t,r=>r==="boundVariables")===Yr(e,r=>r==="boundVariables"),IA=(t,e)=>t===e||t.startsWith(`${e}|`)||t.startsWith(`${e}/`)});function es(t,e){let r=new Set,i=o=>{o.dataText&&typeof o.k=="string"&&r.add(o.k);for(let s of o.children??[])i(s)};i(e);let n=o=>({...o,...typeof o.k=="string"&&r.has(o.k)?{dataText:!0}:{},...o.children?{children:o.children.map(n)}:{}});return n(t)}function nu(t){let e=EA(t.base,t.ours,t.theirs),r=e.ours.filter(o=>o.merge==="clean"||t.designWins&&o.merge==="conflict"),i=mf(r.filter(o=>o.kind!=="data"),t.dtcg,OA(t.theirs));for(let o of i)o.variants!=="all"&&(o.scope=t.scopes?.[vv(o)]??"all");let n=mf(r.filter(o=>o.kind==="data"),t.dtcg,OA(t.theirs));return{m:e,changes:i,content:n}}var OA,vw=w(()=>{"use strict";Uc();TA();OA=t=>(t.children??[]).map(e=>Object.entries(e.variantProperties??{}).sort().map(([r,i])=>`${r}=${i}`).join(","))});function iV(t,e){let r=t.replace("#",""),i=n=>nV(Number.parseInt(r.slice(n,n+2),16)/255);return{...e?{boundVariables:{color:_w(e)}}:{},color:{b:i(4),g:i(2),r:i(0)},opacity:r.length===8?i(6):1,type:"SOLID",visible:!0}}function AA(t,e,r){return t.map((i,n)=>i.startsWith("image:")?e?.[n]??{type:"IMAGE"}:i.startsWith("gradient:")?e?.[n]??{type:"GRADIENT_LINEAR"}:iV(i,r))}function oV(t,e){let r={...t},i=e.props,n={...t.boundVariables??{}};for(let a of eV)a in i&&(r[a]=i[a]);if("layoutMode"in i||PA.some(a=>a in i)){let a={...t.layout??{}};"layoutMode"in i&&(a.mode=i.layoutMode);for(let c of PA)c in i&&(a[c]=i[c]);a.strokesIncludedInLayout===!1&&!t.layout?.strokesIncludedInLayout&&delete a.strokesIncludedInLayout,r.layout=a}let o=r.layout?.mode;if((o==="HORIZONTAL"||o==="VERTICAL")&&r.layoutSizingHorizontal&&r.layoutSizingVertical){let[a,c]=o==="HORIZONTAL"?["Horizontal","Vertical"]:["Vertical","Horizontal"];r.primaryAxisSizingMode=r[`layoutSizing${a}`]==="HUG"?"AUTO":"FIXED",r.counterAxisSizingMode=r[`layoutSizing${c}`]==="HUG"?"AUTO":"FIXED"}if("fontName"in i){let a=i.fontName,c=t.fontName??{},l=c.family===a.family&&c.style===a.style;r.fontName={family:a.family,style:a.style,...c.variationSettings?{variationSettings:l?c.variationSettings:{...c.variationSettings,wght:tV[a.style]??400}}:{}}}if("fills"in i&&(r.fills=AA(i.fills,t.fills,e.paintBind?.fills)),"strokes"in i&&!(t.strokes===void 0&&i.strokes.length===0)&&(r.strokes=AA(i.strokes,t.strokes,e.paintBind?.strokes)),"strokeTopWeight"in i){let a={bottom:i.strokeBottomWeight,left:i.strokeLeftWeight,right:i.strokeRightWeight,top:i.strokeTopWeight};new Set(Object.values(a)).size===1?(r.strokeWeight=a.top,delete r.strokeWeights):(r.strokeWeight="mixed",r.strokeWeights=a)}else"strokeWeight"in i&&(r.strokeWeight=i.strokeWeight,delete r.strokeWeights);let s=new Set([...Object.keys(i),..."cornerRadius"in i?rV:[]]);("layoutMode"in i||"itemSpacing"in i)&&s.add("itemSpacing");for(let a of s)a!=="fills"&&a!=="strokes"&&delete n[a];for(let[a,c]of Object.entries(e.bind??{}))n[a]=[_w(c)];for(let a of["fills","strokes"])a in i&&(delete n[a],e.paintBind?.[a]&&(n[a]=[_w(e.paintBind[a])]));return Object.keys(n).length?r.boundVariables=n:delete r.boundVariables,r}function iu(t,e){let r=new Map,i=c=>{r.set(c.k,c);for(let l of c.children??[])i(l)};i(e);let n=new Set,o=!0,s=(c,l)=>{let u=typeof c.k=="string"?c.k:null,d=u?r.get(u):void 0;u&&d&&n.add(u),u&&!d&&!l&&u.startsWith(`${e.k}/`)&&(o=!1);let p=d&&d.type!=="INSTANCE"?oV(c,d):c;return d?.type==="INSTANCE"?p:c.children?{...p,children:c.children.map(f=>s(f,!1))}:p},a=s(t,!0);for(let c of r.keys())n.has(c)||(o=!1);return{tree:a,exact:o}}var PA,eV,tV,rV,nV,_w,bw=w(()=>{"use strict";Uc();PA=["paddingTop","paddingRight","paddingBottom","paddingLeft","itemSpacing","primaryAxisAlignItems","counterAxisAlignItems","strokesIncludedInLayout"],eV=["layoutPositioning","x","y","layoutSizingHorizontal","layoutSizingVertical","primaryAxisSizingMode","counterAxisSizingMode","width","height","cornerRadius","opacity","clipsContent","characters","fontSize","lineHeight","letterSpacing","textAutoResize","textAlignHorizontal","textCase","textTruncation","maxLines","strokeAlign"],tV={Regular:400,Medium:500,"Semi Bold":600,Bold:700},rV=["topLeftRadius","topRightRadius","bottomLeftRadius","bottomRightRadius"],nV=t=>Math.round(t*1e4)/1e4,_w=t=>`var(${Ns}/${t})`});function sV(t,e){return(e.differs??[]).map(r=>{let i=r.k.slice(t.length+1).split("/").join(" \u203A ")||"(the whole thing)";return r.at?`${i}: at ${r.figma[0]},${r.figma[1]} in Figma, ${r.app[0]},${r.app[1]} in the app (placed elsewhere${e.anchored?"":" \u2014 rebuilt next update"})`:`${i}: ${r.figma[0]}\xD7${r.figma[1]} in Figma, ${r.app[0]}\xD7${r.app[1]} in the app${r.why?` (${r.why})`:""}`})}function jA(t){let{dataText:e,children:r,...i}=t;return{...i,...r?{children:r.map(jA)}:{}}}function zA(t,e){let r=e;if(t.type!=="COMPONENT_SET"&&e.type==="COMPONENT_SET"&&e.children?.length){let{variantProperties:o,...s}=e.children[0];r={...s,type:t.type,name:t.name}}let i=o=>{let{k:s,children:a,...c}=o;return{...c,...a?{children:a.map(i)}:{}}},n=o=>{let{constraints:s,layoutSizingHorizontal:a,layoutSizingVertical:c,...l}=o,u=l.layout;if(u){let{strokesIncludedInLayout:d,...p}=u;l.layout=p}return l};return[n(i(t)),n(i(r))]}function aV(t,e){if(!t)return;let r=qn(t,e);if(!r.length)return;let i={layout:"layout",token:"tokens",style:"colours/borders",typography:"type",content:"text",structure:"layers",variant:"variants",prop:"properties"};return`Changed in code: ${[...new Set(r.map(o=>i[o.kind]??o.kind))].join(", ")} (${r.length} change${r.length>1?"s":""})`}function cV(t,e){let r=[],i=a=>{Array.isArray(a.pin)&&typeof a.k=="string"&&!a.pin.includes("*")&&r.push({key:a.k,props:a.pin});for(let c of a.children??[])i(c)};if(i(t),!r.length)return[];let n=iu(t,e).tree,o=mE(t),s=new Set(qn(t,n,{pins:!1}).map(a=>`${o.get(a.target)}|${a.prop}`));return r.flatMap(a=>a.props.filter(c=>!s.has(`${a.key}|${c}`)).map(c=>`the code now does what was kept as design (${c} of ${a.key}) \u2014 it can follow the code again ("Use the code's" in the panel)`))}async function $w(t,e,r,i){let{dtcg:n,commit:o}=r,s=_=>!r.only||r.only.includes(_.replace(/^screen:/,"")),a=r.sets.filter(_=>s(_.k)),c=r.screens.filter(_=>s(_.spec.k));r.only&&i(`only: ${r.only.join(", ")} \u2014 the rest of Live stays as it is`);let l=new Set(Di(n).values()),u=xt(e.ledger()),d=[],p=_=>[...e.ledger(),...d].filter(U=>U.kind==="generated"&&U.component===_).length,f=Object.fromEntries(Object.entries(await t.call("ids",{})).filter(([_])=>!_.includes("/"))),h=[],m={},g={},y={},v={},b={},x=(_,U,z)=>{if(z.score){let ie=z.fitted??[];if(b[_]={score:z.score.after,fitted:ie.length},(ie.length||z.score.after<100)&&i(`${_}: ${z.score.after}% of ${z.score.checked} layers match the app${ie.length?` (${z.score.before}% as built; ${ie.length} fitted to it)`:""}`),ie.length){let we=ie.map(Ee=>Ee.slice(U.length+1).split("/").join(" \u203A ")||"(the whole thing)");h.push(`${_}: fitted to the app after building \u2014 ${we.slice(0,6).join("; ")}${we.length>6?`; +${we.length-6} more`:""} (CoDesignFlo gaps, not code to change)`)}}if(z.designMatch){v[_]=z.designMatch;let{now:ie,was:we}=z.designMatch;i(`${_}: ${ie}% like the designer's design${we!==void 0&&we!==ie?` (was ${we}%)`:""} \u2014 Live ${z.anchored?"is built on it with the code's changes":"shows the app"}`),we!==void 0&&we-ie>=10&&h.push(`${_}: the app moved away from the designer's design \u2014 ${ie}% like it, was ${we}% (the designer sees it on the row)`)}z.anchored&&i(`${_}: built on the designer's design${z.fitted?.length?`; ${z.fitted.length} layer(s) the code added were generated`:""}`),z.pairing&&z.pairing.paired<.6*z.pairing.layers&&h.push(`${_}: only ${z.pairing.paired} of the design's ${z.pairing.layers} layers are found in the app \u2014 for the developer, code to change: name the page's elements after the design's layers (call pair_design for this page), so changes and differences follow them`);let ue=sV(U,z);if(ue.length){y[_]=ue;for(let ie of ue)h.push(`${_}: ${z.anchored?"the app differs from the design":"differs from the app"} \u2014 ${ie}`)}},k=await t.call("gens",{}),E=new Set;for(let _ of a){let U=k[_.k]??u.get(_.k)?.lastGen,z=U?await e.generation(_.k,U):null;if(U&&!z&&f[_.k]&&h.push(`${_.k}: Live was last updated from another branch \u2014 not checked for hand edits`),z&&f[_.k]){let ue=wi(await t.call("snapshot",{id:f[_.k]}));if(qn(z,ue).length){let ie={id:`live${Date.now().toString(36)}`,component:_.k,by:"edited in Live",at:kn(),baselineGen:U??""};await t.call("cloneToProposals",{id:f[_.k],claim:ie,base:z}),E.add(_.k);let we=u.get(_.k)?.state;(we==="in_sync"||we==="code_new"||we==="ignored")&&e.append([{id:`${ie.id}_claimed`,at:kn(),by:ie.by,component:_.k,kind:"claimed",claim:ie.id,baselineGen:ie.baselineGen}]),h.push(`${_.k}: Live had been edited by hand \u2014 saved as a proposal before updating it`)}}}let O=await t.call("tokensPush",{dtcg:n});(O.created||Object.keys(O.writes).length)&&i(`tokens: ${O.created} created, ${Object.values(O.writes).reduce((_,U)=>_+U,0)} updated`),r.images&&Object.keys(r.images).length&&await t.call("putImages",{images:r.images},{timeoutMs:12e4});let X=(await t.call("readFacts")).proposals,le={},$e=_=>{let U=u.get(_);if(U?.state!=="design_new"||!U.claim||f[_])return{};let z=X.find(ue=>ue.role==="proposal"&&ue.claim.id===U.claim.id);return z?{adoptFrom:z.nodeId}:{}},q=async(_,U,z,ue)=>{let ie=ww(z);await t.call("setGen",{id:U,gen:ie}),await e.generation(_,ie)||await e.saveGeneration(_,ie,z);let we=u.get(_)?.lastGen;if(ie!==we){u.has(_)||d.push({id:`reg_${_}`,at:new Date(Date.now()-1).toISOString(),by:"cli",component:_,kind:"registered",reviewed:ue}),d.push({id:`gen_${_}_${p(_)}_${ie}`,at:kn(),by:"cli",component:_,kind:"generated",gen:ie,commit:o,fingerprint:ie});let Ee=aV(we?await e.generation(_,we):null,z);Ee&&(m[_]=Ee)}return{gen:ie,prev:we}},Re=_=>({name:_.name,type:_.type,width:_.measured?.w,height:_.measured?.h,children:(_.children??[]).map(Re)});for(let _ of a)(_.children??[]).some(U=>dv(Re(U)))&&h.push(`${_.k}: looks like the browser window the designs were framed in (a title bar with traffic lights), not app UI \u2014 for the developer, code to change: take it out of the app's pages (nothing to wait for from the designer)`);let de=[];for(let _ of a){let U=$e(_.k),z=await t.call("reconcile",{spec:_,...U,...E.has(_.k)||U.adoptFrom?{}:{specHash:RA(_)}},{timeoutMs:18e4});f[_.k]=z.id;for(let G of z.stats.errors)G.startsWith("bind grid")||h.push(`${_.k}: ${G}`);x(_.k,_.k,z.stats);let ue=z.stats.errors.filter(G=>G.startsWith("font missing in Figma")).map(G=>/: (.+?) \(/.exec(G)?.[1]??G);ue.length&&(g[_.k]=`Drawn with Inter here: the app's font (${[...new Set(ue)].join(", ")}) isn't in Figma \u2014 install it, or the app doesn't look like this`);let ie=wi(await t.call("snapshot",{id:z.id})),we=u.get(_.k);if(we?.state==="design_new"&&we.claim){let G=X.find(Zn=>Zn.role==="proposal"&&Zn.claim.id===we.claim.id),Gr=G?wi(await t.call("snapshot",{id:G.nodeId})):null,Kt=Zn=>Yr(Zn,Qd=>Qd==="boundVariables"),ko=Gr?qn(...zA(Gr,ie)):[],zs=ko.filter(Zn=>Kt(Zn.from)!==Kt(Zn.to)).length,So=ko.length-zs;d.push({id:`closed_${we.claim.id}`,at:new Date(Date.now()-2).toISOString(),by:"cli",component:_.k,kind:"closed",claim:we.claim.id,commit:o,items:[]}),G&&await t.call("archiveProposal",{nodeId:G.nodeId}),i(`closed: ${_.k} \u2014 the new design is built and now in Live${zs?` (${zs} visual difference(s) from the designer's frame \u2014 check with: codesignflo verify ${_.k})`:" and matches the designer's frame"}${So?`; ${So} raw value(s) became tokens`:""}`)}let{gen:Ee,prev:zt}=await q(_.k,z.id,ie,u.size===0);de.push({key:_.k,id:z.id,gen:Ee});for(let G of cV(ie,_))h.push(`${_.k}: ${G}`);let Mr=Object.values(z.stats.writes).reduce((G,Gr)=>G+Gr,0);i(`${_.k.padEnd(16)} ${Ee===zt?"unchanged":zt?"updated":"created"}${Mr||z.stats.created?` (${z.stats.created} created, ${Mr} writes)`:""}`)}let pt=new Map(r.sets.flatMap(_=>(_.children??[]).map(U=>[U.k,U])));for(let _ of c){let U=_.spec.k.replace(/^screen:/,""),z=$e(U),ue=Dc(_.spec,pt),ie=[...e.ledger(),...d].flatMap(zt=>zt.kind==="closed"&&zt.component===U&&zt.how!=="accepted"?[zt.claim]:[]),we;try{we=await t.call("reconcileScreen",{spec:ue,closedClaims:ie,...z,...z.adoptFrom?{}:{specHash:RA(ue)}},{timeoutMs:18e4})}catch(zt){h.push(`${U}: couldn't update this page in Live (${zt.message}) \u2014 the rest of the update went on; it's tried again next time`);continue}f[U]=we.id,x(U,_.spec.k,we.stats),await q(U,we.id,wi(await t.call("snapshot",{id:we.id})),!0);let Ee=u.get(U);if(Ee?.state==="design_new"&&Ee.claim){let zt=X.find(Mr=>Mr.role==="proposal"&&Mr.claim.id===Ee.claim.id);d.push({id:`closed_${Ee.claim.id}`,at:kn(),by:"cli",component:U,kind:"closed",claim:Ee.claim.id,commit:o,items:[]}),zt&&await t.call("archiveProposal",{nodeId:zt.nodeId}),i(`closed: ${U} \u2014 the new page is built and now in Live \u2192 Screens (compare with: codesignflo verify --screens)`)}}for(let _ of de){let U=wi(await t.call("snapshot",{id:_.id})),z=ww(U);if(z===_.gen)continue;await t.call("setGen",{id:_.id,gen:z}),await e.generation(_.key,z)||await e.saveGeneration(_.key,z,U);let ue=d.find(ie=>ie.kind==="generated"&&ie.component===_.key&&ie.gen===_.gen);ue&&ue.kind==="generated"?Object.assign(ue,{id:ue.id.replace(_.gen,z),gen:z,fingerprint:z}):d.push({id:`gen_${_.key}_${p(_.key)}_${z}`,at:kn(),by:"cli",component:_.key,kind:"generated",gen:z,commit:o,fingerprint:z})}c.length&&i(`screens: ${c.map(_=>`${_.spec.name} (${Math.round(100*_.coverage.inInstances/_.coverage.nodes)}% from library)`).join(", ")}`);let Zt=new Set([...a.map(_=>_.k),...c.map(_=>_.spec.k)]),De=(r.only?[]:[...Object.keys(f).filter(_=>!_.startsWith("pages.")&&!_.includes("/")),...Object.keys(await t.call("ids",{screens:!0})).filter(_=>_.startsWith("screen:")&&!_.includes("/"))].filter(_=>!Zt.has(_))).filter(_=>{let U=u.get(_.replace(/^screen:/,"")),z=U?.state==="in_design"||U?.state==="ready_for_dev";return z&&h.push(`${_.replace(/^screen:/,"")}: no longer in the code, but the designer has a proposal open for it \u2014 kept in Live`),!z}),Lt=a.length+c.length+De.length;if(De.length>3&&De.length>Lt/2)h.push(`this update would remove ${De.length} of ${Lt} components and pages from Live (${De.join(", ")}) \u2014 held back: if they were really removed, they go with the next update that keeps most of Live`);else for(let _ of De){await t.call("archiveLive",{k:_,commit:o});let U=_.replace(/^screen:/,"");delete f[U],d.push({id:`removed_${U}_${o.slice(0,8)}`,at:kn(),by:"cli",component:U,kind:"removed_in_code",commit:o}),i(`removed: ${U} \u2014 no longer in the code; Live's copy moved to Archive (the designer decides whether to delete it)`)}e.append(d);let Ht=await t.call("readFacts");for(let _ of e.append(Ht.events))i(`designer: ${_.component} ${_.kind}${"note"in _?` \u2014 "${_.note}"`:""} (${_.by})`);Ht.events.length&&await t.call("ackEvents",{ids:Ht.events.map(_=>_.id)});let Mn=[];for(let _ of Ht.proposals.filter(U=>U.role==="proposal"&&U.claim.readyHash)){let U=xt(e.ledger()).get(_.claim.component);if(U?.state!=="ready_for_dev"||U.claim?.id!==_.claim.id)continue;let z=await t.call("snapshot",{id:_.nodeId}),ue=pi(Bn(ru(z.tree,{variables:z.variables,styles:z.styles})));ue!==_.claim.readyHash&&(Mn.push({id:`edited_${_.claim.id}_${ue.slice(0,8)}`,at:kn(),by:"sync",component:_.claim.component,kind:"proposal_changed_after_ready",claim:_.claim.id}),h.push(`${_.claim.component}: the proposal was edited after "Ready for dev" \u2014 back to In design`))}e.append(Mn);let Fn=[],Xd=new Set([...xt(e.ledger()).values()].filter(_=>_.claim&&_.state==="ready_for_dev").map(_=>_.claim.id)),Yd=new Set(e.ledger().map(_=>_.id));for(let _ of r.deliveries.filter(U=>Xd.has(U.claim)&&!Yd.has(`sentback_${U.claim}_${U.commit.slice(0,8)}`))){let U=xt(e.ledger()).get(_.component);if(!U?.claim||U.claim.id!==_.claim)continue;let z=Ht.proposals.find(G=>G.claim.id===_.claim&&G.role==="proposal");if(!z)continue;let ue=wi(await t.call("snapshot",{id:f[_.component]})),ie=Ds(wi(await t.call("snapshot",{id:z.nodeId})),l),we=new Set(qn(ue,ie).map(G=>G.id)),Ee=_.changes.filter(G=>!_.items.length||_.items.includes(G.id)),zt=Ee.filter(G=>G.items.some(Gr=>we.has(Gr)));if(zt.length){h.push(`${_.component}: ${Ee.length-zt.length}/${Ee.length} changes landed; still open: ${zt.map(G=>`${G.id} ${G.layer} ${G.prop}`).join(", ")}`);continue}let Mr=_.changes.filter(G=>!Ee.includes(G));if(Mr.length===0)Fn.push({id:`closed_${_.claim}`,at:kn(),by:"cli",component:_.component,kind:"closed",claim:_.claim,commit:_.commit,items:Ee.map(G=>G.id)}),await t.call("archiveProposal",{nodeId:z.nodeId}),i(`closed: ${_.component} \u2014 all ${Ee.length} changes verified in ${_.commit.slice(0,7)}; the designer's copy moved to Archive`);else{let G=Kt=>_.why[Kt.id]??"not applied",Gr=`Done in code: ${Ee.map(Kt=>`${Kt.layer} ${Kt.prop}`).join(", ")}. Needs your decision: ${Mr.map(Kt=>`${Kt.layer} ${Kt.prop} \u2014 ${G(Kt)}`).join(" | ")}`;Fn.push({id:`sentback_${_.claim}_${_.commit.slice(0,8)}`,at:kn(),by:"cli",component:_.component,kind:"sent_back",claim:_.claim,question:Gr}),i(`partly delivered: ${_.component} \u2014 ${Ee.length} verified in ${_.commit.slice(0,7)}, ${Mr.length} sent back to the designer with questions`)}}e.append(Fn);let S=await Bh(t,e,n),T=S.filter(_=>_.changes.length===0&&_.conflicts===0);for(let _ of T){let U=e.ledger().filter(ue=>ue.kind==="generated"&&ue.component===_.component).at(-1),z=U&&"commit"in U?U.commit:o;e.append([{id:`closed_${_.claim}`,at:kn(),by:"cli",component:_.component,kind:"closed",claim:_.claim,commit:z,items:[]}]),await t.call("archiveProposal",{nodeId:_.nodeId}),i(_.convergent?`closed: ${_.component} \u2014 the code now matches the designer's copy (${_.convergent} change(s), in ${z.slice(0,7)}); the copy moved to Archive`:`closed: ${_.component} \u2014 nothing to change in code (example text only); the copy moved to Archive`)}for(let _ of S)le[_.component]={done:_.convergent,total:_.convergent+_.conflicts+_.changes.reduce((U,z)=>U+z.items.length,0)};let Q=S.filter(_=>!T.includes(_));for(let _ of Q)for(let U of _.changes.flatMap(z=>z.foreign??[]))h.push(`${_.component}: the designer used Figma variable ${U.variable} (${U.value}); delivering it adds the token ${U.token}`);for(let _ of Q)i(`ready: ${_.component} \u2014 ${_.changes.length} code change(s)${_.convergent?` left (${_.convergent} already in code)`:""}${_.conflicts?`, ${_.conflicts} conflicting (settle with: codesignflo resolve ${_.component} --design | --code "<why>")`:""}${_.folder?` (${_.folder})`:""}`);if(e.newDesign)for(let[_,U]of xt(e.ledger())){if(U.state!=="design_new"||!U.claim)continue;let z=Ht.proposals.find(we=>we.role==="proposal"&&we.claim.id===U.claim.id);if(!z)continue;let ue=await t.call("snapshot",{id:z.nodeId}),ie=await e.newDesign(_,U.claim.id,ru(ue.tree,{variables:ue.variables,styles:ue.styles}),()=>t.call("exportNode",{id:z.nodeId}));i(`new design: ${_} by ${U.claim.by} \u2014 "${U.claim.note??""}" (${ie}); build it with: codesignflo deliver ${_}`)}let ye=xt(e.ledger()),_e=await t.call("readFacts");for(let _ of Q){let U=ye.get(_.component);U&&(U.conflict=_.conflicts>0)}let Qe=new Set(r.keys),ht=[...ye.values()].filter(_=>Qe.has(_.component)||_.state==="design_new").map(_=>({...lV(_,f,_e.proposals,m,le),...g[_.component]?{warning:g[_.component]}:{},...y[_.component]?{differs:y[_.component]}:{},...b[_.component]?{score:b[_.component].score,fitted:b[_.component].fitted}:{},...v[_.component]?{designMatch:v[_.component]}:{}}));return await t.call("writeIndex",{entries:ht,lastSyncAt:kn(),lastSyncCommit:o,...r.only?{updated:[...a.map(_=>_.k),...c.map(_=>_.spec.k.replace(/^screen:/,""))]}:{}}),{states:ye,notes:h}}async function Bh(t,e,r){let i=await t.call("readFacts"),n=xt(e.ledger()),o=Object.entries(await t.call("ids",{screens:!0})).filter(([l])=>l.startsWith("screen:")&&!l.includes("/")).map(([l,u])=>[l.slice(7),u]),s={...await t.call("ids",{}),...Object.fromEntries(o)},a=new Set(Di(r).values()),c=[];for(let l of i.proposals.filter(u=>u.role==="proposal")){let u=n.get(l.claim.component);if(u?.state!=="ready_for_dev")continue;let d=s[l.claim.component];if(!d)throw new Error(`Live ${l.claim.component} not found`);let p=wi(await t.call("snapshot",{id:d})),f=u.claim?.baselineGen||l.claim.baselineGen,h=es(f&&await e.generation(l.claim.component,f)||p,p),m=Ds(es(wi(await t.call("snapshot",{id:l.nodeId})),p),a),g=e.ledger().some(x=>x.kind==="resolved"&&x.claim===l.claim.id&&x.take==="design"),{m:y,changes:v,content:b}=nu({base:h,ours:m,theirs:p,dtcg:r,...l.claim.scopes?{scopes:l.claim.scopes}:{},designWins:g});c.push({component:l.claim.component,claim:l.claim.id,nodeId:l.nodeId,convergent:y.summary.convergent,...l.claim.note?{note:l.claim.note}:{},by:l.claim.by,changes:v,content:b,conflicts:g?0:y.summary.conflict,codeChanges:y.summary.codeChanges,folder:e.delta?e.delta(l.claim.component,l.claim.id,y,v,b):""})}return c}function lV(t,e,r,i,n={}){let o=r.find(s=>s.role==="proposal"&&s.claim.component===t.component);return{component:t.component,name:t.component,state:t.state,unseen:t.unseen,conflict:t.conflict,...t.lastGen?{lastGen:t.lastGen}:{},...e[t.component]?{liveNodeId:e[t.component]}:{},...i[t.component]?{whatsNew:i[t.component]}:{},...t.pins?{pins:t.pins}:{},...t.claim?{claim:{id:t.claim.id,by:t.claim.by,baselineGen:t.claim.baselineGen,...t.claim.note?{note:t.claim.note}:{},...t.claim.question?{question:t.claim.question}:{},...o?{proposalNodeId:o.nodeId}:{},...n[t.component]?.done?n[t.component]:{}}}:{}}}var kn,wi,ww,RA,CA=w(()=>{"use strict";lv();pv();mv();Uc();hw();yw();ff();Lc();vw();bw();kn=()=>new Date().toISOString(),wi=t=>ru(t.tree,{variables:t.variables,styles:t.styles,ignoreRootName:!0});ww=t=>`g_${pi(Bn(jA(t))).slice(0,10)}`;RA=t=>pi(Yr(t)).slice(0,16)});function ou(t){let e=t.layer==="(root)"?"the component's root element":`layer \`${t.layer}\``,r=t.variants==="all"?"(in every version)":t.scope==="variants"?`ONLY when ${t.variants.map(ya).join(", or when ")} \u2014 implement it as a condition on the props that produce that version, leave the other versions unchanged`:`(the designer made it in ${t.variants.map(ya).join("; ")}, but it applies to every version)`,i=t.foreign?.length?` \u2014 NOTE: ${t.foreign.map(n=>`Figma variable "${n.variable}" (${n.value})`).join(", ")} is not a project token yet. The designer decided: add it to the project's tokens file as \`${t.foreign.map(n=>n.token.replace(/\//g,".")).join("`, `")}\` (DTCG \`$value\` = the value given), then use its CSS variable (\`${t.foreign.map(n=>`var(--${n.token.replace(/\//g,"-")})`).join("`, `")}\`). Do not substitute an existing token.`:"";return`- ${t.id} [${t.kind}] ${e} \u2014 ${t.prop}: ${t.from} \u2192 ${t.to} ${r}${i}`}function kw(t){let e=t.entry?.files??[],r=t.entry?.stories?Object.entries(t.entry.stories).map(([i,n])=>`${ya(Object.entries(n).map(([o,s])=>`${o}=${s}`).join(","))} = story "${i}"`).join("; "):"";return`Design proposal for ${t.component} by ${t.by}, ready for dev. Designer's note: ${t.note??"(none)"}
|
|
67
|
+
${t.conflict?`
|
|
68
|
+
NOTE: some changes clash with code changed since the designer claimed it \u2014 call resolve first (take=design unless there's a functional reason).
|
|
69
|
+
`:""}
|
|
70
|
+
Changes (implement each exactly once):
|
|
71
|
+
${t.changes.map(ou).join(`
|
|
72
|
+
`)}
|
|
73
|
+
${t.content.length?`
|
|
74
|
+
Example text the designer changed (no code change): ${t.content.map(i=>`${i.layer}: ${i.to}`).join("; ")}
|
|
75
|
+
`:""}
|
|
76
|
+
Where: ${e.join(", ")||"(see the registry)"}${t.page?" (a page: changes inside a component used on the page change the page's use of it; if the component itself must change, ask_designer)":""}.
|
|
77
|
+
How the design maps to the code: layer \`body/price\` is the element with class styles.price (or data-cdf="price") inside styles.body; "a > b" is layer b inside the nested component a; \`<layer>-margin\` is a CSS margin; tokens are CSS custom properties, use them as given.${r?` Versions: ${r}; "ONLY when \u2026" is a condition on those props.`:""}
|
|
78
|
+
|
|
79
|
+
Implement only these changes; no refactors. Commit normally (any message). Then call sync to verify and close. If something can't be done cleanly, call ask_designer.`}function Sw(t){return`New ${t.page?"page":"component"} designed in Figma: ${t.component} by ${t.by}. Designer's note: ${t.note??"(none)"}
|
|
80
|
+
|
|
81
|
+
Build it in this app:
|
|
82
|
+
- The design: ${t.design} (exact layers: sizes, auto layout, colours, text; INSTANCE layers are existing components \u2014 reuse them).
|
|
83
|
+
- ${t.page?`A page: a page file next to the existing pages (${t.pageFiles?.join(", ")||"src/pages"}), a Storybook page story under the same title as the other pages, rendered at the design's width (a decorator setting the width), and a route. The story must register as ${t.component}, or CoDesignFlo can't pair it with this design: titled "Pages/${uV(t.component)}" with one story.`:`A component: a new folder next to the existing components, following their conventions, with a stories file titled with its PascalCase name and one story per variant (registers as ${t.component}).`}
|
|
84
|
+
- Name elements with data-cdf attributes matching the spec's layer names (layers are named after them, or after readable CSS-module class names: keep those unhashed, e.g. Vite css.modules.generateScopedName "[name]__[local]"). Use the project's tokens; a Figma variable or colour that isn't a token yet is the designer's decision: add a token. A font the app doesn't load: load it (Google Fonts @import in the global CSS) and use it for this design only.
|
|
85
|
+
- Mockup framing isn't app UI: a browser window bar (traffic lights), a device frame or status bar drawn around the screen \u2014 layers marked "presentation" in the spec. Don't build them; the page starts below them.
|
|
86
|
+
- Commit normally. Then call sync: it registers the new ${t.page?"page":"component"}, puts it in Figma and closes the proposal.`}function xw(t){let e=t.filter(r=>r.state==="ready_for_dev"||r.state==="design_new");return e.length?`Waiting on the developer: ${e.map(r=>`${r.component} (${r.state==="design_new"?"new design":"ready"}${r.claim?.note?`: "${r.claim.note}"`:""}${r.conflict?", clashes with code":""})`).join("; ")}`:"Nothing is waiting on the developer."}function Iw(t){return t.filter(e=>e.pins&&Object.keys(e.pins).length).map(e=>`${e.component}: kept as design in Live (not in the code, by the designer's choice): ${Object.entries(e.pins).map(([r,i])=>i.includes("*")?`layer ${r}`:`${i.join(", ")} of ${r}`).join("; ")}`)}function Ew(t,e){if(t.state!=="ready_for_dev"||!t.claim)throw new Error(`${t.component} has no proposal ready for dev`);return{id:`sentback_${t.claim.id}_ask_${Date.now().toString(36)}`,at:new Date().toISOString(),by:"developer",component:t.component,kind:"sent_back",claim:t.claim.id,question:e.trim()}}function Tw(t,e,r){if(t.state!=="ready_for_dev"||!t.claim)throw new Error(`${t.component} has no proposal ready for dev`);let i=new Date().toISOString();return[{id:`resolved_${t.claim.id}_${e}`,at:i,by:"developer",component:t.component,kind:"resolved",claim:t.claim.id,take:e,...r?{reason:r}:{}},...e==="code"?[{id:`sentback_${t.claim.id}_resolved`,at:new Date(Date.parse(i)+1).toISOString(),by:"developer",component:t.component,kind:"sent_back",claim:t.claim.id,question:`Where the code changed the same things, the developer kept the code's version: ${r}`}]:[]]}function Ow(t){return[...t.storybook?[]:["No Storybook: Live is made from the app's Storybook. Add Storybook, with a stories file per component (one story per variant) and data-cdf attributes naming the elements."],...t.tokens?[]:[`No design tokens file: add one in DTCG format (e.g. tokens/tokens.json, generated from the app's CSS custom properties) and set "tokens" in .codesignflo/config.json.`],...t.pageStories?[]:['No page stories: screens appear in Live only through Storybook stories under "Pages" (or rendered with layout "fullscreen"), one per page with sample data. Add them.']]}function Pw(t){if(t.newDesigns.length){let e=t.newDesigns.filter(n=>n.startsWith("pages.")),r=t.newDesigns.filter(n=>!n.startsWith("pages.")),i=r.length&&e.length?`the components first (${r.join(", ")}), then the pages (${e.join(", ")}), reusing those components`:r.length?`the components (${r.join(", ")})`:`the pages (${e.join(", ")}), reusing the app's components`;return[`The designer started: ${t.newDesigns.length} new design${t.newDesigns.length>1?"s":""} waiting. Build ${i}: get_proposal for each, implement, commit, sync. Each one lands in Live and takes over the designer's frame.`]}return t.hasFile?[`The designer's Figma file is connected. Sync on ${t.liveBranch} to update Live; if the file already has their designs, they bring them in from the plugin and the differences come back to you as proposals (status shows them).`]:[`Sync on ${t.liveBranch} to put the app into Figma, then invite the designer (invite with their email): they open a new Figma file, run the CoDesignFlo plugin, sign in, and choose "Use this file" \u2014 Live appears there.`]}function Aw(t){let e=t.filter(r=>r.compared?.result==="differs"&&(r.compared.decision==="later"||!r.compared.decision)&&!r.claim);return e.length?[`Existing designs that differ from the code (the designer decides later; nothing to do yet): ${e.map(r=>`${r.component}${r.compared?.differences?` (${r.compared.differences})`:""}`).join(", ")}`]:[]}function Hh(t,e=12){let r=(t??"").split(`
|
|
87
|
+
`).map(n=>n.replace(/^! /,"")),i=(n,o)=>{let s=r.filter(a=>a.includes(n));return s.length?[o,...s.slice(0,e).map(a=>`- ${a}`),...s.length>e?[`- \u2026 and ${s.length-e} more`]:[]]:[]};return[...i(": the app differs from the design \u2014 ","Where the app differs from the designer's design (Live is built on their design; sizes in Figma vs the browser) \u2014 code to change when the design is right; ask the user when a difference looks intended:"),...i(": differs from the app \u2014 ","Where Live differs from the app (sizes in Figma vs the browser, last update) \u2014 CoDesignFlo/Figma gaps, not code to change; tell the user (a missing font: install it for the designer):")]}var ya,uV,NA=w(()=>{"use strict";ya=t=>t.split(",").map(e=>e.replace("="," = ")).join(" and ");uV=t=>t.replace(/^pages\./,"").split("-").map(e=>e&&e[0].toUpperCase()+e.slice(1)).join(" ")});var Wh,su,Rw,DA=w(()=>{"use strict";Wh=t=>t.split("/").map(e=>e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()).join("."),su=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1).toLowerCase()).join(""),Rw=t=>{let e=Wh(t).replace(/(^|-)page$/,"")||"new";return{key:`pages.${e}-page`,component:su(e),story:`${su(e)}Page`}}});var Pr=w(()=>{"use strict";CA();vw();NA();bw();lv();pv();Uc();pw();hw();Qy();yw();ff();DA()});function LA(){return globalThis[dV]}var dV,UA=w(()=>{dV=Symbol.for("@supabase/supabase-js.traceContextExtractor")});var Zr={};Jr(Zr,{__addDisposableResource:()=>uR,__assign:()=>Kh,__asyncDelegator:()=>rR,__asyncGenerator:()=>tR,__asyncValues:()=>nR,__await:()=>va,__awaiter:()=>GA,__classPrivateFieldGet:()=>aR,__classPrivateFieldIn:()=>lR,__classPrivateFieldSet:()=>cR,__createBinding:()=>Jh,__decorate:()=>ZA,__disposeResources:()=>dR,__esDecorate:()=>VA,__exportStar:()=>XA,__extends:()=>MA,__generator:()=>JA,__importDefault:()=>sR,__importStar:()=>oR,__makeTemplateObject:()=>iR,__metadata:()=>KA,__param:()=>qA,__propKey:()=>HA,__read:()=>Cw,__rest:()=>FA,__rewriteRelativeImportExtension:()=>fR,__runInitializers:()=>BA,__setFunctionName:()=>WA,__spread:()=>YA,__spreadArray:()=>eR,__spreadArrays:()=>QA,__values:()=>Gh,default:()=>hV});function MA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");jw(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function FA(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function ZA(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}function qA(t,e){return function(r,i){e(r,i,t)}}function VA(t,e,r,i,n,o){function s(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?i.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,i.name):{}),d,p=!1,f=r.length-1;f>=0;f--){var h={};for(var m in i)h[m]=m==="access"?{}:i[m];for(var m in i.access)h.access[m]=i.access[m];h.addInitializer=function(y){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(y||null))};var g=(0,r[f])(a==="accessor"?{get:u.get,set:u.set}:u[c],h);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(d=s(g.get))&&(u.get=d),(d=s(g.set))&&(u.set=d),(d=s(g.init))&&n.unshift(d)}else(d=s(g))&&(a==="field"?n.unshift(d):u[c]=d)}l&&Object.defineProperty(l,i.name,u),p=!0}function BA(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function HA(t){return typeof t=="symbol"?t:"".concat(t)}function WA(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function KA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function GA(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(i.next(u))}catch(d){s(d)}}function c(u){try{l(i.throw(u))}catch(d){s(d)}}function l(u){u.done?o(u.value):n(u.value).then(a,c)}l((i=i.apply(t,e||[])).next())})}function JA(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(i=1,n&&(o=l[0]&2?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(u){l=[6,u],n=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function XA(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jh(e,t,r)}function Gh(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Cw(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,o=[],s;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function YA(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Cw(arguments[e]));return t}function QA(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,n++)i[n]=o[s];return i}function eR(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function va(t){return this instanceof va?(this.v=t,this):new va(t)}function tR(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),n[Symbol.asyncIterator]=function(){return this},n;function s(f){return function(h){return Promise.resolve(h).then(f,d)}}function a(f,h){i[f]&&(n[f]=function(m){return new Promise(function(g,y){o.push([f,m,g,y])>1||c(f,m)})},h&&(n[f]=h(n[f])))}function c(f,h){try{l(i[f](h))}catch(m){p(o[0][3],m)}}function l(f){f.value instanceof va?Promise.resolve(f.value.v).then(u,d):p(o[0][2],f)}function u(f){c("next",f)}function d(f){c("throw",f)}function p(f,h){f(h),o.shift(),o.length&&c(o[0][0],o[0][1])}}function rR(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=t[n]?function(s){return(r=!r)?{value:va(t[n](s)),done:!1}:o?o(s):s}:o}}function nR(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Gh=="function"?Gh(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(s){return new Promise(function(a,c){s=t[o](s),n(a,c,s.done,s.value)})}}function n(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}function iR(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function oR(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=zw(t),i=0;i<r.length;i++)r[i]!=="default"&&Jh(e,t,r[i]);return fV(e,t),e}function sR(t){return t&&t.__esModule?t:{default:t}}function aR(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function cR(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function lR(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function uR(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function dR(t){function e(o){t.error=t.hasError?new pV(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(o).then(n,function(s){return e(s),n()})}else i|=1}catch(s){e(s)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return n()}function fR(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,o,s){return i?e?".jsx":".js":n&&(!o||!s)?r:n+o+"."+s.toLowerCase()+"js"}):t}var jw,Kh,Jh,fV,zw,pV,hV,qr=w(()=>{jw=function(t,e){return jw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},jw(t,e)};Kh=function(){return Kh=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Kh.apply(this,arguments)};Jh=Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]});fV=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},zw=function(t){return zw=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},zw(t)};pV=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};hV={__extends:MA,__assign:Kh,__rest:FA,__decorate:ZA,__param:qA,__esDecorate:VA,__runInitializers:BA,__propKey:HA,__setFunctionName:WA,__metadata:KA,__awaiter:GA,__generator:JA,__createBinding:Jh,__exportStar:XA,__values:Gh,__read:Cw,__spread:YA,__spreadArrays:QA,__spreadArray:eR,__await:va,__asyncGenerator:tR,__asyncDelegator:rR,__asyncValues:nR,__makeTemplateObject:iR,__importStar:oR,__importDefault:sR,__classPrivateFieldGet:aR,__classPrivateFieldSet:cR,__classPrivateFieldIn:lR,__addDisposableResource:uR,__disposeResources:dR,__rewriteRelativeImportExtension:fR}});var pR=C(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.resolveFetch=void 0;var mV=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);Xh.resolveFetch=mV});var Uw=C(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.FunctionRegion=nn.FunctionsHttpError=nn.FunctionsRelayError=nn.FunctionsFetchError=nn.FunctionsError=void 0;var _a=class extends Error{constructor(e,r="FunctionsError",i){super(e),this.name=r,this.context=i}toJSON(){return{name:this.name,message:this.message,context:this.context}}};nn.FunctionsError=_a;var Nw=class extends _a{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nn.FunctionsFetchError=Nw;var Dw=class extends _a{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nn.FunctionsRelayError=Dw;var Lw=class extends _a{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nn.FunctionsHttpError=Lw;var hR;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(hR||(nn.FunctionRegion=hR={}))});var mR=C(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.FunctionsClient=void 0;var gV=(qr(),Xr(Zr)),yV=pR(),ba=Uw(),Mw=class{constructor(e,{headers:r={},customFetch:i,region:n=ba.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=n,this.fetch=(0,yV.resolveFetch)(i)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return gV.__awaiter(this,arguments,void 0,function*(r,i={}){var n,o;let s,a,c;try{let{headers:l,method:u,body:d,signal:p,timeout:f}=i,h={},{region:m}=i;m||(m=this.region);let g=new URL(`${this.url}/${r}`);m&&m!=="any"&&(h["x-region"]=m,g.searchParams.set("forceFunctionRegion",m));let y,v=!!l&&Object.keys(l).some(X=>X.toLowerCase()==="content-type");d&&!v?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(h["Content-Type"]=d.type||"application/octet-stream",y=d):typeof d=="string"?(h["Content-Type"]="text/plain",y=d):typeof FormData<"u"&&d instanceof FormData?y=d:(h["Content-Type"]="application/json",y=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?y=JSON.stringify(d):y=d;let b=p;f&&(a=new AbortController,s=setTimeout(()=>a.abort(),f),p?(b=a.signal,c=()=>a.abort(),p.addEventListener("abort",c)):b=a.signal);let x=yield this.fetch(g.toString(),{method:u||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),l),body:y,signal:b}).catch(X=>{throw new ba.FunctionsFetchError(X)}),k=x.headers.get("x-relay-error");if(k&&k==="true")throw new ba.FunctionsRelayError(x);if(!x.ok)throw new ba.FunctionsHttpError(x);let E=((n=x.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim().toLowerCase(),O;return E==="application/json"?O=yield x.json():E==="application/octet-stream"||E==="application/pdf"?O=yield x.blob():E==="text/event-stream"?O=x:E==="multipart/form-data"?O=yield x.formData():O=yield x.text(),{data:O,error:null,response:x}}catch(l){return{data:null,error:l,response:l instanceof ba.FunctionsHttpError||l instanceof ba.FunctionsRelayError?l.context:void 0}}finally{s&&clearTimeout(s),c&&((o=i.signal)===null||o===void 0||o.removeEventListener("abort",c))}})}};Yh.FunctionsClient=Mw});var gR=C(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.FunctionRegion=Ar.FunctionsRelayError=Ar.FunctionsHttpError=Ar.FunctionsFetchError=Ar.FunctionsError=Ar.FunctionsClient=void 0;var vV=mR();Object.defineProperty(Ar,"FunctionsClient",{enumerable:!0,get:function(){return vV.FunctionsClient}});var cu=Uw();Object.defineProperty(Ar,"FunctionsError",{enumerable:!0,get:function(){return cu.FunctionsError}});Object.defineProperty(Ar,"FunctionsFetchError",{enumerable:!0,get:function(){return cu.FunctionsFetchError}});Object.defineProperty(Ar,"FunctionsHttpError",{enumerable:!0,get:function(){return cu.FunctionsHttpError}});Object.defineProperty(Ar,"FunctionsRelayError",{enumerable:!0,get:function(){return cu.FunctionsRelayError}});Object.defineProperty(Ar,"FunctionRegion",{enumerable:!0,get:function(){return cu.FunctionRegion}})});function lu(t){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lu(t)}function bV(t,e){if(lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(lu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wV(t){var e=bV(t,"string");return lu(e)=="symbol"?e:e+""}function $V(t,e,r){return(e=wV(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vR(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function ts(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vR(Object(r),!0).forEach(function(i){$V(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vR(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function _R(t,e){return new Promise(r=>{if(e?.aborted){r();return}let i=setTimeout(()=>{e?.removeEventListener("abort",n),r()},t);function n(){clearTimeout(i),r()}e?.addEventListener("abort",n)})}function kV(t,e,r,i){return!(!i||r>=$R||!kR.includes(t)||!_V.includes(e))}async function SR(t,e,r,i){let n=0;for(;;){let c=ts({},r.headers);n>0&&(c["X-Retry-Count"]=String(n));let l;try{l=await t(e,{method:r.method,headers:c,body:r.body,signal:r.signal})}catch(u){var o;if(u?.name==="AbortError"||u?.code==="ABORT_ERR"||u?.name==="TimeoutError"&&(!((o=r.signal)===null||o===void 0)&&o.aborted)||!kR.includes(r.method))throw u;if(i&&n<$R){let d=yR(n);n++,await _R(d,r.signal);continue}throw u}if(kV(r.method,l.status,n,i)){var s,a;let u=(s=(a=l.headers)===null||a===void 0?void 0:a.get("Retry-After"))!==null&&s!==void 0?s:null,d=u!==null?Math.max(0,parseInt(u,10)||0)*1e3:yR(n);await l.text(),n++,await _R(d,r.signal);continue}return l}}function EV(t,e){try{let s=JSON.parse(t);if(s&&typeof s=="object"&&!Array.isArray(s)){var r,i,n,o;return new Ji({message:String((r=s.message)!==null&&r!==void 0?r:t),details:(i=s.details)!==null&&i!==void 0?i:"",hint:(n=s.hint)!==null&&n!==void 0?n:"",code:(o=s.code)!==null&&o!==void 0?o:""})}}catch{}return new Ji({message:t||e,details:"",hint:"",code:""})}function wR(t,e,r){var i;let n=t;return{success:!1,error:new Ji({message:`${(i=n?.name)!==null&&i!==void 0?i:"FetchError"}: ${n?.message}`,details:"",hint:"",code:""}),data:null,count:null,status:e,statusText:r}}var Ji,$R,yR,_V,kR,SV,xV,bR,wa,IV,xR,ER=w(()=>{Ji=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}},$R=3,yR=t=>Math.min(1e3*2**t,3e4),_V=[520,503],kR=["GET","HEAD","OPTIONS"];SV=class{constructor(t){var e,r,i,n,o;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(i=t.shouldStripNulls)!==null&&i!==void 0?i:!1,this.urlLengthLimit=(n=t.urlLengthLimit)!==null&&n!==void 0?n:8e3,this.retryEnabled=(o=t.retry)!==null&&o!==void 0?o:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){let s=this.headers.get("Accept");s==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!s||s==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let i=this.fetch,o=(async()=>{let s={};r.headers.forEach((c,l)=>{s[l]=c});let a=await SR(i,r.url.toString(),{method:r.method,headers:s,body:JSON.stringify(r.body,(c,l)=>typeof l=="bigint"?l.toString():l),signal:r.signal},r.retryEnabled);return await r.processResponse(a)})();return this.shouldThrowOnError||(o=o.catch(s=>{var a;let c="",l="",u="",d=s?.cause;if(d){var p,f,h,m;let v=(p=d?.message)!==null&&p!==void 0?p:"",b=(f=d?.code)!==null&&f!==void 0?f:"";c=`${(h=s?.name)!==null&&h!==void 0?h:"FetchError"}: ${s?.message}`,c+=`
|
|
88
|
+
|
|
89
|
+
Caused by: ${(m=d?.name)!==null&&m!==void 0?m:"Error"}: ${v}`,b&&(c+=` (${b})`),d?.stack&&(c+=`
|
|
90
|
+
${d.stack}`)}else{var g;c=(g=s?.stack)!==null&&g!==void 0?g:""}let y=this.url.toString().length;return s?.name==="AbortError"||s?.code==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",y>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${y} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(d?.name==="HeadersOverflowError"||d?.code==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",y>this.urlLengthLimit&&(l+=`. Your request URL is ${y} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=s?.name)!==null&&a!==void 0?a:"FetchError"}: ${s?.message}`,details:c,hint:l,code:u},data:null,count:null,status:0,statusText:""}})),o.then(t,e)}async processResponse(t){var e=this;let r=null,i=null,n=null,o=t.status,s=t.statusText;if(t.ok){var a,c;if(e.method!=="HEAD"){var l;let f=await t.text();if(f!=="")if(e.headers.get("Accept")==="text/csv")i=f;else if(e.headers.get("Accept")&&(!((l=e.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")))i=f;else try{i=JSON.parse(f)}catch{if(r={message:f},i=null,e.shouldThrowOnError)throw new Ji({message:f,details:"",hint:"",code:""})}}let d=(a=e.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),p=(c=t.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");if(d&&p&&p.length>1&&(n=parseInt(p[1])),e.isMaybeSingle&&Array.isArray(i))if(i.length>1){if(r={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,n=null,o=406,s="Not Acceptable",e.shouldThrowOnError){var u;throw new Ji(ts(ts({},r),{},{hint:(u=r.hint)!==null&&u!==void 0?u:""}))}}else i.length===1?i=i[0]:i=null}else{let d=await t.text();try{r=JSON.parse(d),Array.isArray(r)&&t.status===404&&(i=[],r=null,o=200,s="OK")}catch{t.status===404&&d===""?(o=204,s="No Content"):r={message:d}}if(r&&e.shouldThrowOnError)throw new Ji(r)}return{success:r===null,error:r,data:i,count:n,status:o,statusText:s}}returns(){return this}overrideTypes(){return this}},xV=class extends SV{throwOnError(){return super.throwOnError()}select(t){let e=!1,r=(t??"*").split("").map(i=>/\s/.test(i)&&!e?"":(i==='"'&&(e=!e),i)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:i,referencedTable:n=i}={}){let o=n?`${n}.order`:"order",s=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${s?`${s},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){let i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:i=r}={}){let n=typeof i>"u"?"offset":`${i}.offset`,o=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(n,`${t}`),this.url.searchParams.set(o,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:i=!1,wal:n=!1,format:o="text"}={}){var s;let a=[t?"analyze":null,e?"verbose":null,r?"settings":null,i?"buffers":null,n?"wal":null].filter(Boolean).join("|"),c=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${c}"; options=${a};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}},bR=new RegExp("[,()]"),wa=class extends xV{throwOnError(){return super.throwOnError()}eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){let r=Array.from(new Set(e)).map(i=>typeof i=="string"&&bR.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){let r=Array.from(new Set(e)).map(i=>typeof i=="string"&&bR.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:i}={}){let n="";i==="plain"?n="pl":i==="phrase"?n="ph":i==="websearch"&&(n="w");let o=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${n}fts${o}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){let i=r?`${r}.or`:"or";return this.url.searchParams.append(i,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},IV=class{constructor(t,{headers:e={},schema:r,fetch:i,urlLengthLimit:n=8e3,retry:o}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=i,this.urlLengthLimit=n,this.retry=o}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){let{head:r=!1,count:i}=e??{},n=r?"HEAD":"GET",o=!1,s=(t??"*").split("").map(l=>/\s/.test(l)&&!o?"":(l==='"'&&(o=!o),l)).join(""),{url:a,headers:c}=this.cloneRequestState();return a.searchParams.set("select",s),i&&c.append("Prefer",`count=${i}`),new wa({method:n,url:a,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var i;let n="POST",{url:o,headers:s}=this.cloneRequestState();if(e&&s.append("Prefer",`count=${e}`),r||s.append("Prefer","missing=default"),Array.isArray(t)){let a=t.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(a.length>0){let c=[...new Set(a)].map(l=>`"${l}"`);o.searchParams.set("columns",c.join(","))}}return new wa({method:n,url:o,headers:s,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:i,defaultToNull:n=!0}={}){var o;let s="POST",{url:a,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),i&&c.append("Prefer",`count=${i}`),n||c.append("Prefer","missing=default"),Array.isArray(t)){let l=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){let u=[...new Set(l)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new wa({method:s,url:a,headers:c,schema:this.schema,body:t,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;let i="PATCH",{url:n,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new wa({method:i,url:n,headers:o,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;let r="DELETE",{url:i,headers:n}=this.cloneRequestState();return t&&n.append("Prefer",`count=${t}`),new wa({method:r,url:i,headers:n,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};xR=class IR{constructor(e,{headers:r={},schema:i,fetch:n,timeout:o,urlLengthLimit:s=8e3,retry:a}={}){this.url=e,this.headers=new Headers(r),this.schemaName=i,this.urlLengthLimit=s;let c=n??globalThis.fetch;o!==void 0&&o>0?this.fetch=(l,u)=>{let d=new AbortController,p=setTimeout(()=>d.abort(),o),f=u?.signal;if(f){if(f.aborted)return clearTimeout(p),c(l,u);let h=()=>{clearTimeout(p),d.abort()};return f.addEventListener("abort",h,{once:!0}),c(l,ts(ts({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(p),f.removeEventListener("abort",h)})}return c(l,ts(ts({},u),{},{signal:d.signal})).finally(()=>clearTimeout(p))}:this.fetch=c,this.retry=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new IV(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new IR(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}async getOpenApiSpec(){var e=this,r;let i=new Headers(e.headers);i.set("Accept","application/openapi+json"),e.schemaName&&i.set("Accept-Profile",e.schemaName);let n={};i.forEach((l,u)=>{n[u]=l});let o=(r=e.fetch)!==null&&r!==void 0?r:globalThis.fetch,s;try{var a;s=await SR(o,`${e.url}/`,{method:"GET",headers:n},(a=e.retry)!==null&&a!==void 0?a:!0)}catch(l){return wR(l,0,"")}let c;try{c=await s.text()}catch(l){return wR(l,s.status,s.statusText)}if(s.ok)try{return{success:!0,error:null,data:JSON.parse(c),count:null,status:s.status,statusText:s.statusText}}catch{}return{success:!1,error:EV(c,s.statusText),data:null,count:null,status:s.status,statusText:s.statusText}}rpc(e,r={},{head:i=!1,get:n=!1,count:o}={}){var s;let a,c=new URL(`${this.url}/rpc/${e}`),l,u=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(u)),d=i&&Object.values(r).some(u);d?(a="POST",l=r):i||n?(a=i?"HEAD":"GET",Object.entries(r).filter(([f,h])=>h!==void 0).map(([f,h])=>[f,Array.isArray(h)?`{${h.join(",")}}`:`${h}`]).forEach(([f,h])=>{c.searchParams.append(f,h)})):(a="POST",l=r);let p=new Headers(this.headers);return d?p.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&p.set("Prefer",`count=${o}`),new wa({method:a,url:c,headers:p,schema:this.schemaName,body:l,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}}});var Fw=C(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.WebSocketFactory=void 0;var Qh=class{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};let r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};let i=typeof global<"u"?global:void 0;if(i&&typeof i.WebSocket<"u")return{type:"native",wsConstructor:i.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let n=globalThis.process;if(n){let o=n.versions;if(o&&o.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
|
|
91
|
+
|
|
92
|
+
Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}};uu.WebSocketFactory=Qh;uu.default=Qh});var TR=C(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.version=void 0;em.version="2.117.3"});var du=C(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.CONNECTION_STATE=He.TRANSPORTS=He.CHANNEL_EVENTS=He.CHANNEL_STATES=He.SOCKET_STATES=He.MAX_PUSH_BUFFER_SIZE=He.WS_CLOSE_NORMAL=He.POSTGRES_CHANGES_WAIT_ERROR_GRACE=He.DEFAULT_POSTGRES_CHANGES_WAIT_TIMEOUT=He.DEFAULT_TIMEOUT=He.VERSION=He.DEFAULT_VSN=He.VSN_2_0_0=He.VSN_1_0_0=He.DEFAULT_VERSION=void 0;var OR=TR();He.DEFAULT_VERSION=`realtime-js/${OR.version}`;He.VSN_1_0_0="1.0.0";He.VSN_2_0_0="2.0.0";He.DEFAULT_VSN=He.VSN_2_0_0;He.VERSION=OR.version;He.DEFAULT_TIMEOUT=1e4;He.DEFAULT_POSTGRES_CHANGES_WAIT_TIMEOUT=15e3;He.POSTGRES_CHANGES_WAIT_ERROR_GRACE=1e4;He.WS_CLOSE_NORMAL=1e3;He.MAX_PUSH_BUFFER_SIZE=100;He.SOCKET_STATES={connecting:0,open:1,closing:2,closed:3};He.CHANNEL_STATES={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"};He.CHANNEL_EVENTS={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"};He.TRANSPORTS={websocket:"websocket"};He.CONNECTION_STATE={connecting:"connecting",open:"open",closing:"closing",closed:"closed"}});var PR=C(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});var Zw=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(i))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,i;let n=(i=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&i!==void 0?i:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var r,i;let n=(i=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&i!==void 0?i:{},s=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(e,r,i){var n,o;let s=new TextEncoder,a=s.encode(e.topic),c=s.encode((n=e.ref)!==null&&n!==void 0?n:""),l=s.encode((o=e.join_ref)!==null&&o!==void 0?o:""),u=s.encode(e.payload.event),d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},p=s.encode(Object.keys(d).length===0?"":JSON.stringify(d));if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`ref length ${c.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`metadata length ${p.length} exceeds maximum of 255`);let f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+c.length+a.length+u.length+p.length,h=new ArrayBuffer(this.HEADER_LENGTH+f),m=new DataView(h),g=new Uint8Array(h),y=0;m.setUint8(y++,this.KINDS.userBroadcastPush),m.setUint8(y++,l.length),m.setUint8(y++,c.length),m.setUint8(y++,a.length),m.setUint8(y++,u.length),m.setUint8(y++,p.length),m.setUint8(y++,r),g.set(l,y),y+=l.length,g.set(c,y),y+=c.length,g.set(a,y),y+=a.length,g.set(u,y),y+=u.length,g.set(p,y),y+=p.length;var v=new Uint8Array(h.byteLength+i.byteLength);return v.set(new Uint8Array(h),0),v.set(new Uint8Array(i),h.byteLength),v.buffer}decode(e,r){if(this._isArrayBuffer(e)){let i=this._binaryDecode(e);return r(i)}if(typeof e=="string"){let i=JSON.parse(e),[n,o,s,a,c]=i;return r({join_ref:n,ref:o,topic:s,event:a,payload:c})}return r({})}_binaryDecode(e){let r=new DataView(e),i=r.getUint8(0),n=new TextDecoder;switch(i){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,n)}}_decodeUserBroadcast(e,r,i){let n=r.getUint8(1),o=r.getUint8(2),s=r.getUint8(3),a=r.getUint8(4),c=this.HEADER_LENGTH+4,l=i.decode(e.slice(c,c+n));c=c+n;let u=i.decode(e.slice(c,c+o));c=c+o;let d=i.decode(e.slice(c,c+s));c=c+s;let p=e.slice(c,e.byteLength),f=a===this.JSON_ENCODING?JSON.parse(i.decode(p)):p,h={type:this.BROADCAST_EVENT,event:u,payload:f};return s>0&&(h.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:h}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([i])=>r.includes(i)))}};qw.default=Zw});var tm=C(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.httpEndpointURL=tt.toTimestampString=tt.toArray=tt.toJson=tt.toNumber=tt.toBoolean=tt.convertCell=tt.convertColumn=tt.convertChangeData=tt.PostgresTypes=void 0;var mt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(mt||(tt.PostgresTypes=mt={}));var TV=(t,e,r={})=>{var i;let n=(i=r.skipTypes)!==null&&i!==void 0?i:[];return e?Object.keys(e).reduce((o,s)=>(o[s]=(0,tt.convertColumn)(s,t,e,n),o),{}):{}};tt.convertChangeData=TV;var OV=(t,e,r,i)=>{let n=e.find(a=>a.name===t),o=n?.type,s=r[t];return o&&!i.includes(o)?(0,tt.convertCell)(o,s):Vw(s)};tt.convertColumn=OV;var PV=(t,e)=>{if(t.charAt(0)==="_"){let r=t.slice(1,t.length);return(0,tt.toArray)(e,r)}switch(t){case mt.bool:return(0,tt.toBoolean)(e);case mt.float4:case mt.float8:case mt.int2:case mt.int4:case mt.int8:case mt.numeric:case mt.oid:return(0,tt.toNumber)(e);case mt.json:case mt.jsonb:return(0,tt.toJson)(e);case mt.timestamp:return(0,tt.toTimestampString)(e);case mt.abstime:case mt.date:case mt.daterange:case mt.int4range:case mt.int8range:case mt.money:case mt.reltime:case mt.text:case mt.time:case mt.timestamptz:case mt.timetz:case mt.tsrange:case mt.tstzrange:return Vw(e);default:return Vw(e)}};tt.convertCell=PV;var Vw=t=>t,AV=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}};tt.toBoolean=AV;var RV=t=>{if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return e}return t};tt.toNumber=RV;var jV=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t};tt.toJson=jV;var zV=(t,e)=>{if(typeof t!="string")return t;let r=t.length-1,i=t[r];if(t[0]==="{"&&i==="}"){let o,s=t.slice(1,r);try{o=JSON.parse("["+s+"]")}catch{o=s?s.split(","):[]}return o.map(a=>(0,tt.convertCell)(e,a))}return t};tt.toArray=zV;var CV=t=>typeof t=="string"?t.replace(" ","T"):t;tt.toTimestampString=CV;var NV=t=>{let e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};tt.httpEndpointURL=NV});var Gw=C((Vne,jR)=>{"use strict";var Ww=Object.defineProperty,DV=Object.getOwnPropertyDescriptor,LV=Object.getOwnPropertyNames,UV=Object.prototype.hasOwnProperty,MV=(t,e)=>{for(var r in e)Ww(t,r,{get:e[r],enumerable:!0})},FV=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of LV(e))!UV.call(t,n)&&n!==r&&Ww(t,n,{get:()=>e[n],enumerable:!(i=DV(e,n))||i.enumerable});return t},ZV=t=>FV(Ww({},"__esModule",{value:!0}),t),AR={};MV(AR,{Channel:()=>RR,LongPoll:()=>rs,Presence:()=>JV,Push:()=>fu,Serializer:()=>hu,Socket:()=>XV,Timer:()=>Kw});jR.exports=ZV(AR);var ka=t=>typeof t=="function"?t:function(){return t},qV=typeof self<"u"?self:null,$a=typeof window<"u"?window:null,Hn=qV||$a||globalThis,VV="2.0.0",BV=1e4,HV=1e3,WV=100,Wn={connecting:0,open:1,closing:2,closed:3},Rr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},$i={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Bw={longpoll:"longpoll",websocket:"websocket"},KV={complete:4},Hw="base64url.bearer.phx.",fu=class{constructor(t,e,r,i){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(i=>i.status===t).forEach(i=>i.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},Kw=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},RR=class{constructor(t,e,r){this.state=Rr.closed,this.topic=t,this.params=ka(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new fu(this,$i.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Kw(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Rr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this.joinPush.receive("error",i=>{this.state=Rr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Rr.closed,this.socket.remove(this)}),this.onError(i=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.isJoining()&&this.joinPush.reset(),this.state=Rr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new fu(this,$i.leave,ka({}),this.timeout).send(),this.state=Rr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on($i.reply,(i,n)=>{this.trigger(this.replyEventName(n),i)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Rr.closed,this.bindings=[]}onClose(t){this.on($i.close,t)}onError(t){return this.on($i.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new fu(this,t,function(){return e},r);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Rr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger($i.close,"leave")},r=new fu(this,$i.leave,ka({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,i){return this.topic!==t?!1:i&&i!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:i}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Rr.joining,this.joinPush.resend(t))}trigger(t,e,r,i){let n=this.onMessage(t,e,r,i);if(e&&!n)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(s=>s.event===t&&this.filterBindings(s,e,r));for(let s=0;s<o.length;s++)o[s].callback(n,r,i||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Rr.closed}isErrored(){return this.state===Rr.errored}isJoined(){return this.state===Rr.joined}isJoining(){return this.state===Rr.joining}isLeaving(){return this.state===Rr.leaving}},rm=class{static request(t,e,r,i,n,o,s){if(Hn.XDomainRequest){let a=new Hn.XDomainRequest;return this.xdomainRequest(a,t,e,i,n,o,s)}else if(Hn.XMLHttpRequest){let a=new Hn.XMLHttpRequest;return this.xhrRequest(a,t,e,r,i,n,o,s)}else{if(Hn.fetch&&Hn.AbortController)return this.fetchRequest(t,e,r,i,n,o,s);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,i,n,o,s){let a={method:t,headers:r,body:i},c=null;if(n){c=new AbortController;let l=setTimeout(()=>c.abort(),n);a.signal=c.signal}return Hn.fetch(e,a).then(l=>l.text()).then(l=>this.parseJSON(l)).then(l=>s&&s(l)).catch(l=>{l.name==="AbortError"&&o?o():s&&s(null)}),c}static xdomainRequest(t,e,r,i,n,o,s){return t.timeout=n,t.open(e,r),t.onload=()=>{let a=this.parseJSON(t.responseText);s&&s(a)},o&&(t.ontimeout=o),t.onprogress=()=>{},t.send(i),t}static xhrRequest(t,e,r,i,n,o,s,a){t.open(e,r,!0),t.timeout=o;for(let[c,l]of Object.entries(i))t.setRequestHeader(c,l);return t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===KV.complete&&a){let c=this.parseJSON(t.responseText);a(c)}},s&&(t.ontimeout=s),t.send(n),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let n=e?`${e}[${i}]`:i,o=t[i];typeof o=="object"?r.push(this.serialize(o,n)):r.push(encodeURIComponent(n)+"="+encodeURIComponent(o))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},GV=t=>{let e="",r=new Uint8Array(t),i=r.byteLength;for(let n=0;n<i;n++)e+=String.fromCharCode(r[n]);return btoa(e)},rs=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Hw)&&(this.authToken=atob(e[1].slice(Hw.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=Wn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Bw.websocket),"$1/"+Bw.longpoll)}endpointURL(){return rm.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=Wn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Wn.open||this.readyState===Wn.connecting}poll(){let t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:i,messages:n}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=i}else r=0;switch(r){case 200:n.forEach(o=>{setTimeout(()=>this.onmessage({data:o}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Wn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=GV(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t,e=0){this.awaitingBatchAck=!0;let r=e+WV,i=t.slice(e,r);this.ajax("POST",{"Content-Type":"application/x-ndjson"},i.join(`
|
|
93
|
+
`),()=>this.onerror("timeout"),n=>{!n||n.status!==200?(this.awaitingBatchAck=!1,this.onerror(n&&n.status),this.closeAndRetry(1011,"internal server error",!1)):r<t.length?this.batchSend(t,r):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(t,e,r){for(let n of this.reqs)n.abort();this.readyState=Wn.closed;let i=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",i)):this.onclose(i)}ajax(t,e,r,i,n){let o,s=()=>{this.reqs.delete(o),i()};o=rm.request(t,this.endpointURL(),e,r,this.timeout,s,a=>{this.reqs.delete(o),this.isActive()&&n(a)}),this.reqs.add(o)}},JV=class pu{constructor(e,r={}){let i=r.events||{state:"presence_state",diff:"presence_diff"};this.state=Object.create(null),this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(i.state,n=>{let{onJoin:o,onLeave:s,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=pu.syncState(this.state,n,o,s),this.pendingDiffs.forEach(c=>{this.state=pu.syncDiff(this.state,c,o,s)}),this.pendingDiffs=[],a()}),this.channel.on(i.diff,n=>{let{onJoin:o,onLeave:s,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(n):(this.state=pu.syncDiff(this.state,n,o,s),a())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return pu.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,i,n){let o=this.toNullProtoObj(this.clone(e));r=this.toNullProtoObj(r);let s=Object.create(null),a=Object.create(null);return this.map(o,(c,l)=>{r[c]||(a[c]=l)}),this.map(r,(c,l)=>{let u=o[c];if(u){let d=l.metas.map(m=>m.phx_ref),p=u.metas.map(m=>m.phx_ref),f=l.metas.filter(m=>p.indexOf(m.phx_ref)<0),h=u.metas.filter(m=>d.indexOf(m.phx_ref)<0);f.length>0&&(s[c]=l,s[c].metas=f),h.length>0&&(a[c]=this.clone(u),a[c].metas=h)}else s[c]=l}),this.syncDiff(o,{joins:s,leaves:a},i,n)}static syncDiff(e,r,i,n){e=this.toNullProtoObj(e);let{joins:o,leaves:s}=this.clone(r);return i||(i=function(){}),n||(n=function(){}),this.map(o,(a,c)=>{let l=e[a];if(e[a]=this.clone(c),l){let u=e[a].metas.map(p=>p.phx_ref),d=l.metas.filter(p=>u.indexOf(p.phx_ref)<0);e[a].metas.unshift(...d)}i(a,l,c)}),this.map(s,(a,c)=>{let l=e[a];if(!l)return;let u=c.metas.map(d=>d.phx_ref);l.metas=l.metas.filter(d=>u.indexOf(d.phx_ref)<0),n(a,l,c),l.metas.length===0&&delete e[a]}),e}static list(e,r){return r||(r=function(i,n){return n}),this.map(e,(i,n)=>r(i,n))}static map(e,r){return Object.getOwnPropertyNames(e).map(i=>r(i,e[i]))}static toNullProtoObj(e){if(Object.getPrototypeOf(e)===null)return e;let r=Object.create(null);return Object.getOwnPropertyNames(e).forEach(i=>{r[i]=e[i]}),r}static clone(e){return JSON.parse(JSON.stringify(e))}},hu={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,i,n,o,s]=JSON.parse(t);return e({join_ref:r,ref:i,topic:n,event:o,payload:s})}},binaryEncode(t){let{join_ref:e,ref:r,event:i,topic:n,payload:o}=t,s=new TextEncoder,a=s.encode(e),c=s.encode(r),l=s.encode(n),u=s.encode(i);this.assertFieldSize(a.byteLength,"join_ref"),this.assertFieldSize(c.byteLength,"ref"),this.assertFieldSize(l.byteLength,"topic"),this.assertFieldSize(u.byteLength,"event");let d=this.META_LENGTH+a.byteLength+c.byteLength+l.byteLength+u.byteLength,p=new ArrayBuffer(this.HEADER_LENGTH+d),f=new Uint8Array(p),h=new DataView(p),m=0;h.setUint8(m++,this.KINDS.push),h.setUint8(m++,a.byteLength),h.setUint8(m++,c.byteLength),h.setUint8(m++,l.byteLength),h.setUint8(m++,u.byteLength),f.set(a,m),m+=a.byteLength,f.set(c,m),m+=c.byteLength,f.set(l,m),m+=l.byteLength,f.set(u,m),m+=u.byteLength;var g=new Uint8Array(p.byteLength+o.byteLength);return g.set(f,0),g.set(new Uint8Array(o),p.byteLength),g.buffer},assertFieldSize(t,e){if(t>255)throw new Error(`unable to convert ${e} to binary: must be less than or equal to 255 bytes, but is ${t} bytes`)},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,i);case this.KINDS.reply:return this.decodeReply(t,e,i);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,i)}},decodePush(t,e,r){let i=e.getUint8(1),n=e.getUint8(2),o=e.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(t.slice(s,s+i));s=s+i;let c=r.decode(t.slice(s,s+n));s=s+n;let l=r.decode(t.slice(s,s+o));s=s+o;let u=t.slice(s,t.byteLength);return{join_ref:a,ref:null,topic:c,event:l,payload:u}},decodeReply(t,e,r){let i=e.getUint8(1),n=e.getUint8(2),o=e.getUint8(3),s=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=r.decode(t.slice(a,a+i));a=a+i;let l=r.decode(t.slice(a,a+n));a=a+n;let u=r.decode(t.slice(a,a+o));a=a+o;let d=r.decode(t.slice(a,a+s));a=a+s;let p=t.slice(a,t.byteLength),f={status:d,response:p};return{join_ref:c,ref:l,topic:u,event:$i.reply,payload:f}},decodeBroadcast(t,e,r){let i=e.getUint8(1),n=e.getUint8(2),o=this.HEADER_LENGTH+2,s=r.decode(t.slice(o,o+i));o=o+i;let a=r.decode(t.slice(o,o+n));o=o+n;let c=t.slice(o,t.byteLength);return{join_ref:null,ref:null,topic:s,event:a,payload:c}}},XV=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||BV,this.transport=e.transport||Hn.WebSocket||rs,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=Hn&&Hn.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=hu.encode.bind(hu),this.defaultDecoder=hu.decode.bind(hu),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==rs?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;$a&&$a.addEventListener&&($a.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),i=this.connectClock)}),$a.addEventListener("pageshow",n=>{i===this.connectClock&&(i=null,this.connect())}),$a.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,o,s)=>{console.log(`${n}: ${o}`,s)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=ka(e.params||{}),this.endPoint=`${t}/${Bw.websocket}`,this.vsn=e.vsn||VV,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Kw(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken&&ka(e.authToken)}getLongPollTransport(){return rs}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=rm.appendParams(rm.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ka(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==rs?this.connectWithFallback(rs,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let i=this.onMessage(n=>{n.ref===e&&(this.off([i]),t(Date.now()-r))});return!0}transportName(t){switch(t){case rs:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Hw}${btoa(this.authToken()).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,i=!0,n,o,s=this.transportName(t),a=c=>{this.log("transport",`falling back to ${s}...`,c),this.off([n,o]),i=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${s}`))return a("memorized");this.fallbackTimer=setTimeout(a,e),o=this.onError(c=>{this.log("transport","error",c),i&&!r&&(clearTimeout(this.fallbackTimer),a(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!i){let c=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,e),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),HV,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();let i=this.conn;this.waitForBufferDone(i,()=>{e?i.close(e,r||""):i.close(),this.waitForSocketClosed(i,()=>{this.conn===i&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===Wn.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger($i.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case Wn.connecting:return"connecting";case Wn.open:return"open";case Wn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new RR(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:i,ref:n,join_ref:o}=t;this.log("push",`${e} ${r} (${o}, ${n})`,i)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:i,payload:n,ref:o,join_ref:s}=e;if(o&&o===this.pendingHeartbeatRef){let a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(n.status==="ok"?"ok":"error",a)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${r} ${i} ${o&&"("+o+")"||""}`.trim(),n);for(let a=0;a<this.channels.length;a++){let c=this.channels[a];c.isMember(r,i,n,s)&&c.trigger(i,n,o,s)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,i])=>{try{i(...e)}catch(n){this.log("error",`error in ${t} callback`,n)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}}});var CR=C(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});var YV=Gw(),Jw=class t{constructor(e,r){let i=e2(r);this.presence=new YV.Presence(e.getChannel(),i),this.presence.onJoin((n,o,s)=>{let a=t.onJoinPayload(n,o,s);e.getChannel().trigger("presence",a)}),this.presence.onLeave((n,o,s)=>{let a=t.onLeavePayload(n,o,s);e.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return t.transformState(this.presence.state)}static transformState(e){return e=QV(e),Object.getOwnPropertyNames(e).reduce((r,i)=>{let n=e[i];return r[i]=nm(n),r},{})}static onJoinPayload(e,r,i){let n=zR(r),o=nm(i);return{event:"join",key:e,currentPresences:n,newPresences:o}}static onLeavePayload(e,r,i){let n=zR(r),o=nm(i);return{event:"leave",key:e,currentPresences:n,leftPresences:o}}};Xw.default=Jw;function nm(t){return t.metas.map(e=>{let r=Object.getOwnPropertyDescriptors(e),i=Object.defineProperties({},r);return i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i})}function QV(t){return JSON.parse(JSON.stringify(t))}function e2(t){return t?.events&&{events:t.events}}function zR(t){return t?.metas?nm(t):[]}});var Qw=C(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.REALTIME_PRESENCE_LISTEN_EVENTS=void 0;var t2=(qr(),Xr(Zr)),r2=t2.__importDefault(CR()),NR;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(NR||(mu.REALTIME_PRESENCE_LISTEN_EVENTS=NR={}));var Yw=class{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new r2.default(this.channel.channelAdapter,r)}};mu.default=Yw});var DR=C(e$=>{"use strict";Object.defineProperty(e$,"__esModule",{value:!0});e$.normalizeChannelError=n2;function n2(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){let e=t;if(typeof e.code=="number"){let r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}});var LR=C(r$=>{"use strict";Object.defineProperty(r$,"__esModule",{value:!0});var Sa=du(),t$=class{constructor(e,r,i){let n=i2(i);this.channel=e.getSocket().channel(r,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,i){let n;try{n=this.channel.push(e,r,i)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>Sa.MAX_PUSH_BUFFER_SIZE){let o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${o.event}`,o.payload())}return n}updateJoinPayload(e){let r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===Sa.CHANNEL_STATES.joined}isJoined(){return this.state===Sa.CHANNEL_STATES.joined}isJoining(){return this.state===Sa.CHANNEL_STATES.joining}isClosed(){return this.state===Sa.CHANNEL_STATES.closed}isLeaving(){return this.state===Sa.CHANNEL_STATES.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};r$.default=t$;function i2(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}});var n$=C(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.postgresChangesFilter=xa.RealtimePostgresFilterBuilder=void 0;var o2=/[,()"\\]/,s2=t=>o2.test(t)||t!==t.trim(),a2=t=>`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,UR=t=>{let e=t===null?"null":String(t);return s2(e)?a2(e):e},c2=t=>t===null?"null":String(t),l2=(t,e)=>{if(t==="in"){let r=Array.isArray(e)?e:[e];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(n=>UR(n)).join(",")})`}return t==="is"?`is.${c2(e)}`:`${t}.${UR(e)}`},im=class{constructor(){this.filters=[]}add(e,r,i,n=!1){let o=n?"not.":"";return this.filters.push(`${e}=${o}${l2(r,i)}`),this}eq(e,r){return this.add(e,"eq",r)}neq(e,r){return this.add(e,"neq",r)}gt(e,r){return this.add(e,"gt",r)}gte(e,r){return this.add(e,"gte",r)}lt(e,r){return this.add(e,"lt",r)}lte(e,r){return this.add(e,"lte",r)}in(e,r){return this.add(e,"in",r)}like(e,r){return this.add(e,"like",r)}ilike(e,r){return this.add(e,"ilike",r)}match(e,r){return this.add(e,"match",r)}imatch(e,r){return this.add(e,"imatch",r)}is(e,r){return this.add(e,"is",r)}isDistinct(e,r){return this.add(e,"isdistinct",r)}not(e,r,i){return this.add(e,r,i,!0)}build(){return this.filters.join(",")}toString(){return this.build()}};xa.RealtimePostgresFilterBuilder=im;var u2=()=>new im;xa.postgresChangesFilter=u2});var s$=C(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.REALTIME_CHANNEL_STATES=vr.REALTIME_SUBSCRIBE_STATES=vr.REALTIME_LISTEN_TYPES=vr.REALTIME_POSTGRES_CHANGES_LISTEN_EVENT=vr.postgresChangesFilter=vr.RealtimePostgresFilterBuilder=void 0;var o$=(qr(),Xr(Zr)),ns=du(),d2=o$.__importDefault(Qw()),MR=o$.__importStar(tm()),f2=tm(),p2=DR(),h2=o$.__importDefault(LR()),m2=n$(),ZR=n$();Object.defineProperty(vr,"RealtimePostgresFilterBuilder",{enumerable:!0,get:function(){return ZR.RealtimePostgresFilterBuilder}});Object.defineProperty(vr,"postgresChangesFilter",{enumerable:!0,get:function(){return ZR.postgresChangesFilter}});var FR;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(FR||(vr.REALTIME_POSTGRES_CHANGES_LISTEN_EVENT=FR={}));var is;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(is||(vr.REALTIME_LISTEN_TYPES=is={}));var ki;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(ki||(vr.REALTIME_SUBSCRIBE_STATES=ki={}));vr.REALTIME_CHANNEL_STATES=ns.CHANNEL_STATES;var i$=class t{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},i){var n,o;if(this.topic=e,this.params=r,this.socket=i,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new h2.default(this.socket.socketAdapter,e,this.params),this.presence=new d2.default(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=(0,f2.httpEndpointURL)(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((o=(n=this.params.config)===null||n===void 0?void 0:n.broadcast)===null||o===void 0)&&o.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var i,n,o,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:a,presence:c,private:l,postgres_changes_options:u}}=this.params,d=(n=(i=this.bindings.postgres_changes)===null||i===void 0?void 0:i.map(g=>g.filter))!==null&&n!==void 0?n:[],p=!!this.bindings[is.PRESENCE]&&this.bindings[is.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,f={},h=Object.assign({broadcast:a,presence:Object.assign(Object.assign({},c),{enabled:p}),postgres_changes:d,private:l},u?{postgres_changes_options:u}:{});this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(g=>{e?.(ki.CHANNEL_ERROR,(0,p2.normalizeChannelError)(g))}),this._onClose(()=>e?.(ki.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this._updateFilterMessage();let m=u?.wait&&d.length>0?Math.max(r,((s=u.timeout)!==null&&s!==void 0?s:ns.DEFAULT_POSTGRES_CHANGES_WAIT_TIMEOUT)+ns.POSTGRES_CHANGES_WAIT_ERROR_GRACE):r;this.channelAdapter.subscribe(m).receive("ok",async({postgres_changes:g})=>{if(this.socket._isManualToken()||this.socket.setAuth(),g===void 0){e?.(ki.SUBSCRIBED);return}this._updatePostgresBindings(g,e)}).receive("error",g=>{this.state=ns.CHANNEL_STATES.errored;let y=Object.values(g).join(", ")||"error";e?.(ki.CHANNEL_ERROR,new Error(y,{cause:g}))}).receive("timeout",()=>{e?.(ki.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var i;let n=this.bindings.postgres_changes,o=(i=n?.length)!==null&&i!==void 0?i:0,s=[];for(let a=0;a<o;a++){let c=n[a],{filter:{event:l,schema:u,table:d,filter:p}}=c,f=e&&e[a];if(f&&f.event===l&&t.isFilterValueEqual(f.schema,u)&&t.isFilterValueEqual(f.table,d)&&t.isFilterValueEqual(f.filter,p))s.push(Object.assign(Object.assign({},c),{id:f.id}));else{this.unsubscribe(),this.state=ns.CHANNEL_STATES.errored,r?.(ki.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=s,this.state!=ns.CHANNEL_STATES.errored&&r&&r(ki.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,i){let n=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=e===is.PRESENCE||e===is.POSTGRES_CHANGES;if(n&&o)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,i)}async httpSend(e,r,i={}){var n;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));let o=r instanceof ArrayBuffer||ArrayBuffer.isView(r),s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":o?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);let a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&a.searchParams.set("private","true");let c={method:"POST",headers:s,body:o?r:JSON.stringify(r)},l=await this._fetchWithTimeout(a.toString(),c,(n=i.timeout)!==null&&n!==void 0?n:this.timeout);if(l.status===202)return{success:!0};if(l.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let u=l.statusText;try{let d=await l.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(e,r={}){var i,n;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){let o="Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.";this.socket.hasLogger()?this.socket.log("channel",o):console.warn(o);let{event:s,payload:a}=e,c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);let l={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);return await((n=u.body)===null||n===void 0?void 0:n.cancel()),u.ok?"ok":"error"}catch(u){return u instanceof Error&&u.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var s,a,c;let l=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(s=this.params)===null||s===void 0?void 0:s.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&o("ok"),l.receive("ok",()=>o("ok")),l.receive("error",()=>o("error")),l.receive("timeout",()=>o("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,i){let n=new AbortController,o=setTimeout(()=>n.abort(),i),s=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:n.signal}));return clearTimeout(o),s}_on(e,r,i){var n;let o=e.toLocaleLowerCase(),s=r?.filter;if((s instanceof m2.RealtimePostgresFilterBuilder||typeof s=="object"&&s!==null&&typeof s.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:s.build()})),o===is.POSTGRES_CHANGES&&((n=this.bindings[o])===null||n===void 0?void 0:n.find(u=>t.isSamePostgresFilter(u.filter,r))))return this.socket.log("error",`duplicate \`postgres_changes\` binding for ${this.topic} ignored`,r),this;let a=this.channelAdapter.on(e,i),c={type:o,filter:r,callback:i,ref:a};return this.bindings[o]?this.bindings[o].push(c):this.bindings[o]=[c],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,i)=>{var n,o,s,a,c,l,u;let d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,i))return!1;let p=(n=this.bindings[d])===null||n===void 0?void 0:n.find(f=>f.ref===e.ref);if(!p)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in p){let f=p.id,h=(o=p.filter)===null||o===void 0?void 0:o.event;return f&&((s=r.ids)===null||s===void 0?void 0:s.includes(f))&&(h==="*"||h?.toLocaleLowerCase()===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{let f=(l=(c=p?.filter)===null||c===void 0?void 0:c.event)===null||l===void 0?void 0:l.toLocaleLowerCase();return f==="*"||f===((u=r?.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,r){let{close:i,error:n,leave:o,join:s}=ns.CHANNEL_EVENTS;return r&&[i,n,o,s].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,i)=>{if(typeof r=="object"&&"ids"in r){let n=r.data,{schema:o,table:s,commit_timestamp:a,type:c,errors:l}=n;return Object.assign(Object.assign({},{schema:o,table:s,commit_timestamp:a,eventType:c,new:{},old:{},errors:l}),this._getPayloadRecords(n))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(let r in e.bindings)for(let i of e.bindings[r])this._on(i.type,i.filter,i.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}static isSamePostgresFilter(e,r){var i,n,o,s;let a=(n=(i=e?.select)===null||i===void 0?void 0:i.join())!==null&&n!==void 0?n:void 0,c=(s=(o=r?.select)===null||o===void 0?void 0:o.join())!==null&&s!==void 0?s:void 0;return e?.event===r?.event&&t.isFilterValueEqual(e?.schema,r?.schema)&&t.isFilterValueEqual(e?.table,r?.table)&&t.isFilterValueEqual(e?.filter,r?.filter)&&a===c}_getPayloadRecords(e){let r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=MR.convertChangeData(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=MR.convertChangeData(e.columns,e.old_record)),r}};vr.default=i$});var VR=C(c$=>{"use strict";Object.defineProperty(c$,"__esModule",{value:!0});var g2=Gw(),qR=du(),a$=class{constructor(e,r){this.socket=new g2.Socket(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,i,n=1e4){return new Promise(o=>{setTimeout(()=>o("timeout"),n),this.socket.disconnect(()=>{e(),o("ok")},r,i)})}push(e){this.socket.push(e)}log(e,r,i){this.socket.log(e,r,i)}hasLogger(){return this.socket.hasLogger()}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==qR.CONNECTION_STATE.connecting}isDisconnecting(){return this.socket.connectionState()==qR.CONNECTION_STATE.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}};c$.default=a$});var HR=C(u$=>{"use strict";Object.defineProperty(u$,"__esModule",{value:!0});var om=(qr(),Xr(Zr)),y2=om.__importDefault(Fw()),os=du(),v2=om.__importDefault(PR()),_2=tm(),b2=om.__importDefault(s$()),w2=om.__importDefault(VR()),BR={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},$2=[1e3,2e3,5e3,1e4],k2=1e4;function S2(){let t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function x2(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return S2()}var I2=`
|
|
94
|
+
addEventListener("message", (e) => {
|
|
95
|
+
if (e.data.event === "start") {
|
|
96
|
+
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
97
|
+
}
|
|
98
|
+
});`,l$=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var i;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new v2.default,this._manuallySetToken=!1,this._authPromise=null,this._authGeneration=0,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=o=>o?(...s)=>o(...s):(...s)=>fetch(...s),!(!((i=r?.params)===null||i===void 0)&&i.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;let n=this._initializeOptions(r);this.socketAdapter=new w2.default(e,n),this.httpEndpoint=(0,_2.httpEndpointURL)(e),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let r=e.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){let r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){let e=this.channels.map(async i=>{let n=await i.unsubscribe();return i.teardown(),n}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,i){this.socketAdapter.log(e,r,i)}hasLogger(){return this.socketAdapter.hasLogger()}connectionState(){return this.socketAdapter.connectionState()||os.CONNECTION_STATE.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){let i=`realtime:${e}`,n=this.getChannels().find(o=>o.topic===i);if(n)return n;{let o=new b2.default(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(o),o}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){let r=++this._authGeneration,i=this._performAuth(e,r);r===this._authGeneration&&(this._authPromise=i);try{await i}finally{this._authPromise===i&&(this._authPromise=null)}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e,r){let i,n=!1;if(e)i=e,n=!0;else if(this.accessToken)try{i=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),i=this.accessTokenValue}else i=this.accessTokenValue;r===this._authGeneration&&(this.accessToken?this._manuallySetToken=!1:n&&(this._manuallySetToken=!0),this.accessTokenValue!=i&&(this.accessTokenValue=i,this.channels.forEach(o=>{let s={access_token:i,version:os.DEFAULT_VERSION};o.updateJoinPayload(s),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(os.CHANNEL_EVENTS.access_token,{access_token:i})})))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,i)=>{r!=="disconnected"&&(r=="sent"&&this._setAuthSafely(),e&&e(r,i))}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{let i=new Blob([I2],{type:"application/javascript"});r=URL.createObjectURL(i)}return r}_initializeOptions(e){var r,i,n,o,s,a,c,l,u,d,p,f;this.worker=(r=e?.worker)!==null&&r!==void 0?r:!1,this.accessToken=(i=e?.accessToken)!==null&&i!==void 0?i:null;let h={};h.timeout=(n=e?.timeout)!==null&&n!==void 0?n:os.DEFAULT_TIMEOUT,h.heartbeatIntervalMs=(o=e?.heartbeatIntervalMs)!==null&&o!==void 0?o:BR.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(s=e?.disconnectOnEmptyChannelsAfterMs)!==null&&s!==void 0?s:2*((a=e?.heartbeatIntervalMs)!==null&&a!==void 0?a:BR.HEARTBEAT_INTERVAL),h.transport=(c=e?.transport)!==null&&c!==void 0?c:y2.default.getWebSocketConstructor(),h.params=e?.params,h.logger=e?.logger,h.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),h.sessionStorage=(l=e?.sessionStorage)!==null&&l!==void 0?l:x2(),h.reconnectAfterMs=(u=e?.reconnectAfterMs)!==null&&u!==void 0?u:(v=>$2[v-1]||k2);let m,g,y=(d=e?.vsn)!==null&&d!==void 0?d:os.DEFAULT_VSN;switch(y){case os.VSN_1_0_0:m=(v,b)=>b(JSON.stringify(v)),g=(v,b)=>b(JSON.parse(v));break;case os.VSN_2_0_0:m=this.serializer.encode.bind(this.serializer),g=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${h.vsn}`)}if(h.vsn=y,h.encode=(p=e?.encode)!==null&&p!==void 0?p:m,h.decode=(f=e?.decode)!==null&&f!==void 0?f:g,h.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,h.params=Object.assign(Object.assign({},h.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e?.workerUrl,h.autoSendHeartbeat=!this.worker}return h}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}};u$.default=l$});var d$=C(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.WebSocketFactory=wt.REALTIME_CHANNEL_STATES=wt.REALTIME_SUBSCRIBE_STATES=wt.REALTIME_PRESENCE_LISTEN_EVENTS=wt.REALTIME_POSTGRES_CHANGES_LISTEN_EVENT=wt.REALTIME_LISTEN_TYPES=wt.postgresChangesFilter=wt.RealtimePostgresFilterBuilder=wt.RealtimeClient=wt.RealtimeChannel=wt.RealtimePresence=void 0;var sm=(qr(),Xr(Zr)),E2=sm.__importDefault(HR());wt.RealtimeClient=E2.default;var ss=sm.__importStar(s$());wt.RealtimeChannel=ss.default;Object.defineProperty(wt,"RealtimePostgresFilterBuilder",{enumerable:!0,get:function(){return ss.RealtimePostgresFilterBuilder}});Object.defineProperty(wt,"postgresChangesFilter",{enumerable:!0,get:function(){return ss.postgresChangesFilter}});Object.defineProperty(wt,"REALTIME_LISTEN_TYPES",{enumerable:!0,get:function(){return ss.REALTIME_LISTEN_TYPES}});Object.defineProperty(wt,"REALTIME_POSTGRES_CHANGES_LISTEN_EVENT",{enumerable:!0,get:function(){return ss.REALTIME_POSTGRES_CHANGES_LISTEN_EVENT}});Object.defineProperty(wt,"REALTIME_SUBSCRIBE_STATES",{enumerable:!0,get:function(){return ss.REALTIME_SUBSCRIBE_STATES}});Object.defineProperty(wt,"REALTIME_CHANNEL_STATES",{enumerable:!0,get:function(){return ss.REALTIME_CHANNEL_STATES}});var WR=sm.__importStar(Qw());wt.RealtimePresence=WR.default;Object.defineProperty(wt,"REALTIME_PRESENCE_LISTEN_EVENTS",{enumerable:!0,get:function(){return WR.REALTIME_PRESENCE_LISTEN_EVENTS}});var T2=sm.__importDefault(Fw());wt.WebSocketFactory=T2.default});function O2(t,e,r){let i=new URL(e,t);if(r)for(let[n,o]of Object.entries(r))o!==void 0&&i.searchParams.set(n,o);return i.toString()}async function P2(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function A2(t){let e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:i,query:n,body:o,headers:s}){let a=O2(t.baseUrl,i,n),c=await P2(t.auth),l=await e(a,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...c,...s},body:o?JSON.stringify(o):void 0}),u=await l.text(),d=(l.headers.get("content-type")||"").includes("application/json"),p=d&&u?JSON.parse(u):u;if(!l.ok){let f=d?p:void 0,h=f?.error;throw new gu(h?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:h?.type,icebergCode:h?.code,details:f})}return{status:l.status,headers:l.headers,data:p}}}}function am(t){return t.join("")}function Ia(t){return t.join("")}var gu,R2,j2,KR,GR=w(()=>{gu=class extends Error{constructor(t,e){super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&e.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};R2=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){let e=t?{parent:am(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(i=>({namespace:i}))}async createNamespace(t,e){let r={namespace:t.namespace,properties:e?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${am(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${am(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${am(t.namespace)}`}),!0}catch(e){if(e instanceof gu&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof gu&&r.status===409)return;throw r}}};j2=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ia(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ia(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ia(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ia(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String(e?.purge??!1)}})}async loadTable(t){let e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ia(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){let e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ia(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof gu&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof gu&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},KR=class{constructor(t){let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);let r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=A2({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=t.accessDelegation?.join(","),this.namespaceOps=new R2(this.client,e),this.tableOps=new j2(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}}});function vu(t){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vu(t)}function z2(t,e){if(vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(vu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function C2(t){var e=z2(t,"string");return vu(e)=="symbol"?e:e+""}function N2(t,e,r){return(e=C2(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function JR(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function pe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?JR(Object(r),!0).forEach(function(i){N2(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):JR(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function dm(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}function cm(t,e,r){let i=pe({},t),n=e.toLowerCase();for(let o of Object.keys(i))o.toLowerCase()===n&&delete i[o];return i[n]=r,i}function D2(t){let e={};for(let[r,i]of Object.entries(t))e[r.toLowerCase()]=i;return e}async function yu(t,e,r,i,n,o,s){return new Promise((a,c)=>{t(r,Z2(e,i,n,o)).then(l=>{if(!l.ok)throw l;if(i?.noResolveJson)return l;if(s==="vectors"){let u=l.headers.get("content-type");if(l.headers.get("content-length")==="0"||l.status===204)return{};if(!u||!u.includes("application/json"))return{}}return l.json()}).then(l=>a(l)).catch(l=>F2(l,c,i,s))})}function ej(t="storage"){return{get:async(e,r,i,n)=>yu(e,"GET",r,i,n,void 0,t),post:async(e,r,i,n,o)=>yu(e,"POST",r,n,o,i,t),put:async(e,r,i,n,o)=>yu(e,"PUT",r,n,o,i,t),head:async(e,r,i,n)=>yu(e,"HEAD",r,pe(pe({},i),{},{noResolveJson:!0}),n,void 0,t),remove:async(e,r,i,n,o)=>yu(e,"DELETE",r,n,o,i,t)}}var um,_u,QR,L2,U2,p$,M2,h$,XR,F2,Z2,q2,Ea,Sn,lm,V2,Ta,Vr,Oa,tj,B2,rj,H2,f$,YR,W2,K2,bu,G2,J2,X2,Y2,Q2,eB,tB,rB,nj,ij=w(()=>{GR();um=class extends Error{constructor(t,e="storage",r,i){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=i}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};_u=class extends um{constructor(t,e,r,i="storage",n){super(t,i,e,r),this.name=i==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r,this.code=n}toJSON(){return pe(pe({},super.toJSON()),{},{code:this.code})}},QR=class extends um{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};L2=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),U2=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},p$=t=>{if(Array.isArray(t))return t.map(r=>p$(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,i])=>{let n=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[n]=p$(i)}),e},M2=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),h$=t=>t.split("/").map(encodeURIComponent).join("/"),XR=t=>{if(typeof t=="object"&&t!==null){let e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){let r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},F2=async(t,e,r,i)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){let n=t,o=parseInt(String(n.status),10);Number.isFinite(o)||(o=500),n.json().then(s=>{let a=s?.statusCode||s?.code||o+"";e(new _u(XR(s),o,a,i,s?.code))}).catch(()=>{let s=o+"";e(new _u(n.statusText||`HTTP ${o} error`,o,s,i))})}else e(new QR(XR(t),t,i))},Z2=(t,e,r,i)=>{let n={method:t,headers:e?.headers||{}};if(t==="GET"||t==="HEAD"||!i)return pe(pe({},n),r);if(U2(i)){var o;let s=e?.headers||{},a;for(let[c,l]of Object.entries(s))c.toLowerCase()==="content-type"&&(a=l);n.headers=cm(s,"Content-Type",(o=a)!==null&&o!==void 0?o:"application/json"),n.body=JSON.stringify(i)}else n.body=i;return e?.duplex&&(n.duplex=e.duplex),pe(pe({},n),r)};q2=ej("storage"),{get:Ea,post:Sn,put:lm,head:V2,remove:Ta}=q2,Vr=ej("vectors"),Oa=class{constructor(t,e={},r,i="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=D2(e),this.fetch=L2(r),this.namespace=i}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=cm(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(dm(r))return{data:null,error:r};throw r}}};tj=Symbol.toStringTag;B2=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[tj]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(dm(e))return{data:null,error:e};throw e}}};rj=Symbol.toStringTag;H2=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[rj]="BlobDownloadBuilder",this.promise=null}asStream(){return new B2(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(dm(e))return{data:null,error:e};throw e}}},f$={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},YR={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},W2=class extends Oa{constructor(t,e={},r,i){super(t,e,i,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,i){var n=this;return n.handleOperation(async()=>{let o,s=pe(pe({},YR),i),a=pe(pe({},n.headers),t==="POST"&&{"x-upsert":String(s.upsert)}),c=s.metadata;if(typeof Blob<"u"&&r instanceof Blob||typeof FormData<"u"&&r instanceof FormData?o=n.prepareUploadFormData(r,s):(o=r,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,c&&(a["x-metadata"]=n.toBase64(n.encodeMetadata(c))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!s.duplex&&(s.duplex="half")),i?.headers)for(let[p,f]of Object.entries(i.headers))a=cm(a,p,f);let l=n._removeEmptyFolders(e),u=n._getFinalPath(l),d=await(t=="PUT"?lm:Sn)(n.fetch,`${n.url}/object/${u}`,o,pe({headers:a},s?.duplex?{duplex:s.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,i){var n=this;let o=n._removeEmptyFolders(t),s=n._getFinalPath(o),a=new URL(n.url+`/object/upload/sign/${s}`);return a.searchParams.set("token",e),n.handleOperation(async()=>{let c,l=pe(pe({},YR),i),u=pe(pe({},n.headers),{"x-upsert":String(l.upsert)}),d=l.metadata;if(typeof Blob<"u"&&r instanceof Blob||typeof FormData<"u"&&r instanceof FormData?c=n.prepareUploadFormData(r,l):(c=r,u["cache-control"]=`max-age=${l.cacheControl}`,u["content-type"]=l.contentType,d&&(u["x-metadata"]=n.toBase64(n.encodeMetadata(d))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!l.duplex&&(l.duplex="half")),i?.headers)for(let[p,f]of Object.entries(i.headers))u=cm(u,p,f);return{path:o,fullPath:(await lm(n.fetch,a.toString(),c,pe({headers:u},l?.duplex?{duplex:l.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(t),n=pe({},r.headers);e?.upsert&&(n["x-upsert"]="true");let o=await Sn(r.fetch,`${r.url}/object/upload/sign/${i}`,{},{headers:n}),s=new URL(r.url+o.url),a=s.searchParams.get("token");if(!a)throw new um("No token returned by API");return{signedUrl:s.toString(),path:t,token:a}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var i=this;return i.handleOperation(async()=>await Sn(i.fetch,`${i.url}/object/move`,{bucketId:i.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket,sourceVersionId:r?.sourceVersionId},{headers:i.headers}))}async copy(t,e,r){var i=this;return i.handleOperation(async()=>({path:(await Sn(i.fetch,`${i.url}/object/copy`,{bucketId:i.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket,sourceVersionId:r?.sourceVersionId},{headers:i.headers})).Key}))}async createSignedUrl(t,e,r){var i=this;return i.handleOperation(async()=>{let n=i._getFinalPath(t),o=typeof r?.transform=="object"&&r.transform!==null&&Object.keys(r.transform).length>0,s=await Sn(i.fetch,`${i.url}/object/sign/${n}`,pe(pe({expiresIn:e},o?{transform:r.transform}:{}),r?.versionId!=null?{versionId:r.versionId}:{}),{headers:i.headers}),a=new URLSearchParams;r?.download&&a.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&a.set("cacheNonce",String(r.cacheNonce));let c=a.toString();return{signedUrl:encodeURI(`${i.url}${s.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(t,e,r){var i=this;return i.handleOperation(async()=>{let n=await Sn(i.fetch,`${i.url}/object/sign/${i.bucketId}`,{expiresIn:e,paths:t},{headers:i.headers}),o=new URLSearchParams;r?.download&&o.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&o.set("cacheNonce",String(r.cacheNonce));let s=o.toString();return n.map(a=>pe(pe({},a),{},{signedUrl:a.signedURL?encodeURI(`${i.url}${a.signedURL}${s?`&${s}`:""}`):null}))})}download(t,e,r){let i=typeof e?.transform=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",n=new URLSearchParams;e?.transform&&this.applyTransformOptsToQuery(n,e.transform),e?.cacheNonce!=null&&n.set("cacheNonce",String(e.cacheNonce)),e?.versionId!=null&&n.set("versionId",String(e.versionId));let o=n.toString(),s=this._getFinalPath(t),a=()=>Ea(this.fetch,`${this.url}/${i}/${s}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new H2(a,this.shouldThrowOnError)}async info(t,e){var r=this;let i=r._getFinalPath(t),n=new URLSearchParams;e?.versionId!=null&&n.set("versionId",String(e.versionId));let o=n.toString();return r.handleOperation(async()=>p$(await Ea(r.fetch,`${r.url}/object/info/${i}${o?`?${o}`:""}`,{headers:r.headers})))}async exists(t){var e=this;let r=e._getFinalPath(t);try{return await V2(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(dm(n)){var i;let o=n instanceof _u?n.status:n instanceof QR?(i=n.originalError)===null||i===void 0?void 0:i.status:void 0;if(o!==void 0&&[400,404].includes(o))return{data:!1,error:n}}throw n}}getPublicUrl(t,e){let r=this._getFinalPath(t),i=new URLSearchParams;e?.download&&i.set("download",e.download===!0?"":e.download),e?.transform&&this.applyTransformOptsToQuery(i,e.transform),e?.cacheNonce!=null&&i.set("cacheNonce",String(e.cacheNonce)),e?.versionId!=null&&i.set("versionId",String(e.versionId));let n=i.toString(),o=typeof e?.transform=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}`)+(n?`?${n}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await Ta(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async purgeCache(t,e,r){var i=this;return i.handleOperation(async()=>{let n=h$(i._getFinalPath(t)),o=new URLSearchParams;e?.transformations&&o.set("transformations","true");let s=o.toString();return await Ta(i.fetch,`${i.url}/cdn/${n}${s?`?${s}`:""}`,{},{headers:i.headers},r)})}async list(t,e,r){var i=this;return i.handleOperation(async()=>{let n=e?.sortBy?pe(pe({},f$.sortBy),e.sortBy):f$.sortBy,o=pe(pe(pe({},f$),e),{},{sortBy:n,prefix:t||""});return await Sn(i.fetch,`${i.url}/object/list/${i.bucketId}`,o,{headers:i.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{let i=pe({},t);return await Sn(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,i,{headers:r.headers},e)})}prepareUploadFormData(t,e){let r=new FormData,i=[];t instanceof FormData?t.forEach((n,o)=>{typeof n=="string"?r.append(o,n):i.push([o,n])}):i.push(["",t]),r.has("cacheControl")||r.append("cacheControl",e.cacheControl),e.metadata&&!r.has("metadata")&&r.append("metadata",this.encodeMetadata(e.metadata));for(let[n,o]of i)r.append(n,o);return r}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}},K2="2.117.3",bu={"X-Client-Info":`storage-js/${K2}`},G2=class extends Oa{constructor(t,e={},r,i){let n=new URL(t);i?.useNewHostname&&/supabase\.(co|in|red)$/.test(n.hostname)&&!n.hostname.includes("storage.supabase.")&&(n.hostname=n.hostname.replace("supabase.","storage.supabase."));let o=n.href.replace(/\/$/,""),s=pe(pe({},bu),e);super(o,s,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{let r=e.listBucketOptionsToQueryString(t);return await Ea(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Ea(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Sn(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes,versioning_status:e.versioningStatus},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await lm(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes,versioning_status:e.versioningStatus},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Sn(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Ta(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}async getBucketLifecycle(t){var e=this;return e.handleOperation(async()=>await Ea(e.fetch,e.bucketLifecycleUrl(t),{headers:e.headers}))}async updateBucketLifecycle(t,e){var r=this;return r.handleOperation(async()=>await lm(r.fetch,r.bucketLifecycleUrl(t),e,{headers:r.headers}))}async deleteBucketLifecycle(t){var e=this;return e.handleOperation(async()=>await Ta(e.fetch,e.bucketLifecycleUrl(t),{},{headers:e.headers}))}async purgeBucketCache(t,e,r){var i=this;return i.handleOperation(async()=>{let n=new URLSearchParams;e?.transformations&&n.set("transformations","true");let o=n.toString();return await Ta(i.fetch,`${i.url}/cdn/${h$(t)}${o?`?${o}`:""}`,{},{headers:i.headers},r)})}bucketLifecycleUrl(t){return`${this.url}/bucket/${h$(t)}/lifecycle`}listBucketOptionsToQueryString(t){let e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},J2=class extends Oa{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},bu),e);super(i,n,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Sn(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{let r=new URLSearchParams;t?.limit!==void 0&&r.set("limit",t.limit.toString()),t?.offset!==void 0&&r.set("offset",t.offset.toString()),t?.sortColumn&&r.set("sortColumn",t.sortColumn),t?.sortOrder&&r.set("sortOrder",t.sortOrder),t?.search&&r.set("search",t.search);let i=r.toString(),n=i?`${e.url}/bucket?${i}`:`${e.url}/bucket`;return await Ea(e.fetch,n,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Ta(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!M2(t))throw new um("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new KR({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),i=this.shouldThrowOnError;return new Proxy(r,{get(n,o){let s=n[o];return typeof s!="function"?s:async(...a)=>{try{return{data:await s.apply(n,a),error:null}}catch(c){if(i)throw c;return{data:null,error:c}}}}})}},X2=class extends Oa{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},bu),{},{"Content-Type":"application/json"},e);super(i,n,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await Vr.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await Vr.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},Y2=class extends Oa{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},bu),{},{"Content-Type":"application/json"},e);super(i,n,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},Q2=class extends Oa{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},bu),{},{"Content-Type":"application/json"},e);super(i,n,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Vr.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},eB=class extends Q2{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new tB(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},tB=class extends X2{constructor(t,e,r,i){super(t,e,i),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,pe(pe({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,pe(pe({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new rB(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},rB=class extends Y2{constructor(t,e,r,i,n){super(t,e,n),this.vectorBucketName=r,this.indexName=i}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,pe(pe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,pe(pe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,pe(pe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,pe(pe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,pe(pe({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},nj=class extends G2{constructor(t,e={},r,i){super(t,e,r,i)}from(t){return new W2(this.url,this.headers,t,this.fetch)}get vectors(){return new eB(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new J2(this.url+"/iceberg",this.headers,this.fetch)}}});var m$=C(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.version=void 0;fm.version="2.117.3"});var pm=C(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.JWKS_TTL=Ue.PKCE_MAX_CONCURRENT_FLOWS=Ue.PKCE_FLOW_ID_PARAM=Ue.BASE64URL_REGEX=Ue.API_VERSIONS=Ue.API_VERSION_HEADER_NAME=Ue.NETWORK_FAILURE=Ue.DEFAULT_HEADERS=Ue.AUDIENCE=Ue.STORAGE_KEY=Ue.GOTRUE_URL=Ue.REFRESH_FAILURE_COOLDOWN_MS=Ue.EXPIRY_MARGIN_MS=Ue.AUTO_REFRESH_TICK_THRESHOLD=Ue.AUTO_REFRESH_TICK_DURATION_MS=void 0;var nB=m$();Ue.AUTO_REFRESH_TICK_DURATION_MS=30*1e3;Ue.AUTO_REFRESH_TICK_THRESHOLD=3;Ue.EXPIRY_MARGIN_MS=Ue.AUTO_REFRESH_TICK_THRESHOLD*Ue.AUTO_REFRESH_TICK_DURATION_MS;Ue.REFRESH_FAILURE_COOLDOWN_MS=2*Ue.AUTO_REFRESH_TICK_DURATION_MS;Ue.GOTRUE_URL="http://localhost:9999";Ue.STORAGE_KEY="supabase.auth.token";Ue.AUDIENCE="";Ue.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${nB.version}`};Ue.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};Ue.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";Ue.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};Ue.BASE64URL_REGEX=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;Ue.PKCE_FLOW_ID_PARAM="sb_flow_id";Ue.PKCE_MAX_CONCURRENT_FLOWS=5;Ue.JWKS_TTL=600*1e3});var as=C(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.AuthInvalidJwtError=Ce.AuthWeakPasswordError=Ce.AuthRefreshDiscardedError=Ce.AuthRetryableFetchError=Ce.AuthPKCECodeVerifierMissingError=Ce.AuthPKCEGrantCodeExchangeError=Ce.AuthImplicitGrantRedirectError=Ce.AuthInvalidCredentialsError=Ce.AuthInvalidTokenResponseError=Ce.AuthSessionMissingError=Ce.CustomAuthError=Ce.AuthUnknownError=Ce.AuthApiError=Ce.AuthError=void 0;Ce.isAuthError=Xi;Ce.isAuthApiError=iB;Ce.isAuthSessionMissingError=oB;Ce.isAuthImplicitGrantRedirectError=sB;Ce.isAuthPKCECodeVerifierMissingError=aB;Ce.isAuthRetryableFetchError=cB;Ce.isAuthRefreshDiscardedError=lB;Ce.isAuthWeakPasswordError=uB;var Pa=class extends Error{constructor(e,r,i){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=i}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};Ce.AuthError=Pa;function Xi(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}var g$=class extends Pa{constructor(e,r,i){super(e,r,i),this.name="AuthApiError",this.status=r,this.code=i}};Ce.AuthApiError=g$;function iB(t){return Xi(t)&&t.name==="AuthApiError"}var y$=class extends Pa{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};Ce.AuthUnknownError=y$;var Br=class extends Pa{constructor(e,r,i,n){super(e,i,n),this.name=r,this.status=i}};Ce.CustomAuthError=Br;var v$=class extends Br{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};Ce.AuthSessionMissingError=v$;function oB(t){return Xi(t)&&t.name==="AuthSessionMissingError"}var _$=class extends Br{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};Ce.AuthInvalidTokenResponseError=_$;var b$=class extends Br{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};Ce.AuthInvalidCredentialsError=b$;var w$=class extends Br{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};Ce.AuthImplicitGrantRedirectError=w$;function sB(t){return Xi(t)&&t.name==="AuthImplicitGrantRedirectError"}var $$=class extends Br{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};Ce.AuthPKCEGrantCodeExchangeError=$$;var k$=class extends Br{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}};Ce.AuthPKCECodeVerifierMissingError=k$;function aB(t){return Xi(t)&&t.name==="AuthPKCECodeVerifierMissingError"}var S$=class extends Br{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};Ce.AuthRetryableFetchError=S$;function cB(t){return Xi(t)&&t.name==="AuthRetryableFetchError"}var x$=class extends Br{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}};Ce.AuthRefreshDiscardedError=x$;function lB(t){return Xi(t)&&t.name==="AuthRefreshDiscardedError"}var I$=class extends Br{constructor(e,r,i){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=i}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}};Ce.AuthWeakPasswordError=I$;function uB(t){return Xi(t)&&t.name==="AuthWeakPasswordError"}var E$=class extends Br{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}};Ce.AuthInvalidJwtError=E$});var mm=C(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.byteToBase64URL=wu;on.byteFromBase64URL=T$;on.stringToBase64URL=fB;on.stringFromBase64URL=pB;on.codepointToUTF8=sj;on.stringToUTF8=O$;on.stringFromUTF8=aj;on.base64UrlToUint8Array=hB;on.stringToUint8Array=mB;on.bytesToBase64URL=gB;var hm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),oj=`
|
|
99
|
+
\r=`.split(""),dB=(()=>{let t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<oj.length;e+=1)t[oj[e].charCodeAt(0)]=-2;for(let e=0;e<hm.length;e+=1)t[hm[e].charCodeAt(0)]=e;return t})();function wu(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){let i=e.queue>>e.queuedBits-6&63;r(hm[i]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){let i=e.queue>>e.queuedBits-6&63;r(hm[i]),e.queuedBits-=6}}function T$(t,e,r){let i=dB[t];if(i>-1)for(e.queue=e.queue<<6|i,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(i===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function fB(t){let e=[],r=n=>{e.push(n)},i={queue:0,queuedBits:0};return O$(t,n=>{wu(n,i,r)}),wu(null,i,r),e.join("")}function pB(t){let e=[],r=s=>{e.push(String.fromCodePoint(s))},i={utf8seq:0,codepoint:0},n={queue:0,queuedBits:0},o=s=>{aj(s,i,r)};for(let s=0;s<t.length;s+=1)T$(t.charCodeAt(s),n,o);return e.join("")}function sj(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function O$(t,e){for(let r=0;r<t.length;r+=1){let i=t.charCodeAt(r);if(i>55295&&i<=56319){let n=(i-55296)*1024&65535;i=(t.charCodeAt(r+1)-56320&65535|n)+65536,r+=1}sj(i,e)}}function aj(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let i=1;i<6;i+=1)if((t>>7-i&1)===0){e.utf8seq=i;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function hB(t){let e=[],r={queue:0,queuedBits:0},i=n=>{e.push(n)};for(let n=0;n<t.length;n+=1)T$(t.charCodeAt(n),r,i);return new Uint8Array(e)}function mB(t){let e=[];return O$(t,r=>e.push(r)),new Uint8Array(e)}function gB(t){let e=[],r={queue:0,queuedBits:0},i=n=>{e.push(n)};return t.forEach(n=>wu(n,r,i)),wu(null,r,i),e.join("")}});var Ra=C(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.pkceVerifierSlotKey=ee.Deferred=ee.removeItemAsync=ee.getItemAsync=ee.setItemAsync=ee.looksLikeFetchResponse=ee.resolveFetch=ee.supportsLocalStorage=ee.isBrowser=void 0;ee.expiresAt=yB;ee.generateCallbackId=vB;ee.parseParametersFromURL=wB;ee.decodeJWT=EB;ee.sleep=TB;ee.retryable=OB;ee.generatePKCEVerifier=uj;ee.generatePKCEChallenge=dj;ee.validatePKCEFlowId=fj;ee.generatePKCEFlowId=pj;ee.storePKCEVerifier=hj;ee.retrievePKCEVerifier=jB;ee.removePKCEVerifier=zB;ee.removeAllPKCEVerifiers=CB;ee.appendFlowIdToRedirectTo=NB;ee.getCodeChallengeAndMethod=DB;ee.parseResponseAPIVersion=UB;ee.validateExp=MB;ee.getAlgorithm=FB;ee.validateUUID=qB;ee.assertRecoveryCodesExperimentalEnabled=VB;ee.userNotAvailableProxy=BB;ee.insecureUserWarningProxy=HB;ee.deepClone=WB;var Aa=pm(),cj=as(),P$=mm();function yB(t){return Math.round(Date.now()/1e3)+t}function vB(){return Symbol("auth-callback")}var _B=()=>typeof window<"u"&&typeof document<"u";ee.isBrowser=_B;var cs={tested:!1,writable:!1},bB=()=>{if(!(0,ee.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(cs.tested)return cs.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),cs.tested=!0,cs.writable=!0}catch{cs.tested=!0,cs.writable=!1}return cs.writable};ee.supportsLocalStorage=bB;function wB(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((n,o)=>{e[o]=n})}catch{}return r.searchParams.forEach((i,n)=>{e[n]=i}),e}var $B=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);ee.resolveFetch=$B;var kB=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";ee.looksLikeFetchResponse=kB;var SB=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};ee.setItemAsync=SB;var xB=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}};ee.getItemAsync=xB;var IB=async(t,e)=>{await t.removeItem(e)};ee.removeItemAsync=IB;var gm=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};ee.Deferred=gm;gm.promiseConstructor=Promise;function EB(t){let e=t.split(".");if(e.length!==3)throw new cj.AuthInvalidJwtError("Invalid JWT structure");for(let i=0;i<e.length;i++)if(!Aa.BASE64URL_REGEX.test(e[i]))throw new cj.AuthInvalidJwtError("JWT not in base64url format");return{header:JSON.parse((0,P$.stringFromBase64URL)(e[0])),payload:JSON.parse((0,P$.stringFromBase64URL)(e[1])),signature:(0,P$.base64UrlToUint8Array)(e[2]),raw:{header:e[0],payload:e[1]}}}async function TB(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function OB(t,e){return new Promise((i,n)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){i(s);return}}catch(s){if(!e(o,s)){n(s);return}}})()})}function lj(t){return("0"+t.toString(16)).substr(-2)}function uj(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",i=r.length,n="";for(let o=0;o<56;o++)n+=r.charAt(Math.floor(Math.random()*i));return n}return crypto.getRandomValues(e),Array.from(e,lj).join("")}async function PB(t){let r=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",r),n=new Uint8Array(i);return Array.from(n).map(o=>String.fromCharCode(o)).join("")}async function dj(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await PB(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var AB=/^[a-zA-Z0-9_-]{8,64}$/;function fj(t){return typeof t=="string"&&AB.test(t)?t:null}function pj(){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,lj).join("")}let t="";for(let e=0;e<32;e++)t+=Math.floor(Math.random()*16).toString(16);return t}var RB=(t,e)=>`${t}-flow-${e}-code-verifier`;ee.pkceVerifierSlotKey=RB;var $u=t=>`${t}-flows-code-verifier`;async function A$(t,e){let r=await(0,ee.getItemAsync)(t,$u(e));return Array.isArray(r)?r.filter(i=>fj(i)!==null):[]}async function hj(t,e,r,i,n){await(0,ee.setItemAsync)(t,(0,ee.pkceVerifierSlotKey)(e,r),i);let o=(await A$(t,e)).filter(s=>s!==r);for(o.push(r);o.length>Aa.PKCE_MAX_CONCURRENT_FLOWS;){let s=o.shift();await(0,ee.removeItemAsync)(t,(0,ee.pkceVerifierSlotKey)(e,s)),n?.(s)}await(0,ee.setItemAsync)(t,$u(e),o),await(0,ee.setItemAsync)(t,`${e}-code-verifier`,i)}async function jB(t,e,r){if(r){let n=await(0,ee.getItemAsync)(t,(0,ee.pkceVerifierSlotKey)(e,r));return{verifier:typeof n=="string"?n:null,flowId:r}}let i=await(0,ee.getItemAsync)(t,`${e}-code-verifier`);return{verifier:typeof i=="string"?i:null,flowId:null}}async function zB(t,e,r){let i=`${e}-code-verifier`;if(!r){await(0,ee.removeItemAsync)(t,i);return}let n=(0,ee.pkceVerifierSlotKey)(e,r),o=await(0,ee.getItemAsync)(t,n);await(0,ee.removeItemAsync)(t,n);let s=await A$(t,e),a=s.filter(c=>c!==r);a.length!==s.length&&(a.length>0?await(0,ee.setItemAsync)(t,$u(e),a):await(0,ee.removeItemAsync)(t,$u(e))),o!=null&&o===await(0,ee.getItemAsync)(t,i)&&await(0,ee.removeItemAsync)(t,i)}async function CB(t,e){let r=await A$(t,e);for(let i of r)await(0,ee.removeItemAsync)(t,(0,ee.pkceVerifierSlotKey)(e,i));await(0,ee.removeItemAsync)(t,$u(e)),await(0,ee.removeItemAsync)(t,`${e}-code-verifier`)}function NB(t,e){let r=t.indexOf("#"),i=r===-1?t:t.slice(0,r),n=r===-1?"":t.slice(r),o=i.indexOf("?");if(o!==-1){let a=i.slice(0,o),c=i.slice(o+1).split("&").filter(l=>l!==""&&l!==Aa.PKCE_FLOW_ID_PARAM&&!l.startsWith(`${Aa.PKCE_FLOW_ID_PARAM}=`));i=c.length>0?`${a}?${c.join("&")}`:a}let s=i.includes("?")?"&":"?";return`${i}${s}${Aa.PKCE_FLOW_ID_PARAM}=${encodeURIComponent(e)}${n}`}async function DB(t,e,r=!1,i){let n=uj(),o=n;r&&(o+="/recovery");let s=pj();await hj(t,e,s,o,i);let a=await dj(n);return[a,n===a?"plain":"s256",s]}var LB=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function UB(t){let e=t.headers.get(Aa.API_VERSION_HEADER_NAME);if(!e||!e.match(LB))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function MB(t){if(!t)throw new Error("Missing exp claim");let e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function FB(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var ZB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function qB(t){if(!ZB.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function VB(t){if(!t.recoveryCodes)throw new Error("@supabase/auth-js: the MFA recovery codes API is experimental and disabled by default. Enable it by passing `auth: { experimental: { recoveryCodes: true } }` to createClient (or to the GoTrueClient constructor).")}function BB(){let t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){let i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function HB(t,e){return new Proxy(t,{get:(r,i,n)=>{if(i==="__isInsecureUserWarningProxy")return!0;if(typeof i=="symbol"){let o=i.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,i,n)}return!e.value&&typeof i=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,i,n)}})}function WB(t){return JSON.parse(JSON.stringify(t))}});var z$=C(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.handleError=j$;Kn._request=JB;Kn._sessionResponse=gj;Kn._sessionResponsePassword=YB;Kn._userResponse=QB;Kn._ssoResponse=eH;Kn._generateLinkResponse=tH;Kn._noResolveJsonResponse=rH;var KB=(qr(),Xr(Zr)),ym=pm(),R$=Ra(),Si=as(),ls=t=>{if(typeof t=="object"&&t!==null){let e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},mj=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function j$(t){var e;if(!(0,R$.looksLikeFetchResponse)(t))throw new Si.AuthRetryableFetchError(ls(t),0);let r;try{r=await t.json()}catch(o){throw mj.includes(t.status)?new Si.AuthRetryableFetchError(t.statusText||`HTTP ${t.status}`,t.status):new Si.AuthUnknownError(ls(o),o)}if(mj.includes(t.status))throw new Si.AuthRetryableFetchError(ls(r),t.status);let i,n=(0,R$.parseResponseAPIVersion)(t);if(n&&n.getTime()>=ym.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?i=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(i=r.error_code),i){if(i==="weak_password")throw new Si.AuthWeakPasswordError(ls(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(i==="session_not_found")throw new Si.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Si.AuthWeakPasswordError(ls(r),t.status,r.weak_password.reasons);throw new Si.AuthApiError(ls(r),t.status||500,i)}var GB=(t,e,r,i)=>{let n={method:t,headers:e?.headers||{}};return t==="GET"?n:(n.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),n.body=JSON.stringify(i),Object.assign(Object.assign({},n),r))};async function JB(t,e,r,i){var n;let o=Object.assign({},i?.headers);o[ym.API_VERSION_HEADER_NAME]||(o[ym.API_VERSION_HEADER_NAME]=ym.API_VERSIONS["2024-01-01"].name),i?.jwt&&(o.Authorization=`Bearer ${i.jwt}`);let s=(n=i?.query)!==null&&n!==void 0?n:{};i?.redirectTo&&(s.redirect_to=i.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",c=await XB(t,e,r+a,{headers:o,noResolveJson:i?.noResolveJson},{},i?.body);return i?.xform?i?.xform(c):{data:Object.assign({},c),error:null}}async function XB(t,e,r,i,n,o){let s=GB(e,i,n,o),a;try{a=await t(r,Object.assign({},s))}catch(c){throw new Si.AuthRetryableFetchError(ls(c),0)}if(a.ok||await j$(a),i?.noResolveJson)return a;try{return await a.json()}catch(c){await j$(c)}}function gj(t){var e;let r=null;nH(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,R$.expiresAt)(t.expires_in)));let i=(e=t.user)!==null&&e!==void 0?e:typeof t?.id=="string"?t:null;return{data:{session:r,user:i},error:null}}function YB(t){let e=gj(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,i)=>r&&typeof i=="string",!0)&&(e.data.weak_password=t.weak_password),e}function QB(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function eH(t){return{data:t,error:null}}function tH(t){let{action_link:e,email_otp:r,hashed_token:i,redirect_to:n,verification_type:o}=t,s=KB.__rest(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:i,redirect_to:n,verification_type:o},c=Object.assign({},s);return{data:{properties:a,user:c},error:null}}function rH(t){return t}function nH(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}});var C$=C(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.SIGN_OUT_SCOPES=void 0;vm.SIGN_OUT_SCOPES=["global","local","others"]});var _m=C(L$=>{"use strict";Object.defineProperty(L$,"__esModule",{value:!0});var iH=(qr(),Xr(Zr)),Ye=z$(),Gn=Ra(),N$=C$(),It=as(),D$=class{constructor({url:e="",headers:r={},fetch:i,experimental:n}){this.url=e,this.headers=r,this.fetch=(0,Gn.resolveFetch)(i),this.experimental=n??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,r=N$.SIGN_OUT_SCOPES[0]){if(N$.SIGN_OUT_SCOPES.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${N$.SIGN_OUT_SCOPES.join(", ")}`);try{return await(0,Ye._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(i){if((0,It.isAuthError)(i))return{data:null,error:i};throw i}}async inviteUserByEmail(e,r={}){try{return await(0,Ye._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ye._userResponse})}catch(i){if((0,It.isAuthError)(i))return{data:{user:null},error:i};throw i}}async generateLink(e){try{let{options:r}=e,i=iH.__rest(e,["options"]),n=Object.assign(Object.assign({},i),r);return"newEmail"in i&&(n.new_email=i?.newEmail,delete n.newEmail),await(0,Ye._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:Ye._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,It.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,Ye._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Ye._userResponse})}catch(r){if((0,It.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,i,n,o,s,a,c;try{let l={nextPage:null,lastPage:0,total:0},u=await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&i!==void 0?i:"",per_page:(o=(n=e?.perPage)===null||n===void 0?void 0:n.toString())!==null&&o!==void 0?o:""},xform:Ye._noResolveJsonResponse});if(u.error)throw u.error;let d=await u.json(),p=(s=u.headers.get("x-total-count"))!==null&&s!==void 0?s:0,f=(c=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(h=>{let m=parseInt(h.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(h.split(";")[1].split("=")[1]);l[`${g}Page`]=m}),l.total=parseInt(p)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if((0,It.isAuthError)(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){(0,Gn.validateUUID)(e);try{return await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Ye._userResponse})}catch(r){if((0,It.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){(0,Gn.validateUUID)(e);try{return await(0,Ye._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Ye._userResponse})}catch(i){if((0,It.isAuthError)(i))return{data:{user:null},error:i};throw i}}async deleteUser(e,r=!1){(0,Gn.validateUUID)(e);try{return await(0,Ye._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ye._userResponse})}catch(i){if((0,It.isAuthError)(i))return{data:{user:null},error:i};throw i}}async _listFactors(e){(0,Gn.validateUUID)(e.userId);try{let{data:r,error:i}=await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:n=>({data:{factors:n},error:null})});return{data:r,error:i}}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){(0,Gn.validateUUID)(e.userId),(0,Gn.validateUUID)(e.id);try{return{data:await(0,Ye._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,i,n,o,s,a,c;try{let l={nextPage:null,lastPage:0,total:0},u=await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&i!==void 0?i:"",per_page:(o=(n=e?.perPage)===null||n===void 0?void 0:n.toString())!==null&&o!==void 0?o:""},xform:Ye._noResolveJsonResponse});if(u.error)throw u.error;let d=await u.json(),p=(s=u.headers.get("x-total-count"))!==null&&s!==void 0?s:0,f=(c=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(h=>{let m=parseInt(h.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(h.split(";")[1].split("=")[1]);l[`${g}Page`]=m}),l.total=parseInt(p)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if((0,It.isAuthError)(l))return{data:{clients:[]},error:l};throw l}}async _createOAuthClient(e){try{return await(0,Ye._request)(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await(0,Ye._request)(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if((0,It.isAuthError)(i))return{data:null,error:i};throw i}}async _deleteOAuthClient(e){try{return await(0,Ye._request)(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await(0,Ye._request)(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{let r={};return e?.type&&(r.type=e.type),await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:i=>{var n;return{data:{providers:(n=i?.providers)!==null&&n!==void 0?n:[]},error:null}}})}catch(r){if((0,It.isAuthError)(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await(0,Ye._request)(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await(0,Ye._request)(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if((0,It.isAuthError)(i))return{data:null,error:i};throw i}}async _deleteCustomProvider(e){try{return await(0,Ye._request)(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){(0,Gn.validateUUID)(e.userId);try{return await(0,Ye._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){(0,Gn.validateUUID)(e.userId),(0,Gn.validateUUID)(e.passkeyId);try{return await(0,Ye._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if((0,It.isAuthError)(r))return{data:null,error:r};throw r}}};L$.default=D$});var yj=C(U$=>{"use strict";Object.defineProperty(U$,"__esModule",{value:!0});U$.memoryLocalStorageAdapter=oH;function oH(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}});var M$=C(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.ProcessLockAcquireTimeoutError=Rt.NavigatorLockAcquireTimeoutError=Rt.LockAcquireTimeoutError=Rt.internals=void 0;Rt.navigatorLock=aH;Rt.processLock=cH;var sH=Ra();Rt.internals={debug:!!(globalThis&&(0,sH.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var us=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Rt.LockAcquireTimeoutError=us;var ku=class extends us{};Rt.NavigatorLockAcquireTimeoutError=ku;var bm=class extends us{};Rt.ProcessLockAcquireTimeoutError=bm;async function aH(t,e,r){Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let i=new globalThis.AbortController,n;e>0&&(n=setTimeout(()=>{i.abort(),Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:i.signal},async o=>{if(o){clearTimeout(n),Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,o.name);try{return await r()}finally{Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,o.name)}}else{if(e===0)throw Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new ku(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Rt.internals.debug)try{let s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(n),await r()}})}catch(o){if(clearTimeout(n),o!==null&&typeof o=="object"&&"name"in o&&o.name==="AbortError"){if(i.signal.aborted)return Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async s=>{if(s){Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,s.name);try{return await r()}finally{Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,s.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw Rt.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new ku(`Lock "${t}" was released because another request stole it`)}throw o}}var vj={};async function cH(t,e,r){var i;let n=(i=vj[t])!==null&&i!==void 0?i:Promise.resolve(),o=(async()=>{try{return await n,null}catch{return null}})(),s=(async()=>{let a=null;try{let c=e>=0?new Promise((l,u)=>{a=setTimeout(()=>{console.warn(`@supabase/gotrue-js: Lock "${t}" acquisition timed out after ${e}ms. This may be caused by another operation holding the lock. Consider increasing lockAcquireTimeout or checking for stuck operations.`),u(new bm(`Acquiring process lock with name "${t}" timed out`))},e)}):null;await Promise.race([o,c].filter(l=>l)),a!==null&&clearTimeout(a)}catch(c){if(a!==null&&clearTimeout(a),c instanceof us)throw c}return await r()})();return vj[t]=(async()=>{try{return await s}catch(a){if(a instanceof us){try{await n}catch{}return null}throw a}})(),await s}});var _j=C(F$=>{"use strict";Object.defineProperty(F$,"__esModule",{value:!0});F$.polyfillGlobalThis=lH;function lH(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}});var wj=C(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.getAddress=bj;ja.fromHex=uH;ja.toHex=dH;ja.createSiweMessage=fH;function bj(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function uH(t){return parseInt(t,16)}function dH(t){let e=new TextEncoder().encode(t);return"0x"+Array.from(e,i=>i.toString(16).padStart(2,"0")).join("")}function fH(t){var e;let{chainId:r,domain:i,expirationTime:n,issuedAt:o=new Date,nonce:s,notBefore:a,requestId:c,resources:l,scheme:u,uri:d,version:p}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!i)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(s&&s.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${s}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
|
|
100
|
+
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}let f=bj(t.address),h=u?`${u}://${i}`:i,m=t.statement?`${t.statement}
|
|
101
|
+
`:"",g=`${h} wants you to sign in with your Ethereum account:
|
|
102
|
+
${f}
|
|
103
|
+
|
|
104
|
+
${m}`,y=`URI: ${d}
|
|
105
|
+
Version: ${p}
|
|
106
|
+
Chain ID: ${r}${s?`
|
|
107
|
+
Nonce: ${s}`:""}
|
|
108
|
+
Issued At: ${o.toISOString()}`;if(n&&(y+=`
|
|
109
|
+
Expiration Time: ${n.toISOString()}`),a&&(y+=`
|
|
110
|
+
Not Before: ${a.toISOString()}`),c&&(y+=`
|
|
111
|
+
Request ID: ${c}`),l){let v=`
|
|
112
|
+
Resources:`;for(let b of l){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);v+=`
|
|
113
|
+
- ${b}`}y+=v}return`${g}
|
|
114
|
+
${y}`}});var kj=C(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.WebAuthnUnknownError=xi.WebAuthnError=void 0;xi.isWebAuthnError=pH;xi.identifyRegistrationError=hH;xi.identifyAuthenticationError=mH;var $j=q$(),Et=class extends Error{constructor({message:e,code:r,cause:i,name:n}){var o;super(e,{cause:i}),this.__isWebAuthnError=!0,this.name=(o=n??(i instanceof Error?i.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}};xi.WebAuthnError=Et;var Z$=class extends Et{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}};xi.WebAuthnUnknownError=Z$;function pH(t){return typeof t=="object"&&t!==null&&"__isWebAuthnError"in t}function hH({error:t,options:e}){var r,i,n;let{publicKey:o}=e;if(!o)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Et({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=o.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Et({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((i=o.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Et({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((n=o.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Et({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Et({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Et({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return o.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new Et({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Et({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){let s=window.location.hostname;if((0,$j.isValidDomain)(s)){if(o.rp.id!==s)return new Et({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new Et({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function mH({error:t,options:e}){let{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Et({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Et({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){let i=window.location.hostname;if((0,$j.isValidDomain)(i)){if(r.rpId!==i)return new Et({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}});var q$=C(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.WebAuthnApi=We.DEFAULT_REQUEST_OPTIONS=We.DEFAULT_CREATION_OPTIONS=We.webAuthnAbortService=We.WebAuthnAbortService=We.identifyAuthenticationError=We.identifyRegistrationError=We.isWebAuthnError=We.WebAuthnError=void 0;We.deserializeCredentialCreationOptions=yH;We.deserializeCredentialRequestOptions=vH;We.serializeCredentialCreationResponse=_H;We.serializeCredentialRequestResponse=bH;We.isValidDomain=wH;We.browserSupportsWebAuthn=V$;We.createCredential=xj;We.getCredential=Ij;We.mergeCredentialCreationOptions=Ej;We.mergeCredentialRequestOptions=Tj;var Sj=(qr(),Xr(Zr)),xn=mm(),Jn=as(),gH=Ra(),Xn=kj();Object.defineProperty(We,"identifyAuthenticationError",{enumerable:!0,get:function(){return Xn.identifyAuthenticationError}});Object.defineProperty(We,"identifyRegistrationError",{enumerable:!0,get:function(){return Xn.identifyRegistrationError}});Object.defineProperty(We,"isWebAuthnError",{enumerable:!0,get:function(){return Xn.isWebAuthnError}});Object.defineProperty(We,"WebAuthnError",{enumerable:!0,get:function(){return Xn.WebAuthnError}});var wm=class{createNewAbortSignal(){if(this.controller){let r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};We.WebAuthnAbortService=wm;We.webAuthnAbortService=new wm;function yH(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);let{challenge:e,user:r,excludeCredentials:i}=t,n=Sj.__rest(t,["challenge","user","excludeCredentials"]),o=(0,xn.base64UrlToUint8Array)(e).buffer,s=Object.assign(Object.assign({},r),{id:(0,xn.base64UrlToUint8Array)(r.id).buffer}),a=Object.assign(Object.assign({},n),{challenge:o,user:s});if(i&&i.length>0){a.excludeCredentials=new Array(i.length);for(let c=0;c<i.length;c++){let l=i[c];a.excludeCredentials[c]=Object.assign(Object.assign({},l),{id:(0,xn.base64UrlToUint8Array)(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function vH(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);let{challenge:e,allowCredentials:r}=t,i=Sj.__rest(t,["challenge","allowCredentials"]),n=(0,xn.base64UrlToUint8Array)(e).buffer,o=Object.assign(Object.assign({},i),{challenge:n});if(r&&r.length>0){o.allowCredentials=new Array(r.length);for(let s=0;s<r.length;s++){let a=r[s];o.allowCredentials[s]=Object.assign(Object.assign({},a),{id:(0,xn.base64UrlToUint8Array)(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return o}function _H(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();let r=t;return{id:t.id,rawId:t.id,response:{attestationObject:(0,xn.bytesToBase64URL)(new Uint8Array(t.response.attestationObject)),clientDataJSON:(0,xn.bytesToBase64URL)(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function bH(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();let r=t,i=t.getClientExtensionResults(),n=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:(0,xn.bytesToBase64URL)(new Uint8Array(n.authenticatorData)),clientDataJSON:(0,xn.bytesToBase64URL)(new Uint8Array(n.clientDataJSON)),signature:(0,xn.bytesToBase64URL)(new Uint8Array(n.signature)),userHandle:n.userHandle?(0,xn.bytesToBase64URL)(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:i,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function wH(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function V$(){var t,e;return!!((0,gH.isBrowser)()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.get)=="function")}async function xj(t){try{let e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Xn.WebAuthnUnknownError("Browser returned unexpected credential type",e)}:{data:null,error:new Xn.WebAuthnUnknownError("Empty credential response",e)}}catch(e){return{data:null,error:(0,Xn.identifyRegistrationError)({error:e,options:t})}}}async function Ij(t){try{let e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Xn.WebAuthnUnknownError("Browser returned unexpected credential type",e)}:{data:null,error:new Xn.WebAuthnUnknownError("Empty credential response",e)}}catch(e){return{data:null,error:(0,Xn.identifyAuthenticationError)({error:e,options:t})}}}We.DEFAULT_CREATION_OPTIONS={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"};We.DEFAULT_REQUEST_OPTIONS={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function $m(...t){let e=n=>n!==null&&typeof n=="object"&&!Array.isArray(n),r=n=>n instanceof ArrayBuffer||ArrayBuffer.isView(n),i={};for(let n of t)if(n)for(let o in n){let s=n[o];if(s!==void 0)if(Array.isArray(s))i[o]=s;else if(r(s))i[o]=s;else if(e(s)){let a=i[o];e(a)?i[o]=$m(a,s):i[o]=$m(s)}else i[o]=s}return i}function Ej(t,e){return $m(We.DEFAULT_CREATION_OPTIONS,t,e||{})}function Tj(t,e){return $m(We.DEFAULT_REQUEST_OPTIONS,t,e||{})}var B$=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:i,signal:n},o){var s;try{let{data:a,error:c}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!a)return{data:null,error:c};let l=n??We.webAuthnAbortService.createNewAbortSignal();if(a.webauthn.type==="create"){let{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){let d=i;if(d)u.name=`${u.id}:${d}`;else{let f=(await this.client.getUser()).data.user,h=((s=f?.user_metadata)===null||s===void 0?void 0:s.name)||f?.email||f?.id||"User";u.name=`${u.id}:${h}`}}u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{let u=Ej(a.webauthn.credential_options.publicKey,o?.create),{data:d,error:p}=await xj({publicKey:u,signal:l});return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:p}}case"request":{let u=Tj(a.webauthn.credential_options.publicKey,o?.request),{data:d,error:p}=await Ij(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:l}));return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:p}}}}catch(a){return(0,Jn.isAuthError)(a)?{data:null,error:a}:{data:null,error:new Jn.AuthUnknownError("Unexpected error in challenge",a)}}}async _verify({challengeId:e,factorId:r,webauthn:i}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:i})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:i=typeof window<"u"?[window.location.origin]:void 0,signal:n}={}},o){if(!r)return{data:null,error:new Jn.AuthError("rpId is required for WebAuthn authentication")};try{if(!V$())return{data:null,error:new Jn.AuthUnknownError("Browser does not support WebAuthn",null)};let{data:s,error:a}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:i},signal:n},{request:o});if(!s)return{data:null,error:a};let{webauthn:c}=s;return this._verify({factorId:e,challengeId:s.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:i,credential_response:c.credential_response}})}catch(s){return(0,Jn.isAuthError)(s)?{data:null,error:s}:{data:null,error:new Jn.AuthUnknownError("Unexpected error in authenticate",s)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:i=typeof window<"u"?[window.location.origin]:void 0,signal:n}={}},o){if(!r)return{data:null,error:new Jn.AuthError("rpId is required for WebAuthn registration")};try{if(!V$())return{data:null,error:new Jn.AuthUnknownError("Browser does not support WebAuthn",null)};let{data:s,error:a}=await this._enroll({friendlyName:e});if(!s)return await this.client.mfa.listFactors().then(u=>{var d;return(d=u.data)===null||d===void 0?void 0:d.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status==="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u?.id}):void 0),{data:null,error:a};let{data:c,error:l}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:r,rpOrigins:i},signal:n},{create:o});return c?this._verify({factorId:s.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:i,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:l}}catch(s){return(0,Jn.isAuthError)(s)?{data:null,error:s}:{data:null,error:new Jn.AuthUnknownError("Unexpected error in register",s)}}}};We.WebAuthnApi=B$});var W$=C(H$=>{"use strict";Object.defineProperty(H$,"__esModule",{value:!0});var $H=(qr(),Xr(Zr)),kH=$H.__importDefault(_m()),Tt=pm(),L=as(),re=z$(),V=Ra(),Oj=yj(),SH=M$(),xH=_j(),IH=m$(),Pj=mm(),km=wj(),_r=q$();(0,xH.polyfillGlobalThis)();var EH={url:Tt.GOTRUE_URL,storageKey:Tt.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Tt.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},za={},Aj=!1,Sm=class t{get jwks(){var e,r;return(r=(e=za[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){za[this.storageKey]=Object.assign(Object.assign({},za[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=za[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){za[this.storageKey]=Object.assign(Object.assign({},za[this.storageKey]),{cachedAt:e})}constructor(e){var r,i,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let o=Object.assign(Object.assign({},EH),e);if(this.storageKey=o.storageKey,this.instanceID=(r=t.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,t.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&(0,V.isBrowser)()){let s=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(s),this.logDebugMessages&&console.trace(s)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(i=o.experimental)!==null&&i!==void 0?i:{},this.admin=new kH.default({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=(0,V.resolveFetch)(o.fetch),this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock!=null&&(this.lock=o.lock,Aj||(Aj=!0,console.warn(`${this._logPrefix()} The "lock" option is deprecated and will be removed in v3. The client now coordinates session refreshes without a lock, so most apps can drop the option. See https://github.com/supabase/supabase-js/blob/master/packages/core/auth-js/migrations/lockless-coordination.md`))),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new _r.WebAuthnApi(this),recoveryCodes:{getStatus:this._getRecoveryCodesStatus.bind(this),generate:this._generateRecoveryCodes.bind(this),verify:this._verifyRecoveryCode.bind(this),regenerate:this._regenerateRecoveryCodes.bind(this),unenroll:this._unenrollRecoveryCodes.bind(this)}},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:(0,V.supportsLocalStorage)()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=(0,Oj.memoryLocalStorageAdapter)(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=(0,Oj.memoryLocalStorageAdapter)(this.memoryStorage)),(0,V.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),(s.data.event==="TOKEN_REFRESHED"||s.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(s.data.event,s.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}o.skipAutoInitialize||this.initialize().catch(s=>{this._debug("#initialize()","error",s)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${IH.version}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){var e;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();let r=await this.initializePromise,i=(e=this._pendingInitNotifications)!==null&&e!==void 0?e:[];this._pendingInitNotifications=null;for(let n of i)await this._notifyAllSubscribers(n.event,n.session,n.broadcast);return r}async _initialize(){var e;try{let r={},i="none";if((0,V.isBrowser)()&&(r=(0,V.parseParametersFromURL)(window.location.href),this._isImplicitGrantCallback(r)?i="implicit":await this._isPKCECallback(r)&&(i="pkce")),(0,V.isBrowser)()&&this.detectSessionInUrl&&i!=="none"){let{data:n,error:o}=await this._getSessionFromURL(r,i);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),(0,L.isAuthImplicitGrantRedirectError)(o)){let c=(e=o.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:o}}return{error:o}}let{session:s,redirectType:a}=n;return this._debug("#_initialize()","detected session in URL",s,"redirect type",a),await this._saveSession(s),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return(0,L.isAuthError)(r)?this._returnResult({error:r}):this._returnResult({error:new L.AuthUnknownError("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,i,n;try{let o=await(0,re._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(i=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:(n=e?.options)===null||n===void 0?void 0:n.captchaToken}},xform:re._sessionResponse}),{data:s,error:a}=o;if(a||!s)return this._returnResult({data:{user:null,session:null},error:a});let c=s.session,l=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:l,session:c},error:null})}catch(o){if((0,L.isAuthError)(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(e){var r,i,n;let o=null;try{let s;if("email"in e){let{email:d,password:p,options:f}=e,h=null,m=null;this.flowType==="pkce"&&([h,m,o]=await this._getCodeChallengeAndMethod()),s=await(0,re._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(f?.emailRedirectTo,o),body:{email:d,password:p,data:(r=f?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:h,code_challenge_method:m},xform:re._sessionResponse})}else if("phone"in e){let{phone:d,password:p,options:f}=e;s=await(0,re._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:p,data:(i=f?.data)!==null&&i!==void 0?i:{},channel:(n=f?.channel)!==null&&n!==void 0?n:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:re._sessionResponse})}else throw new L.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:a,error:c}=s;if(c||!a)return await(0,V.removePKCEVerifier)(this.storage,this.storageKey,o),this._returnResult({data:{user:null,session:null},error:c});let l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,o),(0,L.isAuthError)(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:re._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:re._sessionResponsePassword})}else throw new L.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:i,error:n}=r;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!i||!i.session||!i.user){let o=new L.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:o})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign({user:i.user,session:i.session},i.weak_password?{weakPassword:i.weak_password}:null),error:n})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,i,n,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(i=e.options)===null||i===void 0?void 0:i.scopes,queryParams:(n=e.options)===null||n===void 0?void 0:n.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e,r){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e,r)):this._exchangeCodeForSession(e,r)}async signInWithWeb3(e){let{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,i,n,o,s,a,c,l,u,d,p;let f,h;if("message"in e)f=e.message,h=e.signature;else{let{chain:m,wallet:g,statement:y,options:v}=e,b;if((0,V.isBrowser)())if(typeof g=="object")b=g;else{let le=window;if("ethereum"in le&&typeof le.ethereum=="object"&&"request"in le.ethereum&&typeof le.ethereum.request=="function")b=le.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!v?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=g}let x=new URL((r=v?.url)!==null&&r!==void 0?r:window.location.href),k=await b.request({method:"eth_requestAccounts"}).then(le=>le).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let E=(0,km.getAddress)(k[0]),O=(i=v?.signInWithEthereum)===null||i===void 0?void 0:i.chainId;if(!O){let le=await b.request({method:"eth_chainId"});O=(0,km.fromHex)(le)}let X={domain:x.host,address:E,statement:y,uri:x.href,version:"1",chainId:O,nonce:(n=v?.signInWithEthereum)===null||n===void 0?void 0:n.nonce,issuedAt:(s=(o=v?.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(a=v?.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(c=v?.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(l=v?.signInWithEthereum)===null||l===void 0?void 0:l.requestId,resources:(u=v?.signInWithEthereum)===null||u===void 0?void 0:u.resources};f=(0,km.createSiweMessage)(X),h=await b.request({method:"personal_sign",params:[(0,km.toHex)(f),E]})}try{let{data:m,error:g}=await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:h},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:re._sessionResponse});if(g)throw g;if(!m||!m.session||!m.user){let y=new L.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:y})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:g})}catch(m){if((0,L.isAuthError)(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(e){var r,i,n,o,s,a,c,l,u,d,p,f;let h,m;if("message"in e)h=e.message,m=e.signature;else{let{chain:g,wallet:y,statement:v,options:b}=e,x;if((0,V.isBrowser)())if(typeof y=="object")x=y;else{let E=window;if("solana"in E&&typeof E.solana=="object"&&("signIn"in E.solana&&typeof E.solana.signIn=="function"||"signMessage"in E.solana&&typeof E.solana.signMessage=="function"))x=E.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!b?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=y}let k=new URL((r=b?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in x&&x.signIn){let E=await x.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b?.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),v?{statement:v}:null)),O;if(Array.isArray(E)&&E[0]&&typeof E[0]=="object")O=E[0];else if(E&&typeof E=="object"&&"signedMessage"in E&&"signature"in E)O=E;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in O&&"signature"in O&&(typeof O.signedMessage=="string"||O.signedMessage instanceof Uint8Array)&&O.signature instanceof Uint8Array)h=typeof O.signedMessage=="string"?O.signedMessage:new TextDecoder().decode(O.signedMessage),m=O.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in x)||typeof x.signMessage!="function"||!("publicKey"in x)||typeof x!="object"||!x.publicKey||!("toBase58"in x.publicKey)||typeof x.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");h=[`${k.host} wants you to sign in with your Solana account:`,x.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(n=(i=b?.signInWithSolana)===null||i===void 0?void 0:i.issuedAt)!==null&&n!==void 0?n:new Date().toISOString()}`,...!((o=b?.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((s=b?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((a=b?.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((c=b?.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((l=b?.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((d=(u=b?.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...b.signInWithSolana.resources.map(O=>`- ${O}`)]:[]].join(`
|
|
115
|
+
`);let E=await x.signMessage(new TextEncoder().encode(h),"utf8");if(!E||!(E instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=E}}try{let{data:g,error:y}=await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:h,signature:(0,Pj.bytesToBase64URL)(m)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:re._sessionResponse});if(y)throw y;if(!g||!g.session||!g.user){let v=new L.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:v})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if((0,L.isAuthError)(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async _exchangeCodeForSession(e,r){let i=r?.flowId!=null,n=i?(0,V.validatePKCEFlowId)(r?.flowId):(0,V.isBrowser)()?(0,V.validatePKCEFlowId)((0,V.parseParametersFromURL)(window.location.href)[Tt.PKCE_FLOW_ID_PARAM]):null;i&&!n&&this._debug("#_exchangeCodeForSession()","provided flowId is not a valid flow id",r?.flowId);let{verifier:o,flowId:s}=i&&!n?{verifier:null,flowId:null}:await(0,V.retrievePKCEVerifier)(this.storage,this.storageKey,n),[a,c]=(o??"").split("/");try{if(!a&&this.flowType==="pkce")throw new L.AuthPKCECodeVerifierMissingError;let{data:l,error:u}=await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:a},xform:re._sessionResponse});if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,s),u)throw u;if(!l||!l.session||!l.user){let d=new L.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null,redirectType:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(c==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l.session)),this._returnResult({data:Object.assign(Object.assign({},l),{redirectType:c??null}),error:u})}catch(l){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,s),(0,L.isAuthError)(l))return this._returnResult({data:{user:null,session:null,redirectType:null},error:l});throw l}}async signInWithIdToken(e){try{let{options:r,provider:i,token:n,access_token:o,nonce:s}=e,a=await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:i,id_token:n,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:re._sessionResponse}),{data:c,error:l}=a;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!c||!c.session||!c.user){let u=new L.AuthInvalidTokenResponseError;return this._returnResult({data:{user:null,session:null},error:u})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:l})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,i,n,o,s;let a=null;try{if("email"in e){let{email:c,options:l}=e,u=null,d=null;this.flowType==="pkce"&&([u,d,a]=await this._getCodeChallengeAndMethod());let{error:p}=await(0,re._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:c,data:(r=l?.data)!==null&&r!==void 0?r:{},create_user:(i=l?.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:this._maybeAppendFlowIdToRedirect(l?.emailRedirectTo,a)});return this._returnResult({data:{user:null,session:null},error:p})}if("phone"in e){let{phone:c,options:l}=e,{data:u,error:d}=await(0,re._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:c,data:(n=l?.data)!==null&&n!==void 0?n:{},create_user:(o=l?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u?.message_id},error:d})}throw new L.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(c){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,a),(0,L.isAuthError)(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async verifyOtp(e){var r,i;try{let n,o;"options"in e&&(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(i=e.options)===null||i===void 0?void 0:i.captchaToken);let{data:s,error:a}=await(0,re._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:n,xform:re._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let c=s.session,l=s.user;return c?.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:l,session:c},error:null})}catch(n){if((0,L.isAuthError)(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithSSO(e){var r,i,n,o;let s=null;try{let a=null,c=null;this.flowType==="pkce"&&([a,c,s]=await this._getCodeChallengeAndMethod());let l=await(0,re._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:this._maybeAppendFlowIdToRedirect((r=e.options)===null||r===void 0?void 0:r.redirectTo,s)}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:c}),headers:this.headers,xform:re._ssoResponse});return!((n=l.data)===null||n===void 0)&&n.url&&(0,V.isBrowser)()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(a){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,s),(0,L.isAuthError)(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:i}=e;if(i)throw i;if(!r)throw new L.AuthSessionMissingError;let{error:n}=await(0,re._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if((0,L.isAuthError)(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){let r=null;try{let i=`${this.url}/resend`;if("email"in e){let{email:n,type:o,options:s}=e,a=null,c=null;this.flowType==="pkce"&&([a,c,r]=await this._getCodeChallengeAndMethod());let{error:l}=await(0,re._request)(this.fetch,"POST",i,{headers:this.headers,body:{email:n,type:o,gotrue_meta_security:{captcha_token:s?.captchaToken},code_challenge:a,code_challenge_method:c},redirectTo:this._maybeAppendFlowIdToRedirect(s?.emailRedirectTo,r)});return l&&await(0,V.removePKCEVerifier)(this.storage,this.storageKey,r),this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in e){let{phone:n,type:o,options:s}=e,{data:a,error:c}=await(0,re._request)(this.fetch,"POST",i,{headers:this.headers,body:{phone:n,type:o,gotrue_meta_security:{captcha_token:s?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:c})}throw new L.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(i){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,r),(0,L.isAuthError)(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let i=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await i,await r()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let i=r();for(this.pendingInLock.push((async()=>{try{await i}catch{}})()),await i;this.pendingInLock.length;){let n=[...this.pendingInLock];await Promise.all(n),this.pendingInLock.splice(0,n.length)}return await i}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,V.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let i=e.expires_at?e.expires_at*1e3-Date.now()<Tt.EXPIRY_MARGIN_MS:!1;if(this._debug("#__loadSession()",`session has${i?"":" not"} expired`,"expires_at",e.expires_at),!i)return{data:{session:await this._hydrateSessionUser(e)},error:null};let{data:n,error:o}=await this._callRefreshToken(e.refresh_token);if(o){let s=await(0,V.getItemAsync)(this.storage,this.storageKey);return s&&this._isValidSession(s)&&s.expires_at&&s.expires_at*1e3>Date.now()?this._returnResult({data:{session:await this._hydrateSessionUser(s)},error:null}):this._returnResult({data:{session:null},error:o})}return this._returnResult({data:{session:n},error:null})}finally{this._debug("#__loadSession()","end")}}async _hydrateSessionUser(e){if(this.userStorage){let r=await(0,V.getItemAsync)(this.userStorage,this.storageKey+"-user");e.user=r?.user?r.user:(0,V.userNotAvailableProxy)()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let r={value:this.suppressGetSessionWarning};e.user=(0,V.insecureUserWarningProxy)(e.user,r),r.value&&(this.suppressGetSessionWarning=!0)}return e}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await(0,re._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:re._userResponse}):await this._useSession(async r=>{var i,n,o;let{data:s,error:a}=r;if(a)throw a;return!(!((i=s.session)===null||i===void 0)&&i.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new L.AuthSessionMissingError}:await(0,re._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&o!==void 0?o:void 0,xform:re._userResponse})})}catch(r){if((0,L.isAuthError)(r))return(0,L.isAuthSessionMissingError)(r)&&await this._removeSession(),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r)):await this._updateUser(e,r)}async _updateUser(e,r={}){let i=null;try{return await this._useSession(async n=>{let{data:o,error:s}=n;if(s)throw s;if(!o.session)throw new L.AuthSessionMissingError;let a=o.session,c=null,l=null;this.flowType==="pkce"&&e.email!=null&&([c,l,i]=await this._getCodeChallengeAndMethod());let{data:u,error:d}=await(0,re._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(r?.emailRedirectTo,i),body:Object.assign(Object.assign({},e),{code_challenge:c,code_challenge_method:l}),jwt:a.access_token,xform:re._userResponse});if(d)throw d;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(n){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,i),(0,L.isAuthError)(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new L.AuthSessionMissingError;let r=Date.now()/1e3,i=r,n=!0,o=null,{payload:s}=(0,V.decodeJWT)(e.access_token);if(s.exp&&(i=s.exp,n=i<=r),n){let{data:a,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:c}=await this._getUser(e.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:i-r,expires_at:i},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async r=>{var i;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(i=s.session)!==null&&i!==void 0?i:void 0}if(!e?.refresh_token)throw new L.AuthSessionMissingError;let{data:n,error:o}=await this._callRefreshToken(e.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var i;try{if(!(0,V.isBrowser)())throw new L.AuthImplicitGrantRedirectError("No browser detected.");if(e.error||e.error_description||e.error_code)throw new L.AuthImplicitGrantRedirectError(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new L.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new L.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new L.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:b,error:x}=await this._exchangeCodeForSession(e.code,{flowId:e[Tt.PKCE_FLOW_ID_PARAM]});if(x)throw x;let k=new URL(window.location.href);return k.searchParams.delete("code"),k.searchParams.delete(Tt.PKCE_FLOW_ID_PARAM),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:b.session,redirectType:(i=b.redirectType)!==null&&i!==void 0?i:null},error:null}}let{provider_token:n,provider_refresh_token:o,access_token:s,refresh_token:a,expires_in:c,expires_at:l,token_type:u}=e;if(!s||!c||!a||!u)throw new L.AuthImplicitGrantRedirectError("No session defined in URL");let d=Math.round(Date.now()/1e3),p=parseInt(c),f=d+p;l&&(f=parseInt(l));let h=f-d;h*1e3<=Tt.AUTO_REFRESH_TICK_DURATION_MS&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${p}s`);let m=f-p;d-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,f,d):d-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,f,d);let{data:g,error:y}=await this._getUser(s);if(y)throw y;let v={provider_token:n,provider_refresh_token:o,access_token:s,expires_in:p,expires_at:f,refresh_token:a,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:v,redirectType:e.type},error:null})}catch(n){if((0,L.isAuthError)(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){if(!e.code)return!1;let r=(0,V.validatePKCEFlowId)(e[Tt.PKCE_FLOW_ID_PARAM]);return r&&await(0,V.getItemAsync)(this.storage,(0,V.pkceVerifierSlotKey)(this.storageKey,r))?!0:!!await(0,V.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var i;let n=async()=>{await this._removeSession()},{data:o,error:s}=r;if(s&&!(0,L.isAuthSessionMissingError)(s))return this._returnResult({error:s});let a=(i=o.session)===null||i===void 0?void 0:i.access_token;if(a){let{error:c}=await this.admin.signOut(a,e);if(c&&!((0,L.isAuthApiError)(c)&&(c.status===404||c.status===401||c.status===403)||(0,L.isAuthSessionMissingError)(c)))return e!=="others"&&await n(),this._returnResult({error:c})}return e!=="others"&&await n(),this._returnResult({error:null})})}onAuthStateChange(e){let r=(0,V.generateCallbackId)(),i={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,i),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:i}}}async _emitInitialSession(e){return await this._useSession(async r=>{var i,n;try{let{data:{session:o},error:s}=r;if(s)throw s;await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){if(await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),(0,L.isAuthRefreshDiscardedError)(o))return;(0,L.isAuthSessionMissingError)(o)||(0,L.isAuthRetryableFetchError)(o)||(0,L.isAuthApiError)(o)&&(o.code==="refresh_token_not_found"||o.code==="refresh_token_already_used"||o.code==="session_expired")?console.warn(o):console.error(o)}})}async resetPasswordForEmail(e,r={}){let i=null,n=null,o=null;this.flowType==="pkce"&&([i,n,o]=await this._getCodeChallengeAndMethod(!0));try{return await(0,re._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:i,code_challenge_method:n,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:this._maybeAppendFlowIdToRedirect(r.redirectTo,o)})}catch(s){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,o),(0,L.isAuthError)(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{let{data:r,error:i}=await this.getUser();if(i)throw i;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;let i=null;try{let{data:n,error:o}=await this._useSession(async s=>{var a,c,l,u,d;let{data:p,error:f}=s;if(f)throw f;let{url:h,flowId:m}=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(c=e.options)===null||c===void 0?void 0:c.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return i=m,await(0,re._request)(this.fetch,"GET",h,{headers:this.headers,jwt:(d=(u=p.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(o)throw o;return(0,V.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),this._returnResult({data:{provider:e.provider,url:n?.url,flowId:i},error:null})}catch(n){if((0,L.isAuthError)(n))return this._returnResult({data:{provider:e.provider,url:null,flowId:i},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var i;try{let{error:n,data:{session:o}}=r;if(n)throw n;let{options:s,provider:a,token:c,access_token:l,nonce:u}=e,d=await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(i=o?.access_token)!==null&&i!==void 0?i:void 0,body:{provider:a,id_token:c,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:re._sessionResponse}),{data:p,error:f}=d;return f?this._returnResult({data:{user:null,session:null},error:f}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new L.AuthInvalidTokenResponseError}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:f}))}catch(n){if(await(0,V.removePKCEVerifier)(this.storage,this.storageKey,null),(0,L.isAuthError)(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var i,n;let{data:o,error:s}=r;if(s)throw s;return await(0,re._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(n=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&n!==void 0?n:void 0})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){let r="#_refreshAccessToken()";this._debug(r,"begin");try{let i=Date.now();return await(0,V.retryable)(async n=>(n>0&&await(0,V.sleep)(200*Math.pow(2,n-1)),this._debug(r,"refreshing attempt",n),await(0,re._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:re._sessionResponse})),(n,o)=>{let s=200*Math.pow(2,n);return o&&(0,L.isAuthRetryableFetchError)(o)&&Date.now()+s-i<Tt.AUTO_REFRESH_TICK_DURATION_MS})}catch(i){if(this._debug(r,"error",i),(0,L.isAuthError)(i))return this._returnResult({data:{session:null,user:null},error:i});throw i}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let{url:i,flowId:n}=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",i),(0,V.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(i),{data:{provider:e,url:i,flowId:n},error:null}}async _recoverAndRefresh(){var e,r;let i="#_recoverAndRefresh()";this._debug(i,"begin");try{let n=await(0,V.getItemAsync)(this.storage,this.storageKey);if(n&&this.userStorage){let s=await(0,V.getItemAsync)(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:n.user},await(0,V.setItemAsync)(this.userStorage,this.storageKey+"-user",s)),n.user=(e=s?.user)!==null&&e!==void 0?e:(0,V.userNotAvailableProxy)()}else if(n&&!n.user&&!n.user){let s=await(0,V.getItemAsync)(this.storage,this.storageKey+"-user");s&&s?.user?(n.user=s.user,await(0,V.removeItemAsync)(this.storage,this.storageKey+"-user"),await(0,V.setItemAsync)(this.storage,this.storageKey,n)):n.user=(0,V.userNotAvailableProxy)()}if(this._debug(i,"session from storage",n),!this._isValidSession(n)){this._debug(i,"session is not valid"),n!==null&&await this._removeSession();return}let o=((r=n.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Tt.EXPIRY_MARGIN_MS;if(this._debug(i,`session has${o?"":" not"} expired with margin of ${Tt.EXPIRY_MARGIN_MS}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&((0,L.isAuthRefreshDiscardedError)(s)?this._debug(i,"refresh discarded by commit guard",s):this._debug(i,"refresh failed",s))}}else if(n.user&&n.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:a}=await this._getUser(n.access_token);!a&&s?.user?(n.user=s.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(i,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(i,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(i,"error",n),(0,L.isAuthRetryableFetchError)(n)?console.warn(n):console.error(n);return}finally{this._debug(i,"end")}}async _callRefreshToken(e){var r,i;if(!e)throw new L.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;let n="#_callRefreshToken()";this._debug(n,"begin");try{this.refreshingDeferred=new V.Deferred,this.refreshingDeferred.promise.then(void 0,()=>{});let o=await(0,V.getItemAsync)(this.storage,this.storageKey),{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new L.AuthSessionMissingError;let c=await(0,V.getItemAsync)(this.storage,this.storageKey);if(o!==null&&(c===null||c.refresh_token!==o.refresh_token)){this._debug(n,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:c?"replaced":"cleared"});let p={data:null,error:new L.AuthRefreshDiscardedError};return this.refreshingDeferred.resolve(p),p}let u=this._sessionRemovalEpoch;if(await this._saveSession(s.session),this._sessionRemovalEpoch!==u){this._debug(n,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await(0,V.removeItemAsync)(this.storage,this.storageKey),this.userStorage&&await(0,V.removeItemAsync)(this.userStorage,this.storageKey+"-user");let p={data:null,error:new L.AuthRefreshDiscardedError};return this.refreshingDeferred.resolve(p),p}await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);let d={data:s.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(d),d}catch(o){if(this._debug(n,"error",o),(0,L.isAuthError)(o)){let s={data:null,error:o};if(!(0,L.isAuthRetryableFetchError)(o)){let a=await(0,V.getItemAsync)(this.storage,this.storageKey);!!(a?.expires_at&&a.expires_at*1e3>Date.now())?this._debug(n,"proactive refresh failed, access token still valid \u2014 preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:s,expiresAt:Date.now()+Tt.REFRESH_FAILURE_COOLDOWN_MS},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(i=this.refreshingDeferred)===null||i===void 0||i.reject(o),o}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,r,i=!0){if(this._pendingInitNotifications!==null&&i){this._pendingInitNotifications.push({event:e,session:r,broadcast:i});return}let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",r,`broadcast = ${i}`);try{this.broadcastChannel&&i&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(c){o.push(c)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;let r=Object.assign({},e),i=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!i&&r.user&&await(0,V.setItemAsync)(this.userStorage,this.storageKey+"-user",{user:r.user});let n=Object.assign({},r);delete n.user;let o=(0,V.deepClone)(n);await(0,V.setItemAsync)(this.storage,this.storageKey,o)}else{let n=(0,V.deepClone)(r);await(0,V.setItemAsync)(this.storage,this.storageKey,n)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await(0,V.removeItemAsync)(this.storage,this.storageKey),await(0,V.removeAllPKCEVerifiers)(this.storage,this.storageKey),await(0,V.removeItemAsync)(this.storage,this.storageKey+"-user"),this.userStorage&&await(0,V.removeItemAsync)(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,V.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),Tt.AUTO_REFRESH_TICK_DURATION_MS);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);let r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:i}}=r;if(!i||!i.refresh_token||!i.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let n=Math.floor((i.expires_at*1e3-e)/Tt.AUTO_REFRESH_TICK_DURATION_MS);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${Tt.AUTO_REFRESH_TICK_DURATION_MS}ms, refresh threshold is ${Tt.AUTO_REFRESH_TICK_THRESHOLD} ticks`),n<=Tt.AUTO_REFRESH_TICK_THRESHOLD&&await this._callRefreshToken(i.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof SH.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{let e=Date.now();try{await this._useSession(async r=>{let{data:{session:i}}=r;if(!i||!i.refresh_token||!i.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let n=Math.floor((i.expires_at*1e3-e)/Tt.AUTO_REFRESH_TICK_DURATION_MS);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${Tt.AUTO_REFRESH_TICK_DURATION_MS}ms, refresh threshold is ${Tt.AUTO_REFRESH_TICK_THRESHOLD} ticks`),n<=Tt.AUTO_REFRESH_TICK_THRESHOLD&&await this._callRefreshToken(i.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,V.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,i){let n=i?.redirectTo,o=null,s=null,a=null;this.flowType==="pkce"&&([o,s,a]=await this._getCodeChallengeAndMethod(),n=this._maybeAppendFlowIdToRedirect(n,a));let c=[`provider=${encodeURIComponent(r)}`];if(n&&c.push(`redirect_to=${encodeURIComponent(n)}`),i?.scopes&&c.push(`scopes=${encodeURIComponent(i.scopes)}`),o!=null&&s!=null){let l=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});c.push(l.toString())}if(i?.queryParams){let l=new URLSearchParams(i.queryParams);c.push(l.toString())}return i?.skipBrowserRedirect&&c.push(`skip_http_redirect=${i.skipBrowserRedirect}`),{url:`${e}?${c.join("&")}`,flowId:a}}_maybeAppendFlowIdToRedirect(e,r){return!e||!r||!this.experimental.appendPkceFlowIdToRedirects?e??void 0:(0,V.appendFlowIdToRedirectTo)(e,r)}async _getCodeChallengeAndMethod(e=!1){return(0,V.getCodeChallengeAndMethod)(this.storage,this.storageKey,e,r=>this._debug("#_getCodeChallengeAndMethod()","evicted oldest pending PKCE verifier slot",r))}async _unenroll(e){try{return await this._useSession(async r=>{var i;let{data:n,error:o}=r;return o?this._returnResult({data:null,error:o}):await(0,re._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(i=n?.session)===null||i===void 0?void 0:i.access_token})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var i,n;let{data:o,error:s}=r;if(s)return this._returnResult({data:null,error:s});let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:l}=await(0,re._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(i=o?.session)===null||i===void 0?void 0:i.access_token});return l?this._returnResult({data:null,error:l}):(e.factorType==="totp"&&c.type==="totp"&&(!((n=c?.totp)===null||n===void 0)&&n.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){let r=async()=>{try{return await this._useSession(async i=>{var n;let{data:o,error:s}=i;if(s)return this._returnResult({data:null,error:s});let a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?(0,_r.serializeCredentialCreationResponse)(e.webauthn.credential_response):(0,_r.serializeCredentialRequestResponse)(e.webauthn.credential_response)})}:{code:e.code}),{data:c,error:l}=await(0,re._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:l}))})}catch(i){if((0,L.isAuthError)(i))return this._returnResult({data:null,error:i});throw i}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(e){let r=async()=>{try{return await this._useSession(async i=>{var n;let{data:o,error:s}=i;if(s)return this._returnResult({data:null,error:s});let a=await(0,re._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});if(a.error)return a;let{data:c}=a;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:(0,_r.deserializeCredentialCreationOptions)(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:(0,_r.deserializeCredentialRequestOptions)(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(i){if((0,L.isAuthError)(i))return this._returnResult({data:null,error:i});throw i}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(e){let{data:r,error:i}=await this._challenge({factorId:e.factorId});return i?this._returnResult({data:null,error:i}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;let{data:{user:r},error:i}=await this.getUser();if(i)return{data:null,error:i};let n={all:[],phone:[],totp:[],webauthn:[],recovery_code:[]};for(let o of(e=r?.factors)!==null&&e!==void 0?e:[])n.all.push(o),o.status==="verified"&&o.factor_type in n&&Array.isArray(n[o.factor_type])&&n[o.factor_type].push(o);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,i,n,o;if(e)try{let{payload:f}=(0,V.decodeJWT)(e),h=null;f.aal&&(h=f.aal);let m=h,{data:{user:g},error:y}=await this.getUser(e);if(y)return this._returnResult({data:null,error:y});((i=(r=g?.factors)===null||r===void 0?void 0:r.filter(x=>x.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(m="aal2");let b=f.amr||[];return{data:{currentLevel:h,nextLevel:m,currentAuthenticationMethods:b},error:null}}catch(f){if((0,L.isAuthError)(f))return this._returnResult({data:null,error:f});throw f}let{data:{session:s},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:c}=(0,V.decodeJWT)(s.access_token),l=null;c.aal&&(l=c.aal);let u=l;((o=(n=s.user.factors)===null||n===void 0?void 0:n.filter(f=>f.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(u="aal2");let p=c.amr||[];return{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:p},error:null}}async _getRecoveryCodesStatus(){(0,V.assertRecoveryCodesExperimentalEnabled)(this.experimental);try{return await this._useSession(async e=>{var r;let{data:i,error:n}=e;if(n)return this._returnResult({data:null,error:n});let{data:o,error:s}=await(0,re._request)(this.fetch,"GET",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:(r=i?.session)===null||r===void 0?void 0:r.access_token});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(e){if((0,L.isAuthError)(e))return this._returnResult({data:null,error:e});throw e}}async _generateRecoveryCodes(e){(0,V.assertRecoveryCodesExperimentalEnabled)(this.experimental);try{return await this._useSession(async r=>{var i;let{data:n,error:o}=r;if(o)return this._returnResult({data:null,error:o});let{data:s,error:a}=await(0,re._request)(this.fetch,"POST",`${this.url}/factors/recovery-codes`,{body:e?.friendlyName?{friendly_name:e.friendlyName}:void 0,headers:this.headers,jwt:(i=n?.session)===null||i===void 0?void 0:i.access_token});return a?this._returnResult({data:null,error:a}):this._returnResult({data:s,error:null})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _verifyRecoveryCode(e){(0,V.assertRecoveryCodesExperimentalEnabled)(this.experimental);let r=async()=>{try{return await this._useSession(async i=>{var n;let{data:o,error:s}=i;if(s)return this._returnResult({data:null,error:s});let{data:a,error:c}=await(0,re._request)(this.fetch,"POST",`${this.url}/factors/recovery-codes/verify`,{body:{code:e.code},headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});if(c)return this._returnResult({data:null,error:c});let l=Object.assign({expires_at:(0,V.expiresAt)(a.expires_in)},a);return await this._saveSession(l),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:a,error:null})})}catch(i){if((0,L.isAuthError)(i))return this._returnResult({data:null,error:i});throw i}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _regenerateRecoveryCodes(){(0,V.assertRecoveryCodesExperimentalEnabled)(this.experimental);try{return await this._useSession(async e=>{var r;let{data:i,error:n}=e;if(n)return this._returnResult({data:null,error:n});let{data:o,error:s}=await(0,re._request)(this.fetch,"POST",`${this.url}/factors/recovery-codes/regenerate`,{headers:this.headers,jwt:(r=i?.session)===null||r===void 0?void 0:r.access_token});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(e){if((0,L.isAuthError)(e))return this._returnResult({data:null,error:e});throw e}}async _unenrollRecoveryCodes(){(0,V.assertRecoveryCodesExperimentalEnabled)(this.experimental);try{return await this._useSession(async e=>{var r;let{data:i,error:n}=e;if(n)return this._returnResult({data:null,error:n});let{data:o,error:s}=await(0,re._request)(this.fetch,"DELETE",`${this.url}/factors/recovery-codes`,{headers:this.headers,jwt:(r=i?.session)===null||r===void 0?void 0:r.access_token});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(e){if((0,L.isAuthError)(e))return this._returnResult({data:null,error:e});throw e}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{let{data:{session:i},error:n}=r;return n?this._returnResult({data:null,error:n}):i?await(0,re._request)(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:i.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new L.AuthSessionMissingError})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async i=>{let{data:{session:n},error:o}=i;if(o)return this._returnResult({data:null,error:o});if(!n)return this._returnResult({data:null,error:new L.AuthSessionMissingError});let s=await(0,re._request)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return s.data&&s.data.redirect_url&&(0,V.isBrowser)()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(i){if((0,L.isAuthError)(i))return this._returnResult({data:null,error:i});throw i}}async _denyAuthorization(e,r){try{return await this._useSession(async i=>{let{data:{session:n},error:o}=i;if(o)return this._returnResult({data:null,error:o});if(!n)return this._returnResult({data:null,error:new L.AuthSessionMissingError});let s=await(0,re._request)(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return s.data&&s.data.redirect_url&&(0,V.isBrowser)()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(i){if((0,L.isAuthError)(i))return this._returnResult({data:null,error:i});throw i}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:r},error:i}=e;return i?this._returnResult({data:null,error:i}):r?await(0,re._request)(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:n=>({data:n,error:null})}):this._returnResult({data:null,error:new L.AuthSessionMissingError})})}catch(e){if((0,L.isAuthError)(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{let{data:{session:i},error:n}=r;return n?this._returnResult({data:null,error:n}):i?(await(0,re._request)(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:i.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new L.AuthSessionMissingError})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let i=r.keys.find(a=>a.kid===e);if(i)return i;let n=Date.now();if(i=this.jwks.keys.find(a=>a.kid===e),i&&this.jwks_cached_at+Tt.JWKS_TTL>n)return i;let{data:o,error:s}=await(0,re._request)(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=n,i=o.keys.find(a=>a.kid===e),!i)?null:i}async getClaims(e,r={}){try{let i=e;if(!i){let{data:f,error:h}=await this.getSession();if(h||!f.session)return this._returnResult({data:null,error:h});i=f.session.access_token}let{header:n,payload:o,signature:s,raw:{header:a,payload:c}}=(0,V.decodeJWT)(i);if(!r?.allowExpired)try{(0,V.validateExp)(o.exp)}catch(f){throw new L.AuthInvalidJwtError(f instanceof Error?f.message:"JWT validation failed")}let l=!n.alg||n.alg.startsWith("HS")||!n.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(n.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!l){let{error:f}=await this.getUser(i);if(f)throw f;return{data:{claims:o,header:n,signature:s},error:null}}let u=(0,V.getAlgorithm)(n.alg),d=await crypto.subtle.importKey("jwk",l,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,s,(0,Pj.stringToUint8Array)(`${a}.${c}`)))throw new L.AuthInvalidJwtError("Invalid JWT signature");return{data:{claims:o,header:n,signature:s},error:null}}catch(i){if((0,L.isAuthError)(i))return this._returnResult({data:null,error:i});throw i}}async signInWithPasskey(e){var r,i,n,o;try{if(!(0,_r.browserSupportsWebAuthn)())return this._returnResult({data:null,error:new L.AuthUnknownError("Browser does not support WebAuthn",null)});let{data:s,error:a}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e?.options)===null||r===void 0?void 0:r.captchaToken}});if(a||!s)return this._returnResult({data:null,error:a});let c=(0,_r.deserializeCredentialRequestOptions)(s.options),l=(n=(i=e?.options)===null||i===void 0?void 0:i.signal)!==null&&n!==void 0?n:_r.webAuthnAbortService.createNewAbortSignal(),{data:u,error:d}=await(0,_r.getCredential)({publicKey:c,signal:l,mediation:(o=e?.options)===null||o===void 0?void 0:o.mediation});if(d||!u)return this._returnResult({data:null,error:d??new L.AuthUnknownError("WebAuthn ceremony failed",null)});let p=(0,_r.serializeCredentialRequestResponse)(u);return this._verifyPasskeyAuthentication({challengeId:s.challenge_id,credential:p})}catch(s){if((0,L.isAuthError)(s))return this._returnResult({data:null,error:s});throw s}}async registerPasskey(e){var r,i;try{if(!(0,_r.browserSupportsWebAuthn)())return this._returnResult({data:null,error:new L.AuthUnknownError("Browser does not support WebAuthn",null)});let{data:n,error:o}=await this._startPasskeyRegistration();if(o||!n)return this._returnResult({data:null,error:o});let s=(0,_r.deserializeCredentialCreationOptions)(n.options),a=(i=(r=e?.options)===null||r===void 0?void 0:r.signal)!==null&&i!==void 0?i:_r.webAuthnAbortService.createNewAbortSignal(),{data:c,error:l}=await(0,_r.createCredential)({publicKey:s,signal:a});if(l||!c)return this._returnResult({data:null,error:l??new L.AuthUnknownError("WebAuthn ceremony failed",null)});let u=(0,_r.serializeCredentialCreationResponse)(c);return this._verifyPasskeyRegistration({challengeId:n.challenge_id,credential:u})}catch(n){if((0,L.isAuthError)(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyRegistration(){try{return await this._useSession(async e=>{let{data:{session:r},error:i}=e;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new L.AuthSessionMissingError});let{data:n,error:o}=await(0,re._request)(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:n,error:null})})}catch(e){if((0,L.isAuthError)(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){try{return await this._useSession(async r=>{let{data:{session:i},error:n}=r;if(n)return this._returnResult({data:null,error:n});if(!i)return this._returnResult({data:null,error:new L.AuthSessionMissingError});let{data:o,error:s}=await(0,re._request)(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:i.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;try{let{data:i,error:n}=await(0,re._request)(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e?.options)===null||r===void 0?void 0:r.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:i,error:null})}catch(i){if((0,L.isAuthError)(i))return this._returnResult({data:null,error:i});throw i}}async _verifyPasskeyAuthentication(e){try{let{data:r,error:i}=await(0,re._request)(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:re._sessionResponse});return i?this._returnResult({data:null,error:i}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){try{return await this._useSession(async e=>{let{data:{session:r},error:i}=e;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new L.AuthSessionMissingError});let{data:n,error:o}=await(0,re._request)(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})});return o?this._returnResult({data:null,error:o}):this._returnResult({data:n,error:null})})}catch(e){if((0,L.isAuthError)(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){try{return await this._useSession(async r=>{let{data:{session:i},error:n}=r;if(n)return this._returnResult({data:null,error:n});if(!i)return this._returnResult({data:null,error:new L.AuthSessionMissingError});let{data:o,error:s}=await(0,re._request)(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:i.access_token,body:{friendly_name:e.friendlyName}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:o,error:null})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){try{return await this._useSession(async r=>{let{data:{session:i},error:n}=r;if(n)return this._returnResult({data:null,error:n});if(!i)return this._returnResult({data:null,error:new L.AuthSessionMissingError});let{error:o}=await(0,re._request)(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:i.access_token,noResolveJson:!0});return o?this._returnResult({data:null,error:o}):this._returnResult({data:null,error:null})})}catch(r){if((0,L.isAuthError)(r))return this._returnResult({data:null,error:r});throw r}}};Sm.nextInstanceID={};H$.default=Sm});var Rj=C(K$=>{"use strict";Object.defineProperty(K$,"__esModule",{value:!0});var TH=(qr(),Xr(Zr)),OH=TH.__importDefault(_m()),PH=OH.default;K$.default=PH});var jj=C(G$=>{"use strict";Object.defineProperty(G$,"__esModule",{value:!0});var AH=(qr(),Xr(Zr)),RH=AH.__importDefault(W$()),jH=RH.default;G$.default=jH});var J$=C(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.processLock=Ut.lockInternals=Ut.NavigatorLockAcquireTimeoutError=Ut.navigatorLock=Ut.AuthClient=Ut.AuthAdminApi=Ut.GoTrueClient=Ut.GoTrueAdminApi=void 0;var Ca=(qr(),Xr(Zr)),zH=Ca.__importDefault(_m());Ut.GoTrueAdminApi=zH.default;var CH=Ca.__importDefault(W$());Ut.GoTrueClient=CH.default;var NH=Ca.__importDefault(Rj());Ut.AuthAdminApi=NH.default;var DH=Ca.__importDefault(jj());Ut.AuthClient=DH.default;Ca.__exportStar(C$(),Ut);Ca.__exportStar(as(),Ut);var xm=M$();Object.defineProperty(Ut,"navigatorLock",{enumerable:!0,get:function(){return xm.navigatorLock}});Object.defineProperty(Ut,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return xm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ut,"lockInternals",{enumerable:!0,get:function(){return xm.internals}});Object.defineProperty(Ut,"processLock",{enumerable:!0,get:function(){return xm.processLock}})});var N={};Jr(N,{FunctionRegion:()=>sn.FunctionRegion,FunctionsError:()=>sn.FunctionsError,FunctionsFetchError:()=>sn.FunctionsFetchError,FunctionsHttpError:()=>sn.FunctionsHttpError,FunctionsRelayError:()=>sn.FunctionsRelayError,PostgrestError:()=>Ji,StorageApiError:()=>_u,SupabaseClient:()=>Bj,createClient:()=>Om});function BH(t){if(!t||typeof t!="string")return null;let e=t.split("-");if(e.length!==4)return null;let[r,i,n,o]=e;if(r.length!==2||i.length!==32||n.length!==16||o.length!==2)return null;let s=/^[0-9a-f]+$/i;return!s.test(r)||!s.test(i)||!s.test(n)||!s.test(o)||i==="00000000000000000000000000000000"||n==="0000000000000000"?null:{version:r,traceId:i,parentId:n,traceFlags:o,isSampled:(parseInt(o,16)&1)===1}}function HH(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(let i of e)try{if(typeof i=="string"){if(WH(r.hostname,i))return!0}else if(i instanceof RegExp){if(i.test(r.hostname))return!0}else if(typeof i=="function"&&i(r))return!0}catch{continue}return!1}function WH(t,e){if(e===t)return!0;if(e.startsWith("*.")){let r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function KH(t){let e=[];try{let r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function xu(t){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xu(t)}function GH(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(xu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JH(t){var e=GH(t,"string");return xu(e)=="symbol"?e:e+""}function XH(t,e,r){return(e=JH(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function jt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zj(Object(r),!0).forEach(function(i){XH(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zj(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function r9(t,e,r){let i=LA();if(!i)return Dj||(Dj=!0,console.warn("@supabase/supabase-js: tracePropagation is enabled but the tracing runtime is not loaded, so trace headers will not be attached. Add `import '@supabase/supabase-js/tracing'` at your application entry point (requires the OpenTelemetry API package to be installed). The CDN/UMD build does not support trace propagation.")),null;if(!HH(typeof t=="string"||t instanceof URL?t:t.url,e))return null;let n=i();if(!n||!n.traceparent){var o;if(!(n==null||(o=n.carrierKeys)===null||o===void 0)&&o.length&&!Lj){Lj=!0;let s=n.carrierKeys.includes("sentry-trace")?" Sentry detected: set `propagateTraceparent: true` in Sentry.init() to emit it.":" Configure your tracing SDK to emit W3C trace context on outgoing requests.";console.warn(`@supabase/supabase-js: tracePropagation is enabled and a tracing SDK is active, but its propagator wrote [${n.carrierKeys.join(", ")}] and no W3C traceparent header, so trace headers will not be attached.`+s)}return null}if(r){let s=BH(n.traceparent);if(s&&!s.isSampled)return{traceparent:n.traceparent}}return n}function Uj(t){return typeof t=="boolean"?{enabled:t}:t}function n9(t){return t.endsWith("/")?t:t+"/"}function i9(t){Mj||typeof t!="object"||t===null||!("schema"in t)||t.schema===void 0||(Mj=!0,console.warn(`@supabase/supabase-js: The "schema" option must be nested under "db", e.g. createClient(url, key, { db: { schema: 'myschema' } }). A top-level "schema" is ignored and queries go to the default schema.`))}function o9(t,e){var r,i,n,o,s,a;let{db:c,auth:l,realtime:u,global:d}=t,{db:p,auth:f,realtime:h,global:m}=e,g=Uj(t.tracePropagation),y=Uj(e.tracePropagation),v={db:jt(jt({},p),c),auth:jt(jt({},f),l),realtime:jt(jt({},h),u),storage:{},global:jt(jt(jt({},m),d),{},{headers:jt(jt({},(r=m?.headers)!==null&&r!==void 0?r:{}),(i=d?.headers)!==null&&i!==void 0?i:{})}),tracePropagation:{enabled:(n=(o=g?.enabled)!==null&&o!==void 0?o:y?.enabled)!==null&&n!==void 0?n:!1,respectSamplingDecision:(s=(a=g?.respectSamplingDecision)!==null&&a!==void 0?a:y?.respectSamplingDecision)!==null&&s!==void 0?s:!0},accessToken:async()=>""};return t.accessToken?v.accessToken=t.accessToken:delete v.accessToken,v}function s9(t){let e=t?.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(n9(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}function c9(){if(typeof window<"u"||globalThis.Deno!==void 0)return!1;let t=globalThis.process;if(!t)return!1;let e=t.version;if(e==null)return!1;let r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}var sn,Fj,Zj,LH,Su,Tm,Im,Em,qj,UH,MH,FH,ZH,qH,VH,YH,QH,Vj,e9,Cj,t9,Nj,Dj,Lj,Mj,a9,Bj,Om,Hj=w(()=>{UA();sn=xo(gR(),1);ER();Fj=xo(d$(),1);ij();Zj=xo(J$(),1);D(N,xo(d$(),1));D(N,xo(J$(),1));LH="2.117.3",Su="";if(typeof Deno<"u")Su="deno",Tm=(Im=Deno.version)===null||Im===void 0?void 0:Im.deno;else if(typeof document<"u")Su="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Su="react-native";else{Su="node";let t=globalThis.process;Tm=t==null||(Em=t.version)===null||Em===void 0?void 0:Em.replace(/^v/,"")}qj=[`runtime=${Su}`];Tm&&qj.push(`runtime-version=${Tm}`);UH={"X-Client-Info":`supabase-js/${LH}; ${qj.join("; ")}`},MH={headers:UH},FH={schema:"public"},ZH={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},qH={},VH={enabled:!1,respectSamplingDecision:!0};YH=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),QH=()=>Headers,Vj=t=>t.startsWith("sb_publishable_")||t.startsWith("sb_secret_"),e9="sb_temp_",Cj=new Set,t9=t=>{var e,r;if(!t.startsWith("sb_")||Vj(t)||t.startsWith(e9))return;let i=(e=(r=t.match(/^sb_[a-zA-Z0-9]+_/))===null||r===void 0?void 0:r[0])!==null&&e!==void 0?e:"unknown";Cj.has(i)||(Cj.add(i),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is; if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type."))},Nj=(t,e,r,i,n,o)=>{let s=YH(i),a=QH(),c=n?.enabled===!0,l=n?.respectSamplingDecision!==!1,u=c?KH(e):null,d=!(o?.omitApiKeyAsBearer&&Vj(t));return async(p,f)=>{let h=await r(),m=new a(f?.headers);if(m.has("apikey")||m.set("apikey",t),!m.has("Authorization")){let g=h??(d?t:null);g&&m.set("Authorization",`Bearer ${g}`)}if(u){let g=r9(p,u,l);g&&(g.traceparent&&!m.has("traceparent")&&m.set("traceparent",g.traceparent),g.tracestate&&!m.has("tracestate")&&m.set("tracestate",g.tracestate),g.baggage&&!m.has("baggage")&&m.set("baggage",g.baggage))}return s(p,jt(jt({},f),{},{headers:m}))}},Dj=!1,Lj=!1;Mj=!1;a9=class extends Zj.AuthClient{constructor(t){super(t)}},Bj=class{constructor(t,e,r){var i,n;this.supabaseUrl=t,this.supabaseKey=e;let o=s9(t);if(!e)throw new Error("supabaseKey is required.");t9(e),i9(r),this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);let s=`sb-${o.hostname.split(".")[0]}-auth-token`,a={db:FH,realtime:qH,auth:jt(jt({},ZH),{},{storageKey:s}),global:MH,tracePropagation:VH},c=o9(r??{},a);if(this.settings=c,this.storageKey=(i=c.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(n=c.global.headers)!==null&&n!==void 0?n:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var l;this.auth=this._initSupabaseAuthClient((l=c.auth)!==null&&l!==void 0?l:{},this.headers,c.global.fetch)}this.fetch=Nj(e,t,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation),this.functionsFetch=Nj(e,t,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(jt({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new xR(new URL("rest/v1",o).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit,retry:c.db.retry}),this.storage=new nj(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new sn.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}getOpenApiSpec(){return this.rest.getOpenApiSpec()}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();let{data:i}=await t.auth.getSession();return(e=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:null}async _getAccessToken(){var t=this,e;return(e=await t._getSessionToken())!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:i,userStorage:n,storageKey:o,flowType:s,lock:a,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:p},f,h){let m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new a9({url:this.authUrl.href,headers:jt(jt({},m),f),storageKey:o,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:i,userStorage:n,flowType:s,lock:a,debug:c,throwOnError:l,experimental:u,fetch:h,lockAcquireTimeout:d,skipAutoInitialize:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(g=>g.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Fj.RealtimeClient(this.realtimeUrl.href,jt(jt({},t),{},{params:jt(jt({},{apikey:this.supabaseKey}),t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e?.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN"||t==="INITIAL_SESSION")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}},Om=(t,e,r)=>new Bj(t,e,r);c9()&&console.warn("\u26A0\uFE0F Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715")});import{chmodSync as l9,existsSync as X$,mkdirSync as Kj,readFileSync as Gj,rmSync as u9,writeFileSync as Jj}from"node:fs";import{homedir as d9}from"node:os";import{join as Pm}from"node:path";function Da(){let t=process.env;if(t.CODESIGNFLO_SERVICE_URL&&t.CODESIGNFLO_SERVICE_ANON)return{url:t.CODESIGNFLO_SERVICE_URL,anon:t.CODESIGNFLO_SERVICE_ANON,web:t.CODESIGNFLO_SERVICE_WEB??"https://codesignflo.vercel.app"};let e=Pm(Iu,"service.json");if(X$(e))return JSON.parse(Gj(e,"utf8"));throw new Error("the CoDesignFlo service isn't configured yet (set CODESIGNFLO_SERVICE_URL and CODESIGNFLO_SERVICE_ANON)")}function Y$(t){Kj(Iu,{recursive:!0}),Jj(Pm(Iu,"service.json"),`${JSON.stringify(t,null,2)}
|
|
116
|
+
`)}function Eu(t,e){Kj(Iu,{recursive:!0}),Jj(Na,JSON.stringify({refresh_token:t,user:e},null,2)),l9(Na,384)}function Xj(){u9(Na,{force:!0})}function Yj(t,e){return Wj??=(async()=>{let r=await fetch(`${e.replace(/\/$/,"")}/ticket`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ticket:t})}),i=await r.json().catch(()=>({}));if(!r.ok||!i.access_token||!i.service||!i.project)throw new Error(i.error??"this command's ticket couldn't be used \u2014 call sync again for a fresh command");return process.env.CODESIGNFLO_SERVICE_URL=i.service.url,process.env.CODESIGNFLO_SERVICE_ANON=i.service.anon,process.env.CODESIGNFLO_SERVICE_WEB=i.service.web,{token:i.access_token,project:i.project}})(),Wj}async function Qj(){let{CODESIGNFLO_TICKET:t,CODESIGNFLO_MCP:e}=process.env;return t&&e?(await Yj(t,e)).project:null}async function an(){let{CODESIGNFLO_TICKET:t,CODESIGNFLO_MCP:e}=process.env,r=t&&e?(await Yj(t,e)).token:process.env.CODESIGNFLO_TOKEN;if(r){let a=Da(),c=Om(a.url,a.anon,{auth:{persistSession:!1,autoRefreshToken:!1},global:{headers:{Authorization:`Bearer ${r}`}}}),{data:l,error:u}=await c.auth.getUser(r);if(u||!l.user)throw new Error("the sign-in from the CoDesignFlo MCP expired \u2014 call sync again for a fresh command");return{client:c,user:{id:l.user.id,email:l.user.email??null}}}if(!X$(Na))throw new Error("not signed in \u2014 run: codesignflo login");let i=JSON.parse(Gj(Na,"utf8")),n=Q$(),{data:o,error:s}=await n.auth.refreshSession({refresh_token:i.refresh_token});if(s||!o.session||!o.user)throw new Error("your sign-in expired \u2014 run: codesignflo login");return Eu(o.session.refresh_token,{id:o.user.id,email:o.user.email??null}),await n.rpc("accept_invitations"),{client:n,user:{id:o.user.id,email:o.user.email??null}}}var Iu,Na,Q$,Am,Wj,La=w(()=>{"use strict";Hj();Iu=Pm(d9(),".codesignflo"),Na=Pm(Iu,"session.json");Q$=(t=Da())=>Om(t.url,t.anon,{auth:{persistSession:!1,autoRefreshToken:!1}});Am=()=>X$(Na),Wj=null});import{existsSync as Ua,mkdirSync as tk,readdirSync as ez,readFileSync as jm,renameSync as f9,writeFileSync as rk}from"node:fs";import{join as ds,resolve as tz}from"node:path";async function nz(t){let e=In(t);if(!e?.cloud)return;let{client:r}=await an(),i=await Qj();if(i&&i!==e.projectId)throw new Error(`this command was made for project ${i}, but this app is ${e.projectId} \u2014 run it in that app's folder`);let n=[];for(let o=0;;o+=1e3){let{data:s,error:a}=await r.from("events").select("id, at, by, component, kind, body").eq("project_id",e.projectId).order("seq").range(o,o+999);if(a)throw new Error(`couldn't read the project's history: ${a.message}`);if(n.push(...s.map(p9).filter(c=>c!==null)),(s??[]).length<1e3)break}Mt={projectId:e.projectId,events:n,pending:[],client:r}}async function iz(){if(!Mt?.pending.length)return;let t=Mt.pending.map(r=>rz(Mt.projectId,r)),{error:e}=await Mt.client.from("events").upsert(t,{onConflict:"project_id,id",ignoreDuplicates:!0});if(e)throw new Error(`couldn't save to the project's history: ${e.message}`);Mt.pending=[]}async function oz(t,e,r){for(let i=0;i<r.length;i+=500){let{error:n}=await t.from("events").upsert(r.slice(i,i+500).map(o=>rz(e,o)),{onConflict:"project_id,id",ignoreDuplicates:!0});if(n)throw new Error(`couldn't upload the history: ${n.message}`)}}function In(t){let e=sz(t);return Ua(e)?JSON.parse(jm(e,"utf8")):null}function nk(t,e){tk(gt(e),{recursive:!0}),rk(sz(e),`${JSON.stringify(t,null,2)}
|
|
117
|
+
`)}function Yt(t){let e=In(t);if(!e)throw new Error("no .codesignflo/config.json here \u2014 run `codesignflo init` first (in your app's folder)");return e}function Ct(t){if(Mt)return Mt.events;let e=az(t);return Ua(e)?jm(e,"utf8").split(`
|
|
118
|
+
`).filter(Boolean).map(r=>Vh(JSON.parse(r))).filter(r=>r!==null):[]}function En(t,e){let r=new Set(Ct(e).map(n=>n.id)),i=tu(t.filter(n=>!r.has(n.id)));return Mt?(Mt.events.push(...i),Mt.pending.push(...i),i):(i.length&&(tk(gt(e),{recursive:!0}),rk(az(e),i.map(n=>`${JSON.stringify(n)}
|
|
119
|
+
`).join(""),{flag:"a"})),i)}async function Tu(t,e){let r=`${t}@${e}`;if(Rm.has(r))return Rm.get(r);let i=null;if(Mt){let{data:n,error:o}=await Mt.client.from("generations").select("snapshot, canon_version").eq("project_id",Mt.projectId).eq("component",t).eq("gen",e).maybeSingle();if(o)throw new Error(`couldn't read a version of ${t}: ${o.message}`);i=n&&(n.canon_version??5)===5?n.snapshot:null}return!i&&Ua(ek(t,e))&&(i=JSON.parse(jm(ek(t,e),"utf8"))),Rm.set(r,i),i}async function cz(t,e,r){if(Rm.set(`${t}@${e}`,r),Mt){let{error:i}=await Mt.client.from("generations").upsert({project_id:Mt.projectId,component:t,gen:e,snapshot:r,canon_version:5},{onConflict:"project_id,component,gen",ignoreDuplicates:!0});if(i)throw new Error(`couldn't save a version of ${t}: ${i.message}`);return}tk(ds(gt(),"snapshots",t),{recursive:!0}),rk(ek(t,e),Bn(r))}async function lz(t,e,r){let i=ds(gt(r),"snapshots");if(!Ua(i))return 0;let n=0;for(let o of ez(i))for(let s of ez(ds(i,o)).filter(a=>a.endsWith(".json"))){let a=JSON.parse(jm(ds(i,o,s),"utf8")),{error:c}=await t.from("generations").upsert({project_id:e,component:o,gen:s.slice(0,-5),snapshot:a,canon_version:5},{onConflict:"project_id,component,gen",ignoreDuplicates:!0});if(c)throw new Error(`couldn't upload the versions of ${o}: ${c.message}`);n++}return n}var Mt,rz,p9,fs,gt,sz,az,ek,Rm,sr=w(()=>{"use strict";Pr();La();Mt=null,rz=(t,e)=>{let{id:r,at:i,by:n,component:o,kind:s,...a}=e;return{project_id:t,id:r,at:i,by:n,component:o,kind:s,body:a}},p9=t=>Vh({...t.body,id:t.id,at:t.at,by:t.by,component:t.component,kind:t.kind});fs=()=>Mt?{client:Mt.client,projectId:Mt.projectId}:null;gt=(t=process.cwd())=>{let e=tz(t,".codesignflo"),r=tz(t,".codesignloop");return!Ua(e)&&Ua(r)&&f9(r,e),e},sz=t=>ds(gt(t),"config.json"),az=t=>ds(gt(t),"events.jsonl");ek=(t,e,r)=>ds(gt(r),"snapshots",t,`${e}.json`),Rm=new Map});var Le,xC,J,Ti,Nu=w(()=>{(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let o={};for(let s of n)o[s]=s;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of o)s[a]=n[a];return t.objectValues(s)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&o.push(s);return o},t.find=(n,o)=>{for(let s of n)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(Le||(Le={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(xC||(xC={}));J=Le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ti=t=>{switch(typeof t){case"undefined":return J.undefined;case"string":return J.string;case"number":return Number.isNaN(t)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":return Array.isArray(t)?J.array:t===null?J.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?J.promise:typeof Map<"u"&&t instanceof Map?J.map:typeof Set<"u"&&t instanceof Set?J.set:typeof Date<"u"&&t instanceof Date?J.date:J.object;default:return J.unknown}}});var F,Hr,Vm=w(()=>{Nu();F=Le.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Hr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},i={_errors:[]},n=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)i._errors.push(r(s));else{let a=i,c=0;for(;c<s.path.length;){let l=s.path[c],u=c===s.path.length-1;if(l==="_errors"){u&&a._errors.push(r(s)),c++;continue}Object.prototype.hasOwnProperty.call(a,l)||(l==="__proto__"?Object.defineProperty(a,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):a[l]={_errors:[]}),a=a[l],u&&a._errors.push(r(s)),c++}}};return n(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),i=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];r[o]=r[o]||[],r[o].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Hr.create=t=>new Hr(t)});var DW,eo,Ek=w(()=>{Vm();Nu();DW=(t,e)=>{let r;switch(t.code){case F.invalid_type:t.received===J.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case F.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Le.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:r=`Unrecognized key(s) in object: ${Le.joinValues(t.keys,", ")}`;break;case F.invalid_union:r="Invalid input";break;case F.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Le.joinValues(t.options)}`;break;case F.invalid_enum_value:r=`Invalid enum value. Expected ${Le.joinValues(t.options)}, received '${t.received}'`;break;case F.invalid_arguments:r="Invalid function arguments";break;case F.invalid_return_type:r="Invalid function return type";break;case F.invalid_date:r="Invalid date";break;case F.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Le.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case F.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case F.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case F.custom:r="Invalid input";break;case F.invalid_intersection_types:r="Intersection results could not be merged";break;case F.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case F.not_finite:r="Number must be finite";break;default:r=e.defaultError,Le.assertNever(t)}return{message:r}},eo=DW});function Du(){return LW}var LW,Bm=w(()=>{Ek();LW=eo});function H(t,e){let r=Du(),i=Hm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===eo?void 0:eo].filter(n=>!!n)});t.common.issues.push(i)}var Hm,ar,me,Za,br,Tk,Ok,ps,Lu,Pk=w(()=>{Bm();Ek();Hm=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,o=[...r,...n.path||[]],s={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let a="",c=i.filter(l=>!!l).slice().reverse();for(let l of c)a=l(s,{data:e,defaultError:a}).message;return{...n,path:o,message:a}};ar=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return me;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r){let o=await n.key,s=await n.value;i.push({key:o,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:o,value:s}=n;if(o.status==="aborted"||s.status==="aborted")return me;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}},me=Object.freeze({status:"aborted"}),Za=t=>({status:"dirty",value:t}),br=t=>({status:"valid",value:t}),Tk=t=>t.status==="aborted",Ok=t=>t.status==="dirty",ps=t=>t.status==="valid",Lu=t=>typeof Promise<"u"&&t instanceof Promise});var IC=w(()=>{});var ne,EC=w(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ne||(ne={}))});function ke(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:n}}function PC(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function tK(t){return new RegExp(`^${PC(t)}$`)}function rK(t){let e=`${OC}T${PC(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function nK(t,e){return!!((e==="v4"||!e)&&KW.test(t)||(e==="v6"||!e)&&JW.test(t))}function iK(t,e){if(!VW.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function oK(t,e){return!!((e==="v4"||!e)&&GW.test(t)||(e==="v6"||!e)&&XW.test(t))}function sK(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(t.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return o%s/10**n}function qa(t){if(t instanceof Wr){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=On.create(qa(i))}return new Wr({...t._def,shape:()=>e})}else return t instanceof ro?new ro({...t._def,type:qa(t.element)}):t instanceof On?On.create(qa(t.unwrap())):t instanceof Ai?Ai.create(qa(t.unwrap())):t instanceof Pi?Pi.create(t.items.map(e=>qa(e))):t}function jk(t,e){let r=Ti(t),i=Ti(e);if(t===e)return{valid:!0,data:t};if(r===J.object&&i===J.object){let n=Le.objectKeys(e),o=Le.objectKeys(t).filter(a=>n.indexOf(a)!==-1),s={...t,...e};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(let a of o){if(a==="__proto__")continue;let c=jk(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===J.array&&i===J.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],c=jk(s,a);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===J.date&&i===J.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function AC(t,e){return new Xa({values:t,typeName:Z.ZodEnum,...ke(e)})}var cn,TC,Oe,UW,MW,FW,ZW,qW,VW,BW,HW,WW,Ak,KW,GW,JW,XW,YW,QW,OC,eK,Va,Uu,Mu,Fu,Zu,qu,Ba,Ha,Vu,to,Qn,Bu,ro,Wr,Wa,Oi,Rk,Ka,Pi,zk,Hu,Wu,Ck,Ga,Ja,Xa,Ya,hs,Pn,On,Ai,Qa,ec,Ku,Dae,Wm,Km,tc,Lae,Z,Uae,Mae,Fae,Zae,qae,Vae,Bae,Hae,Wae,Kae,Gae,Jae,Xae,Yae,RC,Qae,ece,tce,rce,nce,ice,oce,sce,ace,cce,lce,uce,dce,fce,pce,hce,mce,gce,yce,jC=w(()=>{Vm();Bm();EC();Pk();Nu();cn=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},TC=(t,e)=>{if(ps(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Hr(t.common.issues);return this._error=r,this._error}}};Oe=class{get description(){return this._def.description}_getType(e){return Ti(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ti(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ar,ctx:{common:e.parent.common,data:e.data,parsedType:Ti(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Lu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ti(e)},n=this._parseSync({data:e,path:i.path,parent:i});return TC(i,n)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ti(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return ps(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>ps(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ti(e)},n=this._parse({data:e,path:i.path,parent:i}),o=await(Lu(n)?n:Promise.resolve(n));return TC(i,o)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let s=e(n),a=()=>o.addIssue({code:F.custom,...i(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Pn({schema:this,typeName:Z.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return On.create(this,this._def)}nullable(){return Ai.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return hs.create(this,this._def)}or(e){return Wa.create([this,e],this._def)}and(e){return Ka.create(this,e,this._def)}transform(e){return new Pn({...ke(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Qa({...ke(this._def),innerType:this,defaultValue:r,typeName:Z.ZodDefault})}brand(){return new Wm({typeName:Z.ZodBranded,type:this,...ke(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new ec({...ke(this._def),innerType:this,catchValue:r,typeName:Z.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Km.create(this,e)}readonly(){return tc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},UW=/^c[^\s-]{8,}$/i,MW=/^[0-9a-z]+$/,FW=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ZW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qW=/^[a-z0-9_-]{21}$/i,VW=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BW=/^[-+]?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)?)??$/,HW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,WW="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",KW=/^(?:(?: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])$/,GW=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,JW=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,XW=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QW=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OC="((\\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])))",eK=new RegExp(`^${OC}$`);Va=class t extends Oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==J.string){let o=this._getOrReturnCtx(e);return H(o,{code:F.invalid_type,expected:J.string,received:o.parsedType}),me}let i=new ar,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:F.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:F.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(n=this._getOrReturnCtx(e,n),s?H(n,{code:F.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&H(n,{code:F.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")HW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"email",code:F.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Ak||(Ak=new RegExp(WW,"u")),Ak.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"emoji",code:F.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")ZW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"uuid",code:F.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")qW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"nanoid",code:F.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")UW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid",code:F.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")MW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid2",code:F.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")FW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ulid",code:F.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),H(n,{validation:"url",code:F.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"regex",code:F.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),H(n,{code:F.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:F.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:F.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?rK(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:F.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?eK.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:F.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?tK(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:F.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?BW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"duration",code:F.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?nK(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ip",code:F.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?iK(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"jwt",code:F.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?oK(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cidr",code:F.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?YW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64",code:F.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?QW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64url",code:F.invalid_string,message:o.message}),i.dirty()):Le.assertNever(o);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:F.invalid_string,...ne.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ne.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ne.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ne.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ne.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ne.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ne.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ne.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ne.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ne.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ne.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ne.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ne.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ne.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ne.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ne.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ne.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ne.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ne.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ne.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ne.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ne.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ne.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ne.errToObj(r)})}nonempty(e){return this.min(1,ne.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Va.create=t=>new Va({checks:[],typeName:Z.ZodString,coerce:t?.coerce??!1,...ke(t)});Uu=class t extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==J.number){let o=this._getOrReturnCtx(e);return H(o,{code:F.invalid_type,expected:J.number,received:o.parsedType}),me}let i,n=new ar;for(let o of this._def.checks)o.kind==="int"?Le.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:F.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:F.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:F.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?sK(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),H(i,{code:F.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:F.not_finite,message:o.message}),n.dirty()):Le.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ne.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ne.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ne.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ne.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:ne.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ne.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ne.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ne.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ne.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ne.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Le.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Uu.create=t=>new Uu({checks:[],typeName:Z.ZodNumber,coerce:t?.coerce||!1,...ke(t)});Mu=class t extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==J.bigint)return this._getInvalidInput(e);let i,n=new ar;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:F.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:F.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),H(i,{code:F.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):Le.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return H(r,{code:F.invalid_type,expected:J.bigint,received:r.parsedType}),me}gte(e,r){return this.setLimit("min",e,!0,ne.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ne.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ne.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ne.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:ne.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Mu.create=t=>new Mu({checks:[],typeName:Z.ZodBigInt,coerce:t?.coerce??!1,...ke(t)});Fu=class extends Oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==J.boolean){let i=this._getOrReturnCtx(e);return H(i,{code:F.invalid_type,expected:J.boolean,received:i.parsedType}),me}return br(e.data)}};Fu.create=t=>new Fu({typeName:Z.ZodBoolean,coerce:t?.coerce||!1,...ke(t)});Zu=class t extends Oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==J.date){let o=this._getOrReturnCtx(e);return H(o,{code:F.invalid_type,expected:J.date,received:o.parsedType}),me}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:F.invalid_date}),me}let i=new ar,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:F.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:F.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):Le.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ne.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ne.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Zu.create=t=>new Zu({checks:[],coerce:t?.coerce||!1,typeName:Z.ZodDate,...ke(t)});qu=class extends Oe{_parse(e){if(this._getType(e)!==J.symbol){let i=this._getOrReturnCtx(e);return H(i,{code:F.invalid_type,expected:J.symbol,received:i.parsedType}),me}return br(e.data)}};qu.create=t=>new qu({typeName:Z.ZodSymbol,...ke(t)});Ba=class extends Oe{_parse(e){if(this._getType(e)!==J.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:F.invalid_type,expected:J.undefined,received:i.parsedType}),me}return br(e.data)}};Ba.create=t=>new Ba({typeName:Z.ZodUndefined,...ke(t)});Ha=class extends Oe{_parse(e){if(this._getType(e)!==J.null){let i=this._getOrReturnCtx(e);return H(i,{code:F.invalid_type,expected:J.null,received:i.parsedType}),me}return br(e.data)}};Ha.create=t=>new Ha({typeName:Z.ZodNull,...ke(t)});Vu=class extends Oe{constructor(){super(...arguments),this._any=!0}_parse(e){return br(e.data)}};Vu.create=t=>new Vu({typeName:Z.ZodAny,...ke(t)});to=class extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return br(e.data)}};to.create=t=>new to({typeName:Z.ZodUnknown,...ke(t)});Qn=class extends Oe{_parse(e){let r=this._getOrReturnCtx(e);return H(r,{code:F.invalid_type,expected:J.never,received:r.parsedType}),me}};Qn.create=t=>new Qn({typeName:Z.ZodNever,...ke(t)});Bu=class extends Oe{_parse(e){if(this._getType(e)!==J.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:F.invalid_type,expected:J.void,received:i.parsedType}),me}return br(e.data)}};Bu.create=t=>new Bu({typeName:Z.ZodVoid,...ke(t)});ro=class t extends Oe{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==J.array)return H(r,{code:F.invalid_type,expected:J.array,received:r.parsedType}),me;if(n.exactLength!==null){let s=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(s||a)&&(H(r,{code:s?F.too_big:F.too_small,minimum:a?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(H(r,{code:F.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(H(r,{code:F.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>n.type._parseAsync(new cn(r,s,r.path,a)))).then(s=>ar.mergeArray(i,s));let o=[...r.data].map((s,a)=>n.type._parseSync(new cn(r,s,r.path,a)));return ar.mergeArray(i,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ne.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ne.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ne.toString(r)}})}nonempty(e){return this.min(1,e)}};ro.create=(t,e)=>new ro({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...ke(e)});Wr=class t extends Oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Le.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==J.object){let l=this._getOrReturnCtx(e);return H(l,{code:F.invalid_type,expected:J.object,received:l.parsedType}),me}let{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Qn&&this._def.unknownKeys==="strip"))for(let l in n.data)s.includes(l)||a.push(l);let c=[];for(let l of s){let u=o[l],d=n.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new cn(n,d,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof Qn){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(l==="strict")a.length>0&&(H(n,{code:F.unrecognized_keys,keys:a}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let d=n.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new cn(n,d,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>ar.mergeObjectSync(i,l)):ar.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return ne.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{let n=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:ne.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Z.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let i of Le.objectKeys(e))e[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let i of Le.objectKeys(this.shape))e[i]||(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}deepPartial(){return qa(this)}partial(e){let r={};for(let i of Le.objectKeys(this.shape)){let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let i of Le.objectKeys(this.shape))if(e&&!e[i])r[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof On;)o=o._def.innerType;r[i]=o}return new t({...this._def,shape:()=>r})}keyof(){return AC(Le.objectKeys(this.shape))}};Wr.create=(t,e)=>new Wr({shape:()=>t,unknownKeys:"strip",catchall:Qn.create(),typeName:Z.ZodObject,...ke(e)});Wr.strictCreate=(t,e)=>new Wr({shape:()=>t,unknownKeys:"strict",catchall:Qn.create(),typeName:Z.ZodObject,...ke(e)});Wr.lazycreate=(t,e)=>new Wr({shape:t,unknownKeys:"strip",catchall:Qn.create(),typeName:Z.ZodObject,...ke(e)});Wa=class extends Oe{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Hr(a.ctx.common.issues));return H(r,{code:F.invalid_union,unionErrors:s}),me}if(r.common.async)return Promise.all(i.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(n);{let o,s=[];for(let c of i){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new Hr(c));return H(r,{code:F.invalid_union,unionErrors:a}),me}}get options(){return this._def.options}};Wa.create=(t,e)=>new Wa({options:t,typeName:Z.ZodUnion,...ke(e)});Oi=t=>t instanceof Ga?Oi(t.schema):t instanceof Pn?Oi(t.innerType()):t instanceof Ja?[t.value]:t instanceof Xa?t.options:t instanceof Ya?Le.objectValues(t.enum):t instanceof Qa?Oi(t._def.innerType):t instanceof Ba?[void 0]:t instanceof Ha?[null]:t instanceof On?[void 0,...Oi(t.unwrap())]:t instanceof Ai?[null,...Oi(t.unwrap())]:t instanceof Wm||t instanceof tc?Oi(t.unwrap()):t instanceof ec?Oi(t._def.innerType):[],Rk=class t extends Oe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==J.object)return H(r,{code:F.invalid_type,expected:J.object,received:r.parsedType}),me;let i=this.discriminator,n=r.data[i],o=this.optionsMap.get(n);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(H(r,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),me)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let o of r){let s=Oi(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,o)}}return new t({typeName:Z.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...ke(i)})}};Ka=class extends Oe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(o,s)=>{if(Tk(o)||Tk(s))return me;let a=jk(o.value,s.value);return a.valid?((Ok(o)||Ok(s))&&r.dirty(),{status:r.value,value:a.data}):(H(i,{code:F.invalid_intersection_types}),me)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>n(o,s)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Ka.create=(t,e,r)=>new Ka({left:t,right:e,typeName:Z.ZodIntersection,...ke(r)});Pi=class t extends Oe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==J.array)return H(i,{code:F.invalid_type,expected:J.array,received:i.parsedType}),me;if(i.data.length<this._def.items.length)return H(i,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),me;!this._def.rest&&i.data.length>this._def.items.length&&(H(i,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...i.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new cn(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>ar.mergeArray(r,s)):ar.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pi.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pi({items:t,typeName:Z.ZodTuple,rest:null,...ke(e)})};zk=class t extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==J.object)return H(i,{code:F.invalid_type,expected:J.object,received:i.parsedType}),me;let n=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)n.push({key:o._parse(new cn(i,a,i.path,a)),value:s._parse(new cn(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?ar.mergeObjectAsync(r,n):ar.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof Oe?new t({keyType:e,valueType:r,typeName:Z.ZodRecord,...ke(i)}):new t({keyType:Va.create(),valueType:e,typeName:Z.ZodRecord,...ke(r)})}},Hu=class extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==J.map)return H(i,{code:F.invalid_type,expected:J.map,received:i.parsedType}),me;let n=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,c],l)=>({key:n._parse(new cn(i,a,i.path,[l,"key"])),value:o._parse(new cn(i,c,i.path,[l,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return me;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return me;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}}}};Hu.create=(t,e,r)=>new Hu({valueType:e,keyType:t,typeName:Z.ZodMap,...ke(r)});Wu=class t extends Oe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==J.set)return H(i,{code:F.invalid_type,expected:J.set,received:i.parsedType}),me;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(H(i,{code:F.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(H(i,{code:F.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let l=new Set;for(let u of c){if(u.status==="aborted")return me;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let a=[...i.data.values()].map((c,l)=>o._parse(new cn(i,c,i.path,l)));return i.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:ne.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ne.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Wu.create=(t,e)=>new Wu({valueType:t,minSize:null,maxSize:null,typeName:Z.ZodSet,...ke(e)});Ck=class t extends Oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==J.function)return H(r,{code:F.invalid_type,expected:J.function,received:r.parsedType}),me;function i(a,c){return Hm({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Du(),eo].filter(l=>!!l),issueData:{code:F.invalid_arguments,argumentsError:c}})}function n(a,c){return Hm({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Du(),eo].filter(l=>!!l),issueData:{code:F.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof hs){let a=this;return br(async function(...c){let l=new Hr([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(i(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(n(d,f)),l})})}else{let a=this;return br(function(...c){let l=a._def.args.safeParse(c,o);if(!l.success)throw new Hr([i(c,l.error)]);let u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Hr([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pi.create(e).rest(to.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||Pi.create([]).rest(to.create()),returns:r||to.create(),typeName:Z.ZodFunction,...ke(i)})}},Ga=class extends Oe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ga.create=(t,e)=>new Ga({getter:t,typeName:Z.ZodLazy,...ke(e)});Ja=class extends Oe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return H(r,{received:r.data,code:F.invalid_literal,expected:this._def.value}),me}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ja.create=(t,e)=>new Ja({value:t,typeName:Z.ZodLiteral,...ke(e)});Xa=class t extends Oe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return H(r,{expected:Le.joinValues(i),received:r.parsedType,code:F.invalid_type}),me}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),i=this._def.values;return H(r,{received:r.data,code:F.invalid_enum_value,options:i}),me}return br(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...r})}};Xa.create=AC;Ya=class extends Oe{_parse(e){let r=Le.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==J.string&&i.parsedType!==J.number){let n=Le.objectValues(r);return H(i,{expected:Le.joinValues(n),received:i.parsedType,code:F.invalid_type}),me}if(this._cache||(this._cache=new Set(Le.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=Le.objectValues(r);return H(i,{received:i.data,code:F.invalid_enum_value,options:n}),me}return br(e.data)}get enum(){return this._def.values}};Ya.create=(t,e)=>new Ya({values:t,typeName:Z.ZodNativeEnum,...ke(e)});hs=class extends Oe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==J.promise&&r.common.async===!1)return H(r,{code:F.invalid_type,expected:J.promise,received:r.parsedType}),me;let i=r.parsedType===J.promise?r.data:Promise.resolve(r.data);return br(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};hs.create=(t,e)=>new hs({type:t,typeName:Z.ZodPromise,...ke(e)});Pn=class extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:s=>{H(i,s),s.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let s=n.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return me;let c=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return c.status==="aborted"?me:c.status==="dirty"?Za(c.value):r.value==="dirty"?Za(c.value):c});{if(r.value==="aborted")return me;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?me:a.status==="dirty"?Za(a.value):r.value==="dirty"?Za(a.value):a}}if(n.type==="refinement"){let s=a=>{let c=n.refinement(a,o);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?me:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?me:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ps(s))return me;let a=n.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>ps(s)?Promise.resolve(n.transform(s.value,o)).then(a=>({status:r.value,value:a})):me);Le.assertNever(n)}};Pn.create=(t,e,r)=>new Pn({schema:t,typeName:Z.ZodEffects,effect:e,...ke(r)});Pn.createWithPreprocess=(t,e,r)=>new Pn({schema:e,effect:{type:"preprocess",transform:t},typeName:Z.ZodEffects,...ke(r)});On=class extends Oe{_parse(e){return this._getType(e)===J.undefined?br(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};On.create=(t,e)=>new On({innerType:t,typeName:Z.ZodOptional,...ke(e)});Ai=class extends Oe{_parse(e){return this._getType(e)===J.null?br(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ai.create=(t,e)=>new Ai({innerType:t,typeName:Z.ZodNullable,...ke(e)});Qa=class extends Oe{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===J.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Qa.create=(t,e)=>new Qa({innerType:t,typeName:Z.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ke(e)});ec=class extends Oe{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Lu(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hr(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Hr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};ec.create=(t,e)=>new ec({innerType:t,typeName:Z.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ke(e)});Ku=class extends Oe{_parse(e){if(this._getType(e)!==J.nan){let i=this._getOrReturnCtx(e);return H(i,{code:F.invalid_type,expected:J.nan,received:i.parsedType}),me}return{status:"valid",value:e.data}}};Ku.create=t=>new Ku({typeName:Z.ZodNaN,...ke(t)});Dae=Symbol("zod_brand"),Wm=class extends Oe{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},Km=class t extends Oe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?me:o.status==="dirty"?(r.dirty(),Za(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?me:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:Z.ZodPipeline})}},tc=class extends Oe{_parse(e){let r=this._def.innerType._parse(e),i=n=>(ps(n)&&(n.value=Object.freeze(n.value)),n);return Lu(r)?r.then(n=>i(n)):i(r)}unwrap(){return this._def.innerType}};tc.create=(t,e)=>new tc({innerType:t,typeName:Z.ZodReadonly,...ke(e)});Lae={object:Wr.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Z||(Z={}));Uae=Va.create,Mae=Uu.create,Fae=Ku.create,Zae=Mu.create,qae=Fu.create,Vae=Zu.create,Bae=qu.create,Hae=Ba.create,Wae=Ha.create,Kae=Vu.create,Gae=to.create,Jae=Qn.create,Xae=Bu.create,Yae=ro.create,RC=Wr.create,Qae=Wr.strictCreate,ece=Wa.create,tce=Rk.create,rce=Ka.create,nce=Pi.create,ice=zk.create,oce=Hu.create,sce=Wu.create,ace=Ck.create,cce=Ga.create,lce=Ja.create,uce=Xa.create,dce=Ya.create,fce=hs.create,pce=Pn.create,hce=On.create,mce=Ai.create,gce=Pn.createWithPreprocess,yce=Km.create});var zC=w(()=>{Bm();Pk();IC();Nu();jC();Vm()});var Gu=w(()=>{zC()});var Nk=w(()=>{fw()});function ei(t){return!!t._zod}function ms(t){let e=Object.values(t);if(e.length===0)return dt({});let r=e.every(ei),i=e.every(n=>!ei(n));if(r)return dt(t);if(i)return RC(t);throw new Error("Mixed Zod versions detected in object shape.")}function no(t,e){return ei(t)?Ks(t,e):t.safeParse(e)}async function Gm(t,e){return ei(t)?await Js(t,e):await t.safeParseAsync(e)}function io(t){if(!t)return;let e;if(ei(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function rc(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let i=Object.values(t);if(i.length>0&&i.every(n=>typeof n=="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse=="function")))return ms(t)}}if(ei(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function cK(t){return t.length===0?"object root":t.reduce((e,r,i)=>i===0?String(r):typeof r=="number"?`${e}[${r}]`:`${e}.${r}`,"")}function Jm(t){if(t&&typeof t=="object"){if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0)return t.issues.map(e=>e.path?.length?`${e.message} at ${cK(e.path)}`:e.message).join(`
|
|
120
|
+
`);if("message"in t&&typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function NC(t){return t.description}function DC(t){if(ei(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function nc(t){if(ei(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let i=t.value;if(i!==void 0)return i}var Ju=w(()=>{Gu();Nk()});var Xm={};Jr(Xm,{endsWith:()=>Bo,gt:()=>bn,gte:()=>gr,includes:()=>qo,length:()=>Vi,lowercase:()=>Fo,lt:()=>_n,lte:()=>mr,maxLength:()=>qi,maxSize:()=>_i,mime:()=>Wo,minLength:()=>Or,minSize:()=>wn,multipleOf:()=>vi,negative:()=>Hl,nonnegative:()=>Kl,nonpositive:()=>Wl,normalize:()=>Ko,overwrite:()=>rn,positive:()=>Bl,properties:()=>Ho,property:()=>Gl,regex:()=>Mo,size:()=>Zi,slugify:()=>fa,startsWith:()=>Vo,toLowerCase:()=>Jo,toUpperCase:()=>Xo,trim:()=>Go,uppercase:()=>Zo});var Ym=w(()=>{Xt()});function Qm(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){let i=r(this);return Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0})}})}var LC,UC,lK,zr,Dk=w(()=>{Xt();Xt();B();LC=new WeakSet([Object.prototype,Error.prototype]);UC=(t,e)=>{Dv.init(t,e),t.name="ZodError";let r=Object.getPrototypeOf(t);LC.has(r)||(LC.add(r),Qm(r,"format",i=>n=>Gc(i,n)),Qm(r,"flatten",i=>n=>Kc(i,n)),Qm(r,"addIssue",i=>n=>{i.issues.push(n),i.message=JSON.stringify(i.issues,Ms,2)}),Qm(r,"addIssues",i=>n=>{i.issues.push(...n),i.message=JSON.stringify(i.issues,Ms,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},lK=$("ZodError",UC),zr=$("ZodError",UC,void 0,{Parent:Error})});var Lk,Uk,Mk,Fk,Zk,qk,Vk,Bk,Hk,Wk,Kk,Gk,Jk=w(()=>{Xt();Dk();Xt();Lk=Bs(zr),Uk=Hs(zr),Mk=Ws(zr),Fk=Gs(zr),Zk=$f(zr),qk=kf(zr),Vk=Sf(zr),Bk=xf(zr),Hk=If(zr),Wk=Ef(zr),Kk=Tf(zr),Gk=Of(zr)});var dc={};Jr(dc,{ZodAny:()=>n0,ZodArray:()=>a0,ZodBase64:()=>gg,ZodBase64URL:()=>yg,ZodBigInt:()=>lc,ZodBigIntFormat:()=>bg,ZodBoolean:()=>cc,ZodCIDRv4:()=>hg,ZodCIDRv6:()=>mg,ZodCUID:()=>ag,ZodCUID2:()=>cg,ZodCatch:()=>I0,ZodCodec:()=>od,ZodCreditCard:()=>Yk,ZodCustom:()=>sd,ZodCustomStringFormat:()=>ys,ZodDate:()=>ed,ZodDefault:()=>b0,ZodDiscriminatedUnion:()=>l0,ZodE164:()=>vg,ZodEmail:()=>ng,ZodEmoji:()=>og,ZodEnum:()=>oc,ZodExactOptional:()=>kg,ZodFile:()=>g0,ZodFunction:()=>N0,ZodGUID:()=>ig,ZodIBAN:()=>Qk,ZodIPv4:()=>fg,ZodIPv6:()=>pg,ZodISODate:()=>so,ZodISODateTime:()=>oo,ZodISODuration:()=>co,ZodISOTime:()=>ao,ZodInstanceOf:()=>U0,ZodIntersection:()=>u0,ZodJWT:()=>_g,ZodKSUID:()=>dg,ZodLazy:()=>j0,ZodLiteral:()=>m0,ZodMAC:()=>Xk,ZodMap:()=>p0,ZodNaN:()=>T0,ZodNanoID:()=>sg,ZodNever:()=>o0,ZodNonOptional:()=>Sg,ZodNull:()=>r0,ZodNullable:()=>_0,ZodNumber:()=>ac,ZodNumberFormat:()=>vs,ZodObject:()=>td,ZodOptional:()=>_s,ZodPipe:()=>id,ZodPrefault:()=>$0,ZodPreprocess:()=>O0,ZodPromise:()=>C0,ZodReadonly:()=>P0,ZodRecord:()=>ic,ZodSet:()=>h0,ZodString:()=>sc,ZodStringFormat:()=>st,ZodSuccess:()=>x0,ZodSymbol:()=>e0,ZodTemplateLiteral:()=>R0,ZodTransform:()=>y0,ZodTuple:()=>d0,ZodType:()=>Se,ZodULID:()=>lg,ZodURL:()=>Yu,ZodUUID:()=>ti,ZodUndefined:()=>t0,ZodUnion:()=>rd,ZodUnknown:()=>i0,ZodVoid:()=>s0,ZodXID:()=>ug,ZodXor:()=>c0,_ZodString:()=>rg,_default:()=>w0,_function:()=>BN,any:()=>IN,array:()=>Pe,base64:()=>sN,base64url:()=>aN,bigint:()=>wN,boolean:()=>Nt,catch:()=>E0,check:()=>HN,cidrv4:()=>iN,cidrv6:()=>oN,codec:()=>FN,creditCard:()=>lN,cuid:()=>JC,cuid2:()=>XC,currencyCode:()=>mN,custom:()=>xg,date:()=>TN,describe:()=>WN,discriminatedUnion:()=>nd,e164:()=>cN,email:()=>MC,emoji:()=>KC,enum:()=>er,exactOptional:()=>v0,file:()=>DN,float32:()=>yN,float64:()=>vN,function:()=>BN,guid:()=>FC,hash:()=>gN,hex:()=>hN,hostname:()=>pN,httpUrl:()=>WC,iban:()=>uN,instanceof:()=>GN,int:()=>eg,int32:()=>_N,int64:()=>$N,intersection:()=>uc,invertCodec:()=>ZN,ipv4:()=>tN,ipv6:()=>nN,json:()=>XN,jwt:()=>dN,keyof:()=>ON,ksuid:()=>eN,lazy:()=>z0,literal:()=>se,looseObject:()=>Qt,looseRecord:()=>jN,mac:()=>rN,map:()=>zN,meta:()=>KN,nan:()=>MN,nanoid:()=>GC,nativeEnum:()=>NN,never:()=>wg,nonoptional:()=>S0,null:()=>Qu,nullable:()=>Xu,nullish:()=>LN,number:()=>Ke,object:()=>K,optional:()=>ot,partialRecord:()=>RN,pipe:()=>tg,prefault:()=>k0,preprocess:()=>ad,promise:()=>VN,readonly:()=>A0,record:()=>at,refine:()=>D0,set:()=>CN,strictObject:()=>PN,string:()=>P,stringFormat:()=>fN,stringbool:()=>JN,success:()=>UN,superRefine:()=>L0,symbol:()=>SN,templateLiteral:()=>qN,transform:()=>$g,tuple:()=>f0,uint32:()=>bN,uint64:()=>kN,ulid:()=>YC,undefined:()=>xN,union:()=>rt,unknown:()=>ct,url:()=>HC,uuid:()=>ZC,uuidv4:()=>qC,uuidv6:()=>VC,uuidv7:()=>BC,void:()=>EN,xid:()=>QC,xor:()=>AN});function dK(){Wt.localeError||Pt(ih())}function gs(){Wt.memoizer||Pt({memoizer:hl()})}function P(t){return yl(sc,t)}function MC(t){return vl(ng,t)}function FC(t){return _l(ig,t)}function ZC(t){return bl(ti,t)}function qC(t){return wl(ti,t)}function VC(t){return $l(ti,t)}function BC(t){return kl(ti,t)}function HC(t){return da(Yu,t)}function WC(t){return da(Yu,{protocol:Jc,hostname:c_,...A.normalizeParams(t)})}function KC(t){return Sl(og,t)}function GC(t){return xl(sg,t)}function JC(t){return Il(ag,t)}function XC(t){return El(cg,t)}function YC(t){return Tl(lg,t)}function QC(t){return Ol(ug,t)}function eN(t){return Pl(dg,t)}function tN(t){return Al(fg,t)}function rN(t){return ph(Xk,t)}function nN(t){return Rl(pg,t)}function iN(t){return jl(hg,t)}function oN(t){return zl(mg,t)}function sN(t){return Cl(gg,t)}function aN(t){return Nl(yg,t)}function cN(t){return Dl(vg,t)}function lN(t){return hh(Yk,t)}function uN(t){return mh(Qk,t)}function dN(t){return Ll(_g,t)}function fN(t,e,r={}){return Bi(ys,t,e,r)}function pN(t){return Bi(ys,"hostname",a_,t)}function hN(t){return Bi(ys,"hex",$_,t)}function mN(t){return Bi(ys,"currency_code",u_,t)}function gN(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=Fr[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Bi(ys,i,n,e)}function Ke(t){return ql(ac,t)}function eg(t){return gh(vs,t)}function yN(t){return yh(vs,t)}function vN(t){return vh(vs,t)}function _N(t){return _h(vs,t)}function bN(t){return bh(vs,t)}function Nt(t){return Vl(cc,t)}function wN(t){return wh(lc,t)}function $N(t){return $h(bg,t)}function kN(t){return kh(bg,t)}function SN(t){return Sh(e0,t)}function xN(t){return xh(t0,t)}function Qu(t){return Ih(r0,t)}function IN(){return Eh(n0)}function ct(){return Th(i0)}function wg(t){return Oh(o0,t)}function EN(t){return Ph(s0,t)}function TN(t){return Ah(ed,t)}function Pe(t,e){return wb(a0,t,e)}function ON(t){let e=t._zod.def.shape;return er(Object.keys(e))}function K(t,e){let r={type:"object",shape:t??{},...A.normalizeParams(e)};return new td(r)}function PN(t,e){return new td({type:"object",shape:t,catchall:wg(),...A.normalizeParams(e)})}function Qt(t,e){return new td({type:"object",shape:t,catchall:ct(),...A.normalizeParams(e)})}function rt(t,e){return new rd({type:"union",options:t,...A.normalizeParams(e)})}function AN(t,e){return new c0({type:"union",options:t,inclusive:!1,...A.normalizeParams(e)})}function nd(t,e,r){return new l0({type:"union",options:e,discriminator:t,...A.normalizeParams(r)})}function uc(t,e){return new u0({type:"intersection",left:t,right:e})}function f0(t,e,r){let i=e instanceof ve,n=i?r:e,o=i?e:null;return new d0({type:"tuple",items:t,rest:o,...A.normalizeParams(n)})}function at(t,e,r){return!e||!e._zod?new ic({type:"record",keyType:P(),valueType:t,...A.normalizeParams(e)}):new ic({type:"record",keyType:t,valueType:e,...A.normalizeParams(r)})}function RN(t,e,r){return new ic({type:"record",keyType:t,valueType:e,...A.normalizeParams(r),partial:!0})}function jN(t,e,r){return new ic({type:"record",keyType:t,valueType:e,mode:"loose",...A.normalizeParams(r)})}function zN(t,e,r){return new p0({type:"map",keyType:t,valueType:e,...A.normalizeParams(r)})}function CN(t,e){return new h0({type:"set",valueType:t,...A.normalizeParams(e)})}function er(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new oc({type:"enum",entries:r,...A.normalizeParams(e)})}function NN(t,e){return new oc({type:"enum",entries:t,...A.normalizeParams(e)})}function se(t,e){return new m0({type:"literal",values:Array.isArray(t)?t:[t],...A.normalizeParams(e)})}function DN(t){return jh(g0,t)}function $g(t){return new y0({type:"transform",transform:t})}function ot(t){return new _s({type:"optional",innerType:t})}function v0(t){return new kg({type:"optional",innerType:t})}function Xu(t){return new _0({type:"nullable",innerType:t})}function LN(t){return ot(Xu(t))}function w0(t,e){return new b0({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():A.shallowClone(e)}})}function k0(t,e){return new $0({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():A.shallowClone(e)}})}function S0(t,e){return new Sg({type:"nonoptional",innerType:t,...A.normalizeParams(e)})}function UN(t){return new x0({type:"success",innerType:t})}function E0(t,e){return new I0({type:"catch",innerType:t,catchValue:typeof e=="function"?e:A.constantCatch(e)})}function MN(t){return Rh(T0,t)}function tg(t,e){return new id({type:"pipe",in:t,out:e})}function FN(t,e,r){return new od({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function ZN(t){let e=t._zod.def;return new od({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function A0(t){return new P0({type:"readonly",innerType:t})}function qN(t,e){return new R0({type:"template_literal",parts:t,...A.normalizeParams(e)})}function z0(t){return new j0({type:"lazy",getter:t})}function VN(t){return new C0({type:"promise",innerType:t})}function BN(t){return new N0({type:"function",input:Array.isArray(t?.input)?f0(t?.input):t?.input??Pe(ct()),output:t?.output??ct()})}function HN(t){let e=new it({check:"custom"});return e._zod.check=t,e}function xg(t,e){return zh(sd,t??(()=>!0),e)}function D0(t,e={}){return Ch(sd,t,e)}function L0(t,e){return Nh(t,e)}function GN(t,e={}){let r=new U0({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...A.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}function XN(t){let e=z0(()=>rt([P(t),Ke(),Nt(),Qu(),Pe(e),at(P(),e)]));return e}function ad(t,e){return new O0({type:"pipe",in:$g(t),out:e})}var Se,rg,sc,st,oo,so,ao,co,ng,ig,ti,Yu,og,sg,ag,cg,lg,ug,dg,fg,Xk,pg,hg,mg,gg,yg,vg,Yk,Qk,_g,ys,ac,vs,cc,lc,bg,e0,t0,r0,n0,i0,o0,s0,ed,a0,td,rd,c0,l0,u0,d0,ic,p0,h0,oc,m0,g0,y0,_s,kg,_0,b0,$0,Sg,x0,I0,T0,id,od,O0,P0,R0,j0,C0,N0,sd,WN,KN,U0,JN,lo=w(()=>{Xt();Xt();ga();jo();Xl();ob();Ym();Jk();Se=$("ZodType",(t,e)=>(dK(),ve.init(t,e),t.def=e,t.type=e.type,t),{check(...t){let e=this.def;return this.clone(A.mergeDefs(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return Be(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(D0(t,e))},superRefine(t,e){return this.check(L0(t,e))},overwrite(t){return this.check(rn(t))},optional(){return ot(this)},exactOptional(){return v0(this)},nullable(){return Xu(this)},nullish(){return ot(Xu(this))},nonoptional(t){return S0(this,t)},array(){return Pe(this)},or(t){return rt([this,t])},and(t){return uc(this,t)},transform(t){return tg(this,$g(t))},default(t){return w0(this,t)},prefault(t){return k0(this,t)},catch(t){return E0(this,t)},pipe(t){return tg(this,t)},readonly(){return A0(this)},describe(t){let e=this.clone();return Jt.add(e,{description:t}),e},meta(...t){if(t.length===0)return Jt.get(this);let e=this.clone();return Jt.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return A.hide(this,"~standard",{...Zf(this),jsonSchema:{input:pa(this,"input"),output:pa(this,"output")}})},set"~standard"(t){A.own(this,"~standard",t)},parse:function t(e,r){return Lk(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await Uk(this,e,r,{callee:t})},safeParse(t,e){return Mk(this,t,e)},async safeParseAsync(t,e){return Fk(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){A.own(this,"spa",t)},validate(t,e){return Xs(this,t,e)},validateAsync(t,e){return Ys(this,t,e)},encode:function t(e,r){return Zk(this,e,r,{callee:t})},decode:function t(e,r){return qk(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await Vk(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await Bk(this,e,r,{callee:t})},safeEncode(t,e){return Hk(this,t,e)},safeDecode(t,e){return Wk(this,t,e)},async safeEncodeAsync(t,e){return Kk(this,t,e)},async safeDecodeAsync(t,e){return Gk(this,t,e)},toJSONSchema(t){return kb(this,{})(t)},get description(){return Jt.get(this)?.description},get _def(){return this._zod.def}}),rg=$("_ZodString",(t,e)=>{yi.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ib(t,r,i,n)},A.derived({format:t=>Vt(t).format??null,minLength:t=>Vt(t).minimum??null,maxLength:t=>Vt(t).maximum??null},{regex(...t){return this.check(Mo(...t))},includes(...t){return this.check(qo(...t))},startsWith(...t){return this.check(Vo(...t))},endsWith(...t){return this.check(Bo(...t))},min(...t){return this.check(Or(...t))},max(...t){return this.check(qi(...t))},length(...t){return this.check(Vi(...t))},nonempty(...t){return this.check(Or(1,...t))},lowercase(t){return this.check(Fo(t))},uppercase(t){return this.check(Zo(t))},trim(){return this.check(Go())},normalize(...t){return this.check(Ko(...t))},toLowerCase(){return this.check(Jo())},toUpperCase(){return this.check(Xo())},slugify(){return this.check(fa())}})),sc=$("ZodString",(t,e)=>{yi.init(t,e),rg.init(t,e)},{email(t){return this.check(vl(ng,t))},url(t){return this.check(da(Yu,t))},jwt(t){return this.check(Ll(_g,t))},emoji(t){return this.check(Sl(og,t))},guid(t){return this.check(_l(ig,t))},uuid(t){return this.check(bl(ti,t))},uuidv4(t){return this.check(wl(ti,t))},uuidv6(t){return this.check($l(ti,t))},uuidv7(t){return this.check(kl(ti,t))},nanoid(t){return this.check(xl(sg,t))},cuid(t){return this.check(Il(ag,t))},cuid2(t){return this.check(El(cg,t))},ulid(t){return this.check(Tl(lg,t))},base64(t){return this.check(Cl(gg,t))},base64url(t){return this.check(Nl(yg,t))},xid(t){return this.check(Ol(ug,t))},ksuid(t){return this.check(Pl(dg,t))},ipv4(t){return this.check(Al(fg,t))},ipv6(t){return this.check(Rl(pg,t))},cidrv4(t){return this.check(jl(hg,t))},cidrv6(t){return this.check(zl(mg,t))},e164(t){return this.check(Dl(vg,t))},datetime(t){return this.check(Ul(oo,t))},date(t){return this.check(Ml(so,t))},time(t){return this.check(Fl(ao,t))},duration(t){return this.check(Zl(co,t))}});st=$("ZodStringFormat",(t,e)=>{Xe.init(t,e),rg.init(t,e)}),oo=$("ZodISODateTime",(t,e)=>{G_.init(t,e),st.init(t,e)}),so=$("ZodISODate",(t,e)=>{J_.init(t,e),st.init(t,e)}),ao=$("ZodISOTime",(t,e)=>{X_.init(t,e),st.init(t,e)}),co=$("ZodISODuration",(t,e)=>{Y_.init(t,e),st.init(t,e)}),ng=$("ZodEmail",(t,e)=>{Bf.init(t,e),st.init(t,e)});ig=$("ZodGUID",(t,e)=>{qf.init(t,e),st.init(t,e)});ti=$("ZodUUID",(t,e)=>{Vf.init(t,e),st.init(t,e)});Yu=$("ZodURL",(t,e)=>{Gf.init(t,e),st.init(t,e)});og=$("ZodEmoji",(t,e)=>{Jf.init(t,e),st.init(t,e)});sg=$("ZodNanoID",(t,e)=>{Xf.init(t,e),st.init(t,e)});ag=$("ZodCUID",(t,e)=>{Yf.init(t,e),st.init(t,e)});cg=$("ZodCUID2",(t,e)=>{Qf.init(t,e),st.init(t,e)});lg=$("ZodULID",(t,e)=>{ep.init(t,e),st.init(t,e)});ug=$("ZodXID",(t,e)=>{tp.init(t,e),st.init(t,e)});dg=$("ZodKSUID",(t,e)=>{rp.init(t,e),st.init(t,e)});fg=$("ZodIPv4",(t,e)=>{np.init(t,e),st.init(t,e)});Xk=$("ZodMAC",(t,e)=>{op.init(t,e),st.init(t,e)});pg=$("ZodIPv6",(t,e)=>{ip.init(t,e),st.init(t,e)});hg=$("ZodCIDRv4",(t,e)=>{sp.init(t,e),st.init(t,e)});mg=$("ZodCIDRv6",(t,e)=>{cp.init(t,e),st.init(t,e)});gg=$("ZodBase64",(t,e)=>{up.init(t,e),st.init(t,e)});yg=$("ZodBase64URL",(t,e)=>{fp.init(t,e),st.init(t,e)});vg=$("ZodE164",(t,e)=>{pp.init(t,e),st.init(t,e)});Yk=$("ZodCreditCard",(t,e)=>{mp.init(t,e),st.init(t,e)});Qk=$("ZodIBAN",(t,e)=>{yp.init(t,e),st.init(t,e)});_g=$("ZodJWT",(t,e)=>{_p.init(t,e),st.init(t,e)});ys=$("ZodCustomStringFormat",(t,e)=>{bp.init(t,e),st.init(t,e)});ac=$("ZodNumber",(t,e)=>{ta.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Eb(t,r,i,n),t.isFinite=!0},A.derived({minValue:t=>{let{minimum:e,exclusiveMinimum:r}=Vt(t);return Math.max(e??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:t=>{let{maximum:e,exclusiveMaximum:r}=Vt(t);return Math.min(e??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:t=>{let{isInt:e,multipleOf:r}=Vt(t);return!!e||!!r?.some(Number.isSafeInteger)},format:t=>Vt(t).format??null},{gt(t,e){return this.check(bn(t,e))},gte(t,e){return this.check(gr(t,e))},min(t,e){return this.check(gr(t,e))},lt(t,e){return this.check(_n(t,e))},lte(t,e){return this.check(mr(t,e))},max(t,e){return this.check(mr(t,e))},int(t){return this.check(eg(t))},safe(t){return this.check(eg(t))},positive(t){return this.check(bn(0,t))},nonnegative(t){return this.check(gr(0,t))},negative(t){return this.check(_n(0,t))},nonpositive(t){return this.check(mr(0,t))},multipleOf(t,e){return this.check(vi(t,e))},step(t,e){return this.check(vi(t,e))},finite(){return this}}));vs=$("ZodNumberFormat",(t,e)=>{wp.init(t,e),ac.init(t,e)});cc=$("ZodBoolean",(t,e)=>{Co.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tb(t,r,i,n)});lc=$("ZodBigInt",(t,e)=>{ol.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ob(t,r,i,n)},A.derived({minValue:t=>Vt(t).minimum??null,maxValue:t=>Vt(t).maximum??null,format:t=>Vt(t).format??null},{gte(t,e){return this.check(gr(t,e))},min(t,e){return this.check(gr(t,e))},gt(t,e){return this.check(bn(t,e))},lt(t,e){return this.check(_n(t,e))},lte(t,e){return this.check(mr(t,e))},max(t,e){return this.check(mr(t,e))},positive(t){return this.check(bn(BigInt(0),t))},negative(t){return this.check(_n(BigInt(0),t))},nonpositive(t){return this.check(mr(BigInt(0),t))},nonnegative(t){return this.check(gr(BigInt(0),t))},multipleOf(t,e){return this.check(vi(t,e))}}));bg=$("ZodBigIntFormat",(t,e)=>{$p.init(t,e),lc.init(t,e)});e0=$("ZodSymbol",(t,e)=>{kp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pb(t,r,i,n)});t0=$("ZodUndefined",(t,e)=>{Sp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rb(t,r,i,n)});r0=$("ZodNull",(t,e)=>{xp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ab(t,r,i,n)});n0=$("ZodAny",(t,e)=>{Ip.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cb(t,r,i,n)});i0=$("ZodUnknown",(t,e)=>{Ep.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Nb(t,r,i,n)});o0=$("ZodNever",(t,e)=>{Tp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zb(t,r,i,n)});s0=$("ZodVoid",(t,e)=>{Op.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>jb(t,r,i,n)});ed=$("ZodDate",(t,e)=>{Pp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Db(t,r,i,n),t.min=(r,i)=>t.check(gr(r,i)),t.max=(r,i)=>t.check(mr(r,i))},A.derived({minDate:t=>{let{minimum:e}=Vt(t);return e?new Date(e):null},maxDate:t=>{let{maximum:e}=Vt(t);return e?new Date(e):null}},{}));a0=$("ZodArray",(t,e)=>{gs(),sl.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Gb(t,r,i,n),t.element=e.element},{min(t,e){return this.check(Or(t,e))},nonempty(t){return this.check(Or(1,t))},max(t,e){return this.check(qi(t,e))},length(t,e){return this.check(Vi(t,e))},unwrap(){return this.element}});td=$("ZodObject",(t,e)=>{gs(),Q_.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Jb(t,r,i,n),A.installLazyProp(t,"shape",r=>r._zod.def.shape,!1)},{keyof(){return er(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(A.mergeDefs(this._zod.def,{catchall:t}))},passthrough(){return this.clone(A.mergeDefs(this._zod.def,{catchall:ct()}))},loose(){return this.clone(A.mergeDefs(this._zod.def,{catchall:ct()}))},strict(){return this.clone(A.mergeDefs(this._zod.def,{catchall:wg()}))},strip(){return this.clone(A.mergeDefs(this._zod.def,{catchall:void 0}))},extend(t){return A.extend(this,t)},safeExtend(t){return A.safeExtend(this,t)},merge(t){return A.merge(this,t)},pick(t){return A.pick(this,t)},omit(t){return A.omit(this,t)},partial(...t){return A.partial(_s,this,t[0])},exactPartial(...t){return A.partial(kg,this,t[0],"exactPartial")},required(...t){return A.required(Sg,this,t[0])}});rd=$("ZodUnion",(t,e)=>{ra.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fh(t,r,i,n),t.options=e.options});c0=$("ZodXor",(t,e)=>{rd.init(t,e),Rp.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fh(t,r,i,n),t.options=e.options});l0=$("ZodDiscriminatedUnion",(t,e)=>{rd.init(t,e),al.init(t,e)});u0=$("ZodIntersection",(t,e)=>{jp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Xb(t,r,i,n)});d0=$("ZodTuple",(t,e)=>{gs(),cl.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Yb(t,r,i,n)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map(e=>new _s({type:"optional",innerType:e}))})}});ic=$("ZodRecord",(t,e)=>{gs(),zp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Qb(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});p0=$("ZodMap",(t,e)=>{gs(),Cp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Wb(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(wn(...r)),t.nonempty=r=>t.check(wn(1,r)),t.max=(...r)=>t.check(_i(...r)),t.size=(...r)=>t.check(Zi(...r))});h0=$("ZodSet",(t,e)=>{gs(),Np.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Kb(t,r,i,n),t.min=(...r)=>t.check(wn(...r)),t.nonempty=r=>t.check(wn(1,r)),t.max=(...r)=>t.check(_i(...r)),t.size=(...r)=>t.check(Zi(...r))});oc=$("ZodEnum",(t,e)=>{ll.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Lb(t,i,n,o),t.enum=e.entries,t.options=[...t._zod.values];let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new oc({...e,checks:[],...A.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new oc({...e,checks:[],...A.normalizeParams(n),entries:o})}});m0=$("ZodLiteral",(t,e)=>{ul.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ub(t,r,i,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});g0=$("ZodFile",(t,e)=>{Dp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zb(t,r,i,n),t.min=(r,i)=>t.check(wn(r,i)),t.max=(r,i)=>t.check(_i(r,i)),t.mime=(r,i)=>t.check(Wo(Array.isArray(r)?r:[r],i))});y0=$("ZodTransform",(t,e)=>{gs(),Lp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Hb(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Fi(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(A.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=t),r.issues.push(A.issue(s))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});_s=$("ZodOptional",(t,e)=>{na.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zh(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});kg=$("ZodExactOptional",(t,e)=>{Up.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zh(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});_0=$("ZodNullable",(t,e)=>{Mp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ew(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});b0=$("ZodDefault",(t,e)=>{Fp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});$0=$("ZodPrefault",(t,e)=>{Zp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>iw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});Sg=$("ZodNonOptional",(t,e)=>{qp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});x0=$("ZodSuccess",(t,e)=>{Vp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>qb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});I0=$("ZodCatch",(t,e)=>{Bp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ow(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});T0=$("ZodNaN",(t,e)=>{Hp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mb(t,r,i,n)});id=$("ZodPipe",(t,e)=>{dl.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sw(t,r,i,n),t.in=e.in,t.out=e.out});od=$("ZodCodec",(t,e)=>{id.init(t,e),ia.init(t,e)});O0=$("ZodPreprocess",(t,e)=>{id.init(t,e),tb.init(t,e)}),P0=$("ZodReadonly",(t,e)=>{Wp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>aw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});R0=$("ZodTemplateLiteral",(t,e)=>{Kp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fb(t,r,i,n)});j0=$("ZodLazy",(t,e)=>{oa.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lw(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});C0=$("ZodPromise",(t,e)=>{Jp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>cw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});N0=$("ZodFunction",(t,e)=>{Gp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Bb(t,r,i,n)});sd=$("ZodCustom",(t,e)=>{Xp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vb(t,r,i,n)});WN=Dh,KN=Lh,U0=$("ZodInstanceOf",(t,e)=>{sd.init(t,e)},{properties(t,e){return this.check(Ho(t,e))}});JN=(...t)=>Uh({Codec:od,Boolean:cc,String:sc},...t)});function pK(t){Pt({customError:t})}function hK(){return Pt().customError}var fK,M0,YN=w(()=>{Xt();fK={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"};M0||(M0={})});var bs={};Jr(bs,{ZodISODate:()=>so,ZodISODateTime:()=>oo,ZodISODuration:()=>co,ZodISOTime:()=>ao,date:()=>gK,datetime:()=>mK,duration:()=>vK,time:()=>yK});function mK(t){return Ul(oo,t)}function gK(t){return Ml(so,t)}function yK(t){return Fl(ao,t)}function vK(t){return Zl(co,t)}var Ig=w(()=>{Xt();lo();lo()});function bK(t,e){let r=t.$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":e??"draft-2020-12"}function QN(t,e){return t.map((r,i)=>i<e?r:r.optional())}function wK(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function $K(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1]===void 0?void 0:wK(r[1]);if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function kK(t,e){return W.transform(i=>i).check(i=>{let n=i.value;if(typeof n!="object"||n===null||Array.isArray(n))return;let o=Object.getOwnPropertyNames(n);if(e.minProperties!==void 0&&o.length<e.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:e.minProperties,inclusive:!0,message:`Too small: expected object to have >=${e.minProperties} properties`,input:n,inst:t,continue:!0}),e.maxProperties!==void 0&&o.length>e.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:e.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${e.maxProperties} properties`,input:n,inst:t,continue:!0}),e.keySchema)for(let s of o){let a=e.keySchema.safeParse(s);a.success||i.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(t)}function F0(t,e){if(t===null)return"z";let r=typeof t;if(r!=="object"){if(r==="number"&&Number.isNaN(t))return null;let i=String(t);return`${r[0]}${i.length}:${i}`}if(e.has(t))return null;e.add(t);try{if(Array.isArray(t)){let o=[];for(let s of t){let a=F0(s,e);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(t).sort(),n=[];for(let o of i){let s=F0(t[o],e);if(s===null)return null;n.push(`${o.length}:${o}=${s}`)}return`o${n.length}:{${n.join(",")}}`}finally{e.delete(t)}}function cd(t){return typeof t!="object"||t===null?!1:Array.isArray(t)?t.some(cd):typeof t.$ref=="string"?!0:Object.entries(t).some(([e,r])=>SK.has(e)?cd(r):!xK.has(e)||typeof r!="object"||r===null?!1:Object.values(r).some(cd))}function eD(t){return t===1?"element":"elements"}function IK(t,e){return W.transform(i=>i).check(i=>{let n=i.value;if(Array.isArray(n)){if(e.uniqueItems===!0){let o=new Map;for(let s=0;s<n.length;s++){let a=F0(n[s],new Set);if(a===null)continue;let c=o.get(a);if(c===void 0){o.set(a,s);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:n,path:[s],continue:!0})}}if(e.containsSchema){let o=e.minContains??1,s=e.maxContains!==void 0?e.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of n)if(e.containsSchema.safeParse(c).success&&++a>=s)break;a<o&&i.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${eD(o)}; found ${a}`,input:n,continue:!0}),e.maxContains!==void 0&&a>e.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${e.maxContains} matching ${eD(e.maxContains)}`,input:n,continue:!0})}}}).pipe(t)}function tD(t,e){if(t!==!1)return t===void 0||t===!0?W.any():wr(t,e)}function rD(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return W.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return W.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=$K(n,e),s=wr(o,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return W.null();if(n.length===0)return W.never();if(n.length===1)return W.literal(n[0]);if(n.every(s=>typeof s=="string"))return W.enum(n);let o=n.map(s=>W.literal(s));return o.length<2?o[0]:W.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return W.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...t,type:o};return rD(s,e)});return n.length===0?W.never():n.length===1?n[0]:W.union(n)}if(!r)return W.any();let i;switch(r){case"string":{let n=W.string();if(t.format){let o=t.format;o==="email"?n=n.check(W.email()):o==="uri"||o==="uri-reference"?n=n.check(W.url()):o==="uuid"||o==="guid"?n=n.check(W.uuid()):o==="date-time"?n=n.check(W.iso.datetime({offset:!0})):o==="date"?n=n.check(W.iso.date()):o==="time"?n=n.check(W.regex(EK)):o==="duration"?n=n.check(W.iso.duration()):o==="hostname"?n=n.check(W.hostname()):o==="ipv4"?n=n.check(W.ipv4()):o==="ipv6"?n=n.check(W.ipv6()):o==="mac"?n=n.check(W.mac()):o==="cidr"?n=n.check(W.cidrv4()):o==="cidr-v6"?n=n.check(W.cidrv6()):o==="base64"?n=n.check(W.base64()):o==="base64url"?n=n.check(W.base64url()):o==="e164"?n=n.check(W.e164()):o==="credit_card"?n=n.check(W.creditCard()):o==="iban"?n=n.check(W.iban()):o==="jwt"?n=n.check(W.jwt()):o==="emoji"?n=n.check(W.emoji()):o==="nanoid"?n=n.check(W.nanoid()):o==="cuid"?n=n.check(W.cuid()):o==="cuid2"?n=n.check(W.cuid2()):o==="ulid"?n=n.check(W.ulid()):o==="xid"?n=n.check(W.xid()):o==="ksuid"&&(n=n.check(W.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?W.number().int():W.number();typeof t.minimum=="number"&&t.exclusiveMinimum!==!0&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&t.exclusiveMaximum!==!0&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=W.boolean();break}case"null":{i=W.null();break}case"object":{let n={},o=t.properties||{},s=new Set(t.required||[]),a=typeof t.additionalProperties=="object"?wr(t.additionalProperties,e):void 0;for(let[d,p]of Object.entries(o)){let f=wr(p,e);Gt(n,d,s.has(d)?f:f.optional())}if(t.patternProperties){let d=t.patternProperties,p=Object.keys(d),f=[];for(let m of p){let g=wr(d[m],e),y=W.string().regex(new RegExp(m));f.push(W.looseRecord(y,g))}let h=[];if(Object.keys(n).length>0&&h.push(W.object(n).passthrough()),h.push(...f),h.length===0)i=W.object({}).passthrough();else if(h.length===1)i=h[0];else{let m=W.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)m=W.intersection(m,h[g]);i=m}if(t.additionalProperties===!1){let m=Object.keys(n),g=p.map(v=>new RegExp(v)),y=i;i=i.check(v=>{if(!en(v.value))return;let b=[];for(let x of Object.keys(v.value))m.includes(x)||g.some(k=>k.test(x))||b.push(x);b.length&&v.issues.push({code:"unrecognized_keys",keys:b,input:v.value,inst:y})})}}else{let d=W.object(n);t.additionalProperties===!1?i=d.strict():a?i=d.catchall(a):i=d.passthrough()}let c=t.propertyNames!==void 0&&t.propertyNames!==!0,l=typeof t.minProperties=="number"?t.minProperties:void 0,u=typeof t.maxProperties=="number"?t.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let p=typeof t.propertyNames=="object"&&t.propertyNames.type===void 0?{type:"string",...t.propertyNames}:t.propertyNames;d=wr(p,e)}i=kK(i,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let s=typeof t.minItems=="number"?t.minItems:0,a=n.map(d=>wr(d,e)),c=QN(a,s),l=Array.isArray(o)?void 0:tD(o,e),u=W.tuple(c);i=l?u.rest(l):u,typeof t.minItems=="number"&&(i=i.check(W.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(W.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=typeof t.minItems=="number"?t.minItems:0,a=o.map(d=>wr(d,e)),c=QN(a,s),l=tD(t.additionalItems,e),u=W.tuple(c);i=l?u.rest(l):u,typeof t.minItems=="number"&&(i=i.check(W.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(W.maxLength(t.maxItems)))}else if(o!==void 0){let s=wr(o,e),a=W.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=W.array(W.any());(t.uniqueItems===!0||t.contains!==void 0)&&(i=IK(i,{uniqueItems:t.uniqueItems===!0,containsSchema:t.contains!==void 0?wr(t.contains,e):void 0,minContains:typeof t.minContains=="number"?t.minContains:void 0,maxContains:typeof t.maxContains=="number"?t.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return i}function wr(t,e){if(typeof t=="boolean")return t?W.any():W.never();let r=rD(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>wr(l,e)),c=W.union(a);r=i?W.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>wr(l,e)),c=W.xor(a);r=i?W.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:W.any();else{let a=i?r:wr(t.allOf[0],e),c=i?0:1;for(let l=c;l<t.allOf.length;l++)a=W.intersection(a,wr(t.allOf[l],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=W.nullable(r)),t.readOnly===!0&&(r=W.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(n[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(n[a]=t[a]);if(t.type==="object"&&t.$ref===void 0){t.propertyNames!==void 0&&!cd(t.propertyNames)&&(n.propertyNames=t.propertyNames);for(let a of["minProperties","maxProperties"])t[a]!==void 0&&(n[a]=t[a])}if(t.type==="array"&&t.$ref===void 0){t.contains!==void 0&&!cd(t.contains)&&(n.contains=t.contains);for(let a of["uniqueItems","minContains","maxContains"])t[a]!==void 0&&(n[a]=t[a])}for(let a of Object.keys(t))_K.has(a)||Gt(n,a,t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function nD(t,e){if(typeof t=="boolean")return t?W.any():W.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=bK(r,e?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Jt};return wr(r,o)}var W,_K,SK,xK,EK,iD=w(()=>{gl();B();Ym();Ig();lo();W={...dc,...Xm,iso:bs},_K=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"]);SK=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),xK=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);EK=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function oD(t){return eu(t,{object:e=>e.partial(),union:e=>{let r=e._zod.def;return r.discriminator===void 0?e:rt(r.options)}})}var sD=w(()=>{dw();lo()});function TK(t,e){if(!e?.length)return t;let r=t._zod.def;return Be(t,Qr(r,{checks:[...r.checks??[],...e]}),{parent:!0})}function aD(t){return TK(t.out,t.checks)}function OK(t){return t.in._zod.traits.has("$ZodTransform")?aD(t):t.in}function cD(t){return eu(t,{pipe:e=>OK(e._zod.def),default:(e,r)=>r?ot(e._zod.def.innerType):e,catch:(e,r)=>r?e._zod.def.innerType:e})}function lD(t){return eu(t,{pipe:e=>aD(e._zod.def),prefault:(e,r)=>r?e._zod.def.innerType:e})}var uD=w(()=>{B();dw();lo()});var Z0={};Jr(Z0,{bigint:()=>jK,boolean:()=>RK,date:()=>zK,number:()=>AK,string:()=>PK});function PK(t){return mb(sc,t)}function AK(t){return yb(ac,t)}function RK(t){return vb(cc,t)}function jK(t){return _b(lc,t)}function zK(t){return bb(ed,t)}var dD=w(()=>{Xt();lo()});var yt={};Jr(yt,{$brand:()=>zv,$input:()=>lb,$output:()=>cb,INVALID:()=>hr,NEVER:()=>jv,TimePrecision:()=>gb,ZodAny:()=>n0,ZodArray:()=>a0,ZodBase64:()=>gg,ZodBase64URL:()=>yg,ZodBigInt:()=>lc,ZodBigIntFormat:()=>bg,ZodBoolean:()=>cc,ZodCIDRv4:()=>hg,ZodCIDRv6:()=>mg,ZodCUID:()=>ag,ZodCUID2:()=>cg,ZodCatch:()=>I0,ZodCodec:()=>od,ZodCompileAsyncError:()=>vn,ZodCompileUnsupportedError:()=>je,ZodCreditCard:()=>Yk,ZodCustom:()=>sd,ZodCustomStringFormat:()=>ys,ZodDate:()=>ed,ZodDefault:()=>b0,ZodDiscriminatedUnion:()=>l0,ZodE164:()=>vg,ZodEmail:()=>ng,ZodEmoji:()=>og,ZodEnum:()=>oc,ZodError:()=>lK,ZodExactOptional:()=>kg,ZodFile:()=>g0,ZodFirstPartyTypeKind:()=>M0,ZodFunction:()=>N0,ZodGUID:()=>ig,ZodIBAN:()=>Qk,ZodIPv4:()=>fg,ZodIPv6:()=>pg,ZodISODate:()=>so,ZodISODateTime:()=>oo,ZodISODuration:()=>co,ZodISOTime:()=>ao,ZodInstanceOf:()=>U0,ZodIntersection:()=>u0,ZodIssueCode:()=>fK,ZodJWT:()=>_g,ZodKSUID:()=>dg,ZodLazy:()=>j0,ZodLiteral:()=>m0,ZodMAC:()=>Xk,ZodMap:()=>p0,ZodNaN:()=>T0,ZodNanoID:()=>sg,ZodNever:()=>o0,ZodNonOptional:()=>Sg,ZodNull:()=>r0,ZodNullable:()=>_0,ZodNumber:()=>ac,ZodNumberFormat:()=>vs,ZodObject:()=>td,ZodOptional:()=>_s,ZodPipe:()=>id,ZodPrefault:()=>$0,ZodPreprocess:()=>O0,ZodPromise:()=>C0,ZodReadonly:()=>P0,ZodRealError:()=>zr,ZodRecord:()=>ic,ZodSet:()=>h0,ZodString:()=>sc,ZodStringFormat:()=>st,ZodSuccess:()=>x0,ZodSymbol:()=>e0,ZodTemplateLiteral:()=>R0,ZodTransform:()=>y0,ZodTuple:()=>d0,ZodType:()=>Se,ZodULID:()=>lg,ZodURL:()=>Yu,ZodUUID:()=>ti,ZodUndefined:()=>t0,ZodUnion:()=>rd,ZodUnknown:()=>i0,ZodVoid:()=>s0,ZodXID:()=>ug,ZodXor:()=>c0,_ZodString:()=>rg,_default:()=>w0,_function:()=>BN,any:()=>IN,array:()=>Pe,base64:()=>sN,base64url:()=>aN,bigint:()=>wN,boolean:()=>Nt,catch:()=>E0,check:()=>HN,cidrv4:()=>iN,cidrv6:()=>oN,clone:()=>Be,codec:()=>FN,coerce:()=>Z0,compile:()=>pb,config:()=>Pt,core:()=>$n,creditCard:()=>lN,cuid:()=>JC,cuid2:()=>XC,currencyCode:()=>mN,custom:()=>xg,date:()=>TN,decode:()=>qk,decodeAsync:()=>Bk,deepPartial:()=>oD,describe:()=>WN,discriminatedUnion:()=>nd,e164:()=>cN,email:()=>MC,emoji:()=>KC,encode:()=>Zk,encodeAsync:()=>Vk,endsWith:()=>Bo,enum:()=>er,exactOptional:()=>v0,file:()=>DN,flattenError:()=>Kc,float32:()=>yN,float64:()=>vN,formatError:()=>Gc,fromJSONSchema:()=>nD,function:()=>BN,getDiscriminatedOption:()=>eb,getErrorMap:()=>hK,globalRegistry:()=>Jt,gt:()=>bn,gte:()=>gr,guid:()=>FC,hash:()=>gN,hex:()=>hN,hostname:()=>pN,httpUrl:()=>WC,iban:()=>uN,includes:()=>qo,input:()=>cD,instanceof:()=>GN,int:()=>eg,int32:()=>_N,int64:()=>$N,intersection:()=>uc,invertCodec:()=>ZN,ipv4:()=>tN,ipv6:()=>nN,iso:()=>bs,json:()=>XN,jwt:()=>dN,keyof:()=>ON,ksuid:()=>eN,lazy:()=>z0,length:()=>Vi,literal:()=>se,locales:()=>la,looseObject:()=>Qt,looseRecord:()=>jN,lowercase:()=>Fo,lt:()=>_n,lte:()=>mr,mac:()=>rN,map:()=>zN,maxLength:()=>qi,maxSize:()=>_i,memoizer:()=>hl,meta:()=>KN,mime:()=>Wo,minLength:()=>Or,minSize:()=>wn,multipleOf:()=>vi,nan:()=>MN,nanoid:()=>GC,nativeEnum:()=>NN,negative:()=>Hl,never:()=>wg,nonnegative:()=>Kl,nonoptional:()=>S0,nonpositive:()=>Wl,normalize:()=>Ko,null:()=>Qu,nullable:()=>Xu,nullish:()=>LN,number:()=>Ke,object:()=>K,optional:()=>ot,output:()=>lD,overwrite:()=>rn,parse:()=>Lk,parseAsync:()=>Uk,partialRecord:()=>RN,pipe:()=>tg,positive:()=>Bl,prefault:()=>k0,preprocess:()=>ad,prettifyError:()=>Uv,promise:()=>VN,properties:()=>Ho,property:()=>Gl,readonly:()=>A0,record:()=>at,refine:()=>D0,regex:()=>Mo,regexes:()=>Fr,registry:()=>lh,safeDecode:()=>Wk,safeDecodeAsync:()=>Gk,safeEncode:()=>Hk,safeEncodeAsync:()=>Kk,safeParse:()=>Mk,safeParseAsync:()=>Fk,set:()=>CN,setErrorMap:()=>pK,size:()=>Zi,slugify:()=>fa,startsWith:()=>Vo,strictObject:()=>PN,string:()=>P,stringFormat:()=>fN,stringbool:()=>JN,success:()=>UN,superRefine:()=>L0,symbol:()=>SN,templateLiteral:()=>qN,toJSONSchema:()=>Yo,toLowerCase:()=>Jo,toUpperCase:()=>Xo,toZod:()=>Mc,transform:()=>$g,treeifyError:()=>Lv,trim:()=>Go,tuple:()=>f0,uint32:()=>bN,uint64:()=>kN,ulid:()=>YC,undefined:()=>xN,union:()=>rt,unknown:()=>ct,uppercase:()=>Zo,url:()=>HC,util:()=>A,uuid:()=>ZC,uuidv4:()=>qC,uuidv6:()=>VC,uuidv7:()=>BC,validate:()=>Xs,validateAsync:()=>Ys,void:()=>EN,withParser:()=>uh,xid:()=>QC,xor:()=>AN});var Eg=w(()=>{Xt();lo();Ym();Dk();Jk();YN();Xt();ga();iD();sD();uD();ah();Ig();Ig();dD()});var fD=w(()=>{Eg()});var pD=w(()=>{fD()});function PD(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function AD(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var V0,hD,uo,Og,Bt,mD,gD,cle,NK,DK,B0,Kr,ld,yD,tr,ln,un,rr,Pg,vD,H0,_D,bD,W0,ud,ae,K0,wD,$D,lle,Ag,LK,Rg,UK,dd,fc,kD,MK,FK,ZK,qK,VK,BK,G0,HK,WK,J0,jg,KK,GK,zg,JK,fd,pd,XK,hd,pc,YK,md,Cg,Ng,Dg,ule,Lg,Ug,Mg,SD,xD,ID,X0,ED,gd,hc,TD,QK,Fg,eG,Zg,tG,Y0,rG,qg,nG,iG,oG,sG,aG,cG,lG,uG,dG,fG,Vg,pG,hG,Bg,Q0,eS,tS,mG,gG,yG,rS,vG,_G,bG,wG,$G,OD,Hg,kG,Wg,dle,SG,mc,xG,fle,yd,IG,nS,EG,TG,OG,PG,AG,RG,jG,Tg,zG,CG,NG,vd,iS,DG,LG,UG,MG,FG,ZG,qG,VG,BG,HG,WG,KG,GG,JG,XG,YG,QG,eJ,gc,tJ,rJ,nJ,Kg,iJ,oJ,sJ,oS,aJ,ple,hle,mle,gle,yle,vle,te,q0,yc=w(()=>{pD();V0="2025-11-25",hD=[V0,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],uo="io.modelcontextprotocol/related-task",Og="2.0",Bt=xg(t=>t!==null&&(typeof t=="object"||typeof t=="function")),mD=rt([P(),Ke().int()]),gD=P(),cle=Qt({ttl:Ke().optional(),pollInterval:Ke().optional()}),NK=K({ttl:Ke().optional()}),DK=K({taskId:P()}),B0=Qt({progressToken:mD.optional(),[uo]:DK.optional()}),Kr=K({_meta:B0.optional()}),ld=Kr.extend({task:NK.optional()}),yD=t=>ld.safeParse(t).success,tr=K({method:P(),params:Kr.loose().optional()}),ln=K({_meta:B0.optional()}),un=K({method:P(),params:ln.loose().optional()}),rr=Qt({_meta:B0.optional()}),Pg=rt([P(),Ke().int()]),vD=K({jsonrpc:se(Og),id:Pg,...tr.shape}).strict(),H0=t=>vD.safeParse(t).success,_D=K({jsonrpc:se(Og),...un.shape}).strict(),bD=t=>_D.safeParse(t).success,W0=K({jsonrpc:se(Og),id:Pg,result:rr}).strict(),ud=t=>W0.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ae||(ae={}));K0=K({jsonrpc:se(Og),id:Pg.optional(),error:K({code:Ke().int(),message:P(),data:ct().optional()})}).strict(),wD=t=>K0.safeParse(t).success,$D=rt([vD,_D,W0,K0]),lle=rt([W0,K0]),Ag=rr.strict(),LK=ln.extend({requestId:Pg.optional(),reason:P().optional()}),Rg=un.extend({method:se("notifications/cancelled"),params:LK}),UK=K({src:P(),mimeType:P().optional(),sizes:Pe(P()).optional(),theme:er(["light","dark"]).optional()}),dd=K({icons:Pe(UK).optional()}),fc=K({name:P(),title:P().optional()}),kD=fc.extend({...fc.shape,...dd.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),MK=uc(K({applyDefaults:Nt().optional()}),at(P(),ct())),FK=ad(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,uc(K({form:MK.optional(),url:Bt.optional()}),at(P(),ct()).optional())),ZK=Qt({list:Bt.optional(),cancel:Bt.optional(),requests:Qt({sampling:Qt({createMessage:Bt.optional()}).optional(),elicitation:Qt({create:Bt.optional()}).optional()}).optional()}),qK=Qt({list:Bt.optional(),cancel:Bt.optional(),requests:Qt({tools:Qt({call:Bt.optional()}).optional()}).optional()}),VK=K({experimental:at(P(),Bt).optional(),sampling:K({context:Bt.optional(),tools:Bt.optional()}).optional(),elicitation:FK.optional(),roots:K({listChanged:Nt().optional()}).optional(),tasks:ZK.optional(),extensions:at(P(),Bt).optional()}),BK=Kr.extend({protocolVersion:P(),capabilities:VK,clientInfo:kD}),G0=tr.extend({method:se("initialize"),params:BK}),HK=K({experimental:at(P(),Bt).optional(),logging:Bt.optional(),completions:Bt.optional(),prompts:K({listChanged:Nt().optional()}).optional(),resources:K({subscribe:Nt().optional(),listChanged:Nt().optional()}).optional(),tools:K({listChanged:Nt().optional()}).optional(),tasks:qK.optional(),extensions:at(P(),Bt).optional()}),WK=rr.extend({protocolVersion:P(),capabilities:HK,serverInfo:kD,instructions:P().optional()}),J0=un.extend({method:se("notifications/initialized"),params:ln.optional()}),jg=tr.extend({method:se("ping"),params:Kr.optional()}),KK=K({progress:Ke(),total:ot(Ke()),message:ot(P())}),GK=K({...ln.shape,...KK.shape,progressToken:mD}),zg=un.extend({method:se("notifications/progress"),params:GK}),JK=Kr.extend({cursor:gD.optional()}),fd=tr.extend({params:JK.optional()}),pd=rr.extend({nextCursor:gD.optional()}),XK=er(["working","input_required","completed","failed","cancelled"]),hd=K({taskId:P(),status:XK,ttl:rt([Ke(),Qu()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:ot(Ke()),statusMessage:ot(P())}),pc=rr.extend({task:hd}),YK=ln.merge(hd),md=un.extend({method:se("notifications/tasks/status"),params:YK}),Cg=tr.extend({method:se("tasks/get"),params:Kr.extend({taskId:P()})}),Ng=rr.merge(hd),Dg=tr.extend({method:se("tasks/result"),params:Kr.extend({taskId:P()})}),ule=rr.loose(),Lg=fd.extend({method:se("tasks/list")}),Ug=pd.extend({tasks:Pe(hd)}),Mg=tr.extend({method:se("tasks/cancel"),params:Kr.extend({taskId:P()})}),SD=rr.merge(hd),xD=K({uri:P(),mimeType:ot(P()),_meta:at(P(),ct()).optional()}),ID=xD.extend({text:P()}),X0=P().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ED=xD.extend({blob:X0}),gd=er(["user","assistant"]),hc=K({audience:Pe(gd).optional(),priority:Ke().min(0).max(1).optional(),lastModified:bs.datetime({offset:!0}).optional()}),TD=K({...fc.shape,...dd.shape,uri:P(),description:ot(P()),mimeType:ot(P()),size:ot(Ke()),annotations:hc.optional(),_meta:ot(Qt({}))}),QK=K({...fc.shape,...dd.shape,uriTemplate:P(),description:ot(P()),mimeType:ot(P()),annotations:hc.optional(),_meta:ot(Qt({}))}),Fg=fd.extend({method:se("resources/list")}),eG=pd.extend({resources:Pe(TD)}),Zg=fd.extend({method:se("resources/templates/list")}),tG=pd.extend({resourceTemplates:Pe(QK)}),Y0=Kr.extend({uri:P()}),rG=Y0,qg=tr.extend({method:se("resources/read"),params:rG}),nG=rr.extend({contents:Pe(rt([ID,ED]))}),iG=un.extend({method:se("notifications/resources/list_changed"),params:ln.optional()}),oG=Y0,sG=tr.extend({method:se("resources/subscribe"),params:oG}),aG=Y0,cG=tr.extend({method:se("resources/unsubscribe"),params:aG}),lG=ln.extend({uri:P()}),uG=un.extend({method:se("notifications/resources/updated"),params:lG}),dG=K({name:P(),description:ot(P()),required:ot(Nt())}),fG=K({...fc.shape,...dd.shape,description:ot(P()),arguments:ot(Pe(dG)),_meta:ot(Qt({}))}),Vg=fd.extend({method:se("prompts/list")}),pG=pd.extend({prompts:Pe(fG)}),hG=Kr.extend({name:P(),arguments:at(P(),P()).optional()}),Bg=tr.extend({method:se("prompts/get"),params:hG}),Q0=K({type:se("text"),text:P(),annotations:hc.optional(),_meta:at(P(),ct()).optional()}),eS=K({type:se("image"),data:X0,mimeType:P(),annotations:hc.optional(),_meta:at(P(),ct()).optional()}),tS=K({type:se("audio"),data:X0,mimeType:P(),annotations:hc.optional(),_meta:at(P(),ct()).optional()}),mG=K({type:se("tool_use"),name:P(),id:P(),input:at(P(),ct()),_meta:at(P(),ct()).optional()}),gG=K({type:se("resource"),resource:rt([ID,ED]),annotations:hc.optional(),_meta:at(P(),ct()).optional()}),yG=TD.extend({type:se("resource_link")}),rS=rt([Q0,eS,tS,yG,gG]),vG=K({role:gd,content:rS}),_G=rr.extend({description:P().optional(),messages:Pe(vG)}),bG=un.extend({method:se("notifications/prompts/list_changed"),params:ln.optional()}),wG=K({title:P().optional(),readOnlyHint:Nt().optional(),destructiveHint:Nt().optional(),idempotentHint:Nt().optional(),openWorldHint:Nt().optional()}),$G=K({taskSupport:er(["required","optional","forbidden"]).optional()}),OD=K({...fc.shape,...dd.shape,description:P().optional(),inputSchema:K({type:se("object"),properties:at(P(),Bt).optional(),required:Pe(P()).optional()}).catchall(ct()),outputSchema:K({type:se("object"),properties:at(P(),Bt).optional(),required:Pe(P()).optional()}).catchall(ct()).optional(),annotations:wG.optional(),execution:$G.optional(),_meta:at(P(),ct()).optional()}),Hg=fd.extend({method:se("tools/list")}),kG=pd.extend({tools:Pe(OD)}),Wg=rr.extend({content:Pe(rS).default([]),structuredContent:at(P(),ct()).optional(),isError:Nt().optional()}),dle=Wg.or(rr.extend({toolResult:ct()})),SG=ld.extend({name:P(),arguments:at(P(),ct()).optional()}),mc=tr.extend({method:se("tools/call"),params:SG}),xG=un.extend({method:se("notifications/tools/list_changed"),params:ln.optional()}),fle=K({autoRefresh:Nt().default(!0),debounceMs:Ke().int().nonnegative().default(300)}),yd=er(["debug","info","notice","warning","error","critical","alert","emergency"]),IG=Kr.extend({level:yd}),nS=tr.extend({method:se("logging/setLevel"),params:IG}),EG=ln.extend({level:yd,logger:P().optional(),data:ct()}),TG=un.extend({method:se("notifications/message"),params:EG}),OG=K({name:P().optional()}),PG=K({hints:Pe(OG).optional(),costPriority:Ke().min(0).max(1).optional(),speedPriority:Ke().min(0).max(1).optional(),intelligencePriority:Ke().min(0).max(1).optional()}),AG=K({mode:er(["auto","required","none"]).optional()}),RG=K({type:se("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:Pe(rS).default([]),structuredContent:K({}).loose().optional(),isError:Nt().optional(),_meta:at(P(),ct()).optional()}),jG=nd("type",[Q0,eS,tS]),Tg=nd("type",[Q0,eS,tS,mG,RG]),zG=K({role:gd,content:rt([Tg,Pe(Tg)]),_meta:at(P(),ct()).optional()}),CG=ld.extend({messages:Pe(zG),modelPreferences:PG.optional(),systemPrompt:P().optional(),includeContext:er(["none","thisServer","allServers"]).optional(),temperature:Ke().optional(),maxTokens:Ke().int(),stopSequences:Pe(P()).optional(),metadata:Bt.optional(),tools:Pe(OD).optional(),toolChoice:AG.optional()}),NG=tr.extend({method:se("sampling/createMessage"),params:CG}),vd=rr.extend({model:P(),stopReason:ot(er(["endTurn","stopSequence","maxTokens"]).or(P())),role:gd,content:jG}),iS=rr.extend({model:P(),stopReason:ot(er(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:gd,content:rt([Tg,Pe(Tg)])}),DG=K({type:se("boolean"),title:P().optional(),description:P().optional(),default:Nt().optional()}),LG=K({type:se("string"),title:P().optional(),description:P().optional(),minLength:Ke().optional(),maxLength:Ke().optional(),format:er(["email","uri","date","date-time"]).optional(),default:P().optional()}),UG=K({type:er(["number","integer"]),title:P().optional(),description:P().optional(),minimum:Ke().optional(),maximum:Ke().optional(),default:Ke().optional()}),MG=K({type:se("string"),title:P().optional(),description:P().optional(),enum:Pe(P()),default:P().optional()}),FG=K({type:se("string"),title:P().optional(),description:P().optional(),oneOf:Pe(K({const:P(),title:P()})),default:P().optional()}),ZG=K({type:se("string"),title:P().optional(),description:P().optional(),enum:Pe(P()),enumNames:Pe(P()).optional(),default:P().optional()}),qG=rt([MG,FG]),VG=K({type:se("array"),title:P().optional(),description:P().optional(),minItems:Ke().optional(),maxItems:Ke().optional(),items:K({type:se("string"),enum:Pe(P())}),default:Pe(P()).optional()}),BG=K({type:se("array"),title:P().optional(),description:P().optional(),minItems:Ke().optional(),maxItems:Ke().optional(),items:K({anyOf:Pe(K({const:P(),title:P()}))}),default:Pe(P()).optional()}),HG=rt([VG,BG]),WG=rt([ZG,qG,HG]),KG=rt([WG,DG,LG,UG]),GG=ld.extend({mode:se("form").optional(),message:P(),requestedSchema:K({type:se("object"),properties:at(P(),KG),required:Pe(P()).optional()})}),JG=ld.extend({mode:se("url"),message:P(),elicitationId:P(),url:P().url()}),XG=rt([GG,JG]),YG=tr.extend({method:se("elicitation/create"),params:XG}),QG=ln.extend({elicitationId:P()}),eJ=un.extend({method:se("notifications/elicitation/complete"),params:QG}),gc=rr.extend({action:er(["accept","decline","cancel"]),content:ad(t=>t===null?void 0:t,at(P(),rt([P(),Ke(),Nt(),Pe(P())])).optional())}),tJ=K({type:se("ref/resource"),uri:P()}),rJ=K({type:se("ref/prompt"),name:P()}),nJ=Kr.extend({ref:rt([rJ,tJ]),argument:K({name:P(),value:P()}),context:K({arguments:at(P(),P()).optional()}).optional()}),Kg=tr.extend({method:se("completion/complete"),params:nJ});iJ=rr.extend({completion:Qt({values:Pe(P()).max(100),total:ot(Ke().int()),hasMore:ot(Nt())})}),oJ=K({uri:P().startsWith("file://"),name:P().optional(),_meta:at(P(),ct()).optional()}),sJ=tr.extend({method:se("roots/list"),params:Kr.optional()}),oS=rr.extend({roots:Pe(oJ)}),aJ=un.extend({method:se("notifications/roots/list_changed"),params:ln.optional()}),ple=rt([jg,G0,Kg,nS,Bg,Vg,Fg,Zg,qg,sG,cG,mc,Hg,Cg,Dg,Lg,Mg]),hle=rt([Rg,zg,J0,aJ,md]),mle=rt([Ag,vd,iS,gc,oS,Ng,Ug,pc]),gle=rt([jg,NG,YG,sJ,Cg,Dg,Lg,Mg]),yle=rt([Rg,zg,TG,uG,iG,xG,bG,md,eJ]),vle=rt([Ag,WK,iJ,_G,pG,eG,tG,nG,Wg,kG,Ng,Ug,pc]),te=class t extends Error{constructor(e,r,i){super(`MCP error ${e}: ${r}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,r,i){if(e===ae.UrlElicitationRequired&&i){let n=i;if(n.elicitations)return new q0(n.elicitations,r)}return new t(e,r,i)}},q0=class extends te{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ae.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function fo(t){return t==="completed"||t==="failed"||t==="cancelled"}var RD=w(()=>{});var zD,jD,CD,Gg=w(()=>{zD=Symbol("Let zodToJsonSchema decide on which parser to use"),jD={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},CD=t=>typeof t=="string"?{...jD,name:t}:{...jD,...t}});var ND,sS=w(()=>{Gg();ND=t=>{let e=CD(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...e.basePath,e.definitionPath,i],jsonSchema:void 0}]))}}});function aS(t,e,r,i){i?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Me(t,e,r,i,n){t[e]=r,aS(t,e,i,n)}var po=w(()=>{});var Jg,Xg=w(()=>{Jg=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")}});function $t(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Jg(e,t.currentPath):e.join("/")}}var dn=w(()=>{Xg()});function DD(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Z.ZodAny&&(r.items=ge(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Me(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Me(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Me(r,"minItems",t.exactLength.value,t.exactLength.message,e),Me(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var cS=w(()=>{Gu();po();Ft()});function LD(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let i of t.checks)switch(i.kind){case"min":e.target==="jsonSchema7"?i.inclusive?Me(r,"minimum",i.value,i.message,e):Me(r,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(r.exclusiveMinimum=!0),Me(r,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?Me(r,"maximum",i.value,i.message,e):Me(r,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(r.exclusiveMaximum=!0),Me(r,"maximum",i.value,i.message,e));break;case"multipleOf":Me(r,"multipleOf",i.value,i.message,e);break}return r}var lS=w(()=>{po()});function UD(){return{type:"boolean"}}var uS=w(()=>{});function Yg(t,e){return ge(t.type._def,e)}var Qg=w(()=>{Ft()});var MD,dS=w(()=>{Ft();MD=(t,e)=>ge(t.innerType._def,e)});function fS(t,e,r){let i=r??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>fS(t,e,n))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return cJ(t,e)}}var cJ,pS=w(()=>{po();cJ=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let i of t.checks)switch(i.kind){case"min":Me(r,"minimum",i.value,i.message,e);break;case"max":Me(r,"maximum",i.value,i.message,e);break}return r}});function FD(t,e){return{...ge(t.innerType._def,e),default:t.defaultValue()}}var hS=w(()=>{Ft()});function ZD(t,e){return e.effectStrategy==="input"?ge(t.schema._def,e):$t(e)}var mS=w(()=>{Ft();dn()});function qD(t){return{type:"string",enum:Array.from(t.values)}}var gS=w(()=>{});function VD(t,e){let r=[ge(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),ge(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),i=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(o=>{if(lJ(o))n.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:a,...c}=o;s=c}else i=void 0;n.push(s)}}),n.length?{allOf:n,...i}:void 0}var lJ,yS=w(()=>{Ft();lJ=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function BD(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var vS=w(()=>{});function ey(t,e){let r={type:"string"};if(t.checks)for(let i of t.checks)switch(i.kind){case"min":Me(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e);break;case"max":Me(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Rn(r,"email",i.message,e);break;case"format:idn-email":Rn(r,"idn-email",i.message,e);break;case"pattern:zod":$r(r,An.email,i.message,e);break}break;case"url":Rn(r,"uri",i.message,e);break;case"uuid":Rn(r,"uuid",i.message,e);break;case"regex":$r(r,i.regex,i.message,e);break;case"cuid":$r(r,An.cuid,i.message,e);break;case"cuid2":$r(r,An.cuid2,i.message,e);break;case"startsWith":$r(r,RegExp(`^${bS(i.value,e)}`),i.message,e);break;case"endsWith":$r(r,RegExp(`${bS(i.value,e)}$`),i.message,e);break;case"datetime":Rn(r,"date-time",i.message,e);break;case"date":Rn(r,"date",i.message,e);break;case"time":Rn(r,"time",i.message,e);break;case"duration":Rn(r,"duration",i.message,e);break;case"length":Me(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e),Me(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"includes":{$r(r,RegExp(bS(i.value,e)),i.message,e);break}case"ip":{i.version!=="v6"&&Rn(r,"ipv4",i.message,e),i.version!=="v4"&&Rn(r,"ipv6",i.message,e);break}case"base64url":$r(r,An.base64url,i.message,e);break;case"jwt":$r(r,An.jwt,i.message,e);break;case"cidr":{i.version!=="v6"&&$r(r,An.ipv4Cidr,i.message,e),i.version!=="v4"&&$r(r,An.ipv6Cidr,i.message,e);break}case"emoji":$r(r,An.emoji(),i.message,e);break;case"ulid":{$r(r,An.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Rn(r,"binary",i.message,e);break}case"contentEncoding:base64":{Me(r,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{$r(r,An.base64,i.message,e);break}}break}case"nanoid":$r(r,An.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function bS(t,e){return e.patternStrategy==="escape"?dJ(t):t}function dJ(t){let e="";for(let r=0;r<t.length;r++)uJ.has(t[r])||(e+="\\"),e+=t[r];return e}function Rn(t,e,r,i){t.format||t.anyOf?.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&i.errorMessages&&{errorMessage:{format:r}}})):Me(t,"format",e,r,i)}function $r(t,e,r,i){t.pattern||t.allOf?.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:HD(e,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):Me(t,"pattern",HD(e,i),r,i)}function HD(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source,n="",o=!1,s=!1,a=!1;for(let c=0;c<i.length;c++){if(o){n+=i[c],o=!1;continue}if(r.i){if(s){if(i[c].match(/[a-z]/)){a?(n+=i[c],n+=`${i[c-2]}-${i[c]}`.toUpperCase(),a=!1):i[c+1]==="-"&&i[c+2]?.match(/[a-z]/)?(n+=i[c],a=!0):n+=`${i[c]}${i[c].toUpperCase()}`;continue}}else if(i[c].match(/[a-z]/)){n+=`[${i[c]}${i[c].toUpperCase()}]`;continue}}if(r.m){if(i[c]==="^"){n+=`(^|(?<=[\r
|
|
121
|
+
]))`;continue}else if(i[c]==="$"){n+=`($|(?=[\r
|
|
122
|
+
]))`;continue}}if(r.s&&i[c]==="."){n+=s?`${i[c]}\r
|
|
123
|
+
`:`[${i[c]}\r
|
|
124
|
+
]`;continue}n+=i[c],i[c]==="\\"?o=!0:s&&i[c]==="]"?s=!1:!s&&i[c]==="["&&(s=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}var _S,An,uJ,ty=w(()=>{po();An={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(_S===void 0&&(_S=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_S),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};uJ=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function ry(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===Z.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((i,n)=>({...i,[n]:ge(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",n]})??$t(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:ge(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Z.ZodString&&t.keyType._def.checks?.length){let{type:i,...n}=ey(t.keyType._def,e);return{...r,propertyNames:n}}else{if(t.keyType?._def.typeName===Z.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===Z.ZodBranded&&t.keyType._def.type._def.typeName===Z.ZodString&&t.keyType._def.type._def.checks?.length){let{type:i,...n}=Yg(t.keyType._def,e);return{...r,propertyNames:n}}}return r}var ny=w(()=>{Gu();Ft();ty();Qg();dn()});function WD(t,e){if(e.mapStrategy==="record")return ry(t,e);let r=ge(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||$t(e),i=ge(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||$t(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}var wS=w(()=>{Ft();ny();dn()});function KD(t){let e=t.values,i=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),n=Array.from(new Set(i.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:i}}var $S=w(()=>{});function GD(t){return t.target==="openAi"?void 0:{not:$t({...t,currentPath:[...t.currentPath,"not"]})}}var kS=w(()=>{dn()});function JD(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var SS=w(()=>{});function YD(t,e){if(e.target==="openApi3")return XD(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(i=>i._def.typeName in _d&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let s=_d[o._def.typeName];return s&&!n.includes(s)?[...n,s]:n},[]);return{type:i.length>1?i:i[0]}}else if(r.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=r.reduce((n,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(i.length===r.length){let n=i.filter((o,s,a)=>a.indexOf(o)===s);return{type:n.length>1?n:n[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((i,n)=>[...i,...n._def.values.filter(o=>!i.includes(o))],[])};return XD(t,e)}var _d,XD,iy=w(()=>{Ft();_d={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};XD=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((i,n)=>ge(i._def,{...e,currentPath:[...e.currentPath,"anyOf",`${n}`]})).filter(i=>!!i&&(!e.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0}});function QD(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:_d[t.innerType._def.typeName],nullable:!0}:{type:[_d[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let i=ge(t.innerType._def,{...e,currentPath:[...e.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let r=ge(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var xS=w(()=>{Ft();iy()});function e1(t,e){let r={type:"number"};if(!t.checks)return r;for(let i of t.checks)switch(i.kind){case"int":r.type="integer",aS(r,"type",i.message,e);break;case"min":e.target==="jsonSchema7"?i.inclusive?Me(r,"minimum",i.value,i.message,e):Me(r,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(r.exclusiveMinimum=!0),Me(r,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?Me(r,"maximum",i.value,i.message,e):Me(r,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(r.exclusiveMaximum=!0),Me(r,"maximum",i.value,i.message,e));break;case"multipleOf":Me(r,"multipleOf",i.value,i.message,e);break}return r}var IS=w(()=>{po()});function t1(t,e){let r=e.target==="openAi",i={type:"object",properties:{}},n=[],o=t.shape();for(let a in o){let c=o[a];if(c===void 0||c._def===void 0)continue;let l=pJ(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=ge(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});u!==void 0&&(i.properties[a]=u,l||n.push(a))}n.length&&(i.required=n);let s=fJ(t,e);return s!==void 0&&(i.additionalProperties=s),i}function fJ(t,e){if(t.catchall._def.typeName!=="ZodNever")return ge(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function pJ(t){try{return t.isOptional()}catch{return!0}}var ES=w(()=>{Ft()});var r1,TS=w(()=>{Ft();dn();r1=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return ge(t.innerType._def,e);let r=ge(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:$t(e)},r]}:$t(e)}});var n1,OS=w(()=>{Ft();n1=(t,e)=>{if(e.pipeStrategy==="input")return ge(t.in._def,e);if(e.pipeStrategy==="output")return ge(t.out._def,e);let r=ge(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),i=ge(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter(n=>n!==void 0)}}});function i1(t,e){return ge(t.type._def,e)}var PS=w(()=>{Ft()});function o1(t,e){let i={type:"array",uniqueItems:!0,items:ge(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Me(i,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Me(i,"maxItems",t.maxSize.value,t.maxSize.message,e),i}var AS=w(()=>{po();Ft()});function s1(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,i)=>ge(r._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:ge(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,i)=>ge(r._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}var RS=w(()=>{Ft()});function a1(t){return{not:$t(t)}}var jS=w(()=>{dn()});function c1(t){return $t(t)}var zS=w(()=>{dn()});var l1,CS=w(()=>{Ft();l1=(t,e)=>ge(t.innerType._def,e)});var u1,NS=w(()=>{Gu();dn();cS();lS();uS();Qg();dS();pS();hS();mS();gS();yS();vS();wS();$S();kS();SS();xS();IS();ES();TS();OS();PS();ny();AS();ty();RS();jS();iy();zS();CS();u1=(t,e,r)=>{switch(e){case Z.ZodString:return ey(t,r);case Z.ZodNumber:return e1(t,r);case Z.ZodObject:return t1(t,r);case Z.ZodBigInt:return LD(t,r);case Z.ZodBoolean:return UD();case Z.ZodDate:return fS(t,r);case Z.ZodUndefined:return a1(r);case Z.ZodNull:return JD(r);case Z.ZodArray:return DD(t,r);case Z.ZodUnion:case Z.ZodDiscriminatedUnion:return YD(t,r);case Z.ZodIntersection:return VD(t,r);case Z.ZodTuple:return s1(t,r);case Z.ZodRecord:return ry(t,r);case Z.ZodLiteral:return BD(t,r);case Z.ZodEnum:return qD(t);case Z.ZodNativeEnum:return KD(t);case Z.ZodNullable:return QD(t,r);case Z.ZodOptional:return r1(t,r);case Z.ZodMap:return WD(t,r);case Z.ZodSet:return o1(t,r);case Z.ZodLazy:return()=>t.getter()._def;case Z.ZodPromise:return i1(t,r);case Z.ZodNaN:case Z.ZodNever:return GD(r);case Z.ZodEffects:return ZD(t,r);case Z.ZodAny:return $t(r);case Z.ZodUnknown:return c1(r);case Z.ZodDefault:return FD(t,r);case Z.ZodBranded:return Yg(t,r);case Z.ZodReadonly:return l1(t,r);case Z.ZodCatch:return MD(t,r);case Z.ZodPipeline:return n1(t,r);case Z.ZodFunction:case Z.ZodVoid:case Z.ZodSymbol:return;default:return(i=>{})(e)}}});function ge(t,e,r=!1){let i=e.seen.get(t);if(e.override){let a=e.override?.(t,e,i,r);if(a!==zD)return a}if(i&&!r){let a=hJ(i,e);if(a!==void 0)return a}let n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);let o=u1(t,t.typeName,e),s=typeof o=="function"?ge(o(),e):o;if(s&&mJ(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return n.jsonSchema=s,a}return n.jsonSchema=s,s}var hJ,mJ,Ft=w(()=>{Gg();NS();Xg();dn();hJ=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Jg(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,i)=>e.currentPath[i]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),$t(e)):e.$refStrategy==="seen"?$t(e):void 0}},mJ=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var d1=w(()=>{});var DS,LS=w(()=>{Ft();sS();dn();DS=(t,e)=>{let r=ND(e),i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[l,u])=>({...c,[l]:ge(u._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??$t(r)}),{}):void 0,n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=ge(t._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??$t(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),r.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[r.openAiAnyTypeName]||(i[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=n===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...i,[n]:o}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var f1=w(()=>{Gg();sS();po();Xg();Ft();d1();dn();cS();lS();uS();Qg();dS();pS();hS();mS();gS();yS();vS();wS();$S();kS();SS();xS();IS();ES();TS();OS();PS();CS();ny();AS();ty();RS();jS();iy();zS();NS();LS();LS()});function gJ(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function US(t,e){return ei(t)?Yo(t,{target:gJ(e?.target),io:e?.pipeStrategy??"input"}):DS(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function MS(t){let r=io(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=nc(r);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function FS(t,e){let r=no(t,e);if(!r.success)throw r.error;return r.data}var ZS=w(()=>{Nk();Ju();f1()});function p1(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function h1(t,e){let r={...t};for(let i in e){let n=i,o=e[n];if(o===void 0)continue;let s=r[n];p1(s)&&p1(o)?r[n]={...s,...o}:r[n]=o}return r}var yJ,oy,m1=w(()=>{Ju();yc();RD();ZS();yJ=6e4,oy=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Rg,r=>{this._oncancel(r)}),this.setNotificationHandler(zg,r=>{this._onprogress(r)}),this.setRequestHandler(jg,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Cg,async(r,i)=>{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new te(ae.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Dg,async(r,i)=>{let n=async()=>{let o=r.params.taskId;if(!await this._taskStore.getTask(o,i.sessionId))throw new te(ae.InvalidParams,`Task not found: ${o}`);if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),a.type==="response")u(c);else{let d=c,p=new te(d.error.code,d.error.message,d.error.data);u(p)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:i.requestId})}}let s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new te(ae.InvalidParams,`Task not found: ${o}`);if(!fo(s.status))return await this._waitForTaskUpdate(o,i.signal,i.sessionId),await n();if(fo(s.status)){let a=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o,i.sessionId),{...a,_meta:{...a._meta,[uo]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(Lg,async(r,i)=>{try{let{tasks:n,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,i.sessionId);return{tasks:n,nextCursor:o,_meta:{}}}catch(n){throw new te(ae.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Mg,async(r,i)=>{try{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new te(ae.InvalidParams,`Task not found: ${r.params.taskId}`);if(fo(n.status))throw new te(ae.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(r.params.taskId,i.sessionId);let o=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!o)throw new te(ae.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof te?n:new te(ae.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,i,n,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let i=Date.now()-r.startTime;if(r.maxTotalTimeout&&i>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),te.fromError(ae.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:i});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let n=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{n?.(o,s),ud(o)||wD(o)?this._onresponse(o):H0(o)?this._onrequest(o,s):bD(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let r=te.fromError(ae.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of e.values())i(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,r){let i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,o=e.params?._meta?.[uo]?.taskId,s=n?.sessionId,a=this._taskStore,c=!0,l;if(o&&a&&this._taskMessageQueue&&s!==void 0&&(c=!1,l=(async()=>{if(!await a.getTask(o,s))throw new te(ae.InvalidParams,`Task not found: ${o}`);c=!0})()),i===void 0){let h={jsonrpc:"2.0",id:e.id,error:{code:ae.MethodNotFound,message:"Method not found"}};if(o&&l){let m={type:"error",message:h,timestamp:Date.now()};l.then(()=>this._enqueueTaskMessage(o,m,s),()=>n?.send(h)).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)))}else o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},n?.sessionId).catch(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):n?.send(h).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}let u=new AbortController;this._requestHandlerAbortControllers.set(e.id,u);let d=yD(e.params)?e.params.task:void 0,p=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,f={signal:u.signal,sessionId:n?.sessionId,_meta:e.params?._meta,sendNotification:async h=>{if(u.signal.aborted)return;let m={relatedRequestId:e.id};o&&(m.relatedTask={taskId:o}),await this.notification(h,m)},sendRequest:async(h,m,g)=>{if(u.signal.aborted)throw new te(ae.ConnectionClosed,"Request was cancelled");let y={...g,relatedRequestId:e.id};o&&!y.relatedTask&&(y.relatedTask={taskId:o});let v=y.relatedTask?.taskId??o;return v&&p&&await p.updateTaskStatus(v,"input_required"),await this.request(h,m,y)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:p,taskRequestedTtl:d?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};(l??Promise.resolve()).then(()=>{if(l&&u.signal.aborted)throw new te(ae.ConnectionClosed,"Request was cancelled");d&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,f)).then(async h=>{if(u.signal.aborted)return;let m={result:h,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:m,timestamp:Date.now()},n?.sessionId):await n?.send(m)},async h=>{if(u.signal.aborted)return;let m={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(h.code)?h.code:ae.InternalError,message:h.message??"Internal error",...h.data!==void 0&&{data:h.data}}};o&&this._taskMessageQueue&&c?await this._enqueueTaskMessage(o,{type:"error",message:m,timestamp:Date.now()},n?.sessionId):await n?.send(m)}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===u&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...i}=e.params,n=Number(r),o=this._progressHandlers.get(n);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),s(c);return}o(i)}_onresponse(e){let r=Number(e.id),i=this._requestResolvers.get(r);if(i){if(this._requestResolvers.delete(r),ud(e))i(e);else{let s=new te(e.error.code,e.error.message,e.error.data);i(s)}return}let n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(ud(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),ud(e))n(e);else{let s=te.fromError(e.error.code,e.error.message,e.error.data);n(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,i){let{task:n}=i??{};if(!n){try{yield{type:"result",result:await this.request(e,r,i)}}catch(s){yield{type:"error",error:s instanceof te?s:new te(ae.InternalError,String(s))}}return}let o;try{let s=await this.request(e,pc,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new te(ae.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:a},fo(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)}:a.status==="failed"?yield{type:"error",error:new te(ae.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new te(ae.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof te?s:new te(ae.InternalError,String(s))}}}request(e,r,i){let{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=i??{};return new Promise((l,u)=>{let d=v=>{u(v)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(v){d(v);return}i?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};i?.onprogress&&(this._progressHandlers.set(p,i.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[uo]:c}});let h=v=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(v)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let b=v instanceof te?v:new te(ae.RequestTimeout,String(v));u(b)};this._responseHandlers.set(p,v=>{if(!i?.signal?.aborted){if(v instanceof Error)return u(v);try{let b=no(r,v.result);b.success?l(b.data):u(b.error)}catch(b){u(b)}}}),i?.signal?.addEventListener("abort",()=>{h(i?.signal?.reason)});let m=i?.timeout??yJ,g=()=>h(te.fromError(ae.RequestTimeout,"Request timed out",{timeout:m}));this._setupTimeout(p,m,i?.maxTotalTimeout,g,i?.resetTimeoutOnProgress??!1);let y=c?.taskId;if(y){let v=b=>{let x=this._responseHandlers.get(p);x?x(b):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,v),this._enqueueTaskMessage(y,{type:"request",message:f,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(p),u(b)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(v=>{this._cleanupTimeout(p),u(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Ng,r)}async getTaskResult(e,r,i){return this.request({method:"tasks/result",params:e},r,i)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Ug,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},SD,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let i=r?.relatedTask?.taskId;if(i){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[uo]:r.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[uo]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[uo]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let i=MS(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(n,o)=>{let s=FS(e,n);return Promise.resolve(r(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let i=MS(e);this._notificationHandlers.set(i,n=>{let o=FS(e,n);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,i??this._transport?.sessionId,n)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(e,r);for(let n of i)if(n.type==="request"&&H0(n.message)){let o=n.message.id,s=this._requestResolvers.get(o);s?(s(new te(ae.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r,i){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e,i);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new te(ae.InvalidRequest,"Request cancelled"));return}let a=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(a),s(new te(ae.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await i.createTask(n,e.id,{method:e.method,params:e.params},r)},getTask:async n=>{let o=await i.getTask(n,r);if(!o)throw new te(ae.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,s)=>{await i.storeTaskResult(n,o,s,r);let a=await i.getTask(n,r);if(a){let c=md.parse({method:"notifications/tasks/status",params:a});await this.notification(c),fo(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>i.getTaskResult(n,r),updateTaskStatus:async(n,o,s)=>{let a=await i.getTask(n,r);if(!a)throw new te(ae.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(fo(a.status))throw new te(ae.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(n,o,s,r);let c=await i.getTask(n,r);if(c){let l=md.parse({method:"notifications/tasks/status",params:c});await this.notification(l),fo(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>i.listTasks(n,r)}}}});var $d=C(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.regexpCode=Ge.getEsmExportName=Ge.getProperty=Ge.safeStringify=Ge.stringify=Ge.strConcat=Ge.addCodeArg=Ge.str=Ge._=Ge.nil=Ge._Code=Ge.Name=Ge.IDENTIFIER=Ge._CodeOrName=void 0;var bd=class{};Ge._CodeOrName=bd;Ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ws=class extends bd{constructor(e){if(super(),!Ge.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ge.Name=ws;var fn=class extends bd{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,i)=>`${r}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,i)=>(i instanceof ws&&(r[i.str]=(r[i.str]||0)+1),r),{})}};Ge._Code=fn;Ge.nil=new fn("");function g1(t,...e){let r=[t[0]],i=0;for(;i<e.length;)VS(r,e[i]),r.push(t[++i]);return new fn(r)}Ge._=g1;var qS=new fn("+");function y1(t,...e){let r=[wd(t[0])],i=0;for(;i<e.length;)r.push(qS),VS(r,e[i]),r.push(qS,wd(t[++i]));return vJ(r),new fn(r)}Ge.str=y1;function VS(t,e){e instanceof fn?t.push(...e._items):e instanceof ws?t.push(e):t.push(wJ(e))}Ge.addCodeArg=VS;function vJ(t){let e=1;for(;e<t.length-1;){if(t[e]===qS){let r=_J(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function _J(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ws||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ws))return`"${t}${e.slice(1)}`}function bJ(t,e){return e.emptyStr()?t:t.emptyStr()?e:y1`${t}${e}`}Ge.strConcat=bJ;function wJ(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:wd(Array.isArray(t)?t.join(","):t)}function $J(t){return new fn(wd(t))}Ge.stringify=$J;function wd(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ge.safeStringify=wd;function kJ(t){return typeof t=="string"&&Ge.IDENTIFIER.test(t)?new fn(`.${t}`):g1`[${t}]`}Ge.getProperty=kJ;function SJ(t){if(typeof t=="string"&&Ge.IDENTIFIER.test(t))return new fn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ge.getEsmExportName=SJ;function xJ(t){return new fn(t.toString())}Ge.regexpCode=xJ});var WS=C(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ValueScope=Nr.ValueScopeName=Nr.Scope=Nr.varKinds=Nr.UsedValueState=void 0;var Cr=$d(),BS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},sy;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(sy||(Nr.UsedValueState=sy={}));Nr.varKinds={const:new Cr.Name("const"),let:new Cr.Name("let"),var:new Cr.Name("var")};var ay=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Cr.Name?e:this.name(e)}name(e){return new Cr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Nr.Scope=ay;var cy=class extends Cr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:i}){this.value=e,this.scopePath=(0,Cr._)`.${new Cr.Name(r)}[${i}]`}};Nr.ValueScopeName=cy;var IJ=(0,Cr._)`\n`,HS=class extends ay{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?IJ:Cr.nil}}get(){return this._scope}name(e){return new cy(e,this._newName(e))}value(e,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:o}=n,s=(i=r.key)!==null&&i!==void 0?i:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,n);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,n.setValue(r,{property:o,itemIndex:l}),n}getValue(e,r){let i=this._values[e];if(i)return i.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Cr._)`${e}${i.scopePath}`})}scopeCode(e=this._values,r,i){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,i)}_reduceValues(e,r,i={},n){let o=Cr.nil;for(let s in e){let a=e[s];if(!a)continue;let c=i[s]=i[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,sy.Started);let u=r(l);if(u){let d=this.opts.es5?Nr.varKinds.var:Nr.varKinds.const;o=(0,Cr._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=n?.(l))o=(0,Cr._)`${o}${u}${this.opts._n}`;else throw new BS(l);c.set(l,sy.Completed)})}return o}};Nr.ValueScope=HS});var Te=C(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.or=Ae.and=Ae.not=Ae.CodeGen=Ae.operators=Ae.varKinds=Ae.ValueScopeName=Ae.ValueScope=Ae.Scope=Ae.Name=Ae.regexpCode=Ae.stringify=Ae.getProperty=Ae.nil=Ae.strConcat=Ae.str=Ae._=void 0;var Fe=$d(),jn=WS(),ho=$d();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return ho._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return ho.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return ho.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return ho.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return ho.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return ho.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return ho.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return ho.Name}});var fy=WS();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return fy.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return fy.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return fy.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return fy.varKinds}});Ae.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var Ri=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},KS=class extends Ri{constructor(e,r,i){super(),this.varKind=e,this.name=r,this.rhs=i}render({es5:e,_n:r}){let i=e?jn.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=_c(this.rhs,e,r)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},ly=class extends Ri{constructor(e,r,i){super(),this.lhs=e,this.rhs=r,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Fe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=_c(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Fe.Name?{}:{...this.lhs.names};return dy(e,this.rhs)}},GS=class extends ly{constructor(e,r,i,n){super(e,i,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},JS=class extends Ri{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},XS=class extends Ri{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},YS=class extends Ri{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},QS=class extends Ri{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=_c(this.code,e,r),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},kd=class extends Ri{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,i)=>r+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let i=e[r].optimizeNodes();Array.isArray(i)?e.splice(r,1,...i):i?e[r]=i:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:i}=this,n=i.length;for(;n--;){let o=i[n];o.optimizeNames(e,r)||(EJ(e,o.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ss(e,r.names),{})}},ji=class extends kd{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},ex=class extends kd{},vc=class extends ji{};vc.kind="else";var $s=class t extends ji{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let i=r.optimizeNodes();r=this.else=Array.isArray(i)?new vc(i):i}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(v1(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=_c(this.condition,e,r),this}get names(){let e=super.names;return dy(e,this.condition),this.else&&Ss(e,this.else.names),e}};$s.kind="if";var ks=class extends ji{};ks.kind="for";var tx=class extends ks{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=_c(this.iteration,e,r),this}get names(){return Ss(super.names,this.iteration.names)}},rx=class extends ks{constructor(e,r,i,n){super(),this.varKind=e,this.name=r,this.from=i,this.to=n}render(e){let r=e.es5?jn.varKinds.var:this.varKind,{name:i,from:n,to:o}=this;return`for(${r} ${i}=${n}; ${i}<${o}; ${i}++)`+super.render(e)}get names(){let e=dy(super.names,this.from);return dy(e,this.to)}},uy=class extends ks{constructor(e,r,i,n){super(),this.loop=e,this.varKind=r,this.name=i,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=_c(this.iterable,e,r),this}get names(){return Ss(super.names,this.iterable.names)}},Sd=class extends ji{constructor(e,r,i){super(),this.name=e,this.args=r,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Sd.kind="func";var xd=class extends kd{render(e){return"return "+super.render(e)}};xd.kind="return";var nx=class extends ji{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var i,n;return super.optimizeNames(e,r),(i=this.catch)===null||i===void 0||i.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ss(e,this.catch.names),this.finally&&Ss(e,this.finally.names),e}},Id=class extends ji{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Id.kind="catch";var Ed=class extends ji{render(e){return"finally"+super.render(e)}};Ed.kind="finally";var ix=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
125
|
+
`:""},this._extScope=e,this._scope=new jn.Scope({parent:e}),this._nodes=[new ex]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let i=this._extScope.value(e,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,i,n){let o=this._scope.toName(r);return i!==void 0&&n&&(this._constants[o.str]=i),this._leafNode(new KS(e,o,i)),o}const(e,r,i){return this._def(jn.varKinds.const,e,r,i)}let(e,r,i){return this._def(jn.varKinds.let,e,r,i)}var(e,r,i){return this._def(jn.varKinds.var,e,r,i)}assign(e,r,i){return this._leafNode(new ly(e,r,i))}add(e,r){return this._leafNode(new GS(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Fe.nil&&this._leafNode(new QS(e)),this}object(...e){let r=["{"];for(let[i,n]of e)r.length>1&&r.push(","),r.push(i),(i!==n||this.opts.es5)&&(r.push(":"),(0,Fe.addCodeArg)(r,n));return r.push("}"),new Fe._Code(r)}if(e,r,i){if(this._blockNode(new $s(e)),r&&i)this.code(r).else().code(i).endIf();else if(r)this.code(r).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new $s(e))}else(){return this._elseNode(new vc)}endIf(){return this._endBlockNode($s,vc)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new tx(e),r)}forRange(e,r,i,n,o=this.opts.es5?jn.varKinds.var:jn.varKinds.let){let s=this._scope.toName(e);return this._for(new rx(o,s,r,i),()=>n(s))}forOf(e,r,i,n=jn.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof Fe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Fe._)`${s}.length`,a=>{this.var(o,(0,Fe._)`${s}[${a}]`),i(o)})}return this._for(new uy("of",n,o,r),()=>i(o))}forIn(e,r,i,n=this.opts.es5?jn.varKinds.var:jn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Fe._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new uy("in",n,o,r),()=>i(o))}endFor(){return this._endBlockNode(ks)}label(e){return this._leafNode(new JS(e))}break(e){return this._leafNode(new XS(e))}return(e){let r=new xd;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(xd)}try(e,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new nx;if(this._blockNode(n),this.code(e),r){let o=this.name("e");this._currNode=n.catch=new Id(o),r(o)}return i&&(this._currNode=n.finally=new Ed,this.code(i)),this._endBlockNode(Id,Ed)}throw(e){return this._leafNode(new YS(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-r;if(i<0||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Fe.nil,i,n){return this._blockNode(new Sd(e,r,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Sd)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let i=this._currNode;if(i instanceof e||r&&i instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof $s))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ae.CodeGen=ix;function Ss(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function dy(t,e){return e instanceof Fe._CodeOrName?Ss(t,e.names):t}function _c(t,e,r){if(t instanceof Fe.Name)return i(t);if(!n(t))return t;return new Fe._Code(t._items.reduce((o,s)=>(s instanceof Fe.Name&&(s=i(s)),s instanceof Fe._Code?o.push(...s._items):o.push(s),o),[]));function i(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function n(o){return o instanceof Fe._Code&&o._items.some(s=>s instanceof Fe.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function EJ(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function v1(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Fe._)`!${ox(t)}`}Ae.not=v1;var TJ=_1(Ae.operators.AND);function OJ(...t){return t.reduce(TJ)}Ae.and=OJ;var PJ=_1(Ae.operators.OR);function AJ(...t){return t.reduce(PJ)}Ae.or=AJ;function _1(t){return(e,r)=>e===Fe.nil?r:r===Fe.nil?e:(0,Fe._)`${ox(e)} ${t} ${ox(r)}`}function ox(t){return t instanceof Fe.Name?t:(0,Fe._)`(${t})`}});var qe=C(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.checkStrictMode=Ne.getErrorPath=Ne.Type=Ne.useFunc=Ne.setEvaluated=Ne.evaluatedPropsToName=Ne.mergeEvaluated=Ne.eachItem=Ne.unescapeJsonPointer=Ne.escapeJsonPointer=Ne.escapeFragment=Ne.unescapeFragment=Ne.schemaRefOrVal=Ne.schemaHasRulesButRef=Ne.schemaHasRules=Ne.checkUnknownRules=Ne.alwaysValidSchema=Ne.toHash=void 0;var ft=Te(),RJ=$d();function jJ(t){let e={};for(let r of t)e[r]=!0;return e}Ne.toHash=jJ;function zJ(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:($1(t,e),!k1(e,t.self.RULES.all))}Ne.alwaysValidSchema=zJ;function $1(t,e=t.schema){let{opts:r,self:i}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=i.RULES.keywords;for(let o in e)n[o]||I1(t,`unknown keyword: "${o}"`)}Ne.checkUnknownRules=$1;function k1(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ne.schemaHasRules=k1;function CJ(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ne.schemaHasRulesButRef=CJ;function NJ({topSchemaRef:t,schemaPath:e},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ft._)`${r}`}return(0,ft._)`${t}${e}${(0,ft.getProperty)(i)}`}Ne.schemaRefOrVal=NJ;function DJ(t){return S1(decodeURIComponent(t))}Ne.unescapeFragment=DJ;function LJ(t){return encodeURIComponent(ax(t))}Ne.escapeFragment=LJ;function ax(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ne.escapeJsonPointer=ax;function S1(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ne.unescapeJsonPointer=S1;function UJ(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ne.eachItem=UJ;function b1({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:i}){return(n,o,s,a)=>{let c=s===void 0?o:s instanceof ft.Name?(o instanceof ft.Name?t(n,o,s):e(n,o,s),s):o instanceof ft.Name?(e(n,s,o),o):r(o,s);return a===ft.Name&&!(c instanceof ft.Name)?i(n,c):c}}Ne.mergeEvaluated={props:b1({mergeNames:(t,e,r)=>t.if((0,ft._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ft._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ft._)`${r} || {}`).code((0,ft._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ft._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ft._)`${r} || {}`),cx(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:x1}),items:b1({mergeNames:(t,e,r)=>t.if((0,ft._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ft._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ft._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ft._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function x1(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ft._)`{}`);return e!==void 0&&cx(t,r,e),r}Ne.evaluatedPropsToName=x1;function cx(t,e,r){Object.keys(r).forEach(i=>t.assign((0,ft._)`${e}${(0,ft.getProperty)(i)}`,!0))}Ne.setEvaluated=cx;var w1={};function MJ(t,e){return t.scopeValue("func",{ref:e,code:w1[e.code]||(w1[e.code]=new RJ._Code(e.code))})}Ne.useFunc=MJ;var sx;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(sx||(Ne.Type=sx={}));function FJ(t,e,r){if(t instanceof ft.Name){let i=e===sx.Num;return r?i?(0,ft._)`"[" + ${t} + "]"`:(0,ft._)`"['" + ${t} + "']"`:i?(0,ft._)`"/" + ${t}`:(0,ft._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ft.getProperty)(t).toString():"/"+ax(t)}Ne.getErrorPath=FJ;function I1(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ne.checkStrictMode=I1});var zi=C(lx=>{"use strict";Object.defineProperty(lx,"__esModule",{value:!0});var cr=Te(),ZJ={data:new cr.Name("data"),valCxt:new cr.Name("valCxt"),instancePath:new cr.Name("instancePath"),parentData:new cr.Name("parentData"),parentDataProperty:new cr.Name("parentDataProperty"),rootData:new cr.Name("rootData"),dynamicAnchors:new cr.Name("dynamicAnchors"),vErrors:new cr.Name("vErrors"),errors:new cr.Name("errors"),this:new cr.Name("this"),self:new cr.Name("self"),scope:new cr.Name("scope"),json:new cr.Name("json"),jsonPos:new cr.Name("jsonPos"),jsonLen:new cr.Name("jsonLen"),jsonPart:new cr.Name("jsonPart")};lx.default=ZJ});var Td=C(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.extendErrors=lr.resetErrorsCount=lr.reportExtraError=lr.reportError=lr.keyword$DataError=lr.keywordError=void 0;var Ve=Te(),py=qe(),kr=zi();lr.keywordError={message:({keyword:t})=>(0,Ve.str)`must pass "${t}" keyword validation`};lr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Ve.str)`"${t}" keyword must be ${e} ($data)`:(0,Ve.str)`"${t}" keyword is invalid ($data)`};function qJ(t,e=lr.keywordError,r,i){let{it:n}=t,{gen:o,compositeRule:s,allErrors:a}=n,c=O1(t,e,r);i??(s||a)?E1(o,c):T1(n,(0,Ve._)`[${c}]`)}lr.reportError=qJ;function VJ(t,e=lr.keywordError,r){let{it:i}=t,{gen:n,compositeRule:o,allErrors:s}=i,a=O1(t,e,r);E1(n,a),o||s||T1(i,kr.default.vErrors)}lr.reportExtraError=VJ;function BJ(t,e){t.assign(kr.default.errors,e),t.if((0,Ve._)`${kr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ve._)`${kr.default.vErrors}.length`,e),()=>t.assign(kr.default.vErrors,null)))}lr.resetErrorsCount=BJ;function HJ({gen:t,keyword:e,schemaValue:r,data:i,errsCount:n,it:o}){if(n===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",n,kr.default.errors,a=>{t.const(s,(0,Ve._)`${kr.default.vErrors}[${a}]`),t.if((0,Ve._)`${s}.instancePath === undefined`,()=>t.assign((0,Ve._)`${s}.instancePath`,(0,Ve.strConcat)(kr.default.instancePath,o.errorPath))),t.assign((0,Ve._)`${s}.schemaPath`,(0,Ve.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,Ve._)`${s}.schema`,r),t.assign((0,Ve._)`${s}.data`,i))})}lr.extendErrors=HJ;function E1(t,e){let r=t.const("err",e);t.if((0,Ve._)`${kr.default.vErrors} === null`,()=>t.assign(kr.default.vErrors,(0,Ve._)`[${r}]`),(0,Ve._)`${kr.default.vErrors}.push(${r})`),t.code((0,Ve._)`${kr.default.errors}++`)}function T1(t,e){let{gen:r,validateName:i,schemaEnv:n}=t;n.$async?r.throw((0,Ve._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ve._)`${i}.errors`,e),r.return(!1))}var xs={keyword:new Ve.Name("keyword"),schemaPath:new Ve.Name("schemaPath"),params:new Ve.Name("params"),propertyName:new Ve.Name("propertyName"),message:new Ve.Name("message"),schema:new Ve.Name("schema"),parentSchema:new Ve.Name("parentSchema")};function O1(t,e,r){let{createErrors:i}=t.it;return i===!1?(0,Ve._)`{}`:WJ(t,e,r)}function WJ(t,e,r={}){let{gen:i,it:n}=t,o=[KJ(n,r),GJ(t,r)];return JJ(t,e,o),i.object(...o)}function KJ({errorPath:t},{instancePath:e}){let r=e?(0,Ve.str)`${t}${(0,py.getErrorPath)(e,py.Type.Str)}`:t;return[kr.default.instancePath,(0,Ve.strConcat)(kr.default.instancePath,r)]}function GJ({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:i}){let n=i?e:(0,Ve.str)`${e}/${t}`;return r&&(n=(0,Ve.str)`${n}${(0,py.getErrorPath)(r,py.Type.Str)}`),[xs.schemaPath,n]}function JJ(t,{params:e,message:r},i){let{keyword:n,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;i.push([xs.keyword,n],[xs.params,typeof e=="function"?e(t):e||(0,Ve._)`{}`]),c.messages&&i.push([xs.message,typeof r=="function"?r(t):r]),c.verbose&&i.push([xs.schema,s],[xs.parentSchema,(0,Ve._)`${u}${d}`],[kr.default.data,o]),l&&i.push([xs.propertyName,l])}});var A1=C(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.boolOrEmptySchema=bc.topBoolOrEmptySchema=void 0;var XJ=Td(),YJ=Te(),QJ=zi(),e3={message:"boolean schema is false"};function t3(t){let{gen:e,schema:r,validateName:i}=t;r===!1?P1(t,!1):typeof r=="object"&&r.$async===!0?e.return(QJ.default.data):(e.assign((0,YJ._)`${i}.errors`,null),e.return(!0))}bc.topBoolOrEmptySchema=t3;function r3(t,e){let{gen:r,schema:i}=t;i===!1?(r.var(e,!1),P1(t)):r.var(e,!0)}bc.boolOrEmptySchema=r3;function P1(t,e){let{gen:r,data:i}=t,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,XJ.reportError)(n,e3,void 0,e)}});var ux=C(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.getRules=wc.isJSONType=void 0;var n3=["string","number","integer","boolean","null","object","array"],i3=new Set(n3);function o3(t){return typeof t=="string"&&i3.has(t)}wc.isJSONType=o3;function s3(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}wc.getRules=s3});var dx=C(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.shouldUseRule=mo.shouldUseGroup=mo.schemaHasRulesForType=void 0;function a3({schema:t,self:e},r){let i=e.RULES.types[r];return i&&i!==!0&&R1(t,i)}mo.schemaHasRulesForType=a3;function R1(t,e){return e.rules.some(r=>j1(t,r))}mo.shouldUseGroup=R1;function j1(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(i=>t[i]!==void 0))}mo.shouldUseRule=j1});var Od=C(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.reportTypeError=ur.checkDataTypes=ur.checkDataType=ur.coerceAndCheckDataType=ur.getJSONTypes=ur.getSchemaTypes=ur.DataType=void 0;var c3=ux(),l3=dx(),u3=Td(),Ie=Te(),z1=qe(),$c;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})($c||(ur.DataType=$c={}));function d3(t){let e=C1(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}ur.getSchemaTypes=d3;function C1(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(c3.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ur.getJSONTypes=C1;function f3(t,e){let{gen:r,data:i,opts:n}=t,o=p3(e,n.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,l3.schemaHasRulesForType)(t,e[0]));if(s){let a=px(e,i,n.strictNumbers,$c.Wrong);r.if(a,()=>{o.length?h3(t,e,o):hx(t)})}return s}ur.coerceAndCheckDataType=f3;var N1=new Set(["string","number","integer","boolean","null"]);function p3(t,e){return e?t.filter(r=>N1.has(r)||e==="array"&&r==="array"):[]}function h3(t,e,r){let{gen:i,data:n,opts:o}=t,s=i.let("dataType",(0,Ie._)`typeof ${n}`),a=i.let("coerced",(0,Ie._)`undefined`);o.coerceTypes==="array"&&i.if((0,Ie._)`${s} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,Ie._)`${n}[0]`).assign(s,(0,Ie._)`typeof ${n}`).if(px(e,n,o.strictNumbers),()=>i.assign(a,n))),i.if((0,Ie._)`${a} !== undefined`);for(let l of r)(N1.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);i.else(),hx(t),i.endIf(),i.if((0,Ie._)`${a} !== undefined`,()=>{i.assign(n,a),m3(t,a)});function c(l){switch(l){case"string":i.elseIf((0,Ie._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Ie._)`"" + ${n}`).elseIf((0,Ie._)`${n} === null`).assign(a,(0,Ie._)`""`);return;case"number":i.elseIf((0,Ie._)`${s} == "boolean" || ${n} === null
|
|
126
|
+
|| (${s} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,Ie._)`+${n}`);return;case"integer":i.elseIf((0,Ie._)`${s} === "boolean" || ${n} === null
|
|
127
|
+
|| (${s} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,Ie._)`+${n}`);return;case"boolean":i.elseIf((0,Ie._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,Ie._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":i.elseIf((0,Ie._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(a,null);return;case"array":i.elseIf((0,Ie._)`${s} === "string" || ${s} === "number"
|
|
128
|
+
|| ${s} === "boolean" || ${n} === null`).assign(a,(0,Ie._)`[${n}]`)}}}function m3({gen:t,parentData:e,parentDataProperty:r},i){t.if((0,Ie._)`${e} !== undefined`,()=>t.assign((0,Ie._)`${e}[${r}]`,i))}function fx(t,e,r,i=$c.Correct){let n=i===$c.Correct?Ie.operators.EQ:Ie.operators.NEQ,o;switch(t){case"null":return(0,Ie._)`${e} ${n} null`;case"array":o=(0,Ie._)`Array.isArray(${e})`;break;case"object":o=(0,Ie._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Ie._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Ie._)`typeof ${e} ${n} ${t}`}return i===$c.Correct?o:(0,Ie.not)(o);function s(a=Ie.nil){return(0,Ie.and)((0,Ie._)`typeof ${e} == "number"`,a,r?(0,Ie._)`isFinite(${e})`:Ie.nil)}}ur.checkDataType=fx;function px(t,e,r,i){if(t.length===1)return fx(t[0],e,r,i);let n,o=(0,z1.toHash)(t);if(o.array&&o.object){let s=(0,Ie._)`typeof ${e} != "object"`;n=o.null?s:(0,Ie._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else n=Ie.nil;o.number&&delete o.integer;for(let s in o)n=(0,Ie.and)(n,fx(s,e,r,i));return n}ur.checkDataTypes=px;var g3={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ie._)`{type: ${t}}`:(0,Ie._)`{type: ${e}}`};function hx(t){let e=y3(t);(0,u3.reportError)(e,g3)}ur.reportTypeError=hx;function y3(t){let{gen:e,data:r,schema:i}=t,n=(0,z1.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:t}}});var L1=C(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.assignDefaults=void 0;var kc=Te(),v3=qe();function _3(t,e){let{properties:r,items:i}=t.schema;if(e==="object"&&r)for(let n in r)D1(t,n,r[n].default);else e==="array"&&Array.isArray(i)&&i.forEach((n,o)=>D1(t,o,n.default))}hy.assignDefaults=_3;function D1(t,e,r){let{gen:i,compositeRule:n,data:o,opts:s}=t;if(r===void 0)return;let a=(0,kc._)`${o}${(0,kc.getProperty)(e)}`;if(n){(0,v3.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,kc._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,kc._)`${c} || ${a} === null || ${a} === ""`),i.if(c,(0,kc._)`${a} = ${(0,kc.stringify)(r)}`)}});var pn=C(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.validateUnion=lt.validateArray=lt.usePattern=lt.callValidateCode=lt.schemaProperties=lt.allSchemaProperties=lt.noPropertyInData=lt.propertyInData=lt.isOwnProperty=lt.hasPropFunc=lt.reportMissingProp=lt.checkMissingProp=lt.checkReportMissingProp=void 0;var vt=Te(),mx=qe(),go=zi(),b3=qe();function w3(t,e){let{gen:r,data:i,it:n}=t;r.if(yx(r,i,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,vt._)`${e}`},!0),t.error()})}lt.checkReportMissingProp=w3;function $3({gen:t,data:e,it:{opts:r}},i,n){return(0,vt.or)(...i.map(o=>(0,vt.and)(yx(t,e,o,r.ownProperties),(0,vt._)`${n} = ${o}`)))}lt.checkMissingProp=$3;function k3(t,e){t.setParams({missingProperty:e},!0),t.error()}lt.reportMissingProp=k3;function U1(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,vt._)`Object.prototype.hasOwnProperty`})}lt.hasPropFunc=U1;function gx(t,e,r){return(0,vt._)`${U1(t)}.call(${e}, ${r})`}lt.isOwnProperty=gx;function S3(t,e,r,i){let n=(0,vt._)`${e}${(0,vt.getProperty)(r)} !== undefined`;return i?(0,vt._)`${n} && ${gx(t,e,r)}`:n}lt.propertyInData=S3;function yx(t,e,r,i){let n=(0,vt._)`${e}${(0,vt.getProperty)(r)} === undefined`;return i?(0,vt.or)(n,(0,vt.not)(gx(t,e,r))):n}lt.noPropertyInData=yx;function M1(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}lt.allSchemaProperties=M1;function x3(t,e){return M1(e).filter(r=>!(0,mx.alwaysValidSchema)(t,e[r]))}lt.schemaProperties=x3;function I3({schemaCode:t,data:e,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:s},a,c,l){let u=l?(0,vt._)`${t}, ${e}, ${i}${n}`:e,d=[[go.default.instancePath,(0,vt.strConcat)(go.default.instancePath,o)],[go.default.parentData,s.parentData],[go.default.parentDataProperty,s.parentDataProperty],[go.default.rootData,go.default.rootData]];s.opts.dynamicRef&&d.push([go.default.dynamicAnchors,go.default.dynamicAnchors]);let p=(0,vt._)`${u}, ${r.object(...d)}`;return c!==vt.nil?(0,vt._)`${a}.call(${c}, ${p})`:(0,vt._)`${a}(${p})`}lt.callValidateCode=I3;var E3=(0,vt._)`new RegExp`;function T3({gen:t,it:{opts:e}},r){let i=e.unicodeRegExp?"u":"",{regExp:n}=e.code,o=n(r,i);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,vt._)`${n.code==="new RegExp"?E3:(0,b3.useFunc)(t,n)}(${r}, ${i})`})}lt.usePattern=T3;function O3(t){let{gen:e,data:r,keyword:i,it:n}=t,o=e.name("valid");if(n.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,vt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:mx.Type.Num},o),e.if((0,vt.not)(o),a)})}}lt.validateArray=O3;function P3(t){let{gen:e,schema:r,keyword:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,mx.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:i,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,vt._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,vt.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}lt.validateUnion=P3});var q1=C(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.validateKeywordUsage=ri.validSchemaType=ri.funcKeywordCode=ri.macroKeywordCode=void 0;var Sr=Te(),Is=zi(),A3=pn(),R3=Td();function j3(t,e){let{gen:r,keyword:i,schema:n,parentSchema:o,it:s}=t,a=e.macro.call(s.self,n,o,s),c=Z1(r,i,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Sr.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ri.macroKeywordCode=j3;function z3(t,e){var r;let{gen:i,keyword:n,schema:o,parentSchema:s,$data:a,it:c}=t;N3(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=Z1(i,n,l),d=i.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)m(),e.modifying&&F1(t),g(()=>t.error());else{let y=e.async?f():h();e.modifying&&F1(t),g(()=>C3(t,y))}}function f(){let y=i.let("ruleErrs",null);return i.try(()=>m((0,Sr._)`await `),v=>i.assign(d,!1).if((0,Sr._)`${v} instanceof ${c.ValidationError}`,()=>i.assign(y,(0,Sr._)`${v}.errors`),()=>i.throw(v))),y}function h(){let y=(0,Sr._)`${u}.errors`;return i.assign(y,null),m(Sr.nil),y}function m(y=e.async?(0,Sr._)`await `:Sr.nil){let v=c.opts.passContext?Is.default.this:Is.default.self,b=!("compile"in e&&!a||e.schema===!1);i.assign(d,(0,Sr._)`${y}${(0,A3.callValidateCode)(t,u,v,b)}`,e.modifying)}function g(y){var v;i.if((0,Sr.not)((v=e.valid)!==null&&v!==void 0?v:d),y)}}ri.funcKeywordCode=z3;function F1(t){let{gen:e,data:r,it:i}=t;e.if(i.parentData,()=>e.assign(r,(0,Sr._)`${i.parentData}[${i.parentDataProperty}]`))}function C3(t,e){let{gen:r}=t;r.if((0,Sr._)`Array.isArray(${e})`,()=>{r.assign(Is.default.vErrors,(0,Sr._)`${Is.default.vErrors} === null ? ${e} : ${Is.default.vErrors}.concat(${e})`).assign(Is.default.errors,(0,Sr._)`${Is.default.vErrors}.length`),(0,R3.extendErrors)(t)},()=>t.error())}function N3({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Z1(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Sr.stringify)(r)})}function D3(t,e,r=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||r&&typeof t>"u")}ri.validSchemaType=D3;function L3({schema:t,opts:e,self:r,errSchemaPath:i},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");let s=n.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ri.validateKeywordUsage=L3});var B1=C(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.extendSubschemaMode=yo.extendSubschemaData=yo.getSubschema=void 0;var ni=Te(),V1=qe();function U3(t,{keyword:e,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,ni._)`${t.schemaPath}${(0,ni.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,ni._)`${t.schemaPath}${(0,ni.getProperty)(e)}${(0,ni.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,V1.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}yo.getSubschema=U3;function M3(t,e,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:s}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,p=a.let("data",(0,ni._)`${e.data}${(0,ni.getProperty)(r)}`,!0);c(p),t.errorPath=(0,ni.str)`${l}${(0,V1.getErrorPath)(r,i,d.jsPropertySyntax)}`,t.parentDataProperty=(0,ni._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(n!==void 0){let l=n instanceof ni.Name?n:a.let("data",n,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}yo.extendSubschemaData=M3;function F3(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){i!==void 0&&(t.compositeRule=i),n!==void 0&&(t.createErrors=n),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}yo.extendSubschemaMode=F3});var vx=C((zfe,H1)=>{"use strict";H1.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var s=o[n];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var K1=C((Cfe,W1)=>{"use strict";var vo=W1.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};my(e,i,n,t,"",t)};vo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};vo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};vo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};vo.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function my(t,e,r,i,n,o,s,a,c,l){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,n,o,s,a,c,l);for(var u in i){var d=i[u];if(Array.isArray(d)){if(u in vo.arrayKeywords)for(var p=0;p<d.length;p++)my(t,e,r,d[p],n+"/"+u+"/"+p,o,n,u,i,p)}else if(u in vo.propsKeywords){if(d&&typeof d=="object")for(var f in d)my(t,e,r,d[f],n+"/"+u+"/"+Z3(f),o,n,u,i,f)}else(u in vo.keywords||t.allKeys&&!(u in vo.skipKeywords))&&my(t,e,r,d,n+"/"+u,o,n,u,i)}r(i,n,o,s,a,c,l)}}function Z3(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Pd=C(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.getSchemaRefs=Dr.resolveUrl=Dr.normalizeId=Dr._getFullPath=Dr.getFullPath=Dr.inlineRef=void 0;var q3=qe(),V3=vx(),B3=K1(),H3=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function W3(t,e=!0){return typeof t=="boolean"?!0:e===!0?!_x(t):e?G1(t)<=e:!1}Dr.inlineRef=W3;var K3=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _x(t){for(let e in t){if(K3.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(_x)||typeof r=="object"&&_x(r))return!0}return!1}function G1(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!H3.has(r)&&(typeof t[r]=="object"&&(0,q3.eachItem)(t[r],i=>e+=G1(i)),e===1/0))return 1/0}return e}function J1(t,e="",r){r!==!1&&(e=Sc(e));let i=t.parse(e);return X1(t,i)}Dr.getFullPath=J1;function X1(t,e){return t.serialize(e).split("#")[0]+"#"}Dr._getFullPath=X1;var G3=/#\/?$/;function Sc(t){return t?t.replace(G3,""):""}Dr.normalizeId=Sc;function J3(t,e,r){return r=Sc(r),t.resolve(e,r)}Dr.resolveUrl=J3;var X3=/^[a-z_][-a-z0-9._]*$/i;function Y3(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=Sc(t[r]||e),o={"":n},s=J1(i,n,!1),a={},c=new Set;return B3(t,{allKeys:!0},(d,p,f,h)=>{if(h===void 0)return;let m=s+p,g=o[h];typeof d[r]=="string"&&(g=y.call(this,d[r])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),o[p]=g;function y(b){let x=this.opts.uriResolver.resolve;if(b=Sc(g?x(g,b):b),c.has(b))throw u(b);c.add(b);let k=this.refs[b];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?l(d,k.schema,b):b!==Sc(m)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=m),b}function v(b){if(typeof b=="string"){if(!X3.test(b))throw new Error(`invalid anchor "${b}"`);y.call(this,`#${b}`)}}}),a;function l(d,p,f){if(p!==void 0&&!V3(d,p))throw u(f)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Dr.getSchemaRefs=Y3});var jd=C(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.getData=_o.KeywordCxt=_o.validateFunctionCode=void 0;var rL=A1(),Y1=Od(),wx=dx(),gy=Od(),Q3=L1(),Rd=q1(),bx=B1(),ce=Te(),be=zi(),e5=Pd(),Ci=qe(),Ad=Td();function t5(t){if(oL(t)&&(sL(t),iL(t))){i5(t);return}nL(t,()=>(0,rL.topBoolOrEmptySchema)(t))}_o.validateFunctionCode=t5;function nL({gen:t,validateName:e,schema:r,schemaEnv:i,opts:n},o){n.code.es5?t.func(e,(0,ce._)`${be.default.data}, ${be.default.valCxt}`,i.$async,()=>{t.code((0,ce._)`"use strict"; ${Q1(r,n)}`),n5(t,n),t.code(o)}):t.func(e,(0,ce._)`${be.default.data}, ${r5(n)}`,i.$async,()=>t.code(Q1(r,n)).code(o))}function r5(t){return(0,ce._)`{${be.default.instancePath}="", ${be.default.parentData}, ${be.default.parentDataProperty}, ${be.default.rootData}=${be.default.data}${t.dynamicRef?(0,ce._)`, ${be.default.dynamicAnchors}={}`:ce.nil}}={}`}function n5(t,e){t.if(be.default.valCxt,()=>{t.var(be.default.instancePath,(0,ce._)`${be.default.valCxt}.${be.default.instancePath}`),t.var(be.default.parentData,(0,ce._)`${be.default.valCxt}.${be.default.parentData}`),t.var(be.default.parentDataProperty,(0,ce._)`${be.default.valCxt}.${be.default.parentDataProperty}`),t.var(be.default.rootData,(0,ce._)`${be.default.valCxt}.${be.default.rootData}`),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`${be.default.valCxt}.${be.default.dynamicAnchors}`)},()=>{t.var(be.default.instancePath,(0,ce._)`""`),t.var(be.default.parentData,(0,ce._)`undefined`),t.var(be.default.parentDataProperty,(0,ce._)`undefined`),t.var(be.default.rootData,be.default.data),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`{}`)})}function i5(t){let{schema:e,opts:r,gen:i}=t;nL(t,()=>{r.$comment&&e.$comment&&cL(t),l5(t),i.let(be.default.vErrors,null),i.let(be.default.errors,0),r.unevaluated&&o5(t),aL(t),f5(t)})}function o5(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ce._)`${r}.evaluated`),e.if((0,ce._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ce._)`${t.evaluated}.props`,(0,ce._)`undefined`)),e.if((0,ce._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ce._)`${t.evaluated}.items`,(0,ce._)`undefined`))}function Q1(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ce._)`/*# sourceURL=${r} */`:ce.nil}function s5(t,e){if(oL(t)&&(sL(t),iL(t))){a5(t,e);return}(0,rL.boolOrEmptySchema)(t,e)}function iL({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function oL(t){return typeof t.schema!="boolean"}function a5(t,e){let{schema:r,gen:i,opts:n}=t;n.$comment&&r.$comment&&cL(t),u5(t),d5(t);let o=i.const("_errs",be.default.errors);aL(t,o),i.var(e,(0,ce._)`${o} === ${be.default.errors}`)}function sL(t){(0,Ci.checkUnknownRules)(t),c5(t)}function aL(t,e){if(t.opts.jtd)return eL(t,[],!1,e);let r=(0,Y1.getSchemaTypes)(t.schema),i=(0,Y1.coerceAndCheckDataType)(t,r);eL(t,r,!i,e)}function c5(t){let{schema:e,errSchemaPath:r,opts:i,self:n}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,Ci.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function l5(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ci.checkStrictMode)(t,"default is ignored in the schema root")}function u5(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,e5.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function d5(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function cL({gen:t,schemaEnv:e,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)t.code((0,ce._)`${be.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let s=(0,ce.str)`${i}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,ce._)`${be.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function f5(t){let{gen:e,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=t;r.$async?e.if((0,ce._)`${be.default.errors} === 0`,()=>e.return(be.default.data),()=>e.throw((0,ce._)`new ${n}(${be.default.vErrors})`)):(e.assign((0,ce._)`${i}.errors`,be.default.vErrors),o.unevaluated&&p5(t),e.return((0,ce._)`${be.default.errors} === 0`))}function p5({gen:t,evaluated:e,props:r,items:i}){r instanceof ce.Name&&t.assign((0,ce._)`${e}.props`,r),i instanceof ce.Name&&t.assign((0,ce._)`${e}.items`,i)}function eL(t,e,r,i){let{gen:n,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Ci.schemaHasRulesButRef)(o,u))){n.block(()=>uL(t,"$ref",u.all.$ref.definition));return}c.jtd||h5(t,e),n.block(()=>{for(let p of u.rules)d(p);d(u.post)});function d(p){(0,wx.shouldUseGroup)(o,p)&&(p.type?(n.if((0,gy.checkDataType)(p.type,s,c.strictNumbers)),tL(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,gy.reportTypeError)(t)),n.endIf()):tL(t,p),a||n.if((0,ce._)`${be.default.errors} === ${i||0}`))}}function tL(t,e){let{gen:r,schema:i,opts:{useDefaults:n}}=t;n&&(0,Q3.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,wx.shouldUseRule)(i,o)&&uL(t,o.keyword,o.definition,e.type)})}function h5(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(m5(t,e),t.opts.allowUnionTypes||g5(t,e),y5(t,t.dataTypes))}function m5(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{lL(t.dataTypes,r)||$x(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),_5(t,e)}}function g5(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&$x(t,"use allowUnionTypes to allow union type keyword")}function y5(t,e){let r=t.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,wx.shouldUseRule)(t.schema,n)){let{type:o}=n.definition;o.length&&!o.some(s=>v5(e,s))&&$x(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function v5(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function lL(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function _5(t,e){let r=[];for(let i of t.dataTypes)lL(e,i)?r.push(i):e.includes("integer")&&i==="number"&&r.push("integer");t.dataTypes=r}function $x(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ci.checkStrictMode)(t,e,t.opts.strictTypes)}var yy=class{constructor(e,r,i){if((0,Rd.validateKeywordUsage)(e,r,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ci.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",dL(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Rd.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",be.default.errors))}result(e,r,i){this.failResult((0,ce.not)(e),r,i)}failResult(e,r,i){this.gen.if(e),i?i():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ce.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ce._)`${r} !== undefined && (${(0,ce.or)(this.invalid$data(),e)})`)}error(e,r,i){if(r){this.setParams(r),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,r){(e?Ad.reportExtraError:Ad.reportError)(this,this.def.error,r)}$dataError(){(0,Ad.reportError)(this,this.def.$dataError||Ad.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ad.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,i=ce.nil){this.gen.block(()=>{this.check$data(e,i),r()})}check$data(e=ce.nil,r=ce.nil){if(!this.$data)return;let{gen:i,schemaCode:n,schemaType:o,def:s}=this;i.if((0,ce.or)((0,ce._)`${n} === undefined`,r)),e!==ce.nil&&i.assign(e,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==ce.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:i,def:n,it:o}=this;return(0,ce.or)(s(),a());function s(){if(i.length){if(!(r instanceof ce.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,ce._)`${(0,gy.checkDataTypes)(c,r,o.opts.strictNumbers,gy.DataType.Wrong)}`}return ce.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,ce._)`!${c}(${r})`}return ce.nil}}subschema(e,r){let i=(0,bx.getSubschema)(this.it,e);(0,bx.extendSubschemaData)(i,this.it,e),(0,bx.extendSubschemaMode)(i,e);let n={...this.it,...i,items:void 0,props:void 0};return s5(n,r),n}mergeEvaluated(e,r){let{it:i,gen:n}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=Ci.mergeEvaluated.props(n,e.props,i.props,r)),i.items!==!0&&e.items!==void 0&&(i.items=Ci.mergeEvaluated.items(n,e.items,i.items,r)))}mergeValidEvaluated(e,r){let{it:i,gen:n}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,ce.Name)),!0}};_o.KeywordCxt=yy;function uL(t,e,r,i){let n=new yy(t,r,e);"code"in r?r.code(n,i):n.$data&&r.validate?(0,Rd.funcKeywordCode)(n,r):"macro"in r?(0,Rd.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Rd.funcKeywordCode)(n,r)}var b5=/^\/(?:[^~]|~0|~1)*$/,w5=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function dL(t,{dataLevel:e,dataNames:r,dataPathArr:i}){let n,o;if(t==="")return be.default.rootData;if(t[0]==="/"){if(!b5.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,o=be.default.rootData}else{let l=w5.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(n=l[2],n==="#"){if(u>=e)throw new Error(c("property/index",u));return i[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!n)return o}let s=o,a=n.split("/");for(let l of a)l&&(o=(0,ce._)`${o}${(0,ce.getProperty)((0,Ci.unescapeJsonPointer)(l))}`,s=(0,ce._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}_o.getData=dL});var vy=C(Sx=>{"use strict";Object.defineProperty(Sx,"__esModule",{value:!0});var kx=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Sx.default=kx});var zd=C(Ex=>{"use strict";Object.defineProperty(Ex,"__esModule",{value:!0});var xx=Pd(),Ix=class extends Error{constructor(e,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,xx.resolveUrl)(e,r,i),this.missingSchema=(0,xx.normalizeId)((0,xx.getFullPath)(e,this.missingRef))}};Ex.default=Ix});var by=C(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.resolveSchema=hn.getCompilingSchema=hn.resolveRef=hn.compileSchema=hn.SchemaEnv=void 0;var zn=Te(),$5=vy(),Es=zi(),Cn=Pd(),fL=qe(),k5=jd(),xc=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Cn.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};hn.SchemaEnv=xc;function Ox(t){let e=pL.call(this,t);if(e)return e;let r=(0,Cn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,s=new zn.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:$5.default,code:(0,zn._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:Es.default.data,parentData:Es.default.parentData,parentDataProperty:Es.default.parentDataProperty,dataNames:[Es.default.data],dataPathArr:[zn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,zn.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:zn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,zn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,k5.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(Es.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let f=new Function(`${Es.default.self}`,`${Es.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:m}=l;f.evaluated={props:h instanceof zn.Name?void 0:h,items:m instanceof zn.Name?void 0:m,dynamicProps:h instanceof zn.Name,dynamicItems:m instanceof zn.Name},f.source&&(f.source.evaluated=(0,zn.stringify)(f.evaluated))}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}hn.compileSchema=Ox;function S5(t,e,r){var i;r=(0,Cn.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let o=E5.call(this,t,r);if(o===void 0){let s=(i=t.localRefs)===null||i===void 0?void 0:i[r],{schemaId:a}=this.opts;s&&(o=new xc({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=x5.call(this,o)}hn.resolveRef=S5;function x5(t){return(0,Cn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Ox.call(this,t)}function pL(t){for(let e of this._compilations)if(I5(e,t))return e}hn.getCompilingSchema=pL;function I5(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function E5(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||_y.call(this,t,e)}function _y(t,e){let r=this.opts.uriResolver.parse(e),i=(0,Cn._getFullPath)(this.opts.uriResolver,r),n=(0,Cn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===n)return Tx.call(this,r,t);let o=(0,Cn.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=_y.call(this,t,s);return typeof a?.schema!="object"?void 0:Tx.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Ox.call(this,s),o===(0,Cn.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(n=(0,Cn.resolveUrl)(this.opts.uriResolver,n,l)),new xc({schema:a,schemaId:c,root:t,baseId:n})}return Tx.call(this,r,s)}}hn.resolveSchema=_y;var T5=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Tx(t,{baseId:e,schema:r,root:i}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,fL.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!T5.has(a)&&l&&(e=(0,Cn.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,fL.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Cn.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=_y.call(this,i,a)}let{schemaId:s}=this.opts;if(o=o||new xc({schema:r,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}});var hL=C((Ffe,O5)=>{O5.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Cx=C((Zfe,wL)=>{"use strict";var P5=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Ax=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),A5=RegExp.prototype.test.bind(/^\d*$/u),Ts=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Rx=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),gL=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),jx=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),R5=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Lr=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)Lr[e]="%"+t[e>>4]+t[e&15]}function dr(t){return t<2048?Lr[192|t>>6]+Lr[128|t&63]:t<65536?Lr[224|t>>12]+Lr[128|t>>6&63]+Lr[128|t&63]:Lr[240|t>>18]+Lr[128|t>>12&63]+Lr[128|t>>6&63]+Lr[128|t&63]}function j5(t){let e="",r=0,i=0;for(i=0;i<t.length;i++)if(r=t[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(r=t[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i]}return e}var z5=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),C5=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),N5=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),D5=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function L5(t){if(t.length===0)return!1;for(let e=0;e<t.length;e++)if(!N5(t[e])){if(t[e]==="%"&&e+2<t.length&&Ts(t.slice(e+1,e+3))){e+=2;continue}return!1}return!0}function mL(t){let e=-1,r=0,i=-1,n=0;for(let a=0;a<t.length;a++)t[a]==="0"?(i===-1&&(i=a),n++,n>r&&(r=n,e=i)):(i=-1,n=0);if(r<2)return t.join(":");let o=t.slice(0,e).join(":"),s=t.slice(e+r).join(":");return o+"::"+s}function U5(t){let e=t.indexOf("::");if(e!==-1&&t.indexOf("::",e+1)!==-1)return;let r=e===-1?t.split(":"):t.slice(0,e).split(":"),i=e===-1?[]:t.slice(e+2).split(":");e!==-1&&(r.length===1&&r[0]===""&&(r.length=0),i.length===1&&i[0]===""&&(i.length=0));let n=r.concat(i),o=0;for(let a=0;a<n.length;a++){let c=n[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==n.length-1||e!==-1&&i.length===0||!Ax(c))return;o+=2;continue}if(!z5(c))return;n[a]=parseInt(c,16).toString(16),o++}if(e===-1)return o!==8?void 0:mL(n);if(o>=8)return;let s=n.slice(0,r.length);for(let a=o;a<8;a++)s.push("0");for(let a=r.length;a<n.length;a++)s.push(n[a]);return mL(s)}function Px(t){let e=t[0]==="["&&t[t.length-1]==="]";if((t[0]==="["||t[t.length-1]==="]")&&!e)return{host:t,isIPV6:!1,error:!0};let i=e?t.slice(1,-1):t;if(e&&C5(i))return i=i.toLowerCase(),{host:`[${i}]`,escapedHost:i,isIPV6:!1,isIPVFuture:!0};if(M5(i,":")<2)return{host:t,isIPV6:!1,error:e};let n="",o=i.indexOf("%");if(o!==-1){let a=i.slice(o,o+3).toLowerCase()==="%25"?3:1;if(n=i.slice(o+a),!L5(n))return{host:t,isIPV6:!1,error:!0};i=i.slice(0,o)}let s=U5(i);return s===void 0?{host:t,isIPV6:!1,error:!0}:{host:s+(n?"%"+n:""),escapedHost:s+(n?"%25"+n:""),isIPV6:!0}}function M5(t,e){let r=0;for(let i=0;i<t.length;i++)t[i]===e&&r++;return r}function F5(t){let e=t,r=[],i=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((i=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,i)),e=e.slice(i)}return r.join("")}var Z5={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},q5=/[@/?#:]/g,V5=/[@/?#]/g;function yL(t,e){let r=e?V5:q5;return r.lastIndex=0,t.replace(r,i=>Z5[i])}function vL(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let n=t.slice(i+1,i+3);if(Ts(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&Rx(s)?r+=s:r+="%"+o,i+=2;continue}}r+=t[i]}return r}function B5(t){let e="";for(let r=0;r<t.length;r++){let i=t[r];if(i==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Ts(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));s!=="."&&Rx(s)?e+=s:e+="%"+o,r+=2;continue}}if(gL(i))e+=i;else{let n=t.charCodeAt(r);if(n<128)e+=bL(n)?i:Lr[n];else if(n<55296||n>57343)e+=dr(n);else if(n<=56319&&r+1<t.length){let o=t.charCodeAt(r+1);o>=56320&&o<=57343?(e+=dr(65536+(n-55296<<10)+(o-56320)),r++):e+=dr(65533)}else e+=dr(65533)}}return e}function H5(t,e=!1){let r="",i=e&&t[0]!=="/";for(let n=0;n<t.length;n++){let o=t[n];if(o==="%"&&n+2<t.length){let s=t.slice(n+1,n+3);if(Ts(s)){r+="%"+s.toUpperCase(),n+=2;continue}}if(o==="/"&&(i=!1),gL(o)&&(o!==":"||!i))r+=o;else{let s=t.charCodeAt(n);if(s<128)r+=Lr[s];else if(s<55296||s>57343)r+=dr(s);else if(s<=56319&&n+1<t.length){let a=t.charCodeAt(n+1);a>=56320&&a<=57343?(r+=dr(65536+(s-55296<<10)+(a-56320)),n++):r+=dr(65533)}else r+=dr(65533)}}return r}function zx(t,e){let r="";for(let i=0;i<t.length;i++){let n=t[i];if(n==="%"&&i+2<t.length){let o=t.slice(i+1,i+3);if(Ts(o)){r+="%"+o.toUpperCase(),i+=2;continue}}if(e(n))r+=n;else{let o=t.charCodeAt(i);if(o<128)r+=Lr[o];else if(o<55296||o>57343)r+=dr(o);else if(o<=56319&&i+1<t.length){let s=t.charCodeAt(i+1);s>=56320&&s<=57343?(r+=dr(65536+(o-55296<<10)+(s-56320)),i++):r+=dr(65533)}else r+=dr(65533)}}return r}function _L(t){return zx(t,R5)}function W5(t){return zx(t,jx)}function K5(t){return zx(t,jx)}function bL(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}function G5(t){let e="";for(let r=0;r<t.length;r++){let i=t[r];if(i==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Ts(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));Rx(s)?e+=s:e+="%"+o,r+=2;continue}}if(jx(i))e+=i;else{let n=t.charCodeAt(r);if(n<128)e+=bL(n)?i:Lr[n];else if(n<55296||n>57343)e+=dr(n);else if(n<=56319&&r+1<t.length){let o=t.charCodeAt(r+1);o>=56320&&o<=57343?(e+=dr(65536+(n-55296<<10)+(o-56320)),r++):e+=dr(65533)}else e+=dr(65533)}}return e}function J5(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let i=t.slice(r+1,r+3);if(Ts(i)){e+="%"+i.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function X5(t){let e=[];if(t.userinfo!==void 0&&(e.push(_L(t.userinfo)),e.push("@")),t.host!==void 0){let r=t.host;if(!Ax(r)){let i=Px(r);i.isIPV6!==!0&&i.isIPVFuture!==!0&&(r=vL(r,!0),i=Px(r)),i.isIPV6===!0||i.isIPVFuture===!0?r=`[${i.escapedHost}]`:r=yL(r,!1)}e.push(r)}if(typeof t.port=="number"||typeof t.port=="string"){let r=String(t.port);if(!A5(r))throw new TypeError("URI port is malformed.");e.push(":"),e.push(r)}return e.length?e.join(""):void 0}wL.exports={nonSimpleDomain:D5,recomposeAuthority:X5,reescapeHostDelimiters:yL,normalizePercentEncoding:vL,normalizePathEncoding:B5,serializePathEncoding:H5,normalizeQueryFragmentEncoding:G5,encodeUserinfo:_L,encodeQuery:W5,encodeFragment:K5,escapePreservingEscapes:J5,removeDotSegments:F5,isIPv4:Ax,isUUID:P5,normalizeIPv6:Px,stringArrayToHexStripped:j5}});var IL=C((qfe,xL)=>{"use strict";var{isUUID:Y5}=Cx(),Q5=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,e8=["http","https","ws","wss","urn","urn:uuid"];function t8(t){return e8.indexOf(t)!==-1}function Nx(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function $L(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function kL(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function r8(t){return t.secure=Nx(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function n8(t){if((t.port===(Nx(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let e=t.resourceName.indexOf("?"),r=e===-1?t.resourceName:t.resourceName.slice(0,e);t.path=r&&r!=="/"?r:void 0,t.query=e===-1?void 0:t.resourceName.slice(e+1),t.resourceName=void 0}return t.fragment=void 0,t}function i8(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Q5);if(r&&r[0]===t.path){let i=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${i}:${e.nid||t.nid}`,o=Dx(n);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function o8(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),n=`${r}:${e.nid||i}`,o=Dx(n);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${i||e.nid}:${a}`,e.skipEscape=!0,s}function s8(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Y5(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function a8(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var SL={scheme:"http",domainHost:!0,parse:$L,serialize:kL},c8={scheme:"https",domainHost:SL.domainHost,parse:$L,serialize:kL},wy={scheme:"ws",domainHost:!0,parse:r8,serialize:n8},l8={scheme:"wss",domainHost:wy.domainHost,parse:wy.parse,serialize:wy.serialize},u8={scheme:"urn",parse:i8,serialize:o8,skipNormalize:!0},d8={scheme:"urn:uuid",parse:s8,serialize:a8,skipNormalize:!0},$y={http:SL,https:c8,ws:wy,wss:l8,urn:u8,"urn:uuid":d8};Object.setPrototypeOf($y,null);function Dx(t){return t&&($y[t]||$y[t.toLowerCase()])||void 0}xL.exports={wsIsSecure:Nx,SCHEMES:$y,isValidSchemeName:t8,getSchemeHandler:Dx}});var UL=C((Vfe,xy)=>{"use strict";var{normalizeIPv6:AL,removeDotSegments:Nd,recomposeAuthority:f8,normalizePercentEncoding:Lx,normalizePathEncoding:p8,serializePathEncoding:EL,normalizeQueryFragmentEncoding:TL,encodeQuery:h8,encodeFragment:m8,reescapeHostDelimiters:g8,isIPv4:RL,nonSimpleDomain:y8}=Cx(),{SCHEMES:jL,getSchemeHandler:Ux}=IL(),zL=/^[A-Za-z][A-Za-z0-9+.-]*$/u,CL="URI scheme is malformed.";function OL(t){let e=unescape(String(t));if(!zL.test(e))throw new TypeError(CL);return e}function v8(t,e){return typeof t=="string"?t=I8(t,e):typeof t=="object"&&(t=Sy(Os(t,e),e)),t}function _8(t,e,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:n,malformedAuthorityOrPort:o,malformedPercentEncoding:s,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:l}=ky(t,i),{parsed:u,malformedAuthorityOrPort:d,malformedPercentEncoding:p,malformedSchemeSpecific:f,malformedHost:h,malformedScheme:m}=ky(e,i);if(o||d||s||p||a||f||c||h||l||m)throw new Error(n.error||u.error||"URI is malformed.");let g=NL(n,u,i,!0),y=Ux(r&&r.scheme||g.scheme),v=g.host,b=v!==void 0&&v!==""&&(RL(v)||AL(v).isIPV6);DL(g,r||{},y,b);let x=v&&v.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(v);if(g.error&&!x)throw new Error(g.error);return i.skipEscape=!0,Os(g,i)}function NL(t,e,r,i){let n={};return i||(t=Sy(Os(t,r),r),e=Sy(Os(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Nd(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Nd(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Nd(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Nd(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function b8(t,e,r){let i=PL(t,r),n=PL(e,r);return i!==void 0&&n!==void 0&&i===n}function Os(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),n=[];r.scheme&&(r.scheme=OL(r.scheme));let o=Ux(i.scheme||r.scheme);o&&o.serialize&&o.serialize(r,i);let s=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=!i.skipEscape&&r.scheme===void 0&&!s;r.path!==void 0&&(i.skipEscape?r.path=Lx(r.path):r.path=EL(r.path,a)),i.reference!=="suffix"&&r.scheme&&(r.scheme=OL(r.scheme),n.push(r.scheme,":"));let c=f8(r);if(c!==void 0&&(i.reference!=="suffix"&&n.push("//"),n.push(c),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let l=r.path;!i.absolutePath&&(!o||!o.absolutePath)&&(l=Nd(l)),a&&(l=EL(l,!0)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),n.push(l)}return r.query!==void 0&&n.push("?",h8(r.query)),r.fragment!==void 0&&n.push("#",m8(r.fragment)),n.join("")}var w8=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,$8=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,k8=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function S8(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Cd(t){if(t===void 0)return!1;let e=t.indexOf("%");for(;e!==-1;){if(e+2>=t.length||!/^[\da-f]{2}$/iu.test(t.slice(e+1,e+3)))return!0;e=t.indexOf("%",e+3)}return!1}function Mx(t){return t[0]==="["&&t[t.length-1]==="]"}function x8(t){let e=t[4];return Cd(t[3])||e!==void 0&&!Mx(e)&&Cd(e)||Cd(t[6])||Cd(t[7])||Cd(t[8])}function DL(t,e,r,i){if(!e.unicodeSupport&&(!r||!r.unicodeSupport)&&t.host&&!Mx(t.host)&&(e.domainHost||r&&r.domainHost)&&i===!1&&y8(t.host))try{t.host=new URL("http://"+t.host).hostname}catch(n){return t.error=t.error||"Host's domain name can not be converted to ASCII: "+n,!0}return!1}function ky(t,e){let r=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,o=!1,s=!1,a=!1,c=!1,l=!1,u=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let d=t.match($8);d!==null&&d[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",n=!0);let p=t.match(k8);if(p!==null){let h=p[1],m=h.replace(/[\t\n\r]/g,"");m.length>=2&&(m.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",n=!0):h.length!==m.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",n=!0))}let f=t.match(w8);if(f){if(i.scheme=f[1],i.userinfo=f[3],i.host=f[4],i.port=parseInt(f[5],10),i.path=f[6]||"",i.query=f[7],i.fragment=f[8],i.scheme!==void 0){let g=unescape(i.scheme);zL.test(g)?i.scheme=g.toLowerCase():(i.error=i.error||CL,l=!0)}o=x8(f),o&&(i.error=i.error||"URI contains malformed percent-encoding."),isNaN(i.port)&&(i.port=f[5]);let h=S8(i,f);if(h!==void 0&&(i.error=i.error||h,n=!0),i.host)if(RL(i.host)===!1){let y=Mx(i.host),v=i.host.indexOf("[")!==-1||i.host.indexOf("]")!==-1,b=AL(i.host);u=b.isIPV6||b.isIPVFuture===!0,c=v&&(!y||b.error===!0),i.host=u?b.host:b.host.toLowerCase(),c&&(i.error=i.error||"URI host is malformed.",n=!0)}else u=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let m=Ux(r.scheme||i.scheme);if(c||(a=DL(i,r,m,u)),t.indexOf("%")!==-1&&i.host!==void 0&&!c){let g=u?i.host:Lx(i.host,!0);u||(g=Lx(g.toLowerCase())),i.host=g8(g,u)}(!m||m&&!m.skipNormalize)&&(i.path&&(i.path=p8(i.path)),i.query&&(i.query=TL(i.query)),i.fragment&&(i.fragment=TL(i.fragment))),m&&m.parse&&(m.parse(i,r),m===jL.urn&&i.nid===void 0&&(s=!0))}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:s,malformedHost:a,malformedScheme:l}}function Sy(t,e){return ky(t,e).parsed}function I8(t,e){return LL(t,e).normalized}function LL(t,e){let{parsed:r,malformedAuthorityOrPort:i,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:s,malformedScheme:a}=ky(t,e);return{normalized:i||n||o||s||a?t:Os(r,e),malformedAuthorityOrPort:i,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:s,malformedScheme:a}}function PL(t,e){if(typeof t!="string"&&typeof t!="object")return;let r;try{r=typeof t=="string"?t:Os(t,e)}catch{return}let{normalized:i,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:s,malformedHost:a,malformedScheme:c}=LL(r,e);return n||o||s||a||c?void 0:i}var Fx={SCHEMES:jL,normalize:v8,resolve:_8,resolveComponent:NL,equal:b8,serialize:Os,parse:Sy};xy.exports=Fx;xy.exports.default=Fx;xy.exports.fastUri=Fx});var FL=C(Zx=>{"use strict";Object.defineProperty(Zx,"__esModule",{value:!0});var ML=UL();ML.code='require("ajv/dist/runtime/uri").default';Zx.default=ML});var GL=C(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.CodeGen=nr.Name=nr.nil=nr.stringify=nr.str=nr._=nr.KeywordCxt=void 0;var E8=jd();Object.defineProperty(nr,"KeywordCxt",{enumerable:!0,get:function(){return E8.KeywordCxt}});var Ic=Te();Object.defineProperty(nr,"_",{enumerable:!0,get:function(){return Ic._}});Object.defineProperty(nr,"str",{enumerable:!0,get:function(){return Ic.str}});Object.defineProperty(nr,"stringify",{enumerable:!0,get:function(){return Ic.stringify}});Object.defineProperty(nr,"nil",{enumerable:!0,get:function(){return Ic.nil}});Object.defineProperty(nr,"Name",{enumerable:!0,get:function(){return Ic.Name}});Object.defineProperty(nr,"CodeGen",{enumerable:!0,get:function(){return Ic.CodeGen}});var T8=vy(),HL=zd(),O8=ux(),Dd=by(),P8=Te(),Ld=Pd(),Iy=Od(),Vx=qe(),ZL=hL(),A8=FL(),WL=(t,e)=>new RegExp(t,e);WL.code="new RegExp";var R8=["removeAdditional","useDefaults","coerceTypes"],j8=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),z8={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},C8={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},qL=200;function N8(t){var e,r,i,n,o,s,a,c,l,u,d,p,f,h,m,g,y,v,b,x,k,E,O,X,le;let $e=t.strict,q=(e=t.code)===null||e===void 0?void 0:e.optimize,Re=q===!0||q===void 0?1:q||0,de=(i=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:WL,pt=(n=t.uriResolver)!==null&&n!==void 0?n:A8.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:$e)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:$e)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:$e)!==null&&u!==void 0?u:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:$e)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=t.strictRequired)!==null&&f!==void 0?f:$e)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:Re,regExp:de}:{optimize:Re,regExp:de},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:qL,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:qL,meta:(y=t.meta)!==null&&y!==void 0?y:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(x=t.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(k=t.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(E=t.validateSchema)!==null&&E!==void 0?E:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(X=t.unicodeRegExp)!==null&&X!==void 0?X:!0,int32range:(le=t.int32range)!==null&&le!==void 0?le:!0,uriResolver:pt}}var Ud=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...N8(e)};let{es5:r,lines:i}=this.opts.code;this.scope=new P8.ValueScope({scope:{},prefixes:j8,es5:r,lines:i}),this.logger=Z8(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,O8.getRules)(),VL.call(this,z8,e,"NOT SUPPORTED"),VL.call(this,C8,e,"DEPRECATED","warn"),this._metaOpts=M8.call(this),e.formats&&L8.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&U8.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),D8.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:i}=this.opts,n=ZL;i==="id"&&(n={...ZL},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let n=i(r);return"$async"in i||(this.errors=i.errors),n}compile(e,r){let i=this._addSchema(e,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return n.call(this,e,r);async function n(u,d){await o.call(this,u.$schema);let p=this._addSchema(u,d);return p.validate||s.call(this,p)}async function o(u){u&&!this.getSchema(u)&&await n.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof HL.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=i(u))}finally{delete this._loading[u]}}}addSchema(e,r,i,n=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,i,n);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Ld.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,i,r,n,!0),this}addMetaSchema(e,r,i=this.opts.validateSchema){return this.addSchema(e,r,!0,i),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let i;if(i=e.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(i,e);if(!n&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return n}getSchema(e){let r;for(;typeof(r=BL.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Dd.SchemaEnv({schema:{},schemaId:i});if(r=Dd.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=BL.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let i=e[this.opts.schemaId];return i&&(i=(0,Ld.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let i;if(typeof e=="string")i=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof e=="object"&&r===void 0){if(r=e,i=r.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(V8.call(this,i,r),!r)return(0,Vx.eachItem)(i,o=>qx.call(this,o)),this;H8.call(this,r);let n={...r,type:(0,Iy.getJSONTypes)(r.type),schemaType:(0,Iy.getJSONTypes)(r.schemaType)};return(0,Vx.eachItem)(i,n.type.length===0?o=>qx.call(this,o,n):o=>n.type.forEach(s=>qx.call(this,o,n,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let i of r.rules){let n=i.rules.findIndex(o=>o.keyword===e);n>=0&&i.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${i}${n.instancePath} ${n.message}`).reduce((n,o)=>n+r+o)}$dataMetaSchema(e,r){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let o=n.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in i){let c=i[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=KL(u))}}return e}_removeAllSchemas(e,r){for(let i in e){let n=e[i];(!r||r.test(i))&&(typeof n=="string"?delete e[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[i]))}}_addSchema(e,r,i,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;i=(0,Ld.normalizeId)(s||i);let l=Ld.getSchemaRefs.call(this,e,i);return c=new Dd.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:i,localRefs:l}),this._cache.set(c.schema,c),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Dd.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Dd.compileSchema.call(this,e)}finally{this.opts=r}}};Ud.ValidationError=T8.default;Ud.MissingRefError=HL.default;nr.default=Ud;function VL(t,e,r,i="error"){for(let n in t){let o=n;o in e&&this.logger[i](`${r}: option ${n}. ${t[o]}`)}}function BL(t){return t=(0,Ld.normalizeId)(t),this.schemas[t]||this.refs[t]}function D8(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function L8(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function U8(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function M8(){let t={...this.opts};for(let e of R8)delete t[e];return t}var F8={log(){},warn(){},error(){}};function Z8(t){if(t===!1)return F8;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var q8=/^[a-z_$][a-z0-9_$:-]*$/i;function V8(t,e){let{RULES:r}=this;if((0,Vx.eachItem)(t,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!q8.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function qx(t,e,r){var i;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=n?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,Iy.getJSONTypes)(e.type),schemaType:(0,Iy.getJSONTypes)(e.schemaType)}};e.before?B8.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(i=e.implements)===null||i===void 0||i.forEach(c=>this.addKeyword(c))}function B8(t,e,r){let i=t.rules.findIndex(n=>n.keyword===r);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function H8(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=KL(e)),t.validateSchema=this.compile(e,!0))}var W8={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function KL(t){return{anyOf:[t,W8]}}});var JL=C(Bx=>{"use strict";Object.defineProperty(Bx,"__esModule",{value:!0});var K8={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Bx.default=K8});var eU=C(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.callRef=Ps.getValidate=void 0;var G8=zd(),XL=pn(),Ur=Te(),Ec=zi(),YL=by(),Ey=qe(),J8={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:i}=t,{baseId:n,schemaEnv:o,validateName:s,opts:a,self:c}=i,{root:l}=o;if((r==="#"||r==="#/")&&n===l.baseId)return d();let u=YL.resolveRef.call(c,l,n,r);if(u===void 0)throw new G8.default(i.opts.uriResolver,n,r);if(u instanceof YL.SchemaEnv)return p(u);return f(u);function d(){if(o===l)return Ty(t,s,o,o.$async);let h=e.scopeValue("root",{ref:l});return Ty(t,(0,Ur._)`${h}.validate`,l,l.$async)}function p(h){let m=QL(t,h);Ty(t,m,h,h.$async)}function f(h){let m=e.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,Ur.stringify)(h)}:{ref:h}),g=e.name("valid"),y=t.subschema({schema:h,dataTypes:[],schemaPath:Ur.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(y),t.ok(g)}}};function QL(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ur._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ps.getValidate=QL;function Ty(t,e,r,i){let{gen:n,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Ec.default.this:Ur.nil;i?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=n.let("valid");n.try(()=>{n.code((0,Ur._)`await ${(0,XL.callValidateCode)(t,e,l)}`),f(e),s||n.assign(h,!0)},m=>{n.if((0,Ur._)`!(${m} instanceof ${o.ValidationError})`,()=>n.throw(m)),p(m),s||n.assign(h,!1)}),t.ok(h)}function d(){t.result((0,XL.callValidateCode)(t,e,l),()=>f(e),()=>p(e))}function p(h){let m=(0,Ur._)`${h}.errors`;n.assign(Ec.default.vErrors,(0,Ur._)`${Ec.default.vErrors} === null ? ${m} : ${Ec.default.vErrors}.concat(${m})`),n.assign(Ec.default.errors,(0,Ur._)`${Ec.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=Ey.mergeEvaluated.props(n,g.props,o.props));else{let y=n.var("props",(0,Ur._)`${h}.evaluated.props`);o.props=Ey.mergeEvaluated.props(n,y,o.props,Ur.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=Ey.mergeEvaluated.items(n,g.items,o.items));else{let y=n.var("items",(0,Ur._)`${h}.evaluated.items`);o.items=Ey.mergeEvaluated.items(n,y,o.items,Ur.Name)}}}Ps.callRef=Ty;Ps.default=J8});var tU=C(Hx=>{"use strict";Object.defineProperty(Hx,"__esModule",{value:!0});var X8=JL(),Y8=eU(),Q8=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",X8.default,Y8.default];Hx.default=Q8});var rU=C(Wx=>{"use strict";Object.defineProperty(Wx,"__esModule",{value:!0});var Oy=Te(),bo=Oy.operators,Py={maximum:{okStr:"<=",ok:bo.LTE,fail:bo.GT},minimum:{okStr:">=",ok:bo.GTE,fail:bo.LT},exclusiveMaximum:{okStr:"<",ok:bo.LT,fail:bo.GTE},exclusiveMinimum:{okStr:">",ok:bo.GT,fail:bo.LTE}},eX={message:({keyword:t,schemaCode:e})=>(0,Oy.str)`must be ${Py[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Oy._)`{comparison: ${Py[t].okStr}, limit: ${e}}`},tX={keyword:Object.keys(Py),type:"number",schemaType:"number",$data:!0,error:eX,code(t){let{keyword:e,data:r,schemaCode:i}=t;t.fail$data((0,Oy._)`${r} ${Py[e].fail} ${i} || isNaN(${r})`)}};Wx.default=tX});var nU=C(Kx=>{"use strict";Object.defineProperty(Kx,"__esModule",{value:!0});var Md=Te(),rX={message:({schemaCode:t})=>(0,Md.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Md._)`{multipleOf: ${t}}`},nX={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:rX,code(t){let{gen:e,data:r,schemaCode:i,it:n}=t,o=n.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Md._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Md._)`${s} !== parseInt(${s})`;t.fail$data((0,Md._)`(${i} === 0 || (${s} = ${r}/${i}, ${a}))`)}};Kx.default=nX});var oU=C(Gx=>{"use strict";Object.defineProperty(Gx,"__esModule",{value:!0});function iU(t){let e=t.length,r=0,i=0,n;for(;i<e;)r++,n=t.charCodeAt(i++),n>=55296&&n<=56319&&i<e&&(n=t.charCodeAt(i),(n&64512)===56320&&i++);return r}Gx.default=iU;iU.code='require("ajv/dist/runtime/ucs2length").default'});var sU=C(Jx=>{"use strict";Object.defineProperty(Jx,"__esModule",{value:!0});var As=Te(),iX=qe(),oX=oU(),sX={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,As.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,As._)`{limit: ${t}}`},aX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:sX,code(t){let{keyword:e,data:r,schemaCode:i,it:n}=t,o=e==="maxLength"?As.operators.GT:As.operators.LT,s=n.opts.unicode===!1?(0,As._)`${r}.length`:(0,As._)`${(0,iX.useFunc)(t.gen,oX.default)}(${r})`;t.fail$data((0,As._)`${s} ${o} ${i}`)}};Jx.default=aX});var aU=C(Xx=>{"use strict";Object.defineProperty(Xx,"__esModule",{value:!0});var cX=pn(),lX=qe(),Tc=Te(),uX={message:({schemaCode:t})=>(0,Tc.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Tc._)`{pattern: ${t}}`},dX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:uX,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Tc._)`new RegExp`:(0,lX.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Tc._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Tc._)`!${u}`)}else{let c=(0,cX.usePattern)(t,n);t.fail$data((0,Tc._)`!${c}.test(${r})`)}}};Xx.default=dX});var cU=C(Yx=>{"use strict";Object.defineProperty(Yx,"__esModule",{value:!0});var Fd=Te(),fX={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Fd.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Fd._)`{limit: ${t}}`},pX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:fX,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxProperties"?Fd.operators.GT:Fd.operators.LT;t.fail$data((0,Fd._)`Object.keys(${r}).length ${n} ${i}`)}};Yx.default=pX});var lU=C(Qx=>{"use strict";Object.defineProperty(Qx,"__esModule",{value:!0});var Zd=pn(),qd=Te(),hX=qe(),mX={message:({params:{missingProperty:t}})=>(0,qd.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,qd._)`{missingProperty: ${t}}`},gX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:mX,code(t){let{gen:e,schema:r,schemaCode:i,data:n,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let f=t.parentSchema.properties,{definedProperties:h}=t.it;for(let m of r)if(f?.[m]===void 0&&!h.has(m)){let g=s.schemaEnv.baseId+s.errSchemaPath,y=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,hX.checkStrictMode)(s,y,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(qd.nil,d);else for(let f of r)(0,Zd.checkReportMissingProp)(t,f)}function u(){let f=e.let("missing");if(c||o){let h=e.let("valid",!0);t.block$data(h,()=>p(f,h)),t.ok(h)}else e.if((0,Zd.checkMissingProp)(t,r,f)),(0,Zd.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",i,f=>{t.setParams({missingProperty:f}),e.if((0,Zd.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,h){t.setParams({missingProperty:f}),e.forOf(f,i,()=>{e.assign(h,(0,Zd.propertyInData)(e,n,f,a.ownProperties)),e.if((0,qd.not)(h),()=>{t.error(),e.break()})},qd.nil)}}};Qx.default=gX});var uU=C(eI=>{"use strict";Object.defineProperty(eI,"__esModule",{value:!0});var Vd=Te(),yX={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Vd.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Vd._)`{limit: ${t}}`},vX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:yX,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxItems"?Vd.operators.GT:Vd.operators.LT;t.fail$data((0,Vd._)`${r}.length ${n} ${i}`)}};eI.default=vX});var Ay=C(tI=>{"use strict";Object.defineProperty(tI,"__esModule",{value:!0});var dU=vx();dU.code='require("ajv/dist/runtime/equal").default';tI.default=dU});var fU=C(nI=>{"use strict";Object.defineProperty(nI,"__esModule",{value:!0});var rI=Od(),ir=Te(),_X=qe(),bX=Ay(),wX={message:({params:{i:t,j:e}})=>(0,ir.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ir._)`{i: ${t}, j: ${e}}`},$X={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:wX,code(t){let{gen:e,data:r,$data:i,schema:n,parentSchema:o,schemaCode:s,it:a}=t;if(!i&&!n)return;let c=e.let("valid"),l=o.items?(0,rI.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,ir._)`${s} === false`),t.ok(c);function u(){let h=e.let("i",(0,ir._)`${r}.length`),m=e.let("j");t.setParams({i:h,j:m}),e.assign(c,!0),e.if((0,ir._)`${h} > 1`,()=>(d()?p:f)(h,m))}function d(){return l.length>0&&!l.some(h=>h==="object"||h==="array")}function p(h,m){let g=e.name("item"),y=(0,rI.checkDataTypes)(l,g,a.opts.strictNumbers,rI.DataType.Wrong),v=e.const("indices",(0,ir._)`{}`);e.for((0,ir._)`;${h}--;`,()=>{e.let(g,(0,ir._)`${r}[${h}]`),e.if(y,(0,ir._)`continue`),l.length>1&&e.if((0,ir._)`typeof ${g} == "string"`,(0,ir._)`${g} += "_"`),e.if((0,ir._)`typeof ${v}[${g}] == "number"`,()=>{e.assign(m,(0,ir._)`${v}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,ir._)`${v}[${g}] = ${h}`)})}function f(h,m){let g=(0,_X.useFunc)(e,bX.default),y=e.name("outer");e.label(y).for((0,ir._)`;${h}--;`,()=>e.for((0,ir._)`${m} = ${h}; ${m}--;`,()=>e.if((0,ir._)`${g}(${r}[${h}], ${r}[${m}])`,()=>{t.error(),e.assign(c,!1).break(y)})))}}};nI.default=$X});var pU=C(oI=>{"use strict";Object.defineProperty(oI,"__esModule",{value:!0});var iI=Te(),kX=qe(),SX=Ay(),xX={message:"must be equal to constant",params:({schemaCode:t})=>(0,iI._)`{allowedValue: ${t}}`},IX={keyword:"const",$data:!0,error:xX,code(t){let{gen:e,data:r,$data:i,schemaCode:n,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,iI._)`!${(0,kX.useFunc)(e,SX.default)}(${r}, ${n})`):t.fail((0,iI._)`${o} !== ${r}`)}};oI.default=IX});var hU=C(sI=>{"use strict";Object.defineProperty(sI,"__esModule",{value:!0});var Bd=Te(),EX=qe(),TX=Ay(),OX={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Bd._)`{allowedValues: ${t}}`},PX={keyword:"enum",schemaType:"array",$data:!0,error:OX,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:o,it:s}=t;if(!i&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,EX.useFunc)(e,TX.default)),u;if(a||i)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let f=e.const("vSchema",o);u=(0,Bd.or)(...n.map((h,m)=>p(f,m)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,f=>e.if((0,Bd._)`${l()}(${r}, ${f})`,()=>e.assign(u,!0).break()))}function p(f,h){let m=n[h];return typeof m=="object"&&m!==null?(0,Bd._)`${l()}(${r}, ${f}[${h}])`:(0,Bd._)`${r} === ${m}`}}};sI.default=PX});var mU=C(aI=>{"use strict";Object.defineProperty(aI,"__esModule",{value:!0});var AX=rU(),RX=nU(),jX=sU(),zX=aU(),CX=cU(),NX=lU(),DX=uU(),LX=fU(),UX=pU(),MX=hU(),FX=[AX.default,RX.default,jX.default,zX.default,CX.default,NX.default,DX.default,LX.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},UX.default,MX.default];aI.default=FX});var lI=C(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.validateAdditionalItems=void 0;var Rs=Te(),cI=qe(),ZX={message:({params:{len:t}})=>(0,Rs.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Rs._)`{limit: ${t}}`},qX={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ZX,code(t){let{parentSchema:e,it:r}=t,{items:i}=e;if(!Array.isArray(i)){(0,cI.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}gU(t,i)}};function gU(t,e){let{gen:r,schema:i,data:n,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,Rs._)`${n}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,Rs._)`${a} <= ${e.length}`);else if(typeof i=="object"&&!(0,cI.alwaysValidSchema)(s,i)){let l=r.var("valid",(0,Rs._)`${a} <= ${e.length}`);r.if((0,Rs.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:cI.Type.Num},l),s.allErrors||r.if((0,Rs.not)(l),()=>r.break())})}}Hd.validateAdditionalItems=gU;Hd.default=qX});var uI=C(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.validateTuple=void 0;var yU=Te(),Ry=qe(),VX=pn(),BX={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return vU(t,"additionalItems",e);r.items=!0,!(0,Ry.alwaysValidSchema)(r,e)&&t.ok((0,VX.validateArray)(t))}};function vU(t,e,r=t.schema){let{gen:i,parentSchema:n,data:o,keyword:s,it:a}=t;u(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Ry.mergeEvaluated.items(i,r.length,a.items));let c=i.name("valid"),l=i.const("len",(0,yU._)`${o}.length`);r.forEach((d,p)=>{(0,Ry.alwaysValidSchema)(a,d)||(i.if((0,yU._)`${l} > ${p}`,()=>t.subschema({keyword:s,schemaProp:p,dataProp:p},c)),t.ok(c))});function u(d){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(p.strictTuples&&!m){let g=`"${s}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,Ry.checkStrictMode)(a,g,p.strictTuples)}}}Wd.validateTuple=vU;Wd.default=BX});var _U=C(dI=>{"use strict";Object.defineProperty(dI,"__esModule",{value:!0});var HX=uI(),WX={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,HX.validateTuple)(t,"items")};dI.default=WX});var wU=C(fI=>{"use strict";Object.defineProperty(fI,"__esModule",{value:!0});var bU=Te(),KX=qe(),GX=pn(),JX=lI(),XX={message:({params:{len:t}})=>(0,bU.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,bU._)`{limit: ${t}}`},YX={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:XX,code(t){let{schema:e,parentSchema:r,it:i}=t,{prefixItems:n}=r;i.items=!0,!(0,KX.alwaysValidSchema)(i,e)&&(n?(0,JX.validateAdditionalItems)(t,n):t.ok((0,GX.validateArray)(t)))}};fI.default=YX});var $U=C(pI=>{"use strict";Object.defineProperty(pI,"__esModule",{value:!0});var mn=Te(),jy=qe(),QX={message:({params:{min:t,max:e}})=>e===void 0?(0,mn.str)`must contain at least ${t} valid item(s)`:(0,mn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,mn._)`{minContains: ${t}}`:(0,mn._)`{minContains: ${t}, maxContains: ${e}}`},e7={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:QX,code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:o}=t,s,a,{minContains:c,maxContains:l}=i;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,mn._)`${n}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,jy.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,jy.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,jy.alwaysValidSchema)(o,r)){let m=(0,mn._)`${u} >= ${s}`;a!==void 0&&(m=(0,mn._)`${m} && ${u} <= ${a}`),t.pass(m);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?f(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,mn._)`${n}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let m=e.name("_valid"),g=e.let("count",0);f(m,()=>e.if(m,()=>h(g)))}function f(m,g){e.forRange("i",0,u,y=>{t.subschema({keyword:"contains",dataProp:y,dataPropType:jy.Type.Num,compositeRule:!0},m),g()})}function h(m){e.code((0,mn._)`${m}++`),a===void 0?e.if((0,mn._)`${m} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,mn._)`${m} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,mn._)`${m} >= ${s}`,()=>e.assign(d,!0)))}}};pI.default=e7});var xU=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.validateSchemaDeps=ii.validatePropertyDeps=ii.error=void 0;var hI=Te(),t7=qe(),Kd=pn();ii.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let i=e===1?"property":"properties";return(0,hI.str)`must have ${i} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:i}})=>(0,hI._)`{property: ${t},
|
|
129
|
+
missingProperty: ${i},
|
|
130
|
+
depsCount: ${e},
|
|
131
|
+
deps: ${r}}`};var r7={keyword:"dependencies",type:"object",schemaType:"object",error:ii.error,code(t){let[e,r]=n7(t);kU(t,e),SU(t,r)}};function n7({schema:t}){let e={},r={};for(let i in t){if(i==="__proto__")continue;let n=Array.isArray(t[i])?e:r;n[i]=t[i]}return[e,r]}function kU(t,e=t.schema){let{gen:r,data:i,it:n}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,Kd.propertyInData)(r,i,s,n.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let l of a)(0,Kd.checkReportMissingProp)(t,l)}):(r.if((0,hI._)`${c} && (${(0,Kd.checkMissingProp)(t,a,o)})`),(0,Kd.reportMissingProp)(t,o),r.else())}}ii.validatePropertyDeps=kU;function SU(t,e=t.schema){let{gen:r,data:i,keyword:n,it:o}=t,s=r.name("valid");for(let a in e)(0,t7.alwaysValidSchema)(o,e[a])||(r.if((0,Kd.propertyInData)(r,i,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}ii.validateSchemaDeps=SU;ii.default=r7});var EU=C(mI=>{"use strict";Object.defineProperty(mI,"__esModule",{value:!0});var IU=Te(),i7=qe(),o7={message:"property name must be valid",params:({params:t})=>(0,IU._)`{propertyName: ${t.propertyName}}`},s7={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:o7,code(t){let{gen:e,schema:r,data:i,it:n}=t;if((0,i7.alwaysValidSchema)(n,r))return;let o=e.name("valid");e.forIn("key",i,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,IU.not)(o),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(o)}};mI.default=s7});var yI=C(gI=>{"use strict";Object.defineProperty(gI,"__esModule",{value:!0});var zy=pn(),Nn=Te(),a7=zi(),Cy=qe(),c7={message:"must NOT have additional properties",params:({params:t})=>(0,Nn._)`{additionalProperty: ${t.additionalProperty}}`},l7={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:c7,code(t){let{gen:e,schema:r,parentSchema:i,data:n,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Cy.alwaysValidSchema)(s,r))return;let l=(0,zy.allSchemaProperties)(i.properties),u=(0,zy.allSchemaProperties)(i.patternProperties);d(),t.ok((0,Nn._)`${o} === ${a7.default.errors}`);function d(){e.forIn("key",n,g=>{!l.length&&!u.length?h(g):e.if(p(g),()=>h(g))})}function p(g){let y;if(l.length>8){let v=(0,Cy.schemaRefOrVal)(s,i.properties,"properties");y=(0,zy.isOwnProperty)(e,v,g)}else l.length?y=(0,Nn.or)(...l.map(v=>(0,Nn._)`${g} === ${v}`)):y=Nn.nil;return u.length&&(y=(0,Nn.or)(y,...u.map(v=>(0,Nn._)`${(0,zy.usePattern)(t,v)}.test(${g})`))),(0,Nn.not)(y)}function f(g){e.code((0,Nn._)`delete ${n}[${g}]`)}function h(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Cy.alwaysValidSchema)(s,r)){let y=e.name("valid");c.removeAdditional==="failing"?(m(g,y,!1),e.if((0,Nn.not)(y),()=>{t.reset(),f(g)})):(m(g,y),a||e.if((0,Nn.not)(y),()=>e.break()))}}function m(g,y,v){let b={keyword:"additionalProperties",dataProp:g,dataPropType:Cy.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,y)}}};gI.default=l7});var PU=C(_I=>{"use strict";Object.defineProperty(_I,"__esModule",{value:!0});var u7=jd(),TU=pn(),vI=qe(),OU=yI(),d7={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:o}=t;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&OU.default.code(new u7.KeywordCxt(o,OU.default,"additionalProperties"));let s=(0,TU.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=vI.mergeEvaluated.props(e,(0,vI.toHash)(s),o.props));let a=s.filter(d=>!(0,vI.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,TU.propertyInData)(e,n,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};_I.default=d7});var zU=C(bI=>{"use strict";Object.defineProperty(bI,"__esModule",{value:!0});var AU=pn(),Ny=Te(),RU=qe(),jU=qe(),f7={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:i,parentSchema:n,it:o}=t,{opts:s}=o,a=(0,AU.allSchemaProperties)(r),c=a.filter(m=>(0,RU.alwaysValidSchema)(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&n.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof Ny.Name)&&(o.props=(0,jU.evaluatedPropsToName)(e,o.props));let{props:d}=o;p();function p(){for(let m of a)l&&f(m),o.allErrors?h(m):(e.var(u,!0),h(m),e.if(u))}function f(m){for(let g in l)new RegExp(m).test(g)&&(0,RU.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){e.forIn("key",i,g=>{e.if((0,Ny._)`${(0,AU.usePattern)(t,m)}.test(${g})`,()=>{let y=c.includes(m);y||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:jU.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,Ny._)`${d}[${g}]`,!0):!y&&!o.allErrors&&e.if((0,Ny.not)(u),()=>e.break())})})}}};bI.default=f7});var CU=C(wI=>{"use strict";Object.defineProperty(wI,"__esModule",{value:!0});var p7=qe(),h7={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:i}=t;if((0,p7.alwaysValidSchema)(i,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};wI.default=h7});var NU=C($I=>{"use strict";Object.defineProperty($I,"__esModule",{value:!0});var m7=pn(),g7={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:m7.validateUnion,error:{message:"must match a schema in anyOf"}};$I.default=g7});var DU=C(kI=>{"use strict";Object.defineProperty(kI,"__esModule",{value:!0});var Dy=Te(),y7=qe(),v7={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Dy._)`{passingSchemas: ${t.passing}}`},_7={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:v7,code(t){let{gen:e,schema:r,parentSchema:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let p;(0,y7.alwaysValidSchema)(n,u)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Dy._)`${c} && ${s}`).assign(s,!1).assign(a,(0,Dy._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Dy.Name)})})}}};kI.default=_7});var LU=C(SI=>{"use strict";Object.defineProperty(SI,"__esModule",{value:!0});var b7=qe(),w7={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((o,s)=>{if((0,b7.alwaysValidSchema)(i,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},n);t.ok(n),t.mergeEvaluated(a)})}};SI.default=w7});var FU=C(xI=>{"use strict";Object.defineProperty(xI,"__esModule",{value:!0});var Ly=Te(),MU=qe(),$7={message:({params:t})=>(0,Ly.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ly._)`{failingKeyword: ${t.ifClause}}`},k7={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:$7,code(t){let{gen:e,parentSchema:r,it:i}=t;r.then===void 0&&r.else===void 0&&(0,MU.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=UU(i,"then"),o=UU(i,"else");if(!n&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else n?e.if(a,l("then")):e.if((0,Ly.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let p=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(p,s),d?e.assign(d,(0,Ly._)`${u}`):t.setParams({ifClause:u})}}}};function UU(t,e){let r=t.schema[e];return r!==void 0&&!(0,MU.alwaysValidSchema)(t,r)}xI.default=k7});var ZU=C(II=>{"use strict";Object.defineProperty(II,"__esModule",{value:!0});var S7=qe(),x7={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,S7.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};II.default=x7});var qU=C(EI=>{"use strict";Object.defineProperty(EI,"__esModule",{value:!0});var I7=lI(),E7=_U(),T7=uI(),O7=wU(),P7=$U(),A7=xU(),R7=EU(),j7=yI(),z7=PU(),C7=zU(),N7=CU(),D7=NU(),L7=DU(),U7=LU(),M7=FU(),F7=ZU();function Z7(t=!1){let e=[N7.default,D7.default,L7.default,U7.default,M7.default,F7.default,R7.default,j7.default,A7.default,z7.default,C7.default];return t?e.push(E7.default,O7.default):e.push(I7.default,T7.default),e.push(P7.default),e}EI.default=Z7});var VU=C(TI=>{"use strict";Object.defineProperty(TI,"__esModule",{value:!0});var Dt=Te(),q7={message:({schemaCode:t})=>(0,Dt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Dt._)`{format: ${t}}`},V7={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:q7,code(t,e){let{gen:r,data:i,$data:n,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;n?p():f();function p(){let h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=r.const("fDef",(0,Dt._)`${h}[${s}]`),g=r.let("fType"),y=r.let("format");r.if((0,Dt._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,Dt._)`${m}.type || "string"`).assign(y,(0,Dt._)`${m}.validate`),()=>r.assign(g,(0,Dt._)`"string"`).assign(y,m)),t.fail$data((0,Dt.or)(v(),b()));function v(){return c.strictSchema===!1?Dt.nil:(0,Dt._)`${s} && !${y}`}function b(){let x=u.$async?(0,Dt._)`(${m}.async ? await ${y}(${i}) : ${y}(${i}))`:(0,Dt._)`${y}(${i})`,k=(0,Dt._)`(typeof ${y} == "function" ? ${x} : ${y}.test(${i}))`;return(0,Dt._)`${y} && ${y} !== true && ${g} === ${e} && !${k}`}}function f(){let h=d.formats[o];if(!h){v();return}if(h===!0)return;let[m,g,y]=b(h);m===e&&t.pass(x());function v(){if(c.strictSchema===!1){d.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function b(k){let E=k instanceof RegExp?(0,Dt.regexpCode)(k):c.code.formats?(0,Dt._)`${c.code.formats}${(0,Dt.getProperty)(o)}`:void 0,O=r.scopeValue("formats",{key:o,ref:k,code:E});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,Dt._)`${O}.validate`]:["string",k,O]}function x(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Dt._)`await ${y}(${i})`}return typeof g=="function"?(0,Dt._)`${y}(${i})`:(0,Dt._)`${y}.test(${i})`}}}};TI.default=V7});var BU=C(OI=>{"use strict";Object.defineProperty(OI,"__esModule",{value:!0});var B7=VU(),H7=[B7.default];OI.default=H7});var HU=C(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.contentVocabulary=Oc.metadataVocabulary=void 0;Oc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Oc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var KU=C(PI=>{"use strict";Object.defineProperty(PI,"__esModule",{value:!0});var W7=tU(),K7=mU(),G7=qU(),J7=BU(),WU=HU(),X7=[W7.default,K7.default,(0,G7.default)(),J7.default,WU.metadataVocabulary,WU.contentVocabulary];PI.default=X7});var JU=C(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.DiscrError=void 0;var GU;(function(t){t.Tag="tag",t.Mapping="mapping"})(GU||(Uy.DiscrError=GU={}))});var YU=C(RI=>{"use strict";Object.defineProperty(RI,"__esModule",{value:!0});var Pc=Te(),AI=JU(),XU=by(),Y7=zd(),Q7=qe(),eY={message:({params:{discrError:t,tagName:e}})=>t===AI.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Pc._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},tY={keyword:"discriminator",type:"object",schemaType:"object",error:eY,code(t){let{gen:e,data:r,schema:i,parentSchema:n,it:o}=t,{oneOf:s}=n;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=i.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Pc._)`${r}${(0,Pc.getProperty)(a)}`);e.if((0,Pc._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:AI.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let f=p();e.if(!1);for(let h in f)e.elseIf((0,Pc._)`${l} === ${h}`),e.assign(c,d(f[h]));e.else(),t.error(!1,{discrError:AI.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(f){let h=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:f},h);return t.mergeEvaluated(m,Pc.Name),h}function p(){var f;let h={},m=y(n),g=!0;for(let x=0;x<s.length;x++){let k=s[x];if(k?.$ref&&!(0,Q7.schemaHasRulesButRef)(k,o.self.RULES)){let O=k.$ref;if(k=XU.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,O),k instanceof XU.SchemaEnv&&(k=k.schema),k===void 0)throw new Y7.default(o.opts.uriResolver,o.baseId,O)}let E=(f=k?.properties)===null||f===void 0?void 0:f[a];if(typeof E!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||y(k)),v(E,x)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return h;function y({required:x}){return Array.isArray(x)&&x.includes(a)}function v(x,k){if(x.const)b(x.const,k);else if(x.enum)for(let E of x.enum)b(E,k);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(x,k){if(typeof x!="string"||x in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[x]=k}}}};RI.default=tY});var QU=C((Rpe,rY)=>{rY.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var zI=C((_t,jI)=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.MissingRefError=_t.ValidationError=_t.CodeGen=_t.Name=_t.nil=_t.stringify=_t.str=_t._=_t.KeywordCxt=_t.Ajv=void 0;var nY=GL(),iY=KU(),oY=YU(),eM=QU(),sY=["/properties"],My="http://json-schema.org/draft-07/schema",Ac=class extends nY.default{_addVocabularies(){super._addVocabularies(),iY.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(oY.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(eM,sY):eM;this.addMetaSchema(e,My,!1),this.refs["http://json-schema.org/schema"]=My}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(My)?My:void 0)}};_t.Ajv=Ac;jI.exports=_t=Ac;jI.exports.Ajv=Ac;Object.defineProperty(_t,"__esModule",{value:!0});_t.default=Ac;var aY=jd();Object.defineProperty(_t,"KeywordCxt",{enumerable:!0,get:function(){return aY.KeywordCxt}});var Rc=Te();Object.defineProperty(_t,"_",{enumerable:!0,get:function(){return Rc._}});Object.defineProperty(_t,"str",{enumerable:!0,get:function(){return Rc.str}});Object.defineProperty(_t,"stringify",{enumerable:!0,get:function(){return Rc.stringify}});Object.defineProperty(_t,"nil",{enumerable:!0,get:function(){return Rc.nil}});Object.defineProperty(_t,"Name",{enumerable:!0,get:function(){return Rc.Name}});Object.defineProperty(_t,"CodeGen",{enumerable:!0,get:function(){return Rc.CodeGen}});var cY=vy();Object.defineProperty(_t,"ValidationError",{enumerable:!0,get:function(){return cY.default}});var lY=zd();Object.defineProperty(_t,"MissingRefError",{enumerable:!0,get:function(){return lY.default}})});var cM=C(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.formatNames=si.fastFormats=si.fullFormats=void 0;function oi(t,e){return{validate:t,compare:e}}si.fullFormats={date:oi(iM,LI),time:oi(NI(!0),UI),"date-time":oi(tM(!0),sM),"iso-time":oi(NI(),oM),"iso-date-time":oi(tM(),aM),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:mY,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:$Y,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:gY,int32:{type:"number",validate:_Y},int64:{type:"number",validate:bY},float:{type:"number",validate:nM},double:{type:"number",validate:nM},password:!0,binary:!0};si.fastFormats={...si.fullFormats,date:oi(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,LI),time:oi(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,UI),"date-time":oi(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,sM),"iso-time":oi(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,oM),"iso-date-time":oi(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,aM),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};si.formatNames=Object.keys(si.fullFormats);function uY(t){return t%4===0&&(t%100!==0||t%400===0)}var dY=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,fY=[0,31,28,31,30,31,30,31,31,30,31,30,31];function iM(t){let e=dY.exec(t);if(!e)return!1;let r=+e[1],i=+e[2],n=+e[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&uY(r)?29:fY[i])}function LI(t,e){if(t&&e)return t>e?1:t<e?-1:0}var CI=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function NI(t){return function(r){let i=CI.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],s=+i[3],a=i[4],c=i[5]==="-"?-1:1,l=+(i[6]||0),u=+(i[7]||0);if(l>23||u>59||t&&!a)return!1;if(n<=23&&o<=59&&s<60)return!0;let d=o-u*c,p=n-l*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&s<61}}function UI(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(r&&i)return r-i}function oM(t,e){if(!(t&&e))return;let r=CI.exec(t),i=CI.exec(e);if(r&&i)return t=r[1]+r[2]+r[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}var DI=/t|\s/i;function tM(t){let e=NI(t);return function(i){let n=i.split(DI);return n.length===2&&iM(n[0])&&e(n[1])}}function sM(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),i=new Date(e).valueOf();if(r&&i)return r-i}function aM(t,e){if(!(t&&e))return;let[r,i]=t.split(DI),[n,o]=e.split(DI),s=LI(r,n);if(s!==void 0)return s||UI(i,o)}var pY=/\/|:/,hY=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function mY(t){return pY.test(t)&&hY.test(t)}var rM=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function gY(t){return rM.lastIndex=0,rM.test(t)}var yY=-(2**31),vY=2**31-1;function _Y(t){return Number.isInteger(t)&&t<=vY&&t>=yY}function bY(t){return Number.isInteger(t)}function nM(){return!0}var wY=/[^\\]\\Z/;function $Y(t){if(wY.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var lM=C(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.formatLimitDefinition=void 0;var kY=zI(),Dn=Te(),wo=Dn.operators,Fy={formatMaximum:{okStr:"<=",ok:wo.LTE,fail:wo.GT},formatMinimum:{okStr:">=",ok:wo.GTE,fail:wo.LT},formatExclusiveMaximum:{okStr:"<",ok:wo.LT,fail:wo.GTE},formatExclusiveMinimum:{okStr:">",ok:wo.GT,fail:wo.LTE}},SY={message:({keyword:t,schemaCode:e})=>(0,Dn.str)`should be ${Fy[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Dn._)`{comparison: ${Fy[t].okStr}, limit: ${e}}`};jc.formatLimitDefinition={keyword:Object.keys(Fy),type:"string",schemaType:"string",$data:!0,error:SY,code(t){let{gen:e,data:r,schemaCode:i,keyword:n,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new kY.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let p=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=e.const("fmt",(0,Dn._)`${p}[${c.schemaCode}]`);t.fail$data((0,Dn.or)((0,Dn._)`typeof ${f} != "object"`,(0,Dn._)`${f} instanceof RegExp`,(0,Dn._)`typeof ${f}.compare != "function"`,d(f)))}function u(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${n}": format "${p}" does not define "compare" function`);let h=e.scopeValue("formats",{key:p,ref:f,code:s.code.formats?(0,Dn._)`${s.code.formats}${(0,Dn.getProperty)(p)}`:void 0});t.fail$data(d(h))}function d(p){return(0,Dn._)`${p}.compare(${r}, ${i}) ${Fy[n].fail} 0`}},dependencies:["format"]};var xY=t=>(t.addKeyword(jc.formatLimitDefinition),t);jc.default=xY});var pM=C((Gd,fM)=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var zc=cM(),IY=lM(),MI=Te(),uM=new MI.Name("fullFormats"),EY=new MI.Name("fastFormats"),FI=(t,e={keywords:!0})=>{if(Array.isArray(e))return dM(t,e,zc.fullFormats,uM),t;let[r,i]=e.mode==="fast"?[zc.fastFormats,EY]:[zc.fullFormats,uM],n=e.formats||zc.formatNames;return dM(t,n,r,i),e.keywords&&(0,IY.default)(t),t};FI.get=(t,e="full")=>{let i=(e==="fast"?zc.fastFormats:zc.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function dM(t,e,r,i){var n,o;(n=(o=t.opts.code).formats)!==null&&n!==void 0||(o.formats=(0,MI._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,r[s])}fM.exports=Gd=FI;Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=FI});function TY(){let t=new hM.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,mM.default)(t),t}var hM,mM,Zy,gM=w(()=>{hM=xo(zI(),1),mM=xo(pM(),1);Zy=class{constructor(e){this._ajv=e??TY()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return i=>r(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var qy,yM=w(()=>{yc();qy=class{constructor(e){this._server=e}requestStream(e,r,i){return this._server.requestStream(e,r,i)}createMessageStream(e,r){let i=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],l=c.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(o.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(u.size!==d.size||![...u].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},vd,r)}elicitInputStream(e,r){let i=this._server.getClientCapabilities(),n=e.mode??"form";switch(n){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=n==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},gc,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,i){return this._server.getTaskResult({taskId:e},r,i)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}}});function vM(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function _M(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var bM=w(()=>{});var Vy,wM=w(()=>{m1();yc();gM();Ju();yM();bM();Vy=class extends oy{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(yd.options.map((i,n)=>[i,n])),this.isMessageIgnored=(i,n)=>{let o=this._loggingLevels.get(n);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Zy,this.setRequestHandler(G0,i=>this._oninitialize(i)),this.setNotificationHandler(J0,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(nS,async(i,n)=>{let o=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,a=yd.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new qy(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=h1(this._capabilities,e)}setRequestHandler(e,r){let n=io(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let o=nc(n);if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,l)=>{let u=no(mc,c);if(!u.success){let h=u.error instanceof Error?u.error.message:String(u.error);throw new te(ae.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let h=no(pc,p);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new te(ae.InvalidParams,`Invalid task creation result: ${m}`)}return h.data}let f=no(Wg,p);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new te(ae.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){_M(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&vM(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:hD.includes(r)?r:V0,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Ag)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(l=>l.type==="tool_use");if(o){if(n.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(n.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},iS,r):this.request({method:"sampling/createMessage",params:e},vd,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},gc,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},gc,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!a.valid)throw new te(ae.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof te?s:new te(ae.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},oS,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function ZI(t){return!!t&&typeof t=="object"&&kM in t}function SM(t){return t[kM]?.complete}var kM,$M,xM=w(()=>{kM=Symbol.for("mcp.completable");(function(t){t.Completable="McpCompletable"})($M||($M={}))});var IM=w(()=>{});function PY(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!OY.test(t)){let r=t.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return e.push(`Tool name contains invalid characters: ${r.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function AY(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function qI(t){let e=PY(t);return AY(t,e.warnings),e.isValid}var OY,EM=w(()=>{OY=/^[A-Za-z0-9._-]{1,128}$/});var By,TM=w(()=>{By=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,i){let n={taskSupport:"required",...r.execution};if(n.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,n,r._meta,i)}}});var VI=w(()=>{Eg();Eg()});function RY(t,e){let r=0,i=[t];for(;i.length>0;){let n=i.pop();if(!(n===null||typeof n!="object"))if(Array.isArray(n))for(let o of n){if(++r>e)return r;o!==null&&typeof o=="object"&&i.push(o)}else for(let o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;if(++r>e)return r;let s=n[o];s!==null&&typeof s=="object"&&i.push(s)}}return r}function jY(t){if(!(t===void 0||t===1/0)){if(typeof t!="number"||Number.isNaN(t)||t<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(t)}`);return t}}function AM(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function RM(t){return"_def"in t||"_zod"in t||AM(t)}function BI(t){return typeof t!="object"||t===null||RM(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(AM)}function OM(t){if(t){if(BI(t))return ms(t);if(!RM(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function CY(t){let e=io(t);return e?Object.entries(e).map(([r,i])=>{let n=NC(i),o=DC(i);return{name:r,description:n,required:!o}}):[]}function $o(t){let r=io(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=nc(r);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function PM(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var Hy,zY,Jd,jM=w(()=>{wM();Ju();ZS();yc();xM();IM();EM();TM();VI();Hy=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Vy(e,r),this._maxToolInputElements=jY(r?.maxToolInputElements)}get experimental(){return this._experimental||(this._experimental={tasks:new By(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler($o(Hg)),this.server.assertCanSetRequestHandler($o(mc)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Hg,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let i={name:e,title:r.title,description:r.description,inputSchema:(()=>{let n=rc(r.inputSchema);return n?US(n,{strictUnions:!0,pipeStrategy:"input"}):zY})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let n=rc(r.outputSchema);n&&(i.outputSchema=US(n,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(mc,async(e,r)=>{try{let i=this._registeredTools[e.params.name];if(!i)throw new te(ae.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new te(ae.InvalidParams,`Tool ${e.params.name} disabled`);let n=!!e.params.task,o=i.execution?.taskSupport,s="createTask"in i.handler;if((o==="required"||o==="optional")&&!s)throw new te(ae.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!n)throw new te(ae.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!n&&s)return await this.handleAutomaticTaskPolling(i,e,r);let a=await this.validateToolInput(i,e.params.arguments,e.params.name),c=await this.executeToolHandler(i,a,r);return n||await this.validateToolOutput(i,c,e.params.name),c}catch(i){if(i instanceof te&&i.code===ae.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,i){if(this._maxToolInputElements!==void 0&&RY(r,this._maxToolInputElements)>this._maxToolInputElements)throw new te(ae.InvalidParams,`Invalid arguments for tool ${i}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=rc(e.inputSchema)??e.inputSchema,s=await Gm(o,r??{});if(!s.success){let a="error"in s?s.error:"Unknown error",c=Jm(a);throw new te(ae.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${c}`)}return s.data}async validateToolOutput(e,r,i){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new te(ae.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let n=rc(e.outputSchema),o=await Gm(n,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=Jm(s);throw new te(ae.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${a}`)}}async executeToolHandler(e,r,i){let n=e.handler;if("createTask"in n){if(!i.taskStore)throw new Error("No task store provided.");let s={...i,taskStore:i.taskStore};if(e.inputSchema){let a=n;return await Promise.resolve(a.createTask(r,s))}else{let a=n;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=n;return await Promise.resolve(s(r,i))}else{let s=n;return await Promise.resolve(s(i))}}async handleAutomaticTaskPolling(e,r,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let n=await this.validateToolInput(e,r.params.arguments,r.params.name),o=e.handler,s={...i,taskStore:i.taskStore},a=n?await Promise.resolve(o.createTask(n,s)):await Promise.resolve(o.createTask(s)),c=a.task.taskId,l=a.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(p=>setTimeout(p,u));let d=await i.taskStore.getTask(c);if(!d)throw new te(ae.InternalError,`Task ${c} not found during polling`);l=d}return await i.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler($o(Kg)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Kg,async e=>{switch(e.params.ref.type){case"ref/prompt":return PD(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return AD(e),this.handleResourceCompletion(e,e.params.ref);default:throw new te(ae.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let i=this._registeredPrompts[r.name];if(!i)throw new te(ae.InvalidParams,`Prompt ${r.name} not found`);if(!i.enabled)throw new te(ae.InvalidParams,`Prompt ${r.name} disabled`);if(!i.argsSchema)return Jd;let o=io(i.argsSchema)?.[e.params.argument.name];if(!ZI(o))return Jd;let s=SM(o);if(!s)return Jd;let a=await s(e.params.argument.value,e.params.context);return PM(a)}async handleResourceCompletion(e,r){let i=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!i){if(this._registeredResources[r.uri])return Jd;throw new te(ae.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let n=i.resourceTemplate.completeCallback(e.params.argument.name);if(!n)return Jd;let o=await n(e.params.argument.value,e.params.context);return PM(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler($o(Fg)),this.server.assertCanSetRequestHandler($o(Zg)),this.server.assertCanSetRequestHandler($o(qg)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Fg,async(e,r)=>{let i=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),n=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(r);for(let a of s.resources)n.push({...o.metadata,...a})}return{resources:[...i,...n]}}),this.server.setRequestHandler(Zg,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,i])=>({name:r,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(qg,async(e,r)=>{let i=new URL(e.params.uri),n=this._registeredResources[i.toString()];if(n){if(!n.enabled)throw new te(ae.InvalidParams,`Resource ${i} disabled`);return n.readCallback(i,r)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(i.toString());if(s)return o.readCallback(i,s,r)}throw new te(ae.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler($o(Vg)),this.server.assertCanSetRequestHandler($o(Bg)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Vg,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?CY(r.argsSchema):void 0}))})),this.server.setRequestHandler(Bg,async(e,r)=>{let i=this._registeredPrompts[e.params.name];if(!i)throw new te(ae.InvalidParams,`Prompt ${e.params.name} not found`);if(!i.enabled)throw new te(ae.InvalidParams,`Prompt ${e.params.name} disabled`);if(i.argsSchema){let n=rc(i.argsSchema),o=await Gm(n,e.params.arguments??{});if(!o.success){let c="error"in o?o.error:"Unknown error",l=Jm(c);throw new te(ae.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,a=i.callback;return await Promise.resolve(a(s,r))}else{let n=i.callback;return await Promise.resolve(n(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...i){let n;typeof i[0]=="object"&&(n=i.shift());let o=i[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,i,n){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(e,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,r,i,n,o){let s={name:e,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==i&&(delete this._registeredResources[i],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=s,s}_createRegisteredResourceTemplate(e,r,i,n,o){let s={resourceTemplate:i,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=i.uriTemplate.variableNames;return Array.isArray(a)&&a.some(l=>!!i.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,i,n,o){let s={title:r,description:i,argsSchema:n===void 0?void 0:ms(n),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=ms(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,n&&Object.values(n).some(c=>{let l=c instanceof _s?c._def?.innerType:c;return ZI(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,i,n,o,s,a,c,l){qI(e);let u={title:r,description:i,inputSchema:OM(n),outputSchema:OM(o),annotations:s,execution:a,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&qI(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=u)),typeof d.title<"u"&&(u.title=d.title),typeof d.description<"u"&&(u.description=d.description),typeof d.paramsSchema<"u"&&(u.inputSchema=ms(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=ms(d.outputSchema)),typeof d.callback<"u"&&(u.handler=d.callback),typeof d.annotations<"u"&&(u.annotations=d.annotations),typeof d._meta<"u"&&(u._meta=d._meta),typeof d.enabled<"u"&&(u.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let i,n,o,s;if(typeof r[0]=="string"&&(i=r.shift()),r.length>1){let c=r[0];if(BI(c))n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!BI(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(e,void 0,i,n,o,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,i){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:n,description:o,inputSchema:s,outputSchema:a,annotations:c,_meta:l}=r;return this._createRegisteredTool(e,n,o,s,a,c,{taskSupport:"forbidden"},l,i)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let i;typeof r[0]=="string"&&(i=r.shift());let n;r.length>1&&(n=r.shift());let o=r[0],s=this._createRegisteredPrompt(e,void 0,i,n,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,i){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:n,description:o,argsSchema:s}=r,a=this._createRegisteredPrompt(e,n,o,s,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},zY={type:"object",properties:{}};Jd={completion:{values:[],hasMore:!1}}});function DY(t){return $D.parse(JSON.parse(t))}function zM(t){return JSON.stringify(t)+`
|
|
132
|
+
`}var NY,Wy,CM=w(()=>{yc();NY=10*1024*1024,Wy=class{constructor(e){this._maxBufferSize=e?.maxBufferSize??NY}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
133
|
+
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),DY(r)}clear(){this._buffer=void 0}}});import NM from"node:process";var Ky,DM=w(()=>{CM();Ky=class{constructor(e=NM.stdin,r=NM.stdout,i){this._stdin=e,this._stdout=r,this._started=!1,this._ondata=n=>{try{this._readBuffer.append(n),this.processReadBuffer()}catch(o){this.onerror?.(o),this.close().catch(()=>{})}},this._onerror=n=>{this.onerror?.(n)},this._readBuffer=new Wy({maxBufferSize:i?.maxBufferSize})}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let i=zM(e);this._stdout.write(i)?r():this._stdout.once("drain",r)})}}});var Jy={};Jr(Jy,{mcp:()=>BY,proposalText:()=>MM,statusText:()=>VY});import{spawnSync as LY}from"node:child_process";import{existsSync as js,readdirSync as UY,readFileSync as Gy}from"node:fs";import{join as ai,relative as MY,resolve as LM}from"node:path";import{fileURLToPath as FY}from"node:url";function Ln(t){if(t)return LM(t);let e=process.cwd();if(js(ai(e,".codesignflo","config.json")))return e;let r=(n,o)=>{if(o<0)return null;for(let s of UY(n,{withFileTypes:!0})){if(!s.isDirectory()||s.name==="node_modules"||s.name.startsWith("."))continue;let a=ai(n,s.name);if(js(ai(a,".codesignflo","config.json")))return a;let c=r(a,o-1);if(c)return c}return null},i=r(e,3);if(!i)throw new Error("no CoDesignFlo project here (no .codesignflo/config.json) \u2014 call `init` in the app's folder");return i}function gn(t,e,r=9e5){let i=LY(process.execPath,[ZY,...e],{cwd:t,encoding:"utf8",timeout:r,env:{...process.env,CODESIGNFLO_WAIT_S:process.env.CODESIGNFLO_WAIT_S??"40"}}),n=`${i.stdout??""}${i.stderr??""}`.trim();return i.status===0?n:`${n}
|
|
134
|
+
(exit ${i.status??"timeout"})`}function MM(t,e){let r=xt(UM(t)).get(e);if(!r?.claim)return{text:`${e} has no open proposal (state: ${r?.state??"unknown"}). Call status.`};let i=ai(t,".codesignflo","proposals",e,r.claim.id),n=ai(t,".codesignflo","registry.json"),o=js(n)?JSON.parse(Gy(n,"utf8")):{components:{}},s=p=>MY(t,p),a=e.startsWith("pages.");if(r.state==="design_new"){let p=ai(i,"design.png");return{text:Sw({component:e,by:r.claim.by,...r.claim.note?{note:r.claim.note}:{},page:a,design:js(p)?`${s(p)} (picture, attached) and ${s(ai(i,"spec.json"))}`:s(ai(i,"spec.json")),pageFiles:Object.values(o.screens??{})[0]?.files??[]}),...js(p)?{image:Gy(p).toString("base64")}:{}}}if(r.state!=="ready_for_dev")return{text:`${e} is ${r.state.replace(/_/g," ")}: nothing to implement yet.`};let c=ai(i,"changes.json");if(!js(c))return{text:`The changes for ${e} aren't computed yet: call sync first.`};let{changes:l,content:u}=JSON.parse(Gy(c,"utf8")),d=o.components[e]??o.screens?.[e];return{text:kw({component:e,by:r.claim.by,...r.claim.note?{note:r.claim.note}:{},conflict:r.conflict,changes:l,content:u,...d?{entry:d}:{},page:!!o.screens?.[e]})}}function VY(t){let e=[...xt(UM(t)).values()],r=[xw(e),...Iw(e),...Aw(e)],i=ai(t,".codesignflo","STATUS.md");return js(i)&&r.push("",Gy(i,"utf8")),r.join(`
|
|
135
|
+
`)}async function BY(){let t=new Hy({name:"codesignflo",version:lf},{instructions:qY}),e={app:yt.string().optional().describe("App folder (contains .codesignflo/); default: found from the working directory")};t.registerTool("status",{title:"Design status",description:"What the designer is working on, what is ready for dev, new designs, questions, how Live stands \u2014 without Figma (all=true: every place Live differs from the app).",inputSchema:{...e,all:yt.boolean().optional()}},async({app:n,all:o})=>Un(gn(Ln(n),["status",...o?["--all"]:[]]))),t.registerTool("get_proposal",{title:"Get a design proposal",description:"The designer's proposal for a component or page (ready for dev or a new design), as instructions for implementing it.",inputSchema:{component:yt.string().describe("Component or page key, e.g. product-card or pages.cart-page"),...e}},async({component:n,app:o})=>{let s=gn(Ln(o),["proposal",n,"--json"]),a;try{a=JSON.parse(s)}catch{a={text:s}}return{content:[{type:"text",text:a.text},...a.image?[{type:"image",data:a.image,mimeType:"image/png"}]:[]]}}),t.registerTool("sync",{title:"Sync with Figma",description:"Render Storybook and compare the code with the designer's proposals. Cloud projects: answers at once which proposals look done (no Figma needed); on the Live branch with everything committed it also uploads a Live update, which the plugin applies when the Figma file is open; anywhere else it's a check. Local projects: updates Live directly (Figma open with the plugin).",inputSchema:{...e,allowBranch:yt.boolean().optional().describe("Update Live from a branch other than the tracked one (only if the user asks)")}},async({app:n,allowBranch:o})=>Un(gn(Ln(n),["sync",...o?["--allow-branch"]:[]]))),t.registerTool("verify",{title:"Compare Figma with the code",description:"Browser vs Live, variant by variant (sizes and pixels; images written to .codesignflo/verify/).",inputSchema:{component:yt.string().optional(),screens:yt.boolean().optional(),...e}},async({component:n,screens:o,app:s})=>Un(gn(Ln(s),["verify",...n?[n]:[],...o?["--screens"]:[],"--no-build"]))),t.registerTool("ask_designer",{title:"Ask the designer",description:"Send a ready proposal back to the designer with a question.",inputSchema:{component:yt.string(),question:yt.string(),...e}},async({component:n,question:o,app:s})=>Un(gn(Ln(s),["ask",n,o]))),t.registerTool("resolve",{title:"Settle a clash",description:"When the designer's proposal and the code changed the same things: take=design (default rule) or take=code with a reason for the designer.",inputSchema:{component:yt.string(),take:yt.enum(["design","code"]),reason:yt.string().optional(),...e}},async({component:n,take:o,reason:s,app:a})=>Un(gn(Ln(a),["resolve",n,o==="design"?"--design":"--code",...o==="code"?[s??"kept for a functional reason"]:[]]))),t.registerTool("login",{title:"Sign in to CoDesignFlo",description:"Opens the sign-in page in the user's browser (GitHub) and waits up to 10 minutes for them to approve; tell the user to check the code shown.",inputSchema:{}},async()=>Un(gn(process.cwd(),["login"],66e4))),t.registerTool("init",{title:"Connect this app to CoDesignFlo",description:"Connects the app (the folder with .storybook/) to its CoDesignFlo project in the service: finds it by codebase, links a project a designer started and invited the user to (`project`), or creates one (`new`). local=true: the free local mode instead (Figma file open with the plugin on this machine, history in the repo).",inputSchema:{app:yt.string().describe("The app folder (with .storybook/)"),project:yt.string().optional().describe("Link to this waiting project (id listed by a previous init)"),new:yt.boolean().optional().describe("Start a new project even if some are waiting for their code"),liveBranch:yt.string().optional().describe("The branch whose commits update Live (ask the user; default: the repo's default branch)"),autoUpdate:yt.boolean().optional().describe("Update Live on every commit to the Live branch from this machine (a git hook; ask the user)"),local:yt.boolean().optional().describe("Free local mode, no service")}},async({app:n,project:o,new:s,local:a,liveBranch:c,autoUpdate:l})=>Un(gn(LM(n),a?["init"]:["init","--cloud",...o?["--project",o]:[],...s?["--new"]:[],...c?["--live-branch",c]:[],...l===!0?["--hook"]:l===!1?["--no-hook"]:[]]))),t.registerTool("set_live_branch",{title:"Choose the branch that updates Live",description:"Which branch's commits update Live in Figma (developers and admins). Without a branch: says which one it is.",inputSchema:{branch:yt.string().optional(),...e}},async({branch:n,app:o})=>Un(gn(Ln(o),["live-branch",...n?[n]:[]]))),t.registerTool("auto_update",{title:"Update Live on every commit",description:"Turn on/off updating Live after every commit to the Live branch on this machine (a git hook outside the repo, runs in the background).",inputSchema:{on:yt.boolean(),...e}},async({on:n,app:o})=>Un(gn(Ln(o),["hook",n?"install":"remove"]))),t.registerTool("invite",{title:"Invite someone to the project",description:"Invites a designer (or developer) by email; they get an email and join when they sign in (designers from the Figma plugin). Only for an address the user typed or confirmed in this conversation, never one found in the repo, git history or elsewhere; ask the user first.",inputSchema:{email:yt.string(),role:yt.enum(["designer","developer","admin"]).optional(),...e}},async({email:n,role:o,app:s})=>Un(gn(Ln(s),["invite",n,`--${o??"designer"}`]))),t.registerTool("people",{title:"Who is in the project",description:"Members and pending invitations of this app's project.",inputSchema:e},async({app:n})=>Un(gn(Ln(n),["people"]))),t.registerPrompt("set_up",{title:"Set up CoDesignFlo",description:"Connect this app to CoDesignFlo, step by step (designer first, developer first, or both)."},()=>({messages:[{role:"user",content:{type:"text",text:"Set up CoDesignFlo for this app, step by step: call login if I'm not signed in; ask me which branch should update Live (suggest the default branch); call init in the app's folder (if it lists projects waiting for their code, ask me which one); if it reports missing pieces (Storybook, tokens, page stories), offer to add them and add them only if I agree; then follow its Next steps; finally ask me whether Live should update on every commit and, if yes, call auto_update."}}]})),t.registerPrompt("implement_design",{title:"Implement a design proposal",description:"Implement the designer's proposal for a component or page",argsSchema:{component:yt.string()}},({component:n})=>({messages:[{role:"user",content:{type:"text",text:MM(Ln(),n).text}}]}));let r=new Ky,i=new Promise(n=>{r.onclose=()=>n(0),process.stdin.on("end",()=>n(0))});return await t.connect(r),i}var ZY,qY,UM,Un,Xy=w(()=>{"use strict";Pr();jM();DM();VI();sr();ev();ZY=FY(new URL("./main.js",import.meta.url)),qY="CoDesignFlo keeps a Figma mirror of this app's Storybook (\"Live\") in step with the code, and brings the designer's proposals into the code.\nUse it:\n- After changing UI components, pages, styles or tokens: call `sync` (updates Live, picks up the designer's work, closes proposals the code now satisfies). Two kinds of findings, handled differently: (1) \"N of M of the designer's changes in the code\" \u2014 your job: keep implementing and sync again until it says \"looks done\" (ask_designer if something can't be done cleanly); (2) \"Where Live differs from the app\" \u2014 Live is built from the app as the browser draws it, so the app is right and these are CoDesignFlo/Figma gaps (a font Figma lacks, a placed component's version, text wrapping): do NOT change the code to chase them; tell the user, with the action each one suggests.\n- When the user asks what the designer did / what is waiting: call `status`.\n- Live renders each story at its Storybook viewport (else 1200x900), with a fixed clock (1 January 2026). When Live differs because of size, a scrolling panel or dates, set the story's parameters rather than the app: `codesignflo: { size: { width, height } }`, `codesignflo: { fullHeight: true }` (an app shell 100vh tall whose panel scrolls), `codesignflo: { date: \"<ISO date>\" }` (fixtures with real dates).\n- When something is ready for dev or there is a new design: call `get_proposal` and implement it in the code, any way you like (edit the files, commit normally; no special commit format needed). Then `sync`: it checks the code against the designer's copy and closes the proposal, or reports what is left.\n- If a change is unclear or can't be done cleanly: `ask_designer` instead of guessing.\n- Setting up (\"connect this app to CoDesignFlo\"): `login` once (the user approves in the browser), then `init` in the app's folder. Ask the user which branch should update Live (default: the repo's default branch) and whether Live should update on every commit to it (autoUpdate). If init lists projects waiting for their code (a designer started them and invited the user), ask which one and call `init` again with `project`. Then, if the designer isn't in yet (`people` shows who is), ask the user for their email and `invite` that address.\n- At the start of a session, `status` also says whether Live is behind the Live branch or a branch with finished work was merged; if Live is behind and you're on the Live branch with everything committed, `sync`.\n- Clashes (\"N conflicting\"): the designer's version wins by default (`resolve` with take=design); keep the code only for a functional reason, with that reason.\nCloud projects (connected to the service): `sync` needs no Figma and answers at once; Live itself is updated when someone has the Figma file open. Local projects: `sync` and `verify` need Figma desktop open on the project's file with the CoDesignFlo plugin; if it doesn't connect, tell the user to open it.";UM=t=>Ct(),Un=t=>({content:[{type:"text",text:t}]})});Qy();ev();import{randomBytes as r4}from"node:crypto";import{chmodSync as n4,copyFileSync as i4,existsSync as nE,mkdirSync as iE,readFileSync as o4,writeFileSync as s4}from"node:fs";import{createServer as a4}from"node:http";import{homedir as rv}from"node:os";import{dirname as c4,join as nv}from"node:path";import{createInterface as l4}from"node:readline/promises";import{WebSocketServer as u4}from"ws";var Nc=lf,uf="0.1.0",df=class{port;opts;secretsFile;approvals=Promise.resolve();wss=null;http=[];socket=null;pending=new Map;seq=0;waiters=[];session=null;constructor(e){this.opts=e,this.port=e.port??4517,this.secretsFile=e.secretsFile??nv(rv(),".codesignflo","paired.json");let r=nv(rv(),".codesignloop","paired.json");!e.secretsFile&&!nE(this.secretsFile)&&nE(r)&&(iE(nv(rv(),".codesignflo"),{recursive:!0}),i4(r,this.secretsFile))}log(e){(this.opts.log??(r=>console.error(r)))(e)}secrets(){try{return JSON.parse(o4(this.secretsFile,"utf8"))}catch{return[]}}issueSecret(){let e=r4(24).toString("hex");return iE(c4(this.secretsFile),{recursive:!0}),s4(this.secretsFile,JSON.stringify([...this.secrets(),e])),n4(this.secretsFile,384),e}async listen(){this.wss=new u4({noServer:!0,maxPayload:64*1024*1024}),this.wss.on("connection",e=>this.onConnection(e));for(let e of["127.0.0.1","::1"]){let r=a4((i,n)=>n.writeHead(426).end());r.on("upgrade",(i,n,o)=>this.wss?.handleUpgrade(i,n,o,s=>this.wss?.emit("connection",s,i)));try{await new Promise((i,n)=>{r.once("error",n),r.listen(this.port,e,()=>i())}),this.http.push(r)}catch(i){if(e!=="127.0.0.1")continue;throw i.code==="EADDRINUSE"?new Error(`port ${this.port} is in use, probably another codesignflo command. Find it with: lsof -nP -iTCP:${this.port} -sTCP:LISTEN`):i}}}waitForPlugin(e=0){return this.session?Promise.resolve(this.session):new Promise((r,i)=>{this.waiters.push(r),e>0&&setTimeout(()=>i(new Error("the CoDesignFlo plugin did not connect \u2014 open it in Figma desktop (Plugins \u2192 Development \u2192 CoDesignFlo)")),e)})}async close(){for(let e of this.pending.values())clearTimeout(e.timer),e.reject(new Error("bridge closed"));this.pending.clear(),this.socket?.close(),this.wss?.close(),await Promise.all(this.http.map(e=>new Promise(r=>e.close(()=>r()))))}reject(e,r,i){this.send(e,{t:"rejected",code:r,reason:i}),e.close(1008,i.slice(0,120))}onConnection(e){let r=new cf,i=!1;e.on("message",n=>{let o;try{o=r.push(n.toString())}catch{e.close(1003,"bad frame");return}if(!o)return;if(i)return this.onMessage(o);if(o.t!=="hello")return void e.close(1008,"expected hello");let s=o;if(s.protocol!==2)return this.reject(e,"protocol",`protocol ${s.protocol}, CLI speaks ${2}`);if(!tE(s.plugin.version,uf))return this.reject(e,"plugin_too_old",`plugin ${s.plugin.version} is older than ${uf}`);let a=this.opts.accept;if(!(a==="any"||(a==="unset"?s.file.projectId===null:"fileName"in a?s.file.name===a.fileName:s.file.projectId===a.projectId)))return this.log(`ignoring the plugin in "${s.file.name}" (${s.file.projectId?`project ${s.file.projectId}`:"not set up"})`),this.reject(e,"wrong_file","the developer's CLI is working on another file");let l=u=>{if(e.readyState===e.OPEN){i=!0,this.socket&&this.socket!==e&&this.socket.close(4001,"replaced"),this.socket=e,this.send(e,{t:"welcome",protocol:2,server:{version:Nc},secret:u}),this.session={hello:s,call:(d,p,f)=>this.call(d,p,f)};for(let d of this.waiters.splice(0))d(this.session)}};if(s.secret&&this.secrets().includes(s.secret))return l(s.secret);this.send(e,{t:"awaiting_approval"}),this.approvals=this.approvals.then(async()=>{e.readyState===e.OPEN&&(await(this.opts.approve??d4)(s)?l(this.issueSecret()):this.reject(e,"not_approved","pairing not approved"))})}),e.on("close",()=>{if(this.socket===e){this.socket=null,this.session=null;for(let n of this.pending.values())clearTimeout(n.timer),n.reject(new Error(`the plugin disconnected during ${n.method}`));this.pending.clear()}})}onMessage(e){if(e.t==="res"){let r=this.pending.get(e.id);if(!r)return;clearTimeout(r.timer),this.pending.delete(e.id),e.ok?r.resolve(e.result):r.reject(Object.assign(new Error(e.error.message),{stack:e.error.stack}))}else if(e.t==="progress"){let r=this.pending.get(e.id);if(!r)return;clearTimeout(r.timer),r.timer=this.arm(e.id,r.timeoutMs,r.method)}}call(e,r,i={}){let n=this.socket;if(!n)return Promise.reject(new Error("the plugin is not connected"));let o=`r${(this.seq++).toString(36)}`,s=i.timeoutMs??6e4;return new Promise((a,c)=>{this.pending.set(o,{resolve:a,reject:c,timeoutMs:s,method:e,timer:this.arm(o,s,e)}),this.send(n,{t:"req",id:o,method:e,params:r})})}arm(e,r,i){return setTimeout(()=>{let n=this.pending.get(e);n&&(this.pending.delete(e),n.reject(new Error(`${i} timed out after ${r} ms without progress`)))},r)}send(e,r){for(let i of eE(r))e.send(i)}};async function d4(t){let e=l4({input:process.stdin,output:process.stderr});try{let r=`${t.file.name}${t.user?.name?` (${t.user.name})`:""}`;for(let i=0;i<3;i++){if((await e.question(`
|
|
136
|
+
The CoDesignFlo plugin in "${r}" wants to connect.
|
|
137
|
+
Type the code shown in the plugin: `)).trim()===t.pairCode)return!0;console.error("that code doesn't match")}return!1}finally{e.close()}}Pr();sr();async function uz(t){let[e,r]=t.filter(n=>!n.startsWith("--"));if(!e||!r?.trim())throw new Error('usage: codesignflo ask <component> "<question for the designer>"');let i=xt(Ct()).get(e);if(!i)throw new Error(`${e} has no proposal ready for dev`);return En([Ew(i,r)]),console.log(`${e}: question sent to the designer (they see it at the next sync)`),0}Pr();sr();import{execFileSync as jr,spawnSync as h9}from"node:child_process";import{existsSync as Ii,readdirSync as m9,readFileSync as Ou,writeFileSync as Ma}from"node:fs";import{dirname as zm,join as Ot,relative as ik,resolve as g9}from"node:path";function y9(t){return`You are applying a designer's approved changes to the React component "${t.component}".
|
|
138
|
+
|
|
139
|
+
Designer's note: ${t.note??"(none)"}
|
|
140
|
+
|
|
141
|
+
Changes (from CoDesignFlo; implement each one exactly once):
|
|
142
|
+
${t.changes.map(ou).join(`
|
|
143
|
+
`)}
|
|
144
|
+
|
|
145
|
+
How the design maps to the code:
|
|
146
|
+
- Layer names are CSS-module class names: layer \`body/price\` is the element with class \`styles.price\` inside \`styles.body\`. "a > b" means layer b inside the nested component a.
|
|
147
|
+
- A layer named \`<layer>-margin\` (or \`<layer>-margin-top\` / \`-margin-left\`) is the CSS margin after (or before) \`<layer>\`: its size is that margin.
|
|
148
|
+
- Token values are CSS custom properties; use them exactly as given (e.g. var(--space-4)), never raw values.
|
|
149
|
+
- "size" changes list the layer's width/height and how it sizes (FIXED = explicit size, HUG = fits content, FILL = fills its container).
|
|
150
|
+
- Versions (variants) correspond to the component's stories: ${t.storiesHint}. Read the stories file to see which props produce each version.
|
|
151
|
+
|
|
152
|
+
Rules:
|
|
153
|
+
- Edit only these files: ${t.files.join(", ")}.
|
|
154
|
+
- Implement only the listed changes. Do not refactor, reformat, rename, or touch logic, handlers or accessibility.
|
|
155
|
+
- If a change cannot be implemented cleanly, do not guess: mark it "needs_decision" with a one-line reason.
|
|
156
|
+
- Do not run git; the caller commits.
|
|
157
|
+
|
|
158
|
+
When done, reply with ONLY this JSON (no prose, no code fences):
|
|
159
|
+
{"changes":[{"id":"C1","status":"applied|skipped|needs_decision","file":"<file>","note":"<short>"}]}
|
|
160
|
+
`}async function dz(t){let e=t.find(O=>!O.startsWith("--"));if(!e)throw new Error("usage: codesignflo deliver <component> [--track]");let r=Yt(),i=JSON.parse(Ou(g9(r.registry??".codesignflo/registry.json"),"utf8")),n=xt(Ct()).get(e);if(n?.state==="design_new"&&n.claim)return e.startsWith("pages.")?b9(e,n,i):_9(e,n,i);let o=i.screens?.[e],s=i.components[e]??(o?{module:e,files:o.files??[],stories:{}}:void 0);if(!s?.files?.length)throw new Error(`no files listed for ${e} in the registry`);let a=xt(Ct()).get(e);if(a?.state!=="ready_for_dev"||!a.claim)throw new Error(`${e} has no proposal ready for dev (state: ${a?.state??"unknown"}) \u2014 run codesignflo sync first`);let c=Ot(gt(),"proposals",e,a.claim.id);if(!Ii(Ot(c,"changes.json")))throw new Error("no computed changes for this proposal yet \u2014 run codesignflo sync first");let{changes:l}=JSON.parse(Ou(Ot(c,"changes.json"),"utf8"));if(!l.length)throw new Error("the proposal has no code changes (only example text?)");let u=l.some(O=>O.foreign?.length)?[...s.files,r.tokens??"tokens/tokens.json"]:s.files;if(t.includes("--track"))return v9(e,a.claim,u,c,l);let d=jr("git",["status","--porcelain","--",...s.files],{encoding:"utf8"}).trim();if(d)throw new Error(`these files have uncommitted changes; commit or stash them first:
|
|
161
|
+
${d}`);let p=Object.entries(s.stories).map(([O,X])=>`${ya(Object.entries(X).map(([le,$e])=>`${le}=${$e}`).join(","))} = story "${O}"`).join("; "),f=y9({component:e,files:u,storiesHint:p,...a.claim.note?{note:a.claim.note}:{},changes:l})+(o?`
|
|
162
|
+
This is a page (story ${o.story}). Layers inside "a > b" are inside a component used on the page: change the page's use of it (props, wrapper styles) only; if the change needs the component itself to change, mark it "needs_decision" ("this changes <component> everywhere \u2014 claim the component instead?").
|
|
163
|
+
`:"");console.error(`asking Claude Code to apply ${l.length} change(s) to ${u.join(", ")}\u2026`);let h=Date.now(),{report:m,touched:g}=ok(f,u.map(O=>`Edit(${O})`));Ma(Ot(c,"report.json"),`${JSON.stringify(m,null,2)}
|
|
164
|
+
`),console.log(`Claude Code finished in ${Math.round((Date.now()-h)/1e3)} s:`);for(let O of m.changes)console.log(` ${O.id}: ${O.status}${O.note?` \u2014 ${O.note}`:""}`);let y=jr("git",["rev-parse","--show-prefix"],{encoding:"utf8"}).trim(),v=new Set(u.map(O=>`${y}${O}`)),b=g.filter(O=>!v.has(O));if(b.length)throw new Error(`Claude Code changed files outside ${e}: ${b.join(", ")} \u2014 nothing committed, review the working tree`);let x=m.changes.filter(O=>O.status==="applied").map(O=>O.id);if(!x.length)return console.log("nothing applied; nothing committed"),1;let k=`CoDesignFlo: ${e} claim=${a.claim.id} items=${x.join(",")}`;jr("git",["add","--",...u]),jr("git",["commit","-q","-m",`Apply design proposal to ${e}`,"-m",`${a.claim.note?`Designer's note: ${a.claim.note}
|
|
165
|
+
|
|
166
|
+
`:""}${k}`]);let E=jr("git",["rev-parse","HEAD"],{encoding:"utf8"}).trim();return Ma(Ot(c,`delivered-${E.slice(0,8)}.json`),`${JSON.stringify({commit:E,changes:l},null,2)}
|
|
167
|
+
`),En([{id:`delivered_${a.claim.id}_${E.slice(0,8)}`,at:new Date().toISOString(),by:"cli",component:e,kind:"delivered",claim:a.claim.id,mode:"patch",ref:E}]),console.log(`committed ${E.slice(0,7)} with "${k}"`),console.log("next: codesignflo sync \u2014 re-renders, checks each change against the designer's copy, and closes the proposal"),0}function v9(t,e,r,i,n){Ma(Ot(i,"delivered-track.json"),`${JSON.stringify({commit:null,changes:n},null,2)}
|
|
168
|
+
`);let o=`CoDesignFlo: ${t} claim=${e.id} items=${n.map(a=>a.id).join(",")}`,s=`# ${t} \u2014 design changes to implement
|
|
169
|
+
|
|
170
|
+
Designer: ${e.by}${e.note?`
|
|
171
|
+
Note: ${e.note}`:""}
|
|
172
|
+
|
|
173
|
+
Files: ${r.join(", ")}
|
|
174
|
+
|
|
175
|
+
${n.map(ou).join(`
|
|
176
|
+
`)}
|
|
177
|
+
|
|
178
|
+
When committing, add this trailer to the commit message (drop the ids you did not implement):
|
|
179
|
+
|
|
180
|
+
${o}
|
|
181
|
+
|
|
182
|
+
The next \`codesignflo sync\` checks each listed change against the designer's copy and closes the proposal,
|
|
183
|
+
or sends the rest back to the designer with your notes.
|
|
184
|
+
`;return Ma(Ot(i,"HANDOFF.md"),s),En([{id:`delivered_${e.id}_track_${Ct().filter(a=>a.kind==="delivered"&&a.claim===e.id).length+1}`,at:new Date().toISOString(),by:"cli",component:t,kind:"delivered",claim:e.id,mode:"track"}]),console.log(s),console.log(`(saved to ${ik(process.cwd(),Ot(i,"HANDOFF.md"))})`),0}function fz(t){let r=Yt().tokens??"tokens/tokens.json",i=Ou(Ot(t,"spec.json"),"utf8"),n=new Map;for(let u of i.matchAll(/"family":\s*"([^"]+)",\s*"style":\s*"([^"]+)"/g))n.has(u[1])||n.set(u[1],new Set),n.get(u[1]).add(u[2]);let o=new Set([...Ou(r,"utf8").matchAll(/"\$value":\s*\[([^\]]*)\]/g)].flatMap(u=>[...u[1].matchAll(/"([^"]+)"/g)].map(d=>d[1]))),s=[...n].filter(([u])=>!o.has(u)),a=["src/base.css","src/index.css","src/global.css","src/styles.css"].find(u=>Ii(u)),c=u=>[...u].map(d=>({Thin:100,Light:300,Regular:400,Medium:500,"Semi Bold":600,SemiBold:600,Bold:700,Black:900})[d.replace(/ Italic$/,"")]??400);return{rules:`${s.length?`- Fonts: the design uses ${s.map(([u,d])=>`${u} (${[...d].join(", ")})`).join("; ")}, which the app doesn't load. The designer chose ${s.length>1?"them":"it"}: load ${s.length>1?"them":"it"} in ${a??"the app's global stylesheet"} with a Google Fonts @import (e.g. @import url("https://fonts.googleapis.com/css2?family=${s[0][0].replace(/ /g,"+")}:wght@${[...new Set(c(s[0][1]))].sort().join(";")}&display=swap");), add a font-family token to ${r} and use it for this design only. Don't change the font of anything else.
|
|
185
|
+
`:""}- Colours without a Figma variable: use the project token with the same value; if there is none, add a token to ${r} named after its use (e.g. color.alert.surface) and use it \u2014 no raw hex in the styles.
|
|
186
|
+
`,files:[r,...s.length&&a?[a]:[]]}}function ok(t,e){let r=()=>new Set(jr("git",["status","--porcelain","--untracked-files=all"],{encoding:"utf8"}).split(`
|
|
187
|
+
`).filter(Boolean)),i=r(),n=h9("claude",["-p",t,"--permission-mode","acceptEdits","--allowedTools","Read","Glob","Grep",...e,"--output-format","json"],{encoding:"utf8",timeout:9e5});if(n.error)throw new Error(`could not run Claude Code: ${n.error.message}`);let o;try{let s=JSON.parse(n.stdout).result;o=JSON.parse(s.replace(/^```(?:json)?\s*|\s*```$/g,""))}catch{throw new Error(`Claude Code did not return a report:
|
|
188
|
+
${(n.stdout||n.stderr).slice(0,2e3)}`)}return{report:o,touched:[...r()].filter(s=>!i.has(s)).map(s=>s.slice(3))}}async function _9(t,e,r){let i=e.claim,n=Ot(gt(),"proposals",t,i.id);if(!Ii(Ot(n,"spec.json")))throw new Error("no spec for this new design yet \u2014 run codesignflo sync first");let o=Object.values(r.components).map(k=>zm(zm(k.files?.[0]??""))),s=[...new Set(o)].sort((k,E)=>o.filter(O=>O===E).length-o.filter(O=>O===k).length)[0];if(!s||s===".")throw new Error("could not tell where components live (no registered components with files)");let a=su(t.split(".").pop()??t),c=Ot(s,a);if(Ii(c))throw new Error(`${c} already exists \u2014 rename the design or remove the folder`);let l=Object.entries(r.components).sort((k,E)=>(E[1].files?.length??0)-(k[1].files?.length??0))[0],u=zm(l[1].files[0]),d=k=>ik(process.cwd(),k),p=fz(n),f=`Build a new React component "${a}" from a designer's design.
|
|
189
|
+
|
|
190
|
+
Designer's note: ${i.note??"(none)"}
|
|
191
|
+
|
|
192
|
+
The design:
|
|
193
|
+
- ${d(Ot(n,"design.png"))} \u2014 a picture of it (read it).
|
|
194
|
+
- ${d(Ot(n,"spec.json"))} \u2014 its exact layers: sizes, auto layout (direction, gap, padding, alignment), colours, borders, radii, text styles. Token values appear as var(collection/name); use the matching CSS custom properties from the project's tokens, never raw values when a token exists. If it has variants (a component set), each variant's properties become props.
|
|
195
|
+
|
|
196
|
+
Follow the conventions of the existing component in ${u}/ exactly (read every file there, including its stories file): same file layout, styling approach, naming, exports and story format.
|
|
197
|
+
|
|
198
|
+
Create, in ${c}/ only:
|
|
199
|
+
- the component and its styles;
|
|
200
|
+
- a stories file whose title is exactly "${a}", with one story per variant (and a default story), using realistic example data.
|
|
201
|
+
|
|
202
|
+
Rules:
|
|
203
|
+
- Name every element that maps to a layer with a data-cdf attribute in lowercase kebab-case matching the layer names in the spec where they make sense (e.g. data-cdf="title").
|
|
204
|
+
${p.rules}- Do not edit any other file; do not add the component to pages (the developer decides where it is used).
|
|
205
|
+
- Do not run git or install packages.
|
|
206
|
+
|
|
207
|
+
When done, reply with ONLY this JSON (no prose, no code fences):
|
|
208
|
+
{"changes":[{"id":"new","status":"applied|needs_decision","file":"<main file>","note":"<short: what you built, or what is unclear>"}]}
|
|
209
|
+
`;console.error(`asking Claude Code to build ${a} in ${c}\u2026`);let h=Date.now(),{report:m,touched:g}=ok(f,[`${c}/**`,...p.files].flatMap(k=>[`Edit(${k})`,`Write(${k})`]));Ma(Ot(n,"report.json"),`${JSON.stringify(m,null,2)}
|
|
210
|
+
`),console.log(`Claude Code finished in ${Math.round((Date.now()-h)/1e3)} s:`);for(let k of m.changes)console.log(` ${k.status}${k.note?` \u2014 ${k.note}`:""}`);let y=jr("git",["rev-parse","--show-prefix"],{encoding:"utf8"}).trim(),v=g.filter(k=>!k.startsWith(`${y}${c}/`)&&!p.files.some(E=>k===`${y}${E}`)&&!/(^|\/)src\/tokens\.css$/.test(k));if(v.length)throw new Error(`Claude Code changed files outside ${c}: ${v.join(", ")} \u2014 nothing committed, review the working tree`);if(!g.length||!m.changes.some(k=>k.status==="applied"))return console.log("nothing built; nothing committed"),1;let b=`CoDesignFlo: ${t} claim=${i.id} items=new`;jr("git",["add","--",...g.map(k=>k.slice(y.length))]),jr("git",["commit","-q","-m",`Add ${a} from a new design`,"-m",`${i.note?`Designer's note: ${i.note}
|
|
211
|
+
|
|
212
|
+
`:""}${b}`]);let x=jr("git",["rev-parse","HEAD"],{encoding:"utf8"}).trim();return En([{id:`delivered_${i.id}_${x.slice(0,8)}`,at:new Date().toISOString(),by:"cli",component:t,kind:"delivered",claim:i.id,mode:"patch",ref:x}]),console.log(`committed ${x.slice(0,7)} with "${b}"`),console.log("next: codesignflo sync \u2014 registers it from Storybook, builds it in Live and closes the proposal"),0}async function b9(t,e,r){let i=e.claim,n=Ot(gt(),"proposals",t,i.id);if(!Ii(Ot(n,"spec.json")))throw new Error("no spec for this new design yet \u2014 run codesignflo sync first");let s=Object.values(r.screens??{}).find(de=>de.files?.length)?.files??[],a=s[0]?zm(s[0]):"src/pages",c=Ii(a)?m9(a).find(de=>/\.stories\.[jt]sx?$/.test(de)):void 0;if(!c)throw new Error(`no page stories file in ${a} (CoDesignFlo renders pages from a Storybook page story)`);let l=Ot(a,c),u=["src/App.tsx","src/App.jsx","src/app.tsx"].find(de=>Ii(de)),d=t.replace(/^pages\./,"").replace(/-page$/,""),p=Rw(d),f=Ot(a,p.component);if(Ii(`${f}.tsx`)||Ii(`${f}.jsx`))throw new Error(`${f} already exists \u2014 rename the design`);let h=de=>ik(process.cwd(),de),m=Math.round(Number(JSON.parse(Ou(Ot(n,"spec.json"),"utf8")).width??0)),g=Object.values(r.components).map(de=>`- ${de.module}: ${(de.files??[]).filter(pt=>/\.[jt]sx?$/.test(pt)).join(", ")}`).join(`
|
|
213
|
+
`),y=fz(n),v=`Build a new page "${p.component}" of this React app from a designer's full-screen design.
|
|
214
|
+
|
|
215
|
+
Designer's note: ${i.note??"(none)"}
|
|
216
|
+
|
|
217
|
+
The design:
|
|
218
|
+
- ${h(Ot(n,"design.png"))} \u2014 a picture of it (read it).
|
|
219
|
+
- ${h(Ot(n,"spec.json"))} \u2014 its exact layers: sizes, auto layout, colours, text. INSTANCE layers are existing components (their mainComponent names the component and its variant): reuse those React components with matching props, don't rebuild them.
|
|
220
|
+
|
|
221
|
+
Existing components (reuse them where the design uses them):
|
|
222
|
+
${g}
|
|
223
|
+
|
|
224
|
+
Follow the conventions of the existing pages (${s.join(", ")}) exactly: file layout, styling approach, naming, data and component usage.
|
|
225
|
+
|
|
226
|
+
Create / change exactly:
|
|
227
|
+
1. ${f}.tsx (+ its styles next to it, named like the existing pages' styles): the page component \`${p.component}\`. Example data like the existing pages use.
|
|
228
|
+
2. ${l}: add \`export const ${p.story}\` rendering \`<${p.component} />\`, like the other page stories (keep the file's decorators and parameters).${m?` The design is ${m}px wide: render this story at that width without nesting a second container \u2014 if the file's decorator has a fixed width, make it read a story parameter (\`parameters.width\`, defaulting to the current width) and set \`parameters: { width: ${m} }\` on the new story.`:""}
|
|
229
|
+
${u?`3. ${u}: add a route for it (\`#/${d}\`), like the existing routes.`:""}
|
|
230
|
+
|
|
231
|
+
Rules:
|
|
232
|
+
- Name every element that maps to a layer with a data-cdf attribute (lowercase kebab-case, the spec's layer names where they make sense).
|
|
233
|
+
- Colours, spacing, radii, font sizes: use the project's tokens (CSS custom properties) when one has the same value; a Figma variable from the design that isn't a project token yet is the designer's decision \u2014 add it to the tokens file and use it.
|
|
234
|
+
${y.rules}- Do not change existing components or other pages. Do not run git or install packages.
|
|
235
|
+
|
|
236
|
+
When done, reply with ONLY this JSON (no prose, no code fences):
|
|
237
|
+
{"changes":[{"id":"new","status":"applied|needs_decision","file":"<page file>","note":"<short: what you built, or what is unclear>"}]}
|
|
238
|
+
`;console.error(`asking Claude Code to build the page ${p.component} (${f}.tsx, story ${p.story})\u2026`);let b=Date.now(),x=Yt().tokens??"tokens/tokens.json",k=[`${f}.*`,l,...u?[u]:[],x,...y.files],{report:E,touched:O}=ok(v,k.flatMap(de=>[`Edit(${de})`,`Write(${de})`]));Ma(Ot(n,"report.json"),`${JSON.stringify(E,null,2)}
|
|
239
|
+
`),console.log(`Claude Code finished in ${Math.round((Date.now()-b)/1e3)} s:`);for(let de of E.changes)console.log(` ${de.status}${de.note?` \u2014 ${de.note}`:""}`);let X=jr("git",["rev-parse","--show-prefix"],{encoding:"utf8"}).trim(),le=de=>de.startsWith(`${X}${f}.`)||[l,u,x,...y.files].some(pt=>pt&&de===`${X}${pt}`)||/(^|\/)src\/tokens\.css$/.test(de),$e=O.filter(de=>!le(de));if($e.length)throw new Error(`Claude Code changed files outside the new page: ${$e.join(", ")} \u2014 nothing committed, review the working tree`);if(!O.length||!E.changes.some(de=>de.status==="applied"))return console.log("nothing built; nothing committed"),1;let q=`CoDesignFlo: ${t} claim=${i.id} items=new`;jr("git",["add","--",...O.map(de=>de.slice(X.length))]),jr("git",["commit","-q","-m",`Add the ${p.component} page from a new design`,"-m",`${i.note?`Designer's note: ${i.note}
|
|
240
|
+
|
|
241
|
+
`:""}${q}`]);let Re=jr("git",["rev-parse","HEAD"],{encoding:"utf8"}).trim();return En([{id:`delivered_${i.id}_${Re.slice(0,8)}`,at:new Date().toISOString(),by:"cli",component:t,kind:"delivered",claim:i.id,mode:"patch",ref:Re}]),console.log(`committed ${Re.slice(0,7)} with "${q}"`),console.log("next: codesignflo sync \u2014 renders the page story, builds it in Live \u2192 Screens and closes the proposal"),0}Pr();sr();import{mkdirSync as J9,readFileSync as X9,writeFileSync as Hz}from"node:fs";import{join as wk,resolve as Y9}from"node:path";async function Yn(t,e){let r=new df({accept:t});await r.listen(),console.error("waiting for the CoDesignFlo plugin in Figma desktop\u2026");try{let i=await r.waitForPlugin(Number(process.env.CODESIGNFLO_WAIT_S??process.env.CODESIGNLOOP_WAIT_S??120)*1e3);return console.error(`connected to "${i.hello.file.name}" (plugin ${i.hello.plugin.version})`),await e(i)}finally{await r.close()}}Pr();import{execSync as V9}from"node:child_process";import{existsSync as vk,mkdirSync as B9,readFileSync as _k,writeFileSync as Ru}from"node:fs";import{join as Tn,relative as Zz,resolve as qz}from"node:path";import{execFileSync as Pu}from"node:child_process";var Yi=t=>Pu("git",t,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();function Cm(){try{return Yi(["rev-parse","HEAD"])}catch{return"uncommitted"}}function Au(){try{return Yi(["rev-parse","--abbrev-ref","HEAD"])}catch{return null}}function pz(t){let e;try{let r=t&&t!=="uncommitted"?[`${t}..HEAD`]:["HEAD"];e=Yi(["log","--format=%H%x1f%B%x1e",...r])}catch{return[]}return w9(e)}function w9(t){let e=[];for(let r of t.split("")){let[i,n]=r.trim().split("");if(!(!i||!n))for(let o of n.split(`
|
|
242
|
+
`)){let s=/^CoDesign(?:Flo|Loop):\s*(\S+)\s+claim=(\S+)(?:\s+items=(\S+))?\s*$/.exec(o.trim());s&&e.push({commit:i,component:s[1],claim:s[2],items:s[3]?s[3].split(","):[]})}}return e}function hz(){try{return Yi(["status","--porcelain","--",".",":(exclude).codesignflo",":(exclude).codesignloop"]).split(`
|
|
243
|
+
`).filter(Boolean).map(t=>t.replace(/^[ MADRCU?!T]{1,2} /,""))}catch{return[]}}var $9=[/\.(md|txt|rst|log)$/i,/(^|\/)(docs?|scripts|e2e|\.github|\.vscode|\.idea)\//,/\.(test|spec)\.[cm]?[jt]sx?$/,/(^|\/)(__tests__|__mocks__)\//];function mz(t,e=[]){return $9.some(r=>r.test(t))?!1:!e.some(r=>new RegExp(`^${r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*\/?/g,"\xA7").replace(/\*/g,"[^/]*").replace(/§/g,".*")}$`).test(t))}function Nm(){try{return Yi(["symbolic-ref","--short","refs/remotes/origin/HEAD"]).replace(/^origin\//,"")}catch{for(let t of["main","master"])try{return Yi(["rev-parse","--verify","--quiet",`refs/heads/${t}`]),t}catch{}return Au()}}function gz(t){try{Pu("git",["fetch","--quiet","origin",t],{stdio:"ignore",timeout:2e4})}catch{}for(let e of[`refs/remotes/origin/${t}`,`refs/heads/${t}`])try{return Yi(["rev-parse","--verify","--quiet",e])}catch{}return null}function yz(t,e){try{return Pu("git",["merge-base","--is-ancestor",e,t],{stdio:"ignore"}),!0}catch(r){return r.status===1?!1:null}}function vz(t,e){try{return Number(Yi(["rev-list","--count",`${t}..${e}`]))}catch{return null}}function _z(t){try{return Pu("git",["diff","--quiet",t,"HEAD","--",".",":(exclude).codesignflo"],{stdio:"ignore"}),!1}catch(e){return e.status===1?!0:null}}function bz(t,e,r){if(!r.length)return null;try{return Pu("git",["diff","--quiet",t,e,"--",...r],{stdio:"ignore"}),!0}catch(i){return i.status===1?!1:null}}sr();Pr();import{createReadStream as T9,existsSync as Tz,readFileSync as O9,statSync as P9}from"node:fs";import{createServer as A9}from"node:http";import{extname as R9,join as lk}from"node:path";import{chromium as j9}from"playwright";function wz(){let t=document.querySelector("[data-cdf-container], [data-cdl-container]")??document.querySelector("#storybook-root"),e=t.firstElementChild;if(!e)throw new Error("story rendered nothing");let r=[e,...Array.from(e.querySelectorAll("*"))],i=t.style.width,n=S=>(t.style.width=`${S}px`,new Map(r.map(T=>[T,T.getBoundingClientRect().width]))),o=new Map(r.map(S=>[S,S.getBoundingClientRect()])),s=Math.round(t.getBoundingClientRect().width),a=n(s),c=n(s+160);t.style.width=i;let l=[],u=S=>{for(let T of Array.from(S))T instanceof CSSStyleRule?l.push(T):T instanceof CSSMediaRule?window.matchMedia(T.conditionText||T.media.mediaText).matches&&u(T.cssRules):T instanceof CSSSupportsRule?CSS.supports(T.conditionText)&&u(T.cssRules):"cssRules"in T&&T.cssRules&&u(T.cssRules)};for(let S of Array.from(document.styleSheets)){let T;try{T=S.cssRules}catch{continue}u(T)}let d=(S,T)=>{let Q=S.style?.getPropertyValue(T)??"";if(Q)return Q.trim();for(let ye of l){let _e=!1;try{_e=S.matches(ye.selectorText)}catch{}if(_e){let Qe=ye.style.getPropertyValue(T);Qe&&(Q=Qe)}}return Q.trim()},p=(S,T)=>{for(let Q=S;Q;Q=Q.parentElement){let ye=d(Q,T);if(ye)return ye}return""},f=S=>/var\(--([\w-]+)\)/.exec(S)?.[1],h=(S,T,Q,ye)=>{let _e=d(S,ye);if(_e)return f(_e);let Qe=d(S,T).split(/\s+(?![^(]*\))/).filter(Boolean);if(Qe.length===0)return;let ht=[[0,0,0,0],[0,1,0,1],[0,1,2,1],[0,1,2,3]][Math.min(Qe.length,4)-1][Q];return f(Qe[ht])},m=S=>Math.round(S*100)/100,g=S=>S==="normal"||S===""?0:parseFloat(S)||0,y=S=>{let T=/rgba?\(([^)]+)\)/.exec(S);if(!T)return;let[Q,ye,_e,Qe="1"]=T[1].split(/[,\s/]+/).filter(Boolean);if(parseFloat(Qe)===0)return;let ht=_=>Math.round(_).toString(16).padStart(2,"0");return`#${ht(+Q)}${ht(+ye)}${ht(+_e)}${parseFloat(Qe)<1?ht(parseFloat(Qe)*255):""}`},v=(S,T)=>T?{value:S,token:T}:{value:S},b=S=>{for(let T of Array.from(S.classList)){let Q=/^([A-Za-z0-9]+)-module__[\w-]+$/.exec(T);if(Q)return Q[1]}},x=b(e),k=S=>{let T=S.getAttribute("data-cdf")??S.getAttribute("data-cdl");if(T)return T;for(let Q of Array.from(S.classList)){let ye=/^[A-Za-z0-9]+-module__([\w-]+)$/.exec(Q);if(ye)return ye[1]}},E=(S,T)=>k(S)??T,O=S=>{let T=S.parentElement;for(;T&&T!==t&&getComputedStyle(T).display==="contents";)T=T.parentElement;return T},X=S=>Array.from(S.childNodes).flatMap(T=>T.nodeType===Node.ELEMENT_NODE&&getComputedStyle(T).display==="contents"?X(T):[T]),le=(S,T)=>{let Q=O(S);if(!Q)return!1;let ye=getComputedStyle(Q);return(ye.display==="flex"||ye.display==="inline-flex")&&ye.flexDirection.startsWith(T)&&parseFloat(getComputedStyle(S).flexGrow)>0},$e=S=>{if(Math.abs((c.get(S)??0)-(a.get(S)??0))>.5)return"fill";let T=d(S,"width");if(/^\d+(\.\d+)?px$/.test(T)||/^-?[\d.]+(rem|em|vw|ch)$|^calc\(/.test(T)||/^table-(cell|row|header-group|row-group|footer-group|column)$/.test(getComputedStyle(S).display))return"fixed";if(/^(fit-content|max-content|min-content)$/.test(T))return"hug";if(le(S,"row"))return"fill";let Q=getComputedStyle(S),ye=S.getBoundingClientRect().width;if(/px$/.test(Q.maxWidth)&&Math.abs(ye-parseFloat(Q.maxWidth))<.5||/px$/.test(Q.minWidth)&&parseFloat(Q.minWidth)>0&&Math.abs(ye-parseFloat(Q.minWidth))<.5)return"fixed";let _e=O(S),Qe=_e?getComputedStyle(_e):null;if(Qe&&/flex/.test(Qe.display)&&Qe.flexDirection.startsWith("row")&&/px$/.test(Q.flexBasis)&&parseFloat(Q.flexGrow)===0)return"fixed";if(/^100(\.0+)?%$/.test(T))return"fill";if(/%$/.test(T))return"fixed";let ht=O(S);if(ht&&S!==e){let _=getComputedStyle(ht),U=getComputedStyle(S),z=U.alignSelf,ue=z==="auto"?_.alignItems:z;if((_.display==="flex"||_.display==="inline-flex")&&_.flexDirection.startsWith("column")&&(ue==="normal"||ue==="stretch"))return"fill";let we=U.justifySelf==="auto"?_.justifyItems:U.justifySelf;if((_.display==="grid"||_.display==="inline-grid")&&/^(normal|stretch|legacy)$/.test(we))return"fill";let Ee=!/flex|grid|inline|table/.test(_.display),zt=["block","flex","grid","flow-root","list-item"].includes(U.display),Mr=!d(S,"width")||d(S,"width")==="auto";if(Ee&&zt&&Mr&&U.float==="none"&&U.position!=="absolute"&&U.position!=="fixed")return"fill"}return"hug"},q=S=>{let T=d(S,"height");if(/^\d+(\.\d+)?px$/.test(T)||/^-?[\d.]+(vh|dvh|svh|lvh|rem|em)$|^calc\(/.test(T))return"fixed";if(/%$/.test(T))return S===e?"fixed":"fill";if(le(S,"column"))return"fill";let Q=getComputedStyle(S).minHeight;if(/px$/.test(Q)&&parseFloat(Q)>0&&Math.abs(S.getBoundingClientRect().height-parseFloat(Q))<.5||S===e&&Math.abs(Re(S)-S.getBoundingClientRect().height)>.5)return"fixed";let ye=O(S);if(ye&&S!==e){let _e=getComputedStyle(ye),Qe=getComputedStyle(S).alignSelf,ht=Qe==="auto"?_e.alignItems:Qe,_=ht==="normal"||ht==="stretch",U=_e.display==="grid"||_e.display==="inline-grid",z=(_e.display==="flex"||_e.display==="inline-flex")&&_e.flexDirection.startsWith("row");if(_&&(U||z))return"fill"}return"hug"},Re=S=>{let T=S.style.alignSelf;S.style.alignSelf="flex-start";let Q=S.getBoundingClientRect().height;return S.style.alignSelf=T,Q},de=S=>S==="center"?"CENTER":S==="flex-end"||S==="end"?"MAX":S==="baseline"?"BASELINE":S==="normal"||S==="stretch"?"STRETCH":"MIN",pt=S=>S==="center"?"CENTER":S==="flex-end"||S==="end"?"MAX":S==="space-between"?"SPACE_BETWEEN":"MIN",Zt=(S,T)=>{let Q=S.getBoundingClientRect();if(!S.complete||!S.naturalWidth||Q.width<1||Q.height<1)return{};try{let _e=document.createElement("canvas");_e.width=Math.round(Q.width*2),_e.height=Math.round(Q.height*2);let Qe=_e.getContext("2d"),ht=S.naturalWidth,_=S.naturalHeight,U=T.objectFit,z=_e.width,ue=_e.height;if(U==="cover"||U==="contain"){let ie=(U==="cover"?Math.max:Math.min)(_e.width/ht,_e.height/_);z=ht*ie,ue=_*ie}return Qe.drawImage(S,(_e.width-z)/2,(_e.height-ue)/2,z,ue),{image:{png:_e.toDataURL("image/png").split(",")[1]}}}catch{return{}}},Y=S=>{let T=document.createRange(),Q=Array.from(S.childNodes).find(_e=>_e.nodeType===Node.TEXT_NODE&&_e.textContent.trim());if(!Q)return 0;T.selectNodeContents(Q);let ye=T.getClientRects()[0];return ye?Math.round(ye.height*100)/100:0},De=(S,T)=>{let Q=S.getBoundingClientRect(),ye=g(T.paddingLeft)+g(T.paddingRight)+g(T.borderLeftWidth)+g(T.borderRightWidth),_e=g(T.paddingTop)+g(T.paddingBottom)+g(T.borderTopWidth)+g(T.borderBottomWidth);return{w:m(Math.max(0,Q.width-ye)),h:m(Math.max(0,Q.height-_e))}},Lt=(S,T,Q)=>{let ye=parseInt(T.getPropertyValue("-webkit-line-clamp"),10),_e=T.textTransform,Qe=_e==="uppercase"?"UPPER":_e==="lowercase"?"LOWER":_e==="capitalize"?"TITLE":void 0,ht=T.textOverflow==="ellipsis"&&T.whiteSpace.startsWith("nowrap")?1:0,_=T.textAlign,U=_==="center"?"CENTER":_==="right"||_==="end"?"RIGHT":_==="justify"?"JUSTIFIED":void 0;return{characters:Q,fontFamily:T.fontFamily.split(",")[0].replace(/["']/g,"").trim(),fontWeight:v(parseInt(T.fontWeight,10),f(p(S,"font-weight"))),fontSize:v(g(T.fontSize),f(p(S,"font-size"))),lineHeight:T.lineHeight==="normal"?Y(S):g(T.lineHeight),letterSpacing:g(T.letterSpacing),color:v(y(T.color)??"#000000",f(p(S,"color"))),...ye>0?{maxLines:ye}:ht?{maxLines:1}:{},...U?{align:U}:{},...Qe?{case:Qe}:{}}},Ht=(S,T)=>{let Q=/linear-gradient\((.*)\)\s*$/.exec(S.trim());if(!Q||S.indexOf("gradient(")!==S.lastIndexOf("gradient("))return;let ye=Q[1].split(/,(?![^(]*\))/).map(z=>z.trim()),_e=180,Qe={top:0,right:90,bottom:180,left:270,"top right":45,"right top":45,"bottom right":135,"right bottom":135,"bottom left":225,"left bottom":225,"top left":315,"left top":315};if(/deg$|turn$|rad$/.test(ye[0])){let z=parseFloat(ye[0]);_e=ye[0].endsWith("turn")?z*360:ye[0].endsWith("rad")?z*180/Math.PI:z,ye.shift()}else ye[0].startsWith("to ")&&(_e=Qe[ye.shift().slice(3)]??180);let ht=[...T.matchAll(/var\(--([\w-]+)\)/g)].map(z=>z[1]),_=ye.flatMap(z=>{let ue=y(/rgba?\([^)]+\)/.exec(z)?.[0]??"");if(!ue)return[];let ie=/(-?[\d.]+)%\s*$/.exec(z);return[{color:ue,position:ie?parseFloat(ie[1])/100:Number.NaN}]});if(_.length<2)return;Number.isNaN(_[0].position)&&(_[0].position=0),Number.isNaN(_[_.length-1].position)&&(_[_.length-1].position=1);for(let z=1;z<_.length-1;z++)if(Number.isNaN(_[z].position)){let ue=z;for(;Number.isNaN(_[ue].position);)ue++;let ie=_[z-1].position,we=_[ue].position;for(let Ee=z;Ee<ue;Ee++)_[Ee].position=ie+(we-ie)*(Ee-z+1)/(ue-z+1)}let U=ht.length===_.length;return{angle:Math.round(_e*100)/100,stops:_.map((z,ue)=>({color:v(z.color,U?ht[ue]:void 0),position:Math.round(z.position*1e3)/1e3}))}},Mn=(S,T)=>/^(pre|break-spaces)/.test(T)?S.replace(/^\n|\n$/g,""):T==="pre-line"?S.split(`
|
|
244
|
+
`).map(Q=>Q.replace(/[ \t\f\r]+/g," ").trim()).join(`
|
|
245
|
+
`).trim():S.replace(/\s+/g," ").trim(),Fn=o.get(e)??e.getBoundingClientRect(),Xd=S=>({x:m(S.left-Fn.left),y:m(S.top-Fn.top)}),Yd=S=>{let T=getComputedStyle(S),Q=o.get(S)??S.getBoundingClientRect(),ye=S.parentElement,_e=(T.position==="absolute"||T.position==="fixed")&&ye&&S!==t&&S!==e,Qe=_e?o.get(ye)??ye.getBoundingClientRect():null,ht=/^matrix\(([^)]+)\)/.exec(T.transform),[_,U]=ht?ht[1].split(",").map(Number):[1,0],z=ht?Math.round(Math.atan2(U,_)*180/Math.PI*100)/100:0,ue=Math.abs(z)>.05&&S instanceof HTMLElement,ie={name:E(S,S.tagName.toLowerCase()),...k(S)||S.tagName.toLowerCase()==="svg"?{}:{unnamed:!0},width:m(ue?S.offsetWidth:Q.width),height:m(ue?S.offsetHeight:Q.height),sizing:_e||ue?{w:"fixed",h:"fixed"}:{w:$e(S),h:q(S)},...ue?{rotation:z}:{},...Qe?{absolute:{x:m(Q.left-Qe.left),y:m(Q.top-Qe.top)}}:{},...b(S)?{module:b(S)}:{},at:Xd(Q)};if(S.tagName==="IMG")return{...ie,type:"IMAGE",fill:v("#e0e7ff"),...Zt(S,T)};if(S.tagName.toLowerCase()==="svg"){let oe=S.outerHTML.replace(/currentColor/g,y(T.color)??"#000000");return{...ie,type:"SVG",svg:oe}}let we=X(S),Ee=we.filter(oe=>oe.nodeType===Node.ELEMENT_NODE&&getComputedStyle(oe).display!=="none"),zt=we.filter(oe=>oe.nodeType===Node.TEXT_NODE&&oe.textContent.trim()).map(oe=>Mn(oe.textContent,T.whiteSpace)),Mr=!!y(T.backgroundColor)||g(T.borderTopWidth)>0||g(T.paddingTop)+g(T.paddingLeft)>0;if(Ee.length===0&&zt.length>0&&!Mr){let oe=Lt(S,T,zt.join(" ")),nt=oe.lineHeight||Y(S)||1,Ze=Math.round(Q.height/nt),ut=S.scrollWidth>S.clientWidth+1,kt=(Ze>1||(oe.maxLines??0)>1||oe.maxLines===1&&ut)&&ie.sizing.w==="hug"?{...ie.sizing,w:"fill"}:ie.sizing;return{...ie,sizing:kt,name:E(S,"text"),type:"TEXT",text:oe}}let G={...ie,type:"FRAME"},Gr=b(S);Gr&&(S===e||Gr!==x)&&(G.component={module:Gr,classes:Array.from(S.classList).map(oe=>/-module__([\w-]+)$/.exec(oe)?.[1]).filter(oe=>!!oe).sort()});let Kt=T.display,ko=Kt==="flex"||Kt==="inline-flex",zs=!1,So=ko&&T.flexDirection.startsWith("row")||Kt==="table-row";if(Kt==="grid"||Kt==="inline-grid"){let oe=Je=>Je==="none"?0:Je.trim().split(/\s+/).length,nt=f(d(S,"gap"));G.layout={direction:"GRID",columns:oe(T.gridTemplateColumns),...T.gridTemplateColumns!=="none"?{columnSizes:T.gridTemplateColumns.trim().split(/\s+/).map(Je=>m(g(Je)))}:{},rows:Math.max(1,oe(T.gridTemplateRows)),gap:v(g(T.columnGap),f(d(S,"column-gap"))??nt),rowGap:v(g(T.rowGap),f(d(S,"row-gap"))??nt),padding:[v(g(T.paddingTop),h(S,"padding",0,"padding-top")),v(g(T.paddingRight),h(S,"padding",1,"padding-right")),v(g(T.paddingBottom),h(S,"padding",2,"padding-bottom")),v(g(T.paddingLeft),h(S,"padding",3,"padding-left"))],align:"STRETCH",justify:"MIN"};let Ze=Array.from(S.children).filter(Je=>{let kt=getComputedStyle(Je);return kt.display!=="none"&&kt.position!=="absolute"&&kt.position!=="fixed"}),ut=Math.max(0,...G.layout.columnSizes??[0]);if((G.layout.columns??0)>1&&Ze.some(Je=>Je.getBoundingClientRect().width>ut+1)){let Je=new Set(Ze.map(yn=>Math.round(yn.getBoundingClientRect().top))),{columns:kt,columnSizes:ui,rows:di,...fi}=G.layout;G.layout={...fi,direction:"HORIZONTAL",align:"STRETCH",...Je.size>1?{wrap:!0}:{}},zs=!0}}else G.layout={direction:So?"HORIZONTAL":"VERTICAL",gap:v(g(So?T.columnGap:T.rowGap),f(d(S,"gap"))??f(d(S,So?"column-gap":"row-gap"))),padding:[v(g(T.paddingTop),h(S,"padding",0,"padding-top")),v(g(T.paddingRight),h(S,"padding",1,"padding-right")),v(g(T.paddingBottom),h(S,"padding",2,"padding-bottom")),v(g(T.paddingLeft),h(S,"padding",3,"padding-left"))],align:ko?de(T.alignItems):"STRETCH",justify:ko?pt(T.justifyContent):"MIN",...So&&T.flexWrap.startsWith("wrap")?{wrap:!0,rowGap:v(g(T.rowGap),f(d(S,"row-gap"))??f(d(S,"gap")))}:{}};let Zn=y(T.backgroundColor);Zn&&(G.fill=v(Zn,f(d(S,"background"))??f(d(S,"background-color"))));let Qd=Ht(T.backgroundImage,d(S,"background")||d(S,"background-image"));Qd&&(G.gradient=Qd);let ef=oe=>T.getPropertyValue(`border-${oe.toLowerCase()}-style`)==="none"?0:g(T.getPropertyValue(`border-${oe.toLowerCase()}-width`)),tf=[ef("Top"),ef("Right"),ef("Bottom"),ef("Left")],Ni=Math.max(...tf);if(Ni>0){let nt=["Top","Right","Bottom","Left"][tf.indexOf(Ni)],Ze=y(T.getPropertyValue(`border-${nt.toLowerCase()}-color`))??"#00000000",ut=f(d(S,"border-color"))??f(d(S,"border"))??f(d(S,`border-${nt.toLowerCase()}-color`))??f(d(S,`border-${nt.toLowerCase()}`)),Je=T.getPropertyValue(`border-${nt.toLowerCase()}-style`),kt=Je==="dashed"?[Ni*3,Ni*3]:Je==="dotted"?[Ni,Ni]:void 0;G.stroke={color:v(Ze,ut),width:Ni,...tf.some(ui=>ui!==Ni)?{sides:tf}:{},...kt?{dash:kt}:{}}}let WI=g(T.borderTopLeftRadius);WI>0&&(G.radius=v(Math.min(WI,9999),f(d(S,"border-radius"))));let KI=parseFloat(T.opacity);KI<1&&(G.opacity=KI),(T.overflow==="hidden"||T.overflowX==="hidden")&&(G.clip=!0),T.boxShadow!=="none"&&(G.shadow=T.boxShadow);let Cs=S.tagName;if(Cs==="INPUT"||Cs==="TEXTAREA"||Cs==="SELECT"){let oe=S,nt=(oe.getAttribute("type")??"text").toLowerCase(),Ze=Cs==="SELECT"?oe.selectedOptions[0]?.text??"":nt==="password"?"\u2022".repeat(oe.value.length):oe.value,ut=Ze||oe.placeholder||"";if(ut&&!["checkbox","radio","range","color","file","hidden","submit","button"].includes(nt)){let Je=Lt(S,T,ut);if(!Ze){let fi=getComputedStyle(S,"::placeholder"),yn;for(let VM of Array.from(document.styleSheets)){let QI;try{QI=VM.cssRules}catch{continue}for(let of of Array.from(QI)){if(!(of instanceof CSSStyleRule)||!of.selectorText.includes("::placeholder"))continue;let BM=of.selectorText.replace(/::placeholder/g,"");try{S.matches(BM)&&(yn=f(of.style.getPropertyValue("color"))??yn)}catch{}}}let Yy=y(T.color),nf=y(fi.color)??Je.color.value;Je.color=v(nf,yn??(nf===Yy?f(p(S,"color")):void 0))}G.layout&&Cs!=="TEXTAREA"&&(G.layout.justify="CENTER");let kt=De(S,T),ui=Je.lineHeight||Y(S)||g(T.fontSize)*1.2,di=Cs==="TEXTAREA"?kt.h:m(Math.min(kt.h,ui));return G.children=[{name:Ze?"value":"placeholder",type:"TEXT",width:kt.w,height:di,sizing:{w:"fill",h:"hug"},text:Je,at:{x:m(Q.left-Fn.left+g(T.paddingLeft)+g(T.borderLeftWidth)),y:m(Q.top-Fn.top+(Q.height-di)/2)}}],G}}let ci=[],li=G.layout?.direction==="VERTICAL",GI=G.layout&&G.layout.direction!=="GRID",rf=!ko,JI=0,XI=(oe,nt,Ze,ut)=>({name:ut?`${oe}-margin-${li?"top":"left"}`:`${oe}-margin`,type:"FRAME",width:li?0:nt,height:li?nt:0,sizing:li?{w:"fill",h:"fixed"}:{w:"fixed",h:"fill"},layout:{direction:li?"VERTICAL":"HORIZONTAL",gap:v(0),padding:[v(0),v(0),v(0),v(0)],align:"MIN",justify:"MIN"},...Ze?{spaceToken:Ze}:{}});for(let oe of we)if(oe.nodeType===Node.ELEMENT_NODE&&Ee.includes(oe)){let nt=oe,Ze=getComputedStyle(nt),ut=Yd(nt);if(!GI||Ze.position==="absolute"){ci.push(ut);continue}let[Je,kt,ui,di]=li?["top","bottom",0,2]:["left","right",3,1],fi=g(Ze.getPropertyValue(`margin-${Je}`)),yn=g(Ze.getPropertyValue(`margin-${kt}`));rf&&li&&(fi=Math.max(0,fi-JI)),fi>0&&(ci.length||!rf)&&ci.push(XI(ut.name,fi,h(nt,"margin",ui,`margin-${Je}`),!0)),ci.push(ut),yn>0&&(oe!==Ee[Ee.length-1]||!rf)&&ci.push(XI(ut.name,yn,h(nt,"margin",di,`margin-${kt}`),!1)),JI=yn}else if(oe.nodeType===Node.TEXT_NODE&&oe.textContent.trim()){let nt=Mn(oe.textContent,T.whiteSpace),Ze=Ee.length===0?"label":"text",ut=document.createRange();ut.selectNodeContents(oe);let Je=new Set(Array.from(ut.getClientRects()).map(nf=>Math.round(nf.top))),kt=Lt(S,T,nt),ui=Je.size>1||!!kt.maxLines,di=ut.getBoundingClientRect(),yn=Ee.length===0&&ui?De(S,T).w:m(di.width),Yy=kt.lineHeight?m(Je.size*kt.lineHeight):m(di.height);ci.push({name:Ze,type:"TEXT",width:yn,height:Yy,sizing:{w:ui?"fill":"hug",h:"hug"},text:kt,at:Xd(di)})}if(zs)for(let oe of ci)!oe.absolute&&oe.sizing.w!=="fixed"&&(oe.sizing={...oe.sizing,w:"fixed"});if(ci.length&&(G.children=ci),rf&&G.layout?.direction==="VERTICAL"&&Ee.length&&Ee.every(oe=>getComputedStyle(oe).display.startsWith("inline"))){let oe=we.flatMap(Ze=>{if(Ze.nodeType===Node.ELEMENT_NODE)return Ee.includes(Ze)?[Ze.getBoundingClientRect()]:[];if(Ze.nodeType!==Node.TEXT_NODE||!Ze.textContent.trim())return[];let ut=document.createRange();return ut.selectNodeContents(Ze),[ut.getBoundingClientRect()]}),nt=oe[0];if(oe.every(Ze=>Ze.top<nt.bottom-.5&&Ze.bottom>nt.top+.5)){let Ze=oe.slice(1).map((Je,kt)=>Je.left-oe[kt].right);G.layout.direction="HORIZONTAL",G.layout.align="CENTER",G.layout.gap=v(Ze.length?m(Math.max(0,Math.min(...Ze))):0);let ut=De(S,T).h;G.sizing.h==="hug"&&ut>Math.max(...oe.map(Je=>Je.height))+.5&&(G.sizing={...G.sizing,h:"fixed"})}}let YI=Ee.filter(oe=>!["absolute","fixed"].includes(getComputedStyle(oe).position)),qM=G.layout?.direction===(li?"VERTICAL":"HORIZONTAL");if(GI&&YI.length&&G.layout&&qM){let oe=li?[3,1]:[0,2];for(let nt of oe){let Ze=["top","right","bottom","left"][nt],ut=Math.min(...YI.map(Je=>g(getComputedStyle(Je).getPropertyValue(`margin-${Ze}`))));ut>0&&(G.layout.padding[nt]=v(m(G.layout.padding[nt].value+ut)))}}return G};return Yd(e)}var sk=new Date("2026-01-01T12:00:00Z"),Qi=t=>t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0;function Dm(t){let e=typeof t=="number"?t:typeof t=="string"&&/^\s*\d+(\.\d+)?\s*(px)?\s*$/.test(t)?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0}function k9(t,e,r,i){let n=Qi(t);if(!n||n.disable===!0)return;let o=Qi(n.options)??Qi(n.viewports),s=f=>{let h=typeof f=="string"?{value:f}:Qi(f);return typeof h?.value=="string"&&o?.[h.value]?{name:h.value,rotated:h.isRotated===!0}:void 0},a=s(e)??s(r),c=a?.name??(typeof n.defaultViewport=="string"?n.defaultViewport:void 0);if(!c)return;let l=Qi(Qi(o?.[c])?.styles),u=Dm(l?.width),d=Dm(l?.height);return!u||!d?void 0:a?.rotated===!0||i===!0||n.defaultOrientation==="landscape"?{w:d,h:u}:{w:u,h:d}}function $z(t,e){let r=Qi(t.parameters?.codesignflo)??{},i={},n=Qi(r.size),o=Dm(n?.width??n?.w),s=Dm(n?.height??n?.h),a=o&&s?{w:o,h:s}:k9(t.parameters?.viewport,t.globals?.viewport,e?.viewport,t.globals?.viewportRotated);if(a&&(i.size=a),r.fullHeight===!0&&(i.fullHeight=!0),typeof r.date=="string"||typeof r.date=="number"){let c=new Date(r.date);if(Number.isNaN(c.getTime()))throw new Error(`parameters.codesignflo.date isn't a date: ${String(r.date)} (e.g. "2026-11-10" or "2026-11-10T09:30:00Z")`);i.date=c}return i}Pr();import{readdirSync as S9,readFileSync as x9}from"node:fs";import{basename as xz,dirname as I9,join as ak}from"node:path";var kz=Wh,Iz=t=>/^(pages|screens)(\/|$)/i.test(t),E9=(t,e)=>Iz(t)||e==="fullscreen";function Sz(t,e,r){let i=e.replace(/^\.\//,""),n=I9(i),o=r??xz(i).replace(/\.stories\.[jt]sx?$/,"");return S9(ak(t,n)).filter(s=>!/\.(stories|test|spec)\.[jt]sx?$/.test(s)&&/\.(tsx?|jsx?|css|scss|less)$/.test(s)).filter(s=>s.toLowerCase().startsWith(o.toLowerCase())||!r&&s.startsWith("index.")).map(s=>ak(n,s)).sort()}async function Ez(t,e,r){let i=JSON.parse(x9(ak(e,"index.json"),"utf8")),n=await t.evaluate(async()=>{let l=await window.__STORYBOOK_PREVIEW__.extract();for(let u of Object.values(l))u.args=Object.fromEntries(Object.entries(u.args).filter(([,d])=>typeof d!="function").map(([d,p])=>[d,p!==null&&typeof p=="object"?"__node__":p]));return JSON.parse(JSON.stringify(l,(u,d)=>u==="component"||u==="render"||u==="decorators"||u==="loaders"?void 0:d))}),o=Object.values(i.entries).filter(c=>c.type==="story"),s=new Map;for(let c of o)s.set(c.title,[...s.get(c.title)??[],c]);let a={generated:"codesignflo sync \u2014 derived from Storybook; do not edit",components:{},screens:{}};for(let[c,l]of[...s].sort(([u],[d])=>u.localeCompare(d))){let u=n[l[0].id];if(!u)continue;let d=kz(c),p=Sz(r,l[0].importPath);if(E9(c,u.parameters?.layout)){Iz(c)||console.error(`${c}: treated as a page (its stories use layout "fullscreen"); title it "Pages/\u2026" to keep it, or drop the layout to make it a component`);for(let k of l){let E=k.id.split("--")[1]??"",O=Sz(r,k.importPath,E.split("-")[0]),X=l.length===1&&d!=="pages";a.screens[X?d:kz(`${c}/${E}`).replace(/\.default$/,"")]={story:k.id,title:c,files:O.length?O:p}}continue}let f=u.argTypes,h=k=>{let E=f[k]?.type?.name;return E==="boolean"?"bool":E==="enum"||(f[k]?.options?.length??0)>0?"enum":E==="other"||l.some(O=>n[O.id]?.args[k]==="__node__")?"slot":null},m=(k,E)=>{let O=f[k]?.table?.defaultValue?.summary?.replace(/^["'`]|["'`]$/g,"");if(O&&O!=="undefined")return O;let X=E?.split("--")[1]?.toLowerCase(),le=(f[k]?.options??[]).map(String);return X&&le.some($e=>$e.toLowerCase()===X)?le.find($e=>$e.toLowerCase()===X):"default"},g=(k,E,O,X)=>O==="slot"?String(k[E]==="__node__"):O==="bool"?String(k[E]===!0):k[E]===void 0||k[E]===""?m(E,X):String(k[E]),v=[...new Set(l.flatMap(k=>[...Object.keys(n[k.id]?.args??{}),...Object.keys(f)]))].sort().filter(k=>{let E=h(k);return E!==null&&new Set(l.map(O=>g(n[O.id]?.args??{},k,E,O.id))).size>1}),b={module:xz(p.find(k=>/\.[jt]sx?$/.test(k))??c).replace(/\.[jt]sx?$/,""),title:c,files:p,stories:{}},x=new Map;for(let k of l){let E=n[k.id]?.args??{},O=Object.fromEntries(v.map($e=>[$e,g(E,$e,h($e),k.id)])),X=JSON.stringify(O),le=x.get(X);if(le){b.examples={...b.examples??{},[k.id]:le};continue}x.set(X,k.id),b.stories[k.id]=v.length?O:{story:k.id.split("--")[1]??"default"}}a.components[d]=b}return a}var z9={".html":"text/html",".js":"text/javascript",".css":"text/css",".json":"application/json",".svg":"image/svg+xml",".woff2":"font/woff2",".woff":"font/woff",".png":"image/png"},Pz=null,Az=()=>Pz,ck={w:1200,h:900},Oz=2e4;async function dk(t,e){if(!Tz(lk(t,"index.json")))throw new Error(`no Storybook build in ${t} (expected index.json)`);let r=A9((o,s)=>{let a=lk(t,decodeURIComponent(new URL(o.url??"/","http://x").pathname));if(!Tz(a)||P9(a).isDirectory())return void s.writeHead(404).end();s.writeHead(200,{"content-type":z9[R9(a)]??"application/octet-stream"}),T9(a).pipe(s)});await new Promise(o=>r.listen(0,"127.0.0.1",()=>o()));let i=`http://127.0.0.1:${r.address().port}`,n=await j9.launch().catch(o=>{throw r.close(),new Error(`could not start Chromium (${o.message.split(`
|
|
246
|
+
`)[0]}). Install it once with: npx playwright install chromium`)});try{Pz={os:`${process.platform}-${process.arch}`,browser:`chromium ${n.version()}`,node:process.versions.node.split(".")[0]};let o=await n.newPage({viewport:{width:ck.w,height:ck.h},deviceScaleFactor:1,reducedMotion:"reduce",locale:"en-US",timezoneId:"UTC"});await o.clock.setFixedTime(sk),await o.addInitScript(()=>{globalThis.__name=u=>u;let l=42;Math.random=()=>(l=l*16807%2147483647,(l-1)/2147483646)});let s=null,a=async l=>{if(!s){o.url().includes("/iframe.html")||(await o.goto(`${i}/iframe.html?id=${l}&viewMode=story`),await o.waitForSelector("#storybook-root > *"));let u=await o.evaluate(async()=>{let d=window.__STORYBOOK_PREVIEW__,p=await d.extract(),f=d.storyStoreValue?.projectAnnotations,h=m=>m===void 0?void 0:JSON.parse(JSON.stringify(m));return{projectGlobals:{viewport:h((f?.initialGlobals??f?.globals)?.viewport)},stories:Object.fromEntries(Object.entries(p).map(([m,g])=>[m,{parameters:{viewport:h(g.parameters?.viewport),codesignflo:h(g.parameters?.codesignflo)},globals:{viewport:h(g.globals?.viewport),viewportRotated:h(g.globals?.viewportRotated)}}]))}});s=new Map(Object.entries(u.stories).map(([d,p])=>{try{return[d,$z(p,u.projectGlobals)]}catch(f){throw new Error(`story ${d}: ${f.message}`)}}))}return s.get(l)??{}};return await e(o,async(l,u={})=>{let d=await a(l),p=u.size??d.size??ck;await o.clock.setFixedTime(d.date??sk),await o.setViewportSize({width:Math.round(p.w),height:Math.round(p.h)}),await o.goto(`${i}/iframe.html?id=${l}&viewMode=story`),await o.waitForSelector("#storybook-root > *"),await o.waitForFunction(()=>{let f=globalThis.__STORYBOOK_PREVIEW__?.currentRender;return!f?.phase||["completed","played","errored","aborted","finished"].includes(f.phase)},void 0,{timeout:2e4}).catch(()=>{}),await uk(o),d.fullHeight&&await C9(o,Math.round(p.w),Math.round(p.h))})}finally{await n.close(),r.close()}}async function uk(t){await t.evaluate(()=>new Promise(e=>{let r=setTimeout(o,250),i=setTimeout(o,4e3),n=new MutationObserver(()=>{clearTimeout(r),r=setTimeout(o,250)});n.observe(document.body,{subtree:!0,childList:!0,attributes:!0,characterData:!0});function o(){n.disconnect(),clearTimeout(r),clearTimeout(i),e()}})),await t.evaluate(()=>document.fonts.ready.then(()=>{})),await t.evaluate(()=>Promise.all(Array.from(document.images).map(e=>e.complete?null:new Promise(r=>{e.addEventListener("load",r),e.addEventListener("error",r)}))))}async function C9(t,e,r){let i=()=>t.evaluate(()=>{let s=0;for(let a of Array.from(document.querySelectorAll("*")))a===document.documentElement||a===document.body||a.scrollHeight<=a.clientHeight+1||/(auto|scroll)/.test(getComputedStyle(a).overflowY)&&(s=Math.max(s,a.scrollHeight-a.clientHeight));return Math.ceil(s)}),n=r,o=await i();for(let s=0;s<5&&o>1&&n<Oz;s++){let a=Math.min(Oz,n+o);await t.setViewportSize({width:e,height:a}),await uk(t);let c=await i();if(c>=o-1){await t.setViewportSize({width:e,height:n}),await uk(t);return}n=a,o=c}}async function Lm(t,e,r={}){return dk(t,async(i,n)=>{let o=JSON.parse(O9(lk(t,"index.json"),"utf8")),s=Object.entries(o.entries).find(([,f])=>f.type==="story")?.[0];if(!s)throw new Error("Storybook has no stories");await n(s);let a=await Ez(i,t,e),c=[...Object.values(a.components).flatMap(f=>[...Object.keys(f.stories),...Object.keys(f.examples??{})]),...Object.values(a.screens).map(f=>f.story)],l=new Map,u=new Map,d=f=>{if(f.image?.png){let h=pi(f.image.png);u.set(h,f.image.png),f.image={ref:h}}for(let h of f.children??[])d(h)},p=new Map(Object.entries(a.screens).flatMap(([f,h])=>r[f]?[[h.story,r[f]]]:[]));for(let f of[...new Set(c)].sort()){await n(f,{size:p.get(f)});let h=await i.evaluate(wz);d(h),l.set(f,{story:f,root:h})}return{registry:a,irs:l,images:u}})}Pr();import{existsSync as mk,mkdirSync as M9,readFileSync as Nz,rmSync as zz,writeFileSync as Cz}from"node:fs";import{homedir as F9}from"node:os";import{join as Mm}from"node:path";sr();Pr();sr();import{mkdirSync as N9,readFileSync as D9,writeFileSync as L9}from"node:fs";import{join as Rz,resolve as U9}from"node:path";async function fk(t){let e=fs();if(!e)return{lines:[],checks:[]};let r=Yt(),i=JSON.parse(D9(U9(r.tokens??"tokens/tokens.json"),"utf8")),n=new Set(Di(i).values()),{data:o,error:s}=await e.client.from("proposals").select("claim_id, component, payload").eq("project_id",e.projectId);if(s)throw new Error(`couldn't read proposals: ${s.message}`);let a=xt(Ct()),c=[],l=[];for(let u of o??[]){let d=a.get(u.component);if(d?.claim?.id!==u.claim_id)continue;if(d.state==="design_new"&&u.payload.spec){let O=Rz(gt(),"proposals",u.component,u.claim_id);N9(O,{recursive:!0}),L9(Rz(O,"spec.json"),Bn(fv(u.payload.spec))),c.push(`${u.component}: new design`);continue}if(d.state!=="ready_for_dev"||!u.payload.copy)continue;let p=u.payload.base??(d.claim.baselineGen?await Tu(u.component,d.claim.baselineGen):null),f=(d.lastGen?await Tu(u.component,d.lastGen):null)??p;if(!p||!f)continue;let h=t?.get(u.component),m=h?iu(f,h):null,g=m?.tree??f,y=Ct().some(O=>O.kind==="resolved"&&O.claim===u.claim_id&&O.take==="design"),{m:v,changes:b,content:x}=nu({base:es(p,g),ours:Ds(es(u.payload.copy,g),n),theirs:g,dtcg:i,...u.payload.scopes?{scopes:u.payload.scopes}:{},designWins:y});Um(u.component,u.claim_id,v,b,x);let k=y?0:v.summary.conflict,E=b.reduce((O,X)=>O+X.items.length,0);l.push({component:u.component,claim:u.claim_id,done:v.summary.convergent,total:v.summary.convergent+E+k,conflicts:k,exact:m?.exact??!0}),c.push(`${u.component}: ${b.length} change(s) to implement`)}return{lines:c,checks:l}}async function pk(){return(await fk()).lines}async function jz(){let t=await pk();return console.log(t.length?t.join(`
|
|
247
|
+
`):"no proposals waiting"),0}async function gk(t){let{data:e}=await t.client.from("projects").select("settings").eq("id",t.projectId).single();return e?.settings?.liveBranch??Nm()??"main"}async function Dz(t){let e=await gk(t),r=Au(),i=Cm();if(r!==e)return{kind:"check",liveBranch:e,branch:r,commit:i,why:`Live follows ${e}`};let n=(In()??{}).liveIgnore??[],o=hz().filter(s=>mz(s,n));return o.length?{kind:"check",liveBranch:e,branch:r,commit:i,why:`uncommitted changes never reach Live: ${o.slice(0,5).join(", ")}${o.length>5?` and ${o.length-5} more`:""}`}:{kind:"live",liveBranch:e,branch:r,commit:i}}async function Lz(t,e){let{data:r}=await t.client.from("live_updates").select("commit").eq("project_id",t.projectId).eq("kind","live").neq("status","failed").filter("payload->only","is",null).order("id",{ascending:!1}).limit(1),i=r?.[0]?.commit;return i?i===e||_z(i)===!1:!1}async function Uz(t,e,r,i,n,o,s,a=!0){let{data:c}=await t.client.from("live_updates").select("payload->setup").eq("project_id",t.projectId).eq("kind","live").neq("status","failed").order("id",{ascending:!1}).limit(1),l=c?.[0]?.setup,u=l&&s&&(l.os!==s.os||l.browser!==s.browser),{data:d,error:p}=await t.client.from("live_updates").insert({project_id:t.projectId,commit:e.commit,branch:e.branch,kind:e.kind,status:e.kind==="live"?"pending":"checked",payload:e.kind==="live"?{...r,pictures:n,registry:o,setup:s}:{keys:r.keys,registry:o,dtcg:r.dtcg,setup:s}}).select("id").single();if(p)throw new Error(`couldn't upload to the service: ${p.message}`);let f=`${e.branch??"detached"} @${e.commit.slice(0,7)}`;console.log(e.kind==="live"?`Live update uploaded (${f}): the CoDesignFlo plugin applies it when the Figma file is open \u2014 now, or the next time someone opens it.`:`Checked ${f} \u2014 not a Live update (${e.why}).`);let h=new Map(i.map(y=>[y.k.replace(/^screen:/,""),y])),{checks:m}=await fk(h),g=new Date().toISOString();for(let y of m){let v=y.done===y.total;await t.client.from("proposals").update({code_check:{done:y.done,total:y.total,conflicts:y.conflicts,exact:y.exact,branch:e.branch,commit:e.commit,at:g}}).eq("project_id",t.projectId).eq("claim_id",y.claim);let b=e.kind==="live"?"it closes when the designer opens Figma (Live confirms it)":e.branch===e.liveBranch?"commit it, and it closes once Live has it":`it closes once this reaches ${e.liveBranch} and Live has it`;console.log(v?y.total===0?`${y.component}: nothing to change in the code (the designer's copy shows no difference); ${b}`:`${y.component}: looks done \u2014 ${y.total}/${y.total} of the designer's changes are in the code; ${b}${y.exact?"":" (layers added or removed: Live confirms the rest)"}`:`${y.component}: ${y.done} of ${y.total} of the designer's changes in the code${y.conflicts?`, ${y.conflicts} clashing`:""} \u2014 the rest: get_proposal ${y.component}`)}u&&console.log(`! rendered on ${s.os}, ${s.browser}; the last Live update was rendered on ${l.os}, ${l.browser} \u2014 small differences in Live can come from that (fonts, anti-aliasing), not the code`),e.kind==="live"&&a&&await Z9(t,d.id);for(let y of await yk(t,e.liveBranch))console.log(y);return 0}async function Z9(t,e){let{data:r}=await t.client.from("plugin_presence").select("seen_at, file_name").eq("project_id",t.projectId).order("seen_at",{ascending:!1}).limit(1),i=r?.[0];if(!i||Date.now()-Date.parse(i.seen_at)>6e4){console.log("Figma isn't open with the plugin: Live is updated when someone opens the file; status then shows how it went.");return}console.log(`Figma is open${i.file_name?` ("${i.file_name}")`:""}: waiting for the plugin to apply the update\u2026`);for(let n=0;n<3e5;n+=3e3){await new Promise(l=>setTimeout(l,3e3));let{data:o}=await t.client.from("live_updates").select("status, log").eq("id",e).single(),s=o;if(!s||s.status==="pending"||s.status==="applying")continue;if(s.status==="superseded")return void console.log("(a newer update replaced this one)");let a=(s.log??"").split(`
|
|
248
|
+
`).filter(l=>/^(closed:|removed:|ready:|! |couldn't)/.test(l)||/ built on the designer's design| of \d+ layers match the app/.test(l));console.log(s.status==="applied"?"Applied in Figma.":"Applying it in Figma failed:");let c=l=>l.includes(": differs from the app \u2014 ")||l.includes(": the app differs from the design \u2014 ");for(let l of a.filter(u=>!c(u)))console.log(` ${l}`);for(let l of Hh(s.log,12))console.log(` ${l}`);return}console.log("Still being applied in Figma (large updates take a while); status shows how it went.")}async function yk(t,e,r=!1){let i=e??await gk(t),n=[],{data:o}=await t.client.from("live_updates").select("commit, status, created_at, log").eq("project_id",t.projectId).eq("kind","live").in("status",["pending","applying","applied"]).order("id",{ascending:!1}).limit(1),s=o?.[0],a=gz(i);if(!s)n.push(`Live: nothing uploaded from ${i} yet \u2014 sync on ${i} (or commit there with the hook on)`);else{let c=a?vz(s.commit,a):null;n.push(`Live: ${i} @${s.commit.slice(0,7)}${s.status==="applied"?"":" (waiting for the Figma file to be opened)"}${c?` \u2014 ${c} commit${c>1?"s":""} behind ${i}: sync on ${i} to update it`:""}`)}if(n.push(...Hh(s?.log,r?Number.POSITIVE_INFINITY:12)),a){let c=new Set([...xt(Ct()).values()].filter(u=>u.state==="ready_for_dev"&&u.claim).map(u=>u.claim.id)),{data:l}=await t.client.from("proposals").select("component, claim_id, code_check").eq("project_id",t.projectId).not("code_check","is",null);for(let u of l??[]){let d=u.code_check;!c.has(u.claim_id)||d.branch===i||d.done!==d.total||!d.total||(yz(a,d.commit)||bz(d.commit,a,q9(u.component)))&&n.push(`${u.component}: done on ${d.branch}, now merged into ${i} \u2014 Live has it after the next sync on ${i}`)}}return n}function q9(t){let e=Mm(gt(),"registry.json");if(!mk(e))return[];let r=JSON.parse(Nz(e,"utf8"));return r.components?.[t]?.files??r.screens?.[t]?.files??[]}var hk=()=>Mm(F9(),".codesignflo","locks");async function Mz(t,e){M9(hk(),{recursive:!0});let r=Mm(hk(),`${t}.lock`),i=Mm(hk(),`${t}.again`);if(mk(r)){let n=Number(Nz(r,"utf8")),o=!1;try{process.kill(n,0),o=!0}catch{}if(o)return Cz(i,"1"),!1}Cz(r,String(process.pid));try{do zz(i,{force:!0}),await e();while(mk(i))}finally{zz(r,{force:!0})}return!0}async function Fz(t,e){if(!e)throw new Error("this app isn't connected to the CoDesignFlo service \u2014 run: codesignflo init --cloud");let r=t.find(i=>!i.startsWith("--"));if(r){let{error:i}=await e.client.rpc("set_live_branch",{p_project:e.projectId,p_branch:r});if(i)throw new Error(i.message)}return console.log(`Live follows ${await gk(e)}${r?"":" (change it: codesignflo live-branch <name>)"}`),0}var H9=()=>Tn(gt(),"state.json"),bk={ledger:()=>Ct(),append:t=>En(t),generation:Tu,saveGeneration:cz,delta:(t,e,r,i,n)=>Zz(process.cwd(),Um(t,e,r,i,n)),newDesign:async(t,e,r,i)=>{let n=Tn(gt(),"proposals",t,e);return B9(n,{recursive:!0}),Ru(Tn(n,"spec.json"),Bn(r)),Ru(Tn(n,"design.png"),Buffer.from(await i(),"base64")),Zz(process.cwd(),n)}};function W9(){let t=[];for(let e of pz(void 0)){let r=Tn(gt(),"proposals",e.component,e.claim),i=Tn(r,`delivered-${e.commit.slice(0,8)}.json`),n=vk(i)?i:Tn(r,"delivered-track.json");if(!vk(n))continue;let{changes:o}=JSON.parse(_k(n,"utf8")),s=vk(Tn(r,"report.json"))?JSON.parse(_k(Tn(r,"report.json"),"utf8")).changes:[],a=Object.fromEntries(s.filter(c=>c.note).map(c=>[c.id,c.note]));t.push({...e,changes:o,why:a})}return t}async function K9(t){let{data:e}=await t.client.from("proposals").select("component, w:payload->spec->width, h:payload->spec->height, updated_at").eq("project_id",t.projectId).like("component","pages.%").order("updated_at",{ascending:!0}),r={};for(let i of e??[])typeof i.w=="number"&&typeof i.h=="number"&&i.w>0&&i.h>0&&(r[i.component]={w:i.w,h:i.h});return r}async function Bz(t=[]){let e=fs();if(t.includes("--from-hook")){if(!e)return 0;let r=0;return await Mz(e.projectId,async()=>{r=await Vz(t,e)}),r}return Vz(t,e)}async function Vz(t,e){let r=Yt(),i=e&&!t.includes("--local")?await Dz(e):null;if(e&&i&&t.includes("--from-hook")){if(i.kind!=="live"||await Lz(e,i.commit))return 0;console.log(`${new Date().toISOString()} hook: updating Live from ${i.liveBranch} @${i.commit.slice(0,7)}`)}let n=JSON.parse(_k(qz(r.tokens??"tokens/tokens.json"),"utf8")),o=r.storybook??{};t.includes("--no-build")||(console.error(`building Storybook (${o.build??"pnpm build-storybook"})\u2026`),V9(o.build??"pnpm build-storybook",{stdio:"ignore",env:{...process.env,STORYBOOK_DISABLE_TELEMETRY:"1"}})),console.error("reading Storybook\u2026");let s=e?await K9(e):{},{registry:a,irs:c,images:l}=await Lm(qz(o.out??"storybook-static"),process.cwd(),s),u=a;Ru(Tn(gt(),"registry.json"),`${JSON.stringify(a,null,2)}
|
|
249
|
+
`),console.error(`${Object.keys(a.components).length} components, ${Object.keys(a.screens).length} screens, ${c.size} stories rendered`);let d=[...c.values()].reduce((O,X)=>{let le=$e=>($e.unnamed?1:0)+($e.children??[]).reduce((q,Re)=>q+le(Re),0);return O+le(X.root)},0);d&&console.error(`${d} element(s) without a semantic name \u2014 run: codesignflo name`);let p=Di(n),f=av(u,c,p),h=cv({...u,screens:u.screens??{}},c,p);if(t.includes("--dry-run")){for(let[O,X]of Object.entries(a.components)){let le=[...new Set(Object.values(X.stories).flatMap($e=>Object.keys($e)))];console.log(`${O.padEnd(18)} ${Object.keys(X.stories).length} variant(s)${le.length&&le[0]!=="story"?` by ${le.join(", ")}`:""}${X.examples?`, ${Object.keys(X.examples).length} example(s)`:""} \u2014 ${X.files.join(", ")}`)}for(let O of h)console.log(`screen ${O.spec.name.padEnd(11)} ${Math.round(100*O.coverage.inInstances/O.coverage.nodes)}% from library; instances ${JSON.stringify(O.coverage.instances)}`);return 0}let m=Cm(),g=[...Object.keys(u.components),...Object.keys(u.screens??{})],y=t.find(O=>O.startsWith("--only")),v=y?(y.includes("=")?y.split("=")[1]:t[t.indexOf(y)+1]??"").split(",").map(O=>O.trim()).filter(Boolean):void 0;if(v){let O=v.filter(X=>!g.includes(X));if(O.length)return console.error(`not in this app's Storybook: ${O.join(", ")} \u2014 known: ${g.join(", ")}`),1}let b={sets:f,screens:h.map(O=>({spec:O.spec,coverage:O.coverage})),dtcg:n,commit:m,keys:g,deliveries:W9(),...v?{only:v}:{}};if(e&&i)return Uz(e,i,b,[...f,...h.map(O=>O.spec)],l.size,a,Az(),!t.includes("--from-hook"));let x=r.trackedBranch,k=Au();if(x&&k&&k!==x&&!t.includes("--allow-branch"))return console.error(`Live mirrors "${x}", and you are on "${k}". Deliver works on any branch; run sync on ${x} after merging (it verifies delivered changes there). To update Live from this branch anyway: codesignflo sync --allow-branch`),1;let E;return await Yn({projectId:r.projectId},async O=>{let X=await $w(O,bk,{...b,images:Object.fromEntries(l)},le=>console.log(le));E=X.states;for(let le of X.notes)console.log(`! ${le}`)}),E&&Ru(Tn(gt(),"STATUS.md"),G9(E,u)),Ru(H9(),`${JSON.stringify({lastSyncCommit:m},null,2)}
|
|
250
|
+
`),0}function G9(t,e){let r={in_sync:"In sync",in_design:"In design",ready_for_dev:"Ready for dev",design_new:"New design",code_new:"New in code",ignored:"Ignored"};return`# CoDesignFlo status
|
|
251
|
+
|
|
252
|
+
Generated by \`codesignflo sync\`. Do not edit.
|
|
253
|
+
|
|
254
|
+
| Component | State | Claimed by | Designer's note |
|
|
255
|
+
|---|---|---|---|
|
|
256
|
+
${[...t.values()].filter(n=>e.components[n.component]||e.screens?.[n.component]||n.state==="design_new").map(n=>`| ${n.component} | ${n.conflict?"Needs a look":n.unseen?"Changed in code":r[n.state]} | ${n.claim?n.claim.by:""} | ${(n.claim?.note??"").replace(/\|/g,"\\|")} |`).join(`
|
|
257
|
+
`)}
|
|
258
|
+
`}function Um(t,e,r,i,n){let o=wk(gt(),"proposals",t,e);return J9(o,{recursive:!0}),Hz(wk(o,"delta.json"),`${JSON.stringify(r,null,2)}
|
|
259
|
+
`),Hz(wk(o,"changes.json"),`${JSON.stringify({changes:i,content:n},null,2)}
|
|
260
|
+
`),o}async function Wz(){let t=Yt(),e=await Yn({projectId:t.projectId},r=>Bh(r,bk,JSON.parse(X9(Y9(t.tokens??"tokens/tokens.json"),"utf8"))));e.length||console.log("no proposals are ready for dev");for(let r of e){console.log(`
|
|
261
|
+
${r.component} \u2014 proposal ${r.claim} by ${r.by}${r.note?`: "${r.note}"`:""}`),console.log(`${r.changes.length} code change${r.changes.length===1?"":"s"}${r.conflicts?`, ${r.conflicts} conflicting with code`:""}:`);for(let i of r.changes)console.log(` ${i.id} [${i.kind}] ${i.layer} ${i.prop}: ${i.from} \u2192 ${i.to}${i.variants==="all"?" (all variants)":i.scope==="variants"?` (only: ${i.variants.join("; ")})`:` (made in ${i.variants.join("; ")} \u2014 apply to all)`}`);if(r.content.length){console.log("content changes (example data, no code impact):");for(let i of r.content)console.log(` ${i.layer}: ${i.from} \u2192 ${i.to}`)}console.log(`written: ${r.folder}`)}return 0}sr();import{readFileSync as Kz}from"node:fs";async function Gz(){let t=Yt(),e=new URL("../../../plugin/dist/",import.meta.url),r=Kz(new URL("code.js",e),"utf8"),i=Kz(new URL("ui.html",e),"utf8");return await Yn({projectId:t.projectId},async n=>{await n.call("dev.reload",{code:r,html:i})}),console.log(`plugin reloaded (${Math.round(r.length/1024)} kB code, ${Math.round(i.length/1024)} kB panel)`),0}import{execFileSync as tW}from"node:child_process";import{chmodSync as rW,existsSync as eC,mkdirSync as Yz,readFileSync as tC,rmSync as nW,writeFileSync as rC}from"node:fs";import{homedir as nC}from"node:os";import{dirname as iW,join as ju,resolve as oW}from"node:path";import{fileURLToPath as sW}from"node:url";sr();La();La();import{spawn as Q9}from"node:child_process";var eW=t=>new Promise(e=>setTimeout(e,t));async function Fm(t){let e=Da(),r=Q$(e),{data:i,error:n}=await r.rpc("start_login",{p_client:"cli"});if(n)throw new Error(`couldn't start sign-in: ${n.message}`);let{device_code:o,user_code:s}=i[0],a=`${s.slice(0,4)}-${s.slice(4)}`,c=`${e.web}/?code=${s}`;console.log(`Sign in at ${c}
|
|
262
|
+
and check that the page shows the code ${a}`),t.includes("--no-browser")||Q9(process.platform==="darwin"?"open":"xdg-open",[c],{stdio:"ignore",detached:!0}).unref();for(let l=0;l<6e5;l+=2e3){await eW(2e3);let u=await r.rpc("poll_login",{p_device_code:o});if(u.error)throw new Error(u.error.message);if(u.data){let d=await r.auth.refreshSession({refresh_token:u.data});if(d.error||!d.data.session||!d.data.user)throw new Error("sign-in failed \u2014 try again");return Eu(d.data.session.refresh_token,{id:d.data.user.id,email:d.data.user.email??null}),console.log(`signed in as ${d.data.user.email??d.data.user.id}`),0}}throw new Error("sign-in timed out \u2014 run codesignflo login again")}async function Jz(){let{user:t}=await an();return console.log(t.email??t.id),0}async function Xz(t){if(!Am())return console.log("not signed in on this machine"),0;let e=t.includes("--everywhere");try{let{client:r}=await an(),{error:i}=await r.auth.signOut({scope:e?"global":"local"});if(i)throw i}catch(r){if(!/expired/.test(r.message))throw r}return Xj(),console.log(e?"signed out everywhere: every session of this account is revoked":"signed out on this machine (its sign-in is revoked)"),0}var iC="# >>> codesignflo: update Live on commits to the Live branch",oC="# <<< codesignflo",sC=["post-commit","post-merge"],Qz=t=>tW("git",t,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim(),Fa=t=>`'${t.replace(/'/g,"'\\''")}'`;function aC(){let t=sW(new URL("../main.js",import.meta.url));return t.includes("/_npx/")||t.includes("/node_modules/@orkestralai/")?`${Fa(ju(iW(process.execPath),"npx"))} -y @orkestralai/codesignflo@${Nc}`:`${Fa(process.execPath)} ${Fa(t)}`}function aW(t,e){let r=ju(nC(),".codesignflo","logs",`${e}.log`);return`${iC} (remove: codesignflo hook remove)
|
|
263
|
+
( cd ${Fa(t)} && nohup ${aC()} sync --from-hook >> ${Fa(r)} 2>&1 & ) >/dev/null 2>&1
|
|
264
|
+
${oC}
|
|
265
|
+
`}function cC(){let t="";try{t=Qz(["config","--get","core.hooksPath"])}catch{}return t?{dir:null,managedBy:t}:{dir:oW(Qz(["rev-parse","--git-path","hooks"]))}}var lC=t=>t.replace(new RegExp(`${iC}[\\s\\S]*?${oC}\\n?`,"g"),"");function $k(){let t=In();if(!t?.cloud)return{ok:!1,message:"the hook is for projects connected to the service (init --cloud)"};let{dir:e,managedBy:r}=cC(),i=`${aC()} sync --from-hook`;if(!e)return{ok:!1,message:`this repo's hooks are managed in ${r} (husky, lefthook\u2026), which is part of the repo. To keep Live updated on commits, add this to its post-commit and post-merge hooks \u2014 or skip it: the agent syncs after its own commits.
|
|
266
|
+
(cd ${Fa(process.cwd())} && nohup ${i} >/dev/null 2>&1 &)`};Yz(e,{recursive:!0}),Yz(ju(nC(),".codesignflo","logs"),{recursive:!0});for(let n of sC){let o=ju(e,n),s=eC(o)?lC(tC(o,"utf8")):`#!/bin/sh
|
|
267
|
+
`;rC(o,`${s.endsWith(`
|
|
268
|
+
`)?s:`${s}
|
|
269
|
+
`}${aW(process.cwd(),t.projectId)}`),rW(o,493)}return{ok:!0,message:`Live updates on every commit to the Live branch on this machine (git hooks post-commit and post-merge in ${e}; not part of the repo). Log: ~/.codesignflo/logs/${t.projectId}.log`}}function cW(){let{dir:t}=cC();if(!t)return"nothing to remove (hooks are managed by the repo's hook tool)";let e=0;for(let r of sC){let i=ju(t,r);if(!eC(i))continue;let n=tC(i,"utf8"),o=lC(n);o!==n&&(o.trim()==="#!/bin/sh"?nW(i):rC(i,o),e++)}return e?"removed: commits no longer update Live by themselves (to also revoke this machine's sign-in: codesignflo logout)":"no CoDesignFlo hook here"}async function uC(t){if(t[0]==="remove")return console.log(cW()),0;if(t[0]!=="install")throw new Error("usage: codesignflo hook install [--code <one-time code> --from <MCP address>] | remove");let e=t.includes("--code")?t[t.indexOf("--code")+1]:void 0,r=t.includes("--from")?t[t.indexOf("--from")+1]:void 0;if(e&&r){let n=await fetch(`${r.replace(/\/$/,"")}/install-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:e})}),o=await n.json();if(!n.ok||!o.refresh_token||!o.service)throw new Error(o.error??"couldn't use the code \u2014 ask the agent for auto_update again");Y$(o.service),Eu(o.refresh_token,{id:"",email:null}),delete process.env.CODESIGNFLO_TOKEN,delete process.env.CODESIGNFLO_TICKET;let{user:s}=await an();console.log(`this machine is signed in as ${s.email??s.id} (codesignflo logout to undo)`)}else Am()||(console.log("The hook runs by itself after commits, so this machine needs its own sign-in (once):"),delete process.env.CODESIGNFLO_TOKEN,delete process.env.CODESIGNFLO_TICKET,await Fm([]));process.env.CODESIGNFLO_SERVICE_URL&&process.env.CODESIGNFLO_SERVICE_ANON&&Y$(Da());let i=$k();return console.log(i.message),i.ok?0:2}Pr();import{execFileSync as fC}from"node:child_process";import{randomBytes as gW}from"node:crypto";import{existsSync as zu,readdirSync as yW,readFileSync as Sk}from"node:fs";import{createRequire as vW}from"node:module";import{dirname as _W,join as pC}from"node:path";import{chromium as bW}from"playwright";sr();La();import{execFileSync as lW}from"node:child_process";import{cpSync as uW,existsSync as dW,mkdirSync as fW,readdirSync as pW}from"node:fs";import{join as Zm,relative as hW}from"node:path";import{fileURLToPath as mW}from"node:url";var kk=mW(new URL("../skills",import.meta.url));function dC(t=process.cwd()){let e=t;try{e=lW("git",["rev-parse","--show-toplevel"],{cwd:t,encoding:"utf8"}).trim()}catch{}let r=Zm(e,".claude","skills");fW(r,{recursive:!0});let i=pW(kk).filter(n=>dW(Zm(kk,n,"SKILL.md")));for(let n of i)uW(Zm(kk,n),Zm(r,n),{recursive:!0});return{folder:hW(t,r)||".",skills:i}}async function hC(t=[]){if(t.includes("--skills")){let n=dC();return console.log(`Claude Code skills installed in ${n.folder}: ${n.skills.join(", ")}`),0}if(t.includes("--cloud")){let n=o=>t.includes(o)?t[t.indexOf(o)+1]:void 0;return SW({project:n("--project"),fresh:t.includes("--new"),liveBranch:n("--live-branch"),hook:t.includes("--hook")?!0:t.includes("--no-hook")?!1:void 0})}let e=In(),r=e?.projectId??`p_${gW(6).toString("hex")}`,i=await Yn(e?{projectId:r}:"unset",n=>n.call("init",{projectId:r,minPlugin:uf}));return e||nk({projectId:r,tokens:"tokens/tokens.json"}),$W(),console.log(`project ${r} \u2014 Figma file set up: ${i.pages.join(", ")}`),console.log("config: .codesignflo/config.json (commit it)"),console.log("connect your coding agent (once per machine):"),console.log(" claude mcp add --scope user codesignflo -- npx -y @orkestralai/codesignflo mcp"),console.log(" (other MCP agents: command `npx -y @orkestralai/codesignflo mcp`; legacy Claude Code skills: codesignflo init --skills)"),0}async function wW(t){let{data:e,error:r}=await t.rpc("projects_without_code");if(r)throw new Error(r.message);return e}function $W(){if(zu(bW.executablePath()))return;console.log("installing Chromium for rendering Storybook (once per machine)\u2026");let t=pC(_W(vW(import.meta.url).resolve("playwright/package.json")),"cli.js");fC(process.execPath,[t,"install","chromium"],{stdio:"inherit"})}function kW(){let t=n=>fC("git",n,{encoding:"utf8"}).trim(),e=t(["rev-list","--max-parents=0","HEAD"]).split(`
|
|
270
|
+
`).sort()[0],r=t(["rev-parse","--show-prefix"]).replace(/\/$/,"")||".",i=r==="."?t(["rev-parse","--show-toplevel"]).split("/").pop():r.split("/").pop();try{i=JSON.parse(Sk("package.json","utf8")).name??i}catch{}return{rootCommit:e,folder:r,name:i}}async function SW(t={}){let{client:e,user:r}=await an(),{rootCommit:i,folder:n,name:o}=kW(),s=In(),{data:a,error:c}=await e.rpc("find_project",{p_root_commit:i,p_folder:n});if(c)throw new Error(c.message);let l=a[0],u;if(l&&!l.access)throw new Error("this app already has a CoDesignFlo project \u2014 ask its owner to invite you");let d=l||t.fresh||t.project?[]:await wW(e);if(l)u=l.project_id,console.log(`found the project "${l.name}" (${u})`);else if(t.project||d.length){if(!t.project){console.log("Projects waiting for their code (a designer started them and invited you):");for(let E of d)console.log(` ${E.project_id} ${E.name}`);return console.log("Link this app to one: codesignflo init --cloud --project <id> (or start a new project: --new)"),2}let x=t.project,{error:k}=await e.rpc("link_codebase",{p_project:x,p_root_commit:i,p_folder:n});if(k)throw new Error(k.message);u=x,console.log(`linked this app to the project ${u}; its Figma file is already set up by the designer`),s&&!s.cloud&&Ct().length&&console.log("note: the local history (.codesignflo/events.jsonl) belongs to the old local project and was not moved")}else{let{data:x,error:k}=await e.rpc("create_project",{p_name:o,p_root_commit:i,p_folder:n,p_settings:s?{tokens:s.tokens,trackedBranch:s.trackedBranch}:{},...s&&!s.cloud?{p_id:s.projectId}:{}});if(k)throw new Error(k.message);if(u=x,console.log(`created the project "${o}" (${u}) for ${r.email??r.id}`),s&&!s.cloud){let E=Ct();await oz(e,u,E),console.log(`moved the local project to the cloud: ${E.length} history entries uploaded`)}}if(s&&!s.cloud&&s.projectId===u){let x=await lz(e,u);x&&console.log(`uploaded ${x} stored versions of Live (snapshots/; the folder can be deleted after this)`)}nk({...s??{tokens:"tokens/tokens.json"},projectId:u,cloud:!0}),console.log("this app now uses the CoDesignFlo service");let{data:p}=await e.from("projects").select("settings").eq("id",u).single(),f=p?.settings?.liveBranch,h=t.liveBranch??f??Nm()??"main";if(h!==f){let{error:x}=await e.rpc("set_live_branch",{p_project:u,p_branch:h});if(x)throw new Error(x.message)}console.log(`Live follows ${h} (change it: codesignflo live-branch <name>)`),t.hook===!0?console.log($k().message):t.hook===void 0&&console.log(`to update Live on every commit to ${h} from this machine: codesignflo hook install (a git hook; nothing goes into the repo)`);let m=Ow(xW(s?.tokens??"tokens/tokens.json"));m.length&&console.log(`
|
|
271
|
+
Missing in this app:
|
|
272
|
+
${m.map(x=>`- ${x}`).join(`
|
|
273
|
+
`)}`);let{data:g}=await e.from("projects").select("settings").eq("id",u).single(),{data:y}=await e.from("events").select("component, kind").eq("project_id",u).in("kind",["designed_new","closed","unclaimed"]),v=new Map;for(let x of y??[])v.set(x.component,(v.get(x.component)??0)+(x.kind==="designed_new"?1:-1));let b=Pw({hasFile:!!g?.settings?.file,newDesigns:[...v].filter(([,x])=>x>0).map(([x])=>x),liveBranch:h});return console.log(`
|
|
274
|
+
Next:
|
|
275
|
+
${b.map(x=>`- ${x}`).join(`
|
|
276
|
+
`)}`),0}function xW(t){let e=zu("package.json")?JSON.parse(Sk("package.json","utf8")):{},r=zu(".storybook")||Object.values(e.scripts??{}).some(o=>o.includes("storybook")),i=!1,n=(o,s)=>{if(!(i||s<0||!zu(o)))for(let a of yW(o,{withFileTypes:!0})){if(a.name==="node_modules"||a.name.startsWith("."))continue;let c=pC(o,a.name);if(a.isDirectory())n(c,s-1);else if(/\.stories\.(t|j)sx?$/.test(a.name)){let l=Sk(c,"utf8");(/title:\s*["'`](pages|screens)(\/|["'`])/i.test(l)||/layout:\s*["'`]fullscreen/.test(l))&&(i=!0)}}};return n("src",6),{storybook:r,tokens:zu(t)?t:null,pageStories:i}}sr();import{execSync as IW,spawnSync as EW}from"node:child_process";import{resolve as TW}from"node:path";var OW=["header","body","footer","title","subtitle","label","description","price","total","summary","row","list","item","image","media","icon","logo","nav","link","actions","badge","divider","value","step","content","meta"];function mC(t,e,r){let i=[],n=(o,s,a)=>{if(!(!a&&o.component)){o.unnamed&&i.push({owner:e,files:r,path:s,tag:o.name,...o.text?{text:o.text.characters.slice(0,40)}:{}});for(let c of o.children??[])n(c,`${s} \u203A ${c.name}`,!1)}};return n(t,t.name,!0),i}async function gC(t){let{registry:e,irs:r}=await Lm(t,process.cwd()),i=[];for(let[o,s]of Object.entries(e.components))for(let a of Object.keys(s.stories)){let c=r.get(a);c&&i.push(...mC(c.root,o,s.files))}for(let[o,s]of Object.entries(e.screens)){let a=r.get(s.story);a&&i.push(...mC(a.root,o,s.files))}let n=new Set;return i.filter(o=>{let s=`${o.owner}|${o.path}|${o.text??""}`;return n.has(s)?!1:(n.add(s),!0)})}async function yC(t){let e=Yt(),r=e.storybook??{},i=()=>IW(r.build??"pnpm build-storybook",{stdio:"ignore",env:{...process.env,STORYBOOK_DISABLE_TELEMETRY:"1"}});t.includes("--no-build")||i();let n=TW(r.out??"storybook-static"),o=await gC(n);if(!o.length)return console.log("every element of every registered component and page has a name"),0;console.log(`${o.length} unnamed element(s):`);for(let d of o)console.log(` ${d.owner}: ${d.path}${d.text?` ("${d.text}")`:""}`);if(t.includes("--check"))return 1;let s=[...new Set(o.flatMap(d=>d.files))],a=[...OW,...e.vocabulary??[]],c=`Give these unnamed elements a semantic layer name by adding a data-cdf attribute to the JSX element.
|
|
277
|
+
|
|
278
|
+
Elements (owner component or page \u203A layer path; the last segment is the element's HTML tag; quoted text is its content):
|
|
279
|
+
${o.map(d=>`- ${d.owner} (${d.files.filter(p=>/\.[jt]sx?$/.test(p)).join(", ")}): ${d.path}${d.text?` \u2014 text "${d.text}"`:""}`).join(`
|
|
280
|
+
`)}
|
|
281
|
+
|
|
282
|
+
Rules:
|
|
283
|
+
- Add exactly one attribute per element: data-cdf="<name>". Names are lowercase kebab-case, short, describe the element's role, and are unique among its siblings.
|
|
284
|
+
- Prefer these words when they fit: ${a.join(", ")}. Siblings of the same kind get distinct names (e.g. "subtotal-row", "shipping-row", "total-row").
|
|
285
|
+
- Change nothing else: no refactors, no formatting changes, no new classes, no logic changes.
|
|
286
|
+
- If an element is produced by another component (not written as JSX in these files), skip it.
|
|
287
|
+
- Edit only: ${s.join(", ")}. Do not run git.
|
|
288
|
+
|
|
289
|
+
When done, reply with ONLY: {"named": <number of attributes added>}
|
|
290
|
+
`;console.error("asking Claude Code to name them\u2026");let l=EW("claude",["-p",c,"--permission-mode","acceptEdits","--allowedTools","Read","Glob","Grep",...s.map(d=>`Edit(${d})`),"--output-format","json"],{encoding:"utf8",timeout:9e5});if(l.error)throw new Error(`could not run Claude Code: ${l.error.message}`);i();let u=await gC(n);console.log(`named ${o.length-u.length} of ${o.length}; review the data-cdf attributes in your diff and commit them`);for(let d of u)console.log(` still unnamed: ${d.owner}: ${d.path}`);return u.length?1:0}sr();La();function xk(){let t=In();if(!t?.cloud)throw new Error("this app isn't connected to the CoDesignFlo service \u2014 run: codesignflo init --cloud");return t.projectId}var PW=t=>t.pending?t.email_status==="sent"?" \u2014 invitation email sent":t.email_status==="failed"?` \u2014 invitation email not sent: ${t.email_error??"unknown error"}`:t.email_status==="queued"?" \u2014 invitation email on its way":" \u2014 no invitation email sent":"";async function vC(t){let e=t.find(s=>!s.startsWith("--"));if(!e||!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(e))throw new Error("usage: codesignflo invite <email> [--designer | --developer | --admin] | invite <email> --resend");let{client:r}=await an();if(t.includes("--resend")){let{error:s}=await r.rpc("resend_invitation",{p_project:xk(),p_email:e});if(s)throw new Error(s.message);return console.log(`invitation email sent again to ${e}`),0}let i=t.includes("--admin")?"admin":t.includes("--developer")?"developer":"designer",{data:n,error:o}=await r.rpc("invite",{p_project:xk(),p_email:e,p_role:i});if(o)throw new Error(o.message);return console.log(n==="added"?`${e} is now in the project (${i}) \u2014 they got an email about it`:`invited ${e} as ${i} \u2014 an email tells them how to join (they join when they sign in with that email)`),0}async function _C(){let{client:t}=await an(),{data:e,error:r}=await t.rpc("project_people",{p_project:xk()});if(r)throw new Error(r.message);for(let i of e)console.log(`${(i.email??"(no email)").padEnd(32)} ${i.role}${i.pending?" (invited)":""}${PW(i)}`);return 0}Pr();sr();async function bC(t){let e=t.find(o=>!o.startsWith("--")),r=t.includes("--design")?"design":t.includes("--code")?"code":null,i=r==="code"?t[t.indexOf("--code")+1]:void 0;if(!e||!r||r==="code"&&(!i||i.startsWith("--")))throw new Error('usage: codesignflo resolve <component> --design | --code "<why the code version stays>"');let n=xt(Ct()).get(e);if(!n)throw new Error(`${e} has no proposal ready for dev`);return En(Tw(n,r,i)),console.log(r==="design"?`${e}: the designer's version wins \u2014 run codesignflo sync, then deliver it (the clashing changes are included)`:`${e}: kept the code's version; sent back to the designer with your reason (they see it at the next sync)`),0}Pr();sr();import{execSync as AW}from"node:child_process";import{mkdirSync as wC,readFileSync as RW,rmSync as jW,writeFileSync as $C}from"node:fs";import{join as Cu,relative as kC,resolve as zW}from"node:path";import CW from"pixelmatch";import{PNG as Ei}from"pngjs";var qm=2,Ik=.03;function NW(t,e,r=[]){let i=Math.max(t.width,e.width),n=Math.max(t.height,e.height),o=h=>{let m=new Ei({width:i,height:n});m.data.fill(255);for(let g=0;g<h.height;g++)for(let y=0;y<h.width;y++){let v=(g*h.width+y)*4,b=(g*i+y)*4,x=h.data[v+3]/255;for(let k=0;k<3;k++)m.data[b+k]=Math.round(h.data[v+k]*x+255*(1-x))}return m},s=o(t),a=o(e),c=new Ei({width:i,height:n});CW(s.data,a.data,c.data,i,n,{threshold:.2});let l=new Uint8Array(i*n);for(let h of r)for(let m=Math.max(0,Math.floor(h.y-3));m<Math.min(n,Math.ceil(h.y+h.height+3));m++)for(let g=Math.max(0,Math.floor(h.x-3));g<Math.min(i,Math.ceil(h.x+h.width+3));g++)l[m*i+g]=1;let u=0,d=0,p=0;for(let h=0;h<i*n;h++){let m=c.data[h*4]===255&&c.data[h*4+1]===0&&c.data[h*4+2]===0;l[h]?(p++,m&&d++):m&&u++}let f=new Ei({width:i*3+32,height:n});return f.data.fill(255),Ei.bitblt(s,f,0,0,i,n,0,0),Ei.bitblt(a,f,0,0,i,n,i+16,0),Ei.bitblt(c,f,0,0,i,n,2*i+32,0),{mismatch:u/(i*n),textMismatch:p?d/p:null,image:f}}async function SC(t){let r=Yt().storybook??{};t.includes("--no-build")||AW(r.build??"pnpm build-storybook",{stdio:"ignore",env:{...process.env,STORYBOOK_DISABLE_TELEMETRY:"1"}});let i=JSON.parse(RW(Cu(gt(),"registry.json"),"utf8")),n=t.filter(d=>!d.startsWith("--")),o=Object.keys(i.components).filter(d=>!n.length||n.includes(d));if(n.length&&!o.length)throw new Error(`not registered: ${n.join(", ")} \u2014 run codesignflo sync first`);let s=t.includes("--screens")?Object.entries(i.screens):[],a=await Yn({projectId:Yt().projectId},async d=>{let p=await d.call("exportVariants",{setKeys:o},{timeoutMs:18e4});for(let[f]of s)try{p[`screen:${f}`]=await d.call("exportNode",{k:`screen:${f}`})}catch{}return p}),c=Cu(gt(),"verify");jW(c,{recursive:!0,force:!0});let l=[];await dk(zW(r.out??"storybook-static"),async(d,p)=>{let f=async(m,g)=>{await p(m),g&&await d.evaluate(x=>{let k=document.querySelector("[data-cdf-container]")??document.querySelector("#storybook-root");k.style.boxSizing="content-box",k.style.width=`${x}px`},g);let y=await d.$("[data-cdf-container] > *")??await d.$("#storybook-root > *");if(!y)throw new Error(`story ${m} rendered nothing`);let v=await y.evaluate(x=>{let k=x.getBoundingClientRect();x.style.translate=`${-(k.x%1)}px ${-(k.y%1)}px`;let E=x.getBoundingClientRect(),O=[],X=document.createTreeWalker(x,NodeFilter.SHOW_TEXT);for(let le=X.nextNode();le;le=X.nextNode()){if(!le.textContent?.trim())continue;let $e=document.createRange();$e.selectNodeContents(le);for(let q of Array.from($e.getClientRects()))O.push({x:q.x-E.x,y:q.y-E.y,width:q.width,height:q.height})}return{width:k.width,height:k.height,text:O}});return{shot:Ei.sync.read(await y.screenshot()),width:Math.round(v.width),height:Math.round(v.height),text:v.text}},h=async(m,g,y,v)=>{let b=a[v]?Ei.sync.read(Buffer.from(a[v],"base64")):null,{shot:x,width:k,height:E,text:O}=await f(y,b?.width),X={component:m,variant:g,story:y,browser:{width:k,height:E},figma:b?{width:b.width,height:b.height}:null,mismatch:null,flagged:!0};if(b){let{mismatch:le,textMismatch:$e,image:q}=NW(x,b,O),Re=Cu(c,m,`${g.replace(/[^\w=.-]+/g,"_")}.png`);wC(Cu(c,m),{recursive:!0}),$C(Re,Ei.sync.write(q)),X.mismatch=le,X.textMismatch=$e,X.image=kC(process.cwd(),Re),X.flagged=Math.abs(k-b.width)>qm||Math.abs(E-b.height)>qm||le>Ik}l.push(X)};for(let m of o)for(let[g,y]of Object.entries(i.components[m].stories)){let v=Io(y);await h(m,v,g,`${m}/${v}`)}for(let[m,g]of s)await h(m,"screen",g.story,`screen:${m}`)}),wC(c,{recursive:!0}),$C(Cu(c,"report.json"),`${JSON.stringify({at:new Date().toISOString(),thresholds:{sizePx:qm,mismatch:Ik},rows:l},null,2)}
|
|
291
|
+
`);for(let d of l){let p=d.figma?`${d.browser.width}\xD7${d.browser.height} vs ${d.figma.width}\xD7${d.figma.height}`:"not in Live",f=d.mismatch===null?"":` ${(100*d.mismatch).toFixed(1)}% pixels differ${d.textMismatch?` (text ${(100*d.textMismatch).toFixed(0)}%)`:""}`;console.log(`${d.flagged?"!":"\u2713"} ${`${d.component} ${d.variant}`.padEnd(40)} ${p}${f}`)}let u=l.filter(d=>d.flagged).length;return console.log(`${l.length-u}/${l.length} match (sizes within ${qm} px, under ${Ik*100}% pixels outside text). Images: ${kC(process.cwd(),c)}/`),u&&t.includes("--strict")?1:0}sr();var FM={init:{summary:"set up the open Figma file for this project (run in your app's folder) [--cloud: connect to the service; --project <id> | --new] [--skills]",run:t=>hC(t)},sync:{summary:"render Storybook, update Live, record the designer's work, verify delivered changes (--only a,b: update just these in Live)",run:t=>Bz(t)},deliver:{summary:"apply a ready proposal to the code with Claude Code and commit it: deliver <component> (--track: hand-off only, you implement and commit)",run:t=>dz(t)},status:{summary:"what is waiting on the developer, and each component's state (no Figma needed) [--all: every place Live differs from the app]",run:async t=>{console.log((await Promise.resolve().then(()=>(Xy(),Jy))).statusText(process.cwd()));let e=fs();if(e)for(let r of await yk(e,void 0,t.includes("--all")))console.log(r);return 0}},proposal:{summary:"the designer's proposal for a component as implementation instructions: proposal <component> [--json]",run:async t=>{let e=t.find(i=>!i.startsWith("--"));if(!e)throw new Error("usage: codesignflo proposal <component> [--json]");let r=(await Promise.resolve().then(()=>(Xy(),Jy))).proposalText(process.cwd(),e);return console.log(t.includes("--json")?JSON.stringify(r):r.text),0}},pull:{summary:"cloud projects: fetch the designer's proposals and compute their changes (no Figma needed)",run:()=>jz()},login:{summary:"sign in to the CoDesignFlo service (opens the browser; nothing typed here) [--no-browser]",run:t=>Fm(t)},whoami:{summary:"who you are signed in as",run:()=>Jz()},logout:{summary:"revoke this machine's sign-in [--everywhere: every session of the account]",run:t=>Xz(t)},invite:{summary:"cloud projects: invite someone by email: invite <email> [--designer (default) | --developer | --admin] (emails them how to join; --resend: send it again)",run:t=>vC(t)},people:{summary:"cloud projects: who is in this app's project",run:()=>_C()},"live-branch":{summary:"cloud projects: which branch updates Live: live-branch [<name>] (developers and admins)",run:t=>Fz(t,fs())},hook:{summary:"cloud projects: update Live on every commit to the Live branch (git hook on this machine): hook install | remove",run:t=>uC(t)},ask:{summary:'send a ready proposal back to the designer with a question: ask <component> "<question>"',run:t=>uz(t)},mcp:{summary:"run the MCP server for coding agents (stdio): claude mcp add --scope user codesignflo -- npx -y @orkestralai/codesignflo mcp",run:async()=>(await Promise.resolve().then(()=>(Xy(),Jy))).mcp()},resolve:{summary:`settle a clash between the designer's copy and code changed meanwhile: resolve <component> --design | --code "<why>"`,run:t=>bC(t)},delta:{summary:"show what the designer changed in proposals marked ready for dev (writes .codesignflo/proposals/\u2026)",run:()=>Wz()},verify:{summary:"compare Live with the code, variant by variant (browser vs Figma images) [component\u2026] [--screens] [--strict]",run:t=>SC(t)},name:{summary:"give unnamed elements semantic layer names in code (data-cdf) with Claude Code [--check]",run:t=>yC(t)},"dev:reload":{summary:"(development) hot-swap the running plugin with the current build",run:()=>Gz()},version:{summary:"print the version",run:()=>(console.log(Nc),0)}},[Cc="help",...HY]=process.argv.slice(2),ZM=FM[Cc];if(!ZM){console.log(`usage: codesignflo <command>
|
|
292
|
+
`);for(let[t,e]of Object.entries(FM))console.log(` ${t.padEnd(10)} ${e.summary}`);process.exit(Cc==="help"?0:1)}var WY=["login","logout","whoami","invite","people","hook","mcp","version","help","init","dev:reload"].includes(Cc),HI=1;try{WY||await nz(),["deliver","ask","resolve","verify","status","proposal"].includes(Cc)&&await pk(),HI=await ZM.run(HY)}catch(t){console.error(`codesignflo ${Cc}: ${t.message}`)}finally{try{await iz()}catch(t){console.error(`codesignflo ${Cc}: ${t.message}`),HI=1}}process.exit(HI);
|