@orkestralai/codesignflo 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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 UM=Object.create;var sf=Object.defineProperty;var MM=Object.getOwnPropertyDescriptor;var FM=Object.getOwnPropertyNames;var ZM=Object.getPrototypeOf,qM=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)sf(t,r,{get:e[r],enumerable:!0})},of=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of FM(e))!qM.call(t,n)&&n!==r&&sf(t,n,{get:()=>e[n],enumerable:!(i=MM(e,n))||i.enumerable});return t},D=(t,e,r)=>(of(t,e,"default"),r&&of(r,e,"default")),So=(t,e,r)=>(r=t!=null?UM(ZM(t)):{},of(e||!t||!t.__esModule?sf(r,"default",{value:t,enumerable:!0}):r,t)),Xr=t=>of(sf({},"__esModule",{value:!0}),t);function GI(t,e=524288){let r=JSON.stringify(t);if(r.length<=e)return[r];let i=`c${Date.now().toString(36)}${(VM++).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 JI(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 VM,af,Xy=w(()=>{"use strict";VM=0;af=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 BM}from"node:fs";function HM(){try{let t=JSON.parse(BM(new URL("../package.json",import.meta.url),"utf8"));if(t.version&&t.name?.includes("codesignflo"))return t.version}catch{}return"0.0.0"}var cf,Yy=w(()=>{"use strict";cf=HM()});function eE(t){if(!t||t==="none")return[];let e=[];for(let r of o4(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 o4,tE=w(()=>{"use strict";o4=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 a4(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 ov(t,e,r){return c4(rE(t,e,r).sets())}function c4(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 sv(t,e,r){let i=rE(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(iv(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 iv(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=f=>r(f)&&f.sizing.w==="fill"&&(o.w==="hug"||s==="VERTICAL"&&!f.text?.align);n.children&&(n={...n,children:n.children.map(f=>l(f)?{...f,sizing:{...f.sizing,w:"hug"}}:f)}),n.layout?.wrap&&c&&n.children&&(n={...n,children:n.children.map(f=>f.sizing[c]==="fill"?{...f,sizing:{...f.sizing,[c]:"fixed"}}:f)});let u=(n.children??[]).filter(f=>f.type!=="TEXT"||f.width>0),d={...o};c&&d[c]==="hug"&&u.length&&u.every(f=>f.sizing[c]==="fill")&&(d[c]="fixed");let p=(n.children??[]).map(f=>{let h={...f.sizing};return a&&d[a]==="hug"&&h[a]==="fill"&&(h[a]="fixed"),i(f,h)});return{...n,sizing:d,...n.children?{children:p}:{}}};return i(t,e(t.sizing))}function rE(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,E)=>{if(!(!v||!b)){v.type==="TEXT"&&b.type==="TEXT"&&v.sizing.w==="hug"&&b.height>v.height+2&&o.add(E);for(let[k,I]of nv(v.children))y(k,rv(b,I),`${E}/${I}`)}};y(m,g,`${u}/${xo(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,E=[],k=q=>q.reduce((Re,de)=>rv(Re,de),b);if(b&&u.fill?.value!==b.fill?.value&&u.fill){let q=i(u.fill);E.push({path:[],fill:u.fill.value,...q?{fillToken:q}:{}})}let I=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]=[I(q),I(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&&E.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)}E.push(Y)}else if(q!==u&&q.type==="FRAME"){let Zt=[...Re,de],Y=O(q,k(Zt));Y&&E.push({path:Zt,at:pt,layout:Y})}for(let[Zt,[Y,De]]of nv(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)=>rv(Re,de)??(q.at?.[pt]!==void 0?Re?.children?.[q.at[pt]]:void 0),b);if(!(b&&E.some(q=>q.path.length&&(!$e(q)||q.characters!==void 0&&$e(q).type!=="TEXT"))))return{mainK:`${d.key}/${xo(v.props)}`,overrides:E}},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",E=u.sizing.h==="fixed"||f&&u.sizing.h==="fill";if(b&&(m.width=u.width),E&&(m.height=u.height),u.spaceToken&&r.get(u.spaceToken)&&(g[E?"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:s4[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 I=u.layout,O=!b&&u.sizing.w!=="fill";if(m.layoutMode=I.direction,[m.paddingTop,m.paddingRight,m.paddingBottom,m.paddingLeft]=I.padding.map(Y=>Y.value),I.direction==="GRID"){m.gridColumnCount=I.columns;let Y=u.width-I.padding[1].value-I.padding[3].value,De=!!I.columnSizes&&I.columnSizes.reduce((Mn,Fn)=>Mn+Fn,0)+I.gap.value*(I.columns-1)<Y-1;I.columnSizes&&I.columnSizes.length===I.columns&&(De||new Set(I.columnSizes).size>1)&&(m.gridColumnSizes=I.columnSizes.map(Mn=>O||De?{type:"FIXED",value:Mn}:{type:"FLEX",value:Math.round(Mn)})),m.gridRowCount=I.rows,m.gridColumnGap=I.gap.value,m.gridRowGap=I.rowGap?.value??I.gap.value;let Lt=i(I.gap);Lt&&(g.gridColumnGap=Lt);let Ht=i(I.rowGap);Ht&&(g.gridRowGap=Ht)}else{if(m.itemSpacing=I.gap.value,I.wrap){m.layoutWrap="WRAP",m.counterAxisSpacing=I.rowGap?.value??I.gap.value;let Y=i(I.rowGap);Y&&(g.counterAxisSpacing=Y)}m.primaryAxisAlignItems=I.justify,m.counterAxisAlignItems=I.align==="STRETCH"||I.align==="BASELINE"&&I.direction==="VERTICAL"?"MIN":I.align}let X=!b&&u.sizing.w!=="fill",le=!E;I.direction!=="GRID"&&(m.primaryAxisSizingMode=(I.direction==="HORIZONTAL"?X:le)?"AUTO":"FIXED",m.counterAxisSizingMode=(I.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=eE(u.shadow),m.effects.some(Y=>Y.spread>0)&&!(u.children??[]).some(Y=>Y.absolute)&&(m.clipsContent=!0);let $e=I.direction==="GRID"?void 0:i(I.gap);$e&&(g.itemSpacing=$e),["paddingTop","paddingRight","paddingBottom","paddingLeft"].forEach((Y,De)=>{let Lt=i(I.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}`:""}`,I,!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=xo(m);return{...a(iv(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(iv(g.root),`${u}/${xo(y)}`,null,!0)]:[]});return a4(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 Nc(t,e,r=0){let i=t.children?{children:t.children.map(d=>Nc(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:Nc(s,e,r+1)}}var nv,rv,s4,xo,av=w(()=>{"use strict";tE();nv=(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}`:""}`]})},rv=(t,e)=>t&&nv(t.children).find(([,r])=>r===e)?.[0],s4={400:"Regular",500:"Medium",600:"Semi Bold",700:"Bold"};xo=t=>Object.keys(t).sort().map(e=>`${e}=${String(t[e]??"").replace(/[=,]/g," ").trim()||"default"}`).join(", ")});function cv(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 nE(t){let e=[],r=t.width??0;for(let i of t.children??[])if(cv(i,r))e.push(i);else for(let n of i.children??[])cv(n,r)&&e.push(n);return e}function uv(t){let e=new Set(nE(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 lv,dv=w(()=>{"use strict";lv=t=>cv({...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 df=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 ff,Dc=w(()=>{"use strict";ff=(t,e)=>Yr(t)===Yr(e)});function fv(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=l4(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 uE(t){return new Map([...fv(t)].filter(([,e])=>typeof e.node.k=="string").map(([e,r])=>[e,r.node.k]))}function f4(t){let e=/italic/i.test(t),r=t.replace(/italic/i,"").toLowerCase().replace(/[\s_-]/g,""),i=d4.find(n=>n.toLowerCase().replace(/\s/g,"")===r)??(r?t.replace(/italic/i,"").trim():"Regular");return e?`${i==="Regular"?"":`${i} `}Italic`:i}function iE(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:f4(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))pf.includes(d)||(r[`layout.${d}`]=p);pf.some(d=>d in u)&&(r.padding=pf.map(d=>u[d]??0))}return r.cornerRadii&&(r.cornerRadius=r.cornerRadii,delete r.cornerRadii),r}function g4(t,e,r,i={}){let n=iE(t.node,r),o=iE(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)||oE(n[p],o[p])||a.set(p,{from:n[p],to:o[p],token:sE(n[p])||sE(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(oE(c[p],l[p]))continue;let f=p4(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})}_4(a),v4(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":m4(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 v4(t){let e=y4.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 _4(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 b4(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=fv(t),n=fv(e),o=[],s=new Set,a=new Set,c=(u,d)=>[...u.values()].filter(p=>$4(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(cE(d.node),cE(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:lE(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:lE(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(...g4(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=b4(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=>!aE(i,u)&&!aE(n,u))}function aE(t,e){for(let r=t.get(e.target);r;r=r.parent?t.get(r.parent):void 0){let i=w4(r.node);if(i.includes("*")||r.id===e.target&&e.prop&&i.includes(e.prop))return!0}return!1}function $4(t,e,r){for(let i=t.get(e)?.parent;i;i=t.get(i)?.parent)if(i===r)return!0;return!1}function cE(t){return{...t,type:"FRAME_ROOT"}}var l4,pf,u4,d4,p4,h4,m4,oE,Li,y4,sE,w4,lE,pv=w(()=>{"use strict";df();Dc();l4=t=>{let e=t.variantProperties??{};return`V[${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join(",")}]`};pf=["paddingTop","paddingRight","paddingBottom","paddingLeft"],u4=["topLeftRadius","topRightRadius","bottomLeftRadius","bottomRightRadius"],d4=["Thin","Extra Light","Light","Regular","Medium","Semi Bold","Bold","Extra Bold","Black"];p4=t=>pf.includes(t)?"padding":u4.includes(t)?"cornerRadius":t==="itemSpacing"?"layout.itemSpacing":t,h4={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"},m4=t=>t.startsWith("layout.")?"layout":h4[t]??"other",oE=ff,Li=(...t)=>pi(JSON.stringify(t)).slice(0,10);y4=["width","height","layoutSizingHorizontal","layoutSizingVertical","primaryAxisSizingMode","counterAxisSizingMode","layoutAlign","layoutGrow"];sE=t=>JSON.stringify(t??null).includes('"var(');w4=t=>Array.isArray(t.pin)?t.pin:[];lE=t=>({type:t.type,name:t.name,...t.characters?{characters:t.characters}:{}})});function yv(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 Ns(t,e){return JSON.parse(JSON.stringify(t),(r,i)=>{let n=typeof i=="string"?/^var\(([^/)]+)\/(.+)\)$/.exec(i):null;if(!n||n[1]===Cs)return i;for(let o of[!0,!1]){let s=yv(`${n[1]}/${n[2]}`,o);if(e.has(s))return`var(${Cs}/${s})`}return i})}function k4(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]!==Cs){let a=i.find(l=>typeof l=="object"&&l&&"color"in l),c=a?.color?`#${hv(a.color.r)}${hv(a.color.g)}${hv(a.color.b)}`:JSON.stringify(t.to);e.push({variable:`${s[1]}/${s[2]}`,value:c,token:yv(`${s[1]}/${s[2]}`,!!a?.color)})}return o}),e}function fE(t){let[,...e]=t.split("|");return e.map(r=>r.split("/").slice(2).join("/")).filter(Boolean).join(" > ")||"(root)"}function dE(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(")?mv(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(mv)??[];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 x4(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 hf(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(x4(s))continue;let a=fE(s.target),c=s.prop??s.op??"?",l=dE(c,s.from,i,s.fromBound),u=dE(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(S4(s.target)),p.items.push(s.id);for(let f of k4(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 gv,Cs,hv,S4,mv,Lc=w(()=>{"use strict";Dc();gv=t=>`${t.layer}|${t.prop}${Array.isArray(t.variants)?`|${[...t.variants].sort().join(";")}`:""}`,Cs="Tokens";hv=t=>Math.round(t*255).toString(16).padStart(2,"0");S4=t=>/^V\[([^\]]*)\]/.exec(t)?.[1]??"",mv=t=>t.replace(/var\((?:[^/)]+\/)?([^)]+)\)/g,(e,r)=>`var(--${r.replace(/\//g,"-")})`)});var A={};Jr(A,{BIGINT_FORMAT_RANGES:()=>qc,CONSTANT_CATCH:()=>_f,Class:()=>bv,NUMBER_FORMAT_RANGES:()=>Zc,aborted:()=>pr,allowsEval:()=>kv,assert:()=>P4,assertEqual:()=>I4,assertIs:()=>T4,assertNever:()=>O4,assertNotEqual:()=>E4,assignProp:()=>Gt,attachSchema:()=>vf,base64ToUint8Array:()=>SE,base64urlToUint8Array:()=>Z4,cached:()=>Ms,captureStackTrace:()=>gf,cleanEnum:()=>F4,cleanRegex:()=>mi,clone:()=>Be,cloneDef:()=>j4,codePointLength:()=>To,constantCatch:()=>Ov,createTransparentProxy:()=>U4,defineLazy:()=>wv,defineLazyInternal:()=>xe,derived:()=>H4,esc:()=>fr,escapeRegex:()=>tn,explicitlyAborted:()=>Iv,extend:()=>vE,finalizeIssue:()=>Ir,floatSafeRemainder:()=>Mc,getElementAtPath:()=>z4,getEnumValues:()=>Ls,getLengthableOrigin:()=>Bc,getParsedType:()=>L4,getSizableOrigin:()=>Vc,hexToUint8Array:()=>V4,hide:()=>Hc,installLazyProp:()=>Tv,isObject:()=>Eo,isPlainObject:()=>en,issue:()=>qs,joinValues:()=>x,jsonStringifyReplacer:()=>Us,members:()=>Ev,merge:()=>wE,mergeDefs:()=>Qr,normalizeParams:()=>M,nullish:()=>mf,numKeys:()=>D4,objectClone:()=>A4,omit:()=>yE,optionalKeys:()=>xv,own:()=>Vn,parsedType:()=>j,partial:()=>$E,pick:()=>gE,prefixIssues:()=>xr,primitiveTypes:()=>Sv,promiseAllObject:()=>C4,propertyKeyTypes:()=>Fc,randomString:()=>N4,rawShape:()=>Fs,required:()=>kE,safeExtend:()=>bE,shallowClone:()=>Zs,slugify:()=>$v,stringifyPrimitive:()=>R,toZod:()=>Uc,uint8ArrayToBase64:()=>xE,uint8ArrayToBase64url:()=>q4,uint8ArrayToHex:()=>B4,unwrapMessage:()=>Ds});function I4(t){return t}function E4(t){return t}function Uc(){return t=>t}function T4(t){}function O4(t){throw new Error("Unexpected value in exhaustive check")}function P4(t){}function Ls(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 x(t,e="|"){return t.map(r=>R(r)).join(e)}function Us(t,e){return typeof e=="bigint"?e.toString():e}function Ms(t){return new _v(t)}function mf(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 Mc(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 wv(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==pE)return i===void 0&&(i=pE,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function A4(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 Fs(t){let e=Object.getOwnPropertyDescriptor(t,"shape");return e?.get?e.get.raw:e?.value}function hi(t){return Fs(t._zod.def)??t._zod.def.shape}function hE(t,e,r){Object.defineProperty(t,e,{get(){let i=r();return Gt(this,e,i),i},enumerable:!0,configurable:!0})}function mE(t,e,r){e in t?Gt(t,e,r):t[e]=r}function Io(t,e,r,i){let n=hi(e);for(let o of r){let s=Object.getOwnPropertyDescriptor(n,o);s.enumerable&&(s.get?hE(t,o,()=>{let a=e._zod.def.shape[o];return i?i(a,o):a}):mE(t,o,i?i(s.value,o):s.value))}}function R4(t,e){for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);i.enumerable&&(i.get?hE(t,r,()=>e[r]):mE(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 j4(t){return Qr(t._zod.def)}function z4(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function C4(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 N4(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 $v(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Eo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function en(t){if(Eo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Eo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Zs(t){return en(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function D4(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 U4(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 xv(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}function gE(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 Io(o,t,yf(t,e)),Be(t,Qr(r,{shape:o,checks:[]}))}function yf(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 yE(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(yf(t,e)),s={};return Io(s,t,Reflect.ownKeys(hi(t)).filter(a=>!o.has(a))),Be(t,Qr(r,{shape:s,checks:[]}))}function vE(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:_E(t,e)}))}function _E(t,e){let r={};return Io(r,t,Reflect.ownKeys(hi(t))),R4(r,e),r}function bE(t,e){if(!en(e))throw new Error("Invalid input to safeExtend: expected a plain object");return Be(t,Qr(t._zod.def,{shape:_E(t,e)}))}function wE(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={};Io(r,t,Reflect.ownKeys(hi(t))),Io(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 $E(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(yf(e,r)):void 0,c={};return Io(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 kE(t,e,r){let i=r?new Set(yf(e,r)):void 0,n={};return Io(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 Iv(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 Ds(t){return typeof t=="string"?t:t?.message}function vf(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:Ds(t.inst?._zod.def?.error?.(t))??Ds(o?.(t))??Ds(e?.error?.(t))??Ds(r.customError?.(t))??Ds(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 Vc(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function To(t){let e=t.length;if(!M4.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 Bc(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 qs(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function F4(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function SE(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 xE(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Z4(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return SE(e+r)}function q4(t){return xE(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function V4(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 B4(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Ev(t,e){for(let r in e){let i=Object.getOwnPropertyDescriptor(e,r);i.get?Object.defineProperty(t,r,{...i,enumerable:!1}):W4(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 Hc(t,e,r){return Vn(t,e,r,!1)}function H4(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 W4(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 K4(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&&vv!==t._zod){vv=void 0;return}vv=t._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,G4);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 Tv(t,e,r,i){let n=K4(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 Ov(t){let e=()=>t;return e[_f]=!0,e}var _v,pE,gf,kv,L4,Fc,Sv,Zc,qc,M4,bv,vv,Ui,G4,_f,B=w(()=>{Mi();_v=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}};pE=Symbol("evaluating");gf="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};kv=Ms(()=>{if(Wt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});L4=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}`)}},Fc=new Set(["string","number","symbol"]),Sv=new Set(["string","number","bigint","boolean","symbol","undefined"]);Zc={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]},qc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};M4=/[\uD800-\uDBFF]/;bv=class{constructor(...e){}};Ui=!1,G4={configurable:!0,get(){Ui=!0}};_f="~constantCatch"});function J4(t){let e=EE;if(e){let r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return EE=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{Pv.value=new o(f);try{Object.defineProperty(p,"_zod",Pv)}finally{Pv.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),Ev(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?J4(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 IE,Av,Pv,EE,Rv,Er,Fi,Wt,Mi=w(()=>{B();Av=Object.freeze({status:"aborted"}),Pv={value:void 0,enumerable:!1},EE="captureStackTrace"in Error?Error:null;Rv=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"}};(IE=globalThis).__zod_globalConfig??(IE.__zod_globalConfig={});Wt=globalThis.__zod_globalConfig});function X4(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,Us,2)),t.message}function Y4(t){this._zod.message=t}function eF(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 Wc(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?eF(r,n.path[0],()=>[]).push(e(n)):i.push(e(n));return{formErrors:i,fieldErrors:r}}function Kc(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 Nv(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 PE(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 Dv(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 ${PE(i.path)}`);return e.join(`
5
+ `)}var Q4,zv,TE,OE,Cv,Tr,Lv=w(()=>{Mi();B();Q4={get:X4,set:Y4,enumerable:!0,configurable:!0},zv={value:void 0,enumerable:!1},TE=new WeakSet([Object.prototype,Error.prototype]),OE=(t,e)=>{t.name="$ZodError",zv.value=e,Object.defineProperty(t,"issues",zv),zv.value=void 0,Object.defineProperty(t,"message",Q4);let r=Object.getPrototypeOf(t);TE.has(r)||(TE.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})}}))},Cv=$("$ZodError",OE),Tr=$("$ZodError",OE,void 0,{Parent:Error})});function bf(t,e){return{callee:e?.callee??t,Err:e?.Err}}function AE(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 iF(t,e,r){let i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=t._zod.bag.fallbackRun,o;if(n?(i[nF]=!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 Vs,Oo,Bs,Po,Hs,Ws,Ks,Gs,rF,nF,Js,Xs,wf,RE,$f,jE,kf,zE,Sf,CE,xf,NE,If,DE,Ef,LE,Tf,UE,Uv=w(()=>{Mi();Lv();B();Vs=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 gf(c,o?.callee??e),c}return a.value};return e},Oo=Vs(Tr),Bs=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 gf(c,o?.callee??e),c}return a.value};return e},Po=Bs(Tr),Hs=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?AE(t,o.issues,n):{success:!0,data:o.value}},Ws=Hs(Tr);Ks=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?AE(t,o.issues,n):{success:!0,data:o.value}},Gs=Ks(Tr),rF=Symbol.for("zod.compile.invalid"),nF=Symbol.for("zod.compile.fallback"),Js=((t,e,r)=>{let i=t._zod.bag.validator;if(i!==void 0){if(i(e)!==rF)return!0;if(i.definite===!0&&r===void 0)return!1}return iF(t,e,r)});Xs=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},wf=t=>{let e=Vs(t),r=(i,n,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return e(i,n,a,bf(r,s))};return r},RE=wf(Tr),$f=t=>{let e=Vs(t),r=(i,n,o,s)=>e(i,n,o,bf(r,s));return r},jE=$f(Tr),kf=t=>{let e=Bs(t),r=async(i,n,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await e(i,n,a,bf(r,s))};return r},zE=kf(Tr),Sf=t=>{let e=Bs(t),r=async(i,n,o,s)=>await e(i,n,o,bf(r,s));return r},CE=Sf(Tr),xf=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Hs(t)(e,r,n)},NE=xf(Tr),If=t=>(e,r,i)=>Hs(t)(e,r,i),DE=If(Tr),Ef=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Ks(t)(e,r,n)},LE=Ef(Tr),Tf=t=>async(e,r,i)=>Ks(t)(e,r,i),UE=Tf(Tr)});var Fr={};Jr(Fr,{anyString:()=>f_,base64:()=>n_,base64url:()=>i_,bigint:()=>h_,boolean:()=>m_,browserEmail:()=>fF,cidrv4:()=>t_,cidrv6:()=>r_,creditCard:()=>Of,cuid:()=>Fv,cuid2:()=>Zv,currencyCode:()=>c_,date:()=>l_,datetime:()=>d_,domain:()=>s_,duration:()=>Kv,e164:()=>a_,email:()=>Jv,emoji:()=>Xv,extendedDuration:()=>oF,guid:()=>Gv,hex:()=>b_,hostname:()=>o_,html5Email:()=>lF,httpProtocol:()=>Gc,iban:()=>Pf,idnEmail:()=>dF,integer:()=>Jc,ipv4:()=>Yv,ipv6:()=>Qv,ksuid:()=>Bv,lowercase:()=>v_,mac:()=>e_,md5_base64:()=>gF,md5_base64url:()=>yF,md5_hex:()=>mF,nanoid:()=>Hv,nanoidOfLength:()=>Wv,null:()=>g_,number:()=>gi,rfc5322Email:()=>uF,sha1_base64:()=>_F,sha1_base64url:()=>bF,sha1_hex:()=>vF,sha256_base64:()=>$F,sha256_base64url:()=>kF,sha256_hex:()=>wF,sha384_base64:()=>xF,sha384_base64url:()=>IF,sha384_hex:()=>SF,sha512_base64:()=>TF,sha512_base64url:()=>OF,sha512_hex:()=>EF,string:()=>p_,time:()=>u_,ulid:()=>qv,undefined:()=>y_,unicodeEmail:()=>ME,uppercase:()=>__,uuid:()=>Ao,uuid4:()=>sF,uuid6:()=>aF,uuid7:()=>cF,xid:()=>Vv});function Wv(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}function Xv(){return new RegExp(pF,"u")}function hF(t){return new RegExp(`^${t}$`)}function Mv(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 u_(t){return new RegExp(`^${Mv(t)}$`)}function d_(t){let e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Mv({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,i=t.local?`${r}|${Mv({precision:t.precision})}`:r;return new RegExp(`^${FE}T(?:${i})$`)}function Xc(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Yc(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Fv,Zv,qv,Vv,Bv,Hv,Kv,oF,Gv,Ao,sF,aF,cF,Jv,lF,uF,ME,dF,fF,pF,Yv,Qv,e_,t_,r_,n_,i_,o_,s_,Gc,a_,Of,c_,Pf,FE,l_,f_,p_,h_,Jc,gi,m_,g_,y_,v_,__,b_,mF,gF,yF,vF,_F,bF,wF,$F,kF,SF,xF,IF,EF,TF,OF,Ro=w(()=>{B();Fv=/^[cC][0-9a-z]{6,}$/,Zv=/^[0-9a-z]+$/,qv=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Vv=/^[0-9a-vA-V]{20}$/,Bv=/^[A-Za-z0-9]{27}$/,Hv=/^[a-zA-Z0-9_-]{21}$/;Kv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,oF=/^[-+]?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)?)??$/,Gv=/^([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})$/,Ao=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)$/,sF=Ao(4),aF=Ao(6),cF=Ao(7),Jv=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lF=/^[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])?)*$/,uF=/^(([^<>()\[\]\\.,;:\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,}))$/,ME=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dF=ME,fF=/^[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])?)*$/,pF="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";Yv=/^(?:(?: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])$/,Qv=/^(([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}|:))$/,e_=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}$`)},t_=/^((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])$/,r_=/^(([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])$/,n_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,i_=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,o_=/^(?=.{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])?)*\.?$/,s_=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Gc=/^https?$/,a_=/^\+[1-9]\d{6,14}$/,Of=/^\d(?:[ -]?\d){11,18}$/,c_=/^(?: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)$/,Pf=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,FE="(?:(?:\\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])))";l_=hF(FE);f_=/^[\s\S]{0,}$/,p_=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},h_=/^-?\d+n?$/,Jc=/^-?\d+$/,gi=/^-?\d+(?:\.\d+)?$/,m_=/^(?:true|false)$/i,g_=/^null$/i,y_=/^undefined$/i,v_=/^[^A-Z]*$/,__=/^[^a-z]*$/,b_=/^[0-9a-fA-F]*$/;mF=/^[0-9a-fA-F]{32}$/,gF=Xc(22,"=="),yF=Yc(22),vF=/^[0-9a-fA-F]{40}$/,_F=Xc(27,"="),bF=Yc(27),wF=/^[0-9a-fA-F]{64}$/,$F=Xc(43,"="),kF=Yc(43),SF=/^[0-9a-fA-F]{96}$/,xF=Xc(64,""),IF=Yc(64),EF=/^[0-9a-fA-F]{128}$/,TF=Xc(86,"=="),OF=Yc(86)});function Rf(t,e,r){t.issues.length&&e.issues.push(...xr(r,t.issues))}var it,w_,$_,Af,jf,zf,k_,S_,x_,I_,E_,T_,O_,P_,A_,Ys,R_,j_,z_,C_,N_,D_,L_,U_,M_,F_,Cf=w(()=>{Mi();Ro();B();it=$("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),w_=t=>{let e=t.value;return!mf(e)&&e.size!==void 0},$_=t=>{let e=t.value;return!mf(e)&&e.length!==void 0},Af={number:"number",bigint:"bigint",object:"date"},jf=$("$ZodCheckLessThan",(t,e)=>{it.init(t,e);let r=Af[typeof e.value];t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:Af[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})}}),zf=$("$ZodCheckGreaterThan",(t,e)=>{it.init(t,e);let r=Af[typeof e.value];t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:Af[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})}}),k_=$("$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):Mc(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})}}),S_=$("$ZodCheckNumberFormat",(t,e)=>{it.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=Zc[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})}}),x_=$("$ZodCheckBigIntFormat",(t,e)=>{it.init(t,e);let[r,i]=qc[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})}}),I_=$("$ZodCheckMaxSize",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=w_),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Vc(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),E_=$("$ZodCheckMinSize",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=w_),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Vc(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),T_=$("$ZodCheckSizeEquals",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=w_),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:Vc(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})}}),O_=$("$ZodCheckMaxLength",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=$_),t._zod.check=i=>{let n=i.value,o=n.length;if((typeof n=="string"&&o>e.maximum?To(n):o)<=e.maximum)return;let a=Bc(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),P_=$("$ZodCheckMinLength",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=$_),t._zod.check=i=>{let n=i.value,o=n.length;if((typeof n=="string"&&o>=e.minimum&&o<e.minimum*2?To(n):o)>=e.minimum)return;let a=Bc(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),A_=$("$ZodCheckLengthEquals",(t,e)=>{var r;it.init(t,e),(r=t._zod.def).when??(r.when=$_),t._zod.check=i=>{let n=i.value,o=n.length,s=typeof n=="string"&&o>=e.length&&o<=e.length*2?To(n):o;if(s===e.length)return;let a=Bc(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})}}),Ys=$("$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=()=>{})}),R_=$("$ZodCheckRegex",(t,e)=>{Ys.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})}}),j_=$("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=v_),Ys.init(t,e)}),z_=$("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=__),Ys.init(t,e)}),C_=$("$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})}}),N_=$("$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})}}),D_=$("$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})}});L_=$("$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=>Rf(n,r,e.property));Rf(i,r,e.property)}}),U_=$("$ZodCheckProperties",(t,e)=>{it.init(t,e),Hc(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=>Rf(l,i,s)))):Rf(c,i,s)}if(o)return Promise.all(o).then(()=>{})}}),M_=$("$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})}}),F_=$("$ZodCheckOverwrite",(t,e)=>{it.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var jo,Nf=w(()=>{jo=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 Z_,q_=w(()=>{Z_={major:4,minor:6,patch:5}});async function PF(t,e){let r={async:!0};return iT(await t._zod.run({value:e,issues:[]},r),r)}function Ff(t){return{validate:e=>{let r={async:!1};try{let i=t._zod.run({value:e,issues:[]},r);if(!(i instanceof Promise))return iT(i,r)}catch{}return PF(t,e)},vendor:"zod",version:1}}function H_(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function Bf(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?H_(t)||Qc:oT(t,e)}function oT(t,e){if(!e.normalize&&e.protocol?.source===Gc.source&&!/^https?:\/\//i.test(t))return B_;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(t)??Qc}return new URL(t)}catch{return Qc}}function el(t){return t.replace(AF,"")}function Hf(t,e){return e.lastIndex=0,e.test(t.hostname)}function Wf(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}function tl(t){return RF.test(t)?H_(`http://[${t}]`):!1}function sp(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:tl(r)}function rl(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function up(t){if(!nl.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return rl(r)}function zF(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 pp(t){return Of.test(t)?zF(t.replace(jF,"")):!1}function CF(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 mp(t){return Pf.test(t)?CF(t):!1}function yp(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 qE(t,e,r){t.issues.length&&e.issues.push(...xr(r,t.issues)),e.value[r]=t.value}function Mf(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 sT(t){let e=Object.keys(t.shape),r=Object.getOwnPropertySymbols(t.shape),i=r.length?r:NF,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=xv(t.shape);return{...t,allKeys:n,symbolKeys:i,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(o)}}function aT(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=>Mf(g,r,h,e,d,p))):Mf(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 VE(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 BE(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 Y_(t,e){let r=t._zod,i=r.bag.optionsMap;i||(i=cT(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 cT(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 Qs(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=Qs(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=Qs(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 HE(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=Qs(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 WE(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 KE(t,e,r){t.issues.length&&e.issues.push(...xr(r,t.issues)),e.value[r]=t.value}function GE(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 JE(t,e,r,i,n,o,s){t.issues.length&&(Fc.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&&(Fc.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 XE(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function YE(t,e){return t.value=e.issues.length?void 0:e.value,t}function QE(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function eT(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 tT(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 Df(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 Lf(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=>Uf(t,o,e.out,r)):Uf(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>Uf(t,o,e.in,r)):Uf(t,n,e.in,r)}}function Uf(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}function rT(t){return t.memo||(t.value=Object.freeze(t.value)),t}function DF(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 p_({minimum:n,maximum:o}).source;let s=t._zod.pattern;return(i&&s===gi?Jc:s)?.source}function V_(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=V_(i);return r&&n&&o&&o!==n?r.replace(mi(n),()=>mi(o)):r}if(e.options){let n=e.options.map(V_);if(n.every(Boolean))return`^(${n.map(o=>mi(o)).join("|")})$`}return DF(t)}function nT(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(qs(n))}}var ve,iT,yi,Xe,Zf,qf,Vf,B_,Qc,AF,Kf,Gf,Jf,Xf,Yf,Qf,ep,tp,W_,K_,G_,J_,rp,RF,np,ip,op,ap,cp,lp,nl,dp,fp,jF,hp,gp,vp,_p,ea,bp,zo,il,wp,$p,kp,Sp,xp,Ip,Ep,Tp,Op,ol,NF,Pp,X_,ta,Ap,sl,Rp,al,jp,zp,Cp,cl,ll,Np,Dp,ra,Lp,Up,Mp,Fp,Zp,qp,Vp,Bp,ul,na,Q_,Hp,Wp,Kp,Gp,ia,Jp,oa=w(()=>{Cf();Mi();Nf();Uv();Ro();B();q_();B();ve=$("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Z_;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(Iv(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&&(vf(a.issues,f,t),u||(u=pr(a,f)))});else{if(a.issues.length===f)continue;vf(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 Hc(this,"~standard",Ff(this))},set"~standard"(t){Vn(this,"~standard",t)}}),iT=(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??f_,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)=>{Ys.init(t,e),yi.init(t,e)}),Zf=$("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Gv),Xe.init(t,e)}),qf=$("$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=Ao(i))}else e.pattern??(e.pattern=Ao());Xe.init(t,e)}),Vf=$("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Jv),Xe.init(t,e)}),B_=1,Qc=2;AF=/[\t\n\r]/g;Kf=$("$ZodURL",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=Bf(i,e);if(n===B_){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}if(n===Qc){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});return}if(n===!0){r.value=el(i);return}e.hostname&&!Hf(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&&!Wf(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:el(i);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Gf=$("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Xv()),Xe.init(t,e)}),Jf=$("$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?Hv:Wv(e.length)),Xe.init(t,e)}),Xf=$("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Fv),Xe.init(t,e)}),Yf=$("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Zv),Xe.init(t,e)}),Qf=$("$ZodULID",(t,e)=>{e.pattern??(e.pattern=qv),Xe.init(t,e)}),ep=$("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Vv),Xe.init(t,e)}),tp=$("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Bv),Xe.init(t,e)}),W_=$("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=d_(e)),Xe.init(t,e)}),K_=$("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=l_),Xe.init(t,e)}),G_=$("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=u_(e)),Xe.init(t,e)}),J_=$("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Kv),Xe.init(t,e)}),rp=$("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Yv),Xe.init(t,e)}),RF=/^[0-9a-fA-F:.]+$/;np=$("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Qv),Xe.init(t,e),t._zod.check=r=>{tl(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}),ip=$("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=e_(e.delimiter)),Xe.init(t,e)}),op=$("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=t_),Xe.init(t,e)});ap=$("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=r_),Xe.init(t,e),t._zod.check=r=>{sp(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}});cp=/^[0-9a-zA-Z+/]*={0,2}$/,lp=$("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=cp),Xe.init(t,e),t._zod.check=r=>{rl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}}),nl=/^[A-Za-z0-9_-]*$/;dp=$("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=nl),Xe.init(t,e),t._zod.check=r=>{up(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),fp=$("$ZodE164",(t,e)=>{e.pattern??(e.pattern=a_),Xe.init(t,e)}),jF=/[- ]/g;hp=$("$ZodCreditCard",(t,e)=>{e.pattern??(e.pattern=Of),Xe.init(t,e),t._zod.check=r=>{pp(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:t,continue:!e.abort})}});gp=$("$ZodIBAN",(t,e)=>{e.pattern??(e.pattern=Pf),Xe.init(t,e),t._zod.check=r=>{mp(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:t,continue:!e.abort})}});vp=$("$ZodJWT",(t,e)=>{Xe.init(t,e),t._zod.check=r=>{yp(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),_p=$("$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})}}),ea=$("$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}}),bp=$("$ZodNumberFormat",(t,e)=>{S_.init(t,e),ea.init(t,e)}),zo=$("$ZodBoolean",(t,e)=>{ve.init(t,e),t._zod.pattern=m_,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}}),il=$("$ZodBigInt",(t,e)=>{ve.init(t,e),t._zod.pattern=h_,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}}),wp=$("$ZodBigIntFormat",(t,e)=>{x_.init(t,e),il.init(t,e)}),$p=$("$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}}),kp=$("$ZodUndefined",(t,e)=>{ve.init(t,e),t._zod.pattern=y_,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}}),Sp=$("$ZodNull",(t,e)=>{ve.init(t,e),t._zod.pattern=g_,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}}),xp=$("$ZodAny",(t,e)=>{ve.init(t,e),t._zod.parse=r=>r}),Ip=$("$ZodUnknown",(t,e)=>{ve.init(t,e),t._zod.parse=r=>r}),Ep=$("$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)}),Tp=$("$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}}),Op=$("$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}});ol=$("$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=>qE(d,i,c)));else if(qE(u,i,c),a&&u.issues.length!==0&&pr(u))break}return s.length?Promise.all(s).then(()=>i):i}});NF=[];Pp=$("$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=Ms(()=>sT(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=Eo,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,E=y._zod.run({value:d[g],issues:[]},u);E instanceof Promise?p.push(E.then(k=>Mf(k,l,g,d,v,b))):Mf(E,l,g,d,v,b)}return s?aT(p,d,l,u,n.value,t,h===!0):p.length?Promise.all(p).then(()=>l):l}}),X_=$("$ZodObjectJIT",(t,e)=>{Pp.init(t,e);let r=t._zod.parse,i=Ms(()=>sT(e)),n=Wt.memoizer,o=f=>{let h=i.value,m=h.symbolKeys,g=new jo(["payload","ctx"],{shape:f,inst:t,memo:n,syms:m}),y=k=>`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`,v=(k,I)=>`
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 ? [${I}, ...iss.path] : [${I}];
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),E=0;for(let k of h.allKeys)b[k]=`key_${E++}`;g.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let k of h.allKeys){if(k==="__proto__")continue;let I=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 ${I} = ${y(O)};`),q&&Re){let de=$e==="optional"?`${I}_present`:`${I}.value !== undefined || ${I}_present`;g.write(`
21
+ const ${I}_present = ${X};
22
+ if (!${I}.issues.length || ${I}_present) {
23
+ if (${I}.issues.length) {${v(I,O)}
24
+ }
25
+
26
+ if (${de}) {
27
+ newResult[${O}] = ${I}.value;
28
+ }
29
+ }
30
+
31
+ `)}else q?(g.write(`
32
+ if (${I}.issues.length) {${v(I,O)}
33
+ }
34
+ `),$e==="defaulted"?g.write(`newResult[${O}] = ${I}.value;`):g.write(`
35
+ if (${I}.value !== undefined || ${X}) {
36
+ newResult[${O}] = ${I}.value;
37
+ }
38
+ `)):g.write(`
39
+ const ${I}_present = ${X};
40
+ if (${I}.issues.length) {${v(I,O)}
41
+ }
42
+ if (!${I}_present && !${I}.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 (${I}_present) {
56
+ newResult[${O}] = ${I}.value;
57
+ }
58
+
59
+ `)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=Eo,c=!Wt.jitless,u=c&&kv.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?aT([],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)}});ta=$("$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=>VE(a,i,t,n)):VE(s,i,t,n)}});Ap=$("$ZodXor",(t,e)=>{ta.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=>BE(a,i,t,n)):BE(s,i,t,n)}});sl=$("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ta.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=Fs(n._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,e.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=Ms(()=>cT(e));t._zod.parse=(n,o)=>{let s=n.value;if(!Eo(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)}}),Rp=$("$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])=>HE(r,c,l)):HE(r,o,s)}});al=$("$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=WE(r,"optin"),l=WE(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=>KE(v,n,f))):KE(y,n,f)}}return a.length?Promise.all(a).then(()=>GE(u,n,r,s,l)):GE(u,n,r,s,l)}});jp=$("$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}}),zp=$("$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])=>{JE(f,h,i,l,o,t,n)})):JE(d,p,i,l,o,t,n)}return s.length?Promise.all(s).then(()=>i):i}});Cp=$("$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=>XE(d,i))):XE(u,i)}return s.length?Promise.all(s).then(()=>i):i}});cl=$("$ZodEnum",(t,e)=>{ve.init(t,e);let r=Ls(e.entries),i=new Set(r);t._zod.values=i,xe(t,"pattern",n=>{let o=Ls(n.def.entries).filter(s=>Fc.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}}),ll=$("$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}}),Np=$("$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}}),Dp=$("$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}});ra=$("$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=>YE(r,o)):YE(r,n)}return e.innerType._zod.run(r,i)}}),Lp=$("$ZodExactOptional",(t,e)=>{ra.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)}),Up=$("$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)}),Mp=$("$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=>QE(o,e)):QE(n,e)}});Fp=$("$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))}),Zp=$("$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=>eT(o,t)):eT(n,t)}});qp=$("$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)}});Vp=$("$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=>tT(r,o,e,i)):tT(r,n,e,i)}}),Bp=$("$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)}),ul=$("$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=>Df(s,e.in,i)):Df(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>Df(o,e.out,i)):Df(n,e.out,i)}});na=$("$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=>Lf(s,e,i)):Lf(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Lf(s,e,i)):Lf(o,e,i)}}});Q_=$("$ZodPreprocess",(t,e)=>{ul.init(t,e)}),Hp=$("$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(rT):rT(n)}});Wp=$("$ZodTemplateLiteral",(t,e)=>{ve.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){let n=V_(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||Sv.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)}),Kp=$("$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?Oo(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?Oo(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 Po(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await Po(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 al({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)),Gp=$("$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))}),ia=$("$ZodLazy",(t,e)=>{ve.init(t,e),wv(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)}),Jp=$("$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=>nT(o,r,i,t));nT(n,r,i,t)}})});function dT(t){return t!==null&&typeof t=="object"}function eb(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}function fl(t,e,r){let i=fT.get(t);if(i!==void 0)return i?dl:sa;if(e.has(t))return dl;e.add(t);let n=sa,o=u=>{if(n!==dl&&u?._zod){let d=fl(u,e,r);d>n&&(n=d)}},s=(u,d)=>{let p=sa;for(let f of Reflect.ownKeys(u)){let h=Object.getOwnPropertyDescriptor(u,f);if(d&&!h.enumerable)continue;let m=h.get?Qp:h.value?._zod?fl(h.value,e,r):sa;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=Fs(c);a(u?s(u,!0):Qp),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?fl(u,e,!1):Qp);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),LF(t,n)}function LF(t,e){return e!==Qp&&fT.set(t,e===dl),e}function th(t){return fl(t,new Set,!0)!==sa}function UF(t,e){let r=t.buckets.get(e);return r||(r=new WeakMap,t.buckets.set(e,r)),r}function pl(){return MF}function rh(t,e){let r=t[tb]?.backEdges;return r!==void 0&&dT(e)&&r.has(e)}var eh,tb,uT,fT,sa,Qp,dl,Xp,Yp,MF,rb=w(()=>{B();eh=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},tb="~memo",uT=[];fT=new WeakMap,sa=0,Qp=1,dl=2;Yp=[],MF={alloc(t,e,r){let i=Xp;if(!i)return r;Xp=void 0;let n={value:r,issues:null};return i.set(e.value,n),Yp.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"&&rh(o,n.value))throw new eh;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=fl(t,new Set,!1);if(y===sa)return t._zod.parse=s,t._zod.run===a&&(t._zod.run=s),s(c,l);y===dl||i?r=!0:i=!0}let u=c.value;if(!dT(u))return s(c,l);let d=l[tb];d||(d={buckets:new WeakMap,backEdges:void 0},l[tb]=d);let p;n===l?p=o:(p=UF(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(...eb(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;Xp=p;let h=Yp.length,m=s(c,l);Xp=void 0;let g=Yp.length>h?Yp.pop():void 0;return m instanceof Promise?m.then(y=>(g&&(g.issues=y.issues.length?eb(y.issues):uT),y)):(g&&(g.issues=m.issues.length?eb(m.issues):uT),m)};t._zod.parse=a,t._zod.run===s&&(t._zod.run=a)})}}});function pT(){return{localeError:FF()}}var FF,hT=w(()=>{B();FF=()=>{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: ${x(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":""}: ${x(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 mT(){return{localeError:ZF()}}var ZF,gT=w(()=>{B();ZF=()=>{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: ${x(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":""}: ${x(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 yT(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 vT(){return{localeError:qF()}}var qF,_T=w(()=>{B();qF=()=>{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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=yT(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=yT(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"}: ${x(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 bT(){return{localeError:VF()}}var VF,wT=w(()=>{B();VF=()=>{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 ${x(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":""}: ${x(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 $T(){return{localeError:BF()}}var BF,kT=w(()=>{B();BF=()=>{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: ${x(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":""}: ${x(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 ST(){return{localeError:HF()}}var HF,xT=w(()=>{B();HF=()=>{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 ${x(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":""}: ${x(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 IT(){return{localeError:WF()}}var WF,ET=w(()=>{B();WF=()=>{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 ${x(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: ${x(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 TT(){return{localeError:KF()}}var KF,OT=w(()=>{B();KF=()=>{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 ${x(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: ${x(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 PT(){return{localeError:GF()}}var GF,AT=w(()=>{B();GF=()=>{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 ${x(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"}: ${x(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 RT(){return{localeError:JF()}}var JF,jT=w(()=>{B();JF=()=>{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 ${x(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"}: ${x(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 zT(){return{localeError:XF()}}var XF,CT=w(()=>{B();XF=()=>{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 ${x(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"}: ${x(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 nh(){return{localeError:YF()}}var YF,nb=w(()=>{B();YF=()=>{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 ${x(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":""}: ${x(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 NT(){return{localeError:QF()}}var QF,DT=w(()=>{B();QF=()=>{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 ${x(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":""}: ${x(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 LT(){return{localeError:e6()}}var e6,UT=w(()=>{B();e6=()=>{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 ${x(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":""}: ${x(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 MT(){return{localeError:t6()}}var t6,FT=w(()=>{B();t6=()=>{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 ${x(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: ${x(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 ZT(){return{localeError:r6()}}var r6,qT=w(()=>{B();r6=()=>{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: ${x(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"}: ${x(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 VT(){return{localeError:n6()}}var n6,BT=w(()=>{B();n6=()=>{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 ${x(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":""} : ${x(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 HT(){return{localeError:i6()}}var i6,WT=w(()=>{B();i6=()=>{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 ${x(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":""} : ${x(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 KT(){return{localeError:o6()}}var o6,GT=w(()=>{B();o6=()=>{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: ${x(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":""}: ${x(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 JT(){return{localeError:s6()}}var s6,XT=w(()=>{B();s6=()=>{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"}: ${x(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 YT(){return{localeError:a6()}}var a6,QT=w(()=>{B();a6=()=>{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 ${x(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":""}: ${x(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 eO(){return{localeError:c6()}}var c6,tO=w(()=>{B();c6=()=>{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 ${x(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"}: ${x(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 rO(){return{localeError:l6()}}var l6,nO=w(()=>{B();l6=()=>{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 ${x(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":""}: ${x(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 iO(t,e,r){return Math.abs(t)===1?e:r}function aa(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 oO(){return{localeError:u6()}}var u6,sO=w(()=>{B();u6=()=>{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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=iO(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 ${aa(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 ${aa(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=iO(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 ${aa(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 ${aa(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":""}. ${x(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${aa(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 ${aa(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function aO(){return{localeError:d6()}}var d6,cO=w(()=>{B();d6=()=>{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 ${x(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":""}: ${x(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 lO(){return{localeError:f6()}}var f6,uO=w(()=>{B();f6=()=>{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 ${x(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"}: ${x(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 dO(){return{localeError:p6()}}var p6,fO=w(()=>{B();p6=()=>{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 ${x(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"}: ${x(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 pO(){return{localeError:h6()}}var h6,hO=w(()=>{B();h6=()=>{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: ${x(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":""}: ${x(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 mO(){return{localeError:m6()}}var m6,gO=w(()=>{B();m6=()=>{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 ${x(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"}: ${x(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 ih(){return{localeError:g6()}}var g6,ib=w(()=>{B();g6=()=>{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 ${x(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 ${x(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 yO(){return ih()}var vO=w(()=>{ib()});function _O(){return{localeError:y6()}}var y6,bO=w(()=>{B();y6=()=>{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 ${x(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":""}: ${x(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 wO(){return{localeError:v6()}}var v6,$O=w(()=>{B();v6=()=>{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: ${x(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: ${x(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 kO(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 SO(){return{localeError:_6()}}var hl,_6,xO=w(()=>{B();hl=t=>t.charAt(0).toUpperCase()+t.slice(1);_6=()=>{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 ${x(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=e(n.origin,kO(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${hl(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`${hl(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,kO(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${hl(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`${hl(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"}: ${x(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`${hl(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function IO(){return{localeError:b6()}}var b6,EO=w(()=>{B();b6=()=>{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 ${x(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"}: ${x(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 TO(){return{localeError:w6()}}var w6,OO=w(()=>{B();w6=()=>{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 ${x(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: ${x(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 PO(){return{localeError:$6()}}var $6,AO=w(()=>{B();$6=()=>{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 ${x(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":""}: ${x(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 RO(){return{localeError:k6()}}var k6,jO=w(()=>{B();k6=()=>{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 ${x(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":""}: ${x(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 zO(){return{localeError:S6()}}var S6,CO=w(()=>{B();S6=()=>{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 ${x(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"}: ${x(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 NO(){return{localeError:x6()}}var x6,DO=w(()=>{B();x6=()=>{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 ${x(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"}: ${x(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 LO(){return{localeError:I6()}}var I6,UO=w(()=>{B();I6=()=>{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 ${x(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":""}: ${x(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 MO(){return{localeError:E6()}}var E6,FO=w(()=>{B();E6=()=>{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 ${x(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"}: ${x(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 ZO(){return{localeError:T6()}}var T6,qO=w(()=>{B();T6=()=>{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 ${x(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":""}: ${x(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 VO(){return{localeError:O6()}}var O6,BO=w(()=>{B();O6=()=>{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: ${x(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}: ${x(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 HO(){return{localeError:P6()}}var P6,WO=w(()=>{B();P6=()=>{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: ${x(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}: ${x(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 KO(){return{localeError:A6()}}var A6,GO=w(()=>{B();A6=()=>{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 ${x(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: ${x(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 JO(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 XO(){return{localeError:R6()}}var R6,YO=w(()=>{B();R6=()=>{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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=JO(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=JO(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":""}: ${x(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 QO(){return{localeError:j6()}}var j6,eP=w(()=>{B();j6=()=>{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 ${x(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: ${x(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 tP(){return{localeError:z6()}}var z6,rP=w(()=>{B();z6=()=>{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 ${x(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"}: ${x(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 nP(){return{localeError:C6()}}var C6,iP=w(()=>{B();C6=()=>{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 ${x(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"}: ${x(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 oP(){return{localeError:N6()}}var N6,sP=w(()=>{B();N6=()=>{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 ${x(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":""}: ${x(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 aP(){return{localeError:D6()}}var D6,cP=w(()=>{B();D6=()=>{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 ${x(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: ${x(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 lP(){return{localeError:L6()}}var L6,uP=w(()=>{B();L6=()=>{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 ${x(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: ${x(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 dP(){return{localeError:U6()}}var U6,fP=w(()=>{B();U6=()=>{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: ${x(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":""}: ${x(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 pP(){return{localeError:M6()}}var M6,hP=w(()=>{B();M6=()=>{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: ${x(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":""}: ${x(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 oh(){return{localeError:F6()}}var F6,ob=w(()=>{B();F6=()=>{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 ${x(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":""}: ${x(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 mP(){return oh()}var gP=w(()=>{ob()});function yP(){return{localeError:Z6()}}var Z6,vP=w(()=>{B();Z6=()=>{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: ${x(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":""}: ${x(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 _P(){return{localeError:q6()}}var q6,bP=w(()=>{B();q6=()=>{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 ${x(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":""}: ${x(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 wP(){return{localeError:V6()}}var V6,$P=w(()=>{B();V6=()=>{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 ${x(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: ${x(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 kP(){return{localeError:B6()}}var B6,SP=w(()=>{B();B6=()=>{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 ${x(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): ${x(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 xP(){return{localeError:H6()}}var H6,IP=w(()=>{B();H6=()=>{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 ${x(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${x(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 EP(){return{localeError:W6()}}var W6,TP=w(()=>{B();W6=()=>{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 ${x(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: ${x(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 ca={};Jr(ca,{ar:()=>pT,az:()=>mT,be:()=>vT,bg:()=>bT,bn:()=>$T,ca:()=>ST,ckb:()=>IT,cs:()=>TT,da:()=>PT,de:()=>RT,el:()=>zT,en:()=>nh,eo:()=>NT,es:()=>LT,fa:()=>MT,fi:()=>ZT,fr:()=>VT,frCA:()=>HT,gu:()=>KT,he:()=>JT,hi:()=>YT,hr:()=>eO,hu:()=>rO,hy:()=>oO,id:()=>aO,is:()=>lO,it:()=>dO,ja:()=>pO,ka:()=>mO,kh:()=>yO,km:()=>ih,kn:()=>_O,ko:()=>wO,lt:()=>SO,mk:()=>IO,ms:()=>TO,ne:()=>PO,nl:()=>RO,nn:()=>zO,no:()=>NO,ota:()=>LO,pl:()=>ZO,ps:()=>MO,pt:()=>VO,ptBR:()=>HO,ro:()=>KO,ru:()=>XO,sk:()=>QO,sl:()=>tP,sv:()=>nP,ta:()=>oP,tg:()=>aP,th:()=>lP,tk:()=>dP,tr:()=>pP,ua:()=>mP,uk:()=>oh,ur:()=>yP,uz:()=>_P,vi:()=>wP,yo:()=>EP,zhCN:()=>kP,zhTW:()=>xP});var sh=w(()=>{hT();gT();_T();wT();kT();xT();ET();OT();AT();jT();CT();nb();DT();UT();FT();qT();BT();WT();GT();XT();QT();tO();nO();sO();cO();uO();fO();hO();gO();vO();ib();bO();$O();xO();EO();OO();AO();jO();CO();DO();UO();FO();qO();BO();WO();GO();YO();eP();rP();iP();sP();cP();uP();fP();hP();gP();ob();vP();bP();$P();SP();IP();TP()});function ch(){return new ah}var OP,sb,ab,ah,Jt,ml=w(()=>{sb=Symbol("ZodOutput"),ab=Symbol("ZodInput"),ah=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)}};(OP=globalThis).__zod_globalRegistry??(OP.__zod_globalRegistry=ch());Jt=globalThis.__zod_globalRegistry});function G6(t,e){try{return uh(t,{assertOnly:!0})}catch{return e}}function db(t,e){try{let r=uh(t),i=lh(t,r);return i._zod.bag.validator=G6(t,r),i}catch(r){if(e?.strict)throw r;return t}}function lh(t,e){if(th(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?.[PP]||a&&rh(a,s.value))return n(s,a);let c=e(s.value);return c!==hr?(s.value=c,s):(a&&(a[PP]=!0),n(s,a))};return o.__originalRun=n,r._zod.bag.fallbackRun=n,r._zod.bag.validator=e,r._zod.run=o,i.__originalRun||J6(r,t,e),r}function J6(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 uh(t,e){let r=!0;try{r=th(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 jo(["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 Do(t,e){return t.definite=!1,he(t,e)}function fe(t){return`v${t.varCounter++}`}function X6(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,Y6(t,e,r,i)}}function Y6(t,e,r,i){e.definite=!1;let n=he(e,r),o=he(e,X6),s=fe(e);return t.write(`const ${s} = ${o}(${n}, ${i});`),t.write(`if (${s} === INVALID) return INVALID;`),s}function eZ(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&&!Q6.has(a.check))throw new je('check with a custom "when" condition');switch(a.check){case"greater_than":tZ(t,e,a,o);break;case"less_than":rZ(t,e,a,o);break;case"multiple_of":nZ(t,e,a,o);break;case"number_format":NP(t,a,o);break;case"min_length":{let c=Co(a.minimum,"min_length"),l=cb(t,e,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);t.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=Co(a.maximum,"max_length"),l=cb(t,e,o,`${o}.length > ${c}`);t.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=Co(a.length,"length_equals"),l=cb(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 < ${Co(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":t.write(`if (${o}.size > ${Co(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":t.write(`if (${o}.size !== ${Co(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=DP(t,e,a,o);break;case"custom":o=lZ(t,e,s,o);break;case"bigint_format":iZ(t,a,o);break;case"mime_type":oZ(t,e,a,o);break;case"property":aZ(t,e,a,o);break;case"properties":sZ(t,e,a,o);break;case"overwrite":{let c=fe(e);cZ(t,e,s,o,c),o=c;break}default:throw new je(`check type ${a.check}`)}}return o}function cb(t,e,r,i){let n=he(e,To),o=fe(e);return t.write(`const ${o} = typeof ${r} === "string" && ${i} ? ${n}(${r}) : ${r}.length;`),o}function Co(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new je(`${e} bound of type ${typeof t}`);return`${t}`}function CP(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 tZ(t,e,r,i){let n=r.inclusive?"<":"<=";t.write(`if (${i} ${n} ${CP(e,r.value)}) return INVALID;`)}function rZ(t,e,r,i){let n=r.inclusive?">":">=";t.write(`if (${i} ${n} ${CP(e,r.value)}) return INVALID;`)}function nZ(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,Mc);t.write(`if (${n}(${i}, ${Co(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function NP(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 iZ(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 oZ(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 sZ(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 aZ(t,e,r,i){let n=`${i}[${JSON.stringify(r.property)}]`;bt(t,e,r.schema,n)}function cZ(t,e,r,i,n){let o=r._zod.def.tx;if(!o)throw new je("overwrite check without a transform function");if(Lo(o))throw new vn("z.compile: async overwrite transforms are not supported");let s=he(e,o);t.write(`const ${n} = ${s}(${i});`)}function lb(){throw new Er}function fb(t){this.issues.push(t)}function lZ(t,e,r,i){let n=r._zod.def;if(n.fn){if(Lo(n.fn))throw new vn("z.compile: async .refine() predicates are not supported");let o=Do(e,n.fn),s=he(e,lb),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(Lo(r._zod.check))throw new vn("z.compile: async .superRefine() / check functions are not supported");let o=r._zod.check,a=Do(e,l=>{let u={value:l,issues:[],addIssue:fb};return o(u)instanceof Promise&&lb(),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 DP(t,e,r,i,n=!0){let o=r.format;if(o==="base64"){let l=he(e,rl);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="base64url"){let l=he(e,up);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="jwt"){let l=he(e,yp),u=he(e,r.alg??null);return t.write(`if (!${l}(${i}, ${u})) return INVALID;`),i}if(o==="ipv6"){let l=he(e,tl);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="cidrv6"){let l=he(e,sp);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="credit_card"){let l=he(e,pp);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="iban"){let l=he(e,mp);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,Bf),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,Hf);t.write(`if (!${m}(${p}, ${u}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let m=he(e,Wf);t.write(`if (!${m}(${p}, ${u}.protocol)) return INVALID;`)}if(!n)return null;let f=fe(e),h=s.normalize?`${p}.href`:`${he(e,el)}(${d})`;return t.write(`const ${f} = ${h};`),f}let a=r.fn;if(a){if(Lo(a))throw new je(`async string format ${o}`);let l=he(e,a);return t.write(`if (!${l}(${i})) return INVALID;`),i}if(uZ.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=dZ(t,e,r,i,a);break;case"number":c=fZ(t,r,i);break;case"boolean":c=pZ(t,i);break;case"bigint":c=hZ(t,r,i);break;case"symbol":c=mZ(t,i);break;case"undefined":c=gZ(t,i);break;case"null":c=yZ(t,i);break;case"any":case"unknown":c=i;break;case"never":t.write("return INVALID;"),c=i;break;case"void":c=vZ(t,i);break;case"nan":c=_Z(t,i);break;case"date":c=bZ(t,i);break;case"object":c=wZ(t,e,r,i,a);break;case"optional":c=$Z(t,e,r,i,a);break;case"nullable":c=xZ(t,e,r,i,a);break;case"array":c=IZ(t,e,r,i,a);break;case"literal":c=EZ(t,e,r,i);break;case"enum":c=TZ(t,e,r,i);break;case"readonly":{let l=RP(t,e,r,i),u=fe(e);t.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":RP(t,e,r,i),c="true";break;case"default":case"prefault":c=OZ(t,e,r,i);break;case"nonoptional":c=PZ(t,e,r,i);break;case"tuple":c=AZ(t,e,r,i);break;case"union":c=RZ(t,e,r,i);break;case"intersection":c=CZ(t,e,r,i);break;case"record":c=NZ(t,e,r,i);break;case"map":c=LZ(t,e,r,i);break;case"set":c=UZ(t,e,r,i);break;case"file":c=MZ(t,i);break;case"template_literal":c=FZ(t,e,r,i);break;case"lazy":c=ZZ(t,e,r,i);break;case"pipe":c=qZ(t,e,r,i);break;case"custom":c=VZ(t,e,r,i);break;case"transform":c=WZ(t,e,r,i);break;case"catch":c=HZ(t,e,r,i);break;default:throw new je(`schema type ${s}`)}return c===null?null:eZ(t,e,r,c)}function dZ(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:DP(t,e,o,i,n)}function fZ(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&&NP(t,{format:i.format},r),r}function pZ(t,e){return t.write(`if (typeof ${e} !== "boolean") return INVALID;`),e}function hZ(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 mZ(t,e){return t.write(`if (typeof ${e} !== "symbol") return INVALID;`),e}function gZ(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function yZ(t,e){return t.write(`if (${e} !== null) return INVALID;`),e}function vZ(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function _Z(t,e){return t.write(`if (typeof ${e} !== "number" || !Number.isNaN(${e})) return INVALID;`),e}function bZ(t,e){return t.write(`if (!(${e} instanceof Date) || Number.isNaN(${e}.getTime())) return INVALID;`),e}function wZ(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],E=u(v),k=fe(e);if(t.write(`const ${k} = ${i}[${E}];`),b._zod.optin!==void 0){let I=fe(e);t.write(`let ${I} = (() => {`),t.indented(O=>{let X=or(O,e,b,k);O.write(`return ${X};`)}),t.write("})();"),b._zod.optout==="optional"?(t.write(`if (${I} === INVALID) {`),t.indented(O=>{O.write(`if (${E} in ${i}) return INVALID;`),O.write(`${I} = undefined;`)}),t.write("}")):t.write(`if (${I} === INVALID) return INVALID;`),f.set(v,I)}else{SZ(b)&&t.write(`if (!(${E} in ${i})) return INVALID;`);let I=or(t,e,b,k,n);I!==null&&f.set(v,I)}}let h=o.catchall,m="none";if(h){let v=h._zod.def.type;if(v==="never"){let b=a.map(E=>`k !== ${fr(E)}`).join(" && ")||"true";t.write(`for (const k in ${i}) {`),t.indented(E=>{E.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=>AP(p[v])||ub(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 E=fe(e);b.write(`const ${E} = ${i}[k];`),or(b,e,h,E,!1)}),t.write("}")}return null}if(y){t.write(`const ${g} = {};`);for(let v of l){let b=u(v),E=f.get(v);ub(p[v])?t.write(`if (${b} in ${i}) ${g}[${b}] = ${E};`):AP(p[v])?t.write(`if (${E} !== undefined || ${b} in ${i}) ${g}[${b}] = ${E};`):t.write(`${g}[${b}] = ${E};`)}}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 E=fe(e);b.write(`const ${E} = ${i}[k];`);let k=or(b,e,h,E);b.write(`${g}[k] = ${k};`)}}),t.write("}")}return g}function $Z(t,e,r,i,n=!0){let o=r._zod.def;if(kZ(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 kZ(t){return t._zod.traits?.has("$ZodExactOptional")===!0}function SZ(t){return t._zod.optin===void 0&&No(t)}function No(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?No(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?No(e.innerType):!0;case"catch":return!0;case"union":return e.options?e.options.some(No):!0;case"intersection":return!e.left||!e.right?!0:No(e.left)&&No(e.right);case"pipe":return e.in?No(e.in):!0;default:return!0}}function ub(t){return t._zod.optin==="optional"&&t._zod.optout==="optional"}function AP(t){return(t._zod.optin!=="defaulted"||t._zod.optout==="optional")&&la(t)}function la(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?la(e.innerType):!0;case"union":return e.options?e.options.some(la):!0;case"intersection":return!e.left||!e.right||la(e.left)||la(e.right);case"pipe":return e.out?la(e.out):!0;default:return!0}}function xZ(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 IZ(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 EZ(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 TZ(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 RP(t,e,r,i){let n=r._zod.def;return bt(t,e,n.innerType,i)}function OZ(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,Zs);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 PZ(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 AZ(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=jP(o,"optin"),c=jP(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(ub(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 jP(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 RZ(t,e,r,i){let n=r._zod.def,o=n.options;if(n.discriminator)return jZ(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 jZ(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=>zZ(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 zZ(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 CZ(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,Qs),c=fe(e);return t.write(`const ${c} = ${a}(${o}, ${s});`),t.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function NZ(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}[${DZ(e,g)}];`);let E=or(t,e,n.valueType,b);t.write(`${s}[${v}] = ${E};`)}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=uh(n.keyType);h.definite===!1&&(e.definite=!1);let m=he(e,h),g=he(e,gi),y=fe(e);return zP(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 E=or(v,e,n.valueType,b);v.write(`${s}[${y}] = ${E};`)}),s}return zP(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 zP(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 DZ(t,e){return typeof e=="string"?fr(e):he(t,e)}function LZ(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 UZ(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 MZ(t,e){return t.write(`if (!(${e} instanceof File)) return INVALID;`),e}function FZ(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 ZZ(t,e,r,i){let n=r._zod.def,o=Do(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 qZ(t,e,r,i){let n=r._zod.def,o=bt(t,e,n.in,i);if(n.transform){if(Lo(n.transform))throw new vn("z.compile: async transforms in pipes are not supported");let s=n.transform,c=Do(e,u=>{let d={value:u,issues:[],addIssue:fb},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 Lo(t){return typeof t=="function"&&(t.constructor.name==="AsyncFunction"||t[Symbol.toStringTag]==="AsyncFunction")}function VZ(t,e,r,i){let n=r._zod.def;if(n.fn){if(Lo(n.fn))throw new vn("z.compile: async custom predicates are not supported");let o=Do(e,n.fn),s=he(e,lb),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 BZ(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 HZ(t,e,r,i){let n=r._zod.def;if(!n.catchValue[_f])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=Do(e,n.catchValue),c=he(e,BZ);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 WZ(t,e,r,i){let n=r._zod.def;if(n.transform){if(Lo(n.transform))throw new vn("z.compile: async transforms are not supported");let o=n.transform,a=Do(e,l=>{let u={value:l,issues:[],addIssue:fb},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,PP,vn,je,Q6,uZ,LP=w(()=>{Mi();Nf();rb();Ro();oa();B();hr=Symbol.for("zod.compile.invalid"),PP=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}};Q6=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);uZ=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 dh(t){return t.checks&&(t.checks=[...t.checks]),t}function gl(t,e){return new t(dh({type:"string",...M(e)}))}function pb(t,e){return new t(dh({type:"string",coerce:!0,...M(e)}))}function yl(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...M(e)})}function vl(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...M(e)})}function _l(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...M(e)})}function bl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...M(e)})}function wl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...M(e)})}function $l(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...M(e)})}function ua(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...M(e)})}function kl(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...M(e)})}function Sl(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...M(e)})}function xl(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...M(e)})}function Il(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...M(e)})}function El(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...M(e)})}function Tl(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...M(e)})}function Ol(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...M(e)})}function Pl(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...M(e)})}function Al(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...M(e)})}function fh(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...M(e)})}function Rl(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...M(e)})}function jl(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...M(e)})}function zl(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...M(e)})}function Cl(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...M(e)})}function Nl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...M(e)})}function ph(t,e){return new t({type:"string",format:"credit_card",check:"string_format",abort:!1,...M(e)})}function hh(t,e){return new t({type:"string",format:"iban",check:"string_format",abort:!1,...M(e)})}function Dl(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...M(e)})}function Ll(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...M(e)})}function Ul(t,e){return new t({type:"string",format:"date",check:"string_format",...M(e)})}function Ml(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...M(e)})}function Fl(t,e){return new t({type:"string",format:"duration",check:"string_format",...M(e)})}function Zl(t,e){return new t(dh({type:"number",checks:[],...M(e)}))}function mb(t,e){return new t(dh({type:"number",coerce:!0,checks:[],...M(e)}))}function mh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...M(e)})}function gh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...M(e)})}function yh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...M(e)})}function vh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...M(e)})}function _h(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...M(e)})}function ql(t,e){return new t({type:"boolean",...M(e)})}function gb(t,e){return new t({type:"boolean",coerce:!0,...M(e)})}function bh(t,e){return new t({type:"bigint",...M(e)})}function yb(t,e){return new t({type:"bigint",coerce:!0,...M(e)})}function wh(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...M(e)})}function $h(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...M(e)})}function kh(t,e){return new t({type:"symbol",...M(e)})}function Sh(t,e){return new t({type:"undefined",...M(e)})}function xh(t,e){return new t({type:"null",...M(e)})}function Ih(t){return new t({type:"any"})}function Eh(t){return new t({type:"unknown"})}function Th(t,e){return new t({type:"never",...M(e)})}function Oh(t,e){return new t({type:"void",...M(e)})}function Ph(t,e){return new t({type:"date",...M(e)})}function vb(t,e){return new t({type:"date",coerce:!0,...M(e)})}function Ah(t,e){return new t({type:"nan",...M(e)})}function _n(t,e){return new jf({check:"less_than",...M(e),value:t,inclusive:!1})}function mr(t,e){return new jf({check:"less_than",...M(e),value:t,inclusive:!0})}function bn(t,e){return new zf({check:"greater_than",...M(e),value:t,inclusive:!1})}function gr(t,e){return new zf({check:"greater_than",...M(e),value:t,inclusive:!0})}function Vl(t){return bn(0,t)}function Bl(t){return _n(0,t)}function Hl(t){return mr(0,t)}function Wl(t){return gr(0,t)}function vi(t,e){return new k_({check:"multiple_of",...M(e),value:t})}function _i(t,e){return new I_({check:"max_size",...M(e),maximum:t})}function wn(t,e){return new E_({check:"min_size",...M(e),minimum:t})}function Zi(t,e){return new T_({check:"size_equals",...M(e),size:t})}function qi(t,e){return new O_({check:"max_length",...M(e),maximum:t})}function Or(t,e){return new P_({check:"min_length",...M(e),minimum:t})}function Vi(t,e){return new A_({check:"length_equals",...M(e),length:t})}function Uo(t,e){return new R_({check:"string_format",format:"regex",...M(e),pattern:t})}function Mo(t){return new j_({check:"string_format",format:"lowercase",...M(t)})}function Fo(t){return new z_({check:"string_format",format:"uppercase",...M(t)})}function Zo(t,e){return new C_({check:"string_format",format:"includes",...M(e),includes:t})}function qo(t,e){return new N_({check:"string_format",format:"starts_with",...M(e),prefix:t})}function Vo(t,e){return new D_({check:"string_format",format:"ends_with",...M(e),suffix:t})}function Kl(t,e,r){return new L_({check:"property",property:t,schema:e,...M(r)})}function Bo(t,e){return new U_({check:"properties",shape:t,...M(e)})}function Ho(t,e){return new M_({check:"mime_type",mime:t,...M(e)})}function rn(t){return new F_({check:"overwrite",tx:t})}function Wo(t){return rn(e=>e.normalize(t))}function Ko(){return rn(t=>t.trim())}function Go(){return rn(t=>t.toLowerCase())}function Jo(){return rn(t=>t.toUpperCase())}function da(){return rn(t=>$v(t))}function _b(t,e,r){return new t({type:"array",element:e,...M(r)})}function KZ(t,e,r){return new t({type:"union",options:e,...M(r)})}function GZ(t,e,r){return new t({type:"union",options:e,inclusive:!1,...M(r)})}function JZ(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...M(i)})}function XZ(t,e,r){return new t({type:"intersection",left:e,right:r})}function YZ(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 QZ(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...M(i)})}function eq(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...M(i)})}function tq(t,e,r){return new t({type:"set",valueType:e,...M(r)})}function rq(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 nq(t,e,r){return new t({type:"enum",entries:e,...M(r)})}function iq(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...M(r)})}function Rh(t,e){return new t({type:"file",...M(e)})}function oq(t,e){return new t({type:"transform",transform:e})}function sq(t,e){return new t({type:"optional",innerType:e})}function aq(t,e){return new t({type:"nullable",innerType:e})}function cq(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Zs(r)}})}function lq(t,e,r){return new t({type:"nonoptional",innerType:e,...M(r)})}function uq(t,e){return new t({type:"success",innerType:e})}function dq(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:Ov(r)})}function fq(t,e,r){return new t({type:"pipe",in:e,out:r})}function pq(t,e){return new t({type:"readonly",innerType:e})}function hq(t,e,r){return new t({type:"template_literal",parts:e,...M(r)})}function mq(t,e){return new t({type:"lazy",getter:e})}function gq(t,e){return new t({type:"promise",innerType:e})}function jh(t,e,r){let i=M(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function zh(t,e,r){return new t({type:"custom",check:"custom",fn:e,...M(r)})}function Ch(t,e){let r=UP(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(qs(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(qs(o))}},t(i.value,i)),e);return r}function UP(t,e){let r=new it({check:"custom",...M(e)});return r._zod.check=t,r}function Nh(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 Dh(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 Lh(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??na,c=t.Boolean??zo,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 hb,MP=w(()=>{Cf();ml();oa();B();hb={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Gl(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&&Gl(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 FP(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}/${FP(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+FP(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 VP(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;VP(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 qP(t){let e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function bb(t){let e=[];for(let o of t){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!BP.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]??qP(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:bb(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=qP(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 yq(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let n of BP)if(n in t)return;let r=e.filter(n=>ZP.some(o=>Array.isArray(n[o]))),i=null;if(!r.length)i=bb(e);else{let n=r[0],o=ZP.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=>bb([...s,c]));if(a.some(c=>!c))return;i={[o]:a}}i&&(delete t.allOf,Gl(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)):Gl(l,h),Gl(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())VP(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)??[])yq(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)}Gl(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:fa(e,"input",t.processors),output:fa(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 BP,ZP,wb,fa,Jl=w(()=>{ml();B();BP=new Set(["type","properties","required","additionalProperties"]),ZP=["oneOf","anyOf"];wb=(t,e={})=>r=>{let i=Hi({...r,processors:e});return et(t,i),Wi(i,t),Ki(i,t)},fa=(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)vq[o._zod.def.check]?.(e,o._zod.def);let n=t._zod.bag;n.minimum!==void 0&&pa(e,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&pa(e,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&ha(e,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&ha(e,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&JP(e,n.multipleOf),n.format!==void 0&&(e.format??(e.format=n.format),n.format.includes("int")&&(e.isInt=!0)),n.mime&&YP(e,n.mime);for(let o of n.patterns??[])XP(e,o);return e}function Xl(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?Xl(e.out):e.type==="catch"?Xl(e.innerType):t._zod.optin}function $b(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=$b(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=>$b(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:Jc).source)),f}function wq(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 kb.get(t)??[]){let n=t.seen.get(i),o=(n?.def??n?.schema)?.propertyNames;if(!o||o===!0||r.has(o))continue;let s=$b(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 tA(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"),ew):JSON.parse(s)}function Xo(t,e){if("_idmap"in t){let i=t,n=Hi({...e,processors:Uh}),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:Uh});return et(t,r),Wi(r,t),Ki(r,t)}var pa,ha,HP,JP,XP,YP,QP,WP,KP,GP,vq,_q,bq,eA,Sb,xb,Ib,Eb,Tb,Ob,Pb,Ab,Rb,jb,zb,Cb,Nb,Db,Lb,Ub,Mb,Fb,Zb,qb,Vb,Bb,Hb,Wb,Kb,Mh,Gb,Jb,kb,Xb,Yb,Qb,ew,tw,rw,nw,iw,ow,sw,Fh,aw,Uh,ma=w(()=>{Ro();oa();Jl();B();pa=(t,e,r)=>{(t[e]===void 0||r>t[e])&&(t[e]=r)},ha=(t,e,r)=>{(t[e]===void 0||r<t[e])&&(t[e]=r)},HP=(t,e)=>{pa(t,"minimum",e),ha(t,"maximum",e)},JP=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},XP=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},YP=(t,e)=>{t.mime=t.mime?t.mime.filter(r=>e.includes(r)):[...e]},QP=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},WP=(t,e)=>pa(t,"minimum",e.minimum),KP=(t,e)=>ha(t,"maximum",e.maximum),GP=t=>(e,r)=>{QP(e,r.format);let[i,n]=t[r.format];pa(e,"minimum",i),ha(e,"maximum",n)},vq={greater_than:(t,e)=>pa(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>ha(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>JP(t,e.value),number_format:GP(Zc),bigint_format:GP(qc),min_length:WP,max_length:KP,length_equals:(t,e)=>HP(t,e.length),min_size:WP,max_size:KP,size_equals:(t,e)=>HP(t,e.size),string_format:(t,e)=>{QP(t,e.format),e.pattern&&XP(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)=>YP(t,e.mime)};_q={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bq=new Map([[cp,n_],[nl,i_]]),eA=t=>bq.get(t)??t,Sb=(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=_q[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(eA);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}))])}},xb=(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}))])}},Ib=(t,e,r,i)=>{r.type="boolean"},Eb=(t,e,r,i)=>{qt(t,e,r,i,"BigInt cannot be represented in JSON Schema")},Tb=(t,e,r,i)=>{qt(t,e,r,i,"Symbols cannot be represented in JSON Schema")},Ob=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Pb=(t,e,r,i)=>{qt(t,e,r,i,"Undefined cannot be represented in JSON Schema")},Ab=(t,e,r,i)=>{qt(t,e,r,i,"Void cannot be represented in JSON Schema")},Rb=(t,e,r,i)=>{r.not={}},jb=(t,e,r,i)=>{},zb=(t,e,r,i)=>{},Cb=(t,e,r,i)=>{qt(t,e,r,i,"Date cannot be represented in JSON Schema")},Nb=(t,e,r,i)=>{let n=t._zod.def,o=Ls(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},Db=(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},Lb=(t,e,r,i)=>{qt(t,e,r,i,"NaN cannot be represented in JSON Schema")},Ub=(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},Mb=(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})))},Fb=(t,e,r,i)=>{r.type="boolean"},Zb=(t,e,r,i)=>{qt(t,e,r,i,"Custom types cannot be represented in JSON Schema")},qb=(t,e,r,i)=>{qt(t,e,r,i,"Function types cannot be represented in JSON Schema")},Vb=(t,e,r,i)=>{qt(t,e,r,i,"Transforms cannot be represented in JSON Schema")},Bb=(t,e,r,i)=>{qt(t,e,r,i,"Map cannot be represented in JSON Schema")},Hb=(t,e,r,i)=>{qt(t,e,r,i,"Set cannot be represented in JSON Schema")},Wb=(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"]})};Kb=(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"?Xl(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)},Mh=(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},Gb=(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)},Jb=(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"?Xl(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)};kb=new WeakMap;Xb=(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,eA(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=kb.get(e);u||(u=[],kb.set(e,u),e.deferred.push(()=>wq(e))),u.push(t)}n.additionalProperties=et(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]})}let c=s._zod.values,l=e.io==="input"&&Xl(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))}},Yb=(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"}]},Qb=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},ew=Symbol();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;let s=tA(n.defaultValue,t,e,r,i);s!==ew&&(r.default=s)},rw=(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=tA(n.defaultValue,t,e,r,i);s!==ew&&(r._prefault=s)},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;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},iw=(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},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,r.readOnly=!0},sw=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Fh=(t,e,r,i)=>{let n=t._zod.def;et(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},aw=(t,e,r,i)=>{let n=t._zod.innerType;et(n,e,i);let o=e.seen.get(t);o.ref=n},Uh={string:Sb,number:xb,boolean:Ib,bigint:Eb,symbol:Tb,null:Ob,undefined:Pb,void:Ab,never:Rb,any:jb,unknown:zb,date:Cb,enum:Nb,literal:Db,nan:Lb,template_literal:Ub,file:Mb,success:Fb,custom:Zb,function:qb,transform:Vb,map:Bb,set:Hb,array:Wb,object:Kb,union:Mh,intersection:Gb,tuple:Jb,record:Xb,nullable:Yb,nonoptional:Qb,default:tw,prefault:rw,catch:nw,pipe:iw,readonly:ow,promise:sw,optional:Fh,lazy:aw}});var Zh,rA=w(()=>{ma();Jl();Zh=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:Uh,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 nA={};var iA=w(()=>{});var $n={};Jr($n,{$ZodAny:()=>xp,$ZodArray:()=>ol,$ZodAsyncError:()=>Er,$ZodBase64:()=>lp,$ZodBase64URL:()=>dp,$ZodBigInt:()=>il,$ZodBigIntFormat:()=>wp,$ZodBoolean:()=>zo,$ZodCIDRv4:()=>op,$ZodCIDRv6:()=>ap,$ZodCUID:()=>Xf,$ZodCUID2:()=>Yf,$ZodCatch:()=>Vp,$ZodCheck:()=>it,$ZodCheckBigIntFormat:()=>x_,$ZodCheckEndsWith:()=>D_,$ZodCheckGreaterThan:()=>zf,$ZodCheckIncludes:()=>C_,$ZodCheckLengthEquals:()=>A_,$ZodCheckLessThan:()=>jf,$ZodCheckLowerCase:()=>j_,$ZodCheckMaxLength:()=>O_,$ZodCheckMaxSize:()=>I_,$ZodCheckMimeType:()=>M_,$ZodCheckMinLength:()=>P_,$ZodCheckMinSize:()=>E_,$ZodCheckMultipleOf:()=>k_,$ZodCheckNumberFormat:()=>S_,$ZodCheckOverwrite:()=>F_,$ZodCheckProperties:()=>U_,$ZodCheckProperty:()=>L_,$ZodCheckRegex:()=>R_,$ZodCheckSizeEquals:()=>T_,$ZodCheckStartsWith:()=>N_,$ZodCheckStringFormat:()=>Ys,$ZodCheckUpperCase:()=>z_,$ZodCodec:()=>na,$ZodCreditCard:()=>hp,$ZodCustom:()=>Jp,$ZodCustomStringFormat:()=>_p,$ZodCyclicError:()=>eh,$ZodDate:()=>Op,$ZodDefault:()=>Mp,$ZodDiscriminatedUnion:()=>sl,$ZodE164:()=>fp,$ZodEmail:()=>Vf,$ZodEmoji:()=>Gf,$ZodEncodeError:()=>Fi,$ZodEnum:()=>cl,$ZodError:()=>Cv,$ZodExactOptional:()=>Lp,$ZodFile:()=>Np,$ZodFunction:()=>Kp,$ZodGUID:()=>Zf,$ZodIBAN:()=>gp,$ZodIPv4:()=>rp,$ZodIPv6:()=>np,$ZodISODate:()=>K_,$ZodISODateTime:()=>W_,$ZodISODuration:()=>J_,$ZodISOTime:()=>G_,$ZodIntersection:()=>Rp,$ZodJWT:()=>vp,$ZodKSUID:()=>tp,$ZodLazy:()=>ia,$ZodLiteral:()=>ll,$ZodMAC:()=>ip,$ZodMap:()=>zp,$ZodNaN:()=>Bp,$ZodNanoID:()=>Jf,$ZodNever:()=>Ep,$ZodNonOptional:()=>Zp,$ZodNull:()=>Sp,$ZodNullable:()=>Up,$ZodNumber:()=>ea,$ZodNumberFormat:()=>bp,$ZodObject:()=>Pp,$ZodObjectJIT:()=>X_,$ZodOptional:()=>ra,$ZodPipe:()=>ul,$ZodPrefault:()=>Fp,$ZodPreprocess:()=>Q_,$ZodPromise:()=>Gp,$ZodReadonly:()=>Hp,$ZodRealError:()=>Tr,$ZodRecord:()=>jp,$ZodRegistry:()=>ah,$ZodSet:()=>Cp,$ZodString:()=>yi,$ZodStringFormat:()=>Xe,$ZodSuccess:()=>qp,$ZodSymbol:()=>$p,$ZodTemplateLiteral:()=>Wp,$ZodTransform:()=>Dp,$ZodTuple:()=>al,$ZodType:()=>ve,$ZodULID:()=>Qf,$ZodURL:()=>Kf,$ZodUUID:()=>qf,$ZodUndefined:()=>kp,$ZodUnion:()=>ta,$ZodUnknown:()=>Ip,$ZodVoid:()=>Tp,$ZodXID:()=>ep,$ZodXor:()=>Ap,$brand:()=>Rv,$constructor:()=>$,$input:()=>ab,$output:()=>sb,Doc:()=>jo,INVALID:()=>hr,JSONSchema:()=>nA,JSONSchemaGenerator:()=>Zh,NEVER:()=>Av,TimePrecision:()=>hb,URL_BAD_FORMAT:()=>B_,URL_UNPARSEABLE:()=>Qc,ZodCompileAsyncError:()=>vn,ZodCompileUnsupportedError:()=>je,_any:()=>Ih,_array:()=>_b,_base64:()=>zl,_base64url:()=>Cl,_bigint:()=>bh,_boolean:()=>ql,_catch:()=>dq,_check:()=>UP,_cidrv4:()=>Rl,_cidrv6:()=>jl,_coercedBigint:()=>yb,_coercedBoolean:()=>gb,_coercedDate:()=>vb,_coercedNumber:()=>mb,_coercedString:()=>pb,_creditCard:()=>ph,_cuid:()=>xl,_cuid2:()=>Il,_custom:()=>jh,_date:()=>Ph,_decode:()=>$f,_decodeAsync:()=>Sf,_default:()=>cq,_discriminatedUnion:()=>JZ,_e164:()=>Nl,_email:()=>yl,_emoji:()=>kl,_encode:()=>wf,_encodeAsync:()=>kf,_endsWith:()=>Vo,_enum:()=>rq,_file:()=>Rh,_float32:()=>gh,_float64:()=>yh,_gt:()=>bn,_gte:()=>gr,_guid:()=>vl,_iban:()=>hh,_includes:()=>Zo,_int:()=>mh,_int32:()=>vh,_int64:()=>wh,_intersection:()=>XZ,_ipv4:()=>Pl,_ipv6:()=>Al,_isoDate:()=>Ul,_isoDateTime:()=>Ll,_isoDuration:()=>Fl,_isoTime:()=>Ml,_jwt:()=>Dl,_ksuid:()=>Ol,_lazy:()=>mq,_length:()=>Vi,_literal:()=>iq,_lowercase:()=>Mo,_lt:()=>_n,_lte:()=>mr,_mac:()=>fh,_map:()=>eq,_max:()=>mr,_maxLength:()=>qi,_maxSize:()=>_i,_mime:()=>Ho,_min:()=>gr,_minLength:()=>Or,_minSize:()=>wn,_multipleOf:()=>vi,_nan:()=>Ah,_nanoid:()=>Sl,_nativeEnum:()=>nq,_negative:()=>Bl,_never:()=>Th,_nonnegative:()=>Wl,_nonoptional:()=>lq,_nonpositive:()=>Hl,_normalize:()=>Wo,_null:()=>xh,_nullable:()=>aq,_number:()=>Zl,_optional:()=>sq,_overwrite:()=>rn,_parse:()=>Vs,_parseAsync:()=>Bs,_pipe:()=>fq,_positive:()=>Vl,_promise:()=>gq,_properties:()=>Bo,_property:()=>Kl,_readonly:()=>pq,_record:()=>QZ,_refine:()=>zh,_regex:()=>Uo,_safeDecode:()=>If,_safeDecodeAsync:()=>Tf,_safeEncode:()=>xf,_safeEncodeAsync:()=>Ef,_safeParse:()=>Hs,_safeParseAsync:()=>Ks,_set:()=>tq,_size:()=>Zi,_slugify:()=>da,_startsWith:()=>qo,_string:()=>gl,_stringFormat:()=>Bi,_stringbool:()=>Lh,_success:()=>uq,_superRefine:()=>Ch,_symbol:()=>kh,_templateLiteral:()=>hq,_toLowerCase:()=>Go,_toUpperCase:()=>Jo,_transform:()=>oq,_trim:()=>Ko,_tuple:()=>YZ,_uint32:()=>_h,_uint64:()=>$h,_ulid:()=>El,_undefined:()=>Sh,_union:()=>KZ,_unknown:()=>Eh,_uppercase:()=>Fo,_url:()=>ua,_uuid:()=>_l,_uuidv4:()=>bl,_uuidv6:()=>wl,_uuidv7:()=>$l,_void:()=>Oh,_xid:()=>Tl,_xor:()=>GZ,base64Charset:()=>cp,base64urlCharset:()=>nl,canParseURL:()=>H_,clone:()=>Be,compile:()=>db,compileFn:()=>uh,config:()=>Pt,createStandardJSONSchemaMethod:()=>fa,createToJSONSchemaMethod:()=>wb,decode:()=>jE,decodeAsync:()=>CE,describe:()=>Nh,encode:()=>RE,encodeAsync:()=>zE,extractDefs:()=>Wi,finalize:()=>Ki,flattenError:()=>Wc,formatError:()=>Kc,getDiscriminatedOption:()=>Y_,globalConfig:()=>Wt,globalRegistry:()=>Jt,handleUnrepresentable:()=>qt,initializeContext:()=>Hi,isBackEdge:()=>rh,isRecursiveSchema:()=>th,isValidBase64:()=>rl,isValidBase64URL:()=>up,isValidCIDRv6:()=>sp,isValidCreditCard:()=>pp,isValidIBAN:()=>mp,isValidIPv6:()=>tl,isValidJWT:()=>yp,locales:()=>ca,memoizer:()=>pl,mergeValues:()=>Qs,meta:()=>Dh,parse:()=>Oo,parseAsync:()=>Po,parseURLObject:()=>oT,prettifyError:()=>Dv,process:()=>et,processSchema:()=>et,regexes:()=>Fr,registry:()=>ch,safeDecode:()=>DE,safeDecodeAsync:()=>UE,safeEncode:()=>NE,safeEncodeAsync:()=>LE,safeParse:()=>Ws,safeParseAsync:()=>Gs,standardProps:()=>Ff,stripTabAndNewline:()=>el,toDotPath:()=>PE,toJSONSchema:()=>Xo,toZod:()=>Uc,treeifyError:()=>Nv,urlHostnameOk:()=>Hf,urlProtocolOk:()=>Wf,util:()=>A,validate:()=>Js,validateAsync:()=>Xs,validateURL:()=>Bf,version:()=>Z_,withParser:()=>lh});var Xt=w(()=>{Mi();Uv();Lv();oa();rb();Cf();q_();B();B();Ro();sh();ml();Nf();LP();MP();Jl();ma();rA();iA()});var cw=w(()=>{Xt()});function ze(t){return gl(Sq,t)}function oA(t){return Zl(xq,t)}function sA(t){return ql(Iq,t)}function Yl(t,e){return new Eq({type:"array",element:t,...M(e)})}function dt(t,e){let r={type:"object",shape:t??{},...M(e)};return new Tq(r)}function aA(t,e,r){return new Oq({type:"union",options:e,discriminator:t,...M(r)})}function Yo(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Pq({type:"enum",entries:r,...M(e)})}function St(t,e){return new Aq({type:"literal",values:Array.isArray(t)?t:[t],...M(e)})}function Gi(t){return new Rq({type:"optional",innerType:t})}var bi,Sq,xq,Iq,Eq,Tq,Oq,Pq,Aq,Rq,cA=w(()=>{Xt();B();cw();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 Oo(this,t,e,{callee:this.parse})},parseAsync(t,e){return Po(this,t,e,{callee:this.parseAsync})},safeParse(t,e){return Ws(this,t,e)},safeParseAsync(t,e){return Gs(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)}}),Sq=$("ZodMiniString",(t,e)=>{yi.init(t,e),bi.init(t,e)});xq=$("ZodMiniNumber",(t,e)=>{ea.init(t,e),bi.init(t,e)});Iq=$("ZodMiniBoolean",(t,e)=>{zo.init(t,e),bi.init(t,e)});Eq=$("ZodMiniArray",(t,e)=>{ol.init(t,e),bi.init(t,e)});Tq=$("ZodMiniObject",(t,e)=>{Pp.init(t,e),bi.init(t,e),Tv(t,"shape",r=>r._zod.def.shape,!1)});Oq=$("ZodMiniDiscriminatedUnion",(t,e)=>{sl.init(t,e),bi.init(t,e)});Pq=$("ZodMiniEnum",(t,e)=>{cl.init(t,e),bi.init(t,e),t.options=[...t._zod.values]});Aq=$("ZodMiniLiteral",(t,e)=>{ll.init(t,e),bi.init(t,e)});Rq=$("ZodMiniOptional",(t,e)=>{ra.init(t,e),bi.init(t,e)})});var lA=w(()=>{Xt()});function Ql(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===uA)return new ia({type:"lazy",getter:()=>i.get(s)});if(a!==void 0)return a;i.set(s,uA);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 uA,lw=w(()=>{oa();B();uA=Symbol("z.visit/resolving")});var dA=w(()=>{});var fA=w(()=>{});var uw=w(()=>{Xt();cw();cA();lA();ma();sh();dA();fA()});var pA=w(()=>{uw()});function qh(t){let e=hA.safeParse(t);return e.success?e.data:null}var At,hA,eu,dw=w(()=>{"use strict";pA();At={id:ze(),at:ze(),by:ze(),component:ze()},hA=aA("kind",[dt({...At,kind:St("generated"),gen:ze(),commit:ze(),fingerprint:ze()}),dt({...At,kind:St("registered"),reviewed:sA()}),dt({...At,kind:St("delivered"),claim:ze(),mode:Yo(["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:Yo(["approved","questions","later","skipped"]),plan:Gi(ze()),question:Gi(ze())}),dt({...At,kind:St("resolved"),claim:ze(),take:Yo(["design","code"]),reason:Gi(ze())}),dt({...At,kind:St("closed"),claim:ze(),commit:ze(),items:Yl(ze()),how:Gi(Yo(["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:Yo(["matches","differs","design_only"]),differences:Gi(oA()),decision:Gi(Yo(["design","code","later"]))}),dt({...At,kind:St("review_requested")}),dt({...At,kind:St("kept"),claim:ze(),pins:Yl(dt({key:ze(),props:Yl(ze())}))}),dt({...At,kind:St("unkept"),key:ze(),props:Yl(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))})]);eu=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 eu(t)){let n=r.get(i.component)??Nq(i.component);r.set(i.component,mA(n,i))}return r}function mA(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 Nq,fw=w(()=>{"use strict";dw();Nq=t=>({component:t,state:"in_sync",unseen:!1,conflict:!1,history:[],warnings:[]})});function _A(t,e,r=!1){return typeof e=="number"?qq(e,Vq.has(t)?Zq:Fq):typeof e=="string"?e.startsWith("VariableID:")?`var(${vA[e]??"unresolved"})`:t in Lq&&pw[e]?`style(${pw[e]})`:r?gA(e):e:Array.isArray(e)?e.map(i=>_A(t,i,r)):e&&typeof e=="object"?hw(e,new Set,r||yA.has(t)):e}function hw(t,e=new Set,r=!1){let i={},n=Object.keys(t).map(o=>[r?gA(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]=_A(s,a,r||yA.has(s)))}return i}function tu(t,e={}){vA=e.variables??{},pw=e.styles??{};let r=(i,n,o)=>{let s=new Set(Uq);(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=hw(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=hw(u,Mq));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 Dq,gA,Lq,yA,Uq,Mq,Fq,Zq,qq,Vq,vA,pw,Bn,mw=w(()=>{"use strict";Dq=/#\d+:\d+$/,gA=t=>t.replace(Dq,""),Lq={fill:!0,stroke:!0,effect:!0,text:!0,grid:!0},yA=new Set(["componentPropertyDefinitions","componentProperties","componentPropertyReferences"]),Uq=new Set(["id","parentId","locked"]),Mq=new Set(["id","componentSetId"]),Fq=2,Zq=4,qq=(t,e)=>{let r=Math.round(t*10**e)/10**e;return Object.is(r,-0)?0:r},Vq=new Set(["r","g","b","a","opacity","position","innerRadius"]),vA={},pw={};Bn=t=>`${JSON.stringify(t,null,2)}
66
+ `});function $A(t,e,r){let i=qn(t,e),n=qn(t,r),o=i.map(s=>{let a=n.filter(u=>!!(u.op==="remove"&&wA(s.target,u.target)||s.op==="remove"&&wA(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&&(bA(c.to,s.to)&&bA(c.toBound,s.toBound)||!Bq(s)&&Hq(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 bA,Bq,Hq,wA,kA=w(()=>{"use strict";pv();Dc();bA=ff,Bq=t=>`${JSON.stringify(t.to??null)}${JSON.stringify(t.toBound??null)}`.includes("var("),Hq=(t,e)=>Yr(t,r=>r==="boundVariables")===Yr(e,r=>r==="boundVariables"),wA=(t,e)=>t===e||t.startsWith(`${e}|`)||t.startsWith(`${e}/`)});function Qo(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 ru(t){let e=$A(t.base,t.ours,t.theirs),r=e.ours.filter(o=>o.merge==="clean"||t.designWins&&o.merge==="conflict"),i=hf(r.filter(o=>o.kind!=="data"),t.dtcg,SA(t.theirs));for(let o of i)o.variants!=="all"&&(o.scope=t.scopes?.[gv(o)]??"all");let n=hf(r.filter(o=>o.kind==="data"),t.dtcg,SA(t.theirs));return{m:e,changes:i,content:n}}var SA,gw=w(()=>{"use strict";Lc();kA();SA=t=>(t.children??[]).map(e=>Object.entries(e.variantProperties??{}).sort().map(([r,i])=>`${r}=${i}`).join(","))});function Xq(t,e){let r=t.replace("#",""),i=n=>Jq(Number.parseInt(r.slice(n,n+2),16)/255);return{...e?{boundVariables:{color:yw(e)}}:{},color:{b:i(4),g:i(2),r:i(0)},opacity:r.length===8?i(6):1,type:"SOLID",visible:!0}}function IA(t,e,r){return t.map((i,n)=>i.startsWith("image:")?e?.[n]??{type:"IMAGE"}:i.startsWith("gradient:")?e?.[n]??{type:"GRADIENT_LINEAR"}:Xq(i,r))}function Yq(t,e){let r={...t},i=e.props,n={...t.boundVariables??{}};for(let a of Wq)a in i&&(r[a]=i[a]);if("layoutMode"in i||xA.some(a=>a in i)){let a={...t.layout??{}};"layoutMode"in i&&(a.mode=i.layoutMode);for(let c of xA)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:Kq[a.style]??400}}:{}}}if("fills"in i&&(r.fills=IA(i.fills,t.fills,e.paintBind?.fills)),"strokes"in i&&!(t.strokes===void 0&&i.strokes.length===0)&&(r.strokes=IA(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?Gq:[]]);("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]=[yw(c)];for(let a of["fills","strokes"])a in i&&(delete n[a],e.paintBind?.[a]&&(n[a]=[yw(e.paintBind[a])]));return Object.keys(n).length?r.boundVariables=n:delete r.boundVariables,r}function nu(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"?Yq(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 xA,Wq,Kq,Gq,Jq,yw,vw=w(()=>{"use strict";Lc();xA=["paddingTop","paddingRight","paddingBottom","paddingLeft","itemSpacing","primaryAxisAlignItems","counterAxisAlignItems","strokesIncludedInLayout"],Wq=["layoutPositioning","x","y","layoutSizingHorizontal","layoutSizingVertical","primaryAxisSizingMode","counterAxisSizingMode","width","height","cornerRadius","opacity","clipsContent","characters","fontSize","lineHeight","letterSpacing","textAutoResize","textAlignHorizontal","textCase","textTruncation","maxLines","strokeAlign"],Kq={Regular:400,Medium:500,"Semi Bold":600,Bold:700},Gq=["topLeftRadius","topRightRadius","bottomLeftRadius","bottomRightRadius"],Jq=t=>Math.round(t*1e4)/1e4,yw=t=>`var(${Cs}/${t})`});function Qq(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 TA(t){let{dataText:e,children:r,...i}=t;return{...i,...r?{children:r.map(TA)}:{}}}function OA(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 eV(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 tV(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=nu(t,e).tree,o=uE(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 bw(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={},E=(_,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=Qq(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",{}),I=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}),I.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=_w(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=eV(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=>lv(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,...I.has(_.k)||U.adoptFrom?{}:{specHash:EA(_)}},{timeoutMs:18e4});f[_.k]=z.id;for(let G of z.stats.errors)G.startsWith("bind grid")||h.push(`${_.k}: ${G}`);E(_.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,Yd=>Yd==="boundVariables"),$o=Gr?qn(...OA(Gr,ie)):[],js=$o.filter(Zn=>Kt(Zn.from)!==Kt(Zn.to)).length,ko=$o.length-js;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${js?` (${js} visual difference(s) from the designer's frame \u2014 check with: codesignflo verify ${_.k})`:" and matches the designer's frame"}${ko?`; ${ko} 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 tV(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=Nc(_.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:EA(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,E(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=_w(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(tu(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=[],Jd=new Set([...xt(e.ledger()).values()].filter(_=>_.claim&&_.state==="ready_for_dev").map(_=>_.claim.id)),Xd=new Set(e.ledger().map(_=>_.id));for(let _ of r.deliveries.filter(U=>Jd.has(U.claim)&&!Xd.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=Ns(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 Vh(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,tu(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(_=>({...rV(_,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 Vh(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=Qo(f&&await e.generation(l.claim.component,f)||p,p),m=Ns(Qo(wi(await t.call("snapshot",{id:l.nodeId})),p),a),g=e.ledger().some(E=>E.kind==="resolved"&&E.claim===l.claim.id&&E.take==="design"),{m:y,changes:v,content:b}=ru({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 rV(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,_w,EA,PA=w(()=>{"use strict";av();dv();pv();Lc();fw();mw();df();Dc();gw();vw();kn=()=>new Date().toISOString(),wi=t=>tu(t.tree,{variables:t.variables,styles:t.styles,ignoreRootName:!0});_w=t=>`g_${pi(Bn(TA(t))).slice(0,10)}`;EA=t=>pi(Yr(t)).slice(0,16)});function iu(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(ga).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(ga).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 ww(t){let e=t.entry?.files??[],r=t.entry?.stories?Object.entries(t.entry.stories).map(([i,n])=>`${ga(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(iu).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 $w(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/${nV(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 kw(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 Sw(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 xw(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 Iw(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 Ew(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 Tw(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 Ow(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 Bh(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 ga,nV,AA=w(()=>{"use strict";ga=t=>t.split(",").map(e=>e.replace("="," = ")).join(" and ");nV=t=>t.replace(/^pages\./,"").split("-").map(e=>e&&e[0].toUpperCase()+e.slice(1)).join(" ")});var Hh,ou,Pw,RA=w(()=>{"use strict";Hh=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("."),ou=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(""),Pw=t=>{let e=Hh(t).replace(/(^|-)page$/,"")||"new";return{key:`pages.${e}-page`,component:ou(e),story:`${ou(e)}Page`}}});var Pr=w(()=>{"use strict";PA();gw();AA();vw();av();dv();Lc();dw();fw();Xy();mw();df();RA()});function jA(){return globalThis[iV]}var iV,zA=w(()=>{iV=Symbol.for("@supabase/supabase-js.traceContextExtractor")});var Zr={};Jr(Zr,{__addDisposableResource:()=>oR,__assign:()=>Wh,__asyncDelegator:()=>XA,__asyncGenerator:()=>JA,__asyncValues:()=>YA,__await:()=>ya,__awaiter:()=>VA,__classPrivateFieldGet:()=>rR,__classPrivateFieldIn:()=>iR,__classPrivateFieldSet:()=>nR,__createBinding:()=>Gh,__decorate:()=>DA,__disposeResources:()=>sR,__esDecorate:()=>UA,__exportStar:()=>HA,__extends:()=>CA,__generator:()=>BA,__importDefault:()=>tR,__importStar:()=>eR,__makeTemplateObject:()=>QA,__metadata:()=>qA,__param:()=>LA,__propKey:()=>FA,__read:()=>jw,__rest:()=>NA,__rewriteRelativeImportExtension:()=>aR,__runInitializers:()=>MA,__setFunctionName:()=>ZA,__spread:()=>WA,__spreadArray:()=>GA,__spreadArrays:()=>KA,__values:()=>Kh,default:()=>aV});function CA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Aw(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function NA(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 DA(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 LA(t,e){return function(r,i){e(r,i,t)}}function UA(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 MA(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 FA(t){return typeof t=="symbol"?t:"".concat(t)}function ZA(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 qA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function VA(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 BA(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 HA(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gh(e,t,r)}function Kh(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 jw(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 WA(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(jw(arguments[e]));return t}function KA(){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 GA(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 ya(t){return this instanceof ya?(this.v=t,this):new ya(t)}function JA(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 ya?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 XA(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:ya(t[n](s)),done:!1}:o?o(s):s}:o}}function YA(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 Kh=="function"?Kh(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 QA(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function eR(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Rw(t),i=0;i<r.length;i++)r[i]!=="default"&&Gh(e,t,r[i]);return oV(e,t),e}function tR(t){return t&&t.__esModule?t:{default:t}}function rR(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 nR(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 iR(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 oR(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 sR(t){function e(o){t.error=t.hasError?new sV(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 aR(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 Aw,Wh,Gh,oV,Rw,sV,aV,qr=w(()=>{Aw=function(t,e){return Aw=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])},Aw(t,e)};Wh=function(){return Wh=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},Wh.apply(this,arguments)};Gh=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]});oV=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},Rw=function(t){return Rw=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},Rw(t)};sV=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};aV={__extends:CA,__assign:Wh,__rest:NA,__decorate:DA,__param:LA,__esDecorate:UA,__runInitializers:MA,__propKey:FA,__setFunctionName:ZA,__metadata:qA,__awaiter:VA,__generator:BA,__createBinding:Gh,__exportStar:HA,__values:Kh,__read:jw,__spread:WA,__spreadArrays:KA,__spreadArray:GA,__await:ya,__asyncGenerator:JA,__asyncDelegator:XA,__asyncValues:YA,__makeTemplateObject:QA,__importStar:eR,__importDefault:tR,__classPrivateFieldGet:rR,__classPrivateFieldSet:nR,__classPrivateFieldIn:iR,__addDisposableResource:oR,__disposeResources:sR,__rewriteRelativeImportExtension:aR}});var cR=C(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.resolveFetch=void 0;var cV=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);Jh.resolveFetch=cV});var Dw=C(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.FunctionRegion=nn.FunctionsHttpError=nn.FunctionsRelayError=nn.FunctionsFetchError=nn.FunctionsError=void 0;var va=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=va;var zw=class extends va{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nn.FunctionsFetchError=zw;var Cw=class extends va{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nn.FunctionsRelayError=Cw;var Nw=class extends va{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nn.FunctionsHttpError=Nw;var lR;(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"})(lR||(nn.FunctionRegion=lR={}))});var uR=C(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.FunctionsClient=void 0;var lV=(qr(),Xr(Zr)),uV=cR(),_a=Dw(),Lw=class{constructor(e,{headers:r={},customFetch:i,region:n=_a.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=n,this.fetch=(0,uV.resolveFetch)(i)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return lV.__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 E=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 _a.FunctionsFetchError(X)}),k=E.headers.get("x-relay-error");if(k&&k==="true")throw new _a.FunctionsRelayError(E);if(!E.ok)throw new _a.FunctionsHttpError(E);let I=((n=E.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim().toLowerCase(),O;return I==="application/json"?O=yield E.json():I==="application/octet-stream"||I==="application/pdf"?O=yield E.blob():I==="text/event-stream"?O=E:I==="multipart/form-data"?O=yield E.formData():O=yield E.text(),{data:O,error:null,response:E}}catch(l){return{data:null,error:l,response:l instanceof _a.FunctionsHttpError||l instanceof _a.FunctionsRelayError?l.context:void 0}}finally{s&&clearTimeout(s),c&&((o=i.signal)===null||o===void 0||o.removeEventListener("abort",c))}})}};Xh.FunctionsClient=Lw});var dR=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 dV=uR();Object.defineProperty(Ar,"FunctionsClient",{enumerable:!0,get:function(){return dV.FunctionsClient}});var au=Dw();Object.defineProperty(Ar,"FunctionsError",{enumerable:!0,get:function(){return au.FunctionsError}});Object.defineProperty(Ar,"FunctionsFetchError",{enumerable:!0,get:function(){return au.FunctionsFetchError}});Object.defineProperty(Ar,"FunctionsHttpError",{enumerable:!0,get:function(){return au.FunctionsHttpError}});Object.defineProperty(Ar,"FunctionsRelayError",{enumerable:!0,get:function(){return au.FunctionsRelayError}});Object.defineProperty(Ar,"FunctionRegion",{enumerable:!0,get:function(){return au.FunctionRegion}})});function cu(t){"@babel/helpers - typeof";return cu=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},cu(t)}function pV(t,e){if(cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(cu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hV(t){var e=pV(t,"string");return cu(e)=="symbol"?e:e+""}function mV(t,e,r){return(e=hV(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pR(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 es(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pR(Object(r),!0).forEach(function(i){mV(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pR(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function hR(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 gV(t,e,r,i){return!(!i||r>=yR||!vR.includes(t)||!fV.includes(e))}async function _R(t,e,r,i){let n=0;for(;;){let c=es({},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)||!vR.includes(r.method))throw u;if(i&&n<yR){let d=fR(n);n++,await hR(d,r.signal);continue}throw u}if(gV(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:fR(n);await l.text(),n++,await hR(d,r.signal);continue}return l}}function bV(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 gR(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,yR,fR,fV,vR,yV,vV,mR,ba,_V,bR,$R=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}}},yR=3,fR=t=>Math.min(1e3*2**t,3e4),fV=[520,503],vR=["GET","HEAD","OPTIONS"];yV=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 _R(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(es(es({},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}},vV=class extends yV{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}},mR=new RegExp("[,()]"),ba=class extends vV{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"&&mR.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"&&mR.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}},_V=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 ba({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 ba({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 ba({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 ba({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 ba({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})}};bR=class wR{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,es(es({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(p),f.removeEventListener("abort",h)})}return c(l,es(es({},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 _V(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 wR(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 _R(o,`${e.url}/`,{method:"GET",headers:n},(a=e.retry)!==null&&a!==void 0?a:!0)}catch(l){return gR(l,0,"")}let c;try{c=await s.text()}catch(l){return gR(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:bV(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 ba({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 Uw=C(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.WebSocketFactory=void 0;var Yh=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}}};lu.WebSocketFactory=Yh;lu.default=Yh});var kR=C(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.version=void 0;Qh.version="2.117.3"});var uu=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 SR=kR();He.DEFAULT_VERSION=`realtime-js/${SR.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=SR.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 xR=C(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});var Mw=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)))}};Fw.default=Mw});var em=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 wV=(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=wV;var $V=(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):Zw(s)};tt.convertColumn=$V;var kV=(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 Zw(e);default:return Zw(e)}};tt.convertCell=kV;var Zw=t=>t,SV=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}};tt.toBoolean=SV;var xV=t=>{if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return e}return t};tt.toNumber=xV;var IV=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t};tt.toJson=IV;var EV=(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=EV;var TV=t=>typeof t=="string"?t.replace(" ","T"):t;tt.toTimestampString=TV;var OV=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=OV});var Ww=C((Cne,TR)=>{"use strict";var Bw=Object.defineProperty,PV=Object.getOwnPropertyDescriptor,AV=Object.getOwnPropertyNames,RV=Object.prototype.hasOwnProperty,jV=(t,e)=>{for(var r in e)Bw(t,r,{get:e[r],enumerable:!0})},zV=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of AV(e))!RV.call(t,n)&&n!==r&&Bw(t,n,{get:()=>e[n],enumerable:!(i=PV(e,n))||i.enumerable});return t},CV=t=>zV(Bw({},"__esModule",{value:!0}),t),IR={};jV(IR,{Channel:()=>ER,LongPoll:()=>ts,Presence:()=>qV,Push:()=>du,Serializer:()=>pu,Socket:()=>VV,Timer:()=>Hw});TR.exports=CV(IR);var $a=t=>typeof t=="function"?t:function(){return t},NV=typeof self<"u"?self:null,wa=typeof window<"u"?window:null,Hn=NV||wa||globalThis,DV="2.0.0",LV=1e4,UV=1e3,MV=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"},qw={longpoll:"longpoll",websocket:"websocket"},FV={complete:4},Vw="base64url.bearer.phx.",du=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})}},Hw=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))}},ER=class{constructor(t,e,r){this.state=Rr.closed,this.topic=t,this.params=$a(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new du(this,$i.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Hw(()=>{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 du(this,$i.leave,$a({}),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 du(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 du(this,$i.leave,$a({}),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}},tm=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===FV.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)}`}},ZV=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)},ts=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Vw)&&(this.authToken=atob(e[1].slice(Vw.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("(.*)/"+qw.websocket),"$1/"+qw.longpoll)}endpointURL(){return tm.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=ZV(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+MV,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=tm.request(t,this.endpointURL(),e,r,this.timeout,s,a=>{this.reqs.delete(o),this.isActive()&&n(a)}),this.reqs.add(o)}},qV=class fu{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=fu.syncState(this.state,n,o,s),this.pendingDiffs.forEach(c=>{this.state=fu.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=fu.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 fu.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))}},pu={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}}},VV=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||LV,this.transport=e.transport||Hn.WebSocket||ts,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=pu.encode.bind(pu),this.defaultDecoder=pu.decode.bind(pu),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!==ts?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;wa&&wa.addEventListener&&(wa.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),i=this.connectClock)}),wa.addEventListener("pageshow",n=>{i===this.connectClock&&(i=null,this.connect())}),wa.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=$a(e.params||{}),this.endPoint=`${t}/${qw.websocket}`,this.vsn=e.vsn||DV,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Hw(()=>{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&&$a(e.authToken)}getLongPollTransport(){return ts}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=tm.appendParams(tm.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=$a(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==ts?this.connectWithFallback(ts,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 ts:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Vw}${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(),UV,"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 ER(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 PR=C(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});var BV=Ww(),Kw=class t{constructor(e,r){let i=WV(r);this.presence=new BV.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=HV(e),Object.getOwnPropertyNames(e).reduce((r,i)=>{let n=e[i];return r[i]=rm(n),r},{})}static onJoinPayload(e,r,i){let n=OR(r),o=rm(i);return{event:"join",key:e,currentPresences:n,newPresences:o}}static onLeavePayload(e,r,i){let n=OR(r),o=rm(i);return{event:"leave",key:e,currentPresences:n,leftPresences:o}}};Gw.default=Kw;function rm(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 HV(t){return JSON.parse(JSON.stringify(t))}function WV(t){return t?.events&&{events:t.events}}function OR(t){return t?.metas?rm(t):[]}});var Xw=C(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.REALTIME_PRESENCE_LISTEN_EVENTS=void 0;var KV=(qr(),Xr(Zr)),GV=KV.__importDefault(PR()),AR;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(AR||(hu.REALTIME_PRESENCE_LISTEN_EVENTS=AR={}));var Jw=class{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new GV.default(this.channel.channelAdapter,r)}};hu.default=Jw});var RR=C(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});Yw.normalizeChannelError=JV;function JV(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 jR=C(e$=>{"use strict";Object.defineProperty(e$,"__esModule",{value:!0});var ka=uu(),Qw=class{constructor(e,r,i){let n=XV(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>ka.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===ka.CHANNEL_STATES.joined}isJoined(){return this.state===ka.CHANNEL_STATES.joined}isJoining(){return this.state===ka.CHANNEL_STATES.joining}isClosed(){return this.state===ka.CHANNEL_STATES.closed}isLeaving(){return this.state===ka.CHANNEL_STATES.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};e$.default=Qw;function XV(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}});var t$=C(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.postgresChangesFilter=Sa.RealtimePostgresFilterBuilder=void 0;var YV=/[,()"\\]/,QV=t=>YV.test(t)||t!==t.trim(),e2=t=>`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,zR=t=>{let e=t===null?"null":String(t);return QV(e)?e2(e):e},t2=t=>t===null?"null":String(t),r2=(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=>zR(n)).join(",")})`}return t==="is"?`is.${t2(e)}`:`${t}.${zR(e)}`},nm=class{constructor(){this.filters=[]}add(e,r,i,n=!1){let o=n?"not.":"";return this.filters.push(`${e}=${o}${r2(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()}};Sa.RealtimePostgresFilterBuilder=nm;var n2=()=>new nm;Sa.postgresChangesFilter=n2});var i$=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 n$=(qr(),Xr(Zr)),rs=uu(),i2=n$.__importDefault(Xw()),CR=n$.__importStar(em()),o2=em(),s2=RR(),a2=n$.__importDefault(jR()),c2=t$(),DR=t$();Object.defineProperty(vr,"RealtimePostgresFilterBuilder",{enumerable:!0,get:function(){return DR.RealtimePostgresFilterBuilder}});Object.defineProperty(vr,"postgresChangesFilter",{enumerable:!0,get:function(){return DR.postgresChangesFilter}});var NR;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(NR||(vr.REALTIME_POSTGRES_CHANGES_LISTEN_EVENT=NR={}));var ns;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(ns||(vr.REALTIME_LISTEN_TYPES=ns={}));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=rs.CHANNEL_STATES;var r$=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 a2.default(this.socket.socketAdapter,e,this.params),this.presence=new i2.default(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=(0,o2.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[ns.PRESENCE]&&this.bindings[ns.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,s2.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:rs.DEFAULT_POSTGRES_CHANGES_WAIT_TIMEOUT)+rs.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=rs.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=rs.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!=rs.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===ns.PRESENCE||e===ns.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 c2.RealtimePostgresFilterBuilder||typeof s=="object"&&s!==null&&typeof s.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:s.build()})),o===ns.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}=rs.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=CR.convertChangeData(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=CR.convertChangeData(e.columns,e.old_record)),r}};vr.default=r$});var UR=C(s$=>{"use strict";Object.defineProperty(s$,"__esModule",{value:!0});var l2=Ww(),LR=uu(),o$=class{constructor(e,r){this.socket=new l2.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()==LR.CONNECTION_STATE.connecting}isDisconnecting(){return this.socket.connectionState()==LR.CONNECTION_STATE.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}};s$.default=o$});var FR=C(c$=>{"use strict";Object.defineProperty(c$,"__esModule",{value:!0});var im=(qr(),Xr(Zr)),u2=im.__importDefault(Uw()),is=uu(),d2=im.__importDefault(xR()),f2=em(),p2=im.__importDefault(i$()),h2=im.__importDefault(UR()),MR={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},m2=[1e3,2e3,5e3,1e4],g2=1e4;function y2(){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 v2(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return y2()}var _2=`
94
+ addEventListener("message", (e) => {
95
+ if (e.data.event === "start") {
96
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
97
+ }
98
+ });`,a$=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 d2.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 h2.default(e,n),this.httpEndpoint=(0,f2.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()||is.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 p2.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:is.DEFAULT_VERSION};o.updateJoinPayload(s),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(is.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([_2],{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:is.DEFAULT_TIMEOUT,h.heartbeatIntervalMs=(o=e?.heartbeatIntervalMs)!==null&&o!==void 0?o:MR.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(s=e?.disconnectOnEmptyChannelsAfterMs)!==null&&s!==void 0?s:2*((a=e?.heartbeatIntervalMs)!==null&&a!==void 0?a:MR.HEARTBEAT_INTERVAL),h.transport=(c=e?.transport)!==null&&c!==void 0?c:u2.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:v2(),h.reconnectAfterMs=(u=e?.reconnectAfterMs)!==null&&u!==void 0?u:(v=>m2[v-1]||g2);let m,g,y=(d=e?.vsn)!==null&&d!==void 0?d:is.DEFAULT_VSN;switch(y){case is.VSN_1_0_0:m=(v,b)=>b(JSON.stringify(v)),g=(v,b)=>b(JSON.parse(v));break;case is.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()}};c$.default=a$});var l$=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 om=(qr(),Xr(Zr)),b2=om.__importDefault(FR());wt.RealtimeClient=b2.default;var os=om.__importStar(i$());wt.RealtimeChannel=os.default;Object.defineProperty(wt,"RealtimePostgresFilterBuilder",{enumerable:!0,get:function(){return os.RealtimePostgresFilterBuilder}});Object.defineProperty(wt,"postgresChangesFilter",{enumerable:!0,get:function(){return os.postgresChangesFilter}});Object.defineProperty(wt,"REALTIME_LISTEN_TYPES",{enumerable:!0,get:function(){return os.REALTIME_LISTEN_TYPES}});Object.defineProperty(wt,"REALTIME_POSTGRES_CHANGES_LISTEN_EVENT",{enumerable:!0,get:function(){return os.REALTIME_POSTGRES_CHANGES_LISTEN_EVENT}});Object.defineProperty(wt,"REALTIME_SUBSCRIBE_STATES",{enumerable:!0,get:function(){return os.REALTIME_SUBSCRIBE_STATES}});Object.defineProperty(wt,"REALTIME_CHANNEL_STATES",{enumerable:!0,get:function(){return os.REALTIME_CHANNEL_STATES}});var ZR=om.__importStar(Xw());wt.RealtimePresence=ZR.default;Object.defineProperty(wt,"REALTIME_PRESENCE_LISTEN_EVENTS",{enumerable:!0,get:function(){return ZR.REALTIME_PRESENCE_LISTEN_EVENTS}});var w2=om.__importDefault(Uw());wt.WebSocketFactory=w2.default});function $2(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 k2(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 S2(t){let e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:i,query:n,body:o,headers:s}){let a=$2(t.baseUrl,i,n),c=await k2(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 mu(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 sm(t){return t.join("")}function xa(t){return t.join("")}var mu,x2,I2,qR,VR=w(()=>{mu=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}};x2=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){let e=t?{parent:sm(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/${sm(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${sm(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${sm(t.namespace)}`}),!0}catch(e){if(e instanceof mu&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof mu&&r.status===409)return;throw r}}};I2=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/${xa(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/${xa(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/${xa(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/${xa(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/${xa(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/${xa(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof mu&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof mu&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},qR=class{constructor(t){let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);let r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=S2({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=t.accessDelegation?.join(","),this.namespaceOps=new x2(this.client,e),this.tableOps=new I2(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 yu(t){"@babel/helpers - typeof";return yu=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},yu(t)}function E2(t,e){if(yu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(yu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function T2(t){var e=E2(t,"string");return yu(e)=="symbol"?e:e+""}function O2(t,e,r){return(e=T2(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function BR(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?BR(Object(r),!0).forEach(function(i){O2(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BR(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function um(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}function am(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 P2(t){let e={};for(let[r,i]of Object.entries(t))e[r.toLowerCase()]=i;return e}async function gu(t,e,r,i,n,o,s){return new Promise((a,c)=>{t(r,C2(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=>z2(l,c,i,s))})}function GR(t="storage"){return{get:async(e,r,i,n)=>gu(e,"GET",r,i,n,void 0,t),post:async(e,r,i,n,o)=>gu(e,"POST",r,n,o,i,t),put:async(e,r,i,n,o)=>gu(e,"PUT",r,n,o,i,t),head:async(e,r,i,n)=>gu(e,"HEAD",r,pe(pe({},i),{},{noResolveJson:!0}),n,void 0,t),remove:async(e,r,i,n,o)=>gu(e,"DELETE",r,n,o,i,t)}}var lm,vu,KR,A2,R2,d$,j2,f$,HR,z2,C2,N2,Ia,Sn,cm,D2,Ea,Vr,Ta,JR,L2,XR,U2,u$,WR,M2,F2,_u,Z2,q2,V2,B2,H2,W2,K2,G2,YR,QR=w(()=>{VR();lm=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}}};vu=class extends lm{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})}},KR=class extends lm{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};A2=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),R2=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)},d$=t=>{if(Array.isArray(t))return t.map(r=>d$(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]=d$(i)}),e},j2=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),f$=t=>t.split("/").map(encodeURIComponent).join("/"),HR=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)},z2=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 vu(HR(s),o,a,i,s?.code))}).catch(()=>{let s=o+"";e(new vu(n.statusText||`HTTP ${o} error`,o,s,i))})}else e(new KR(HR(t),t,i))},C2=(t,e,r,i)=>{let n={method:t,headers:e?.headers||{}};if(t==="GET"||t==="HEAD"||!i)return pe(pe({},n),r);if(R2(i)){var o;let s=e?.headers||{},a;for(let[c,l]of Object.entries(s))c.toLowerCase()==="content-type"&&(a=l);n.headers=am(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)};N2=GR("storage"),{get:Ia,post:Sn,put:cm,head:D2,remove:Ea}=N2,Vr=GR("vectors"),Ta=class{constructor(t,e={},r,i="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=P2(e),this.fetch=A2(r),this.namespace=i}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=am(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(um(r))return{data:null,error:r};throw r}}};JR=Symbol.toStringTag;L2=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[JR]="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(um(e))return{data:null,error:e};throw e}}};XR=Symbol.toStringTag;U2=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[XR]="BlobDownloadBuilder",this.promise=null}asStream(){return new L2(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(um(e))return{data:null,error:e};throw e}}},u$={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},WR={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},M2=class extends Ta{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({},WR),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=am(a,p,f);let l=n._removeEmptyFolders(e),u=n._getFinalPath(l),d=await(t=="PUT"?cm: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({},WR),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=am(u,p,f);return{path:o,fullPath:(await cm(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 lm("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=()=>Ia(this.fetch,`${this.url}/${i}/${s}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new U2(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()=>d$(await Ia(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 D2(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(um(n)){var i;let o=n instanceof vu?n.status:n instanceof KR?(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 Ea(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=f$(i._getFinalPath(t)),o=new URLSearchParams;e?.transformations&&o.set("transformations","true");let s=o.toString();return await Ea(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({},u$.sortBy),e.sortBy):u$.sortBy,o=pe(pe(pe({},u$),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}},F2="2.117.3",_u={"X-Client-Info":`storage-js/${F2}`},Z2=class extends Ta{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({},_u),e);super(o,s,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{let r=e.listBucketOptionsToQueryString(t);return await Ia(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Ia(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 cm(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 Ea(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}async getBucketLifecycle(t){var e=this;return e.handleOperation(async()=>await Ia(e.fetch,e.bucketLifecycleUrl(t),{headers:e.headers}))}async updateBucketLifecycle(t,e){var r=this;return r.handleOperation(async()=>await cm(r.fetch,r.bucketLifecycleUrl(t),e,{headers:r.headers}))}async deleteBucketLifecycle(t){var e=this;return e.handleOperation(async()=>await Ea(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 Ea(i.fetch,`${i.url}/cdn/${f$(t)}${o?`?${o}`:""}`,{},{headers:i.headers},r)})}bucketLifecycleUrl(t){return`${this.url}/bucket/${f$(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():""}},q2=class extends Ta{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},_u),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 Ia(e.fetch,n,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Ea(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!j2(t))throw new lm("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 qR({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}}}}})}},V2=class extends Ta{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},_u),{},{"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})||{})}},B2=class extends Ta{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},_u),{},{"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})||{})}},H2=class extends Ta{constructor(t,e={},r){let i=t.replace(/\/$/,""),n=pe(pe({},_u),{},{"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})||{})}},W2=class extends H2{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new K2(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)}},K2=class extends V2{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 G2(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},G2=class extends B2{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}))}},YR=class extends Z2{constructor(t,e={},r,i){super(t,e,r,i)}from(t){return new M2(this.url,this.headers,t,this.fetch)}get vectors(){return new W2(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new q2(this.url+"/iceberg",this.headers,this.fetch)}}});var p$=C(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.version=void 0;dm.version="2.117.3"});var fm=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 J2=p$();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/${J2.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 ss=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=X2;Ce.isAuthSessionMissingError=Y2;Ce.isAuthImplicitGrantRedirectError=Q2;Ce.isAuthPKCECodeVerifierMissingError=eB;Ce.isAuthRetryableFetchError=tB;Ce.isAuthRefreshDiscardedError=rB;Ce.isAuthWeakPasswordError=nB;var Oa=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=Oa;function Xi(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}var h$=class extends Oa{constructor(e,r,i){super(e,r,i),this.name="AuthApiError",this.status=r,this.code=i}};Ce.AuthApiError=h$;function X2(t){return Xi(t)&&t.name==="AuthApiError"}var m$=class extends Oa{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};Ce.AuthUnknownError=m$;var Br=class extends Oa{constructor(e,r,i,n){super(e,i,n),this.name=r,this.status=i}};Ce.CustomAuthError=Br;var g$=class extends Br{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};Ce.AuthSessionMissingError=g$;function Y2(t){return Xi(t)&&t.name==="AuthSessionMissingError"}var y$=class extends Br{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};Ce.AuthInvalidTokenResponseError=y$;var v$=class extends Br{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};Ce.AuthInvalidCredentialsError=v$;var _$=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=_$;function Q2(t){return Xi(t)&&t.name==="AuthImplicitGrantRedirectError"}var b$=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=b$;var w$=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=w$;function eB(t){return Xi(t)&&t.name==="AuthPKCECodeVerifierMissingError"}var $$=class extends Br{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};Ce.AuthRetryableFetchError=$$;function tB(t){return Xi(t)&&t.name==="AuthRetryableFetchError"}var k$=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=k$;function rB(t){return Xi(t)&&t.name==="AuthRefreshDiscardedError"}var S$=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=S$;function nB(t){return Xi(t)&&t.name==="AuthWeakPasswordError"}var x$=class extends Br{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}};Ce.AuthInvalidJwtError=x$});var hm=C(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.byteToBase64URL=bu;on.byteFromBase64URL=I$;on.stringToBase64URL=oB;on.stringFromBase64URL=sB;on.codepointToUTF8=tj;on.stringToUTF8=E$;on.stringFromUTF8=rj;on.base64UrlToUint8Array=aB;on.stringToUint8Array=cB;on.bytesToBase64URL=lB;var pm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ej=`
99
+ \r=`.split(""),iB=(()=>{let t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<ej.length;e+=1)t[ej[e].charCodeAt(0)]=-2;for(let e=0;e<pm.length;e+=1)t[pm[e].charCodeAt(0)]=e;return t})();function bu(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(pm[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(pm[i]),e.queuedBits-=6}}function I$(t,e,r){let i=iB[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 oB(t){let e=[],r=n=>{e.push(n)},i={queue:0,queuedBits:0};return E$(t,n=>{bu(n,i,r)}),bu(null,i,r),e.join("")}function sB(t){let e=[],r=s=>{e.push(String.fromCodePoint(s))},i={utf8seq:0,codepoint:0},n={queue:0,queuedBits:0},o=s=>{rj(s,i,r)};for(let s=0;s<t.length;s+=1)I$(t.charCodeAt(s),n,o);return e.join("")}function tj(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 E$(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}tj(i,e)}}function rj(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 aB(t){let e=[],r={queue:0,queuedBits:0},i=n=>{e.push(n)};for(let n=0;n<t.length;n+=1)I$(t.charCodeAt(n),r,i);return new Uint8Array(e)}function cB(t){let e=[];return E$(t,r=>e.push(r)),new Uint8Array(e)}function lB(t){let e=[],r={queue:0,queuedBits:0},i=n=>{e.push(n)};return t.forEach(n=>bu(n,r,i)),bu(null,r,i),e.join("")}});var Aa=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=uB;ee.generateCallbackId=dB;ee.parseParametersFromURL=hB;ee.decodeJWT=bB;ee.sleep=wB;ee.retryable=$B;ee.generatePKCEVerifier=oj;ee.generatePKCEChallenge=sj;ee.validatePKCEFlowId=aj;ee.generatePKCEFlowId=cj;ee.storePKCEVerifier=lj;ee.retrievePKCEVerifier=IB;ee.removePKCEVerifier=EB;ee.removeAllPKCEVerifiers=TB;ee.appendFlowIdToRedirectTo=OB;ee.getCodeChallengeAndMethod=PB;ee.parseResponseAPIVersion=RB;ee.validateExp=jB;ee.getAlgorithm=zB;ee.validateUUID=NB;ee.assertRecoveryCodesExperimentalEnabled=DB;ee.userNotAvailableProxy=LB;ee.insecureUserWarningProxy=UB;ee.deepClone=MB;var Pa=fm(),nj=ss(),T$=hm();function uB(t){return Math.round(Date.now()/1e3)+t}function dB(){return Symbol("auth-callback")}var fB=()=>typeof window<"u"&&typeof document<"u";ee.isBrowser=fB;var as={tested:!1,writable:!1},pB=()=>{if(!(0,ee.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(as.tested)return as.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),as.tested=!0,as.writable=!0}catch{as.tested=!0,as.writable=!1}return as.writable};ee.supportsLocalStorage=pB;function hB(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 mB=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);ee.resolveFetch=mB;var gB=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";ee.looksLikeFetchResponse=gB;var yB=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};ee.setItemAsync=yB;var vB=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}};ee.getItemAsync=vB;var _B=async(t,e)=>{await t.removeItem(e)};ee.removeItemAsync=_B;var mm=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};ee.Deferred=mm;mm.promiseConstructor=Promise;function bB(t){let e=t.split(".");if(e.length!==3)throw new nj.AuthInvalidJwtError("Invalid JWT structure");for(let i=0;i<e.length;i++)if(!Pa.BASE64URL_REGEX.test(e[i]))throw new nj.AuthInvalidJwtError("JWT not in base64url format");return{header:JSON.parse((0,T$.stringFromBase64URL)(e[0])),payload:JSON.parse((0,T$.stringFromBase64URL)(e[1])),signature:(0,T$.base64UrlToUint8Array)(e[2]),raw:{header:e[0],payload:e[1]}}}async function wB(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function $B(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 ij(t){return("0"+t.toString(16)).substr(-2)}function oj(){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,ij).join("")}async function kB(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 sj(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 kB(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var SB=/^[a-zA-Z0-9_-]{8,64}$/;function aj(t){return typeof t=="string"&&SB.test(t)?t:null}function cj(){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,ij).join("")}let t="";for(let e=0;e<32;e++)t+=Math.floor(Math.random()*16).toString(16);return t}var xB=(t,e)=>`${t}-flow-${e}-code-verifier`;ee.pkceVerifierSlotKey=xB;var wu=t=>`${t}-flows-code-verifier`;async function O$(t,e){let r=await(0,ee.getItemAsync)(t,wu(e));return Array.isArray(r)?r.filter(i=>aj(i)!==null):[]}async function lj(t,e,r,i,n){await(0,ee.setItemAsync)(t,(0,ee.pkceVerifierSlotKey)(e,r),i);let o=(await O$(t,e)).filter(s=>s!==r);for(o.push(r);o.length>Pa.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,wu(e),o),await(0,ee.setItemAsync)(t,`${e}-code-verifier`,i)}async function IB(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 EB(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 O$(t,e),a=s.filter(c=>c!==r);a.length!==s.length&&(a.length>0?await(0,ee.setItemAsync)(t,wu(e),a):await(0,ee.removeItemAsync)(t,wu(e))),o!=null&&o===await(0,ee.getItemAsync)(t,i)&&await(0,ee.removeItemAsync)(t,i)}async function TB(t,e){let r=await O$(t,e);for(let i of r)await(0,ee.removeItemAsync)(t,(0,ee.pkceVerifierSlotKey)(e,i));await(0,ee.removeItemAsync)(t,wu(e)),await(0,ee.removeItemAsync)(t,`${e}-code-verifier`)}function OB(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!==Pa.PKCE_FLOW_ID_PARAM&&!l.startsWith(`${Pa.PKCE_FLOW_ID_PARAM}=`));i=c.length>0?`${a}?${c.join("&")}`:a}let s=i.includes("?")?"&":"?";return`${i}${s}${Pa.PKCE_FLOW_ID_PARAM}=${encodeURIComponent(e)}${n}`}async function PB(t,e,r=!1,i){let n=oj(),o=n;r&&(o+="/recovery");let s=cj();await lj(t,e,s,o,i);let a=await sj(n);return[a,n===a?"plain":"s256",s]}var AB=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function RB(t){let e=t.headers.get(Pa.API_VERSION_HEADER_NAME);if(!e||!e.match(AB))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function jB(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 zB(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 CB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function NB(t){if(!CB.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function DB(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 LB(){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 UB(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 MB(t){return JSON.parse(JSON.stringify(t))}});var R$=C(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.handleError=A$;Kn._request=qB;Kn._sessionResponse=dj;Kn._sessionResponsePassword=BB;Kn._userResponse=HB;Kn._ssoResponse=WB;Kn._generateLinkResponse=KB;Kn._noResolveJsonResponse=GB;var FB=(qr(),Xr(Zr)),gm=fm(),P$=Aa(),Si=ss(),cs=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)},uj=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function A$(t){var e;if(!(0,P$.looksLikeFetchResponse)(t))throw new Si.AuthRetryableFetchError(cs(t),0);let r;try{r=await t.json()}catch(o){throw uj.includes(t.status)?new Si.AuthRetryableFetchError(t.statusText||`HTTP ${t.status}`,t.status):new Si.AuthUnknownError(cs(o),o)}if(uj.includes(t.status))throw new Si.AuthRetryableFetchError(cs(r),t.status);let i,n=(0,P$.parseResponseAPIVersion)(t);if(n&&n.getTime()>=gm.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(cs(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(cs(r),t.status,r.weak_password.reasons);throw new Si.AuthApiError(cs(r),t.status||500,i)}var ZB=(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 qB(t,e,r,i){var n;let o=Object.assign({},i?.headers);o[gm.API_VERSION_HEADER_NAME]||(o[gm.API_VERSION_HEADER_NAME]=gm.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 VB(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 VB(t,e,r,i,n,o){let s=ZB(e,i,n,o),a;try{a=await t(r,Object.assign({},s))}catch(c){throw new Si.AuthRetryableFetchError(cs(c),0)}if(a.ok||await A$(a),i?.noResolveJson)return a;try{return await a.json()}catch(c){await A$(c)}}function dj(t){var e;let r=null;JB(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,P$.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 BB(t){let e=dj(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 HB(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function WB(t){return{data:t,error:null}}function KB(t){let{action_link:e,email_otp:r,hashed_token:i,redirect_to:n,verification_type:o}=t,s=FB.__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 GB(t){return t}function JB(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}});var j$=C(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.SIGN_OUT_SCOPES=void 0;ym.SIGN_OUT_SCOPES=["global","local","others"]});var vm=C(N$=>{"use strict";Object.defineProperty(N$,"__esModule",{value:!0});var XB=(qr(),Xr(Zr)),Ye=R$(),Gn=Aa(),z$=j$(),It=ss(),C$=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=z$.SIGN_OUT_SCOPES[0]){if(z$.SIGN_OUT_SCOPES.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${z$.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=XB.__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}}};N$.default=C$});var fj=C(D$=>{"use strict";Object.defineProperty(D$,"__esModule",{value:!0});D$.memoryLocalStorageAdapter=YB;function YB(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}});var L$=C(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.ProcessLockAcquireTimeoutError=Rt.NavigatorLockAcquireTimeoutError=Rt.LockAcquireTimeoutError=Rt.internals=void 0;Rt.navigatorLock=eH;Rt.processLock=tH;var QB=Aa();Rt.internals={debug:!!(globalThis&&(0,QB.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var ls=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Rt.LockAcquireTimeoutError=ls;var $u=class extends ls{};Rt.NavigatorLockAcquireTimeoutError=$u;var _m=class extends ls{};Rt.ProcessLockAcquireTimeoutError=_m;async function eH(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 $u(`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 $u(`Lock "${t}" was released because another request stole it`)}throw o}}var pj={};async function tH(t,e,r){var i;let n=(i=pj[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 _m(`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 ls)throw c}return await r()})();return pj[t]=(async()=>{try{return await s}catch(a){if(a instanceof ls){try{await n}catch{}return null}throw a}})(),await s}});var hj=C(U$=>{"use strict";Object.defineProperty(U$,"__esModule",{value:!0});U$.polyfillGlobalThis=rH;function rH(){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 gj=C(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.getAddress=mj;Ra.fromHex=nH;Ra.toHex=iH;Ra.createSiweMessage=oH;function mj(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function nH(t){return parseInt(t,16)}function iH(t){let e=new TextEncoder().encode(t);return"0x"+Array.from(e,i=>i.toString(16).padStart(2,"0")).join("")}function oH(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=mj(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 vj=C(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.WebAuthnUnknownError=xi.WebAuthnError=void 0;xi.isWebAuthnError=sH;xi.identifyRegistrationError=aH;xi.identifyAuthenticationError=cH;var yj=F$(),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 M$=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=M$;function sH(t){return typeof t=="object"&&t!==null&&"__isWebAuthnError"in t}function aH({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,yj.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 cH({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,yj.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 F$=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=uH;We.deserializeCredentialRequestOptions=dH;We.serializeCredentialCreationResponse=fH;We.serializeCredentialRequestResponse=pH;We.isValidDomain=hH;We.browserSupportsWebAuthn=Z$;We.createCredential=bj;We.getCredential=wj;We.mergeCredentialCreationOptions=$j;We.mergeCredentialRequestOptions=kj;var _j=(qr(),Xr(Zr)),xn=hm(),Jn=ss(),lH=Aa(),Xn=vj();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 bm=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=bm;We.webAuthnAbortService=new bm;function uH(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=_j.__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 dH(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=_j.__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 fH(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 pH(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 hH(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Z$(){var t,e;return!!((0,lH.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 bj(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 wj(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 wm(...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]=wm(a,s):i[o]=wm(s)}else i[o]=s}return i}function $j(t,e){return wm(We.DEFAULT_CREATION_OPTIONS,t,e||{})}function kj(t,e){return wm(We.DEFAULT_REQUEST_OPTIONS,t,e||{})}var q$=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=$j(a.webauthn.credential_options.publicKey,o?.create),{data:d,error:p}=await bj({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=kj(a.webauthn.credential_options.publicKey,o?.request),{data:d,error:p}=await wj(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(!Z$())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(!Z$())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=q$});var B$=C(V$=>{"use strict";Object.defineProperty(V$,"__esModule",{value:!0});var mH=(qr(),Xr(Zr)),gH=mH.__importDefault(vm()),Tt=fm(),L=ss(),re=R$(),V=Aa(),Sj=fj(),yH=L$(),vH=hj(),_H=p$(),xj=hm(),$m=gj(),_r=F$();(0,vH.polyfillGlobalThis)();var bH={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:{}},ja={},Ij=!1,km=class t{get jwks(){var e,r;return(r=(e=ja[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){ja[this.storageKey]=Object.assign(Object.assign({},ja[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=ja[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){ja[this.storageKey]=Object.assign(Object.assign({},ja[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({},bH),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 gH.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,Ij||(Ij=!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,Sj.memoryLocalStorageAdapter)(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=(0,Sj.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} (${_H.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 E=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 I=(0,$m.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,$m.fromHex)(le)}let X={domain:E.host,address:I,statement:y,uri:E.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,$m.createSiweMessage)(X),h=await b.request({method:"personal_sign",params:[(0,$m.toHex)(f),I]})}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,E;if((0,V.isBrowser)())if(typeof y=="object")E=y;else{let I=window;if("solana"in I&&typeof I.solana=="object"&&("signIn"in I.solana&&typeof I.solana.signIn=="function"||"signMessage"in I.solana&&typeof I.solana.signMessage=="function"))E=I.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.");E=y}let k=new URL((r=b?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in E&&E.signIn){let I=await E.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(I)&&I[0]&&typeof I[0]=="object")O=I[0];else if(I&&typeof I=="object"&&"signedMessage"in I&&"signature"in I)O=I;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 E)||typeof E.signMessage!="function"||!("publicKey"in E)||typeof E!="object"||!E.publicKey||!("toBase58"in E.publicKey)||typeof E.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:`,E.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 I=await E.signMessage(new TextEncoder().encode(h),"utf8");if(!I||!(I instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=I}}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,xj.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:E}=await this._exchangeCodeForSession(e.code,{flowId:e[Tt.PKCE_FLOW_ID_PARAM]});if(E)throw E;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 yH.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(E=>E.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,xj.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}}};km.nextInstanceID={};V$.default=km});var Ej=C(H$=>{"use strict";Object.defineProperty(H$,"__esModule",{value:!0});var wH=(qr(),Xr(Zr)),$H=wH.__importDefault(vm()),kH=$H.default;H$.default=kH});var Tj=C(W$=>{"use strict";Object.defineProperty(W$,"__esModule",{value:!0});var SH=(qr(),Xr(Zr)),xH=SH.__importDefault(B$()),IH=xH.default;W$.default=IH});var K$=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 za=(qr(),Xr(Zr)),EH=za.__importDefault(vm());Ut.GoTrueAdminApi=EH.default;var TH=za.__importDefault(B$());Ut.GoTrueClient=TH.default;var OH=za.__importDefault(Ej());Ut.AuthAdminApi=OH.default;var PH=za.__importDefault(Tj());Ut.AuthClient=PH.default;za.__exportStar(j$(),Ut);za.__exportStar(ss(),Ut);var Sm=L$();Object.defineProperty(Ut,"navigatorLock",{enumerable:!0,get:function(){return Sm.navigatorLock}});Object.defineProperty(Ut,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Sm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(Ut,"lockInternals",{enumerable:!0,get:function(){return Sm.internals}});Object.defineProperty(Ut,"processLock",{enumerable:!0,get:function(){return Sm.processLock}})});var N={};Jr(N,{FunctionRegion:()=>sn.FunctionRegion,FunctionsError:()=>sn.FunctionsError,FunctionsFetchError:()=>sn.FunctionsFetchError,FunctionsHttpError:()=>sn.FunctionsHttpError,FunctionsRelayError:()=>sn.FunctionsRelayError,PostgrestError:()=>Ji,StorageApiError:()=>vu,SupabaseClient:()=>Mj,createClient:()=>Tm});function LH(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 UH(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(MH(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 MH(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 FH(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 Su(t){"@babel/helpers - typeof";return Su=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},Su(t)}function ZH(t,e){if(Su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(Su(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qH(t){var e=ZH(t,"string");return Su(e)=="symbol"?e:e+""}function VH(t,e,r){return(e=qH(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oj(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?Oj(Object(r),!0).forEach(function(i){VH(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Oj(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function GH(t,e,r){let i=jA();if(!i)return Rj||(Rj=!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(!UH(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&&!jj){jj=!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=LH(n.traceparent);if(s&&!s.isSampled)return{traceparent:n.traceparent}}return n}function zj(t){return typeof t=="boolean"?{enabled:t}:t}function JH(t){return t.endsWith("/")?t:t+"/"}function XH(t){Cj||typeof t!="object"||t===null||!("schema"in t)||t.schema===void 0||(Cj=!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 YH(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=zj(t.tracePropagation),y=zj(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 QH(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(JH(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}function t9(){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,Nj,Dj,AH,ku,Em,xm,Im,Lj,RH,jH,zH,CH,NH,DH,BH,HH,Uj,WH,Pj,KH,Aj,Rj,jj,Cj,e9,Mj,Tm,Fj=w(()=>{zA();sn=So(dR(),1);$R();Nj=So(l$(),1);QR();Dj=So(K$(),1);D(N,So(l$(),1));D(N,So(K$(),1));AH="2.117.3",ku="";if(typeof Deno<"u")ku="deno",Em=(xm=Deno.version)===null||xm===void 0?void 0:xm.deno;else if(typeof document<"u")ku="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")ku="react-native";else{ku="node";let t=globalThis.process;Em=t==null||(Im=t.version)===null||Im===void 0?void 0:Im.replace(/^v/,"")}Lj=[`runtime=${ku}`];Em&&Lj.push(`runtime-version=${Em}`);RH={"X-Client-Info":`supabase-js/${AH}; ${Lj.join("; ")}`},jH={headers:RH},zH={schema:"public"},CH={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},NH={},DH={enabled:!1,respectSamplingDecision:!0};BH=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),HH=()=>Headers,Uj=t=>t.startsWith("sb_publishable_")||t.startsWith("sb_secret_"),WH="sb_temp_",Pj=new Set,KH=t=>{var e,r;if(!t.startsWith("sb_")||Uj(t)||t.startsWith(WH))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";Pj.has(i)||(Pj.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."))},Aj=(t,e,r,i,n,o)=>{let s=BH(i),a=HH(),c=n?.enabled===!0,l=n?.respectSamplingDecision!==!1,u=c?FH(e):null,d=!(o?.omitApiKeyAsBearer&&Uj(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=GH(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}))}},Rj=!1,jj=!1;Cj=!1;e9=class extends Dj.AuthClient{constructor(t){super(t)}},Mj=class{constructor(t,e,r){var i,n;this.supabaseUrl=t,this.supabaseKey=e;let o=QH(t);if(!e)throw new Error("supabaseKey is required.");KH(e),XH(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:zH,realtime:NH,auth:jt(jt({},CH),{},{storageKey:s}),global:jH,tracePropagation:DH},c=YH(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=Aj(e,t,this._getSessionToken.bind(this),c.global.fetch,c.tracePropagation),this.functionsFetch=Aj(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 bR(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 YR(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 e9({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 Nj.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)}},Tm=(t,e,r)=>new Mj(t,e,r);t9()&&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 r9,existsSync as G$,mkdirSync as qj,readFileSync as Vj,rmSync as n9,writeFileSync as Bj}from"node:fs";import{homedir as i9}from"node:os";import{join as Om}from"node:path";function Na(){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=Om(xu,"service.json");if(G$(e))return JSON.parse(Vj(e,"utf8"));throw new Error("the CoDesignFlo service isn't configured yet (set CODESIGNFLO_SERVICE_URL and CODESIGNFLO_SERVICE_ANON)")}function J$(t){qj(xu,{recursive:!0}),Bj(Om(xu,"service.json"),`${JSON.stringify(t,null,2)}
116
+ `)}function Iu(t,e){qj(xu,{recursive:!0}),Bj(Ca,JSON.stringify({refresh_token:t,user:e},null,2)),r9(Ca,384)}function Hj(){n9(Ca,{force:!0})}function Wj(t,e){return Zj??=(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}})(),Zj}async function Kj(){let{CODESIGNFLO_TICKET:t,CODESIGNFLO_MCP:e}=process.env;return t&&e?(await Wj(t,e)).project:null}async function an(){let{CODESIGNFLO_TICKET:t,CODESIGNFLO_MCP:e}=process.env,r=t&&e?(await Wj(t,e)).token:process.env.CODESIGNFLO_TOKEN;if(r){let a=Na(),c=Tm(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(!G$(Ca))throw new Error("not signed in \u2014 run: codesignflo login");let i=JSON.parse(Vj(Ca,"utf8")),n=X$(),{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 Iu(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 xu,Ca,X$,Pm,Zj,Da=w(()=>{"use strict";Fj();xu=Om(i9(),".codesignflo"),Ca=Om(xu,"session.json");X$=(t=Na())=>Tm(t.url,t.anon,{auth:{persistSession:!1,autoRefreshToken:!1}});Pm=()=>G$(Ca),Zj=null});import{existsSync as La,mkdirSync as Q$,readdirSync as Gj,readFileSync as Rm,renameSync as o9,writeFileSync as ek}from"node:fs";import{join as us,resolve as Jj}from"node:path";async function Yj(t){let e=In(t);if(!e?.cloud)return;let{client:r}=await an(),i=await Kj();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(s9).filter(c=>c!==null)),(s??[]).length<1e3)break}Mt={projectId:e.projectId,events:n,pending:[],client:r}}async function Qj(){if(!Mt?.pending.length)return;let t=Mt.pending.map(r=>Xj(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 ez(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=>Xj(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=tz(t);return La(e)?JSON.parse(Rm(e,"utf8")):null}function tk(t,e){Q$(gt(e),{recursive:!0}),ek(tz(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=rz(t);return La(e)?Rm(e,"utf8").split(`
118
+ `).filter(Boolean).map(r=>qh(JSON.parse(r))).filter(r=>r!==null):[]}function En(t,e){let r=new Set(Ct(e).map(n=>n.id)),i=eu(t.filter(n=>!r.has(n.id)));return Mt?(Mt.events.push(...i),Mt.pending.push(...i),i):(i.length&&(Q$(gt(e),{recursive:!0}),ek(rz(e),i.map(n=>`${JSON.stringify(n)}
119
+ `).join(""),{flag:"a"})),i)}async function Eu(t,e){let r=`${t}@${e}`;if(Am.has(r))return Am.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&&La(Y$(t,e))&&(i=JSON.parse(Rm(Y$(t,e),"utf8"))),Am.set(r,i),i}async function nz(t,e,r){if(Am.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}Q$(us(gt(),"snapshots",t),{recursive:!0}),ek(Y$(t,e),Bn(r))}async function iz(t,e,r){let i=us(gt(r),"snapshots");if(!La(i))return 0;let n=0;for(let o of Gj(i))for(let s of Gj(us(i,o)).filter(a=>a.endsWith(".json"))){let a=JSON.parse(Rm(us(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,Xj,s9,ds,gt,tz,rz,Y$,Am,sr=w(()=>{"use strict";Pr();Da();Mt=null,Xj=(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}},s9=t=>qh({...t.body,id:t.id,at:t.at,by:t.by,component:t.component,kind:t.kind});ds=()=>Mt?{client:Mt.client,projectId:Mt.projectId}:null;gt=(t=process.cwd())=>{let e=Jj(t,".codesignflo"),r=Jj(t,".codesignloop");return!La(e)&&La(r)&&o9(r,e),e},tz=t=>us(gt(t),"config.json"),rz=t=>us(gt(t),"events.jsonl");Y$=(t,e,r)=>us(gt(r),"snapshots",t,`${e}.json`),Am=new Map});var Le,vC,J,Ti,Cu=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})})(vC||(vC={}));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,Zm=w(()=>{Cu();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 TW,Qi,$k=w(()=>{Zm();Cu();TW=(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}},Qi=TW});function Nu(){return OW}var OW,qm=w(()=>{$k();OW=Qi});function H(t,e){let r=Nu(),i=Vm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Qi?void 0:Qi].filter(n=>!!n)});t.common.issues.push(i)}var Vm,ar,me,Fa,br,kk,Sk,fs,Du,xk=w(()=>{qm();$k();Vm=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"}),Fa=t=>({status:"dirty",value:t}),br=t=>({status:"valid",value:t}),kk=t=>t.status==="aborted",Sk=t=>t.status==="dirty",fs=t=>t.status==="valid",Du=t=>typeof Promise<"u"&&t instanceof Promise});var _C=w(()=>{});var ne,bC=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 kC(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 HW(t){return new RegExp(`^${kC(t)}$`)}function WW(t){let e=`${$C}T${kC(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 KW(t,e){return!!((e==="v4"||!e)&&UW.test(t)||(e==="v6"||!e)&&FW.test(t))}function GW(t,e){if(!CW.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 JW(t,e){return!!((e==="v4"||!e)&&MW.test(t)||(e==="v6"||!e)&&ZW.test(t))}function XW(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 Za(t){if(t instanceof Wr){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=On.create(Za(i))}return new Wr({...t._def,shape:()=>e})}else return t instanceof to?new to({...t._def,type:Za(t.element)}):t instanceof On?On.create(Za(t.unwrap())):t instanceof Ai?Ai.create(Za(t.unwrap())):t instanceof Pi?Pi.create(t.items.map(e=>Za(e))):t}function Tk(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=Tk(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=Tk(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 SC(t,e){return new Ja({values:t,typeName:Z.ZodEnum,...ke(e)})}var cn,wC,Oe,PW,AW,RW,jW,zW,CW,NW,DW,LW,Ik,UW,MW,FW,ZW,qW,VW,$C,BW,qa,Lu,Uu,Mu,Fu,Zu,Va,Ba,qu,eo,Qn,Vu,to,Wr,Ha,Oi,Ek,Wa,Pi,Ok,Bu,Hu,Pk,Ka,Ga,Ja,Xa,ps,Pn,On,Ai,Ya,Qa,Wu,Iae,Bm,Hm,ec,Eae,Z,Tae,Oae,Pae,Aae,Rae,jae,zae,Cae,Nae,Dae,Lae,Uae,Mae,Fae,xC,Zae,qae,Vae,Bae,Hae,Wae,Kae,Gae,Jae,Xae,Yae,Qae,ece,tce,rce,nce,ice,oce,sce,IC=w(()=>{Zm();qm();bC();xk();Cu();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}},wC=(t,e)=>{if(fs(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(Du(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 wC(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 fs(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=>fs(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(Du(n)?n:Promise.resolve(n));return wC(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 to.create(this)}promise(){return ps.create(this,this._def)}or(e){return Ha.create([this,e],this._def)}and(e){return Wa.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 Ya({...ke(this._def),innerType:this,defaultValue:r,typeName:Z.ZodDefault})}brand(){return new Bm({typeName:Z.ZodBranded,type:this,...ke(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Qa({...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 Hm.create(this,e)}readonly(){return ec.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},PW=/^c[^\s-]{8,}$/i,AW=/^[0-9a-z]+$/,RW=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jW=/^[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,zW=/^[a-z0-9_-]{21}$/i,CW=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,NW=/^[-+]?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)?)??$/,DW=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LW="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",UW=/^(?:(?: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])$/,MW=/^(?:(?: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])$/,FW=/^(([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]))$/,ZW=/^(([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])$/,qW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VW=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$C="((\\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])))",BW=new RegExp(`^${$C}$`);qa=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")DW.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")Ik||(Ik=new RegExp(LW,"u")),Ik.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")jW.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")zW.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")PW.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")AW.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")RW.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"?WW(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"?BW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:F.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?HW(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"?NW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"duration",code:F.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?KW(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"?GW(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"?JW(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"?qW.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64",code:F.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?VW.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}};qa.create=t=>new qa({checks:[],typeName:Z.ZodString,coerce:t?.coerce??!1,...ke(t)});Lu=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"?XW(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)}};Lu.create=t=>new Lu({checks:[],typeName:Z.ZodNumber,coerce:t?.coerce||!1,...ke(t)});Uu=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}};Uu.create=t=>new Uu({checks:[],typeName:Z.ZodBigInt,coerce:t?.coerce??!1,...ke(t)});Mu=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)}};Mu.create=t=>new Mu({typeName:Z.ZodBoolean,coerce:t?.coerce||!1,...ke(t)});Fu=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}};Fu.create=t=>new Fu({checks:[],coerce:t?.coerce||!1,typeName:Z.ZodDate,...ke(t)});Zu=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)}};Zu.create=t=>new Zu({typeName:Z.ZodSymbol,...ke(t)});Va=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)}};Va.create=t=>new Va({typeName:Z.ZodUndefined,...ke(t)});Ba=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)}};Ba.create=t=>new Ba({typeName:Z.ZodNull,...ke(t)});qu=class extends Oe{constructor(){super(...arguments),this._any=!0}_parse(e){return br(e.data)}};qu.create=t=>new qu({typeName:Z.ZodAny,...ke(t)});eo=class extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return br(e.data)}};eo.create=t=>new eo({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)});Vu=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)}};Vu.create=t=>new Vu({typeName:Z.ZodVoid,...ke(t)});to=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)}};to.create=(t,e)=>new to({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 Za(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 SC(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)});Ha=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}};Ha.create=(t,e)=>new Ha({options:t,typeName:Z.ZodUnion,...ke(e)});Oi=t=>t instanceof Ka?Oi(t.schema):t instanceof Pn?Oi(t.innerType()):t instanceof Ga?[t.value]:t instanceof Ja?t.options:t instanceof Xa?Le.objectValues(t.enum):t instanceof Ya?Oi(t._def.innerType):t instanceof Va?[void 0]:t instanceof Ba?[null]:t instanceof On?[void 0,...Oi(t.unwrap())]:t instanceof Ai?[null,...Oi(t.unwrap())]:t instanceof Bm||t instanceof ec?Oi(t.unwrap()):t instanceof Qa?Oi(t._def.innerType):[],Ek=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)})}};Wa=class extends Oe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(o,s)=>{if(kk(o)||kk(s))return me;let a=Tk(o.value,s.value);return a.valid?((Sk(o)||Sk(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}))}};Wa.create=(t,e,r)=>new Wa({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)})};Ok=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:qa.create(),valueType:e,typeName:Z.ZodRecord,...ke(r)})}},Bu=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}}}};Bu.create=(t,e,r)=>new Bu({valueType:e,keyType:t,typeName:Z.ZodMap,...ke(r)});Hu=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)}};Hu.create=(t,e)=>new Hu({valueType:t,minSize:null,maxSize:null,typeName:Z.ZodSet,...ke(e)});Pk=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 Vm({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Nu(),Qi].filter(l=>!!l),issueData:{code:F.invalid_arguments,argumentsError:c}})}function n(a,c){return Vm({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Nu(),Qi].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 ps){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(eo.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(eo.create()),returns:r||eo.create(),typeName:Z.ZodFunction,...ke(i)})}},Ka=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})}};Ka.create=(t,e)=>new Ka({getter:t,typeName:Z.ZodLazy,...ke(e)});Ga=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}};Ga.create=(t,e)=>new Ga({value:t,typeName:Z.ZodLiteral,...ke(e)});Ja=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})}};Ja.create=SC;Xa=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}};Xa.create=(t,e)=>new Xa({values:t,typeName:Z.ZodNativeEnum,...ke(e)});ps=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})))}};ps.create=(t,e)=>new ps({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"?Fa(c.value):r.value==="dirty"?Fa(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"?Fa(a.value):r.value==="dirty"?Fa(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(!fs(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=>fs(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)});Ya=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}};Ya.create=(t,e)=>new Ya({innerType:t,typeName:Z.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ke(e)});Qa=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 Du(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}};Qa.create=(t,e)=>new Qa({innerType:t,typeName:Z.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ke(e)});Wu=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}}};Wu.create=t=>new Wu({typeName:Z.ZodNaN,...ke(t)});Iae=Symbol("zod_brand"),Bm=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}},Hm=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(),Fa(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})}},ec=class extends Oe{_parse(e){let r=this._def.innerType._parse(e),i=n=>(fs(n)&&(n.value=Object.freeze(n.value)),n);return Du(r)?r.then(n=>i(n)):i(r)}unwrap(){return this._def.innerType}};ec.create=(t,e)=>new ec({innerType:t,typeName:Z.ZodReadonly,...ke(e)});Eae={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={}));Tae=qa.create,Oae=Lu.create,Pae=Wu.create,Aae=Uu.create,Rae=Mu.create,jae=Fu.create,zae=Zu.create,Cae=Va.create,Nae=Ba.create,Dae=qu.create,Lae=eo.create,Uae=Qn.create,Mae=Vu.create,Fae=to.create,xC=Wr.create,Zae=Wr.strictCreate,qae=Ha.create,Vae=Ek.create,Bae=Wa.create,Hae=Pi.create,Wae=Ok.create,Kae=Bu.create,Gae=Hu.create,Jae=Pk.create,Xae=Ka.create,Yae=Ga.create,Qae=Ja.create,ece=Xa.create,tce=ps.create,rce=Pn.create,nce=On.create,ice=Ai.create,oce=Pn.createWithPreprocess,sce=Hm.create});var EC=w(()=>{qm();xk();_C();Cu();IC();Zm()});var Ku=w(()=>{EC()});var Ak=w(()=>{uw()});function ei(t){return!!t._zod}function hs(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 xC(t);throw new Error("Mixed Zod versions detected in object shape.")}function ro(t,e){return ei(t)?Ws(t,e):t.safeParse(e)}async function Wm(t,e){return ei(t)?await Gs(t,e):await t.safeParseAsync(e)}function no(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 tc(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 hs(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 QW(t){return t.length===0?"object root":t.reduce((e,r,i)=>i===0?String(r):typeof r=="number"?`${e}[${r}]`:`${e}.${r}`,"")}function Km(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 ${QW(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 OC(t){return t.description}function PC(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 rc(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 Gu=w(()=>{Ku();Ak()});var Gm={};Jr(Gm,{endsWith:()=>Vo,gt:()=>bn,gte:()=>gr,includes:()=>Zo,length:()=>Vi,lowercase:()=>Mo,lt:()=>_n,lte:()=>mr,maxLength:()=>qi,maxSize:()=>_i,mime:()=>Ho,minLength:()=>Or,minSize:()=>wn,multipleOf:()=>vi,negative:()=>Bl,nonnegative:()=>Wl,nonpositive:()=>Hl,normalize:()=>Wo,overwrite:()=>rn,positive:()=>Vl,properties:()=>Bo,property:()=>Kl,regex:()=>Uo,size:()=>Zi,slugify:()=>da,startsWith:()=>qo,toLowerCase:()=>Go,toUpperCase:()=>Jo,trim:()=>Ko,uppercase:()=>Fo});var Jm=w(()=>{Xt()});function Xm(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 AC,RC,eK,zr,Rk=w(()=>{Xt();Xt();B();AC=new WeakSet([Object.prototype,Error.prototype]);RC=(t,e)=>{Cv.init(t,e),t.name="ZodError";let r=Object.getPrototypeOf(t);AC.has(r)||(AC.add(r),Xm(r,"format",i=>n=>Kc(i,n)),Xm(r,"flatten",i=>n=>Wc(i,n)),Xm(r,"addIssue",i=>n=>{i.issues.push(n),i.message=JSON.stringify(i.issues,Us,2)}),Xm(r,"addIssues",i=>n=>{i.issues.push(...n),i.message=JSON.stringify(i.issues,Us,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},eK=$("ZodError",RC),zr=$("ZodError",RC,void 0,{Parent:Error})});var jk,zk,Ck,Nk,Dk,Lk,Uk,Mk,Fk,Zk,qk,Vk,Bk=w(()=>{Xt();Rk();Xt();jk=Vs(zr),zk=Bs(zr),Ck=Hs(zr),Nk=Ks(zr),Dk=wf(zr),Lk=$f(zr),Uk=kf(zr),Mk=Sf(zr),Fk=xf(zr),Zk=If(zr),qk=Ef(zr),Vk=Tf(zr)});var uc={};Jr(uc,{ZodAny:()=>Yk,ZodArray:()=>r0,ZodBase64:()=>hg,ZodBase64URL:()=>mg,ZodBigInt:()=>cc,ZodBigIntFormat:()=>vg,ZodBoolean:()=>ac,ZodCIDRv4:()=>fg,ZodCIDRv6:()=>pg,ZodCUID:()=>og,ZodCUID2:()=>sg,ZodCatch:()=>w0,ZodCodec:()=>id,ZodCreditCard:()=>Wk,ZodCustom:()=>od,ZodCustomStringFormat:()=>gs,ZodDate:()=>Qu,ZodDefault:()=>m0,ZodDiscriminatedUnion:()=>i0,ZodE164:()=>gg,ZodEmail:()=>tg,ZodEmoji:()=>ng,ZodEnum:()=>ic,ZodExactOptional:()=>wg,ZodFile:()=>d0,ZodFunction:()=>A0,ZodGUID:()=>rg,ZodIBAN:()=>Kk,ZodIPv4:()=>ug,ZodIPv6:()=>dg,ZodISODate:()=>oo,ZodISODateTime:()=>io,ZodISODuration:()=>ao,ZodISOTime:()=>so,ZodInstanceOf:()=>z0,ZodIntersection:()=>o0,ZodJWT:()=>yg,ZodKSUID:()=>lg,ZodLazy:()=>T0,ZodLiteral:()=>u0,ZodMAC:()=>Hk,ZodMap:()=>c0,ZodNaN:()=>k0,ZodNanoID:()=>ig,ZodNever:()=>e0,ZodNonOptional:()=>$g,ZodNull:()=>Xk,ZodNullable:()=>h0,ZodNumber:()=>sc,ZodNumberFormat:()=>ys,ZodObject:()=>ed,ZodOptional:()=>vs,ZodPipe:()=>nd,ZodPrefault:()=>y0,ZodPreprocess:()=>S0,ZodPromise:()=>P0,ZodReadonly:()=>x0,ZodRecord:()=>nc,ZodSet:()=>l0,ZodString:()=>oc,ZodStringFormat:()=>st,ZodSuccess:()=>b0,ZodSymbol:()=>Gk,ZodTemplateLiteral:()=>E0,ZodTransform:()=>f0,ZodTuple:()=>s0,ZodType:()=>Se,ZodULID:()=>ag,ZodURL:()=>Xu,ZodUUID:()=>ti,ZodUndefined:()=>Jk,ZodUnion:()=>td,ZodUnknown:()=>Qk,ZodVoid:()=>t0,ZodXID:()=>cg,ZodXor:()=>n0,_ZodString:()=>eg,_default:()=>g0,_function:()=>LN,any:()=>_N,array:()=>Pe,base64:()=>QC,base64url:()=>eN,bigint:()=>hN,boolean:()=>Nt,catch:()=>$0,check:()=>UN,cidrv4:()=>XC,cidrv6:()=>YC,codec:()=>zN,creditCard:()=>rN,cuid:()=>qC,cuid2:()=>VC,currencyCode:()=>cN,custom:()=>kg,date:()=>wN,describe:()=>MN,discriminatedUnion:()=>rd,e164:()=>tN,email:()=>jC,emoji:()=>FC,enum:()=>er,exactOptional:()=>p0,file:()=>PN,float32:()=>uN,float64:()=>dN,function:()=>LN,guid:()=>zC,hash:()=>lN,hex:()=>aN,hostname:()=>sN,httpUrl:()=>MC,iban:()=>nN,instanceof:()=>ZN,int:()=>Ym,int32:()=>fN,int64:()=>mN,intersection:()=>lc,invertCodec:()=>CN,ipv4:()=>KC,ipv6:()=>JC,json:()=>VN,jwt:()=>iN,keyof:()=>$N,ksuid:()=>WC,lazy:()=>O0,literal:()=>se,looseObject:()=>Qt,looseRecord:()=>IN,mac:()=>GC,map:()=>EN,meta:()=>FN,nan:()=>jN,nanoid:()=>ZC,nativeEnum:()=>ON,never:()=>_g,nonoptional:()=>_0,null:()=>Yu,nullable:()=>Ju,nullish:()=>AN,number:()=>Ke,object:()=>K,optional:()=>ot,partialRecord:()=>xN,pipe:()=>Qm,prefault:()=>v0,preprocess:()=>sd,promise:()=>DN,readonly:()=>I0,record:()=>at,refine:()=>R0,set:()=>TN,strictObject:()=>kN,string:()=>P,stringFormat:()=>oN,stringbool:()=>qN,success:()=>RN,superRefine:()=>j0,symbol:()=>yN,templateLiteral:()=>NN,transform:()=>bg,tuple:()=>a0,uint32:()=>pN,uint64:()=>gN,ulid:()=>BC,undefined:()=>vN,union:()=>rt,unknown:()=>ct,url:()=>UC,uuid:()=>CC,uuidv4:()=>NC,uuidv6:()=>DC,uuidv7:()=>LC,void:()=>bN,xid:()=>HC,xor:()=>SN});function rK(){Wt.localeError||Pt(nh())}function ms(){Wt.memoizer||Pt({memoizer:pl()})}function P(t){return gl(oc,t)}function jC(t){return yl(tg,t)}function zC(t){return vl(rg,t)}function CC(t){return _l(ti,t)}function NC(t){return bl(ti,t)}function DC(t){return wl(ti,t)}function LC(t){return $l(ti,t)}function UC(t){return ua(Xu,t)}function MC(t){return ua(Xu,{protocol:Gc,hostname:s_,...A.normalizeParams(t)})}function FC(t){return kl(ng,t)}function ZC(t){return Sl(ig,t)}function qC(t){return xl(og,t)}function VC(t){return Il(sg,t)}function BC(t){return El(ag,t)}function HC(t){return Tl(cg,t)}function WC(t){return Ol(lg,t)}function KC(t){return Pl(ug,t)}function GC(t){return fh(Hk,t)}function JC(t){return Al(dg,t)}function XC(t){return Rl(fg,t)}function YC(t){return jl(pg,t)}function QC(t){return zl(hg,t)}function eN(t){return Cl(mg,t)}function tN(t){return Nl(gg,t)}function rN(t){return ph(Wk,t)}function nN(t){return hh(Kk,t)}function iN(t){return Dl(yg,t)}function oN(t,e,r={}){return Bi(gs,t,e,r)}function sN(t){return Bi(gs,"hostname",o_,t)}function aN(t){return Bi(gs,"hex",b_,t)}function cN(t){return Bi(gs,"currency_code",c_,t)}function lN(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=Fr[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Bi(gs,i,n,e)}function Ke(t){return Zl(sc,t)}function Ym(t){return mh(ys,t)}function uN(t){return gh(ys,t)}function dN(t){return yh(ys,t)}function fN(t){return vh(ys,t)}function pN(t){return _h(ys,t)}function Nt(t){return ql(ac,t)}function hN(t){return bh(cc,t)}function mN(t){return wh(vg,t)}function gN(t){return $h(vg,t)}function yN(t){return kh(Gk,t)}function vN(t){return Sh(Jk,t)}function Yu(t){return xh(Xk,t)}function _N(){return Ih(Yk)}function ct(){return Eh(Qk)}function _g(t){return Th(e0,t)}function bN(t){return Oh(t0,t)}function wN(t){return Ph(Qu,t)}function Pe(t,e){return _b(r0,t,e)}function $N(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 ed(r)}function kN(t,e){return new ed({type:"object",shape:t,catchall:_g(),...A.normalizeParams(e)})}function Qt(t,e){return new ed({type:"object",shape:t,catchall:ct(),...A.normalizeParams(e)})}function rt(t,e){return new td({type:"union",options:t,...A.normalizeParams(e)})}function SN(t,e){return new n0({type:"union",options:t,inclusive:!1,...A.normalizeParams(e)})}function rd(t,e,r){return new i0({type:"union",options:e,discriminator:t,...A.normalizeParams(r)})}function lc(t,e){return new o0({type:"intersection",left:t,right:e})}function a0(t,e,r){let i=e instanceof ve,n=i?r:e,o=i?e:null;return new s0({type:"tuple",items:t,rest:o,...A.normalizeParams(n)})}function at(t,e,r){return!e||!e._zod?new nc({type:"record",keyType:P(),valueType:t,...A.normalizeParams(e)}):new nc({type:"record",keyType:t,valueType:e,...A.normalizeParams(r)})}function xN(t,e,r){return new nc({type:"record",keyType:t,valueType:e,...A.normalizeParams(r),partial:!0})}function IN(t,e,r){return new nc({type:"record",keyType:t,valueType:e,mode:"loose",...A.normalizeParams(r)})}function EN(t,e,r){return new c0({type:"map",keyType:t,valueType:e,...A.normalizeParams(r)})}function TN(t,e){return new l0({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 ic({type:"enum",entries:r,...A.normalizeParams(e)})}function ON(t,e){return new ic({type:"enum",entries:t,...A.normalizeParams(e)})}function se(t,e){return new u0({type:"literal",values:Array.isArray(t)?t:[t],...A.normalizeParams(e)})}function PN(t){return Rh(d0,t)}function bg(t){return new f0({type:"transform",transform:t})}function ot(t){return new vs({type:"optional",innerType:t})}function p0(t){return new wg({type:"optional",innerType:t})}function Ju(t){return new h0({type:"nullable",innerType:t})}function AN(t){return ot(Ju(t))}function g0(t,e){return new m0({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():A.shallowClone(e)}})}function v0(t,e){return new y0({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():A.shallowClone(e)}})}function _0(t,e){return new $g({type:"nonoptional",innerType:t,...A.normalizeParams(e)})}function RN(t){return new b0({type:"success",innerType:t})}function $0(t,e){return new w0({type:"catch",innerType:t,catchValue:typeof e=="function"?e:A.constantCatch(e)})}function jN(t){return Ah(k0,t)}function Qm(t,e){return new nd({type:"pipe",in:t,out:e})}function zN(t,e,r){return new id({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function CN(t){let e=t._zod.def;return new id({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function I0(t){return new x0({type:"readonly",innerType:t})}function NN(t,e){return new E0({type:"template_literal",parts:t,...A.normalizeParams(e)})}function O0(t){return new T0({type:"lazy",getter:t})}function DN(t){return new P0({type:"promise",innerType:t})}function LN(t){return new A0({type:"function",input:Array.isArray(t?.input)?a0(t?.input):t?.input??Pe(ct()),output:t?.output??ct()})}function UN(t){let e=new it({check:"custom"});return e._zod.check=t,e}function kg(t,e){return jh(od,t??(()=>!0),e)}function R0(t,e={}){return zh(od,t,e)}function j0(t,e){return Ch(t,e)}function ZN(t,e={}){let r=new z0({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 VN(t){let e=O0(()=>rt([P(t),Ke(),Nt(),Yu(),Pe(e),at(P(),e)]));return e}function sd(t,e){return new S0({type:"pipe",in:bg(t),out:e})}var Se,eg,oc,st,io,oo,so,ao,tg,rg,ti,Xu,ng,ig,og,sg,ag,cg,lg,ug,Hk,dg,fg,pg,hg,mg,gg,Wk,Kk,yg,gs,sc,ys,ac,cc,vg,Gk,Jk,Xk,Yk,Qk,e0,t0,Qu,r0,ed,td,n0,i0,o0,s0,nc,c0,l0,ic,u0,d0,f0,vs,wg,h0,m0,y0,$g,b0,w0,k0,nd,id,S0,x0,E0,T0,P0,A0,od,MN,FN,z0,qN,co=w(()=>{Xt();Xt();ma();Ro();Jl();nb();Jm();Bk();Se=$("ZodType",(t,e)=>(rK(),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(R0(t,e))},superRefine(t,e){return this.check(j0(t,e))},overwrite(t){return this.check(rn(t))},optional(){return ot(this)},exactOptional(){return p0(this)},nullable(){return Ju(this)},nullish(){return ot(Ju(this))},nonoptional(t){return _0(this,t)},array(){return Pe(this)},or(t){return rt([this,t])},and(t){return lc(this,t)},transform(t){return Qm(this,bg(t))},default(t){return g0(this,t)},prefault(t){return v0(this,t)},catch(t){return $0(this,t)},pipe(t){return Qm(this,t)},readonly(){return I0(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",{...Ff(this),jsonSchema:{input:fa(this,"input"),output:fa(this,"output")}})},set"~standard"(t){A.own(this,"~standard",t)},parse:function t(e,r){return jk(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await zk(this,e,r,{callee:t})},safeParse(t,e){return Ck(this,t,e)},async safeParseAsync(t,e){return Nk(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){A.own(this,"spa",t)},validate(t,e){return Js(this,t,e)},validateAsync(t,e){return Xs(this,t,e)},encode:function t(e,r){return Dk(this,e,r,{callee:t})},decode:function t(e,r){return Lk(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await Uk(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await Mk(this,e,r,{callee:t})},safeEncode(t,e){return Fk(this,t,e)},safeDecode(t,e){return Zk(this,t,e)},async safeEncodeAsync(t,e){return qk(this,t,e)},async safeDecodeAsync(t,e){return Vk(this,t,e)},toJSONSchema(t){return wb(this,{})(t)},get description(){return Jt.get(this)?.description},get _def(){return this._zod.def}}),eg=$("_ZodString",(t,e)=>{yi.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sb(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(Uo(...t))},includes(...t){return this.check(Zo(...t))},startsWith(...t){return this.check(qo(...t))},endsWith(...t){return this.check(Vo(...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(Mo(t))},uppercase(t){return this.check(Fo(t))},trim(){return this.check(Ko())},normalize(...t){return this.check(Wo(...t))},toLowerCase(){return this.check(Go())},toUpperCase(){return this.check(Jo())},slugify(){return this.check(da())}})),oc=$("ZodString",(t,e)=>{yi.init(t,e),eg.init(t,e)},{email(t){return this.check(yl(tg,t))},url(t){return this.check(ua(Xu,t))},jwt(t){return this.check(Dl(yg,t))},emoji(t){return this.check(kl(ng,t))},guid(t){return this.check(vl(rg,t))},uuid(t){return this.check(_l(ti,t))},uuidv4(t){return this.check(bl(ti,t))},uuidv6(t){return this.check(wl(ti,t))},uuidv7(t){return this.check($l(ti,t))},nanoid(t){return this.check(Sl(ig,t))},cuid(t){return this.check(xl(og,t))},cuid2(t){return this.check(Il(sg,t))},ulid(t){return this.check(El(ag,t))},base64(t){return this.check(zl(hg,t))},base64url(t){return this.check(Cl(mg,t))},xid(t){return this.check(Tl(cg,t))},ksuid(t){return this.check(Ol(lg,t))},ipv4(t){return this.check(Pl(ug,t))},ipv6(t){return this.check(Al(dg,t))},cidrv4(t){return this.check(Rl(fg,t))},cidrv6(t){return this.check(jl(pg,t))},e164(t){return this.check(Nl(gg,t))},datetime(t){return this.check(Ll(io,t))},date(t){return this.check(Ul(oo,t))},time(t){return this.check(Ml(so,t))},duration(t){return this.check(Fl(ao,t))}});st=$("ZodStringFormat",(t,e)=>{Xe.init(t,e),eg.init(t,e)}),io=$("ZodISODateTime",(t,e)=>{W_.init(t,e),st.init(t,e)}),oo=$("ZodISODate",(t,e)=>{K_.init(t,e),st.init(t,e)}),so=$("ZodISOTime",(t,e)=>{G_.init(t,e),st.init(t,e)}),ao=$("ZodISODuration",(t,e)=>{J_.init(t,e),st.init(t,e)}),tg=$("ZodEmail",(t,e)=>{Vf.init(t,e),st.init(t,e)});rg=$("ZodGUID",(t,e)=>{Zf.init(t,e),st.init(t,e)});ti=$("ZodUUID",(t,e)=>{qf.init(t,e),st.init(t,e)});Xu=$("ZodURL",(t,e)=>{Kf.init(t,e),st.init(t,e)});ng=$("ZodEmoji",(t,e)=>{Gf.init(t,e),st.init(t,e)});ig=$("ZodNanoID",(t,e)=>{Jf.init(t,e),st.init(t,e)});og=$("ZodCUID",(t,e)=>{Xf.init(t,e),st.init(t,e)});sg=$("ZodCUID2",(t,e)=>{Yf.init(t,e),st.init(t,e)});ag=$("ZodULID",(t,e)=>{Qf.init(t,e),st.init(t,e)});cg=$("ZodXID",(t,e)=>{ep.init(t,e),st.init(t,e)});lg=$("ZodKSUID",(t,e)=>{tp.init(t,e),st.init(t,e)});ug=$("ZodIPv4",(t,e)=>{rp.init(t,e),st.init(t,e)});Hk=$("ZodMAC",(t,e)=>{ip.init(t,e),st.init(t,e)});dg=$("ZodIPv6",(t,e)=>{np.init(t,e),st.init(t,e)});fg=$("ZodCIDRv4",(t,e)=>{op.init(t,e),st.init(t,e)});pg=$("ZodCIDRv6",(t,e)=>{ap.init(t,e),st.init(t,e)});hg=$("ZodBase64",(t,e)=>{lp.init(t,e),st.init(t,e)});mg=$("ZodBase64URL",(t,e)=>{dp.init(t,e),st.init(t,e)});gg=$("ZodE164",(t,e)=>{fp.init(t,e),st.init(t,e)});Wk=$("ZodCreditCard",(t,e)=>{hp.init(t,e),st.init(t,e)});Kk=$("ZodIBAN",(t,e)=>{gp.init(t,e),st.init(t,e)});yg=$("ZodJWT",(t,e)=>{vp.init(t,e),st.init(t,e)});gs=$("ZodCustomStringFormat",(t,e)=>{_p.init(t,e),st.init(t,e)});sc=$("ZodNumber",(t,e)=>{ea.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xb(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(Ym(t))},safe(t){return this.check(Ym(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}}));ys=$("ZodNumberFormat",(t,e)=>{bp.init(t,e),sc.init(t,e)});ac=$("ZodBoolean",(t,e)=>{zo.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ib(t,r,i,n)});cc=$("ZodBigInt",(t,e)=>{il.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Eb(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))}}));vg=$("ZodBigIntFormat",(t,e)=>{wp.init(t,e),cc.init(t,e)});Gk=$("ZodSymbol",(t,e)=>{$p.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tb(t,r,i,n)});Jk=$("ZodUndefined",(t,e)=>{kp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pb(t,r,i,n)});Xk=$("ZodNull",(t,e)=>{Sp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ob(t,r,i,n)});Yk=$("ZodAny",(t,e)=>{xp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>jb(t,r,i,n)});Qk=$("ZodUnknown",(t,e)=>{Ip.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zb(t,r,i,n)});e0=$("ZodNever",(t,e)=>{Ep.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rb(t,r,i,n)});t0=$("ZodVoid",(t,e)=>{Tp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ab(t,r,i,n)});Qu=$("ZodDate",(t,e)=>{Op.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cb(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}},{}));r0=$("ZodArray",(t,e)=>{ms(),ol.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Wb(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}});ed=$("ZodObject",(t,e)=>{ms(),X_.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Kb(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:_g()}))},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(vs,this,t[0])},exactPartial(...t){return A.partial(wg,this,t[0],"exactPartial")},required(...t){return A.required($g,this,t[0])}});td=$("ZodUnion",(t,e)=>{ta.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mh(t,r,i,n),t.options=e.options});n0=$("ZodXor",(t,e)=>{td.init(t,e),Ap.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mh(t,r,i,n),t.options=e.options});i0=$("ZodDiscriminatedUnion",(t,e)=>{td.init(t,e),sl.init(t,e)});o0=$("ZodIntersection",(t,e)=>{Rp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Gb(t,r,i,n)});s0=$("ZodTuple",(t,e)=>{ms(),al.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Jb(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 vs({type:"optional",innerType:e}))})}});nc=$("ZodRecord",(t,e)=>{ms(),jp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Xb(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});c0=$("ZodMap",(t,e)=>{ms(),zp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Bb(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))});l0=$("ZodSet",(t,e)=>{ms(),Cp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Hb(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))});ic=$("ZodEnum",(t,e)=>{cl.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Nb(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 ic({...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 ic({...e,checks:[],...A.normalizeParams(n),entries:o})}});u0=$("ZodLiteral",(t,e)=>{ll.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Db(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]}})});d0=$("ZodFile",(t,e)=>{Np.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mb(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(Ho(Array.isArray(r)?r:[r],i))});f0=$("ZodTransform",(t,e)=>{ms(),Dp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vb(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)}});vs=$("ZodOptional",(t,e)=>{ra.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fh(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});wg=$("ZodExactOptional",(t,e)=>{Lp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fh(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});h0=$("ZodNullable",(t,e)=>{Up.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Yb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});m0=$("ZodDefault",(t,e)=>{Mp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});y0=$("ZodPrefault",(t,e)=>{Fp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});$g=$("ZodNonOptional",(t,e)=>{Zp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Qb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});b0=$("ZodSuccess",(t,e)=>{qp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});w0=$("ZodCatch",(t,e)=>{Vp.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.removeCatch=t.unwrap});k0=$("ZodNaN",(t,e)=>{Bp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Lb(t,r,i,n)});nd=$("ZodPipe",(t,e)=>{ul.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>iw(t,r,i,n),t.in=e.in,t.out=e.out});id=$("ZodCodec",(t,e)=>{nd.init(t,e),na.init(t,e)});S0=$("ZodPreprocess",(t,e)=>{nd.init(t,e),Q_.init(t,e)}),x0=$("ZodReadonly",(t,e)=>{Hp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ow(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});E0=$("ZodTemplateLiteral",(t,e)=>{Wp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ub(t,r,i,n)});T0=$("ZodLazy",(t,e)=>{ia.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>aw(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});P0=$("ZodPromise",(t,e)=>{Gp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sw(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});A0=$("ZodFunction",(t,e)=>{Kp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>qb(t,r,i,n)});od=$("ZodCustom",(t,e)=>{Jp.init(t,e),Se.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zb(t,r,i,n)});MN=Nh,FN=Dh,z0=$("ZodInstanceOf",(t,e)=>{od.init(t,e)},{properties(t,e){return this.check(Bo(t,e))}});qN=(...t)=>Lh({Codec:id,Boolean:ac,String:oc},...t)});function iK(t){Pt({customError:t})}function oK(){return Pt().customError}var nK,C0,BN=w(()=>{Xt();nK={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"};C0||(C0={})});var _s={};Jr(_s,{ZodISODate:()=>oo,ZodISODateTime:()=>io,ZodISODuration:()=>ao,ZodISOTime:()=>so,date:()=>aK,datetime:()=>sK,duration:()=>lK,time:()=>cK});function sK(t){return Ll(io,t)}function aK(t){return Ul(oo,t)}function cK(t){return Ml(so,t)}function lK(t){return Fl(ao,t)}var Sg=w(()=>{Xt();co();co()});function dK(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 HN(t,e){return t.map((r,i)=>i<e?r:r.optional())}function fK(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function pK(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:fK(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 hK(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 N0(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=N0(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=N0(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 ad(t){return typeof t!="object"||t===null?!1:Array.isArray(t)?t.some(ad):typeof t.$ref=="string"?!0:Object.entries(t).some(([e,r])=>mK.has(e)?ad(r):!gK.has(e)||typeof r!="object"||r===null?!1:Object.values(r).some(ad))}function WN(t){return t===1?"element":"elements"}function yK(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=N0(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 ${WN(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 ${WN(e.maxContains)}`,input:n,continue:!0})}}}).pipe(t)}function KN(t,e){if(t!==!1)return t===void 0||t===!0?W.any():wr(t,e)}function GN(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=pK(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 GN(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(vK)):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 E of Object.keys(v.value))m.includes(E)||g.some(k=>k.test(E))||b.push(E);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=hK(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=HN(a,s),l=Array.isArray(o)?void 0:KN(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=HN(a,s),l=KN(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=yK(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=GN(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&&!ad(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&&!ad(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))uK.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 JN(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=dK(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,uK,mK,gK,vK,XN=w(()=>{ml();B();Jm();Sg();co();W={...uc,...Gm,iso:_s},uK=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"]);mK=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),gK=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);vK=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function YN(t){return Ql(t,{object:e=>e.partial(),union:e=>{let r=e._zod.def;return r.discriminator===void 0?e:rt(r.options)}})}var QN=w(()=>{lw();co()});function _K(t,e){if(!e?.length)return t;let r=t._zod.def;return Be(t,Qr(r,{checks:[...r.checks??[],...e]}),{parent:!0})}function eD(t){return _K(t.out,t.checks)}function bK(t){return t.in._zod.traits.has("$ZodTransform")?eD(t):t.in}function tD(t){return Ql(t,{pipe:e=>bK(e._zod.def),default:(e,r)=>r?ot(e._zod.def.innerType):e,catch:(e,r)=>r?e._zod.def.innerType:e})}function rD(t){return Ql(t,{pipe:e=>eD(e._zod.def),prefault:(e,r)=>r?e._zod.def.innerType:e})}var nD=w(()=>{B();lw();co()});var D0={};Jr(D0,{bigint:()=>SK,boolean:()=>kK,date:()=>xK,number:()=>$K,string:()=>wK});function wK(t){return pb(oc,t)}function $K(t){return mb(sc,t)}function kK(t){return gb(ac,t)}function SK(t){return yb(cc,t)}function xK(t){return vb(Qu,t)}var iD=w(()=>{Xt();co()});var yt={};Jr(yt,{$brand:()=>Rv,$input:()=>ab,$output:()=>sb,INVALID:()=>hr,NEVER:()=>Av,TimePrecision:()=>hb,ZodAny:()=>Yk,ZodArray:()=>r0,ZodBase64:()=>hg,ZodBase64URL:()=>mg,ZodBigInt:()=>cc,ZodBigIntFormat:()=>vg,ZodBoolean:()=>ac,ZodCIDRv4:()=>fg,ZodCIDRv6:()=>pg,ZodCUID:()=>og,ZodCUID2:()=>sg,ZodCatch:()=>w0,ZodCodec:()=>id,ZodCompileAsyncError:()=>vn,ZodCompileUnsupportedError:()=>je,ZodCreditCard:()=>Wk,ZodCustom:()=>od,ZodCustomStringFormat:()=>gs,ZodDate:()=>Qu,ZodDefault:()=>m0,ZodDiscriminatedUnion:()=>i0,ZodE164:()=>gg,ZodEmail:()=>tg,ZodEmoji:()=>ng,ZodEnum:()=>ic,ZodError:()=>eK,ZodExactOptional:()=>wg,ZodFile:()=>d0,ZodFirstPartyTypeKind:()=>C0,ZodFunction:()=>A0,ZodGUID:()=>rg,ZodIBAN:()=>Kk,ZodIPv4:()=>ug,ZodIPv6:()=>dg,ZodISODate:()=>oo,ZodISODateTime:()=>io,ZodISODuration:()=>ao,ZodISOTime:()=>so,ZodInstanceOf:()=>z0,ZodIntersection:()=>o0,ZodIssueCode:()=>nK,ZodJWT:()=>yg,ZodKSUID:()=>lg,ZodLazy:()=>T0,ZodLiteral:()=>u0,ZodMAC:()=>Hk,ZodMap:()=>c0,ZodNaN:()=>k0,ZodNanoID:()=>ig,ZodNever:()=>e0,ZodNonOptional:()=>$g,ZodNull:()=>Xk,ZodNullable:()=>h0,ZodNumber:()=>sc,ZodNumberFormat:()=>ys,ZodObject:()=>ed,ZodOptional:()=>vs,ZodPipe:()=>nd,ZodPrefault:()=>y0,ZodPreprocess:()=>S0,ZodPromise:()=>P0,ZodReadonly:()=>x0,ZodRealError:()=>zr,ZodRecord:()=>nc,ZodSet:()=>l0,ZodString:()=>oc,ZodStringFormat:()=>st,ZodSuccess:()=>b0,ZodSymbol:()=>Gk,ZodTemplateLiteral:()=>E0,ZodTransform:()=>f0,ZodTuple:()=>s0,ZodType:()=>Se,ZodULID:()=>ag,ZodURL:()=>Xu,ZodUUID:()=>ti,ZodUndefined:()=>Jk,ZodUnion:()=>td,ZodUnknown:()=>Qk,ZodVoid:()=>t0,ZodXID:()=>cg,ZodXor:()=>n0,_ZodString:()=>eg,_default:()=>g0,_function:()=>LN,any:()=>_N,array:()=>Pe,base64:()=>QC,base64url:()=>eN,bigint:()=>hN,boolean:()=>Nt,catch:()=>$0,check:()=>UN,cidrv4:()=>XC,cidrv6:()=>YC,clone:()=>Be,codec:()=>zN,coerce:()=>D0,compile:()=>db,config:()=>Pt,core:()=>$n,creditCard:()=>rN,cuid:()=>qC,cuid2:()=>VC,currencyCode:()=>cN,custom:()=>kg,date:()=>wN,decode:()=>Lk,decodeAsync:()=>Mk,deepPartial:()=>YN,describe:()=>MN,discriminatedUnion:()=>rd,e164:()=>tN,email:()=>jC,emoji:()=>FC,encode:()=>Dk,encodeAsync:()=>Uk,endsWith:()=>Vo,enum:()=>er,exactOptional:()=>p0,file:()=>PN,flattenError:()=>Wc,float32:()=>uN,float64:()=>dN,formatError:()=>Kc,fromJSONSchema:()=>JN,function:()=>LN,getDiscriminatedOption:()=>Y_,getErrorMap:()=>oK,globalRegistry:()=>Jt,gt:()=>bn,gte:()=>gr,guid:()=>zC,hash:()=>lN,hex:()=>aN,hostname:()=>sN,httpUrl:()=>MC,iban:()=>nN,includes:()=>Zo,input:()=>tD,instanceof:()=>ZN,int:()=>Ym,int32:()=>fN,int64:()=>mN,intersection:()=>lc,invertCodec:()=>CN,ipv4:()=>KC,ipv6:()=>JC,iso:()=>_s,json:()=>VN,jwt:()=>iN,keyof:()=>$N,ksuid:()=>WC,lazy:()=>O0,length:()=>Vi,literal:()=>se,locales:()=>ca,looseObject:()=>Qt,looseRecord:()=>IN,lowercase:()=>Mo,lt:()=>_n,lte:()=>mr,mac:()=>GC,map:()=>EN,maxLength:()=>qi,maxSize:()=>_i,memoizer:()=>pl,meta:()=>FN,mime:()=>Ho,minLength:()=>Or,minSize:()=>wn,multipleOf:()=>vi,nan:()=>jN,nanoid:()=>ZC,nativeEnum:()=>ON,negative:()=>Bl,never:()=>_g,nonnegative:()=>Wl,nonoptional:()=>_0,nonpositive:()=>Hl,normalize:()=>Wo,null:()=>Yu,nullable:()=>Ju,nullish:()=>AN,number:()=>Ke,object:()=>K,optional:()=>ot,output:()=>rD,overwrite:()=>rn,parse:()=>jk,parseAsync:()=>zk,partialRecord:()=>xN,pipe:()=>Qm,positive:()=>Vl,prefault:()=>v0,preprocess:()=>sd,prettifyError:()=>Dv,promise:()=>DN,properties:()=>Bo,property:()=>Kl,readonly:()=>I0,record:()=>at,refine:()=>R0,regex:()=>Uo,regexes:()=>Fr,registry:()=>ch,safeDecode:()=>Zk,safeDecodeAsync:()=>Vk,safeEncode:()=>Fk,safeEncodeAsync:()=>qk,safeParse:()=>Ck,safeParseAsync:()=>Nk,set:()=>TN,setErrorMap:()=>iK,size:()=>Zi,slugify:()=>da,startsWith:()=>qo,strictObject:()=>kN,string:()=>P,stringFormat:()=>oN,stringbool:()=>qN,success:()=>RN,superRefine:()=>j0,symbol:()=>yN,templateLiteral:()=>NN,toJSONSchema:()=>Xo,toLowerCase:()=>Go,toUpperCase:()=>Jo,toZod:()=>Uc,transform:()=>bg,treeifyError:()=>Nv,trim:()=>Ko,tuple:()=>a0,uint32:()=>pN,uint64:()=>gN,ulid:()=>BC,undefined:()=>vN,union:()=>rt,unknown:()=>ct,uppercase:()=>Fo,url:()=>UC,util:()=>A,uuid:()=>CC,uuidv4:()=>NC,uuidv6:()=>DC,uuidv7:()=>LC,validate:()=>Js,validateAsync:()=>Xs,void:()=>bN,withParser:()=>lh,xid:()=>HC,xor:()=>SN});var xg=w(()=>{Xt();co();Jm();Rk();Bk();BN();Xt();ma();XN();QN();nD();sh();Sg();Sg();iD()});var oD=w(()=>{xg()});var sD=w(()=>{oD()});function kD(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function SD(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var U0,aD,lo,Eg,Bt,cD,lD,Xce,EK,TK,M0,Kr,cd,uD,tr,ln,un,rr,Tg,dD,F0,fD,pD,Z0,ld,ae,q0,hD,mD,Yce,Og,OK,Pg,PK,ud,dc,gD,AK,RK,jK,zK,CK,NK,V0,DK,LK,B0,Ag,UK,MK,Rg,FK,dd,fd,ZK,pd,fc,qK,hd,jg,zg,Cg,Qce,Ng,Dg,Lg,yD,vD,_D,H0,bD,md,pc,wD,VK,Ug,BK,Mg,HK,W0,WK,Fg,KK,GK,JK,XK,YK,QK,eG,tG,rG,nG,Zg,iG,oG,qg,K0,G0,J0,sG,aG,cG,X0,lG,uG,dG,fG,pG,$D,Vg,hG,Bg,ele,mG,hc,gG,tle,gd,yG,Y0,vG,_G,bG,wG,$G,kG,SG,Ig,xG,IG,EG,yd,Q0,TG,OG,PG,AG,RG,jG,zG,CG,NG,DG,LG,UG,MG,FG,ZG,qG,VG,BG,mc,HG,WG,KG,Hg,GG,JG,XG,eS,YG,rle,nle,ile,ole,sle,ale,te,L0,gc=w(()=>{sD();U0="2025-11-25",aD=[U0,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],lo="io.modelcontextprotocol/related-task",Eg="2.0",Bt=kg(t=>t!==null&&(typeof t=="object"||typeof t=="function")),cD=rt([P(),Ke().int()]),lD=P(),Xce=Qt({ttl:Ke().optional(),pollInterval:Ke().optional()}),EK=K({ttl:Ke().optional()}),TK=K({taskId:P()}),M0=Qt({progressToken:cD.optional(),[lo]:TK.optional()}),Kr=K({_meta:M0.optional()}),cd=Kr.extend({task:EK.optional()}),uD=t=>cd.safeParse(t).success,tr=K({method:P(),params:Kr.loose().optional()}),ln=K({_meta:M0.optional()}),un=K({method:P(),params:ln.loose().optional()}),rr=Qt({_meta:M0.optional()}),Tg=rt([P(),Ke().int()]),dD=K({jsonrpc:se(Eg),id:Tg,...tr.shape}).strict(),F0=t=>dD.safeParse(t).success,fD=K({jsonrpc:se(Eg),...un.shape}).strict(),pD=t=>fD.safeParse(t).success,Z0=K({jsonrpc:se(Eg),id:Tg,result:rr}).strict(),ld=t=>Z0.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={}));q0=K({jsonrpc:se(Eg),id:Tg.optional(),error:K({code:Ke().int(),message:P(),data:ct().optional()})}).strict(),hD=t=>q0.safeParse(t).success,mD=rt([dD,fD,Z0,q0]),Yce=rt([Z0,q0]),Og=rr.strict(),OK=ln.extend({requestId:Tg.optional(),reason:P().optional()}),Pg=un.extend({method:se("notifications/cancelled"),params:OK}),PK=K({src:P(),mimeType:P().optional(),sizes:Pe(P()).optional(),theme:er(["light","dark"]).optional()}),ud=K({icons:Pe(PK).optional()}),dc=K({name:P(),title:P().optional()}),gD=dc.extend({...dc.shape,...ud.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),AK=lc(K({applyDefaults:Nt().optional()}),at(P(),ct())),RK=sd(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,lc(K({form:AK.optional(),url:Bt.optional()}),at(P(),ct()).optional())),jK=Qt({list:Bt.optional(),cancel:Bt.optional(),requests:Qt({sampling:Qt({createMessage:Bt.optional()}).optional(),elicitation:Qt({create:Bt.optional()}).optional()}).optional()}),zK=Qt({list:Bt.optional(),cancel:Bt.optional(),requests:Qt({tools:Qt({call:Bt.optional()}).optional()}).optional()}),CK=K({experimental:at(P(),Bt).optional(),sampling:K({context:Bt.optional(),tools:Bt.optional()}).optional(),elicitation:RK.optional(),roots:K({listChanged:Nt().optional()}).optional(),tasks:jK.optional(),extensions:at(P(),Bt).optional()}),NK=Kr.extend({protocolVersion:P(),capabilities:CK,clientInfo:gD}),V0=tr.extend({method:se("initialize"),params:NK}),DK=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:zK.optional(),extensions:at(P(),Bt).optional()}),LK=rr.extend({protocolVersion:P(),capabilities:DK,serverInfo:gD,instructions:P().optional()}),B0=un.extend({method:se("notifications/initialized"),params:ln.optional()}),Ag=tr.extend({method:se("ping"),params:Kr.optional()}),UK=K({progress:Ke(),total:ot(Ke()),message:ot(P())}),MK=K({...ln.shape,...UK.shape,progressToken:cD}),Rg=un.extend({method:se("notifications/progress"),params:MK}),FK=Kr.extend({cursor:lD.optional()}),dd=tr.extend({params:FK.optional()}),fd=rr.extend({nextCursor:lD.optional()}),ZK=er(["working","input_required","completed","failed","cancelled"]),pd=K({taskId:P(),status:ZK,ttl:rt([Ke(),Yu()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:ot(Ke()),statusMessage:ot(P())}),fc=rr.extend({task:pd}),qK=ln.merge(pd),hd=un.extend({method:se("notifications/tasks/status"),params:qK}),jg=tr.extend({method:se("tasks/get"),params:Kr.extend({taskId:P()})}),zg=rr.merge(pd),Cg=tr.extend({method:se("tasks/result"),params:Kr.extend({taskId:P()})}),Qce=rr.loose(),Ng=dd.extend({method:se("tasks/list")}),Dg=fd.extend({tasks:Pe(pd)}),Lg=tr.extend({method:se("tasks/cancel"),params:Kr.extend({taskId:P()})}),yD=rr.merge(pd),vD=K({uri:P(),mimeType:ot(P()),_meta:at(P(),ct()).optional()}),_D=vD.extend({text:P()}),H0=P().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),bD=vD.extend({blob:H0}),md=er(["user","assistant"]),pc=K({audience:Pe(md).optional(),priority:Ke().min(0).max(1).optional(),lastModified:_s.datetime({offset:!0}).optional()}),wD=K({...dc.shape,...ud.shape,uri:P(),description:ot(P()),mimeType:ot(P()),size:ot(Ke()),annotations:pc.optional(),_meta:ot(Qt({}))}),VK=K({...dc.shape,...ud.shape,uriTemplate:P(),description:ot(P()),mimeType:ot(P()),annotations:pc.optional(),_meta:ot(Qt({}))}),Ug=dd.extend({method:se("resources/list")}),BK=fd.extend({resources:Pe(wD)}),Mg=dd.extend({method:se("resources/templates/list")}),HK=fd.extend({resourceTemplates:Pe(VK)}),W0=Kr.extend({uri:P()}),WK=W0,Fg=tr.extend({method:se("resources/read"),params:WK}),KK=rr.extend({contents:Pe(rt([_D,bD]))}),GK=un.extend({method:se("notifications/resources/list_changed"),params:ln.optional()}),JK=W0,XK=tr.extend({method:se("resources/subscribe"),params:JK}),YK=W0,QK=tr.extend({method:se("resources/unsubscribe"),params:YK}),eG=ln.extend({uri:P()}),tG=un.extend({method:se("notifications/resources/updated"),params:eG}),rG=K({name:P(),description:ot(P()),required:ot(Nt())}),nG=K({...dc.shape,...ud.shape,description:ot(P()),arguments:ot(Pe(rG)),_meta:ot(Qt({}))}),Zg=dd.extend({method:se("prompts/list")}),iG=fd.extend({prompts:Pe(nG)}),oG=Kr.extend({name:P(),arguments:at(P(),P()).optional()}),qg=tr.extend({method:se("prompts/get"),params:oG}),K0=K({type:se("text"),text:P(),annotations:pc.optional(),_meta:at(P(),ct()).optional()}),G0=K({type:se("image"),data:H0,mimeType:P(),annotations:pc.optional(),_meta:at(P(),ct()).optional()}),J0=K({type:se("audio"),data:H0,mimeType:P(),annotations:pc.optional(),_meta:at(P(),ct()).optional()}),sG=K({type:se("tool_use"),name:P(),id:P(),input:at(P(),ct()),_meta:at(P(),ct()).optional()}),aG=K({type:se("resource"),resource:rt([_D,bD]),annotations:pc.optional(),_meta:at(P(),ct()).optional()}),cG=wD.extend({type:se("resource_link")}),X0=rt([K0,G0,J0,cG,aG]),lG=K({role:md,content:X0}),uG=rr.extend({description:P().optional(),messages:Pe(lG)}),dG=un.extend({method:se("notifications/prompts/list_changed"),params:ln.optional()}),fG=K({title:P().optional(),readOnlyHint:Nt().optional(),destructiveHint:Nt().optional(),idempotentHint:Nt().optional(),openWorldHint:Nt().optional()}),pG=K({taskSupport:er(["required","optional","forbidden"]).optional()}),$D=K({...dc.shape,...ud.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:fG.optional(),execution:pG.optional(),_meta:at(P(),ct()).optional()}),Vg=dd.extend({method:se("tools/list")}),hG=fd.extend({tools:Pe($D)}),Bg=rr.extend({content:Pe(X0).default([]),structuredContent:at(P(),ct()).optional(),isError:Nt().optional()}),ele=Bg.or(rr.extend({toolResult:ct()})),mG=cd.extend({name:P(),arguments:at(P(),ct()).optional()}),hc=tr.extend({method:se("tools/call"),params:mG}),gG=un.extend({method:se("notifications/tools/list_changed"),params:ln.optional()}),tle=K({autoRefresh:Nt().default(!0),debounceMs:Ke().int().nonnegative().default(300)}),gd=er(["debug","info","notice","warning","error","critical","alert","emergency"]),yG=Kr.extend({level:gd}),Y0=tr.extend({method:se("logging/setLevel"),params:yG}),vG=ln.extend({level:gd,logger:P().optional(),data:ct()}),_G=un.extend({method:se("notifications/message"),params:vG}),bG=K({name:P().optional()}),wG=K({hints:Pe(bG).optional(),costPriority:Ke().min(0).max(1).optional(),speedPriority:Ke().min(0).max(1).optional(),intelligencePriority:Ke().min(0).max(1).optional()}),$G=K({mode:er(["auto","required","none"]).optional()}),kG=K({type:se("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:Pe(X0).default([]),structuredContent:K({}).loose().optional(),isError:Nt().optional(),_meta:at(P(),ct()).optional()}),SG=rd("type",[K0,G0,J0]),Ig=rd("type",[K0,G0,J0,sG,kG]),xG=K({role:md,content:rt([Ig,Pe(Ig)]),_meta:at(P(),ct()).optional()}),IG=cd.extend({messages:Pe(xG),modelPreferences:wG.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($D).optional(),toolChoice:$G.optional()}),EG=tr.extend({method:se("sampling/createMessage"),params:IG}),yd=rr.extend({model:P(),stopReason:ot(er(["endTurn","stopSequence","maxTokens"]).or(P())),role:md,content:SG}),Q0=rr.extend({model:P(),stopReason:ot(er(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:md,content:rt([Ig,Pe(Ig)])}),TG=K({type:se("boolean"),title:P().optional(),description:P().optional(),default:Nt().optional()}),OG=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()}),PG=K({type:er(["number","integer"]),title:P().optional(),description:P().optional(),minimum:Ke().optional(),maximum:Ke().optional(),default:Ke().optional()}),AG=K({type:se("string"),title:P().optional(),description:P().optional(),enum:Pe(P()),default:P().optional()}),RG=K({type:se("string"),title:P().optional(),description:P().optional(),oneOf:Pe(K({const:P(),title:P()})),default:P().optional()}),jG=K({type:se("string"),title:P().optional(),description:P().optional(),enum:Pe(P()),enumNames:Pe(P()).optional(),default:P().optional()}),zG=rt([AG,RG]),CG=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()}),NG=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()}),DG=rt([CG,NG]),LG=rt([jG,zG,DG]),UG=rt([LG,TG,OG,PG]),MG=cd.extend({mode:se("form").optional(),message:P(),requestedSchema:K({type:se("object"),properties:at(P(),UG),required:Pe(P()).optional()})}),FG=cd.extend({mode:se("url"),message:P(),elicitationId:P(),url:P().url()}),ZG=rt([MG,FG]),qG=tr.extend({method:se("elicitation/create"),params:ZG}),VG=ln.extend({elicitationId:P()}),BG=un.extend({method:se("notifications/elicitation/complete"),params:VG}),mc=rr.extend({action:er(["accept","decline","cancel"]),content:sd(t=>t===null?void 0:t,at(P(),rt([P(),Ke(),Nt(),Pe(P())])).optional())}),HG=K({type:se("ref/resource"),uri:P()}),WG=K({type:se("ref/prompt"),name:P()}),KG=Kr.extend({ref:rt([WG,HG]),argument:K({name:P(),value:P()}),context:K({arguments:at(P(),P()).optional()}).optional()}),Hg=tr.extend({method:se("completion/complete"),params:KG});GG=rr.extend({completion:Qt({values:Pe(P()).max(100),total:ot(Ke().int()),hasMore:ot(Nt())})}),JG=K({uri:P().startsWith("file://"),name:P().optional(),_meta:at(P(),ct()).optional()}),XG=tr.extend({method:se("roots/list"),params:Kr.optional()}),eS=rr.extend({roots:Pe(JG)}),YG=un.extend({method:se("notifications/roots/list_changed"),params:ln.optional()}),rle=rt([Ag,V0,Hg,Y0,qg,Zg,Ug,Mg,Fg,XK,QK,hc,Vg,jg,Cg,Ng,Lg]),nle=rt([Pg,Rg,B0,YG,hd]),ile=rt([Og,yd,Q0,mc,eS,zg,Dg,fc]),ole=rt([Ag,EG,qG,XG,jg,Cg,Ng,Lg]),sle=rt([Pg,Rg,_G,tG,GK,gG,dG,hd,BG]),ale=rt([Og,LK,GG,uG,iG,BK,HK,KK,Bg,hG,zg,Dg,fc]),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 L0(n.elicitations,r)}return new t(e,r,i)}},L0=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 uo(t){return t==="completed"||t==="failed"||t==="cancelled"}var xD=w(()=>{});var ED,ID,TD,Wg=w(()=>{ED=Symbol("Let zodToJsonSchema decide on which parser to use"),ID={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"},TD=t=>typeof t=="string"?{...ID,name:t}:{...ID,...t}});var OD,tS=w(()=>{Wg();OD=t=>{let e=TD(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 rS(t,e,r,i){i?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Me(t,e,r,i,n){t[e]=r,rS(t,e,i,n)}var fo=w(()=>{});var Kg,Gg=w(()=>{Kg=(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"?Kg(e,t.currentPath):e.join("/")}}var dn=w(()=>{Gg()});function PD(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 nS=w(()=>{Ku();fo();Ft()});function AD(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 iS=w(()=>{fo()});function RD(){return{type:"boolean"}}var oS=w(()=>{});function Jg(t,e){return ge(t.type._def,e)}var Xg=w(()=>{Ft()});var jD,sS=w(()=>{Ft();jD=(t,e)=>ge(t.innerType._def,e)});function aS(t,e,r){let i=r??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>aS(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 QG(t,e)}}var QG,cS=w(()=>{fo();QG=(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 zD(t,e){return{...ge(t.innerType._def,e),default:t.defaultValue()}}var lS=w(()=>{Ft()});function CD(t,e){return e.effectStrategy==="input"?ge(t.schema._def,e):$t(e)}var uS=w(()=>{Ft();dn()});function ND(t){return{type:"string",enum:Array.from(t.values)}}var dS=w(()=>{});function DD(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(eJ(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 eJ,fS=w(()=>{Ft();eJ=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function LD(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 pS=w(()=>{});function Yg(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(`^${mS(i.value,e)}`),i.message,e);break;case"endsWith":$r(r,RegExp(`${mS(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(mS(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 mS(t,e){return e.patternStrategy==="escape"?rJ(t):t}function rJ(t){let e="";for(let r=0;r<t.length;r++)tJ.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:UD(e,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):Me(t,"pattern",UD(e,i),r,i)}function UD(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 hS,An,tJ,Qg=w(()=>{fo();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:()=>(hS===void 0&&(hS=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),hS),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-_]*$/};tJ=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function ey(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}=Yg(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}=Jg(t.keyType._def,e);return{...r,propertyNames:n}}}return r}var ty=w(()=>{Ku();Ft();Qg();Xg();dn()});function MD(t,e){if(e.mapStrategy==="record")return ey(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 gS=w(()=>{Ft();ty();dn()});function FD(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 yS=w(()=>{});function ZD(t){return t.target==="openAi"?void 0:{not:$t({...t,currentPath:[...t.currentPath,"not"]})}}var vS=w(()=>{dn()});function qD(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var _S=w(()=>{});function BD(t,e){if(e.target==="openApi3")return VD(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(i=>i._def.typeName in vd&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let s=vd[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 VD(t,e)}var vd,VD,ry=w(()=>{Ft();vd={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};VD=(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 HD(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:vd[t.innerType._def.typeName],nullable:!0}:{type:[vd[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 bS=w(()=>{Ft();ry()});function WD(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",rS(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 wS=w(()=>{fo()});function KD(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=iJ(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=nJ(t,e);return s!==void 0&&(i.additionalProperties=s),i}function nJ(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 iJ(t){try{return t.isOptional()}catch{return!0}}var $S=w(()=>{Ft()});var GD,kS=w(()=>{Ft();dn();GD=(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 JD,SS=w(()=>{Ft();JD=(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 XD(t,e){return ge(t.type._def,e)}var xS=w(()=>{Ft()});function YD(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 IS=w(()=>{fo();Ft()});function QD(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 ES=w(()=>{Ft()});function e1(t){return{not:$t(t)}}var TS=w(()=>{dn()});function t1(t){return $t(t)}var OS=w(()=>{dn()});var r1,PS=w(()=>{Ft();r1=(t,e)=>ge(t.innerType._def,e)});var n1,AS=w(()=>{Ku();dn();nS();iS();oS();Xg();sS();cS();lS();uS();dS();fS();pS();gS();yS();vS();_S();bS();wS();$S();kS();SS();xS();ty();IS();Qg();ES();TS();ry();OS();PS();n1=(t,e,r)=>{switch(e){case Z.ZodString:return Yg(t,r);case Z.ZodNumber:return WD(t,r);case Z.ZodObject:return KD(t,r);case Z.ZodBigInt:return AD(t,r);case Z.ZodBoolean:return RD();case Z.ZodDate:return aS(t,r);case Z.ZodUndefined:return e1(r);case Z.ZodNull:return qD(r);case Z.ZodArray:return PD(t,r);case Z.ZodUnion:case Z.ZodDiscriminatedUnion:return BD(t,r);case Z.ZodIntersection:return DD(t,r);case Z.ZodTuple:return QD(t,r);case Z.ZodRecord:return ey(t,r);case Z.ZodLiteral:return LD(t,r);case Z.ZodEnum:return ND(t);case Z.ZodNativeEnum:return FD(t);case Z.ZodNullable:return HD(t,r);case Z.ZodOptional:return GD(t,r);case Z.ZodMap:return MD(t,r);case Z.ZodSet:return YD(t,r);case Z.ZodLazy:return()=>t.getter()._def;case Z.ZodPromise:return XD(t,r);case Z.ZodNaN:case Z.ZodNever:return ZD(r);case Z.ZodEffects:return CD(t,r);case Z.ZodAny:return $t(r);case Z.ZodUnknown:return t1(r);case Z.ZodDefault:return zD(t,r);case Z.ZodBranded:return Jg(t,r);case Z.ZodReadonly:return r1(t,r);case Z.ZodCatch:return jD(t,r);case Z.ZodPipeline:return JD(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!==ED)return a}if(i&&!r){let a=oJ(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=n1(t,t.typeName,e),s=typeof o=="function"?ge(o(),e):o;if(s&&sJ(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return n.jsonSchema=s,a}return n.jsonSchema=s,s}var oJ,sJ,Ft=w(()=>{Wg();AS();Gg();dn();oJ=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Kg(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}},sJ=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var i1=w(()=>{});var RS,jS=w(()=>{Ft();tS();dn();RS=(t,e)=>{let r=OD(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 o1=w(()=>{Wg();tS();fo();Gg();Ft();i1();dn();nS();iS();oS();Xg();sS();cS();lS();uS();dS();fS();pS();gS();yS();vS();_S();bS();wS();$S();kS();SS();xS();PS();ty();IS();Qg();ES();TS();ry();OS();AS();jS();jS()});function aJ(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function zS(t,e){return ei(t)?Xo(t,{target:aJ(e?.target),io:e?.pipeStrategy??"input"}):RS(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function CS(t){let r=no(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=rc(r);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function NS(t,e){let r=ro(t,e);if(!r.success)throw r.error;return r.data}var DS=w(()=>{Ak();Gu();o1()});function s1(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function a1(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];s1(s)&&s1(o)?r[n]={...s,...o}:r[n]=o}return r}var cJ,ny,c1=w(()=>{Gu();gc();xD();DS();cJ=6e4,ny=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(Pg,r=>{this._oncancel(r)}),this.setNotificationHandler(Rg,r=>{this._onprogress(r)}),this.setRequestHandler(Ag,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(jg,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(Cg,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(!uo(s.status))return await this._waitForTaskUpdate(o,i.signal,i.sessionId),await n();if(uo(s.status)){let a=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o,i.sessionId),{...a,_meta:{...a._meta,[lo]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(Ng,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(Lg,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(uo(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),ld(o)||hD(o)?this._onresponse(o):F0(o)?this._onrequest(o,s):pD(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?.[lo]?.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=uD(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),ld(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(ld(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),ld(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,fc,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},uo(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||{},[lo]: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(E=>this._onerror(new Error(`Failed to send cancellation: ${E}`)));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=ro(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??cJ,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 E=this._responseHandlers.get(p);E?E(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},zg,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},Dg,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},yD,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||{},[lo]: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||{},[lo]: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||{},[lo]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let i=CS(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(n,o)=>{let s=NS(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=CS(e);this._notificationHandlers.set(i,n=>{let o=NS(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"&&F0(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=hd.parse({method:"notifications/tasks/status",params:a});await this.notification(c),uo(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(uo(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=hd.parse({method:"notifications/tasks/status",params:c});await this.notification(l),uo(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>i.listTasks(n,r)}}}});var wd=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 _d=class{};Ge._CodeOrName=_d;Ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var bs=class extends _d{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=bs;var fn=class extends _d{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 bs&&(r[i.str]=(r[i.str]||0)+1),r),{})}};Ge._Code=fn;Ge.nil=new fn("");function l1(t,...e){let r=[t[0]],i=0;for(;i<e.length;)US(r,e[i]),r.push(t[++i]);return new fn(r)}Ge._=l1;var LS=new fn("+");function u1(t,...e){let r=[bd(t[0])],i=0;for(;i<e.length;)r.push(LS),US(r,e[i]),r.push(LS,bd(t[++i]));return lJ(r),new fn(r)}Ge.str=u1;function US(t,e){e instanceof fn?t.push(...e._items):e instanceof bs?t.push(e):t.push(fJ(e))}Ge.addCodeArg=US;function lJ(t){let e=1;for(;e<t.length-1;){if(t[e]===LS){let r=uJ(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function uJ(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof bs||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 bs))return`"${t}${e.slice(1)}`}function dJ(t,e){return e.emptyStr()?t:t.emptyStr()?e:u1`${t}${e}`}Ge.strConcat=dJ;function fJ(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:bd(Array.isArray(t)?t.join(","):t)}function pJ(t){return new fn(bd(t))}Ge.stringify=pJ;function bd(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ge.safeStringify=bd;function hJ(t){return typeof t=="string"&&Ge.IDENTIFIER.test(t)?new fn(`.${t}`):l1`[${t}]`}Ge.getProperty=hJ;function mJ(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=mJ;function gJ(t){return new fn(t.toString())}Ge.regexpCode=gJ});var ZS=C(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ValueScope=Nr.ValueScopeName=Nr.Scope=Nr.varKinds=Nr.UsedValueState=void 0;var Cr=wd(),MS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},iy;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(iy||(Nr.UsedValueState=iy={}));Nr.varKinds={const:new Cr.Name("const"),let:new Cr.Name("let"),var:new Cr.Name("var")};var oy=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=oy;var sy=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=sy;var yJ=(0,Cr._)`\n`,FS=class extends oy{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?yJ:Cr.nil}}get(){return this._scope}name(e){return new sy(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,iy.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 MS(l);c.set(l,iy.Completed)})}return o}};Nr.ValueScope=FS});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=wd(),jn=ZS(),po=wd();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return po._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return po.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return po.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return po.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return po.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return po.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return po.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return po.Name}});var uy=ZS();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return uy.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return uy.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return uy.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return uy.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}},qS=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=vc(this.rhs,e,r)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},ay=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=vc(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Fe.Name?{}:{...this.lhs.names};return ly(e,this.rhs)}},VS=class extends ay{constructor(e,r,i,n){super(e,i,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},BS=class extends Ri{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},HS=class extends Ri{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},WS=class extends Ri{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},KS=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=vc(this.code,e,r),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},$d=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)||(vJ(e,o.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ks(e,r.names),{})}},ji=class extends $d{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},GS=class extends $d{},yc=class extends ji{};yc.kind="else";var ws=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 yc(i):i}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(d1(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=vc(this.condition,e,r),this}get names(){let e=super.names;return ly(e,this.condition),this.else&&ks(e,this.else.names),e}};ws.kind="if";var $s=class extends ji{};$s.kind="for";var JS=class extends $s{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=vc(this.iteration,e,r),this}get names(){return ks(super.names,this.iteration.names)}},XS=class extends $s{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=ly(super.names,this.from);return ly(e,this.to)}},cy=class extends $s{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=vc(this.iterable,e,r),this}get names(){return ks(super.names,this.iterable.names)}},kd=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)}};kd.kind="func";var Sd=class extends $d{render(e){return"return "+super.render(e)}};Sd.kind="return";var YS=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&&ks(e,this.catch.names),this.finally&&ks(e,this.finally.names),e}},xd=class extends ji{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};xd.kind="catch";var Id=class extends ji{render(e){return"finally"+super.render(e)}};Id.kind="finally";var QS=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 GS]}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 qS(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 ay(e,r,i))}add(e,r){return this._leafNode(new VS(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Fe.nil&&this._leafNode(new KS(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 ws(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 ws(e))}else(){return this._elseNode(new yc)}endIf(){return this._endBlockNode(ws,yc)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new JS(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 XS(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 cy("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 cy("in",n,o,r),()=>i(o))}endFor(){return this._endBlockNode($s)}label(e){return this._leafNode(new BS(e))}break(e){return this._leafNode(new HS(e))}return(e){let r=new Sd;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Sd)}try(e,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new YS;if(this._blockNode(n),this.code(e),r){let o=this.name("e");this._currNode=n.catch=new xd(o),r(o)}return i&&(this._currNode=n.finally=new Id,this.code(i)),this._endBlockNode(xd,Id)}throw(e){return this._leafNode(new WS(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 kd(e,r,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(kd)}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 ws))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=QS;function ks(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function ly(t,e){return e instanceof Fe._CodeOrName?ks(t,e.names):t}function vc(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 vJ(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function d1(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Fe._)`!${ex(t)}`}Ae.not=d1;var _J=f1(Ae.operators.AND);function bJ(...t){return t.reduce(_J)}Ae.and=bJ;var wJ=f1(Ae.operators.OR);function $J(...t){return t.reduce(wJ)}Ae.or=$J;function f1(t){return(e,r)=>e===Fe.nil?r:r===Fe.nil?e:(0,Fe._)`${ex(e)} ${t} ${ex(r)}`}function ex(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(),kJ=wd();function SJ(t){let e={};for(let r of t)e[r]=!0;return e}Ne.toHash=SJ;function xJ(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(m1(t,e),!g1(e,t.self.RULES.all))}Ne.alwaysValidSchema=xJ;function m1(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]||_1(t,`unknown keyword: "${o}"`)}Ne.checkUnknownRules=m1;function g1(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ne.schemaHasRules=g1;function IJ(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=IJ;function EJ({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=EJ;function TJ(t){return y1(decodeURIComponent(t))}Ne.unescapeFragment=TJ;function OJ(t){return encodeURIComponent(rx(t))}Ne.escapeFragment=OJ;function rx(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ne.escapeJsonPointer=rx;function y1(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ne.unescapeJsonPointer=y1;function PJ(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ne.eachItem=PJ;function p1({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:p1({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} || {}`),nx(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:v1}),items:p1({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 v1(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ft._)`{}`);return e!==void 0&&nx(t,r,e),r}Ne.evaluatedPropsToName=v1;function nx(t,e,r){Object.keys(r).forEach(i=>t.assign((0,ft._)`${e}${(0,ft.getProperty)(i)}`,!0))}Ne.setEvaluated=nx;var h1={};function AJ(t,e){return t.scopeValue("func",{ref:e,code:h1[e.code]||(h1[e.code]=new kJ._Code(e.code))})}Ne.useFunc=AJ;var tx;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(tx||(Ne.Type=tx={}));function RJ(t,e,r){if(t instanceof ft.Name){let i=e===tx.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():"/"+rx(t)}Ne.getErrorPath=RJ;function _1(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=_1});var zi=C(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:!0});var cr=Te(),jJ={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")};ix.default=jJ});var Ed=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(),dy=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 zJ(t,e=lr.keywordError,r,i){let{it:n}=t,{gen:o,compositeRule:s,allErrors:a}=n,c=$1(t,e,r);i??(s||a)?b1(o,c):w1(n,(0,Ve._)`[${c}]`)}lr.reportError=zJ;function CJ(t,e=lr.keywordError,r){let{it:i}=t,{gen:n,compositeRule:o,allErrors:s}=i,a=$1(t,e,r);b1(n,a),o||s||w1(i,kr.default.vErrors)}lr.reportExtraError=CJ;function NJ(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=NJ;function DJ({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=DJ;function b1(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 w1(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 Ss={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 $1(t,e,r){let{createErrors:i}=t.it;return i===!1?(0,Ve._)`{}`:LJ(t,e,r)}function LJ(t,e,r={}){let{gen:i,it:n}=t,o=[UJ(n,r),MJ(t,r)];return FJ(t,e,o),i.object(...o)}function UJ({errorPath:t},{instancePath:e}){let r=e?(0,Ve.str)`${t}${(0,dy.getErrorPath)(e,dy.Type.Str)}`:t;return[kr.default.instancePath,(0,Ve.strConcat)(kr.default.instancePath,r)]}function MJ({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,dy.getErrorPath)(r,dy.Type.Str)}`),[Ss.schemaPath,n]}function FJ(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([Ss.keyword,n],[Ss.params,typeof e=="function"?e(t):e||(0,Ve._)`{}`]),c.messages&&i.push([Ss.message,typeof r=="function"?r(t):r]),c.verbose&&i.push([Ss.schema,s],[Ss.parentSchema,(0,Ve._)`${u}${d}`],[kr.default.data,o]),l&&i.push([Ss.propertyName,l])}});var S1=C(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.boolOrEmptySchema=_c.topBoolOrEmptySchema=void 0;var ZJ=Ed(),qJ=Te(),VJ=zi(),BJ={message:"boolean schema is false"};function HJ(t){let{gen:e,schema:r,validateName:i}=t;r===!1?k1(t,!1):typeof r=="object"&&r.$async===!0?e.return(VJ.default.data):(e.assign((0,qJ._)`${i}.errors`,null),e.return(!0))}_c.topBoolOrEmptySchema=HJ;function WJ(t,e){let{gen:r,schema:i}=t;i===!1?(r.var(e,!1),k1(t)):r.var(e,!0)}_c.boolOrEmptySchema=WJ;function k1(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,ZJ.reportError)(n,BJ,void 0,e)}});var ox=C(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.getRules=bc.isJSONType=void 0;var KJ=["string","number","integer","boolean","null","object","array"],GJ=new Set(KJ);function JJ(t){return typeof t=="string"&&GJ.has(t)}bc.isJSONType=JJ;function XJ(){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:{}}}bc.getRules=XJ});var sx=C(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.shouldUseRule=ho.shouldUseGroup=ho.schemaHasRulesForType=void 0;function YJ({schema:t,self:e},r){let i=e.RULES.types[r];return i&&i!==!0&&x1(t,i)}ho.schemaHasRulesForType=YJ;function x1(t,e){return e.rules.some(r=>I1(t,r))}ho.shouldUseGroup=x1;function I1(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))}ho.shouldUseRule=I1});var Td=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 QJ=ox(),e3=sx(),t3=Ed(),Ie=Te(),E1=qe(),wc;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(wc||(ur.DataType=wc={}));function r3(t){let e=T1(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=r3;function T1(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(QJ.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ur.getJSONTypes=T1;function n3(t,e){let{gen:r,data:i,opts:n}=t,o=i3(e,n.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,e3.schemaHasRulesForType)(t,e[0]));if(s){let a=cx(e,i,n.strictNumbers,wc.Wrong);r.if(a,()=>{o.length?o3(t,e,o):lx(t)})}return s}ur.coerceAndCheckDataType=n3;var O1=new Set(["string","number","integer","boolean","null"]);function i3(t,e){return e?t.filter(r=>O1.has(r)||e==="array"&&r==="array"):[]}function o3(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(cx(e,n,o.strictNumbers),()=>i.assign(a,n))),i.if((0,Ie._)`${a} !== undefined`);for(let l of r)(O1.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);i.else(),lx(t),i.endIf(),i.if((0,Ie._)`${a} !== undefined`,()=>{i.assign(n,a),s3(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 s3({gen:t,parentData:e,parentDataProperty:r},i){t.if((0,Ie._)`${e} !== undefined`,()=>t.assign((0,Ie._)`${e}[${r}]`,i))}function ax(t,e,r,i=wc.Correct){let n=i===wc.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===wc.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=ax;function cx(t,e,r,i){if(t.length===1)return ax(t[0],e,r,i);let n,o=(0,E1.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,ax(s,e,r,i));return n}ur.checkDataTypes=cx;var a3={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ie._)`{type: ${t}}`:(0,Ie._)`{type: ${e}}`};function lx(t){let e=c3(t);(0,t3.reportError)(e,a3)}ur.reportTypeError=lx;function c3(t){let{gen:e,data:r,schema:i}=t,n=(0,E1.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:t}}});var A1=C(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.assignDefaults=void 0;var $c=Te(),l3=qe();function u3(t,e){let{properties:r,items:i}=t.schema;if(e==="object"&&r)for(let n in r)P1(t,n,r[n].default);else e==="array"&&Array.isArray(i)&&i.forEach((n,o)=>P1(t,o,n.default))}fy.assignDefaults=u3;function P1(t,e,r){let{gen:i,compositeRule:n,data:o,opts:s}=t;if(r===void 0)return;let a=(0,$c._)`${o}${(0,$c.getProperty)(e)}`;if(n){(0,l3.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,$c._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,$c._)`${c} || ${a} === null || ${a} === ""`),i.if(c,(0,$c._)`${a} = ${(0,$c.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(),ux=qe(),mo=zi(),d3=qe();function f3(t,e){let{gen:r,data:i,it:n}=t;r.if(fx(r,i,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,vt._)`${e}`},!0),t.error()})}lt.checkReportMissingProp=f3;function p3({gen:t,data:e,it:{opts:r}},i,n){return(0,vt.or)(...i.map(o=>(0,vt.and)(fx(t,e,o,r.ownProperties),(0,vt._)`${n} = ${o}`)))}lt.checkMissingProp=p3;function h3(t,e){t.setParams({missingProperty:e},!0),t.error()}lt.reportMissingProp=h3;function R1(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,vt._)`Object.prototype.hasOwnProperty`})}lt.hasPropFunc=R1;function dx(t,e,r){return(0,vt._)`${R1(t)}.call(${e}, ${r})`}lt.isOwnProperty=dx;function m3(t,e,r,i){let n=(0,vt._)`${e}${(0,vt.getProperty)(r)} !== undefined`;return i?(0,vt._)`${n} && ${dx(t,e,r)}`:n}lt.propertyInData=m3;function fx(t,e,r,i){let n=(0,vt._)`${e}${(0,vt.getProperty)(r)} === undefined`;return i?(0,vt.or)(n,(0,vt.not)(dx(t,e,r))):n}lt.noPropertyInData=fx;function j1(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}lt.allSchemaProperties=j1;function g3(t,e){return j1(e).filter(r=>!(0,ux.alwaysValidSchema)(t,e[r]))}lt.schemaProperties=g3;function y3({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=[[mo.default.instancePath,(0,vt.strConcat)(mo.default.instancePath,o)],[mo.default.parentData,s.parentData],[mo.default.parentDataProperty,s.parentDataProperty],[mo.default.rootData,mo.default.rootData]];s.opts.dynamicRef&&d.push([mo.default.dynamicAnchors,mo.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=y3;var v3=(0,vt._)`new RegExp`;function _3({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"?v3:(0,d3.useFunc)(t,n)}(${r}, ${i})`})}lt.usePattern=_3;function b3(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:ux.Type.Num},o),e.if((0,vt.not)(o),a)})}}lt.validateArray=b3;function w3(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,ux.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=w3});var N1=C(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.validateKeywordUsage=ri.validSchemaType=ri.funcKeywordCode=ri.macroKeywordCode=void 0;var Sr=Te(),xs=zi(),$3=pn(),k3=Ed();function S3(t,e){let{gen:r,keyword:i,schema:n,parentSchema:o,it:s}=t,a=e.macro.call(s.self,n,o,s),c=C1(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=S3;function x3(t,e){var r;let{gen:i,keyword:n,schema:o,parentSchema:s,$data:a,it:c}=t;E3(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=C1(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&&z1(t),g(()=>t.error());else{let y=e.async?f():h();e.modifying&&z1(t),g(()=>I3(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?xs.default.this:xs.default.self,b=!("compile"in e&&!a||e.schema===!1);i.assign(d,(0,Sr._)`${y}${(0,$3.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=x3;function z1(t){let{gen:e,data:r,it:i}=t;e.if(i.parentData,()=>e.assign(r,(0,Sr._)`${i.parentData}[${i.parentDataProperty}]`))}function I3(t,e){let{gen:r}=t;r.if((0,Sr._)`Array.isArray(${e})`,()=>{r.assign(xs.default.vErrors,(0,Sr._)`${xs.default.vErrors} === null ? ${e} : ${xs.default.vErrors}.concat(${e})`).assign(xs.default.errors,(0,Sr._)`${xs.default.vErrors}.length`),(0,k3.extendErrors)(t)},()=>t.error())}function E3({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function C1(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 T3(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=T3;function O3({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=O3});var L1=C(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.extendSubschemaMode=go.extendSubschemaData=go.getSubschema=void 0;var ni=Te(),D1=qe();function P3(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,D1.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')}go.getSubschema=P3;function A3(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,D1.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]}}go.extendSubschemaData=A3;function R3(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}go.extendSubschemaMode=R3});var px=C((kfe,U1)=>{"use strict";U1.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 F1=C((Sfe,M1)=>{"use strict";var yo=M1.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(){};py(e,i,n,t,"",t)};yo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};yo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};yo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};yo.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 py(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 yo.arrayKeywords)for(var p=0;p<d.length;p++)py(t,e,r,d[p],n+"/"+u+"/"+p,o,n,u,i,p)}else if(u in yo.propsKeywords){if(d&&typeof d=="object")for(var f in d)py(t,e,r,d[f],n+"/"+u+"/"+j3(f),o,n,u,i,f)}else(u in yo.keywords||t.allKeys&&!(u in yo.skipKeywords))&&py(t,e,r,d,n+"/"+u,o,n,u,i)}r(i,n,o,s,a,c,l)}}function j3(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Od=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 z3=qe(),C3=px(),N3=F1(),D3=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function L3(t,e=!0){return typeof t=="boolean"?!0:e===!0?!hx(t):e?Z1(t)<=e:!1}Dr.inlineRef=L3;var U3=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hx(t){for(let e in t){if(U3.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(hx)||typeof r=="object"&&hx(r))return!0}return!1}function Z1(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!D3.has(r)&&(typeof t[r]=="object"&&(0,z3.eachItem)(t[r],i=>e+=Z1(i)),e===1/0))return 1/0}return e}function q1(t,e="",r){r!==!1&&(e=kc(e));let i=t.parse(e);return V1(t,i)}Dr.getFullPath=q1;function V1(t,e){return t.serialize(e).split("#")[0]+"#"}Dr._getFullPath=V1;var M3=/#\/?$/;function kc(t){return t?t.replace(M3,""):""}Dr.normalizeId=kc;function F3(t,e,r){return r=kc(r),t.resolve(e,r)}Dr.resolveUrl=F3;var Z3=/^[a-z_][-a-z0-9._]*$/i;function q3(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=kc(t[r]||e),o={"":n},s=q1(i,n,!1),a={},c=new Set;return N3(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 E=this.opts.uriResolver.resolve;if(b=kc(g?E(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!==kc(m)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=m),b}function v(b){if(typeof b=="string"){if(!Z3.test(b))throw new Error(`invalid anchor "${b}"`);y.call(this,`#${b}`)}}}),a;function l(d,p,f){if(p!==void 0&&!C3(d,p))throw u(f)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Dr.getSchemaRefs=q3});var Rd=C(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.getData=vo.KeywordCxt=vo.validateFunctionCode=void 0;var G1=S1(),B1=Td(),gx=sx(),hy=Td(),V3=A1(),Ad=N1(),mx=L1(),ce=Te(),be=zi(),B3=Od(),Ci=qe(),Pd=Ed();function H3(t){if(Y1(t)&&(Q1(t),X1(t))){G3(t);return}J1(t,()=>(0,G1.topBoolOrEmptySchema)(t))}vo.validateFunctionCode=H3;function J1({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"; ${H1(r,n)}`),K3(t,n),t.code(o)}):t.func(e,(0,ce._)`${be.default.data}, ${W3(n)}`,i.$async,()=>t.code(H1(r,n)).code(o))}function W3(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 K3(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 G3(t){let{schema:e,opts:r,gen:i}=t;J1(t,()=>{r.$comment&&e.$comment&&tL(t),e5(t),i.let(be.default.vErrors,null),i.let(be.default.errors,0),r.unevaluated&&J3(t),eL(t),n5(t)})}function J3(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 H1(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 X3(t,e){if(Y1(t)&&(Q1(t),X1(t))){Y3(t,e);return}(0,G1.boolOrEmptySchema)(t,e)}function X1({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 Y1(t){return typeof t.schema!="boolean"}function Y3(t,e){let{schema:r,gen:i,opts:n}=t;n.$comment&&r.$comment&&tL(t),t5(t),r5(t);let o=i.const("_errs",be.default.errors);eL(t,o),i.var(e,(0,ce._)`${o} === ${be.default.errors}`)}function Q1(t){(0,Ci.checkUnknownRules)(t),Q3(t)}function eL(t,e){if(t.opts.jtd)return W1(t,[],!1,e);let r=(0,B1.getSchemaTypes)(t.schema),i=(0,B1.coerceAndCheckDataType)(t,r);W1(t,r,!i,e)}function Q3(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 e5(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 t5(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,B3.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function r5(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function tL({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 n5(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&&i5(t),e.return((0,ce._)`${be.default.errors} === 0`))}function i5({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 W1(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(()=>nL(t,"$ref",u.all.$ref.definition));return}c.jtd||o5(t,e),n.block(()=>{for(let p of u.rules)d(p);d(u.post)});function d(p){(0,gx.shouldUseGroup)(o,p)&&(p.type?(n.if((0,hy.checkDataType)(p.type,s,c.strictNumbers)),K1(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,hy.reportTypeError)(t)),n.endIf()):K1(t,p),a||n.if((0,ce._)`${be.default.errors} === ${i||0}`))}}function K1(t,e){let{gen:r,schema:i,opts:{useDefaults:n}}=t;n&&(0,V3.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,gx.shouldUseRule)(i,o)&&nL(t,o.keyword,o.definition,e.type)})}function o5(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(s5(t,e),t.opts.allowUnionTypes||a5(t,e),c5(t,t.dataTypes))}function s5(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{rL(t.dataTypes,r)||yx(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),u5(t,e)}}function a5(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&yx(t,"use allowUnionTypes to allow union type keyword")}function c5(t,e){let r=t.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,gx.shouldUseRule)(t.schema,n)){let{type:o}=n.definition;o.length&&!o.some(s=>l5(e,s))&&yx(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function l5(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function rL(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function u5(t,e){let r=[];for(let i of t.dataTypes)rL(e,i)?r.push(i):e.includes("integer")&&i==="number"&&r.push("integer");t.dataTypes=r}function yx(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ci.checkStrictMode)(t,e,t.opts.strictTypes)}var my=class{constructor(e,r,i){if((0,Ad.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",iL(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ad.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?Pd.reportExtraError:Pd.reportError)(this,this.def.error,r)}$dataError(){(0,Pd.reportError)(this,this.def.$dataError||Pd.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Pd.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,hy.checkDataTypes)(c,r,o.opts.strictNumbers,hy.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,mx.getSubschema)(this.it,e);(0,mx.extendSubschemaData)(i,this.it,e),(0,mx.extendSubschemaMode)(i,e);let n={...this.it,...i,items:void 0,props:void 0};return X3(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}};vo.KeywordCxt=my;function nL(t,e,r,i){let n=new my(t,r,e);"code"in r?r.code(n,i):n.$data&&r.validate?(0,Ad.funcKeywordCode)(n,r):"macro"in r?(0,Ad.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Ad.funcKeywordCode)(n,r)}var d5=/^\/(?:[^~]|~0|~1)*$/,f5=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function iL(t,{dataLevel:e,dataNames:r,dataPathArr:i}){let n,o;if(t==="")return be.default.rootData;if(t[0]==="/"){if(!d5.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,o=be.default.rootData}else{let l=f5.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}`}}vo.getData=iL});var gy=C(_x=>{"use strict";Object.defineProperty(_x,"__esModule",{value:!0});var vx=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};_x.default=vx});var jd=C($x=>{"use strict";Object.defineProperty($x,"__esModule",{value:!0});var bx=Od(),wx=class extends Error{constructor(e,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,bx.resolveUrl)(e,r,i),this.missingSchema=(0,bx.normalizeId)((0,bx.getFullPath)(e,this.missingRef))}};$x.default=wx});var vy=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(),p5=gy(),Is=zi(),Cn=Od(),oL=qe(),h5=Rd(),Sc=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=Sc;function Sx(t){let e=sL.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:p5.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:Is.default.data,parentData:Is.default.parentData,parentDataProperty:Is.default.parentDataProperty,dataNames:[Is.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,h5.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(Is.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let f=new Function(`${Is.default.self}`,`${Is.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=Sx;function m5(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=v5.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 Sc({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=g5.call(this,o)}hn.resolveRef=m5;function g5(t){return(0,Cn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Sx.call(this,t)}function sL(t){for(let e of this._compilations)if(y5(e,t))return e}hn.getCompilingSchema=sL;function y5(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function v5(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||yy.call(this,t,e)}function yy(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 kx.call(this,r,t);let o=(0,Cn.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=yy.call(this,t,s);return typeof a?.schema!="object"?void 0:kx.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Sx.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 Sc({schema:a,schemaId:c,root:t,baseId:n})}return kx.call(this,r,s)}}hn.resolveSchema=yy;var _5=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function kx(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,oL.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!_5.has(a)&&l&&(e=(0,Cn.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,oL.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Cn.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=yy.call(this,i,a)}let{schemaId:s}=this.opts;if(o=o||new Sc({schema:r,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}});var aL=C((Pfe,b5)=>{b5.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 Px=C((Afe,hL)=>{"use strict";var w5=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Ix=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),$5=RegExp.prototype.test.bind(/^\d*$/u),Es=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Ex=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),lL=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Tx=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),k5=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 S5(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 x5=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),I5=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),E5=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),T5=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function O5(t){if(t.length===0)return!1;for(let e=0;e<t.length;e++)if(!E5(t[e])){if(t[e]==="%"&&e+2<t.length&&Es(t.slice(e+1,e+3))){e+=2;continue}return!1}return!0}function cL(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 P5(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||!Ix(c))return;o+=2;continue}if(!x5(c))return;n[a]=parseInt(c,16).toString(16),o++}if(e===-1)return o!==8?void 0:cL(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 cL(s)}function xx(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&&I5(i))return i=i.toLowerCase(),{host:`[${i}]`,escapedHost:i,isIPV6:!1,isIPVFuture:!0};if(A5(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),!O5(n))return{host:t,isIPV6:!1,error:!0};i=i.slice(0,o)}let s=P5(i);return s===void 0?{host:t,isIPV6:!1,error:!0}:{host:s+(n?"%"+n:""),escapedHost:s+(n?"%25"+n:""),isIPV6:!0}}function A5(t,e){let r=0;for(let i=0;i<t.length;i++)t[i]===e&&r++;return r}function R5(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 j5={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},z5=/[@/?#:]/g,C5=/[@/?#]/g;function uL(t,e){let r=e?C5:z5;return r.lastIndex=0,t.replace(r,i=>j5[i])}function dL(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(Es(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&Ex(s)?r+=s:r+="%"+o,i+=2;continue}}r+=t[i]}return r}function N5(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(Es(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));s!=="."&&Ex(s)?e+=s:e+="%"+o,r+=2;continue}}if(lL(i))e+=i;else{let n=t.charCodeAt(r);if(n<128)e+=pL(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 D5(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(Es(s)){r+="%"+s.toUpperCase(),n+=2;continue}}if(o==="/"&&(i=!1),lL(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 Ox(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(Es(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 fL(t){return Ox(t,k5)}function L5(t){return Ox(t,Tx)}function U5(t){return Ox(t,Tx)}function pL(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 M5(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(Es(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));Ex(s)?e+=s:e+="%"+o,r+=2;continue}}if(Tx(i))e+=i;else{let n=t.charCodeAt(r);if(n<128)e+=pL(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 F5(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(Es(i)){e+="%"+i.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function Z5(t){let e=[];if(t.userinfo!==void 0&&(e.push(fL(t.userinfo)),e.push("@")),t.host!==void 0){let r=t.host;if(!Ix(r)){let i=xx(r);i.isIPV6!==!0&&i.isIPVFuture!==!0&&(r=dL(r,!0),i=xx(r)),i.isIPV6===!0||i.isIPVFuture===!0?r=`[${i.escapedHost}]`:r=uL(r,!1)}e.push(r)}if(typeof t.port=="number"||typeof t.port=="string"){let r=String(t.port);if(!$5(r))throw new TypeError("URI port is malformed.");e.push(":"),e.push(r)}return e.length?e.join(""):void 0}hL.exports={nonSimpleDomain:T5,recomposeAuthority:Z5,reescapeHostDelimiters:uL,normalizePercentEncoding:dL,normalizePathEncoding:N5,serializePathEncoding:D5,normalizeQueryFragmentEncoding:M5,encodeUserinfo:fL,encodeQuery:L5,encodeFragment:U5,escapePreservingEscapes:F5,removeDotSegments:R5,isIPv4:Ix,isUUID:w5,normalizeIPv6:xx,stringArrayToHexStripped:S5}});var _L=C((Rfe,vL)=>{"use strict";var{isUUID:q5}=Px(),V5=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,B5=["http","https","ws","wss","urn","urn:uuid"];function H5(t){return B5.indexOf(t)!==-1}function Ax(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 mL(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function gL(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 W5(t){return t.secure=Ax(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function K5(t){if((t.port===(Ax(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 G5(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(V5);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=Rx(n);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function J5(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=Rx(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 X5(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!q5(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Y5(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var yL={scheme:"http",domainHost:!0,parse:mL,serialize:gL},Q5={scheme:"https",domainHost:yL.domainHost,parse:mL,serialize:gL},_y={scheme:"ws",domainHost:!0,parse:W5,serialize:K5},e8={scheme:"wss",domainHost:_y.domainHost,parse:_y.parse,serialize:_y.serialize},t8={scheme:"urn",parse:G5,serialize:J5,skipNormalize:!0},r8={scheme:"urn:uuid",parse:X5,serialize:Y5,skipNormalize:!0},by={http:yL,https:Q5,ws:_y,wss:e8,urn:t8,"urn:uuid":r8};Object.setPrototypeOf(by,null);function Rx(t){return t&&(by[t]||by[t.toLowerCase()])||void 0}vL.exports={wsIsSecure:Ax,SCHEMES:by,isValidSchemeName:H5,getSchemeHandler:Rx}});var RL=C((jfe,ky)=>{"use strict";var{normalizeIPv6:SL,removeDotSegments:Cd,recomposeAuthority:n8,normalizePercentEncoding:jx,normalizePathEncoding:i8,serializePathEncoding:bL,normalizeQueryFragmentEncoding:wL,encodeQuery:o8,encodeFragment:s8,reescapeHostDelimiters:a8,isIPv4:xL,nonSimpleDomain:c8}=Px(),{SCHEMES:IL,getSchemeHandler:zx}=_L(),EL=/^[A-Za-z][A-Za-z0-9+.-]*$/u,TL="URI scheme is malformed.";function $L(t){let e=unescape(String(t));if(!EL.test(e))throw new TypeError(TL);return e}function l8(t,e){return typeof t=="string"?t=y8(t,e):typeof t=="object"&&(t=$y(Ts(t,e),e)),t}function u8(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}=wy(t,i),{parsed:u,malformedAuthorityOrPort:d,malformedPercentEncoding:p,malformedSchemeSpecific:f,malformedHost:h,malformedScheme:m}=wy(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=OL(n,u,i,!0),y=zx(r&&r.scheme||g.scheme),v=g.host,b=v!==void 0&&v!==""&&(xL(v)||SL(v).isIPV6);PL(g,r||{},y,b);let E=v&&v.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(v);if(g.error&&!E)throw new Error(g.error);return i.skipEscape=!0,Ts(g,i)}function OL(t,e,r,i){let n={};return i||(t=$y(Ts(t,r),r),e=$y(Ts(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=Cd(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=Cd(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Cd(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=Cd(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 d8(t,e,r){let i=kL(t,r),n=kL(e,r);return i!==void 0&&n!==void 0&&i===n}function Ts(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=$L(r.scheme));let o=zx(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=jx(r.path):r.path=bL(r.path,a)),i.reference!=="suffix"&&r.scheme&&(r.scheme=$L(r.scheme),n.push(r.scheme,":"));let c=n8(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=Cd(l)),a&&(l=bL(l,!0)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),n.push(l)}return r.query!==void 0&&n.push("?",o8(r.query)),r.fragment!==void 0&&n.push("#",s8(r.fragment)),n.join("")}var f8=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,p8=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,h8=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function m8(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 zd(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 Cx(t){return t[0]==="["&&t[t.length-1]==="]"}function g8(t){let e=t[4];return zd(t[3])||e!==void 0&&!Cx(e)&&zd(e)||zd(t[6])||zd(t[7])||zd(t[8])}function PL(t,e,r,i){if(!e.unicodeSupport&&(!r||!r.unicodeSupport)&&t.host&&!Cx(t.host)&&(e.domainHost||r&&r.domainHost)&&i===!1&&c8(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 wy(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(p8);d!==null&&d[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",n=!0);let p=t.match(h8);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(f8);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);EL.test(g)?i.scheme=g.toLowerCase():(i.error=i.error||TL,l=!0)}o=g8(f),o&&(i.error=i.error||"URI contains malformed percent-encoding."),isNaN(i.port)&&(i.port=f[5]);let h=m8(i,f);if(h!==void 0&&(i.error=i.error||h,n=!0),i.host)if(xL(i.host)===!1){let y=Cx(i.host),v=i.host.indexOf("[")!==-1||i.host.indexOf("]")!==-1,b=SL(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=zx(r.scheme||i.scheme);if(c||(a=PL(i,r,m,u)),t.indexOf("%")!==-1&&i.host!==void 0&&!c){let g=u?i.host:jx(i.host,!0);u||(g=jx(g.toLowerCase())),i.host=a8(g,u)}(!m||m&&!m.skipNormalize)&&(i.path&&(i.path=i8(i.path)),i.query&&(i.query=wL(i.query)),i.fragment&&(i.fragment=wL(i.fragment))),m&&m.parse&&(m.parse(i,r),m===IL.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 $y(t,e){return wy(t,e).parsed}function y8(t,e){return AL(t,e).normalized}function AL(t,e){let{parsed:r,malformedAuthorityOrPort:i,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:s,malformedScheme:a}=wy(t,e);return{normalized:i||n||o||s||a?t:Ts(r,e),malformedAuthorityOrPort:i,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:s,malformedScheme:a}}function kL(t,e){if(typeof t!="string"&&typeof t!="object")return;let r;try{r=typeof t=="string"?t:Ts(t,e)}catch{return}let{normalized:i,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:s,malformedHost:a,malformedScheme:c}=AL(r,e);return n||o||s||a||c?void 0:i}var Nx={SCHEMES:IL,normalize:l8,resolve:u8,resolveComponent:OL,equal:d8,serialize:Ts,parse:$y};ky.exports=Nx;ky.exports.default=Nx;ky.exports.fastUri=Nx});var zL=C(Dx=>{"use strict";Object.defineProperty(Dx,"__esModule",{value:!0});var jL=RL();jL.code='require("ajv/dist/runtime/uri").default';Dx.default=jL});var ZL=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 v8=Rd();Object.defineProperty(nr,"KeywordCxt",{enumerable:!0,get:function(){return v8.KeywordCxt}});var xc=Te();Object.defineProperty(nr,"_",{enumerable:!0,get:function(){return xc._}});Object.defineProperty(nr,"str",{enumerable:!0,get:function(){return xc.str}});Object.defineProperty(nr,"stringify",{enumerable:!0,get:function(){return xc.stringify}});Object.defineProperty(nr,"nil",{enumerable:!0,get:function(){return xc.nil}});Object.defineProperty(nr,"Name",{enumerable:!0,get:function(){return xc.Name}});Object.defineProperty(nr,"CodeGen",{enumerable:!0,get:function(){return xc.CodeGen}});var _8=gy(),UL=jd(),b8=ox(),Nd=vy(),w8=Te(),Dd=Od(),Sy=Td(),Ux=qe(),CL=aL(),$8=zL(),ML=(t,e)=>new RegExp(t,e);ML.code="new RegExp";var k8=["removeAdditional","useDefaults","coerceTypes"],S8=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x8={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."},I8={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},NL=200;function E8(t){var e,r,i,n,o,s,a,c,l,u,d,p,f,h,m,g,y,v,b,E,k,I,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:ML,pt=(n=t.uriResolver)!==null&&n!==void 0?n:$8.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:NL,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:NL,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:(E=t.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(k=t.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(I=t.validateSchema)!==null&&I!==void 0?I:!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 Ld=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,...E8(e)};let{es5:r,lines:i}=this.opts.code;this.scope=new w8.ValueScope({scope:{},prefixes:S8,es5:r,lines:i}),this.logger=j8(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,b8.getRules)(),DL.call(this,x8,e,"NOT SUPPORTED"),DL.call(this,I8,e,"DEPRECATED","warn"),this._metaOpts=A8.call(this),e.formats&&O8.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&P8.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),T8.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:i}=this.opts,n=CL;i==="id"&&(n={...CL},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 UL.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,Dd.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=LL.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Nd.SchemaEnv({schema:{},schemaId:i});if(r=Nd.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=LL.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,Dd.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(C8.call(this,i,r),!r)return(0,Ux.eachItem)(i,o=>Lx.call(this,o)),this;D8.call(this,r);let n={...r,type:(0,Sy.getJSONTypes)(r.type),schemaType:(0,Sy.getJSONTypes)(r.schemaType)};return(0,Ux.eachItem)(i,n.type.length===0?o=>Lx.call(this,o,n):o=>n.type.forEach(s=>Lx.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]=FL(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,Dd.normalizeId)(s||i);let l=Dd.getSchemaRefs.call(this,e,i);return c=new Nd.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):Nd.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{Nd.compileSchema.call(this,e)}finally{this.opts=r}}};Ld.ValidationError=_8.default;Ld.MissingRefError=UL.default;nr.default=Ld;function DL(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 LL(t){return t=(0,Dd.normalizeId)(t),this.schemas[t]||this.refs[t]}function T8(){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 O8(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function P8(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 A8(){let t={...this.opts};for(let e of k8)delete t[e];return t}var R8={log(){},warn(){},error(){}};function j8(t){if(t===!1)return R8;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 z8=/^[a-z_$][a-z0-9_$:-]*$/i;function C8(t,e){let{RULES:r}=this;if((0,Ux.eachItem)(t,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!z8.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 Lx(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,Sy.getJSONTypes)(e.type),schemaType:(0,Sy.getJSONTypes)(e.schemaType)}};e.before?N8.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 N8(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 D8(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=FL(e)),t.validateSchema=this.compile(e,!0))}var L8={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function FL(t){return{anyOf:[t,L8]}}});var qL=C(Mx=>{"use strict";Object.defineProperty(Mx,"__esModule",{value:!0});var U8={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Mx.default=U8});var WL=C(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.callRef=Os.getValidate=void 0;var M8=jd(),VL=pn(),Ur=Te(),Ic=zi(),BL=vy(),xy=qe(),F8={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=BL.resolveRef.call(c,l,n,r);if(u===void 0)throw new M8.default(i.opts.uriResolver,n,r);if(u instanceof BL.SchemaEnv)return p(u);return f(u);function d(){if(o===l)return Iy(t,s,o,o.$async);let h=e.scopeValue("root",{ref:l});return Iy(t,(0,Ur._)`${h}.validate`,l,l.$async)}function p(h){let m=HL(t,h);Iy(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 HL(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ur._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Os.getValidate=HL;function Iy(t,e,r,i){let{gen:n,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Ic.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,VL.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,VL.callValidateCode)(t,e,l),()=>f(e),()=>p(e))}function p(h){let m=(0,Ur._)`${h}.errors`;n.assign(Ic.default.vErrors,(0,Ur._)`${Ic.default.vErrors} === null ? ${m} : ${Ic.default.vErrors}.concat(${m})`),n.assign(Ic.default.errors,(0,Ur._)`${Ic.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=xy.mergeEvaluated.props(n,g.props,o.props));else{let y=n.var("props",(0,Ur._)`${h}.evaluated.props`);o.props=xy.mergeEvaluated.props(n,y,o.props,Ur.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=xy.mergeEvaluated.items(n,g.items,o.items));else{let y=n.var("items",(0,Ur._)`${h}.evaluated.items`);o.items=xy.mergeEvaluated.items(n,y,o.items,Ur.Name)}}}Os.callRef=Iy;Os.default=F8});var KL=C(Fx=>{"use strict";Object.defineProperty(Fx,"__esModule",{value:!0});var Z8=qL(),q8=WL(),V8=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Z8.default,q8.default];Fx.default=V8});var GL=C(Zx=>{"use strict";Object.defineProperty(Zx,"__esModule",{value:!0});var Ey=Te(),_o=Ey.operators,Ty={maximum:{okStr:"<=",ok:_o.LTE,fail:_o.GT},minimum:{okStr:">=",ok:_o.GTE,fail:_o.LT},exclusiveMaximum:{okStr:"<",ok:_o.LT,fail:_o.GTE},exclusiveMinimum:{okStr:">",ok:_o.GT,fail:_o.LTE}},B8={message:({keyword:t,schemaCode:e})=>(0,Ey.str)`must be ${Ty[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ey._)`{comparison: ${Ty[t].okStr}, limit: ${e}}`},H8={keyword:Object.keys(Ty),type:"number",schemaType:"number",$data:!0,error:B8,code(t){let{keyword:e,data:r,schemaCode:i}=t;t.fail$data((0,Ey._)`${r} ${Ty[e].fail} ${i} || isNaN(${r})`)}};Zx.default=H8});var JL=C(qx=>{"use strict";Object.defineProperty(qx,"__esModule",{value:!0});var Ud=Te(),W8={message:({schemaCode:t})=>(0,Ud.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Ud._)`{multipleOf: ${t}}`},K8={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:W8,code(t){let{gen:e,data:r,schemaCode:i,it:n}=t,o=n.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Ud._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Ud._)`${s} !== parseInt(${s})`;t.fail$data((0,Ud._)`(${i} === 0 || (${s} = ${r}/${i}, ${a}))`)}};qx.default=K8});var YL=C(Vx=>{"use strict";Object.defineProperty(Vx,"__esModule",{value:!0});function XL(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}Vx.default=XL;XL.code='require("ajv/dist/runtime/ucs2length").default'});var QL=C(Bx=>{"use strict";Object.defineProperty(Bx,"__esModule",{value:!0});var Ps=Te(),G8=qe(),J8=YL(),X8={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ps.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Ps._)`{limit: ${t}}`},Y8={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:X8,code(t){let{keyword:e,data:r,schemaCode:i,it:n}=t,o=e==="maxLength"?Ps.operators.GT:Ps.operators.LT,s=n.opts.unicode===!1?(0,Ps._)`${r}.length`:(0,Ps._)`${(0,G8.useFunc)(t.gen,J8.default)}(${r})`;t.fail$data((0,Ps._)`${s} ${o} ${i}`)}};Bx.default=Y8});var eU=C(Hx=>{"use strict";Object.defineProperty(Hx,"__esModule",{value:!0});var Q8=pn(),eX=qe(),Ec=Te(),tX={message:({schemaCode:t})=>(0,Ec.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Ec._)`{pattern: ${t}}`},rX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:tX,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,Ec._)`new RegExp`:(0,eX.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Ec._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Ec._)`!${u}`)}else{let c=(0,Q8.usePattern)(t,n);t.fail$data((0,Ec._)`!${c}.test(${r})`)}}};Hx.default=rX});var tU=C(Wx=>{"use strict";Object.defineProperty(Wx,"__esModule",{value:!0});var Md=Te(),nX={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Md.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Md._)`{limit: ${t}}`},iX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:nX,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxProperties"?Md.operators.GT:Md.operators.LT;t.fail$data((0,Md._)`Object.keys(${r}).length ${n} ${i}`)}};Wx.default=iX});var rU=C(Kx=>{"use strict";Object.defineProperty(Kx,"__esModule",{value:!0});var Fd=pn(),Zd=Te(),oX=qe(),sX={message:({params:{missingProperty:t}})=>(0,Zd.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Zd._)`{missingProperty: ${t}}`},aX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sX,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,oX.checkStrictMode)(s,y,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(Zd.nil,d);else for(let f of r)(0,Fd.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,Fd.checkMissingProp)(t,r,f)),(0,Fd.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",i,f=>{t.setParams({missingProperty:f}),e.if((0,Fd.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,h){t.setParams({missingProperty:f}),e.forOf(f,i,()=>{e.assign(h,(0,Fd.propertyInData)(e,n,f,a.ownProperties)),e.if((0,Zd.not)(h),()=>{t.error(),e.break()})},Zd.nil)}}};Kx.default=aX});var nU=C(Gx=>{"use strict";Object.defineProperty(Gx,"__esModule",{value:!0});var qd=Te(),cX={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,qd.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,qd._)`{limit: ${t}}`},lX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:cX,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxItems"?qd.operators.GT:qd.operators.LT;t.fail$data((0,qd._)`${r}.length ${n} ${i}`)}};Gx.default=lX});var Oy=C(Jx=>{"use strict";Object.defineProperty(Jx,"__esModule",{value:!0});var iU=px();iU.code='require("ajv/dist/runtime/equal").default';Jx.default=iU});var oU=C(Yx=>{"use strict";Object.defineProperty(Yx,"__esModule",{value:!0});var Xx=Td(),ir=Te(),uX=qe(),dX=Oy(),fX={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}}`},pX={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:fX,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,Xx.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,Xx.checkDataTypes)(l,g,a.opts.strictNumbers,Xx.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,uX.useFunc)(e,dX.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)})))}}};Yx.default=pX});var sU=C(eI=>{"use strict";Object.defineProperty(eI,"__esModule",{value:!0});var Qx=Te(),hX=qe(),mX=Oy(),gX={message:"must be equal to constant",params:({schemaCode:t})=>(0,Qx._)`{allowedValue: ${t}}`},yX={keyword:"const",$data:!0,error:gX,code(t){let{gen:e,data:r,$data:i,schemaCode:n,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,Qx._)`!${(0,hX.useFunc)(e,mX.default)}(${r}, ${n})`):t.fail((0,Qx._)`${o} !== ${r}`)}};eI.default=yX});var aU=C(tI=>{"use strict";Object.defineProperty(tI,"__esModule",{value:!0});var Vd=Te(),vX=qe(),_X=Oy(),bX={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Vd._)`{allowedValues: ${t}}`},wX={keyword:"enum",schemaType:"array",$data:!0,error:bX,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,vX.useFunc)(e,_X.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,Vd.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,Vd._)`${l()}(${r}, ${f})`,()=>e.assign(u,!0).break()))}function p(f,h){let m=n[h];return typeof m=="object"&&m!==null?(0,Vd._)`${l()}(${r}, ${f}[${h}])`:(0,Vd._)`${r} === ${m}`}}};tI.default=wX});var cU=C(rI=>{"use strict";Object.defineProperty(rI,"__esModule",{value:!0});var $X=GL(),kX=JL(),SX=QL(),xX=eU(),IX=tU(),EX=rU(),TX=nU(),OX=oU(),PX=sU(),AX=aU(),RX=[$X.default,kX.default,SX.default,xX.default,IX.default,EX.default,TX.default,OX.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},PX.default,AX.default];rI.default=RX});var iI=C(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.validateAdditionalItems=void 0;var As=Te(),nI=qe(),jX={message:({params:{len:t}})=>(0,As.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,As._)`{limit: ${t}}`},zX={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:jX,code(t){let{parentSchema:e,it:r}=t,{items:i}=e;if(!Array.isArray(i)){(0,nI.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}lU(t,i)}};function lU(t,e){let{gen:r,schema:i,data:n,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,As._)`${n}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,As._)`${a} <= ${e.length}`);else if(typeof i=="object"&&!(0,nI.alwaysValidSchema)(s,i)){let l=r.var("valid",(0,As._)`${a} <= ${e.length}`);r.if((0,As.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:nI.Type.Num},l),s.allErrors||r.if((0,As.not)(l),()=>r.break())})}}Bd.validateAdditionalItems=lU;Bd.default=zX});var oI=C(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.validateTuple=void 0;var uU=Te(),Py=qe(),CX=pn(),NX={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return dU(t,"additionalItems",e);r.items=!0,!(0,Py.alwaysValidSchema)(r,e)&&t.ok((0,CX.validateArray)(t))}};function dU(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=Py.mergeEvaluated.items(i,r.length,a.items));let c=i.name("valid"),l=i.const("len",(0,uU._)`${o}.length`);r.forEach((d,p)=>{(0,Py.alwaysValidSchema)(a,d)||(i.if((0,uU._)`${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,Py.checkStrictMode)(a,g,p.strictTuples)}}}Hd.validateTuple=dU;Hd.default=NX});var fU=C(sI=>{"use strict";Object.defineProperty(sI,"__esModule",{value:!0});var DX=oI(),LX={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,DX.validateTuple)(t,"items")};sI.default=LX});var hU=C(aI=>{"use strict";Object.defineProperty(aI,"__esModule",{value:!0});var pU=Te(),UX=qe(),MX=pn(),FX=iI(),ZX={message:({params:{len:t}})=>(0,pU.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,pU._)`{limit: ${t}}`},qX={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ZX,code(t){let{schema:e,parentSchema:r,it:i}=t,{prefixItems:n}=r;i.items=!0,!(0,UX.alwaysValidSchema)(i,e)&&(n?(0,FX.validateAdditionalItems)(t,n):t.ok((0,MX.validateArray)(t)))}};aI.default=qX});var mU=C(cI=>{"use strict";Object.defineProperty(cI,"__esModule",{value:!0});var mn=Te(),Ay=qe(),VX={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}}`},BX={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:VX,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,Ay.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Ay.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Ay.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:Ay.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)))}}};cI.default=BX});var vU=C(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.validateSchemaDeps=ii.validatePropertyDeps=ii.error=void 0;var lI=Te(),HX=qe(),Wd=pn();ii.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let i=e===1?"property":"properties";return(0,lI.str)`must have ${i} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:i}})=>(0,lI._)`{property: ${t},
129
+ missingProperty: ${i},
130
+ depsCount: ${e},
131
+ deps: ${r}}`};var WX={keyword:"dependencies",type:"object",schemaType:"object",error:ii.error,code(t){let[e,r]=KX(t);gU(t,e),yU(t,r)}};function KX({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 gU(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,Wd.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,Wd.checkReportMissingProp)(t,l)}):(r.if((0,lI._)`${c} && (${(0,Wd.checkMissingProp)(t,a,o)})`),(0,Wd.reportMissingProp)(t,o),r.else())}}ii.validatePropertyDeps=gU;function yU(t,e=t.schema){let{gen:r,data:i,keyword:n,it:o}=t,s=r.name("valid");for(let a in e)(0,HX.alwaysValidSchema)(o,e[a])||(r.if((0,Wd.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=yU;ii.default=WX});var bU=C(uI=>{"use strict";Object.defineProperty(uI,"__esModule",{value:!0});var _U=Te(),GX=qe(),JX={message:"property name must be valid",params:({params:t})=>(0,_U._)`{propertyName: ${t.propertyName}}`},XX={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:JX,code(t){let{gen:e,schema:r,data:i,it:n}=t;if((0,GX.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,_U.not)(o),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(o)}};uI.default=XX});var fI=C(dI=>{"use strict";Object.defineProperty(dI,"__esModule",{value:!0});var Ry=pn(),Nn=Te(),YX=zi(),jy=qe(),QX={message:"must NOT have additional properties",params:({params:t})=>(0,Nn._)`{additionalProperty: ${t.additionalProperty}}`},e7={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:QX,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,jy.alwaysValidSchema)(s,r))return;let l=(0,Ry.allSchemaProperties)(i.properties),u=(0,Ry.allSchemaProperties)(i.patternProperties);d(),t.ok((0,Nn._)`${o} === ${YX.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,jy.schemaRefOrVal)(s,i.properties,"properties");y=(0,Ry.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,Ry.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,jy.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:jy.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,y)}}};dI.default=e7});var kU=C(hI=>{"use strict";Object.defineProperty(hI,"__esModule",{value:!0});var t7=Rd(),wU=pn(),pI=qe(),$U=fI(),r7={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&&$U.default.code(new t7.KeywordCxt(o,$U.default,"additionalProperties"));let s=(0,wU.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=pI.mergeEvaluated.props(e,(0,pI.toHash)(s),o.props));let a=s.filter(d=>!(0,pI.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,wU.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)}}};hI.default=r7});var EU=C(mI=>{"use strict";Object.defineProperty(mI,"__esModule",{value:!0});var SU=pn(),zy=Te(),xU=qe(),IU=qe(),n7={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,SU.allSchemaProperties)(r),c=a.filter(m=>(0,xU.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 zy.Name)&&(o.props=(0,IU.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,xU.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){e.forIn("key",i,g=>{e.if((0,zy._)`${(0,SU.usePattern)(t,m)}.test(${g})`,()=>{let y=c.includes(m);y||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:IU.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,zy._)`${d}[${g}]`,!0):!y&&!o.allErrors&&e.if((0,zy.not)(u),()=>e.break())})})}}};mI.default=n7});var TU=C(gI=>{"use strict";Object.defineProperty(gI,"__esModule",{value:!0});var i7=qe(),o7={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:i}=t;if((0,i7.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"}};gI.default=o7});var OU=C(yI=>{"use strict";Object.defineProperty(yI,"__esModule",{value:!0});var s7=pn(),a7={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:s7.validateUnion,error:{message:"must match a schema in anyOf"}};yI.default=a7});var PU=C(vI=>{"use strict";Object.defineProperty(vI,"__esModule",{value:!0});var Cy=Te(),c7=qe(),l7={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Cy._)`{passingSchemas: ${t.passing}}`},u7={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:l7,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,c7.alwaysValidSchema)(n,u)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Cy._)`${c} && ${s}`).assign(s,!1).assign(a,(0,Cy._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Cy.Name)})})}}};vI.default=u7});var AU=C(_I=>{"use strict";Object.defineProperty(_I,"__esModule",{value:!0});var d7=qe(),f7={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,d7.alwaysValidSchema)(i,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},n);t.ok(n),t.mergeEvaluated(a)})}};_I.default=f7});var zU=C(bI=>{"use strict";Object.defineProperty(bI,"__esModule",{value:!0});var Ny=Te(),jU=qe(),p7={message:({params:t})=>(0,Ny.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ny._)`{failingKeyword: ${t.ifClause}}`},h7={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:p7,code(t){let{gen:e,parentSchema:r,it:i}=t;r.then===void 0&&r.else===void 0&&(0,jU.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=RU(i,"then"),o=RU(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,Ny.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,Ny._)`${u}`):t.setParams({ifClause:u})}}}};function RU(t,e){let r=t.schema[e];return r!==void 0&&!(0,jU.alwaysValidSchema)(t,r)}bI.default=h7});var CU=C(wI=>{"use strict";Object.defineProperty(wI,"__esModule",{value:!0});var m7=qe(),g7={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,m7.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};wI.default=g7});var NU=C($I=>{"use strict";Object.defineProperty($I,"__esModule",{value:!0});var y7=iI(),v7=fU(),_7=oI(),b7=hU(),w7=mU(),$7=vU(),k7=bU(),S7=fI(),x7=kU(),I7=EU(),E7=TU(),T7=OU(),O7=PU(),P7=AU(),A7=zU(),R7=CU();function j7(t=!1){let e=[E7.default,T7.default,O7.default,P7.default,A7.default,R7.default,k7.default,S7.default,$7.default,x7.default,I7.default];return t?e.push(v7.default,b7.default):e.push(y7.default,_7.default),e.push(w7.default),e}$I.default=j7});var DU=C(kI=>{"use strict";Object.defineProperty(kI,"__esModule",{value:!0});var Dt=Te(),z7={message:({schemaCode:t})=>(0,Dt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Dt._)`{format: ${t}}`},C7={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:z7,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 E=u.$async?(0,Dt._)`(${m}.async ? await ${y}(${i}) : ${y}(${i}))`:(0,Dt._)`${y}(${i})`,k=(0,Dt._)`(typeof ${y} == "function" ? ${E} : ${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(E());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 I=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:I});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,Dt._)`${O}.validate`]:["string",k,O]}function E(){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})`}}}};kI.default=C7});var LU=C(SI=>{"use strict";Object.defineProperty(SI,"__esModule",{value:!0});var N7=DU(),D7=[N7.default];SI.default=D7});var UU=C(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.contentVocabulary=Tc.metadataVocabulary=void 0;Tc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Tc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var FU=C(xI=>{"use strict";Object.defineProperty(xI,"__esModule",{value:!0});var L7=KL(),U7=cU(),M7=NU(),F7=LU(),MU=UU(),Z7=[L7.default,U7.default,(0,M7.default)(),F7.default,MU.metadataVocabulary,MU.contentVocabulary];xI.default=Z7});var qU=C(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.DiscrError=void 0;var ZU;(function(t){t.Tag="tag",t.Mapping="mapping"})(ZU||(Dy.DiscrError=ZU={}))});var BU=C(EI=>{"use strict";Object.defineProperty(EI,"__esModule",{value:!0});var Oc=Te(),II=qU(),VU=vy(),q7=jd(),V7=qe(),B7={message:({params:{discrError:t,tagName:e}})=>t===II.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Oc._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},H7={keyword:"discriminator",type:"object",schemaType:"object",error:B7,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,Oc._)`${r}${(0,Oc.getProperty)(a)}`);e.if((0,Oc._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:II.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,Oc._)`${l} === ${h}`),e.assign(c,d(f[h]));e.else(),t.error(!1,{discrError:II.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,Oc.Name),h}function p(){var f;let h={},m=y(n),g=!0;for(let E=0;E<s.length;E++){let k=s[E];if(k?.$ref&&!(0,V7.schemaHasRulesButRef)(k,o.self.RULES)){let O=k.$ref;if(k=VU.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,O),k instanceof VU.SchemaEnv&&(k=k.schema),k===void 0)throw new q7.default(o.opts.uriResolver,o.baseId,O)}let I=(f=k?.properties)===null||f===void 0?void 0:f[a];if(typeof I!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||y(k)),v(I,E)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return h;function y({required:E}){return Array.isArray(E)&&E.includes(a)}function v(E,k){if(E.const)b(E.const,k);else if(E.enum)for(let I of E.enum)b(I,k);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(E,k){if(typeof E!="string"||E in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[E]=k}}}};EI.default=H7});var HU=C((wpe,W7)=>{W7.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 OI=C((_t,TI)=>{"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 K7=ZL(),G7=FU(),J7=BU(),WU=HU(),X7=["/properties"],Ly="http://json-schema.org/draft-07/schema",Pc=class extends K7.default{_addVocabularies(){super._addVocabularies(),G7.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(J7.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(WU,X7):WU;this.addMetaSchema(e,Ly,!1),this.refs["http://json-schema.org/schema"]=Ly}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ly)?Ly:void 0)}};_t.Ajv=Pc;TI.exports=_t=Pc;TI.exports.Ajv=Pc;Object.defineProperty(_t,"__esModule",{value:!0});_t.default=Pc;var Y7=Rd();Object.defineProperty(_t,"KeywordCxt",{enumerable:!0,get:function(){return Y7.KeywordCxt}});var Ac=Te();Object.defineProperty(_t,"_",{enumerable:!0,get:function(){return Ac._}});Object.defineProperty(_t,"str",{enumerable:!0,get:function(){return Ac.str}});Object.defineProperty(_t,"stringify",{enumerable:!0,get:function(){return Ac.stringify}});Object.defineProperty(_t,"nil",{enumerable:!0,get:function(){return Ac.nil}});Object.defineProperty(_t,"Name",{enumerable:!0,get:function(){return Ac.Name}});Object.defineProperty(_t,"CodeGen",{enumerable:!0,get:function(){return Ac.CodeGen}});var Q7=gy();Object.defineProperty(_t,"ValidationError",{enumerable:!0,get:function(){return Q7.default}});var eY=jd();Object.defineProperty(_t,"MissingRefError",{enumerable:!0,get:function(){return eY.default}})});var tM=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(XU,jI),time:oi(AI(!0),zI),"date-time":oi(KU(!0),QU),"iso-time":oi(AI(),YU),"iso-date-time":oi(KU(),eM),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:sY,"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:pY,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:aY,int32:{type:"number",validate:uY},int64:{type:"number",validate:dY},float:{type:"number",validate:JU},double:{type:"number",validate:JU},password:!0,binary:!0};si.fastFormats={...si.fullFormats,date:oi(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,jI),time:oi(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,zI),"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,QU),"iso-time":oi(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,YU),"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,eM),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 tY(t){return t%4===0&&(t%100!==0||t%400===0)}var rY=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,nY=[0,31,28,31,30,31,30,31,31,30,31,30,31];function XU(t){let e=rY.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&&tY(r)?29:nY[i])}function jI(t,e){if(t&&e)return t>e?1:t<e?-1:0}var PI=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function AI(t){return function(r){let i=PI.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 zI(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 YU(t,e){if(!(t&&e))return;let r=PI.exec(t),i=PI.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 RI=/t|\s/i;function KU(t){let e=AI(t);return function(i){let n=i.split(RI);return n.length===2&&XU(n[0])&&e(n[1])}}function QU(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),i=new Date(e).valueOf();if(r&&i)return r-i}function eM(t,e){if(!(t&&e))return;let[r,i]=t.split(RI),[n,o]=e.split(RI),s=jI(r,n);if(s!==void 0)return s||zI(i,o)}var iY=/\/|:/,oY=/^(?:[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 sY(t){return iY.test(t)&&oY.test(t)}var GU=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function aY(t){return GU.lastIndex=0,GU.test(t)}var cY=-(2**31),lY=2**31-1;function uY(t){return Number.isInteger(t)&&t<=lY&&t>=cY}function dY(t){return Number.isInteger(t)}function JU(){return!0}var fY=/[^\\]\\Z/;function pY(t){if(fY.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var rM=C(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.formatLimitDefinition=void 0;var hY=OI(),Dn=Te(),bo=Dn.operators,Uy={formatMaximum:{okStr:"<=",ok:bo.LTE,fail:bo.GT},formatMinimum:{okStr:">=",ok:bo.GTE,fail:bo.LT},formatExclusiveMaximum:{okStr:"<",ok:bo.LT,fail:bo.GTE},formatExclusiveMinimum:{okStr:">",ok:bo.GT,fail:bo.LTE}},mY={message:({keyword:t,schemaCode:e})=>(0,Dn.str)`should be ${Uy[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Dn._)`{comparison: ${Uy[t].okStr}, limit: ${e}}`};Rc.formatLimitDefinition={keyword:Object.keys(Uy),type:"string",schemaType:"string",$data:!0,error:mY,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 hY.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}) ${Uy[n].fail} 0`}},dependencies:["format"]};var gY=t=>(t.addKeyword(Rc.formatLimitDefinition),t);Rc.default=gY});var sM=C((Kd,oM)=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});var jc=tM(),yY=rM(),CI=Te(),nM=new CI.Name("fullFormats"),vY=new CI.Name("fastFormats"),NI=(t,e={keywords:!0})=>{if(Array.isArray(e))return iM(t,e,jc.fullFormats,nM),t;let[r,i]=e.mode==="fast"?[jc.fastFormats,vY]:[jc.fullFormats,nM],n=e.formats||jc.formatNames;return iM(t,n,r,i),e.keywords&&(0,yY.default)(t),t};NI.get=(t,e="full")=>{let i=(e==="fast"?jc.fastFormats:jc.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function iM(t,e,r,i){var n,o;(n=(o=t.opts.code).formats)!==null&&n!==void 0||(o.formats=(0,CI._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,r[s])}oM.exports=Kd=NI;Object.defineProperty(Kd,"__esModule",{value:!0});Kd.default=NI});function _Y(){let t=new aM.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,cM.default)(t),t}var aM,cM,My,lM=w(()=>{aM=So(OI(),1),cM=So(sM(),1);My=class{constructor(e){this._ajv=e??_Y()}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 Fy,uM=w(()=>{gc();Fy=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},yd,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},mc,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 dM(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 fM(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 pM=w(()=>{});var Zy,hM=w(()=>{c1();gc();lM();Gu();uM();pM();Zy=class extends ny{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(gd.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 My,this.setRequestHandler(V0,i=>this._oninitialize(i)),this.setNotificationHandler(B0,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Y0,async(i,n)=>{let o=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,a=gd.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Fy(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=a1(this._capabilities,e)}setRequestHandler(e,r){let n=no(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let o=rc(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=ro(hc,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=ro(fc,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=ro(Bg,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){fM(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&dM(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:aD.includes(r)?r:U0,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"},Og)}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},Q0,r):this.request({method:"sampling/createMessage",params:e},yd,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},mc,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},mc,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},eS,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 DI(t){return!!t&&typeof t=="object"&&gM in t}function yM(t){return t[gM]?.complete}var gM,mM,vM=w(()=>{gM=Symbol.for("mcp.completable");(function(t){t.Completable="McpCompletable"})(mM||(mM={}))});var _M=w(()=>{});function wY(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"),!bY.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 $Y(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 LI(t){let e=wY(t);return $Y(t,e.warnings),e.isValid}var bY,bM=w(()=>{bY=/^[A-Za-z0-9._-]{1,128}$/});var qy,wM=w(()=>{qy=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 UI=w(()=>{xg();xg()});function kY(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 SY(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 SM(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function xM(t){return"_def"in t||"_zod"in t||SM(t)}function MI(t){return typeof t!="object"||t===null||xM(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(SM)}function $M(t){if(t){if(MI(t))return hs(t);if(!xM(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function IY(t){let e=no(t);return e?Object.entries(e).map(([r,i])=>{let n=OC(i),o=PC(i);return{name:r,description:n,required:!o}}):[]}function wo(t){let r=no(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=rc(r);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function kM(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var Vy,xY,Gd,IM=w(()=>{hM();Gu();DS();gc();vM();_M();bM();wM();UI();Vy=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 Zy(e,r),this._maxToolInputElements=SY(r?.maxToolInputElements)}get experimental(){return this._experimental||(this._experimental={tasks:new qy(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(wo(Vg)),this.server.assertCanSetRequestHandler(wo(hc)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Vg,()=>({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=tc(r.inputSchema);return n?zS(n,{strictUnions:!0,pipeStrategy:"input"}):xY})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let n=tc(r.outputSchema);n&&(i.outputSchema=zS(n,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(hc,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&&kY(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=tc(e.inputSchema)??e.inputSchema,s=await Wm(o,r??{});if(!s.success){let a="error"in s?s.error:"Unknown error",c=Km(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=tc(e.outputSchema),o=await Wm(n,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=Km(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(wo(Hg)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Hg,async e=>{switch(e.params.ref.type){case"ref/prompt":return kD(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return SD(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 Gd;let o=no(i.argsSchema)?.[e.params.argument.name];if(!DI(o))return Gd;let s=yM(o);if(!s)return Gd;let a=await s(e.params.argument.value,e.params.context);return kM(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 Gd;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 Gd;let o=await n(e.params.argument.value,e.params.context);return kM(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(wo(Ug)),this.server.assertCanSetRequestHandler(wo(Mg)),this.server.assertCanSetRequestHandler(wo(Fg)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Ug,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(Mg,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,i])=>({name:r,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(Fg,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(wo(Zg)),this.server.assertCanSetRequestHandler(wo(qg)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Zg,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?IY(r.argsSchema):void 0}))})),this.server.setRequestHandler(qg,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=tc(i.argsSchema),o=await Wm(n,e.params.arguments??{});if(!o.success){let c="error"in o?o.error:"Unknown error",l=Km(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:hs(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=hs(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 vs?c._def?.innerType:c;return DI(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,i,n,o,s,a,c,l){LI(e);let u={title:r,description:i,inputSchema:$M(n),outputSchema:$M(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"&&LI(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=hs(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=hs(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(MI(c))n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!MI(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()}},xY={type:"object",properties:{}};Gd={completion:{values:[],hasMore:!1}}});function TY(t){return mD.parse(JSON.parse(t))}function EM(t){return JSON.stringify(t)+`
132
+ `}var EY,By,TM=w(()=>{gc();EY=10*1024*1024,By=class{constructor(e){this._maxBufferSize=e?.maxBufferSize??EY}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),TY(r)}clear(){this._buffer=void 0}}});import OM from"node:process";var Hy,PM=w(()=>{TM();Hy=class{constructor(e=OM.stdin,r=OM.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 By({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=EM(e);this._stdout.write(i)?r():this._stdout.once("drain",r)})}}});var Ky={};Jr(Ky,{mcp:()=>NY,proposalText:()=>jM,statusText:()=>CY});import{spawnSync as OY}from"node:child_process";import{existsSync as Rs,readdirSync as PY,readFileSync as Wy}from"node:fs";import{join as ai,relative as AY,resolve as AM}from"node:path";import{fileURLToPath as RY}from"node:url";function Ln(t){if(t)return AM(t);let e=process.cwd();if(Rs(ai(e,".codesignflo","config.json")))return e;let r=(n,o)=>{if(o<0)return null;for(let s of PY(n,{withFileTypes:!0})){if(!s.isDirectory()||s.name==="node_modules"||s.name.startsWith("."))continue;let a=ai(n,s.name);if(Rs(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=OY(process.execPath,[jY,...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 jM(t,e){let r=xt(RM(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=Rs(n)?JSON.parse(Wy(n,"utf8")):{components:{}},s=p=>AY(t,p),a=e.startsWith("pages.");if(r.state==="design_new"){let p=ai(i,"design.png");return{text:$w({component:e,by:r.claim.by,...r.claim.note?{note:r.claim.note}:{},page:a,design:Rs(p)?`${s(p)} (picture, attached) and ${s(ai(i,"spec.json"))}`:s(ai(i,"spec.json")),pageFiles:Object.values(o.screens??{})[0]?.files??[]}),...Rs(p)?{image:Wy(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(!Rs(c))return{text:`The changes for ${e} aren't computed yet: call sync first.`};let{changes:l,content:u}=JSON.parse(Wy(c,"utf8")),d=o.components[e]??o.screens?.[e];return{text:ww({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 CY(t){let e=[...xt(RM(t)).values()],r=[kw(e),...Sw(e),...Ow(e)],i=ai(t,".codesignflo","STATUS.md");return Rs(i)&&r.push("",Wy(i,"utf8")),r.join(`
135
+ `)}async function NY(){let t=new Vy({name:"codesignflo",version:cf},{instructions:zY}),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(AM(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 join when they sign in (designers from the Figma plugin).",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:jM(Ln(),n).text}}]}));let r=new Hy,i=new Promise(n=>{r.onclose=()=>n(0),process.stdin.on("end",()=>n(0))});return await t.connect(r),i}var jY,zY,RM,Un,Gy=w(()=>{"use strict";Pr();IM();PM();UI();sr();Yy();jY=RY(new URL("./main.js",import.meta.url)),zY="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- 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 `invite` the designer by email if they aren't in yet (`people` shows who is).\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.";RM=t=>Ct(),Un=t=>({content:[{type:"text",text:t}]})});Xy();Yy();import{randomBytes as GM}from"node:crypto";import{chmodSync as JM,copyFileSync as XM,existsSync as YI,mkdirSync as QI,readFileSync as YM,writeFileSync as QM}from"node:fs";import{createServer as e4}from"node:http";import{homedir as ev}from"node:os";import{dirname as t4,join as tv}from"node:path";import{createInterface as r4}from"node:readline/promises";import{WebSocketServer as n4}from"ws";var Cc=cf,lf="0.1.0",uf=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??tv(ev(),".codesignflo","paired.json");let r=tv(ev(),".codesignloop","paired.json");!e.secretsFile&&!YI(this.secretsFile)&&YI(r)&&(QI(tv(ev(),".codesignflo"),{recursive:!0}),XM(r,this.secretsFile))}log(e){(this.opts.log??(r=>console.error(r)))(e)}secrets(){try{return JSON.parse(YM(this.secretsFile,"utf8"))}catch{return[]}}issueSecret(){let e=GM(24).toString("hex");return QI(t4(this.secretsFile),{recursive:!0}),QM(this.secretsFile,JSON.stringify([...this.secrets(),e])),JM(this.secretsFile,384),e}async listen(){this.wss=new n4({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=e4((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 af,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(!JI(s.plugin.version,lf))return this.reject(e,"plugin_too_old",`plugin ${s.plugin.version} is older than ${lf}`);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:Cc},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??i4)(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 GI(r))e.send(i)}};async function i4(t){let e=r4({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 oz(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([xw(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 a9}from"node:child_process";import{existsSync as Ii,readdirSync as c9,readFileSync as Tu,writeFileSync as Ua}from"node:fs";import{dirname as jm,join as Ot,relative as rk,resolve as l9}from"node:path";function u9(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(iu).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 sz(t){let e=t.find(O=>!O.startsWith("--"));if(!e)throw new Error("usage: codesignflo deliver <component> [--track]");let r=Yt(),i=JSON.parse(Tu(l9(r.registry??".codesignflo/registry.json"),"utf8")),n=xt(Ct()).get(e);if(n?.state==="design_new"&&n.claim)return e.startsWith("pages.")?p9(e,n,i):f9(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(Tu(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 d9(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])=>`${ga(Object.entries(X).map(([le,$e])=>`${le}=${$e}`).join(","))} = story "${O}"`).join("; "),f=u9({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}=nk(f,u.map(O=>`Edit(${O})`));Ua(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 E=m.changes.filter(O=>O.status==="applied").map(O=>O.id);if(!E.length)return console.log("nothing applied; nothing committed"),1;let k=`CoDesignFlo: ${e} claim=${a.claim.id} items=${E.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 I=jr("git",["rev-parse","HEAD"],{encoding:"utf8"}).trim();return Ua(Ot(c,`delivered-${I.slice(0,8)}.json`),`${JSON.stringify({commit:I,changes:l},null,2)}
167
+ `),En([{id:`delivered_${a.claim.id}_${I.slice(0,8)}`,at:new Date().toISOString(),by:"cli",component:e,kind:"delivered",claim:a.claim.id,mode:"patch",ref:I}]),console.log(`committed ${I.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 d9(t,e,r,i,n){Ua(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(iu).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 Ua(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 ${rk(process.cwd(),Ot(i,"HANDOFF.md"))})`),0}function az(t){let r=Yt().tokens??"tokens/tokens.json",i=Tu(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([...Tu(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 nk(t,e){let r=()=>new Set(jr("git",["status","--porcelain","--untracked-files=all"],{encoding:"utf8"}).split(`
187
+ `).filter(Boolean)),i=r(),n=a9("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 f9(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=>jm(jm(k.files?.[0]??""))),s=[...new Set(o)].sort((k,I)=>o.filter(O=>O===I).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=ou(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,I)=>(I[1].files?.length??0)-(k[1].files?.length??0))[0],u=jm(l[1].files[0]),d=k=>rk(process.cwd(),k),p=az(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}=nk(f,[`${c}/**`,...p.files].flatMap(k=>[`Edit(${k})`,`Write(${k})`]));Ua(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(I=>k===`${y}${I}`)&&!/(^|\/)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 E=jr("git",["rev-parse","HEAD"],{encoding:"utf8"}).trim();return En([{id:`delivered_${i.id}_${E.slice(0,8)}`,at:new Date().toISOString(),by:"cli",component:t,kind:"delivered",claim:i.id,mode:"patch",ref:E}]),console.log(`committed ${E.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 p9(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]?jm(s[0]):"src/pages",c=Ii(a)?c9(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=Pw(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=>rk(process.cwd(),de),m=Math.round(Number(JSON.parse(Tu(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=az(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(),E=Yt().tokens??"tokens/tokens.json",k=[`${f}.*`,l,...u?[u]:[],E,...y.files],{report:I,touched:O}=nk(v,k.flatMap(de=>[`Edit(${de})`,`Write(${de})`]));Ua(Ot(n,"report.json"),`${JSON.stringify(I,null,2)}
239
+ `),console.log(`Claude Code finished in ${Math.round((Date.now()-b)/1e3)} s:`);for(let de of I.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,E,...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||!I.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 F9,readFileSync as Z9,writeFileSync as Uz}from"node:fs";import{join as gk,resolve as q9}from"node:path";async function Yn(t,e){let r=new uf({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 C9}from"node:child_process";import{existsSync as pk,mkdirSync as N9,readFileSync as hk,writeFileSync as Au}from"node:fs";import{join as Tn,relative as Cz,resolve as Nz}from"node:path";import{execFileSync as Ou}from"node:child_process";var Yi=t=>Ou("git",t,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();function zm(){try{return Yi(["rev-parse","HEAD"])}catch{return"uncommitted"}}function Pu(){try{return Yi(["rev-parse","--abbrev-ref","HEAD"])}catch{return null}}function cz(t){let e;try{let r=t&&t!=="uncommitted"?[`${t}..HEAD`]:["HEAD"];e=Yi(["log","--format=%H%x1f%B%x1e",...r])}catch{return[]}return h9(e)}function h9(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 lz(){try{return Yi(["status","--porcelain","--",".",":(exclude).codesignflo",":(exclude).codesignloop"]).split(`
243
+ `).filter(Boolean).map(t=>t.replace(/^[ MADRCU?!T]{1,2} /,""))}catch{return[]}}var m9=[/\.(md|txt|rst|log)$/i,/(^|\/)(docs?|scripts|e2e|\.github|\.vscode|\.idea)\//,/\.(test|spec)\.[cm]?[jt]sx?$/,/(^|\/)(__tests__|__mocks__)\//];function uz(t,e=[]){return m9.some(r=>r.test(t))?!1:!e.some(r=>new RegExp(`^${r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*\/?/g,"\xA7").replace(/\*/g,"[^/]*").replace(/§/g,".*")}$`).test(t))}function Cm(){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 Pu()}}function dz(t){try{Ou("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 fz(t,e){try{return Ou("git",["merge-base","--is-ancestor",e,t],{stdio:"ignore"}),!0}catch(r){return r.status===1?!1:null}}function pz(t,e){try{return Number(Yi(["rev-list","--count",`${t}..${e}`]))}catch{return null}}function hz(t){try{return Ou("git",["diff","--quiet",t,"HEAD","--",".",":(exclude).codesignflo"],{stdio:"ignore"}),!1}catch(e){return e.status===1?!0:null}}function mz(t,e,r){if(!r.length)return null;try{return Ou("git",["diff","--quiet",t,e,"--",...r],{stdio:"ignore"}),!0}catch(i){return i.status===1?!1:null}}sr();Pr();import{createReadStream as b9,existsSync as $z,readFileSync as w9,statSync as $9}from"node:fs";import{createServer as k9}from"node:http";import{extname as S9,join as ok}from"node:path";import{chromium as x9}from"playwright";function gz(){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]}},E=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]}},I=(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(),Jd=S=>({x:m(S.left-Fn.left),y:m(S.top-Fn.top)}),Xd=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:I(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:Jd(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:I(S,"text"),type:"TEXT",text:oe}}let G={...ie,type:"FRAME"},Gr=b(S);Gr&&(S===e||Gr!==E)&&(G.component={module:Gr,classes:Array.from(S.classList).map(oe=>/-module__([\w-]+)$/.exec(oe)?.[1]).filter(oe=>!!oe).sort()});let Kt=T.display,$o=Kt==="flex"||Kt==="inline-flex",js=!1,ko=$o&&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}:{}},js=!0}}else G.layout={direction:ko?"HORIZONTAL":"VERTICAL",gap:v(g(ko?T.columnGap:T.rowGap),f(d(S,"gap"))??f(d(S,ko?"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:$o?de(T.alignItems):"STRETCH",justify:$o?pt(T.justifyContent):"MIN",...ko&&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 Yd=Ht(T.backgroundImage,d(S,"background")||d(S,"background-image"));Yd&&(G.gradient=Yd);let Qd=oe=>T.getPropertyValue(`border-${oe.toLowerCase()}-style`)==="none"?0:g(T.getPropertyValue(`border-${oe.toLowerCase()}-width`)),ef=[Qd("Top"),Qd("Right"),Qd("Bottom"),Qd("Left")],Ni=Math.max(...ef);if(Ni>0){let nt=["Top","Right","Bottom","Left"][ef.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,...ef.some(ui=>ui!==Ni)?{sides:ef}:{},...kt?{dash:kt}:{}}}let ZI=g(T.borderTopLeftRadius);ZI>0&&(G.radius=v(Math.min(ZI,9999),f(d(S,"border-radius"))));let qI=parseFloat(T.opacity);qI<1&&(G.opacity=qI),(T.overflow==="hidden"||T.overflowX==="hidden")&&(G.clip=!0),T.boxShadow!=="none"&&(G.shadow=T.boxShadow);let zs=S.tagName;if(zs==="INPUT"||zs==="TEXTAREA"||zs==="SELECT"){let oe=S,nt=(oe.getAttribute("type")??"text").toLowerCase(),Ze=zs==="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 DM of Array.from(document.styleSheets)){let KI;try{KI=DM.cssRules}catch{continue}for(let nf of Array.from(KI)){if(!(nf instanceof CSSStyleRule)||!nf.selectorText.includes("::placeholder"))continue;let LM=nf.selectorText.replace(/::placeholder/g,"");try{S.matches(LM)&&(yn=f(nf.style.getPropertyValue("color"))??yn)}catch{}}}let Jy=y(T.color),rf=y(fi.color)??Je.color.value;Je.color=v(rf,yn??(rf===Jy?f(p(S,"color")):void 0))}G.layout&&zs!=="TEXTAREA"&&(G.layout.justify="CENTER");let kt=De(S,T),ui=Je.lineHeight||Y(S)||g(T.fontSize)*1.2,di=zs==="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",VI=G.layout&&G.layout.direction!=="GRID",tf=!$o,BI=0,HI=(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=Xd(nt);if(!VI||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}`));tf&&li&&(fi=Math.max(0,fi-BI)),fi>0&&(ci.length||!tf)&&ci.push(HI(ut.name,fi,h(nt,"margin",ui,`margin-${Je}`),!0)),ci.push(ut),yn>0&&(oe!==Ee[Ee.length-1]||!tf)&&ci.push(HI(ut.name,yn,h(nt,"margin",di,`margin-${kt}`),!1)),BI=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(rf=>Math.round(rf.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),Jy=kt.lineHeight?m(Je.size*kt.lineHeight):m(di.height);ci.push({name:Ze,type:"TEXT",width:yn,height:Jy,sizing:{w:ui?"fill":"hug",h:"hug"},text:kt,at:Jd(di)})}if(js)for(let oe of ci)!oe.absolute&&oe.sizing.w!=="fixed"&&(oe.sizing={...oe.sizing,w:"fixed"});if(ci.length&&(G.children=ci),tf&&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 WI=Ee.filter(oe=>!["absolute","fixed"].includes(getComputedStyle(oe).position)),NM=G.layout?.direction===(li?"VERTICAL":"HORIZONTAL");if(VI&&WI.length&&G.layout&&NM){let oe=li?[3,1]:[0,2];for(let nt of oe){let Ze=["top","right","bottom","left"][nt],ut=Math.min(...WI.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 Xd(e)}Pr();import{readdirSync as g9,readFileSync as y9}from"node:fs";import{basename as _z,dirname as v9,join as ik}from"node:path";var yz=Hh,bz=t=>/^(pages|screens)(\/|$)/i.test(t),_9=(t,e)=>bz(t)||e==="fullscreen";function vz(t,e,r){let i=e.replace(/^\.\//,""),n=v9(i),o=r??_z(i).replace(/\.stories\.[jt]sx?$/,"");return g9(ik(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=>ik(n,s)).sort()}async function wz(t,e,r){let i=JSON.parse(y9(ik(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=yz(c),p=vz(r,l[0].importPath);if(_9(c,u.parameters?.layout)){bz(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 I=k.id.split("--")[1]??"",O=vz(r,k.importPath,I.split("-")[0]),X=l.length===1&&d!=="pages";a.screens[X?d:yz(`${c}/${I}`).replace(/\.default$/,"")]={story:k.id,title:c,files:O.length?O:p}}continue}let f=u.argTypes,h=k=>{let I=f[k]?.type?.name;return I==="boolean"?"bool":I==="enum"||(f[k]?.options?.length??0)>0?"enum":I==="other"||l.some(O=>n[O.id]?.args[k]==="__node__")?"slot":null},m=(k,I)=>{let O=f[k]?.table?.defaultValue?.summary?.replace(/^["'`]|["'`]$/g,"");if(O&&O!=="undefined")return O;let X=I?.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,I,O,X)=>O==="slot"?String(k[I]==="__node__"):O==="bool"?String(k[I]===!0):k[I]===void 0||k[I]===""?m(I,X):String(k[I]),v=[...new Set(l.flatMap(k=>[...Object.keys(n[k.id]?.args??{}),...Object.keys(f)]))].sort().filter(k=>{let I=h(k);return I!==null&&new Set(l.map(O=>g(n[O.id]?.args??{},k,I,O.id))).size>1}),b={module:_z(p.find(k=>/\.[jt]sx?$/.test(k))??c).replace(/\.[jt]sx?$/,""),title:c,files:p,stories:{}},E=new Map;for(let k of l){let I=n[k.id]?.args??{},O=Object.fromEntries(v.map($e=>[$e,g(I,$e,h($e),k.id)])),X=JSON.stringify(O),le=E.get(X);if(le){b.examples={...b.examples??{},[k.id]:le};continue}E.set(X,k.id),b.stories[k.id]=v.length?O:{story:k.id.split("--")[1]??"default"}}a.components[d]=b}return a}var I9={".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"},kz=null,Sz=()=>kz;async function sk(t,e){if(!$z(ok(t,"index.json")))throw new Error(`no Storybook build in ${t} (expected index.json)`);let r=k9((o,s)=>{let a=ok(t,decodeURIComponent(new URL(o.url??"/","http://x").pathname));if(!$z(a)||$9(a).isDirectory())return void s.writeHead(404).end();s.writeHead(200,{"content-type":I9[S9(a)]??"application/octet-stream"}),b9(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 x9.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{kz={os:`${process.platform}-${process.arch}`,browser:`chromium ${n.version()}`,node:process.versions.node.split(".")[0]};let o=await n.newPage({viewport:{width:1200,height:900},deviceScaleFactor:1,reducedMotion:"reduce",locale:"en-US",timezoneId:"UTC"});return await o.clock.setFixedTime(new Date("2026-01-01T12:00:00Z")),await o.addInitScript(()=>{globalThis.__name=c=>c;let a=42;Math.random=()=>(a=a*16807%2147483647,(a-1)/2147483646)}),await e(o,async a=>{await o.goto(`${i}/iframe.html?id=${a}&viewMode=story`),await o.waitForSelector("#storybook-root > *"),await o.waitForFunction(()=>{let c=globalThis.__STORYBOOK_PREVIEW__?.currentRender;return!c?.phase||["completed","played","errored","aborted","finished"].includes(c.phase)},void 0,{timeout:2e4}).catch(()=>{}),await o.evaluate(()=>new Promise(c=>{let l=setTimeout(p,250),u=setTimeout(p,4e3),d=new MutationObserver(()=>{clearTimeout(l),l=setTimeout(p,250)});d.observe(document.body,{subtree:!0,childList:!0,attributes:!0,characterData:!0});function p(){d.disconnect(),clearTimeout(l),clearTimeout(u),c()}})),await o.evaluate(()=>document.fonts.ready.then(()=>{})),await o.evaluate(()=>Promise.all(Array.from(document.images).map(c=>c.complete?null:new Promise(l=>{c.addEventListener("load",l),c.addEventListener("error",l)}))))})}finally{await n.close(),r.close()}}async function Nm(t,e,r={}){return sk(t,async(i,n)=>{let o=JSON.parse(w9(ok(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 wz(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()){let h=p.get(f);await i.setViewportSize(h?{width:Math.round(h.w),height:Math.round(h.h)}:{width:1200,height:900}),await n(f);let m=await i.evaluate(gz);d(m),l.set(f,{story:f,root:m})}return{registry:a,irs:l,images:u}})}Pr();import{existsSync as uk,mkdirSync as A9,readFileSync as Oz,rmSync as Ez,writeFileSync as Tz}from"node:fs";import{homedir as R9}from"node:os";import{join as Lm}from"node:path";sr();Pr();sr();import{mkdirSync as E9,readFileSync as T9,writeFileSync as O9}from"node:fs";import{join as xz,resolve as P9}from"node:path";async function ak(t){let e=ds();if(!e)return{lines:[],checks:[]};let r=Yt(),i=JSON.parse(T9(P9(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=xz(gt(),"proposals",u.component,u.claim_id);E9(O,{recursive:!0}),O9(xz(O,"spec.json"),Bn(uv(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 Eu(u.component,d.claim.baselineGen):null),f=(d.lastGen?await Eu(u.component,d.lastGen):null)??p;if(!p||!f)continue;let h=t?.get(u.component),m=h?nu(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:E}=ru({base:Qo(p,g),ours:Ns(Qo(u.payload.copy,g),n),theirs:g,dtcg:i,...u.payload.scopes?{scopes:u.payload.scopes}:{},designWins:y});Dm(u.component,u.claim_id,v,b,E);let k=y?0:v.summary.conflict,I=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+I+k,conflicts:k,exact:m?.exact??!0}),c.push(`${u.component}: ${b.length} change(s) to implement`)}return{lines:c,checks:l}}async function ck(){return(await ak()).lines}async function Iz(){let t=await ck();return console.log(t.length?t.join(`
247
+ `):"no proposals waiting"),0}async function dk(t){let{data:e}=await t.client.from("projects").select("settings").eq("id",t.projectId).single();return e?.settings?.liveBranch??Cm()??"main"}async function Pz(t){let e=await dk(t),r=Pu(),i=zm();if(r!==e)return{kind:"check",liveBranch:e,branch:r,commit:i,why:`Live follows ${e}`};let n=(In()??{}).liveIgnore??[],o=lz().filter(s=>uz(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 Az(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||hz(i)===!1:!1}async function Rz(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 ak(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 j9(t,d.id);for(let y of await fk(t,e.liveBranch))console.log(y);return 0}async function j9(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 Bh(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 fk(t,e,r=!1){let i=e??await dk(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=dz(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?pz(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(...Bh(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||(fz(a,d.commit)||mz(d.commit,a,z9(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 z9(t){let e=Lm(gt(),"registry.json");if(!uk(e))return[];let r=JSON.parse(Oz(e,"utf8"));return r.components?.[t]?.files??r.screens?.[t]?.files??[]}var lk=()=>Lm(R9(),".codesignflo","locks");async function jz(t,e){A9(lk(),{recursive:!0});let r=Lm(lk(),`${t}.lock`),i=Lm(lk(),`${t}.again`);if(uk(r)){let n=Number(Oz(r,"utf8")),o=!1;try{process.kill(n,0),o=!0}catch{}if(o)return Tz(i,"1"),!1}Tz(r,String(process.pid));try{do Ez(i,{force:!0}),await e();while(uk(i))}finally{Ez(r,{force:!0})}return!0}async function zz(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 dk(e)}${r?"":" (change it: codesignflo live-branch <name>)"}`),0}var D9=()=>Tn(gt(),"state.json"),mk={ledger:()=>Ct(),append:t=>En(t),generation:Eu,saveGeneration:nz,delta:(t,e,r,i,n)=>Cz(process.cwd(),Dm(t,e,r,i,n)),newDesign:async(t,e,r,i)=>{let n=Tn(gt(),"proposals",t,e);return N9(n,{recursive:!0}),Au(Tn(n,"spec.json"),Bn(r)),Au(Tn(n,"design.png"),Buffer.from(await i(),"base64")),Cz(process.cwd(),n)}};function L9(){let t=[];for(let e of cz(void 0)){let r=Tn(gt(),"proposals",e.component,e.claim),i=Tn(r,`delivered-${e.commit.slice(0,8)}.json`),n=pk(i)?i:Tn(r,"delivered-track.json");if(!pk(n))continue;let{changes:o}=JSON.parse(hk(n,"utf8")),s=pk(Tn(r,"report.json"))?JSON.parse(hk(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 U9(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 Lz(t=[]){let e=ds();if(t.includes("--from-hook")){if(!e)return 0;let r=0;return await jz(e.projectId,async()=>{r=await Dz(t,e)}),r}return Dz(t,e)}async function Dz(t,e){let r=Yt(),i=e&&!t.includes("--local")?await Pz(e):null;if(e&&i&&t.includes("--from-hook")){if(i.kind!=="live"||await Az(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(hk(Nz(r.tokens??"tokens/tokens.json"),"utf8")),o=r.storybook??{};t.includes("--no-build")||(console.error(`building Storybook (${o.build??"pnpm build-storybook"})\u2026`),C9(o.build??"pnpm build-storybook",{stdio:"ignore",env:{...process.env,STORYBOOK_DISABLE_TELEMETRY:"1"}})),console.error("reading Storybook\u2026");let s=e?await U9(e):{},{registry:a,irs:c,images:l}=await Nm(Nz(o.out??"storybook-static"),process.cwd(),s),u=a;Au(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=ov(u,c,p),h=sv({...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=zm(),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:L9(),...v?{only:v}:{}};if(e&&i)return Rz(e,i,b,[...f,...h.map(O=>O.spec)],l.size,a,Sz(),!t.includes("--from-hook"));let E=r.trackedBranch,k=Pu();if(E&&k&&k!==E&&!t.includes("--allow-branch"))return console.error(`Live mirrors "${E}", and you are on "${k}". Deliver works on any branch; run sync on ${E} after merging (it verifies delivered changes there). To update Live from this branch anyway: codesignflo sync --allow-branch`),1;let I;return await Yn({projectId:r.projectId},async O=>{let X=await bw(O,mk,{...b,images:Object.fromEntries(l)},le=>console.log(le));I=X.states;for(let le of X.notes)console.log(`! ${le}`)}),I&&Au(Tn(gt(),"STATUS.md"),M9(I,u)),Au(D9(),`${JSON.stringify({lastSyncCommit:m},null,2)}
250
+ `),0}function M9(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 Dm(t,e,r,i,n){let o=gk(gt(),"proposals",t,e);return F9(o,{recursive:!0}),Uz(gk(o,"delta.json"),`${JSON.stringify(r,null,2)}
259
+ `),Uz(gk(o,"changes.json"),`${JSON.stringify({changes:i,content:n},null,2)}
260
+ `),o}async function Mz(){let t=Yt(),e=await Yn({projectId:t.projectId},r=>Vh(r,mk,JSON.parse(Z9(q9(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 Fz}from"node:fs";async function Zz(){let t=Yt(),e=new URL("../../../plugin/dist/",import.meta.url),r=Fz(new URL("code.js",e),"utf8"),i=Fz(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 H9}from"node:child_process";import{chmodSync as W9,existsSync as Wz,mkdirSync as Bz,readFileSync as Kz,rmSync as K9,writeFileSync as Gz}from"node:fs";import{homedir as Jz}from"node:os";import{dirname as G9,join as Ru,resolve as J9}from"node:path";import{fileURLToPath as X9}from"node:url";sr();Da();Da();import{spawn as V9}from"node:child_process";var B9=t=>new Promise(e=>setTimeout(e,t));async function Um(t){let e=Na(),r=X$(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")||V9(process.platform==="darwin"?"open":"xdg-open",[c],{stdio:"ignore",detached:!0}).unref();for(let l=0;l<6e5;l+=2e3){await B9(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 Iu(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 qz(){let{user:t}=await an();return console.log(t.email??t.id),0}async function Vz(t){if(!Pm())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 Hj(),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 Xz="# >>> codesignflo: update Live on commits to the Live branch",Yz="# <<< codesignflo",Qz=["post-commit","post-merge"],Hz=t=>H9("git",t,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim(),Ma=t=>`'${t.replace(/'/g,"'\\''")}'`;function eC(){let t=X9(new URL("../main.js",import.meta.url));return t.includes("/_npx/")||t.includes("/node_modules/@orkestralai/")?`${Ma(Ru(G9(process.execPath),"npx"))} -y @orkestralai/codesignflo@${Cc}`:`${Ma(process.execPath)} ${Ma(t)}`}function Y9(t,e){let r=Ru(Jz(),".codesignflo","logs",`${e}.log`);return`${Xz} (remove: codesignflo hook remove)
263
+ ( cd ${Ma(t)} && nohup ${eC()} sync --from-hook >> ${Ma(r)} 2>&1 & ) >/dev/null 2>&1
264
+ ${Yz}
265
+ `}function tC(){let t="";try{t=Hz(["config","--get","core.hooksPath"])}catch{}return t?{dir:null,managedBy:t}:{dir:J9(Hz(["rev-parse","--git-path","hooks"]))}}var rC=t=>t.replace(new RegExp(`${Xz}[\\s\\S]*?${Yz}\\n?`,"g"),"");function yk(){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}=tC(),i=`${eC()} 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 ${Ma(process.cwd())} && nohup ${i} >/dev/null 2>&1 &)`};Bz(e,{recursive:!0}),Bz(Ru(Jz(),".codesignflo","logs"),{recursive:!0});for(let n of Qz){let o=Ru(e,n),s=Wz(o)?rC(Kz(o,"utf8")):`#!/bin/sh
267
+ `;Gz(o,`${s.endsWith(`
268
+ `)?s:`${s}
269
+ `}${Y9(process.cwd(),t.projectId)}`),W9(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 Q9(){let{dir:t}=tC();if(!t)return"nothing to remove (hooks are managed by the repo's hook tool)";let e=0;for(let r of Qz){let i=Ru(t,r);if(!Wz(i))continue;let n=Kz(i,"utf8"),o=rC(n);o!==n&&(o.trim()==="#!/bin/sh"?K9(i):Gz(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 nC(t){if(t[0]==="remove")return console.log(Q9()),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");J$(o.service),Iu(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 Pm()||(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 Um([]));process.env.CODESIGNFLO_SERVICE_URL&&process.env.CODESIGNFLO_SERVICE_ANON&&J$(Na());let i=yk();return console.log(i.message),i.ok?0:2}Pr();import{execFileSync as oC}from"node:child_process";import{randomBytes as aW}from"node:crypto";import{existsSync as ju,readdirSync as cW,readFileSync as _k}from"node:fs";import{createRequire as lW}from"node:module";import{dirname as uW,join as sC}from"node:path";import{chromium as dW}from"playwright";sr();Da();import{execFileSync as eW}from"node:child_process";import{cpSync as tW,existsSync as rW,mkdirSync as nW,readdirSync as iW}from"node:fs";import{join as Mm,relative as oW}from"node:path";import{fileURLToPath as sW}from"node:url";var vk=sW(new URL("../skills",import.meta.url));function iC(t=process.cwd()){let e=t;try{e=eW("git",["rev-parse","--show-toplevel"],{cwd:t,encoding:"utf8"}).trim()}catch{}let r=Mm(e,".claude","skills");nW(r,{recursive:!0});let i=iW(vk).filter(n=>rW(Mm(vk,n,"SKILL.md")));for(let n of i)tW(Mm(vk,n),Mm(r,n),{recursive:!0});return{folder:oW(t,r)||".",skills:i}}async function aC(t=[]){if(t.includes("--skills")){let n=iC();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 mW({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_${aW(6).toString("hex")}`,i=await Yn(e?{projectId:r}:"unset",n=>n.call("init",{projectId:r,minPlugin:lf}));return e||tk({projectId:r,tokens:"tokens/tokens.json"}),pW(),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 fW(t){let{data:e,error:r}=await t.rpc("projects_without_code");if(r)throw new Error(r.message);return e}function pW(){if(ju(dW.executablePath()))return;console.log("installing Chromium for rendering Storybook (once per machine)\u2026");let t=sC(uW(lW(import.meta.url).resolve("playwright/package.json")),"cli.js");oC(process.execPath,[t,"install","chromium"],{stdio:"inherit"})}function hW(){let t=n=>oC("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(_k("package.json","utf8")).name??i}catch{}return{rootCommit:e,folder:r,name:i}}async function mW(t={}){let{client:e,user:r}=await an(),{rootCommit:i,folder:n,name:o}=hW(),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 fW(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 I of d)console.log(` ${I.project_id} ${I.name}`);return console.log("Link this app to one: codesignflo init --cloud --project <id> (or start a new project: --new)"),2}let E=t.project,{error:k}=await e.rpc("link_codebase",{p_project:E,p_root_commit:i,p_folder:n});if(k)throw new Error(k.message);u=E,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:E,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=E,console.log(`created the project "${o}" (${u}) for ${r.email??r.id}`),s&&!s.cloud){let I=Ct();await ez(e,u,I),console.log(`moved the local project to the cloud: ${I.length} history entries uploaded`)}}if(s&&!s.cloud&&s.projectId===u){let E=await iz(e,u);E&&console.log(`uploaded ${E} stored versions of Live (snapshots/; the folder can be deleted after this)`)}tk({...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??Cm()??"main";if(h!==f){let{error:E}=await e.rpc("set_live_branch",{p_project:u,p_branch:h});if(E)throw new Error(E.message)}console.log(`Live follows ${h} (change it: codesignflo live-branch <name>)`),t.hook===!0?console.log(yk().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=Ew(gW(s?.tokens??"tokens/tokens.json"));m.length&&console.log(`
271
+ Missing in this app:
272
+ ${m.map(E=>`- ${E}`).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 E of y??[])v.set(E.component,(v.get(E.component)??0)+(E.kind==="designed_new"?1:-1));let b=Tw({hasFile:!!g?.settings?.file,newDesigns:[...v].filter(([,E])=>E>0).map(([E])=>E),liveBranch:h});return console.log(`
274
+ Next:
275
+ ${b.map(E=>`- ${E}`).join(`
276
+ `)}`),0}function gW(t){let e=ju("package.json")?JSON.parse(_k("package.json","utf8")):{},r=ju(".storybook")||Object.values(e.scripts??{}).some(o=>o.includes("storybook")),i=!1,n=(o,s)=>{if(!(i||s<0||!ju(o)))for(let a of cW(o,{withFileTypes:!0})){if(a.name==="node_modules"||a.name.startsWith("."))continue;let c=sC(o,a.name);if(a.isDirectory())n(c,s-1);else if(/\.stories\.(t|j)sx?$/.test(a.name)){let l=_k(c,"utf8");(/title:\s*["'`](pages|screens)(\/|["'`])/i.test(l)||/layout:\s*["'`]fullscreen/.test(l))&&(i=!0)}}};return n("src",6),{storybook:r,tokens:ju(t)?t:null,pageStories:i}}sr();import{execSync as yW,spawnSync as vW}from"node:child_process";import{resolve as _W}from"node:path";var bW=["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 cC(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 lC(t){let{registry:e,irs:r}=await Nm(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(...cC(c.root,o,s.files))}for(let[o,s]of Object.entries(e.screens)){let a=r.get(s.story);a&&i.push(...cC(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 uC(t){let e=Yt(),r=e.storybook??{},i=()=>yW(r.build??"pnpm build-storybook",{stdio:"ignore",env:{...process.env,STORYBOOK_DISABLE_TELEMETRY:"1"}});t.includes("--no-build")||i();let n=_W(r.out??"storybook-static"),o=await lC(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=[...bW,...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=vW("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 lC(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();Da();function bk(){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 wW=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 dC(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:bk(),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:bk(),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 fC(){let{client:t}=await an(),{data:e,error:r}=await t.rpc("project_people",{p_project:bk()});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)":""}${wW(i)}`);return 0}Pr();sr();async function pC(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(Iw(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 $W}from"node:child_process";import{mkdirSync as hC,readFileSync as kW,rmSync as SW,writeFileSync as mC}from"node:fs";import{join as zu,relative as gC,resolve as xW}from"node:path";import IW from"pixelmatch";import{PNG as Ei}from"pngjs";var Fm=2,wk=.03;function EW(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,E=h.data[v+3]/255;for(let k=0;k<3;k++)m.data[b+k]=Math.round(h.data[v+k]*E+255*(1-E))}return m},s=o(t),a=o(e),c=new Ei({width:i,height:n});IW(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 yC(t){let r=Yt().storybook??{};t.includes("--no-build")||$W(r.build??"pnpm build-storybook",{stdio:"ignore",env:{...process.env,STORYBOOK_DISABLE_TELEMETRY:"1"}});let i=JSON.parse(kW(zu(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=zu(gt(),"verify");SW(c,{recursive:!0,force:!0});let l=[];await sk(xW(r.out??"storybook-static"),async(d,p)=>{let f=async(m,g)=>{await p(m),g&&await d.evaluate(E=>{let k=document.querySelector("[data-cdf-container]")??document.querySelector("#storybook-root");k.style.boxSizing="content-box",k.style.width=`${E}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(E=>{let k=E.getBoundingClientRect();E.style.translate=`${-(k.x%1)}px ${-(k.y%1)}px`;let I=E.getBoundingClientRect(),O=[],X=document.createTreeWalker(E,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-I.x,y:q.y-I.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:E,width:k,height:I,text:O}=await f(y,b?.width),X={component:m,variant:g,story:y,browser:{width:k,height:I},figma:b?{width:b.width,height:b.height}:null,mismatch:null,flagged:!0};if(b){let{mismatch:le,textMismatch:$e,image:q}=EW(E,b,O),Re=zu(c,m,`${g.replace(/[^\w=.-]+/g,"_")}.png`);hC(zu(c,m),{recursive:!0}),mC(Re,Ei.sync.write(q)),X.mismatch=le,X.textMismatch=$e,X.image=gC(process.cwd(),Re),X.flagged=Math.abs(k-b.width)>Fm||Math.abs(I-b.height)>Fm||le>wk}l.push(X)};for(let m of o)for(let[g,y]of Object.entries(i.components[m].stories)){let v=xo(y);await h(m,v,g,`${m}/${v}`)}for(let[m,g]of s)await h(m,"screen",g.story,`screen:${m}`)}),hC(c,{recursive:!0}),mC(zu(c,"report.json"),`${JSON.stringify({at:new Date().toISOString(),thresholds:{sizePx:Fm,mismatch:wk},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 ${Fm} px, under ${wk*100}% pixels outside text). Images: ${gC(process.cwd(),c)}/`),u&&t.includes("--strict")?1:0}sr();var zM={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=>aC(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=>Lz(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=>sz(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(()=>(Gy(),Ky))).statusText(process.cwd()));let e=ds();if(e)for(let r of await fk(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(()=>(Gy(),Ky))).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:()=>Iz()},login:{summary:"sign in to the CoDesignFlo service (opens the browser; nothing typed here) [--no-browser]",run:t=>Um(t)},whoami:{summary:"who you are signed in as",run:()=>qz()},logout:{summary:"revoke this machine's sign-in [--everywhere: every session of the account]",run:t=>Vz(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=>dC(t)},people:{summary:"cloud projects: who is in this app's project",run:()=>fC()},"live-branch":{summary:"cloud projects: which branch updates Live: live-branch [<name>] (developers and admins)",run:t=>zz(t,ds())},hook:{summary:"cloud projects: update Live on every commit to the Live branch (git hook on this machine): hook install | remove",run:t=>nC(t)},ask:{summary:'send a ready proposal back to the designer with a question: ask <component> "<question>"',run:t=>oz(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(()=>(Gy(),Ky))).mcp()},resolve:{summary:`settle a clash between the designer's copy and code changed meanwhile: resolve <component> --design | --code "<why>"`,run:t=>pC(t)},delta:{summary:"show what the designer changed in proposals marked ready for dev (writes .codesignflo/proposals/\u2026)",run:()=>Mz()},verify:{summary:"compare Live with the code, variant by variant (browser vs Figma images) [component\u2026] [--screens] [--strict]",run:t=>yC(t)},name:{summary:"give unnamed elements semantic layer names in code (data-cdf) with Claude Code [--check]",run:t=>uC(t)},"dev:reload":{summary:"(development) hot-swap the running plugin with the current build",run:()=>Zz()},version:{summary:"print the version",run:()=>(console.log(Cc),0)}},[zc="help",...DY]=process.argv.slice(2),CM=zM[zc];if(!CM){console.log(`usage: codesignflo <command>
292
+ `);for(let[t,e]of Object.entries(zM))console.log(` ${t.padEnd(10)} ${e.summary}`);process.exit(zc==="help"?0:1)}var LY=["login","logout","whoami","invite","people","hook","mcp","version","help","init","dev:reload"].includes(zc),FI=1;try{LY||await Yj(),["deliver","ask","resolve","verify","status","proposal"].includes(zc)&&await ck(),FI=await CM.run(DY)}catch(t){console.error(`codesignflo ${zc}: ${t.message}`)}finally{try{await Qj()}catch(t){console.error(`codesignflo ${zc}: ${t.message}`),FI=1}}process.exit(FI);